POSIX-2008
view release on metacpan or search on metacpan
lib/POSIX/2008.pod view on Meta::CPAN
=item C<catan>
(re, im) = catan(re, im);
=item C<catanh>
(re, im) = catanh(re, im);
=item C<catclose>
rv = catclose(catd);
=item C<catgets>
s = catgets(catd, set_id, msg_id, dflt_string);
=item C<catopen>
catd = catopen(name, flag);
=item C<cbrt>
y = cbrt(x);
=item C<ccos>
(re, im) = ccos(re, im);
=item C<ccosh>
(re, im) = ccosh(re, im);
=item C<ceil>
y = ceil(x);
=item C<cexp>
(re, im) = cexp(re, im);
I<New in version 0.19.>
=item C<chdir>
rv = chdir(dir);
C<dir> can be a path, a Perl file or directory handle, or a file descriptor.
I<Changed in version 0.19:> Deprecated I<fchdir> now covered by I<chdir>.
=item C<chmod>
rv = chmod(what, mode);
C<what> can be a path, a Perl file or directory handle (see L</"NOTES">), or a
file descriptor.
I<Changed in version 0.19:> Deprecated I<fchmod> now covered by I<chmod>.
=item C<chown>
rv = chown(what, uid, gid);
C<what> can be a path, a Perl file or directory handle (see L</"NOTES">), or a
file descriptor.
I<Changed in version 0.19:> Deprecated I<fchown> now covered by I<chown>.
=item C<cimag>
im = cimag(re, im);
=item C<clock>
t = clock()
I<New in version 0.08.>
=item C<clock_getcpuclockid>
clock_id = clock_getcpuclockid(pid);
I<pid> defaults to 0. Returns undef on error.
=item C<clock_getres>
(sec, nsec) = clock_getres(clock_id);
floating_sec = clock_getres(clock_id);
I<clock_id> defaults to C<CLOCK_REALTIME>. Returns empty list or undef on
error.
I<Changed in version 0.25:> Return floating seconds in scalar context.
=item C<clock_gettime>
(sec, nsec) = clock_gettime(clock_id);
floating_sec = clock_gettime(clock_id);
clock_id defaults to C<CLOCK_REALTIME>. Returns empty list or undef on error.
I<Changed in version 0.25:> Return floating seconds in scalar context.
=item C<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 C<TIMER_ABSTIME> is
set.
I<Changed in version 0.25:> Sleep time can be floating seconds only or seconds
and nanoseconds.
=item C<clock_settime>
rv = clock_settime(clock_id, sec, nsec);
rv = clock_settime(clock_id, floating_sec);
I<Changed in version 0.25:> Time can be floating seconds only or seconds and
nanoseconds.
=item C<clog>
lib/POSIX/2008.pod view on Meta::CPAN
It executes the program referred to by I<path>, which is interpreted relative
to I<dirfd> as with the other I<*at> functions, passing I<args> as its
command-line arguments and optionally I<env> as its environment.
I<args> must be an array reference and, by convention, I<args-E<gt>[0]> should
be the name of the program being executed.
I<env> must be a hash reference. If omitted or undef, the environment of the
calling proces is used (which you can manipulate via C<%ENV>).
I<flags> is a bit mask that can include zero or more of the flags
C<AT_EMPTY_PATH>, C<AT_SYMLINK_NOFOLLOW>.
I<path> is executed "as is", i.e. no C<PATH> search or interpretation of shell
metacharacters takes place as opposed to Perl's built-in
L<C<exec>|perlfunc/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);
I<New in version 0.22.>
=item C<exp>
y = exp(x);
=item C<exp2>
y = exp2(x);
This function may not be available in libquadmath.
=item C<expm1>
y = expm1(x);
=item C<fabs>
absval = fabs(x);
I<New in version 0.27.>
=item C<faccessat>
rv = faccessat(dirfd, path, amode, flags=0);
I<flags> is the bitwise OR of zero or more of C<AT_EACCESS>,
C<AT_SYMLINK_NOFOLLOW>.
=item C<fchmodat>
rv = fchmodat(dirfd, path, mode, flags=0);
I<flags> can be 0 or C<AT_SYMLINK_NOFOLLOW>. Your system might support a
different set of flags.
=item C<fchownat>
rv = fchownat(dirfd, path, uid, gid, flags=0);
I<flags> can be 0 or C<AT_SYMLINK_NOFOLLOW>. Your system might support a
different set of flags.
=item C<fdatasync>
rv = fdatasync(fd);
=item C<fdopen>
rv = fdopen(fd, mode);
Returns a file handle associated with the numeric file descriptor I<fd> or
undef on error. I<mode> is one of the values C<"r">, C<"w">, C<"a"> with an
optional C<"+"> and/or C<"b">.
The file descriptor is not dup'ed and will be closed when the handle is closed.
It's similar to C<IO::Handle::new_from_fd()> with the following improvements:
=over
=item *
It I<really> calls C<fdopen(3)>.
=item *
It expects POSIX mode strings (e.g. C<"r">, not C<"<">).
=item *
It fails if I<mode> is not compatible with the flags of I<fd>.
=back
Usage example:
my $fh = do {
opendir my $dh, '.';
fdopen(POSIX::dup(fileno $dh), 'r');
};
chmod 0700, $fh; # this would fail with $dh from opendir
I<New in version 0.05.>
I<Changed in version 0.22:> I<fd> can no longer be a handle (that was a wrong
turn).
=item C<fdopendir>
rv = fdopendir(fd);
Returns a directory handle associated with the numeric file descriptor I<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));
lib/POSIX/2008.pod view on Meta::CPAN
=item C<ispunct>
rv = ispunct(charstring);
Like POSIX::ispunct() but returns 0 for the empty string.
=item C<isspace>
rv = isspace(charstring);
Like POSIX::isspace() but returns 0 for the empty string.
=item C<isunordered>
rv = isunordered(x, y);
I<New in version 0.20.>
=item C<isupper>
rv = isupper(charstring);
Like POSIX::isupper() but returns 0 for the empty string.
=item C<isxdigit>
rv = isxdigit(charstring);
Like POSIX::isxdigit() but returns 0 for the empty string.
=item C<j0>
y = j0(x);
C<j0()> is the Bessel function of the first kind of order 0.
=item C<j1>
y = j1(x);
C<j1()> is the Bessel function of the first kind of order 1.
=item C<jn>
y = jn(n, x);
C<jn()> is the Bessel function of the first kind of order I<n>.
=item C<jrand48>
(r, X0, X1, X2) = jrand48(X0, X1, X2);
=item C<killpg>
rv = killpg(pgrp, sig);
=item C<l64a>
s = l64a(n);
=item C<lchown>
rv = lchown(path, uid, gid);
I<New in version 0.08.>
=item C<ldexp>
y = ldexp(x, exp);
=item C<lgamma>
y = lgamma(x);
=item C<link>
rv = link(path1, path2);
=item C<linkat>
rv = linkat(fd1, path1, fd2, path2, flags=0);
I<flags> can be 0 or C<AT_SYMLINK_FOLLOW>. Your system might support a
different set of flags.
=item C<log>
y = log(x);
=item C<log10>
y = log10(x);
=item C<log1p>
y = log1p(x);
=item C<log2>
y = log2(x);
=item C<logb>
y = logb(x);
This function may not be available in libquadmath.
=item C<lrand48>
r = lrand48();
=item C<lrint>
l = lrint(x);
From the countless C<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.
I<New in verion 0.27.>
lib/POSIX/2008.pod view on Meta::CPAN
C<_SC_SELECT> C<_SC_SEMAPHORES> C<_SC_SEM_NSEMS_MAX> C<_SC_SEM_VALUE_MAX>
C<_SC_SHARED_MEMORY_OBJECTS> C<_SC_SHELL> C<_SC_SHRT_MAX> C<_SC_SHRT_MIN>
C<_SC_SIGNALS> C<_SC_SIGQUEUE_MAX> C<_SC_SIGSTKSZ> C<_SC_SINGLE_PROCESS>
C<_SC_SPAWN> C<_SC_SPIN_LOCKS> C<_SC_SPORADIC_SERVER> C<_SC_SSIZE_MAX>
C<_SC_SS_REPL_MAX> C<_SC_STREAMS> C<_SC_STREAM_MAX> C<_SC_SYMLOOP_MAX>
C<_SC_SYNCHRONIZED_IO> C<_SC_SYSTEM_DATABASE> C<_SC_SYSTEM_DATABASE_R>
C<_SC_THREADS> C<_SC_THREAD_ATTR_STACKADDR> C<_SC_THREAD_ATTR_STACKSIZE>
C<_SC_THREAD_CPUTIME> C<_SC_THREAD_DESTRUCTOR_ITERATIONS>
C<_SC_THREAD_KEYS_MAX> C<_SC_THREAD_PRIORITY_SCHEDULING>
C<_SC_THREAD_PRIO_INHERIT> C<_SC_THREAD_PRIO_PROTECT>
C<_SC_THREAD_PROCESS_SHARED> C<_SC_THREAD_ROBUST_PRIO_INHERIT>
C<_SC_THREAD_ROBUST_PRIO_PROTECT> C<_SC_THREAD_SAFE_FUNCTIONS>
C<_SC_THREAD_SPORADIC_SERVER> C<_SC_THREAD_STACK_MIN>
C<_SC_THREAD_THREADS_MAX> C<_SC_TIMEOUTS> C<_SC_TIMERS> C<_SC_TIMER_MAX>
C<_SC_TRACE> C<_SC_TRACE_EVENT_FILTER> C<_SC_TRACE_EVENT_NAME_MAX>
C<_SC_TRACE_INHERIT> C<_SC_TRACE_LOG> C<_SC_TRACE_NAME_MAX>
C<_SC_TRACE_SYS_MAX> C<_SC_TRACE_USER_EVENT_MAX> C<_SC_TTY_NAME_MAX>
C<_SC_TYPED_MEMORY_OBJECTS> C<_SC_TZNAME_MAX> C<_SC_T_IOV_MAX>
C<_SC_UCHAR_MAX> C<_SC_UINT_MAX> C<_SC_UIO_MAXIOV> C<_SC_ULONG_MAX>
C<_SC_USER_GROUPS> C<_SC_USER_GROUPS_R> C<_SC_USHRT_MAX> C<_SC_V6_ILP32_OFF32>
C<_SC_V6_ILP32_OFFBIG> C<_SC_V6_LP64_OFF64> C<_SC_V6_LPBIG_OFFBIG>
C<_SC_V7_ILP32_OFF32> C<_SC_V7_ILP32_OFFBIG> C<_SC_V7_LP64_OFF64>
C<_SC_V7_LPBIG_OFFBIG> C<_SC_V8_ILP32_OFF32> C<_SC_V8_ILP32_OFFBIG>
C<_SC_V8_LP64_OFF64> C<_SC_V8_LPBIG_OFFBIG> C<_SC_VERSION> C<_SC_WORD_BIT>
C<_SC_XBS5_ILP32_OFF32> C<_SC_XBS5_ILP32_OFFBIG> C<_SC_XBS5_LP64_OFF64>
C<_SC_XBS5_LPBIG_OFFBIG> C<_SC_XOPEN_CRYPT> C<_SC_XOPEN_ENH_I18N>
C<_SC_XOPEN_LEGACY> C<_SC_XOPEN_REALTIME> C<_SC_XOPEN_REALTIME_THREADS>
C<_SC_XOPEN_SHM> C<_SC_XOPEN_STREAMS> C<_SC_XOPEN_UNIX> C<_SC_XOPEN_UUCP>
C<_SC_XOPEN_VERSION> C<_SC_XOPEN_XCU_VERSION> C<_SC_XOPEN_XPG2>
C<_SC_XOPEN_XPG3> C<_SC_XOPEN_XPG4>
=head1 NOTES
Since version 0.27, math functions use quadmath or long doubles if Perl was
built with C<-Dusequadmath> or C<-Duselongdouble> respectively and your system
supports it.
Version 0.27 adds the C<*LONG_(MIN|MAX)> constants. These are strings if their
values are outside Perl's UV/IV range (addresses GH#13406).
C<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.
C<preadv()> and C<pwritev()> are nonstandard extensions present in Linux and
BSD.
C<execveat()>, C<openat2()>, C<preadv2()>, C<pwritev2()> and C<renameat2()>
are nonstandard extensions present in Linux.
C<fstatat()>, C<lstat()> and C<stat()> do not set the special underscore
filehandle C<_> (mostly because I have no clue how that works).
C<open()>, C<openat()> and C<openat2()> do not set the C<O_CLOEXEC> flag
automatically. You have to take care of that yourself if needed.
C<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.
For some inexplicable reason, Perl forbids you to use the built-in C<chmod()>
and C<chown()> on an C<opendir()> handle and to use C<readdir()> and
C<rewinddir()> on a C<sysopen()> handle (provided it refers to a directory).
Needless to say that C<chmod()> and C<chown()> from POSIX::2008 happily work
with C<opendir()> handles, and of course you can use C<readdir()> and
C<rewinddir()> on an C<openat()> handle that refers to a directory.
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.
=head1 SEE ALSO
=over
=item * L<POSIX 2024 Changes|https://sortix.org/blog/posix-2024/>
=item * L<POSIX.1-2024|https://pubs.opengroup.org/onlinepubs/9799919799/>
=item * L<POSIX.1-2008|https://pubs.opengroup.org/onlinepubs/9699919799/>
=back
=head1 AUTHOR
Initially hacked together by Carsten Gaebler.
=head1 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 L<https://www.wtfpl.net/>
for more details.
=cut
( run in 0.469 second using v1.01-cache-2.11-cpan-92ad3014f07 )