Print this page
14249 pseudo-terminal nomenclature should reflect POSIX
Change-Id: Ib4a3cef899ff4c71b09cb0dc6878863c5e8357bc


  21      utempter_remove_record(int fd);
  22 
  23      void
  24      addToUtmp(const char *pty, const char *host, int fd);
  25 
  26      void
  27      removeFromUtmp(void);
  28 
  29      void
  30      removeLineFromUtmp(const char *pty, int fd);
  31 
  32 DESCRIPTION
  33      These functions provide an interface for terminal emulators such as tmux,
  34      screen, and xterm to record user sessions to utmpx(4) database.  Note
  35      that they are best effort and may not succeed.  If consumers need to know
  36      for certain that they have successfully updated the utmpx(4) database,
  37      these functions should not be used because they cannot communicate that
  38      for compatibility reasons.
  39 
  40      The utempter_add_record() and addToUtmp() functions add a login record to
  41      the utmpx(4) database for the TTY belonging to the pseudo-terminal master
  42      file descriptor fd, using the username corresponding with the real user
  43      ID of the calling process and the optional hostname host, limited to 256
  44      characters, that is the size of ut_host member of struct utmpx minus
  45      terminating NUL character.
  46 
  47      The utempter_remove_record() and removeLineFromUtmp() functions mark the
  48      login session as being closed for the TTY belonging to the pseudo-
  49      terminal master file descriptor fd.
  50 
  51      The utempter_remove_added_record() and removeFromUtmp() functions have
  52      the same properties as the previously mentioned functions, except that
  53      they use an internally cached value of the file descriptor passed to
  54      utempter_add_record() and addToUtmp().
  55 
  56      In this implementation, the pty arguments of addToUtmp() and
  57      removeLineFromUtmp() are ignored, and database entries are driven
  58      entirely by the fd argument.
  59 
  60 RETURN VALUES
  61      The utempter_add_record(), utempter_remove_added_record() and
  62      utempter_remove_record() functions always return a value of 0.
  63 
  64 INTERFACE STABILITY
  65      utempter_add_record(), utempter_remove_added_record(), and
  66      utempter_remove_record() are Committed.  addToUtmp(), removeFromUtmp(),
  67      and removeLineFromUtmp() are Obsolete Committed.
  68 
  69 MT-LEVEL
  70      Unsafe
  71 
  72 SEE ALSO
  73      pututxline(3c), utmpx(3head), utmpx(4)
  74 
  75 illumos                           May 5, 2020                          illumos


  21      utempter_remove_record(int fd);
  22 
  23      void
  24      addToUtmp(const char *pty, const char *host, int fd);
  25 
  26      void
  27      removeFromUtmp(void);
  28 
  29      void
  30      removeLineFromUtmp(const char *pty, int fd);
  31 
  32 DESCRIPTION
  33      These functions provide an interface for terminal emulators such as tmux,
  34      screen, and xterm to record user sessions to utmpx(4) database.  Note
  35      that they are best effort and may not succeed.  If consumers need to know
  36      for certain that they have successfully updated the utmpx(4) database,
  37      these functions should not be used because they cannot communicate that
  38      for compatibility reasons.
  39 
  40      The utempter_add_record() and addToUtmp() functions add a login record to
  41      the utmpx(4) database for the TTY belonging to the pseudo-terminal
  42      manager file descriptor fd, using the username corresponding with the
  43      real user ID of the calling process and the optional hostname host,
  44      limited to 256 characters, that is the size of ut_host member of struct
  45      utmpx minus terminating NUL character.
  46 
  47      The utempter_remove_record() and removeLineFromUtmp() functions mark the
  48      login session as being closed for the TTY belonging to the pseudo-
  49      terminal manager file descriptor fd.
  50 
  51      The utempter_remove_added_record() and removeFromUtmp() functions have
  52      the same properties as the previously mentioned functions, except that
  53      they use an internally cached value of the file descriptor passed to
  54      utempter_add_record() and addToUtmp().
  55 
  56      In this implementation, the pty arguments of addToUtmp() and
  57      removeLineFromUtmp() are ignored, and database entries are driven
  58      entirely by the fd argument.
  59 
  60 RETURN VALUES
  61      The utempter_add_record(), utempter_remove_added_record() and
  62      utempter_remove_record() functions always return a value of 0.
  63 
  64 INTERFACE STABILITY
  65      utempter_add_record(), utempter_remove_added_record(), and
  66      utempter_remove_record() are Committed.  addToUtmp(), removeFromUtmp(),
  67      and removeLineFromUtmp() are Obsolete Committed.
  68 
  69 MT-LEVEL
  70      Unsafe
  71 
  72 SEE ALSO
  73      pututxline(3c), utmpx(3head), utmpx(4)
  74 
  75 illumos                        February 5, 2022                        illumos