UNISTD(3)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’… UNISTD(3) β€” the manual page, bestie edition

okay so this is unistd(3), from the Library Functions Manual, and honestly? it's kind of the main character of POSIX. let's get into it 🫢


✨ NAME ✨

unistd β€” standard symbolic constants and types. that's it, that's the vibe. iconic behavior, no notes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <unistd.h>

literally one line and it changes your whole life, no cap ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the <unistd.h> header is the foundation of the Portable Operating System Interface for Unix (POSIX) API. it's giving "everything happens here" energy. it includes definitions for a ton of functions, symbolic constants, and types, and among these you'll find:

  • the implementation-defined NULL pointer constant 🌸
  • types like size_t, ssize_t, pid_t, and intptr_t β€” yes bestie, the whole friend group πŸ‘‘
  • various limits and other symbolic constants, all described over in pathconf(2) and sysconf(3) (go read those, iykyk)
  • prototypes for several important system calls and library routines, like chown(2), dup(2), execl(3), fork(2), pipe(2), rmdir(2), setuid(2), and write(2) πŸ”₯ absolute legends, every single one
  • the symbolic constant _POSIX_VERSION, which defines the version of the POSIX standard that the implementation conforms to β€” this is the "which era of the standards are we in" check πŸ’€
  • various other _POSIX-prefixed symbolic constants that indicate whether the system implements some optional part of the standard. examples include constants such as _POSIX_IPV6 for inet6(4) functionality and _POSIX_ASYNCHRONOUS_IO for aio(3) 🧚 so like, a vibe check for optional features, fr fr
lowkey the whole point is: this header tells you what your system actually supports before you go assuming anything πŸ™ˆ

🌈 SEE ALSO 🌈

go read them, they're the supporting cast and they ate πŸ’–


⭐ STANDARDS ⭐

the <unistd.h> header conforms to IEEE Std 1003.1-2001 (β€œPOSIX.1”) β€” periodt, that's the standard, no debate 🎯


and that's the whole page bestie!! this version came from Debian, dated August 9, 2011, and the page is UNISTD(3) β€” ok bye, go include the header, ily πŸ“πŸ’œ

πŸ“¦ where this page comes from