id_t(3type)
β¨ id_t(3type) β¨
okay so bestie, welcome to id_t(3type) π this is the little page about all the "who even are you" types β the ones that hold every ID the kernel ever asks about. no cap, it's foundational.
π NAME π
pid_t, uid_t, gid_t, id_t β process/user/group identifier π
π LIBRARY π
Standard C library (libc) π«Ά
β¨ SYNOPSIS β¨
#include <sys/types.h>
typedef /* ... */ pid_t;
typedef /* ... */ uid_t;
typedef /* ... */ gid_t;
typedef /* ... */ id_t;
yes bestie, that's literally all you need β one include and boom, four types π (the /* ... */ is real, the actual underlying type is left as a mystery on purpose, so don't come for me)
π DESCRIPTION π
pid_tβ this one holds process IDs, process group IDs, and session IDs. it's a signed integer type, so it's giving "I can go negative if I'm feeling spicy" β¨uid_tβ the type that carries user IDs. it's an integer type, periodt πΈgid_tβ the type that carries group IDs. also an integer type πid_tβ the main character of this page π it's a general identifier type. it's an integer type, and it's wide/loose enough to hold apid_t, auid_t, or agid_tinside it. it's giving "one type to rule them all" π¦
π STANDARDS π
POSIX.1-2024. π
π°οΈ HISTORY π°οΈ
pid_tuid_tgid_t
β all three: POSIX.1-1988. the OGs fr fr πΈ
id_tβ SUSv1, POSIX.1-2001 XSI, POSIX.1-2008. it arrived later and lowkey ate β¨
π NOTES π
y'all β the tea is that <sys/types.h> is not the only place these types show up. lots of other headers also hand them to you, so here's the full receipts list π§Ύ
pid_t also comes from these besties:
<fcntl.h>, <sched.h>, <signal.h>, <spawn.h>, <sys/msg.h>, <sys/sem.h>, <sys/shm.h>, <sys/wait.h>, <termios.h>, <time.h>, <unistd.h>, and <utmpx.h>.
uid_t also comes from:
<pwd.h>, <signal.h>, <stropts.h>, <sys/ipc.h>, <sys/stat.h>, and <unistd.h>.
gid_t also comes from:
<grp.h>, <pwd.h>, <signal.h>, <stropts.h>, <sys/ipc.h>, <sys/stat.h>, and <unistd.h>.
and id_t also comes from:
<sys/resource.h>.
ok so quick vibe check:<sys/resource.h>is the only extra one forid_t, whilepid_thas a whole squad. iconic behavior honestly π
π SEE ALSO π
chown(2), fork(2), getegid(2), geteuid(2), getgid(2), getgroups(2), getpgid(2), getpid(2), getppid(2), getpriority(2), getpwnam(3), getresgid(2), getresuid(2), getsid(2), gettid(2), getuid(2), kill(2), pidfd_open(2), sched_setscheduler(2), waitid(2), getgrnam(3), sigqueue(3), credentials(7)
go read credentials(7) if you wanna understand the whole permissions vibe iykyk π₯
π and that's the page bestie!! this one's from Linux man-pages 6.20, dated 2026-02-08 π now go forth and getpid() responsibly, ily, bye!! β¨π
π«Ά
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2020, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms