TCGETSID(3P)

πŸ’– PROLOG πŸ’–

okay bestie, before we even get into it β€” this manual page is part of the POSIX Programmer's Manual. and like, heads up: the Linux implementation of this interface may differ (so if you're on Linux, go read the corresponding Linux manual page for the actual tea πŸ«–), or honestly the interface might not even be implemented on Linux at all. no cap.


✨ NAME ✨

tcgetsid β€” get the process group ID for the session leader for the controlling terminal 🌸


πŸŽ€ SYNOPSIS πŸŽ€

#include <termios.h>

pid_t tcgetsid(int fildes);

πŸ’… DESCRIPTION πŸ’…

so what does tcgetsid() actually do, you ask? it 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 whole vibe. it's giving "who's the session leader here" energy πŸ‘‘


πŸ¦‹ RETURN VALUE πŸ¦‹

upon successful completion, tcgetsid() shall return the process group ID of the session associated with the terminal. iconic. πŸ’–

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. bestie that fd is not fd-ing πŸ™ˆ
  • ENOTTY β€” the calling process does not have a controlling terminal, or the file is not the controlling terminal. πŸ’€
the following sections are informative. (translation: they're the bonus content, not the main character rules)

🌈 EXAMPLES 🌈

None. literally none. nothing to see here ✨


πŸ“ APPLICATION USAGE πŸ“

None. still nothing. we're thriving in the void 🫢


πŸ’œ RATIONALE πŸ’œ

None. ngl the rationale is rationa-less 😭


⭐ FUTURE DIRECTIONS ⭐

None. the future is undefined and honestly so is this section πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

the Base Definitions volume of POSIX.1‐2017, <termios.h> 🧚


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 β€” like, the original is the one who gets the final say, periodt. 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!! this one came from IEEE/The Open Group, dated 2017, and it's TCGETSID(3P) β€” go forth and interrogate your controlling terminals, you absolute icon πŸ’…βœ¨

πŸ“¦ where this page comes from