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

📄 getttyent.3

📁 早期freebsd实现
💻 3
字号:
.\" Copyright (c) 1989, 1991, 1993.\"	The Regents of the University of California.  All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\"    must display the following acknowledgement:.\"	This product includes software developed by the University of.\"	California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\"    may be used to endorse or promote products derived from this software.\"    without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"     @(#)getttyent.3	8.1 (Berkeley) 6/4/93.\".Dd June 4, 1993.Dt GETTTYENT 3.Os BSD 4.3.Sh NAME.Nm getttyent ,.Nm getttynam ,.Nm setttyent ,.Nm endttyent.Nd get ttys file entry.Sh SYNOPSIS.Fd #include <ttyent.h>.Ft struct ttyent *.Fn getttyent.Ft struct ttyent *.Fn getttynam "char *name".Ft int.Fn setttyent void.Ft int.Fn endttyent void.Sh DESCRIPTIONThe.Fn getttyent ,and.Fn getttynamfunctionseach return a pointer to an object, with the following structure,containing the broken-out fields of a line from the tty descriptionfile..Bd -literalstruct ttyent {	char	*ty_name;	/* terminal device name */	char	*ty_getty;	/* command to execute */	char	*ty_type;	/* terminal type */#define	TTY_ON		0x01	/* enable logins */#define	TTY_SECURE	0x02	/* allow uid of 0 to login */	int	ty_status;	/* flag values */	char	*ty_window;	/* command for window manager */	char	*ty_comment;	/* comment field */};.Ed.PpThe fields are as follows:.Bl -tag -width ty_comment.It Fa ty_nameThe name of the character-special file..It Fa ty_gettyThe name of the command invoked by.Xr init 8to initialize tty line characteristics..It Fa ty_typeThe name of the default terminal type connected to this tty line..It Fa ty_statusA mask of bit fields which indicate various actions allowed on thistty line.The possible flags are as follows:.Bl -tag -width TTY_SECURE.It Dv TTY_ONEnables logins (i.e.,.Xr init 8will start the command referenced by.Fa ty_gettyon this entry)..It Dv TTY_SECUREAllow users with a uid of 0 to login on this terminal..El.It Fa ty_windowThe command to execute for a window system associated with the line..It Fa ty_commentAny trailing comment field, with any leading hash marks (``#'') orwhitespace removed..El.PpIf any of the fields pointing to character strings are unspecified,they are returned as null pointers.The field.Fa ty_statuswill be zero if no flag values are specified..PpSee.Xr ttys 5for a more complete discussion of the meaning and usage of thefields..PpThe.Fn getttyentfunctionreads the next line from the ttys file, opening the file if necessary.The.Fn setttyentfunctionrewinds the file if open, or opens the file if it is unopened.The.Fn endttyentfunctioncloses any open files..PpThe.Fn getttynamfunctionsearches from the beginning of the file until a matching.Fa nameis found(or until.Dv EOFis encountered)..Sh RETURN VALUESThe routines.Fn getttyentand.Fn getttynamreturn a null pointer on.Dv EOFor error.The.Fn setttyentfunctionand.Fn endttyentreturn 0 on failure and 1 on success..Sh FILES.Bl -tag -width /etc/ttys -compact.It Pa /etc/ttys.El.Sh SEE ALSO.Xr login 1 ,.Xr ttyslot 3 ,.Xr gettytab 5 ,.Xr termcap 5 ,.Xr ttys 5 ,.Xr getty 8 ,.Xr init 8.Sh HISTORYThe.Fn getttyent ,.Fn getttynam ,.Fn setttyent ,and.Fn endttyentfunctions appeared in.Bx 4.3 ..Sh BUGSThese functions use static data storage;if the data is needed for future use, it should becopied before any subsequent calls overwrite it.

⌨️ 快捷键说明

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