POSIX-1003

 view release on metacpan or  search on metacpan

lib/POSIX/Overview.pod  view on Meta::CPAN

Most terminal interface functions are provided by the separate
L<POSIX::1003::Termios> module, which is the same as the C<POSIX::Termios>
component in C<POSIX.pm>  See its manpage for the usage.

  cfgetispeed                     ::Termios
  cfgetospeed                     ::Termios
  cfsetispeed                     ::Termios
  cfsetospeed                     ::Termios
  ctermid                         ::Proc
  isatty         perlfunc/-X flag -t
  tcdrain                         ::Termios
  tcflow                          ::Termios
  tcflush                         ::Termios
  tcgetattr                       ::Termios/getattr
  tcsendbreak                     ::Termios
  tcsetattr                       ::Termios/setattr
  ttyname                         ::Termios

=head2 Dynamic Linking Interfaces

The loading of shared libraries in organized by its XS wrapper.  The
module L<XSLoader> opens both the wrapper and the wrapped library.
Therefore, there is no need for

  dlclose, dlerror, dlopen, dlsym

=head2 File Descriptor Management Interfaces

Although the name of this section suggests differently, actually
most of these functions use a file handle, not a descriptor.

On file handles:

  fcntl       perlfunc            ::Fcntl Fcntl.pm
  fgetpos     perlfunc/tell       IO::Seekable/getpos
  fseek       perlfunc/seek       IO::Seekable/seek
  fseeko      perlfunc/seek       IO::Seekable/seek
  fsetpos     perlfunc/seek       IO::Seekable/setpos
  ftell       perlfunc/tell       IO::Seekable/tell
  ftello      perlfunc/tell       IO::Seekable/tell
  truncate    perlfunc/truncate   IO::Handle/truncate
  rewind                          POSIX.pm

Using file-descriptors

  dup         perlopentut/<&=     ::FdIO/dupfd
  dup2                            ::FdIO/dup2fd
  lseek                           ::FdIO/seekfd       
  ftruncate                       ::FdIO/truncfd
                                  ::FdIO/rewindfd
                                  ::FdIO/tellfd

=head2 FIFO Interfaces

  mkfifo                          ::FS
  mkfifoat    not supported
  mknodat     not supported

=head2 File Attribute Interfaces

Perl's C<chown> and C<chmod> accept both file names and file handles.  Be
warned that the order of the parameters is different!

  chmod       perlfunc
  chown       perlfunc
  fchmod      perlfunc/chmod
  fchown      perlfunc/chown
  umask       perlfunc
  fchmodat    not supported
  fchownat    not supported

The symbolic constants for C<chmod> are provided by L<Fcntl> (and
POSIX.pm)

=head2 Thread-Safe Stdio Locking Interfaces

Perl does support the non-portable flock (see L<perlfunc/flock>)
in core, but the POSIX C<flockfile> mechanism is unsupported by
the PerlIO layers:

  flockfile, ftrylockfile, funlockfile, getc_unlocked,
  getchar_unlocked, putc_unlocked, putchar_unlocked

=head2 File System Interfaces

  access      filetest            ::FS
  chdir       perlfunc      
  closedir    perlfunc            IO::Dir/close
  creat       perlfunc/sysopen    ::FdIO/creatfd
  fchdir      perlfunc         
  fpathconf                       ::Pathconf
  fstat       perlfunc/stat       ::FdIO/statfd File::stat POSIX.pm
  fstatvfs                        Filesys::statvfs
  getcwd                          Cwd/getcwd
  link        perlfunc         
  mkdir       perlfunc         
  mkstemp                         File::Temp/mkstemp
  opendir     perlfunc            IO::Dir/open
  pathconf                        ::Pathconf
  readdir     perlfunc            IO::Dir/read
  remove                          File::Remove  POSIX.pm
  rename      perlfunc         
  rewinddir   perlfunc            IO::Dir/rewind
  rmdir       perlfunc
  stat        perlfunc            File::stat
  statvfs                         Filesys::statvfs
  tmpfile                         File::Temp IO::File/new_tmpfile
  tmpnam      (insecure!)         File::Temp POSIX.pm
  truncate    perlfunc
  unlink      perlfunc       
  utime       perlfunc            ::FS POSIX.pm

B<Warning:>

  POSIX::utime($filename, $atime, $mtime);
  CORE::utime($atime, $mtime, @filenames);

The symbolic constants needed to understand the result of C<stat>
are provided by L<Fcntl>.

=head2 File System Extension Interfaces

  alphasort   perlfunc/sort
  getdelim    perlvar/$INPUT_RECORD_SEPARATOR
  getline     $a = <FH>           IO::Handle
  glob        perlfunc/glob       ::FS/posix_glob File::Glob/bsd_glob
  globfree    never needed
  mkdtemp     File::Temp/mkdtemp
  scandir     not supported
  dirfd       not supported

lib/POSIX/Overview.pod  view on Meta::CPAN

  sem_post                        POSIX::RT::Semaphore/post
  sem_timedwait                   POSIX::RT::Semaphore/timedwait
  sem_trywait                     POSIX::RT::Semaphore/trywait
  sem_unlink                      POSIX::RT::Semaphore/unlink
  sem_wait                        POSIX::RT::Semaphore/wait

=head2 Shell and Utilities Interfaces

  pclose       perlfunc/close
  popen        perlfunc/open ('|-' or '-|')  perlfunc/qx
  system       perlfunc
  wordexp      perlfunc/glob
  wordfree     never needed

=head2 Signal Interfaces

Signal handling is provided via L<POSIX::1003:SigAction> and
L<POSIX::SigSet>. Take a look at those manuals.

  abort        perlvar/%SIG
  alarm        perlfunc
  kill         perlfunc           ::Signals
  pause                           ::Signals
  psiginfo     not supported
  psignal      not supported
  raise                           ::Signals
  sigaction                       ::Signals
  sigaddset                       ::Signals
  sigdelset                       ::Signals
  sigemptyset                     ::Signals
  sigfillset                      ::Signals
  sigismember                     ::Signals
  signal       perlvar/%SIG       ::Signals
  sigpending                      ::Signals
  sigprocmask                     ::Signals
  sigsuspend                      ::Signals
  sigwait      not supported
  strsignal                       ::Signals

B<Warning>, parameter order in POSIX.pm

  CORE::kill($signal, $pid);
  ::Signals::kill($signal, $pid);
  POSIX::kill($pid, $signal);

=head2 Single Process Interfaces

  confstr                         ::Confstr
  environ     perlvar/%ENV
  errno       perlvar/$ERRNO      $!+0
  getenv      perlvar/%ENV        $ENV{PATH}
  setenv      perlvar/%ENV        $ENV{HOME} = '/tmp'
  sysconf                         ::Sysconf
  uname                           ::OS
  unsetenv    perlvar/%ENV        delete $ENV{PS1}

The error constants are provided by L<Errno|Errno>.

=head2 Symbolic Link Interfaces

  lchown                          ::FS
  lstat       perlfunc
  readlinkat  not supported
  readlink    perlfunc
  symlinkat   not supported
  symlink     perlfunc

B<Warning,> POSIX.pm accepts only one filename

  CORE::chown($uid, $gid, @filename);
  ::FS::lchown($uid, $gid, @symlinks);
  POSIX::lchown($uid, $gid, $symlink); # !!!

=head2 System Database Interfaces

  getgrgid    perlfunc            User::grent
  getgrnam    perlfunc            User::grent
  getpwnam    perlfunc            User::pwent
  getpwuid    perlfunc            User::pwent

=head2 Timer Interfaces

  clock_getres                    Time::HiRes POSIX::RT::Clock
  clock_gettime                   Time::HiRes POSIX::RT::Clock
  clock_settime                   Time::HiRes POSIX::RT::Clock
  nanosleep                       Time::HiRes POSIX::RT::Clock
  timer_create                    POSIX::RT::Timer
  timer_delete                    POSIX::RT::Timer
  timer_getoverrun                POSIX::RT::Timer
  timer_gettime                   POSIX::RT::Timer
  timer_settime                   POSIX::RT::Timer

=head2 User and Group Interfaces

Expect portability issues on this subject.  Better B<not use any of
these>, but use the abstract L<POSIX::1003::User> instead!

  cuserid                         ::Proc
  getegid     perlvar/$EGID $)    ::User
  geteuid     perlvar/$EUID $>    ::User
  getgid      perlvar/$GID  $(    ::User
  getgroups   perlvar/$GID  $(    ::User
  getlogin    perlfunc            ::User
  getuid      perlvar/$UID  $<    ::User    # warning
  setegid     perlvar/$EGID $)    ::User    # warning
  seteuid     perlvar/$EUID $>    ::User    # warning
  setgid      perlvar/$GID  $(    ::User    # warning
  setuid      perlvar/$UID  $<    ::User    # warning

B<Warning:> The special variables for user- and group-ids try to be smart:
they are implemented using C<getreuid> and/or friends.  POSIX.pm provides
C<setuid> and C<setgid> which simply call the special variables. So:
both do not offer access to the system functions with that name.

=head2 Wide Character Device Input and Output Interfaces

No useful support for wide characters, so no

  fgetwc, fgetws, fputwc, fputws, fwide, fwprintf, fwscanf,
  getwc, getwchar, putwc, putwchar, ungetwc, vfwprintf, vfwscanf,
  vwprintf, vwscanf, wprintf, wscanf

=head2 Process CPU-Time Clocks Interfaces

Probably unsupported:

  clock_getcpuclockid             POSIX::RT::Clock/get_cpuclock

=head2 File Synchronization Interfaces

  fsync                           IO::Handle/sync File::Sync



( run in 0.485 second using v1.01-cache-2.11-cpan-5511b514fd6 )