"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"
ret = access(path, mode);
Newinversion0.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().
Changedinversion0.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"
ret = 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);
Newinversion0.19.
"chdir"
ret = chdir(dir);
"dir" can be a path, a Perl file or directory handle, or a file descriptor.
Changedinversion0.19: Deprecated fchdir now covered by chdir.
"chmod"
ret = chmod(what, mode);
"what" can be a path, a Perl file or directory handle (see "NOTES"), or a file descriptor.
Changedinversion0.19: Deprecated fchmod now covered by chmod.
"chown"
ret = chown(what, uid, gid);
"what" can be a path, a Perl file or directory handle (see "NOTES"), or a file descriptor.
Changedinversion0.19: Deprecated fchown now covered by chown.
"cimag"
im = cimag(re, im);
"clock"
t = clock()Newinversion0.08.
"clock_getcpuclockid"
clock_id = clock_getcpuclockid(pid);
pid defaults to $$. Returns undef on error.
"clock_getres"
(sec, nsec) = clock_getres(clock_id);
clock_id defaults to "CLOCK_REALTIME". Returns empty list on error.
"clock_gettime"
(sec, nsec) = clock_gettime(clock_id);
clock_id defaults to "CLOCK_REALTIME". Returns empty list on error.
"clock_nanosleep"
(rem_sec, rem_nsec) = clock_nanosleep(clock_id, flags, sec, nsec);
In scalar context returns the remaining seconds as a floating point number.
"clock_settime"
ret = clock_settime(clock_id, sec, nsec);
"clog"
(re, im) = clog(re, im);
"close"
ret = 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"
ret = creat(path, mode=0666);
Newinversion0.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 Perls int(), "/" and "%".
Changedinversion0.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"
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 proces 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);
Newinversion0.22.
"exp"
y = exp(x);
"exp2"
y = exp2(x);
"expm1"
y = expm1(x);
"faccessat"
ret = faccessat(dirfd, path, amode, flags=0);
flags is the bitwise OR of zero or more of "AT_EACCESS", "AT_SYMLINK_NOFOLLOW".
"fchmodat"
ret = fchmodat(dirfd, path, mode, flags=0);
flags can be 0 or "AT_SYMLINK_NOFOLLOW". Your system might support a different set of flags.
"fchownat"
ret = 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"
ret = fdatasync(fd);
"fdopen"
ret = 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 mode is not compatible with the flags of fd.
Usage example:
my $fh = do {
opendir my $dh, '.';
fdopen(POSIX::dup(fileno $dh), 'r');
};
chmod 0700, $fh; # this would fail with $dh from opendir
Newinversion0.05.Changedinversion0.22:fd can no longer be a handle (that was a wrong turn).
"fdopendir"
ret = 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
Newinversion0.05.Changedinversion0.22:fd can no longer be a handle (that was a wrong turn).
"fdim"
d = fdim(double x, double y);
"feclearexcept"
ret = feclearexcept(excepts);
Returns "0 but true" on success, undef on error.
Newinversion0.20.
"fegetround"
rounding_mode = fegetround();
"feraiseexcept"
ret = feraiseexcept(excepts);
Returns "0 but true" on success, undef on error.
Newinversion0.20.
"fesetround"
ret = fesetround(round);
Returns "0 but true" on success, undef on error.
"fetestexcept"
excepts_currently_set = fetestexcept(excepts);
Newinversion0.20.
"fexecve"
fexecve(fd, args, env=undef);
Executes the program referred to by the file descriptor fd, 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 proces is used
(which you can manipulate via %ENV).
See the manpage for issues regarding the close-on-exec flag and the /proc filesystem.
Returns undef on error, otherwise it doesn't return.
Usage example:
sysopen my $fh, '/usr/bin/date', O_PATH;
fexecve($fh, [qw(date +%T)], {TZ => 'UTC'});
See also execveat().
Newinversion0.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"
ret = fnmatch(pattern, string, flags);
Returns 0 if string matches pattern, "FNM_NOMATCH" if there is no match, undef if there is an error.
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"
fpclassify(x);
Returns one of "FP_NAN", "FP_INFINITE", "FP_ZERO", "FP_SUBNORMAL", "FP_NORMAL".
"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.
See stat() for notes on the return values and bugs in CORE::stat().
Returns the empty list on error.
"fsync"
ret = fsync(fd);
"futimens"
ret = futimens(fd, atime_sec, atime_nsec, mtime_sec, mtime_nsec);
atime_sec and mtime_sec default to 0, 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();
"geteuid"
euid = geteuid();
"getgid"
gid = getgid();
"gethostid"
hostid = gethostid();
"gethostname"
hostname = gethostname();
"getitimer"
(int_sec, int_usec, val_sec, val_usec) = getitimer(which);
which is one of "ITIMER_REAL", "ITIMER_VIRTUAL", "ITIMER_PROF".
"getpriority"
prio = getpriority(which=PRIO_PROCESS, who=0);
which can be one of "PRIO_PROCESS", "PRIO_PGRP", "PRIO_USER", defaults to "PRIO_PROCESS". who
defaults to 0.
Returns undef on error.
"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.
"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.
"hypot"
r = hypot(x, y);
"ilogb"
y = ilogb(x);
"isalnum"
ret = isalnum(charstring);
Like POSIX::isalnum() but returns 0 for the empty string.
"isalpha"
ret = isalpha(charstring);
Like POSIX::isalpha() but returns 0 for the empty string.
"isascii"
ret = isascii(charstring);
POSIX.1-2008 marks it as obsolete, but I include it anyway.
Newinversion0.19.
"isatty"
ret = isatty(fd);
"isblank"
ret = isblank(charstring);
Like POSIX::isblank() but returns 0 for the empty string.
"iscntrl"
ret = iscntrl(charstring);
Like POSIX::iscntrl() but returns 0 for the empty string.
"isdigit"
ret = isdigit(charstring);
Like POSIX::isdigit() but returns 0 for the empty string.
"isfinite"
ret = isfinite(x);
"isgraph"
ret = isgraph(charstring);
Like POSIX::isgraph() but returns 0 for the empty string.
"isgreaterequal"
ret = isgreaterequal(x, y);
Newinversion0.20.
"isinf"
ret = isinf(x);
"isless"
ret = isless(x, y);
Newinversion0.20.
"islessequal"
ret = islessequal(x, y);
Newinversion0.20.
"islessgreater"
ret = islessgreater(x, y);
Newinversion0.20.
"islower"
ret = islower(charstring);
Like POSIX::islower() but returns 0 for the empty string.
"isnan"
ret = isnan(x);
"isnormal"
ret = isnormal(x);
"isprint"
ret = isprint(charstring);
Like POSIX::isprint() but returns 0 for the empty string.
"ispunct"
ret = ispunct(charstring);
Like POSIX::ispunct() but returns 0 for the empty string.
"isspace"
ret = isspace(charstring);
Like POSIX::isspace() but returns 0 for the empty string.
"isunordered"
ret = isunordered(x, y);
Newinversion0.20.
"isupper"
ret = isupper(charstring);
Like POSIX::isupper() but returns 0 for the empty string.
"isxdigit"
ret = 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.
"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"
ret = killpg(pgrp, sig);
"l64a"
s = l64a(n);
"lchown"
ret = lchown(path, uid, gid);
Newinversion0.08.
"ldexp"
y = ldexp(x, exp);
"lgamma"
y = lgamma(x);
"link"
ret = link(path1, path2);
"linkat"
ret = linkat(fd1, path1, fd2, path2, flags=0);
flags can be 0 or "AT_SYMLINK_FOLLOW". Your system might support a different set of flags.
"log"
y = log(x);
"log10"
y = log10(x);
"log1p"
y = log1p(x);
"log2"
y = log2(x);
"logb"
y = logb(x);
"lrand48"
r = lrand48();
"lround"
l = lround(x);
Calls llround() or lround() whichever is the maximum available on your system. 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.
"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);
"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.
"mkdir"
ret = mkdir(path, [mode = 0777]);
"mkdirat"
ret = mkdirat(fd, path, mode);
"mkdtemp"
name = mkdtemp(template);
"mkfifo"
ret = mkfifo(path, mode);
"mkfifoat"
ret = mkfifoat(fd, path, mode);
"mknod"
ret = mknod(path, mode, dev);
"mknodat"
ret = mknodat(fd, path, mode, dev);
"mkstemp"
(fd, name) = mkstemp(template);
"mrand48"
mrand48();
"nanosleep"
(rem_sec, rem_nsec) = nanosleep(sec, nsec);
In scalar context returns the remaining seconds as a floating point number.
"nearbyint"
y = nearbyint(x);
"nextafter"
z = nextafter(x, y);
"nexttoward"
z = nexttoward(x, y);
"nice"
ret = nice(incr);
Returns undef on error.
"nrand48"
r = nrand48()
"open"
ret = open(path, flags=O_RDONLY, mode=0666);
"openat"
ret = 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.
Changedinversion0.18: Support added for "\AT_FDCWD" reference.
"openat2"
ret = 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 structopen_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.
Newinversion0.18.
"pathconf"
ret = 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.
Newinversion0.22.
"posix_fadvise"
ret = posix_fadvise(fd, offset, len, advice);
advice is one of the "POSIX_FADV_" constants.
Newinversion0.14.
"posix_fallocate"
ret = posix_fallocate(fd, offset, len);
Newinversion0.14.
"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.
Changedinversion0.13: Argument order is now (count, offset) instead of (offset, count).
Changedinversion0.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.
Newinversion0.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.
This syscall is Linux-specific.
Newinversion0.20.
"ptsname"
name = ptsname(fd);
Changedinversion0.19: Calls ptsname_r() if available.
Changedinversion0.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).
Changedinversion0.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.
Newinversion0.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.
This syscall is Linux-specific.
Newinversion0.20.
"random"
r = random();
"raise"
ret = raise(sig);
"read"
bytes_read = read(fd, buf, count);
Like POSIX::read() but returns 0 at EOF instead of "0buttrue". Croaks if buf is read-only and count
is non-zero.
Changedinversion0.22: Croak with read-only buf and non-zero count.
"readv"
bytes_read = readv(fd, buffers, sizes);
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:
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')
Newinversion0.13.Changedinversion0.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 fuction realpath() and relies on it to be able to allocate memory for the
resolved path automatically (as required by POSIX-2008).
Returns undef on error.
Newinversion0.18.
"remainder"
rem = remainder(x, y);
Returns undef on error.
"remove"
ret = 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"
ret = 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).
Newinversion0.22.
"remquo"
(rem, quo) = remquo(x, y);
Returns the empty list on error.
Newinversion0.20.
"rename"
ret = rename(old, new);
"renameat"
ret = renameat(olddirfd, oldpath, newdirfd, newpath);
"renameat2"
ret = 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".
Newinversion0.21.
"rmdir"
ret = rmdir(path);
Newinversion0.19.
"round"
r = round(x);
"scalbn"
y = scalbn(x, n);
Calls scalbln() or scalbn(), whichever is the maximum supported by your system.
"seed48"
(old_seed1, old_seed2, old_seed3) = seed48(seed1, seed2, seed3);
"setegid"
ret = setegid(gid);
"seteuid"
ret = seteuid(uid);
"setgid"
ret = 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".
"setpriority"
ret = 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"
ret = setregid(rgid, egid);
"setreuid"
ret = setreuid(ruid, euid);
"setsid"
sid = setsid();
Newinversion0.19.
"setuid"
ret = setuid(uid);
"setutxent"
setutxent();
"sighold"
ret = sighold(sig);
"sigignore"
ret = sigignore(sig);
"signbit"
b = signbit(x);
"sigpause"
sigpause(sig);
"sigrelse"
ret = sigrelse(sig);
"sin"
y = sin(x);
Newinversion0.19.
"sinh"
y = sinh(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.
"strptime"
(sec, min, hour, mday, mon, year, wday, yday, isdst) =
strptime(s, format[, sec, min, hour, mday, mon, year, wday, yday, isdst]);
... = 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 9 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 udpated.
In list context returns the broken-down time or the empty list on error. Fields not affected by the
format string are returned as initialized.
In scalar context 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.
Newinversion0.02.Changedinversion0.24: Accept an array reference as the third argument.
"symlink"
ret = symlink(target, linkpath);
"symlinkat"
ret = symlinkat(target, dirfd, linkpath);
"sync"
sync();
This function doesn't return any value.
"sysconf"
ret = sysconf(name);
name is one of the "_SC_*" integer constants.
Returns undef on error.
Newinversion0.22.
"tan"
y = tan(x);
"tanh"
y = tanh(x);
"tgamma"
y = tgamma(x);
"timer_create"
timerid = timer_create(clockid, signal=undef);
Creates a new per-process interval timer using the clock given by clock_id as the timing base. signal
is the signal number to be delivered when the timer expires. If signal is omitted or undef, no signal
is delivered and the progress of the timer can be monitored using timer_gettime().
Calling a notification function on timer expiration is currently not supported.
Returns undef on error.
Newinversion0.16.Changedinversion0.22:signal is optional.
"timer_delete"
ret = timer_delete(timerid);
Returns "0 but true" on success, undef on error.
Newinversion0.16.
"timer_getoverrun"
count = timer_getoverrun(timerid);
Returns undef on error.
Newinversion0.16.
"timer_gettime"
(interval_sec, interval_nsec, initial_sec, initial_nsec) = timer_gettime(timerid);
Returns the empty list on error.
Newinversion0.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 are set to the int values.
Newinversion0.16.
"truncate"
ret = truncate(what, length);
"what" can be a path, a Perl file handle, or a file descriptor.
Note that it does not flush the file handle before truncating. Perl's built-in truncate() does (this
is undocumented, probably because it's silly).
Changedinversion0.19: Deprecated ftruncate now covered by truncate.
"trunc"
y = trunc(x);
"ttyname"
name = ttyname(fd);
Calls ttyname_r() if available.
Newinversion0.19.Changedinversion0.22:fd may also be a file handle.
"unlink"
ret = unlink(path);
Calls the actual C library function unlink().
Note that core POSIX::unlink() calls CORE::unlink(), which, unless you start Perl with "-U", a) is
prone to time-of-check/time-of-use race conditions due to an additional lstat(), and b) blindly fails
with "EISDIR" for directories (due to said lstat()), ignoring that some OSes use "EPERM" in this case
(as required by POSIX).
"unlinkat"
ret = unlinkat(dirfd, path, flags=0);
flags can be 0 or "AT_REMOVEDIR".
"utimensat"
ret = utimensat(dirfd, path, flags, atime_sec, atime_nsec, mtime_sec, mtime_nsec);
flags can be 0 or "AT_SYMLINK_NOFOLLOW", defaults to 0. Your system might support a different set of
flags.
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 returns 0 instead of "0 but true" if 0 bytes were written, and never writes
more bytes than buf 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.
Note that "writev($fh, $buf);" is not the same as "print $fh, @$buf;" or "syswrite $fh, $_ for
@$buf;" because writev() transfers data atomically as a single block. See the manpage for details.
Returns the number of bytes written or undef on error.
Newinversion0.08.
"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.