TCGETSID(3POSIX)
π TCGETSID(3POSIX) π
okay bestie, welcome to the POSIX Programmer's Manual page for tcgetsid, straight out of the 3POSIX section. pull up a chair, grab a boba, we're doing terminal session stuff π«Ά
πΈ PROLOG πΈ
real talk before we even start: this page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface may just not be implemented on Linux at all. not every vibe is universal, iykyk π
β¨ NAME β¨
tcgetsid β get the process group ID for the session leader for the controlling terminal
like... it gets you the process group ID. for the session leader. for the controlling terminal. that's the whole job and she does it flawlessly π
π SYNOPSIS π
#include <termios.h>
pid_t tcgetsid(int fildes);
π¦ DESCRIPTION π¦
so the tcgetsid() function shall obtain the process group ID of the session for which the terminal specified by fildes is the controlling terminal.
that's it. that's the function. she looks at the terminal you handed her and tells you which session's process group is running the show. main character energy, no cap π
π RETURN VALUE π
when it works? tcgetsid() shall return the process group ID of the session associated with the terminal. iconic, love that for us β¨
when it doesn't? a value of -1 shall be returned and errno set to indicate the error. sad girl hours π
π ERRORS π
the tcgetsid() function shall fail if:
EBADFβ thefildesargument is not a valid file descriptor. girl, that's not a real fd, what are you doing πENOTTYβ the calling process does not have a controlling terminal, or the file is not the controlling terminal. so either you're terminal-less or you brought the wrong file to the party π
the following sections are informative.
π EXAMPLES π
None.
(not a single example, she's mysterious like that π§)
πΈ APPLICATION USAGE πΈ
None.
π RATIONALE π
None.
β FUTURE DIRECTIONS β
None.
π₯ SEE ALSO π₯
- The Base Definitions volume of POSIX.1β2017,
<termios.h>
π COPYRIGHT π
okay legal bestie moment, we gotta do this part properly, no skipping:
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie π big mwah to IEEE/The Open Group, who shipped this in 2017 β so if you ever need to cite it, that's your source and your date, periodt π
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms