⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getttyen.3

📁 操作系统设计与实现源码
💻 3
字号:
.TH GETTTYENT 3.SH NAMEgetttyent, getttynam, setttyent, endttyent \- interface to /etc/ttytab.SH SYNOPSIS.ft B.nf#include <ttyent.h>struct ttyent *getttyent(void)struct ttyent *getttynam(const char *\fIname\fP)int setttyent(void)void endttyent(void).fi.ft P.SH DESCRIPTIONThe.B getttyentfunctions provide an interface to the /etc/ttytab.  (See.BR ttytab (5))..PPTo read one of these files one calls.B getttyent()several times to read the entries in the table until NULL is returned forend-of-file..PP.B Getttyname()searches the.B ttytabfile for the given terminal device.  It is equivalent to a call to.BR setttyent(),several calls to.B getttyent()to locate the entry, and a final.B endttyent()to close the file..PP.B Setttyent()opens or rewinds the ttytab database, and.B endttyent() closes it..B Getttyent()opens the database if not already open, but does not close it..PPThe struct ttyent is defined by <ttyent.h> as follows:.sp.nf.ta +4n +6n +15nstruct ttyent {	char	*ty_name;	/* Name of the terminal device. */	char	*ty_type;	/* Terminal type name (termcap(3)). */	char	**ty_getty;	/* Program to run, normally getty. */	char	**ty_init;	/* Initialization command, normally stty. */};.fi.PPA valid entry has at least two strings, so both.B ty_nameand.B ty_typeare filled in.  The optional.B ty_gettyand.B ty_initmay be NULL (field omitted), point to a pointer that is NULL (null lenghtfield, i.e. ""), or an array of strings terminated by a NULL (fieldpresent).  For now no useful distinction can be made between a omitted fieldand an empty field, so treat both cases as an omission..SH FILES.TP 15.B /etc/ttytabThe terminal device database.SH "SEE ALSO".BR ttyname (3),.BR ttyslot (3),.BR ttytab (5),.BR init (8)..SH DIAGNOSTICS.B Setttyent()has the same return value and error codes as the.BR open (2)call it uses to open the ttytab file.  The.BI get xxx ()functions return NULL on end of file, entry not found, or error.  You canset.B errnoto zero before the call and check it after..SH NOTES.B Getttyent()and.B getttynam()return a pointer to static storage that is overwritten in each call..PPThe Minix.B struct ttyenthas only the.B ty_nameand.B ty_typefields in common with the BSD implementation.  This does not seem to be aproblem, because most third party software that need to know about terminalsonly look at the.B ty_namefield..SH AUTHORKees J. Bot (kjb@cs.vu.nl)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -