getttyent

Autres langues

Langue: es

Autres versions - même langue

Version: 18 julio 2002 (mandriva - 01/05/08)

Section: 3 (Bibliothèques de fonctions)

NOMBRE

getttyent, getttynam, setttyent, endttyent - obtiene una entrada del fichero de terminales

SINOPSIS

#include <ttyent.h>

struct ttyent *getttyent(void);

struct ttyent *getttynam(const char *name);

int setttyent(void);

int endttyent(void);

DESCRIPCIÓN

Estas funciones proporcionan una interfaz con el fichero _PATH_TTYS (p.e., /etc/ttys).

La función setttyent() abre el fichero o lo rebobina si ya está abierto.

La función endttyent() cierra el fichero.

La función getttynam() busca un nombre de terminal dado en el fichero. Devuelve un puntero a una estructura ttyent (descrita abajo).

La función getttyent() abre el fichero _PATH_TTYS (si es necesario) y devuelve la primera entrada. Si el fichero ya está abierto, devuelve la siguiente entrada.

La estructura ttyent

 struct ttyent {
         char    *ty_name;       /* nombre del dispositivo de terminal */
         char    *ty_getty;      /* orden a ejecutar, normalmente getty */
         char    *ty_type;       /* tipo de terminal para termcap */
         int     ty_status;      /* flags de estado */
         char    *ty_window;     /* orden para incializar el gestor de ventanas */
         char    *ty_comment;    /* campo para comentarios */
 };
 

ty_status puede ser

 #define TTY_ON       0x01   /* permite ingresos (arranca el programa ty_getty) */
 #define TTY_SECURE   0x02   /* permite que el uid 0 ingrese */
 

OBSERVACIONES

Bajo Linux el fichero /etc/ttys, y las funciones descritas arriba no se utilizan.

VÉASE TAMBIÉN

ttyname(3), ttyslot(3)