Syntax-K

Know-How für Ihr Projekt

Perl Documentation

NAME

POSIX - Perl interface to IEEE Std 1003.1

SYNOPSIS

use POSIX ();
use POSIX qw(setsid);
use POSIX qw(:errno_h :fcntl_h);
printf "EINTR is %d\n", EINTR;
$sess_id = POSIX::setsid();
$fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
	# note: that's a filedescriptor, *NOT* a filehandle

DESCRIPTION

The POSIX module permits you to access all (or nearly all) the standard POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish interfaces.

This document gives a condensed list of the features available in the POSIX module. Consult your operating system's manpages for general information on most features. Consult perlfunc for functions which are noted as being identical to Perl's builtin functions.

The first section describes POSIX functions from the 1003.1 specification. The second section describes some classes for signal objects, TTY objects, and other miscellaneous objects. The remaining sections list various constants and macros in an organization which roughly follows IEEE Std 1003.1b-1993.

CAVEATS

Everything is exported by default (with a handful of exceptions). This is an unfortunate backwards compatibility feature and its use is strongly discouraged. You should either prevent the exporting (by saying pppppppppppppppppppppppppppppppppppppppppp, as usual) and then use fully qualified names (e.g. POSIX::SEEK_END), or give an explicit import list. If you do neither and opt for the default (as in pppppppppppppppppppppppppppppppppppppppppp), you will import hundreds and hundreds of symbols into your namespace.

A few functions are not implemented because they are C specific. If you attempt to call these, they will print a message telling you that they aren't implemented, and suggest using the Perl equivalent, should one exist. For example, trying to access the setjmp() call will elicit the message "setjmp() is C-specific: use eval {} instead".

Furthermore, some evil vendors will claim 1003.1 compliance, but in fact are not so: they will not pass the PCTS (POSIX Compliance Test Suites). For example, one vendor may not define EDEADLK, or the semantics of the errno values set by open(2) might not be quite right. Perl does not attempt to verify POSIX compliance. That means you can currently successfully say "use POSIX", and then later in your program you find that your vendor has been lax and there's no usable ICANON macro after all. This could be construed to be a bug.

FUNCTIONS

CLASSES

POSIX::SigAction

POSIX::SigRt

POSIX::SigSet

POSIX::Termios

PATHNAME CONSTANTS

POSIX CONSTANTS

SYSTEM CONFIGURATION

ERRNO

FCNTL

FLOAT

FLOATING-POINT ENVIRONMENT

LIMITS

LOCALE

MATH

SIGNAL

STAT

STDLIB

STDIO

TIME

UNISTD

WAIT

WINSOCK

(Windows only.)