tcgetsid man page

Prolog

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

tcgetsid — get the process group ID for the session leader for the controlling terminal

Synopsis

#include <termios.h>

pid_t tcgetsid(int fildes);

Description

The tcgetsid() function shall obtain the process group ID of the session for which the terminal specified by fildes is the controlling terminal.

Return Value

Upon successful completion, tcgetsid() shall return the process group ID of the session associated with the terminal. Otherwise, a value of -1 shall be returned and errno set to indicate the error.

Errors

The tcgetsid() function shall fail if:

EBADF
The fildes argument is not a valid file descriptor.
ENOTTY
The calling process does not have a controlling terminal, or the file is not the controlling terminal.

The following sections are informative.

See Also

The Base Definitions volume of POSIX.1‐2008, <termios.h>

Info

2013 IEEE/The Open Group POSIX Programmer's Manual