Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getut(3)

ttyname(3)



  ttyslot(3)                          CLIX                          ttyslot(3)



  NAME

    ttyslot - Finds the slot in the utmp file of the current user

  LIBRARY

    Standard C Library (libc.a)

  SYNOPSIS

    int ttyslot(
      void );

  DESCRIPTION

    The ttyslot() function returns the index of the current user's entry in
    the /etc/utmp file.  This is accomplished by actually scanning the file
    /etc/inittab for the name of the terminal associated with stdin, stdout,
    or stderr (0, 1, or 2).

  EXAMPLES

    To find the index of the current user's entry in the /etc/utmp file:

    int me;
    if (me = ttyslot() < 0)
         return(NULL);


  FILES

    /etc/inittab

    /etc/utmp

  RETURN VALUES

    A value of 0 is return if an error is encountered while searching for the
    terminal name or if none of the above file descriptors is associated with
    a terminal device.

  RELATED INFORMATION

    Functions:  getut(3), ttyname(3)










  2/94 - Intergraph Corporation                                              1




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026