*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> getttyent (3)              
Title
Content
Arch
Section
 

getttyent(3)

Contents


NAME    [Toc]    [Back]

       getttyent, getttyent_r, getttynam, getttynam_r, setttyent,
       setttyent_r, endttyent, endttyent_r - Get a  /etc/securettys
 file entry

SYNOPSIS    [Toc]    [Back]

       #include <ttyent.h>

       struct ttyent *getttyent(
               void ); struct ttyent *getttynam(
               const char *name ); int setttyent(
               void ); void endttyent(
               void );

       The following obsolete functions are supported in order to
       maintain backward compatibility with previous versions  of
       the  operating  system.  You  should  not  use them in new
       designs.  int getttyent_r(
               struct ttyent *tte,
               char *buf,
               int len,
               FILE **tty_fp ); int getttynam_r(
               const char *name,
               struct ttyent *tte,
               char *buf,
               int len ); int setttyent_r(
               FILE **tty_fp ); void endttyent_r(
               FILE **tty_fp );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

PARAMETERS    [Toc]    [Back]

       Points to the ttyent structure. The ttyent.h  header  file
       defines  the  ttyent structure.  Specifies the name of the
       requested tty description.  Is data for the  tty.   Specifies
  the  length  of  buf.   Specifies a secure ttys file
       stream.

DESCRIPTION    [Toc]    [Back]

       The getttyent() and getttynam() functions  each  return  a
       pointer to an object that has the following ttyent fields.
       These fields describe a line from the secure tty  description
 file.

       The  members  of the structure include the following: Name
       of the character-special file.  The  string  "none".   The
       string  "none".   A  mask  of  bit fields.  The TTY_SECURE
       option indicates users with a user  ID  of  0  (zero)  are
       allowed to log in on this terminal.  A NULL pointer A NULL
       pointer.

       If any of the fields pointing  to  character  strings  are
       unspecified, they are returned as NULL pointers. The field
       ty_status will be 0 (zero) if root logins are not allowed.

       The  getttyent() function reads the next line from the tty
       file, opening the file if necessary. The setttyent() function
  rewinds the file if open, or opens the file if it is
       unopened. The endttyent() function closes any open  files.

       The  getttynam()  function  searches from the beginning of
       the file until a matching name is found or until EOF (EndOf-File)
 is encountered.

NOTES    [Toc]    [Back]

       The getttyent(), setttyent(), endttyent(), and getttynam()
       functions return a pointer to thread-specific data. Subsequent
  calls to these functions from the same thread overwrite
 this data.

       The getttyent_r(), setttyent_r(), endttyent_r(), and getttynam_r()
  functions  are  obsolete  reentrant versions of
       these functions. They are supported in order  to  maintain
       backward compatibility with previous versions of the operating
 system and should not be used in new  designs.  Note
       that  you  must  initialize  the *tty_fp parameter to NULL
       before its first access by any of these functions.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, the  getttyent()  and  getttynam()
 functions return a pointer to a ttyent structure. If
       they fail  or  reach  the  end  of  the  terminal  control
       database file, they return a null pointer.

       Upon   successful  completion,  the  setttyent()  function
       returns a value of 1. Upon failure, it returns a value  of
       0 (zero).

       Upon  successful completion, the getttyent_r() and getttynam_r()
 functions store the ttyent structure in the  location
  pointed  to  by tte, and return a value of 0 (zero).
       Upon failure, they return a value of -1.

       Upon successful  completion,  the  setttyent_r()  function
       returns  a  value  of 0 (zero). Upon failure, it returns a
       value of -1.

ERRORS    [Toc]    [Back]

       If any of  the  following  conditions  occurs,  the  getttyent_r()
 or getttynam_r() functions set errno to the corresponding
 value: The search failed.

       In addition, if any of the  following  conditions  occurs,
       the  getttyent_r() or setttyent_r() functions set errno to
       the corresponding value: The tty_fp, tte, or buf parameter
       is invalid, or the len parameter is too small.

FILES    [Toc]    [Back]

       /etc/securettys  Contains  the  terminal  control database
       file.

SEE ALSO    [Toc]    [Back]

      
      
       Commands: login(1)

       Files: securettys(4).



                                                     getttyent(3)
[ Back ]
 Similar pages
Name OS Title
rpccp_add_member HP-UX Adds a member to a group in a name service entry; if the specified entry does not exist, creates the entry
rpccp_add_element HP-UX Adds an element to a profile in a name service entry; if the specified entry does not exist, creates the entry
getmntent IRIX get file system descriptor file entry
getfsent FreeBSD get file system descriptor file entry
getfstype OpenBSD get file system descriptor file entry
getfsfile NetBSD get file system descriptor file entry
getfstab FreeBSD get file system descriptor file entry
setfstab FreeBSD get file system descriptor file entry
setfsent FreeBSD get file system descriptor file entry
getfsspec FreeBSD get file system descriptor file entry
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service