HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
t
tcgetsid(3C) tcgetsid(3C)
NAME
tcgetsid() - get terminal session ID
SYNOPSIS
#include <termios.h>
pid_t tcgetsid (int fildes);
DESCRIPTION
The tcgetsid() function returns the value of the session ID of the foreground process associated with
the terminal referenced by fildes. tcgetsid() is allowed from a process that is a member of a back-
ground process group (see termio(7)).
RETURN VALUE
Upon successful completion, tcgetsid() returns the value of the session ID of the foreground process
associated with the terminal referenced by fildes. Otherwise, tcgetsid() returns a value of −1 and sets
errno to indicate the error.
ERRORS
If the tcgetsid() function fails, it sets errno (see errno(2)) to one of the following values:
[EACCES] The file associated with fildes is the controlling terminal of the calling process; how-
ever, there is no foreground process group defined for the controlling terminal.
[EBADF] fildes is not a valid file descriptor.
[ENOTTY] The file associated with fildes is not the controlling terminal or the calling process
does not have a controlling terminal.
APPLICATION USAGE
tcgetsid() is thread-safe and async-cancel-safe.
SEE ALSO
getsid(2), setsid(2), tcgetpgrp(3C).
HP-UX Release 11i: December 2000 − 1 − Section 3−−973
___
___