GETTTYENT

Section: Manuel du programmeur Linux (3)
Updated: 21 juillet 2003
Index


NOM
SYNOPSIS
DESCRIPTION
La structure ttyent
NOTES
VOIR AUSSI
TRADUCTION

NOM

getttyent, getttynam, setttyent, endttyent - lire le fichier des terminaux.

SYNOPSIS


#include <ttyent.h>
struct ttyent *getttyent(void);
struct ttyent *getttynam(const char *nom);
int setttyent(void);
int endttyent(void);

DESCRIPTION

Ces fonctions fournissent une interface pour le fichier _PATH_TTYS (par exemple /etc/ttys).
La fonction setttyent() ouvre le fichier, ou reprend la lecture au début s'il était déjà ouvert.
La fonction endttyent() ferme le fichier.
La fonction getttynam() recherche un nom de terminal dans le fichier. Elle renvoie un pointeur sur une structure ttyent (voir ci-dessous).
La fonction getttyent() ouvre le fichier _PATH_TTYS (si besoin) et renvoie la première entrée. Si le fichier est déjà ouvert, elle renvoie l'entrée suivante.

La structure ttyent

struct ttyent {
        char    *ty_name;       /* nom du terminal */
        char    *ty_getty;      /* commande à exécuter (ex : getty) */
        char    *ty_type;       /* type termcap de terminal */
        int     ty_status;      /* attributs d'état */
        char    *ty_window;     /* commande gestionnaire de fenêtres */
        char    *ty_comment;    /* commentaires */
};
Le champ ty_status peut valoir
#define TTY_ON       0x01   /* autoriser les logins (avec ty_getty) */
#define TTY_SECURE   0x02   /* autoriser login de l'UID zéro */

NOTES

Sous Linux, le fichier /etc/ttys, et les fonctions décrites ci-dessus ne sont pas utilisées.

VOIR AUSSI

ttyname(3), ttyslot(3)

TRADUCTION

Christophe Blaess, 2003.