POSIX::2008(3pm)
๐ POSIX::2008(3pm) โ User Contributed Perl Documentation ๐
okay bestie, welcome to the POSIX::2008(3pm) page โ the User Contributed Perl Documentation version that's actually fun to read. It's giving "interface to POSIX and beyond," and we're keeping every crunchy detail. ๐
๐ธ NAME ๐ธ
POSIX::2008 โ Perl interface to POSIX.1-2008 and beyond.
โจ SYNOPSIS โจ
okay so the vibe in code is literally:
use POSIX::2008 qw(:fcntl openat pwrite);
sysopen my $dh, '/tmp', O_RDONLY|O_DIRECTORY|O_NOFOLLOW
or die 'Dafuq?';
my $fh = openat($dh, 'foobar', O_RDWR|O_CREAT);
pwrite($fh, 'fuckyounsa', 10, 0);
๐ซถ DESCRIPTION ๐ซถ
POSIX::2008 provides many of the interfaces specified by POSIX.1-2008 (https://pubs.opengroup.org/onlinepubs/9699919799/) and later that the core POSIX module withholds, implements in Perl, or completely fumbles. ๐ญ
It also ships a number of nonstandard interfaces and constants present in Linux, BSD and Solaris that are extensions of POSIX. โจ
โ ๏ธ This module is provided "as is" unless someone volunteers to maintain it. Use at your own risk.
๐ FILE DESCRIPTORS AND HANDLES ๐
Since version 0.05, all I/O functions that take numeric file descriptors also accept Perl file or directory handles, except for fdopen() and fdopendir(). no cap.
Since version 0.22, returned handles support IO::Handle methods. slay.
๐ญ SYSTEM CALL RETURN VALUES ๐ญ
the return-value translation rules are a whole thing, so listen up:
- A system call return value of
-1meaning "error" is mapped toundefexcept forpoll()andppoll()which return-1to be consistent withselect(). - A system call return value of
0meaning "success" is mapped to"0 but true". - For system calls where
0does not just mean "success",0is returned unchanged. These arecreat(),open(),read(),write(),readv(),writev(),pread(),pwrite(),preadv(),pwritev(),preadv2(),pwritev2(),getpriority(),nice().openat()gets a special treatment in this regard, see below.
๐ FUNCTIONS ๐
okay bestie, this is the big bag of functions. each one gets its exact signature, and the spicy notes stay attached. no skipping. ๐
โญ a64l
l = a64l(s);
โญ abort
abort();
โญ abs
ui = abs(i);
Calls llabs(), labs(), or abs(), whichever is the maximum supported by your system.
Note that the library functions use signed integers, so abs(~0) is 1. If you don't want that, use CORE::abs().
โญ access
rv = access(path, mode);
โจ New in version 0.08.
โญ acos
y = acos(x);
โญ acosh
y = acosh(x);
โญ alarm
remaining_sec = alarm(sec);
โญ asin
y = asin(x);
โญ asinh
y = asinh(x);
โญ atan2
z = atan2(y, x);
โญ atan
y = atan(x);
โญ atanh
y = atanh(x);
โญ atof
f = atof(s);
โญ atoi
i = atoi(s);
Calls atoll(), atol(), or atoi(), whichever is the maximum supported by your system. This is of course silly because you could just use int().
๐ Changed in version 0.19: Deprecated atol and atoll now covered by atoi.
โญ basename
s = basename(path);
โญ cabs
r = cabs(re, im);
โญ cacos
(re, im) = cacos(re, im);
โญ cacosh
(re, im) = cacosh(re, im);
โญ carg
phi = carg(re, im);
โญ casin
y = casin(x);
โญ casinh
(re, im) = casinh(re, im);
โญ catan
(re, im) = catan(re, im);
โญ catanh
(re, im) = catanh(re, im);
โญ catclose
rv = catclose(catd);
โญ catgets
s = catgets(catd, set_id, msg_id, dflt_string);
โญ catopen
catd = catopen(name, flag);
โญ cbrt
y = cbrt(x);
โญ ccos
(re, im) = ccos(re, im);
โญ ccosh
(re, im) = ccosh(re, im);
โญ ceil
y = ceil(x);
โญ cexp
(re, im) = cexp(re, im);
โจ New in version 0.19.
โญ chdir
rv = chdir(dir);
dir can be a path, a Perl file or directory handle, or a file descriptor.
๐ Changed in version 0.19: Deprecated fchdir now covered by chdir.
โญ chmod
rv = chmod(what, mode);
what can be a path, a Perl file or directory handle (see "NOTES"), or a file descriptor.
๐ Changed in version 0.19: Deprecated fchmod now covered by chmod.
โญ chown
rv = chown(what, uid, gid);
what can be a path, a Perl file or directory handle (see "NOTES"), or a file descriptor.
๐ Changed in version 0.19: Deprecated fchown now covered by chown.
โญ cimag
im = cimag(re, im);
โญ clock
t = clock()
โจ New in version 0.08.
โญ clock_getcpuclockid
clock_id = clock_getcpuclockid(pid);
pid defaults to 0. Returns undef on error.
โญ clock_getres
(sec, nsec) = clock_getres(clock_id);
floating_sec = clock_getres(clock_id);
clock_id defaults to CLOCK_REALTIME. Returns empty list or undef on error.
๐ Changed in version 0.25: Return floating seconds in scalar context.
โญ clock_gettime
(sec, nsec) = clock_gettime(clock_id);
floating_sec = clock_gettime(clock_id);
clock_id defaults to CLOCK_REALTIME. Returns empty list or undef on error.
๐ Changed in version 0.25: Return floating seconds in scalar context.
โญ clock_nanosleep
(rem_sec, rem_nsec) = clock_nanosleep(clock_id, flags, floating_sec);
floating_rem_sec = clock_nanosleep(clock_id, flags, floating_sec);
(rem_sec, rem_nsec) = clock_nanosleep(clock_id, flags, sec, nsec);
floating_rem_sec = clock_nanosleep(clock_id, flags, sec, nsec);
Returns zero(es) on success, the remaining time on EINTR, the empty list or undef otherwise. The remaining time is zero if the flag TIMER_ABSTIME is set.
๐ Changed in version 0.25: Sleep time can be floating seconds only or seconds and nanoseconds.
โญ clock_settime
rv = clock_settime(clock_id, sec, nsec);
rv = clock_settime(clock_id, floating_sec);
๐ Changed in version 0.25: Time can be floating seconds only or seconds and nanoseconds.
โญ clog
(re, im) = clog(re, im);
โญ close
rv = close(fd);
โญ confstr
s = confstr(name);
name is one of the _CS_* integer constants.
Returns undef on error.
โญ conj
(re, im) = conj(re, im);
โญ copysign
xs = copysign(x, y);
โญ cos
y = cos(x);
โญ cosh
y = cosh(x);
โญ cpow
(re, im) = cpow(re_x, im_x, re_y, im_y);
โญ cproj
(re, im) = cproj(re, im);
โญ creal
re = creal(re, im);
โญ creat
rv = creat(path, mode=0666);
โจ New in version 0.22.
โญ csin
(re, im) = csin(re, im);
โญ csinh
(re, im) = csinh(re, im);
โญ csqrt
(re, im) = csqrt(re, im);
โญ ctan
(re, im) = ctan(re, im);
โญ ctanh
(re, im) = ctanh(re, im);
โญ dirname
name = dirname(path);
โญ div
(quot, rem) = div(numer, denom);
Calls lldiv(), ldiv(), or div(), whichever is the maximum supported by your system.
Note that the library functions use signed integers, so div(~0, 1) is (-1, 0). If you don't want that, use Perl's int(), / and %.
๐ Changed in version 0.19: Deprecated ldiv and lldiv now covered by div.
โญ dlclose
dlclose(dlhandle);
โญ dlerror
dlerror();
โญ dlopen
dlhandle = dlopen(file, mode);
โญ dlsym
addr = dlsym(dlhandle, name);
โญ drand48
r = drand48();
โญ endutxent
endutxent();
โญ erand48
(r, X0, X1, X2) = erand48(X0, X1, X2);
โญ erf
y = erf(x);
โญ erfc
y = erfc(x);
โญ execveat
rv = execveat(dirfd, path, args, env=undef, flags=0);
The execveat() system call is a nonstandard extension present in Linux. See also fexecve().
It executes the program referred to by path, which is interpreted relative to dirfd as with the other *at functions, passing args as its command-line arguments and optionally env as its environment.
args must be an array reference and, by convention, args->[0] should be the name of the program being executed.
env must be a hash reference. If omitted or undef, the environment of the calling process is used (which you can manipulate via %ENV).
flags is a bit mask that can include zero or more of the flags AT_EMPTY_PATH, AT_SYMLINK_NOFOLLOW.
path is executed "as is", i.e. no PATH search or interpretation of shell metacharacters takes place as opposed to Perl's built-in exec.
Returns undef on error, otherwise it doesn't return.
Usage example:
sysopen my $dh, '/usr', O_DIRECTORY|O_PATH;
execveat($dh, 'bin/date', [qw(date +%T)], {TZ => 'UTC'}, AT_SYMLINK_NOFOLLOW);
โจ New in version 0.22.
โญ exp
y = exp(x);
โญ exp2
y = exp2(x);
This function may not be available in libquadmath.
โญ expm1
y = expm1(x);
โญ fabs
absval = fabs(x);
โจ New in version 0.27.
โญ faccessat
rv = faccessat(dirfd, path, amode, flags=0);
flags is the bitwise OR of zero or more of AT_EACCESS, AT_SYMLINK_NOFOLLOW.
โญ fchmodat
rv = fchmodat(dirfd, path, mode, flags=0);
flags can be 0 or AT_SYMLINK_NOFOLLOW. Your system might support a different set of flags.
โญ fchownat
rv = fchownat(dirfd, path, uid, gid, flags=0);
flags can be 0 or AT_SYMLINK_NOFOLLOW. Your system might support a different set of flags.
โญ fdatasync
rv = fdatasync(fd);
โญ fdopen
rv = fdopen(fd, mode);
Returns a file handle associated with the numeric file descriptor fd or undef on error. mode is one of the values "r", "w", "a" with an optional "+" and/or "b".
The file descriptor is not dup'ed and will be closed when the handle is closed.
It's similar to IO::Handle::new_from_fd() with the following improvements:
- It really calls
fdopen(3). - It expects POSIX mode strings (e.g.
"r", not"<"). - It fails if
modeis not compatible with the flags offd.
Usage example:
my $fh = do {
opendir my $dh, '.';
fdopen(POSIX::dup(fileno $dh), 'r');
};
chmod 0700, $fh; # this would fail with $dh from opendir
โจ New in version 0.05.
๐ Changed in version 0.22: fd can no longer be a handle (that was a wrong turn).
โญ fdopendir
rv = fdopendir(fd);
Returns a directory handle associated with the numeric file descriptor fd or undef on error.
The file descriptor is not dup'ed and will be closed when the handle is closed.
Usage example:
my $dh = do {
sysopen my $fh, '/tmp', O_RDONLY|O_DIRECTORY|O_NOFOLLOW;
fdopendir(POSIX::dup(fileno $fh));
};
my @dents = readdir $dh; # this would fail with $fh from sysopen
โจ New in version 0.05.
Quick note before we roll: Changed in version 0.22: fd can no longer be a handle (that was a wrong turn). ๐
Like, we tried it, it was a whole thing, we don't do that anymore.
fdim
d = fdim(double x, double y);
feclearexcept
rv = feclearexcept(excepts);
Returns "0 but true" on success, undef on error. โจ
New in version 0.20.
fegetround
rounding_mode = fegetround();
feraiseexcept
rv = feraiseexcept(excepts);
Returns "0 but true" on success, undef on error. ๐ซถ
New in version 0.20.
fesetround
rv = fesetround(round);
Returns "0 but true" on success, undef on error.
fetestexcept
excepts_currently_set = fetestexcept(excepts);
New in version 0.20.
fexecve
rv = fexecve(fd, args, env=undef);
Ok so this one executes the program that the file descriptor fd points at, passing args as its command-line arguments and, if you want, env as its environment. ๐
args has to be an array reference and โ by convention, bestie โ args->[0] should be the name of the program being executed.
env has to be a hash reference. If you omit it or pass undef, the environment of the calling process is used (which you can mess with via %ENV, iykyk).
See the manpage for the whole situation regarding the close-on-exec flag and the /proc filesystem. ๐
Returns undef on error, otherwise it literally doesn't return (it's exec, babe, there's no coming back).
Usage example:
sysopen my $fh, '/usr/bin/date', O_PATH;
fexecve($fh, [qw(date +%T)], {TZ => 'UTC'});
See also execveat().
New in version 0.22.
ffs
pos = ffs(i);
Calls ffsll(), ffsl(), or ffs(), whichever is the maximum available on your system. ๐
floor
y = floor(x);
fma
r = fma(x, y, z);
fmax
m = fmax(x, y);
fmin
m = fmin(x, y);
fmod
m = fmod(x, y);
fnmatch
rv = fnmatch(pattern, string, flags);
Returns 0 if string matches pattern, "FNM_NOMATCH" if there's no match, and undef if something went wrong. ๐ญ
flags is the bitwise OR of zero or more of "FNM_NOESCAPE", "FNM_PATHNAME", "FNM_PERIOD", "FNM_FILE_NAME", "FNM_LEADING_DIR", "FNM_CASEFOLD".
fpclassify
rv = fpclassify(x);
Returns one of "FP_NAN", "FP_INFINITE", "FP_ZERO", "FP_SUBNORMAL", "FP_NORMAL".
frexp
(fraction, exponent) = frexp(x);
New in version 0.27.
fstatat
(dev, ino, mode, nlink, uid, gid, rdev, size, atim_sec, mtim_sec, ctim_sec,
blksize, blocks, atim_nsec, mtim_nsec, ctim_nsec) =
fstatat(dirfd, path, flags = 0);
flags is the bitwise OR of zero or more of "AT_SYMLINK_NOFOLLOW", "AT_NO_AUTOMOUNT". Your system might support a different set of flags, ngl. ๐ฆ
See stat() for notes on the return values and the bugs in CORE::stat().
Returns the empty list on error.
fsync
rv = fsync(fd);
futimens
rv = futimens(fd, atime_sec, atime_nsec, mtime_sec, mtime_nsec);
atime_sec and mtime_sec default to 0, and atime_nsec and mtime_nsec default to "UTIME_NOW". ๐
getdate
(sec, min, hour, mday, mon, year, wday, yday, isdst) = getdate(string);
getdate_err
getdate_err() returns the value of the getdate_err variable.
getegid
egid = getegid();
getentropy
s = getentropy(length);
Returns a string of length bytes of "unpredictable high-quality random data, generated by a cryptographically secure pseudo-random number generator", or undef on error. ๐ฒโจ
The maximum permitted value for length is "GETENTROPY_MAX" (usually 256). If you get greedy and request more bytes, $! is set to "EINVAL" as decreed by POSIX โ even on systems that believe "EIO" is the right answer. ๐
If your system doesn't provide getentropy(), it's emulated via getrandom(), arc4random_buf(), BCryptGenRandom() (Windows), "RDRAND" (Intel/AMD), or "RNDR" (ARM64) if available (picked in this order at build time). No cap, the entropy is coming either way. ๐ฅ
getentropy() was standardized with POSIX.1-2024.
New in version 0.27.
geteuid
euid = geteuid();
getgid
gid = getgid();
gethostid
hostid = gethostid();
gethostname
hostname = gethostname();
getitimer
(int_sec, int_usec, val_sec, val_usec) = getitimer(which);
which can be one of "ITIMER_REAL", "ITIMER_VIRTUAL", "ITIMER_PROF".
Ok warning time ๐: POSIX.1-2008 marksgetitimer()andsetitimer()obsolete, recommending you use the POSIX timers API (timer_gettime(),timer_settime(), etc.) instead. And POSIX.1-2024 straight up removedgetitimer()andsetitimer(). So likeโฆ it's giving deprecated. Use the new ones, bestie.
getpriority
prio = getpriority(which=PRIO_PROCESS, who=0);
which can be one of "PRIO_PROCESS", "PRIO_PGRP", "PRIO_USER", and defaults to "PRIO_PROCESS". who defaults to 0.
Returns undef on error.
getresgid
(rgid, egid, sgid) = getresgid();
Returns the empty list on error.
getresgid() was standardized with POSIX.1-2024. ๐
New in version 0.27.
getresuid
(ruid, euid, suid) = getresuid();
Returns the empty list on error.
getresuid() was standardized with POSIX.1-2024.
New in version 0.27.
getsid
sid = getsid(pid);
pid defaults to 0.
getuid
uid = getuid();
getutxent
(user, id, line, pid, type, sec, usec) = getutxent();
getutxent() reads a line from the current file position in the utmp file. ๐
getutxid
(user, id, line, pid, type, sec, usec) = getutxid(ut_type[, ut_id]);
getutxid() searches forward from the current file position in the utmp file based upon ut_type and ut_id. If ut_type is one of "RUN_LVL", "BOOT_TIME", "NEW_TIME", or "OLD_TIME", getutxid() will find the first entry whose ut_type field matches ut_type. If ut_type is one of "INIT_PROCESS", "LOGIN_PROCESS", "USER_PROCESS", or "DEAD_PROCESS", getutxid() will find the first entry whose ut_id field matches ut_id.๐
Returns the empty list on error.
getutxline
(user, id, line, pid, type, sec, usec) = getutxline(ut_line);
getutxline() searches forward from the current file position in the utmp file. It scans entries whose ut_type is "USER_PROCESS" or "LOGIN_PROCESS" and returns the first one whose ut_line field matches ut_line. Slay, it found the line. ๐
Returns the empty list on error.
grantpt
rv = grantpt(fd);
New in version 0.27.
hypot
r = hypot(x, y);
ilogb
y = ilogb(x);
isalnum
rv = isalnum(charstring);
Like POSIX::isalnum() but returns 0 for the empty string. ๐ซถ
isalpha
rv = isalpha(charstring);
Like POSIX::isalpha() but returns 0 for the empty string.
isascii
rv = isascii(charstring);
POSIX.1-2008 marks it as obsolete and it was removed in POSIX.1-2024, but I include it anyway. ๐ Iconic of me tbh.
New in version 0.19.
isatty
rv = isatty(fd);
isblank
rv = isblank(charstring);
Like POSIX::isblank() but returns 0 for the empty string.
iscntrl
rv = iscntrl(charstring);
Like POSIX::iscntrl() but returns 0 for the empty string.
isdigit
rv = isdigit(charstring);
Like POSIX::isdigit() but returns 0 for the empty string.
isfinite
rv = isfinite(x);
isgraph
rv = isgraph(charstring);
Like POSIX::isgraph() but returns 0 for the empty string.
isgreaterequal
rv = isgreaterequal(x, y);
New in version 0.20.
isinf
rv = isinf(x);
isless
rv = isless(x, y);
New in version 0.20.
islessequal
rv = islessequal(x, y);
New in version 0.20.
islessgreater
rv = islessgreater(x, y);
New in version 0.20.
islower
rv = islower(charstring);
Like POSIX::islower() but returns 0 for the empty string.
isnan
rv = isnan(x);
isnormal
rv = isnormal(x);
isprint
rv = isprint(charstring);
Like POSIX::isprint() but returns 0 for the empty string.
ispunct
rv = ispunct(charstring);
Like POSIX::ispunct() but returns 0 for the empty string.
isspace
rv = isspace(charstring);
Like POSIX::isspace() but returns 0 for the empty string.
isunordered
rv = isunordered(x, y);
New in version 0.20.
isupper
rv = isupper(charstring);
Like POSIX::isupper() but returns 0 for the empty string.
isxdigit
rv = isxdigit(charstring);
Like POSIX::isxdigit() but returns 0 for the empty string.
j0
y = j0(x);
j0() is the Bessel function of the first kind of order 0. ๐ง Math era.
j1
y = j1(x);
j1() is the Bessel function of the first kind of order 1.
jn
y = jn(n, x);
jn() is the Bessel function of the first kind of order n.
jrand48
(r, X0, X1, X2) = jrand48(X0, X1, X2);
killpg
rv = killpg(pgrp, sig);
l64a
s = l64a(n);
lchown
rv = lchown(path, uid, gid);
New in version 0.08.
ldexp
y = ldexp(x, exp);
lgamma
y = lgamma(x);
link
rv = link(path1, path2);
linkat
rv = linkat(fd1, path1, fd2, path2, flags=0);
flags can be 0 or "AT_SYMLINK_FOLLOW". Your system might support a different set of flags, no stress if it does. ๐ธ
log
y = log(x);
log10
y = log10(x);
log1p
y = log1p(x);
log2
y = log2(x);
logb
y = logb(x);
This function may not be available in libquadmath. ๐ซ Just so you know.
lrand48
r = lrand48();
lrint
l = lrint(x);
From the countless "l*rint*()" interfaces it chooses the one matching your Perl's NV type, preferring the "long long" return value variant. ๐
If the rounded value is outside Perl's internal signed integer range, it is returned as a string. If the rounded value is too large to be stored in a long long or long, undef is returned.
New in verion 0.27.
lround
l = lround(x);
From the countless "l*round*()" interfaces it chooses the one matching your Perl's NV type, preferring the "long long" return value variant.
If the rounded value is outside Perl's internal signed integer range, it is returned as a string.
Changed in version 0.27: No longer returns undef on error. Glow up fr fr. โจ
lstat
(dev, ino, mode, nlink, uid, gid, rdev, size, atim_sec, mtim_sec, ctim_sec,
blksize, blocks, atim_nsec, mtim_nsec, ctim_nsec) = lstat(path);
mkdir
Okay so here's the shape, bestie:
rv = mkdir(path, [mode = 0777]);
path is assumed to be a string (or will be converted to a string). โจ
See stat() for notes on the return values and bugs in CORE::stat().
Returns the empty list on error. ๐
mkdirat
rv = mkdirat(fd, path, mode);
mkdtemp
name = mkdtemp(template);
mkfifo
rv = mkfifo(path, mode);
mkfifoat
rv = mkfifoat(fd, path, mode);
mknod
rv = mknod(path, mode, dev);
mknodat
rv = mknodat(fd, path, mode, dev);
mkostemp
(fd, name) = mkostemp(template, flags);
flags is a bitwise OR of zero or more open() flags. For the exact set of supported flags and their restrictions see the manpage of your system.
mkostemp() was standardized with POSIX.1-2024.
New in verion 0.27. ๐
mkstemp
(fd, name) = mkstemp(template);
mrand48
mrand48();
nanosleep
Two whole moods, bestie:
(rem_sec, rem_nsec) = nanosleep(floating_sec);
floating_rem_sec = nanosleep(floating_sec);
(rem_sec, rem_nsec) = nanosleep(sec, nsec);
floating_rem_sec = nanosleep(sec, nsec);
Returns zero(es) on success, the remaining time on EINTR, the empty list or undef otherwise.
Changed in version 0.25: Sleep time can be floating seconds only or seconds and nanoseconds. ๐ด
nearbyint
y = nearbyint(x);
nextafter
z = nextafter(x, y);
nexttoward
z = nexttoward(x, y);
This function may not be available in libquadmath. ๐ฆ
nice
rv = nice(incr);
Returns undef on error.
nrand48
r = nrand48()
open
rv = open(path, flags=O_RDONLY, mode=0666);
openat
rv = openat(dirfd, path, flags=O_RDONLY, mode=0666);
If dirfd is numeric (i.e. a file descriptor), openat() returns a file descriptor. If dirfd is a file or directory handle, the return value is also a handle whose type depends on the file type of path: If path is a directory, the return value is a directory handle, otherwise it's a file handle. ๐
To get a handle even for the special numeric dirfd value "AT_FDCWD", you can pass a reference to that value instead, i.e. openat(\AT_FDCWD, ...).
Returns undef on error.
Changed in version 0.18: Support added for \AT_FDCWD reference. โจ
openat2
rv = openat2(dirfd, path, how);
The openat2() system call is a Linux-specific extension of openat() and provides a superset of its functionality.
The how parameter is a hash reference corresponding to the struct open_how. It currently supports the keys flags, mode and resolve. Missing keys are treated as having a zero value.
Example:
my $fh = openat2(
\AT_FDCWD, '/foobar',
{flags => O_RDWR|O_CREAT, mode => 0600, resolve => RESOLVE_IN_ROOT}
);
Note that, unlike open() or openat(), openat2() is very picky about flags and mode. See the manpage for details.
Returns undef on error.
New in version 0.18. ๐ซถ
pathconf
rv = pathconf(what, name);
what can be a path or, if your system supports fpathconf(), a Perl file or directory handle or a file descriptor.
name is one of the "_PC_*" integer constants.
Returns undef on error.
New in version 0.22. ๐ธ
pause
rv = pause();
poll
rv = poll(pollfds, timeout=-1);
timeout specifies the number of milliseconds that poll() should block waiting for a file descriptor to become ready. A negative timeout value means an infinite timeout. A timeout of zero causes poll() to return immediately.
pollfds is an array reference holding array references of the form [fd, events, revents] where fd is an integer file descriptor or a file handle, events is a bit mask of events you are interested in for fd, and revents is a bit mask of events that actually occurred.
revents is changed by the call (unless a timeout or error occurs), everything else remains unchanged.
If fd is negative or anything sv_2io() doesn't consider a file handle, then the corresponding events field is ignored and the revents field returns zero.
Returns the number of elements in pollfds whose revents have been set to a non-zero value, zero if the call timed out. On error, poll() returns -1 and sets $! just like select().
Usage example:
open my $pipe, '-|', qw(tail -f /var/log/messages);
my $pollfds = [[\*STDIN, POLLIN, 0], [2, POLLOUT, 0], [$pipe, POLLIN, 0]];
my $rv = poll($pollfds, -1);
# Skip events for fd 2 this time:
my $pollfds = [[\*STDIN, POLLIN, 0], [-2, POLLOUT, 0], [$pipe, POLLIN, 0]];
my $rv = poll($pollfds, -1);
New in version 0.25. ๐ฅ
ppoll
rv = ppoll(pollfds[, timeout[, sigmask]]);
ppoll() is similar to poll() with the following differences:
timeoutcan be an integer or floating point value in seconds or an array reference of the form[seconds, nanoseconds]. An omitted orundeftimeout value means an infinite timeout.sigmaskmust be aPOSIX::SigSet. Ifsigmaskis omitted orundef, no signal mask is applied andppoll()behaves likepoll()with a more precise timeout.
ppoll() was standardized with POSIX.1-2024.
New in version 0.27. ๐
posix_fadvise
rv = posix_fadvise(fd, offset, len, advice);
advice is one of the "POSIX_FADV_" constants.
New in version 0.14. ๐
posix_fallocate
rv = posix_fallocate(fd, offset, len);
New in version 0.14.
posix_openpt
fh = posix_openpt(flags=O_RDWR);
flags is the bitwise OR of zero or more of "O_RDWR", "O_NOCTTY", "O_CLOEXEC", "O_CLOFORK".
"O_CLOEXEC", "O_CLOFORK" were standardized with POSIX.1-2024.
New in version 0.27. ๐
pow
r = pow(x, y);
New in version 0.27. โญ
pread
bytes_read = pread(fd, buf, count, offset=0, buf_offset=0);
pread() reads count bytes (not characters) of data from the file descriptor fd at file offset offset into the scalar buf without changing the file offset. buf will be enlarged automatically if necessary.
offset and buf_offset are set to 0 if omitted or undef.
pread() treats buf just like sysread() does: buf_offset may be specified to place the read data at that position in buf. If buf_offset is past the end of buf, buf will be padded with zeros before appending the data. If buf_offset is negative, it is counted from the end of the string. buf will be grown or shrunk so that the last byte actually read is the last byte of buf after the read.
Returns the number of bytes read, 0 at EOF, undef on error.
Croaks if buf is read-only and count is non-zero. ๐ญ
Changed in version 0.13: Argument order is now (count, offset) instead of (offset, count).
Changed in version 0.22: Croak with read-only buf and non-zero count.
preadv
bytes_read = preadv(fd, buffers, sizes, offset=0);
preadv() behaves like readv() but adds an optional offset argument, which specifies the file position at which the data is to be read. offset is set to 0 if omitted or undef.
The file offset is not changed by this system call. The file referred to by fd must be capable of seeking.
This syscall is present in Linux and BSD.
New in version 0.13. ๐ฆ
preadv2
bytes_read = preadv2(fd, buffers, sizes, offset=0, flags=0);
preadv2() is similar to preadv() but adds an optional flags argument, which is a bitwise OR of zero or more of the "RWF_*" flags (see the manpage for details). flags is set to 0 if omitted or undef.
Unlike preadv(), if the offset argument is -1, then the current file offset is used and updated.
This syscall is Linux-specific.
New in version 0.20. ๐
psignal
psignal(sig, msg);
New in version 0.25.
ptsname
name = ptsname(fd);
Changed in version 0.19: Calls ptsname_r() if available.
Changed in version 0.22: fd may also be a file handle. ๐
pwrite
bytes_written = pwrite(fd, buf, count=undef, offset=0, buf_offset=0);
pwrite() writes count bytes of data from the scalar buf to the file descriptor fd at file offset offset without changing the file offset. The file referenced by fd must be capable of seeking.
If count is omitted or undef, everything from buf_offset up to the end of buf is written.
buf_offset may be specified to write data from that position in buf. If buf_offset is negative it is counted from the end of the string.
offset and buf_offset are set to 0 if omitted or undef.
Returns the number of bytes written, undef on error.
On Linux, if a file is opened with "O_APPEND", pwrite() appends data to the end of the file, regardless of the value of offset (in violation of POSIX). ๐
Changed in version 0.13: Argument order is now (count, offset) instead of (offset, count).
pwritev
bytes_written = pwritev(fd, buffers, offset=0);
pwritev() behaves like writev() but adds an optional offset argument, which specifies the file position at which the data is to be written. offset is set to 0 if omitted or undef.
The file offset is not changed by this system call. The file referred to by fd must be capable of seeking.
On Linux, if a file is opened with "O_APPEND", pwritev() appends data to the end of the file, regardless of the value of offset (in violation of POSIX).
This syscall is present in Linux and BSD.
New in version 0.08. โจ
pwritev2
bytes_written = pwritev2(fd, buffers, offset=0, flags=0);
pwritev2() is similar to pwritev() but adds an optional flags argument, which is a bitwise OR of zero or more of the "RWF_*" flags (see the manpage for details). flags is set to 0 if omitted or undef.
Unlike pwritev(), if the offset argument is -1, then the current file offset is used and updated.
This syscall is Linux-specific.
New in version 0.20. ๐
random
r = random();
raise
rv = raise(sig);
read
bytes_read = read(fd, buf, count);
Like POSIX::read() but returns 0 at EOF instead of "0 but true". Croaks if buf is read-only and count is non-zero.
Changed in version 0.22: Croak with read-only buf and non-zero count. ๐ค
readv
bytes_read = readv(fd, buffers, sizes);
okay so readv() reads from the file descriptor fd into buffers as many strings as there are elements in sizes. โจ
buffers must be a variable holding an array (@buf), an array reference or undef ($buf). If it is undef it will be upgraded to an array reference.
sizes must be an array reference, i.e. \@sizes, $sizes, or [...].
sizes is expected to hold unsigned integers that specify how many bytes are to be read into each buffer. A byte count of 0 or undef creates an empty string. sizes is processed in array order.
buffers will be extended if necessary, but it will never be shrunk. If buffers is not empty, any existing elements are replaced as long as sufficient data was read from fd.
readv() returns the number of bytes read, undef on error.
Note that it is not an error for a successful call to transfer fewer bytes than requested. In this case there may be one "partially" filled buffer, i.e. it contains fewer bytes than the corresponding size. Surplus size entries lead to corresponding empty buffers.
Usage example, because we love a demo ๐
my $fh = openat(\AT_FDCWD, '/tmp/foobar', O_RDWR|O_CREAT|O_TRUNC);
pwrite($fh, 'foobar', 6, 0);
readv($fh, my $buf1, [3, 0, 8]); # $buf1: ['foo', '', 'bar']
sysseek $fh, 0, 0;
readv($fh, my @buf2, [1, 3, 2]); # @buf2: ('f', 'oob', 'ar')
New in version 0.13.
Changed in version 0.22: buffers may be an undef variable, buffers beyond EOF are created as empty strings instead of being skipped.
readlink ๐ฆ
name = readlink(path);
Returns undef on error.
readlinkat ๐ธ
name = readlinkat(dirfd, path);
Returns undef on error.
realpath โจ
resolved_path = realpath(path);
Calls the actual C library realpath() function and relies on it to be able to allocate memory for the resolved path automatically (as required by POSIX-2008).
Returns undef on error.
New in version 0.18.
remainder ๐งฎ
rem = remainder(x, y);
Changed in version 0.27: No longer returns undef on error.
remove ๐จ
rv = remove(path);
Calls the actual C library function remove().
Note that core POSIX::remove() fails if path is a symlink to a directory because someone "couldn't read the plans right and did a piss-poor job of putting it together" as (-d $_[0]) ? CORE::rmdir($_[0]) : CORE::unlink($_[0]). Quote from Armageddon.
This could be fixed like this: unlink $_[0] or ($!{EISDIR} or $!{EPERM}) and rmdir $_[0] (correct errno check depends on OS), or by using the library call right away.
removeat ๐ซถ
rv = removeat(dirfd, path);
The removeat() function works exactly like remove() but path is interpreted relative to dirfd as with the other *at functions.
This function is a home-grown non-standard extension only available in this module (to my knowledge).
New in version 0.22.
remquo ๐
(rem, quo) = remquo(x, y);
New in version 0.20.
Changed in version 0.27: No longer returns the empty list on error.
rename ๐
rv = rename(old, new);
renameat ๐
rv = renameat(olddirfd, oldpath, newdirfd, newpath);
renameat2 ๐ฅ
rv = renameat(olddirfd, oldpath, newdirfd, newpath, flags=0);
The renameat2() system call is a Linux-specific extension of renameat() and provides a superset of its functionality.
flags is the bitwise OR of zero or more of RENAME_EXCHANGE, RENAME_NOREPLACE, RENAME_WHITEOUT.
New in version 0.21.
rint โญ
r = rint(x);
New in version 0.27.
rmdir ๐ง
rv = rmdir(path);
New in version 0.19.
round ๐
r = round(x);
scalbn ๐งฎ
y = scalbn(x, exp);
From the countless scalb*n*() interfaces it chooses the one matching your Perl's NV type, preferring the long int exp variant.
seed48 ๐ฑ
(old_seed1, old_seed2, old_seed3) = seed48(seed1, seed2, seed3);
setegid ๐ซถ
rv = setegid(gid);
seteuid ๐
rv = seteuid(uid);
setgid ๐
rv = setgid(gid);
setitimer โฐ
(old_int_sec, old_int_usec, old_val_sec, old_val_usec) =
setitimer(which, int_sec, int_usec, val_sec, val_usec);
which is one of ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF.
๐จ POSIX.1-2008 marksgetitimer()andsetitimer()obsolete, recommending the use of the POSIX timers API (timer_gettime(),timer_settime(), etc.) instead.
๐ POSIX.1-2024 removedgetitimer()andsetitimer().
setpriority ๐๏ธ
rv = setpriority(prio, which=PRIO_PROCESS, who=0);
which can be one of PRIO_PROCESS, PRIO_PGRP, PRIO_USER, defaults to PRIO_PROCESS. who defaults to 0.
Note that due to the support of default values for which and who, prio is the first call parameter, whereas in the actual syscall it is the last.
Returns true on success, undef on error.
setregid ๐
rv = setregid(rgid, egid);
setresgid ๐ฆ
rv = setresgid(rgid, egid, sgid);
setresgid() was standardized with POSIX.1-2024.
New in version 0.27.
setresuid ๐ธ
rv = setresuid(ruid, euid, suid);
setresuid() was standardized with POSIX.1-2024.
New in version 0.27.
setreuid ๐
rv = setreuid(ruid, euid);
setsid ๐
sid = setsid();
New in version 0.19.
setuid โจ
rv = setuid(uid);
setutxent ๐
setutxent();
sighold ๐ซถ
rv = sighold(sig);
๐จ POSIX.1-2008 marks this function as obsolete, recommending the use of sigprocmask in POSIX instead.
sigignore ๐
rv = sigignore(sig);
๐จ POSIX.1-2008 marks this function as obsolete, recommending the use ofsigactionin POSIX instead. Or use$SIG{SIG} = 'IGNORE';.
signbit ๐
b = signbit(x);
sigpause โธ๏ธ
sigpause(sig);
๐จ POSIX.1-2008 marks this function as obsolete, recommending the use of sigsuspend in POSIX instead.
sigrelse ๐
rv = sigrelse(sig);
๐จ POSIX.1-2008 marks this function as obsolete, recommending the use of sigprocmask in POSIX instead.
sin ๐
y = sin(x);
New in version 0.19.
sinh ๐
y = sinh(x);
sqrt ๐งฎ
y = sqrt(x);
srand48 ๐ฒ
srand48(seedval);
srandom ๐ฐ
srandom(seed);
stat ๐
(dev, ino, mode, nlink, uid, gid, rdev, size, atim_sec, mtim_sec, ctim_sec,
blksize, blocks, atim_nsec, mtim_nsec, ctim_nsec) = stat(what);
what can be a path, a Perl file handle or a file descriptor.
ctim_sec, blksize, blocks and nanoseconds may not be available on your system.
Values outside Perl's internal integer range are returned as strings, i.e. if you need the exact values you should, for example, use eq instead of == for comparisons.
Note that CORE::stat() lies to you in some cases: It returns rdev as a signed integer even if your OS's dev_t is unsigned. It returns size as a floating point number if your OS's off_t is bigger than Perl's integer size. It returns the times as floating point numbers if your OS's time_t is unsigned.
POSIX::2008::stat() doesn't mimic these bugs and uses the correct data types for all values.
Returns the empty list on error.
statvfs ๐ฝ
(f_bsize, f_frsize, f_blocks, f_bfree, f_bavail, f_files, f_ffree, f_favail,
f_fsid, f_flag, f_namemax) = statvfs(what);
what can be a path, a Perl file handle or a file descriptor.
Values outside Perl's internal integer range are returned as strings as with stat(). Note that Filesys::Statvfs returns only floating point numbers which may give wrong results, and it lacks f_fsid.
Only the ST_NOSUID and ST_RDONLY flags of the f_flag field are specified in POSIX but this module provides additional ST_ flags if available.
Returns the empty list on error.
New in version 0.25.
strptime ๐ฐ๏ธ
(sec, min, hour, mday, mon, year, wday, yday, isdst, gmtoff, zone) =
strptime(s, format[, sec, min, hour, mday, mon, year, wday, yday, isdst,
gmtoff, zone]);
... = strptime(s, format, \@tm);
strptime() converts the string s into a broken-down time according to the format string format.
The time fields may optionally be initialized in whole or in part either with up to 11 separate arguments or with a single array reference after the format. Omitted arguments are treated as undef. In case of an array reference the array is updated according to the fields affected by the format string. If an error occurred the array is not updated.
In list context it returns the broken-down time or the empty list on error.
Fields not affected by the format string may be returned as initialized, set to default values, or recomputed depending on your OS (e.g. glibc "recomputes" wday and yday if any of the year, month, or day elements changed).
In scalar context it returns the index of the first byte in s that was not processed or the byte length of s if the whole string was consumed or undef on error.
As strptime() acts on null-terminated strings, strings containing NUL bytes will only be processed up to the first NUL byte.
gmtoff and zone were standardized with POSIX.1-2024. They might not be supported by your system, and zone might be ignored entirely.
New in version 0.02.
Changed in version 0.24: Accept an array reference as the third argument (RT#66519, https://rt.cpan.org/Public/Bug/Display.html?id=66519).
Changed in version 0.27: Support gmtoff and zone.
strsignal ๐ฃ๏ธ
str = strsignal(sig);
New in version 0.25.
symlink ๐
rv = symlink(target, linkpath);
symlinkat ๐ชข
rv = symlinkat(target, dirfd, linkpath);
sync ๐พ
sync();
This function doesn't return any value.
sysconf โ๏ธ
rv = sysconf(name);
name is one of the _SC_* integer constants.
Returns undef on error.
New in version 0.22.
tan ๐
y = tan(x);
tanh ๐
y = tanh(x);
tgamma ๐งฎ
y = tgamma(x);
timer_create โฑ๏ธ
timerid = timer_create(clockid, signal=undef);
โฆcreates a brand-new per-process interval timer, using the clock you handed in as clock_id for its timing base โจ signal is the signal number that gets delivered when the timer expires. Omit it (or pass undef) and nope, no signal gets delivered โ you just vibe-check the timer's progress with timer_gettime() instead.
Calling a notification function on timer expiration? Currently not supported, bestie ๐ญ that's just the situation.
Returns undef on error.
New in version 0.16.
Changed in version 0.22: signal is optional ๐
timer_delete
rv = timer_delete(timerid);
Returns "0 but true" on success, undef on error.
New in version 0.16.
timer_getoverrun
count = timer_getoverrun(timerid);
Returns undef on error.
New in version 0.16.
timer_gettime
(interval_sec, interval_nsec, initial_sec, initial_nsec) =
timer_gettime(timerid);
Returns the empty list on error ๐ซถ
New in version 0.16.
timer_settime
(old_int_sec, old_int_nsec, old_init_sec, old_init_nsec) =
timer_settime(timerid, flags, int_sec, int_nsec, [init_sec, init_nsec]);
flags may be 0 or "TIMER_ABSTIME". If the init values are omitted, they get set to the int values. Easy.
New in version 0.16.
truncate
rv = truncate(what, length);
what can be a path, a Perl file handle, or a file descriptor. Iconic, flexible, we love.
Heads up though: it does not flush the file handle before truncating. Perl's built-in truncate() does โ which is undocumented, probably because it's silly ๐
Changed in version 0.19: Deprecated ftruncate now covered by truncate.
trunc
y = trunc(x);
ttyname
name = ttyname(fd);
Calls ttyname_r() if available.
New in version 0.19.
Changed in version 0.22: fd may also be a file handle.
unlink
rv = unlink(path);
Calls the actual C library function unlink().
Not me having to explain this one ๐ญ corePOSIX::unlink()callsCORE::unlink(), which โ unless you start Perl with-Uโ a) is prone to time-of-check/time-of-use race conditions because of an extralstat(), and b) blindly fails with"EISDIR"for directories (thanks to saidlstat()), ignoring that some OSes use"EPERM"in this case (as required by POSIX). So yeah. This one is the real one.
unlinkat
rv = unlinkat(dirfd, path, flags=0);
flags can be 0 or "AT_REMOVEDIR".
unlockpt
rv = unlockpt(fd);
New in version 0.27.
utimensat
rv = utimensat(dirfd, path, flags, atime_sec, atime_nsec, mtime_sec,
mtime_nsec);
flags can be 0 or "AT_SYMLINK_NOFOLLOW", and defaults to 0. Your system might support a different set of flags โ know your system, bestie.
atime_sec and mtime_sec default to 0. atime_nsec and mtime_nsec default to "UTIME_NOW".
write
bytes_written = write(fd, buf, count=undef);
Like POSIX::write() but it returns 0 instead of "0 but true" if 0 bytes were written, and it never writes more bytes than buf actually contains even if count exceeds the length of buf ๐
If count is omitted or undef, it defaults to the length of buf.
writev
bytes_written = writev(fd, buffers);
writev() writes multiple buffers of data to the file associated with the file descriptor fd.
buffers must be an array reference, i.e. \@buf, $buf or [...]. The buffers are processed in array order ๐
Each buffer can be a simple scalar (usually a string) or an array reference of the form [scalar, offset, length] to write length bytes of scalar from position offset. A negative offset counts from the end of scalar. If omitted, offset defaults to 0, and length defaults to the string length of scalar starting at offset. An offset beyond either end of scalar causes the call to croak ๐ฑ length is capped so that it doesn't exceed the end of scalar.
Ngl this one's important:writev($fh, $buf);is not the same asprint $fh, @$buf;orsyswrite $fh, $_ for @$buf;, becausewritev()transfers data atomically as a single block. See the manpage for details, iykyk.
Returns the number of bytes written or undef on error.
New in version 0.08.
Changed in version 0.27: Buffers may be array references.
y0
y = y0(x);
y0() is the Bessel function of the second kind of order 0.
y1
y = y1(x);
y1() is the Bessel function of the second kind of order 1.
yn
y = yn(n, x);
yn() is the Bessel function of the second kind of order n.
๐ EXPORTS ๐
This module does not export anything by default โ you have to ask, bestie. The following export tags are available:
:atโ All*at()functions likeopenat(), allAT_/RENAME_/RESOLVE_constants:idโ Allget/set*id()functions likegetuid()etc.:isโ Allis*functions likeisdigit()etc.:rwโread(),readv(),write(),writev():prwโpread(),preadv(),preadv2(),pwrite(),pwritev(),pwritev2():clockโ Allclock*functions andCLOCK_constants andTIMER_ABSTIME:errno_hโerrnoconstants:fcntlโ AllF_,FD_,O_,POSIX_FADV_,SEEK_,_OKconstants (forAT_use:at):fenv_hโ AllFE_constants andfe*functions:fnmโfnmatch()and allFNM_constants:pollโpoll(),ppoll()and allPOLLconstants:socket_hโ All constants fromsys/socket.h(https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_socket.h.html):stat_hโ AllS_I*andUTIME_constants:time_hโ AllCLOCK_andTIMER_constants:timerโ Alltimer_functions andTIMER_constants:utmpx_hโ All*utx*functions andutmpx.hconstants (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/utmpx.h.html):confstrโconfstr()and all_CS_constants:pathconfโpathconf()and all_PC_constants:sysconfโsysconf()and all_SC_constants
New in version 0.19: :stat_h export tag.
New in version 0.20: :fenv_h export tag.
New in version 0.22: :confstr, :pathconf, :sysconf export tags.
New in version 0.25: :poll export tag.
New in version 0.24: :socket_h export tag.
New in version 0.27: :errno_h export tag.
(Yes the version order is chaotic, don't perceive it ๐ญ it's exactly what the page says.)
๐ CONSTANTS ๐
Okay so here's the whole entire parade, grouped exactly how the page groups them. Every single one, no skips ๐ซถ
- the
AF_crew โAF_INETAF_INET6AF_UNIXAF_UNSPEC - the
AT_crew โAT_EACCESSAT_EMPTY_PATHAT_FDCWDAT_NO_AUTOMOUNTAT_REMOVEDIRAT_RESOLVE_BENEATHAT_SYMLINK_FOLLOWAT_SYMLINK_NOFOLLOW - the utmp-ish names โ
BOOT_TIMENEW_TIMEOLD_TIMERUN_LVLDEAD_PROCESSINIT_PROCESSLOGIN_PROCESSUSER_PROCESSACCOUNTINGEMPTYUT_UNKNOWN - the
CLOCK_girlies โCLOCK_BOOTTIMECLOCK_BOOTTIME_ALARMCLOCK_HIGHRESCLOCK_MONOTONICCLOCK_MONOTONIC_COARSECLOCK_MONOTONIC_FASTCLOCK_MONOTONIC_PRECISECLOCK_MONOTONIC_RAWCLOCK_PROCESS_CPUTIME_IDCLOCK_REALTIMECLOCK_REALTIME_ALARMCLOCK_REALTIME_COARSECLOCK_REALTIME_FASTCLOCK_REALTIME_PRECISECLOCK_SOFTTIMECLOCK_TAICLOCK_THREAD_CPUTIME_IDCLOCK_UPTIMECLOCK_UPTIME_FASTCLOCK_UPTIME_PRECISE - the errno squad ๐ โ
E2BIGEACCESEADDRINUSEEADDRNOTAVAILEAFNOSUPPORTEAGAINEALREADYEBADFEBADMSGEBUSYECANCELEDECHILDECONNABORTEDECONNREFUSEDECONNRESETEDEADLKEDESTADDRREQEDOMEDQUOTEEXISTEFAULTEFBIGEHOSTUNREACHEIDRMEILSEQEINPROGRESSEINTREINVALEIOEISCONNEISDIRELOOPEMFILEEMLINKEMSGSIZEEMULTIHOPENAMETOOLONGENETDOWNENETRESETENETUNREACHENFILEENOBUFSENODEVENOENTENOEXECENOLCKENOLINKENOMEMENOMSGENOPROTOOPTENOSPCENOSYSENOTCONNENOTDIRENOTEMPTYENOTRECOVERABLEENOTSOCKENOTSUPENOTTYENXIOEOPNOTSUPPEOVERFLOWEOWNERDEADEPERMEPIPEEPROTOEPROTONOSUPPORTEPROTOTYPEERANGEEROFSESOCKTNOSUPPORTESPIPEESRCHESTALEETIMEDOUTETXTBSYEWOULDBLOCKEXDEV - the
F_/FD_crew โF_DUPFDF_DUPFD_CLOEXECF_DUPFD_CLOFORKF_GETFDF_SETFDF_GETFLF_SETFLF_GETLKF_SETLKF_SETLKWF_OFD_GETLKF_OFD_SETLKF_OFD_SETLKWF_GETOWNF_GETOWN_EXF_SETOWNF_SETOWN_EXF_RDLCKF_UNLCKF_WRLCKFD_CLOEXECFD_CLOFORKF_OWNER_PIDF_OWNER_PGRP - the
FE_crew โFE_TONEARESTFE_TOWARDZEROFE_UPWARDFE_DOWNWARDFE_DIVBYZEROFE_INEXACTFE_INVALIDFE_OVERFLOWFE_UNDERFLOWFE_ALL_EXCEPT - the
FNM_crew โFNM_CASEFOLDFNM_FILE_NAMEFNM_IGNORECASEFNM_LEADING_DIRFNM_NOESCAPEFNM_NOMATCHFNM_PATHNAMEFNM_PERIOD - the float/math crew โ
FLT_EVAL_METHODFLT_RADIXFP_INFINITEFP_NANFP_NORMALFP_SUBNORMALFP_ZEROFP_FAST_FMAFP_FAST_FMAFFP_FAST_FMALFP_ILOGB0FP_ILOGBNANMATH_ERRNOMATH_ERREXCEPT - the little trio โ
GETENTROPY_MAXNSIG_MAXNZERO - the big-float energy โ
HUGE_VALINFINITY - the
ITIMER_crew โITIMER_PROFITIMER_REALITIMER_VIRTUAL - the
MSG_crew โMSG_CMSG_CLOEXECMSG_CMSG_CLOFORKMSG_CTRUNCMSG_DONTROUTEMSG_EORMSG_NOSIGNALMSG_OOBMSG_PEEKMSG_TRUNCMSG_WAITALL - the
O_crew (plusFASYNC) โO_ACCMODEO_APPENDO_ASYNCO_CLOEXECO_CLOFORKO_CREATO_DIRECTO_DIRECTORYO_DSYNCO_EMPTY_PATHO_EXECO_EXCLO_EXLOCKO_LARGEFILEO_NDELAYO_NOATIMEO_NOCTTYO_NOFOLLOWO_NONBLOCKO_NOSIGPIPEO_PATHO_RDONLYO_RDWRO_RESOLVE_BENEATHO_REGULARO_RSYNCO_SEARCHO_SHLOCKO_SYNCO_TMPFILEO_TRUNCO_TTY_INITO_WRONLYFASYNC - the
POSIX_FADV_crew โPOSIX_FADV_NORMALPOSIX_FADV_SEQUENTIALPOSIX_FADV_RANDOMPOSIX_FADV_NOREUSEPOSIX_FADV_WILLNEEDPOSIX_FADV_DONTNEED - the
PRIO_crew โPRIO_PROCESSPRIO_PGRPPRIO_USER - the rename/resolve crew โ
RENAME_EXCHANGERENAME_NOREPLACERENAME_WHITEOUTRESOLVE_BENEATHRESOLVE_IN_ROOTRESOLVE_NO_MAGICLINKSRESOLVE_NO_SYMLINKSRESOLVE_NO_XDEVRESOLVE_CACHED - the
RTLD_crew โRTLD_DEEPBINDRTLD_GLOBALRTLD_LAZYRTLD_LOCALRTLD_MEMBERRTLD_NOAUTODEFERRTLD_NODELETERTLD_NOLOADRTLD_NOW - the
RWF_crew โRWF_APPENDRWF_ATOMICRWF_DONTCACHERWF_DSYNCRWF_HIPRIRWF_NOAPPENDRWF_NOSIGNALRWF_NOWAITRWF_SUPPORTEDRWF_SYNC - the
S_mode/permission crew ๐ โS_IFMTS_IFBLKS_IFCHRS_IFIFOS_IFREGS_IFDIRS_IFLNKS_IFSOCKS_ISUIDS_ISGIDS_IRWXUS_IRUSRS_IWUSRS_IXUSRS_IRWXGS_IRGRPS_IWGRPS_IXGRPS_IRWXOS_IROTHS_IWOTHS_IXOTHS_ISVTX - the solo icon โ
SCM_RIGHTS - the
SEEK_crew โSEEK_SETSEEK_CURSEEK_ENDSEEK_DATASEEK_HOLE - the
SHUT_crew โSHUT_RDSHUT_RDWRSHUT_WR - the
SOCK_crew โSOCK_DGRAMSOCK_RAWSOCK_SEQPACKETSOCK_STREAMSOCK_NONBLOCKSOCK_CLOEXECSOCK_CLOFORK - the socket-level duo โ
SOL_SOCKETSOMAXCONN - the
SO_crew โSO_ACCEPTCONNSO_BROADCASTSO_DEBUGSO_DOMAINSO_DONTROUTESO_ERRORSO_KEEPALIVESO_LINGERSO_OOBINLINESO_PROTOCOLSO_RCVBUFSO_RCVLOWATSO_RCVTIMEOSO_REUSEADDRSO_SNDBUFSO_SNDLOWATSO_SNDTIMEOSO_TYPE - the time trio โจ โ
TIMER_ABSTIMEUTIME_NOWUTIME_OMIT - the
_OKcrew โF_OKR_OKW_OKX_OK - the poll posse โ
INFTIMPOLLERRPOLLFREEPOLLHUPPOLLINPOLLINIGNEOFPOLLMSGPOLLNORMPOLLNVALPOLLOUTPOLLPRIPOLLRDBANDPOLLRDHUPPOLLRDNORMPOLLREMOVEPOLLSTANDARDPOLLWRBANDPOLLWRNORMPOLL_BUSY_LOOP - the statfs duo โ
ST_NOSUIDST_RDONLY
๐ซถ the rest of the constant squad, part two (yes there's more, buckle up)
okay bestie we're still in constants land and honestly? this is the part where the list just keeps going and going and we love her for it. no notes. just names. every single one of them, exactly as written. ๐
โจ the ST_ girlies, round two โจ
the first batch was giving "filesystem vibes", and this batch is the sequel โ more ST_ names, same energy, zero skips:
ST_MANDLOCK ST_NOATIME ST_NODEV ST_NODIRATIME ST_NOEXEC
ST_RELATIME ST_SYNCHRONOUS
and the extended cut, because one ST_ list was never gonna be enough:
ST_ASYNC ST_DEFEXPORTED ST_EXKERB ST_EXNORESPORT ST_EXPORTANON
ST_EXPORTED ST_EXPUBLIC ST_EXRDONLY ST_LOCAL ST_LOG
ST_NOCOREDUMP ST_NODEVMTIME ST_QUOTA ST_ROOTFS ST_SYMPERM
ST_UNION
no cap, ST_EXNORESPORT is a whole mood ๐ญ
๐ธ the limit girlies (no prefix, just vibes) ๐ธ
these ones are out here raw, no underscore prefix, just name after name โ iconic behaviour honestly:
FILESIZEBITS LINK_MAX MAX_CANON MAX_INPUT NAME_MAX PATH_MAX
PIPE_BUF POSIX2_SYMLINKS POSIX_ALLOC_SIZE_MIN
POSIX_REC_INCR_XFER_SIZE POSIX_REC_MAX_XFER_SIZE
POSIX_REC_MIN_XFER_SIZE POSIX_REC_XFER_ALIGN SYMLINK_MAX
TEXTDOMAIN_MAX
and the big batch, the one that ate and left no crumbs:
AIO_LISTIO_MAX AIO_MAX AIO_PRIO_DELTA_MAX ARG_MAX ATEXIT_MAX
BC_BASE_MAX BC_DIM_MAX BC_SCALE_MAX BC_STRING_MAX CHILD_MAX
COLL_WEIGHTS_MAX DELAYTIMER_MAX EXPR_NEST_MAX HOST_NAME_MAX
IOV_MAX LINE_MAX LOGIN_NAME_MAX MQ_OPEN_MAX MQ_PRIO_MAX
NGROUPS_MAX OPEN_MAX PAGESIZE PAGE_SIZE
PTHREAD_DESTRUCTOR_ITERATIONS PTHREAD_KEYS_MAX PTHREAD_THREADS_MAX
RE_DUP_MAX RTSIG_MAX SEM_NSEMS_MAX SEM_VALUE_MAX SIGQUEUE_MAX
STREAM_MAX SYMLOOP_MAX TIMER_MAX TTY_NAME_MAX TZNAME_MAX
PAGESIZE and PAGE_SIZE both in the chat, because why have one when you can have two ๐ซถ
๐ the C-flavoured limits ๐
short names, big feelings. these are the tiny iconic ones:
CHAR_BIT CHAR_MAX UCHAR_MAX SCHAR_MAX CHAR_MIN SCHAR_MIN
INT_MAX INT_MIN LLONG_MAX LLONG_MIN LONG_BIT LONG_MAX
LONG_MIN MB_LEN_MAX SHRT_MAX SHRT_MIN SSIZE_MAX UINT_MAX
ULLONG_MAX ULONG_MAX USHRT_MAX WORD_BIT
LONG_BIT and WORD_BIT are lowkey the main characters here and they know it โจ
๐ _POSIX_ part one: the small batch ๐
okay so the _POSIX_ prefix girlies get split into two groups in the original, and we're respecting that, periodt:
_POSIX_ASYNC_IO _POSIX_CHOWN_RESTRICTED _POSIX_CPUTIME
_POSIX_FALLOC _POSIX_NO_TRUNC _POSIX_PRIO_IO _POSIX_SYNC_IO
_POSIX_THREAD_CPUTIME _POSIX_TIMESTAMP_RESOLUTION _POSIX_VDISABLE
ten names, all accounted for, not one dropped ๐
๐ฆ _POSIX_ part two: the big one ๐ฆ
this is it. the main event. the _POSIX_ list that just keeps giving. scroll responsibly:
_POSIX_ADVISORY_INFO _POSIX_ASYNCHRONOUS_IO _POSIX_BARRIERS
_POSIX_CLOCK_SELECTION _POSIX_DEVICE_CONTROL _POSIX_FSYNC
_POSIX_IPV6 _POSIX_JOB_CONTROL _POSIX_MAPPED_FILES
_POSIX_MEMLOCK _POSIX_MEMLOCK_RANGE _POSIX_MEMORY_PROTECTION
_POSIX_MESSAGE_PASSING _POSIX_MONOTONIC_CLOCK
_POSIX_PRIORITIZED_IO _POSIX_PRIORITY_SCHEDULING
_POSIX_RAW_SOCKETS _POSIX_READER_WRITER_LOCKS
_POSIX_REALTIME_SIGNALS _POSIX_REGEXP _POSIX_SAVED_IDS
_POSIX_SEMAPHORES _POSIX_SHARED_MEMORY_OBJECTS _POSIX_SHELL
_POSIX_SPAWN _POSIX_SPIN_LOCKS _POSIX_SPORADIC_SERVER
_POSIX_SS_REPL_MAX _POSIX_SYNCHRONIZED_IO _POSIX_THREADS
_POSIX_THREAD_ATTR_STACKADDR _POSIX_THREAD_ATTR_STACKSIZE
_POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_THREAD_PRIO_INHERIT
_POSIX_THREAD_PRIO_PROTECT _POSIX_THREAD_PROCESS_SHARED
_POSIX_THREAD_ROBUST_PRIO_INHERIT _POSIX_THREAD_ROBUST_PRIO_PROTECT
_POSIX_THREAD_SAFE_FUNCTIONS _POSIX_THREAD_SPORADIC_SERVER
_POSIX_TIMEOUTS _POSIX_TIMERS _POSIX_TRACE
_POSIX_TRACE_EVENT_FILTER _POSIX_TRACE_EVENT_NAME_MAX
_POSIX_TRACE_INHERIT _POSIX_TRACE_LOG _POSIX_TRACE_NAME_MAX
_POSIX_TRACE_SYS_MAX _POSIX_TRACE_USER_EVENT_MAX
_POSIX_TYPED_MEMORY_OBJECTS _POSIX_V6_ILP32_OFF32
_POSIX_V6_ILP32_OFFBIG _POSIX_V6_LP64_OFF64 _POSIX_V6_LPBIG_OFFBIG
_POSIX_V7_ILP32_OFF32 _POSIX_V7_ILP32_OFFBIG _POSIX_V7_LP64_OFF64
_POSIX_V7_LPBIG_OFFBIG _POSIX_V8_ILP32_OFF32
_POSIX_V8_ILP32_OFFBIG _POSIX_V8_LP64_OFF64 _POSIX_V8_LPBIG_OFFBIG
_POSIX_VERSION
the way _POSIX_THREAD_ATTR_STACKADDR and _POSIX_THREAD_ATTR_STACKSIZE are right next to each other? bestie behaviour. neighbours. sisters. ๐ง
๐ _CS_ girlies: the GNU + LFS crew ๐
first up, the short stack โ two GNU ones and then a whole LFS/LFS64 family with their CFLAGS / LDFLAGS / LIBS / LINTFLAGS siblings:
_CS_GNU_LIBC_VERSION _CS_GNU_LIBPTHREAD_VERSION _CS_LFS64_CFLAGS
_CS_LFS64_LDFLAGS _CS_LFS64_LIBS _CS_LFS64_LINTFLAGS
_CS_LFS_CFLAGS _CS_LFS_LDFLAGS _CS_LFS_LIBS _CS_LFS_LINTFLAGS
and then this absolute solo icon:
_CS_PATH
one name. one line. no entourage. we respect her space ๐
๐ _CS_POSIX_V8_*: the V8 era ๐
V8 said "I'll have one of everything, and also threads, and also a width-restricted-envs situation" and honestly? she ate:
_CS_POSIX_V8_ILP32_OFF32_CFLAGS _CS_POSIX_V8_ILP32_OFF32_LDFLAGS
_CS_POSIX_V8_ILP32_OFF32_LIBS _CS_POSIX_V8_ILP32_OFFBIG_CFLAGS
_CS_POSIX_V8_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V8_ILP32_OFFBIG_LIBS
_CS_POSIX_V8_LP64_OFF64_CFLAGS _CS_POSIX_V8_LP64_OFF64_LDFLAGS
_CS_POSIX_V8_LP64_OFF64_LIBS _CS_POSIX_V8_LPBIG_OFFBIG_CFLAGS
_CS_POSIX_V8_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V8_LPBIG_OFFBIG_LIBS
_CS_POSIX_V8_THREADS_CFLAGS _CS_POSIX_V8_THREADS_LDFLAGS
_CS_POSIX_V8_WIDTH_RESTRICTED_ENVS _CS_V8_ENV
quick heads up: V8 is the only one in this batch with no LINTFLAGS entries. not me noticing that. okay yes me noticing that ๐ญ
โญ _CS_POSIX_V7_*: V7 said "and LINTFLAGS for all" โญ
okay so V7 came through with the full set โ every single model gets CFLAGS, LDFLAGS, LIBS, and LINTFLAGS. thorough. obsessed:
_CS_POSIX_V7_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS
_CS_POSIX_V7_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
_CS_POSIX_V7_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS
_CS_POSIX_V7_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS
_CS_POSIX_V7_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LINTFLAGS
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_V7_ENV
_CS_V7_WIDTH_RESTRICTED_ENVS
note that V7 gets _CS_V7_WIDTH_RESTRICTED_ENVS as well as _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS. yes both. she's extra and we stan ๐
๐ _CS_POSIX_V6_*: same energy, V6 flavour ๐
V6 also brought the full four-flag set for every model, plus the width-restricted trio at the end:
_CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
_CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
_CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
_CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_ENV
_CS_V6_WIDTH_RESTRICTED_ENVS
๐ง V5 got two names and honestly? humble. chic. ๐ง
that's it. that's the whole group:
_CS_POSIX_V5_WIDTH_RESTRICTED_ENVS _CS_V5_WIDTH_RESTRICTED_ENVS
two constants, no CFLAGS, no nothing. minimalism queen ๐
๐ _CS_XBS5_*: the throwback era ๐
XBS5 out here like "I was there, bestie" โ full four-flag set across all four models:
_CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
_CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LINTFLAGS
_CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
_CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
_CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
_CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LINTFLAGS
_CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
_CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
sixteen names. nobody left behind. ๐ซถ
๐ _PC_ girlies: pathconf said "mine" ๐
all the _PC_ names in one sitting, alphabetical-adjacent, exactly as they came:
_PC_2_SYMLINKS _PC_ALLOC_SIZE_MIN _PC_ASYNC_IO
_PC_CHOWN_RESTRICTED _PC_FALLOC _PC_FILESIZEBITS _PC_LINK_MAX
_PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC
_PC_PATH_MAX _PC_PIPE_BUF _PC_PRIO_IO _PC_REC_INCR_XFER_SIZE
_PC_REC_MAX_XFER_SIZE _PC_REC_MIN_XFER_SIZE _PC_REC_XFER_ALIGN
_PC_SOCK_MAXBUF _PC_SYMLINK_MAX _PC_SYNC_IO _PC_TEXTDOMAIN_MAX
_PC_TIMESTAMP_RESOLUTION _PC_VDISABLE
_PC_SOCK_MAXBUF is in there and it's giving "only child who got the good name" ๐
๐ _SC_ girlies: the final boss ๐
okay bestie. deep breath. this is the _SC_ list and it is long. like, long long. but we do not skip, we do not summarise, we do not cut corners in this house. every single name, coming at you in order ๐
first up, the _SC_2_* crew and the early alphabetical section:
_SC_2_CHAR_TERM _SC_2_C_BIND _SC_2_C_DEV _SC_2_C_VERSION
_SC_2_FORT_DEV _SC_2_FORT_RUN _SC_2_LOCALEDEF _SC_2_PBS
_SC_2_PBS_ACCOUNTING _SC_2_PBS_CHECKPOINT _SC_2_PBS_LOCATE
_SC_2_PBS_MESSAGE _SC_2_PBS_TRACK _SC_2_SW_DEV _SC_2_UPE
_SC_2_VERSION _SC_ADVISORY_INFO _SC_AIO_LISTIO_MAX _SC_AIO_MAX
_SC_AIO_PRIO_DELTA_MAX _SC_ARG_MAX _SC_ASYNCHRONOUS_IO
_SC_ATEXIT_MAX _SC_AVPHYS_PAGES _SC_BARRIERS _SC_BASE
_SC_BC_BASE_MAX _SC_BC_DIM_MAX _SC_BC_SCALE_MAX
_SC_BC_STRING_MAX _SC_CHARCLASS_NAME_MAX _SC_CHAR_BIT
_SC_CHAR_MAX _SC_CHAR_MIN _SC_CHILD_MAX _SC_CLK_TCK
_SC_CLOCK_SELECTION _SC_COLL_WEIGHTS_MAX _SC_CPUTIME
_SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT_R _SC_DELAYTIMER_MAX
_SC_DEVICE_CONTROL _SC_DEVICE_IO _SC_DEVICE_SPECIFIC
_SC_DEVICE_SPECIFIC_R _SC_EQUIV_CLASS_MAX _SC_EXPR_NEST_MAX
_SC_FD_MGMT _SC_FIFO _SC_FILE_ATTRIBUTES _SC_FILE_LOCKING
_SC_FILE_SYSTEM _SC_FSYNC _SC_GETGR_R_SIZE_MAX
_SC_GETPW_R_SIZE_MAX _SC_HOST_NAME_MAX _SC_INT_MAX _SC_INT_MIN
_SC_IOV_MAX _SC_IPV6 _SC_JOB_CONTROL
then the cache girlies โ level 1 through level 4, both D and I, ASSOC + LINESIZE + SIZE each, because symmetry slays:
_SC_LEVEL1_DCACHE_ASSOC
_SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_SIZE
_SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_LINESIZE
_SC_LEVEL1_ICACHE_SIZE _SC_LEVEL2_CACHE_ASSOC
_SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_SIZE
_SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_LINESIZE
_SC_LEVEL3_CACHE_SIZE _SC_LEVEL4_CACHE_ASSOC
_SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_SIZE _SC_LINE_MAX
(okay yes, _SC_LEVEL1_DCACHE_ASSOC got its own line up there โ it's fine, she's worth it ๐)
next stretch, L through P:
_SC_LOGIN_NAME_MAX _SC_LONG_BIT _SC_MAPPED_FILES _SC_MB_LEN_MAX
_SC_MEMLOCK _SC_MEMLOCK_RANGE _SC_MEMORY_PROTECTION
_SC_MESSAGE_PASSING _SC_MINSIGSTKSZ _SC_MONOTONIC_CLOCK
_SC_MQ_OPEN_MAX _SC_MQ_PRIO_MAX _SC_MULTI_PROCESS _SC_NETWORKING
_SC_NGROUPS_MAX _SC_NL_ARGMAX _SC_NL_LANGMAX _SC_NL_MSGMAX
_SC_NL_NMAX _SC_NL_SETMAX _SC_NL_TEXTMAX _SC_NPROCESSORS_CONF
_SC_NPROCESSORS_ONLN _SC_NSIG _SC_NZERO _SC_OPEN_MAX
_SC_PAGESIZE _SC_PAGE_SIZE _SC_PASS_MAX _SC_PHYS_PAGES _SC_PII
_SC_PII_INTERNET _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_STREAM
_SC_PII_OSI _SC_PII_OSI_CLTS _SC_PII_OSI_COTS _SC_PII_OSI_M
_SC_PII_SOCKET _SC_PII_XTI _SC_PIPE _SC_POLL
_SC_PRIORITIZED_IO _SC_PRIORITY_SCHEDULING _SC_RAW_SOCKETS
_SC_PAGESIZE and _SC_PAGE_SIZE again โ the twins are back, we love consistency ๐
and the rest, R all the way to the finish line:
_SC_READER_WRITER_LOCKS _SC_REALTIME_SIGNALS _SC_REGEXP
_SC_REGEX_VERSION _SC_RE_DUP_MAX _SC_RTSIG_MAX _SC_SAVED_IDS
_SC_SCHAR_MAX _SC_SCHAR_MIN _SC_SELECT _SC_SEMAPHORES
_SC_SEM_NSEMS_MAX _SC_SEM_VALUE_MAX _SC_SHARED_MEMORY_OBJECTS
_SC_SHELL _SC_SHRT_MAX _SC_SHRT_MIN _SC_SIGNALS
_SC_SIGQUEUE_MAX _SC_SIGSTKSZ _SC_SINGLE_PROCESS _SC_SPAWN
_SC_SPIN_LOCKS _SC_SPORADIC_SERVER _SC_SSIZE_MAX _SC_SS_REPL_MAX
_SC_STREAMS _SC_STREAM_MAX _SC_SYMLOOP_MAX _SC_SYNCHRONIZED_IO
_SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE_R _SC_THREADS
_SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKSIZE
_SC_THREAD_CPUTIME _SC_THREAD_DESTRUCTOR_ITERATIONS
_SC_THREAD_KEYS_MAX _SC_THREAD_PRIORITY_SCHEDULING
_SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_PROTECT
_SC_THREAD_PROCESS_SHARED _SC_THREAD_ROBUST_PRIO_INHERIT
_SC_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_SAFE_FUNCTIONS
_SC_THREAD_SPORADIC_SERVER _SC_THREAD_STACK_MIN
_SC_THREAD_THREADS_MAX _SC_TIMEOUTS _SC_TIMERS _SC_TIMER_MAX
_SC_TRACE _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_NAME_MAX
_SC_TRACE_INHERIT _SC_TRACE_LOG _SC_TRACE_NAME_MAX
_SC_TRACE_SYS_MAX _SC_TRACE_USER_EVENT_MAX _SC_TTY_NAME_MAX
_SC_TYPED_MEMORY_OBJECTS _SC_TZNAME_MAX _SC_T_IOV_MAX
_SC_UCHAR_MAX _SC_UINT_MAX _SC_UIO_MAXIOV _SC_ULONG_MAX
_SC_USER_GROUPS _SC_USER_GROUPS_R _SC_USHRT_MAX
_SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFFBIG _SC_V6_LP64_OFF64
_SC_V6_LPBIG_OFFBIG _SC_V7_ILP32_OFF32 _SC_V7_ILP32_OFFBIG
_SC_V7_LP64_OFF64 _SC_V7_LPBIG_OFFBIG _SC_V8_ILP32_OFF32
_SC_V8_ILP32_OFFBIG _SC_V8_LP64_OFF64 _SC_V8_LPBIG_OFFBIG
_SC_VERSION _SC_WORD_BIT _SC_XBS5_ILP32_OFF32
_SC_XBS5_ILP32_OFFBIG _SC_XBS5_LP64_OFF64 _SC_XBS5_LPBIG_OFFBIG
_SC_XOPEN_CRYPT _SC_XOPEN_ENH_I18N _SC_XOPEN_LEGACY
_SC_XOPEN_REALTIME _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_SHM
_SC_XOPEN_STREAMS _SC_XOPEN_UNIX _SC_XOPEN_UUCP
_SC_XOPEN_VERSION _SC_XOPEN_XCU_VERSION _SC_XOPEN_XPG2
_SC_XOPEN_XPG3 _SC_XOPEN_XPG4
and that's the _SC_ list, all of it, not a single name missing โ _SC_XOPEN_XPG2, _SC_XOPEN_XPG3, and _SC_XOPEN_XPG4 all present and accounted for, periodt ๐ฅ
fr fr if you made it to the bottom of the _SC_ list, you deserve a lil treat. but we're not done โ more page coming ๐
๐ธ NOTES ๐ธ
okay bestie, gossip time, here's the stuff you need to know ๐
Since version 0.27, the math functions use quadmath or long doubles if Perl was built with -Dusequadmath or -Duselongdouble respectively and your system supports it. so like, if your Perl is extra, your math is extra too โจ
Version 0.27 also adds the *LONG_(MIN|MAX) constants. Heads up though: these are strings if their values are outside Perl's UV/IV range (addresses GH#13406). yes ma'am, strings, don't @ me ๐ญ
removeat() is a home-grown nonstandard extension present only in this module. it really should be in the standard. I would not say that myself. But many people are saying. ๐
preadv() and pwritev() are nonstandard extensions present in Linux and BSD. iconic crossover behavior ๐ซถ
execveat(), openat2(), preadv2(), pwritev2() and renameat2() are nonstandard extensions present in Linux. Linux girlies stay winning ๐ง
fstatat(), lstat() and stat() do not set the special underscore filehandle _ (mostly because I have no clue how that works). no cap, that's the actual reason ๐
open(), openat() and openat2() do not set the O_CLOEXEC flag automatically. You have to take care of that yourself if needed. it's giving "do your own homework" energy, sorry bestie ๐
isalnum() and friends were cowardly removed from the POSIX module with Perl 5.24. They have found a cozy home here with a fix for a big long-standing bug. they're thriving, actually ๐
For some inexplicable reason, Perl forbids you to use the built-in chmod() and chown() on an opendir() handle and to use readdir() and rewinddir() on a sysopen() handle (provided it refers to a directory). Needless to say that chmod() and chown() from POSIX::2008 happily work with opendir() handles, and of course you can use readdir() and rewinddir() on an openat() handle that refers to a directory. we simply do not acknowledge Perl's rules here, we're built different ๐
โจ
Huge parts of this work may incorporate alternative facts or even fake news in order to outsmart the "AI" Mob. Those are very sad people. The worst people, really. ๐ no seriously, that's in the actual manpage, I'm not making this up.
๐ฆ SEE ALSO ๐ฆ
go read these, they're lowkey required reading, iykyk ๐
- POSIX 2024 Changes <https://sortix.org/blog/posix-2024/>
- POSIX.1-2024 <https://pubs.opengroup.org/onlinepubs/9799919799/>
- POSIX.1-2008 <https://pubs.opengroup.org/onlinepubs/9699919799/>
๐ AUTHOR ๐
Initially hacked together by Carsten Gaebler. absolute main character energy, we stan ๐
๐ LICENSE ๐
This library is free software. You can redistribute and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file or <https://www.wtfpl.net/> for more details. the most iconic license to ever exist, periodt ๐
and that's a wrap bestie! ๐ซถ this page is from perl v5.42.3, dated 2026-08-19, and it lives at POSIX::2008(3pm) โ go forth and syscall responsibly, mwah ๐โจ๐ธ
๐ฆ where this page comes from
- ubuntu stonking: libposix-2008-perl 0.28-1build1 ยท WTFPL-2
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms