tcgetsid - Man Page

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

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.

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.

Examples

None.

Application Usage

None.

Rationale

None.

Future Directions

None.

See Also

The Base Definitions volume of POSIX.1-2017, <termios.h>

Referenced By

termios.h(0p).

2017 IEEE/The Open Group POSIX Programmer's Manual