GETPPID(3POSIX)

🫢 GETPPID β€” POSIX Programmer's Manual 🫢

okay bestie, before we even start: this page lives inside the POSIX Programmer's Manual. that's its whole home base. but heads up β€” the Linux implementation of this interface may differ (so like, go check the matching Linux manual page for the deets on Linux behavior), or honestly the interface might not even be implemented on Linux at all. vibe check accordingly πŸ’…


✨ NAME ✨

getppid β€” get the parent process ID


🌸 SYNOPSIS 🌸

#include <unistd.h>

pid_t getppid(void);

πŸ’– DESCRIPTION πŸ’–

so the getppid() function shall return the parent process ID of the calling process. that's it. that's the whole thing. she's simple, she's iconic, she does one job and she does it well πŸ‘‘


⭐ RETURN VALUE ⭐

getppid() shall always be successful, and no return value is reserved to indicate an error. like, there is literally no failure state built in here. no error code, no sad path, nothing. slay 🌈


πŸ’€ ERRORS πŸ’€

No errors are defined.

The following sections are informative.


πŸŽ€ EXAMPLES πŸŽ€

None.


πŸ¦‹ APPLICATION USAGE πŸ¦‹

None.


πŸ’œ RATIONALE πŸ’œ

None.


πŸ”₯ FUTURE DIRECTIONS πŸ”₯

None.


πŸ‘‘ SEE ALSO πŸ‘‘

  • exec
  • fork()
  • getpgid()
  • getpgrp()
  • getpid()
  • kill()
  • setpgid()
  • setsid()

The Base Definitions volume of POSIX.1‐2017, <sys_types.h>, <unistd.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. 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 .


ngl bestie, that copyright block is long but she's load-bearing β€” don't skip her πŸ™ˆ

okay that's the whole page!! courtesy of IEEE/The Open Group, 2017, and the manual name on the tin is GETPPID(3POSIX) β€” mwah, go get that parent process ID πŸ«ΆπŸ’–βœ¨