This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.000
[perl5.git] / pod / modpods / POSIX.pod
1 =head1 NAME
2
3 POSIX - Perl interface to IEEE 1003.1 namespace
4
5 =head1 SYNOPSIS
6
7     use POSIX;
8     use POSIX 'strftime';
9
10 =head1 DESCRIPTION
11
12 The POSIX module permits you to access all (or nearly all) the standard
13 POSIX 1003.1 identifiers.  Things which are C<#defines> in C, like EINTR
14 or O_NDELAY, are automatically exported into your namespace.  All
15 functions are only exported if you ask for them explicitly.  Most likely
16 people will prefer to use the fully-qualified function names.
17
18 To get a list of all the possible identifiers available to you--and
19 their semantics--you should pick up a 1003.1 spec, or look in the
20 F<POSIX.pm> module.
21
22 =head1 EXAMPLES
23
24     printf "EENTR is %d\n", EINTR;
25
26     POSIX::setsid(0);
27
28     $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
29         # note: that's a filedescriptor, *NOT* a filehandle
30
31 =head1 NOTE
32
33 The POSIX module is probably the most complex Perl module supplied with
34 the standard distribution.  It incorporates autoloading, namespace games,
35 and dynamic loading of code that's in Perl, C, or both.  It's a great
36 source of wisdom.
37
38 =head1 CAVEATS 
39
40 A few functions are not implemented because they are C specific.  If you
41 attempt to call these, they will print a message telling you that they
42 aren't implemented because they're, supplying the Perl equivalent if one
43 exists.  For example, trying to access the setjmp() call will elicit the
44 message "setjmp() is C-specific: use eval {} instead".
45
46 Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
47 are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
48 For example, one vendor may not define EDEADLK, or the semantics of the
49 errno values set by open(2) might not be quite right.  Perl does not
50 attempt to verify POSIX compliance.  That means you can currently
51 successfully say "use POSIX",  and then later in your program you find
52 that your vendor has been lax and there's no usable ICANON macro after
53 all.  This could be construed to be a bug.