summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2011-02-23 13:01:34 -0800
committerSaul Wold <sgw@linux.intel.com>2011-02-24 14:34:48 -0800
commit9eb9125de80d0f0865fa158fd220663be5e1efb0 (patch)
tree7ff37b314988e214653d60a4e05f6e89884b870a /meta/recipes-devtools
parent0023e32c03a001a7a4a6a688e26af073df7535b0 (diff)
downloadpoky-9eb9125de80d0f0865fa158fd220663be5e1efb0.tar.gz
perl: import parallel build fixes from upstream git tree
The parallel build issue is fixed in the upstream perl git tree differently. Replacing our fix with the upstream fix. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix.patch18
-rw-r--r--meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_1.patch25
-rw-r--r--meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_2.patch22
-rw-r--r--meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_3.patch6583
-rw-r--r--meta/recipes-devtools/perl/perl-native_5.12.2.bb6
-rw-r--r--meta/recipes-devtools/perl/perl_5.12.2.bb6
6 files changed, 6638 insertions, 22 deletions
diff --git a/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix.patch b/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix.patch
deleted file mode 100644
index 476577eb33..0000000000
--- a/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1This patch fixes the parallel make issue on a 40 way build system
2
3Nitin A Kamble <nitin.a.kamble@intel.com>
42011-02-16
5
6Index: perl-5.12.2/Makefile.SH
7===================================================================
8--- perl-5.12.2.orig/Makefile.SH 2010-09-06 16:30:32.000000000 -0700
9+++ perl-5.12.2/Makefile.SH 2011-02-16 16:21:30.744143773 -0800
10@@ -198,6 +198,8 @@
11 $this_target: uni.data" ;;
12 Text/ParseWords) extra_dep="$extra_dep
13 $this_target: lib/auto/Scalar/Util.$dlext" ;;
14+ POSIX) extra_dep="$extra_dep
15+$this_target: lib/auto/Cwd/Cwd.$dlext" ;;
16 esac
17 done
18
diff --git a/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_1.patch b/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_1.patch
new file mode 100644
index 0000000000..63e641003c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_1.patch
@@ -0,0 +1,25 @@
1Imported from perl git tree by Nitin A Kamble <nitin.a.kamble@intel.com>
22011-02-23
3
4commit 6695a346c41138df5b2c0e26b9a49b1f96137da0
5Author: Tony Cook <tony@openbsd32.tony.develop-help.com>
6Date: Thu Jul 22 09:54:13 2010 +1000
7
8 make_ext.pl populates @INC correctly, don't override it badly
9
10 PERL5LIB is populated by make_ext.pl with paths to the modules we need
11 to run, don't override this with "../../lib" since that may not have
12 been populated yet in a parallel build.
13
14diff --git a/ext/POSIX/Makefile.PL b/ext/POSIX/Makefile.PL
15index 392b6fb..9e6d091 100644
16--- a/ext/POSIX/Makefile.PL
17+++ b/ext/POSIX/Makefile.PL
18@@ -1,7 +1,3 @@
19-# Explicitly avoid including '.' in @INC; autoloader gets confused since it
20-# can find POSIX.pm, but can't find autosplit.ix.
21-BEGIN { @INC = '../../lib';}
22-#
23 use ExtUtils::MakeMaker;
24 use ExtUtils::Constant 0.11 'WriteConstants';
25 use Config;
diff --git a/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_2.patch b/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_2.patch
new file mode 100644
index 0000000000..6c536dd05b
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_2.patch
@@ -0,0 +1,22 @@
1Imported from perl git tree by Nitin A Kamble <nitin.a.kamble@intel.com>
22011-02-23
3
4commit 24e93d7838b346d2ed632075f3d824a325170616
5Author: Tony Cook <tony@develop-help.com>
6Date: Sat Aug 14 00:21:29 2010 +1000
7
8 POSIX/t/posix.t expects a certain start to Makefile.PL
9
10 6695a346 changed the start of Makefile.PL, but t/posix.t reads that to
11 test its read() implementation, restore enough of the original for the
12 test to pass.
13
14diff --git a/ext/POSIX/Makefile.PL b/ext/POSIX/Makefile.PL
15index 9e6d091..292882c 100644
16--- a/ext/POSIX/Makefile.PL
17+++ b/ext/POSIX/Makefile.PL
18@@ -1,3 +1,4 @@
19+# Expect this line to be read by t/posix.t, don't change it
20 use ExtUtils::MakeMaker;
21 use ExtUtils::Constant 0.11 'WriteConstants';
22 use Config;
diff --git a/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_3.patch b/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_3.patch
new file mode 100644
index 0000000000..a74a45d73c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.12.2/parallel_build_fix_3.patch
@@ -0,0 +1,6583 @@
1Imported from perl git tree by Nitin A Kamble <nitin.a.kamble@intel.com>
22011-02-23
3
4commit 4feb80ac47a22e7de7d7c1c1d5dfb3d744a2a3a7
5Author: Jerry D. Hedden <jdhedden@cpan.org>
6Date: Tue Aug 17 13:17:11 2010 -0400
7
8 Move POSIX.pm to lib/POSIX.pm to fix autosplitter problem
9
10diff --git a/MANIFEST b/MANIFEST
11index 3036d73..faf8974 100644
12--- a/MANIFEST
13+++ b/MANIFEST
14@@ -3183,9 +3183,9 @@ ext/POSIX/hints/openbsd.pl Hint for POSIX for named architecture
15 ext/POSIX/hints/sunos_4.pl Hint for POSIX for named architecture
16 ext/POSIX/hints/svr4.pl Hint for POSIX for named architecture
17 ext/POSIX/hints/uts.pl Hint for POSIX for named architecture
18+ext/POSIX/lib/POSIX.pm POSIX extension Perl module
19+ext/POSIX/lib/POSIX.pod POSIX extension documentation
20 ext/POSIX/Makefile.PL POSIX extension makefile writer
21-ext/POSIX/POSIX.pm POSIX extension Perl module
22-ext/POSIX/POSIX.pod POSIX extension documentation
23 ext/POSIX/POSIX.xs POSIX extension external subroutines
24 ext/POSIX/t/is.t See if POSIX isxxx() work
25 ext/POSIX/t/math.t Basic math tests for POSIX
26diff --git a/ext/POSIX/Makefile.PL b/ext/POSIX/Makefile.PL
27index 292882c..07c3841 100644
28--- a/ext/POSIX/Makefile.PL
29+++ b/ext/POSIX/Makefile.PL
30@@ -18,7 +18,8 @@ WriteMakefile(
31 NAME => 'POSIX',
32 @libs,
33 XSPROTOARG => '-noprototypes', # XXX remove later?
34- VERSION_FROM => 'POSIX.pm',
35+ VERSION_FROM => 'lib/POSIX.pm',
36+ ABSTRACT_FROM => 'lib/POSIX.pod',
37 realclean => {FILES=> 'const-c.inc const-xs.inc'},
38 );
39
40diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm
41deleted file mode 100644
42index ffbd9de..0000000
43--- a/ext/POSIX/POSIX.pm
44+++ /dev/null
45@@ -1,1042 +0,0 @@
46-package POSIX;
47-use strict;
48-use warnings;
49-
50-our(@ISA, %EXPORT_TAGS, @EXPORT_OK, @EXPORT, $AUTOLOAD, %SIGRT) = ();
51-
52-our $VERSION = "1.19";
53-
54-use AutoLoader;
55-
56-use XSLoader ();
57-
58-use Fcntl qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK F_SETFD
59- F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND
60- O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC
61- O_WRONLY SEEK_CUR SEEK_END SEEK_SET
62- S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG
63- S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID
64- S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR);
65-
66-# Grandfather old foo_h form to new :foo_h form
67-my $loaded;
68-
69-sub import {
70- load_imports() unless $loaded++;
71- my $this = shift;
72- my @list = map { m/^\w+_h$/ ? ":$_" : $_ } @_;
73- local $Exporter::ExportLevel = 1;
74- Exporter::import($this,@list);
75-}
76-
77-sub croak { require Carp; goto &Carp::croak }
78-# declare usage to assist AutoLoad
79-sub usage;
80-
81-XSLoader::load 'POSIX', $VERSION;
82-
83-sub AUTOLOAD {
84- no strict;
85- no warnings 'uninitialized';
86- if ($AUTOLOAD =~ /::(_?[a-z])/) {
87- # require AutoLoader;
88- $AutoLoader::AUTOLOAD = $AUTOLOAD;
89- goto &AutoLoader::AUTOLOAD
90- }
91- local $! = 0;
92- my $constname = $AUTOLOAD;
93- $constname =~ s/.*:://;
94- my ($error, $val) = constant($constname);
95- croak $error if $error;
96- *$AUTOLOAD = sub { $val };
97-
98- goto &$AUTOLOAD;
99-}
100-
101-package POSIX::SigAction;
102-
103-use AutoLoader 'AUTOLOAD';
104-
105-package POSIX::SigRt;
106-
107-use AutoLoader 'AUTOLOAD';
108-
109-use Tie::Hash;
110-
111-use vars qw($SIGACTION_FLAGS $_SIGRTMIN $_SIGRTMAX $_sigrtn @ISA);
112-@POSIX::SigRt::ISA = qw(Tie::StdHash);
113-
114-$SIGACTION_FLAGS = 0;
115-
116-tie %POSIX::SIGRT, 'POSIX::SigRt';
117-
118-sub DESTROY {};
119-
120-package POSIX;
121-
122-1;
123-__END__
124-
125-sub usage {
126- my ($mess) = @_;
127- croak "Usage: POSIX::$mess";
128-}
129-
130-sub redef {
131- my ($mess) = @_;
132- croak "Use method $mess instead";
133-}
134-
135-sub unimpl {
136- my ($mess) = @_;
137- $mess =~ s/xxx//;
138- croak "Unimplemented: POSIX::$mess";
139-}
140-
141-sub assert {
142- usage "assert(expr)" if @_ != 1;
143- if (!$_[0]) {
144- croak "Assertion failed";
145- }
146-}
147-
148-sub tolower {
149- usage "tolower(string)" if @_ != 1;
150- lc($_[0]);
151-}
152-
153-sub toupper {
154- usage "toupper(string)" if @_ != 1;
155- uc($_[0]);
156-}
157-
158-sub closedir {
159- usage "closedir(dirhandle)" if @_ != 1;
160- CORE::closedir($_[0]);
161-}
162-
163-sub opendir {
164- usage "opendir(directory)" if @_ != 1;
165- my $dirhandle;
166- CORE::opendir($dirhandle, $_[0])
167- ? $dirhandle
168- : undef;
169-}
170-
171-sub readdir {
172- usage "readdir(dirhandle)" if @_ != 1;
173- CORE::readdir($_[0]);
174-}
175-
176-sub rewinddir {
177- usage "rewinddir(dirhandle)" if @_ != 1;
178- CORE::rewinddir($_[0]);
179-}
180-
181-sub errno {
182- usage "errno()" if @_ != 0;
183- $! + 0;
184-}
185-
186-sub creat {
187- usage "creat(filename, mode)" if @_ != 2;
188- &open($_[0], &O_WRONLY | &O_CREAT | &O_TRUNC, $_[1]);
189-}
190-
191-sub fcntl {
192- usage "fcntl(filehandle, cmd, arg)" if @_ != 3;
193- CORE::fcntl($_[0], $_[1], $_[2]);
194-}
195-
196-sub getgrgid {
197- usage "getgrgid(gid)" if @_ != 1;
198- CORE::getgrgid($_[0]);
199-}
200-
201-sub getgrnam {
202- usage "getgrnam(name)" if @_ != 1;
203- CORE::getgrnam($_[0]);
204-}
205-
206-sub atan2 {
207- usage "atan2(x,y)" if @_ != 2;
208- CORE::atan2($_[0], $_[1]);
209-}
210-
211-sub cos {
212- usage "cos(x)" if @_ != 1;
213- CORE::cos($_[0]);
214-}
215-
216-sub exp {
217- usage "exp(x)" if @_ != 1;
218- CORE::exp($_[0]);
219-}
220-
221-sub fabs {
222- usage "fabs(x)" if @_ != 1;
223- CORE::abs($_[0]);
224-}
225-
226-sub log {
227- usage "log(x)" if @_ != 1;
228- CORE::log($_[0]);
229-}
230-
231-sub pow {
232- usage "pow(x,exponent)" if @_ != 2;
233- $_[0] ** $_[1];
234-}
235-
236-sub sin {
237- usage "sin(x)" if @_ != 1;
238- CORE::sin($_[0]);
239-}
240-
241-sub sqrt {
242- usage "sqrt(x)" if @_ != 1;
243- CORE::sqrt($_[0]);
244-}
245-
246-sub getpwnam {
247- usage "getpwnam(name)" if @_ != 1;
248- CORE::getpwnam($_[0]);
249-}
250-
251-sub getpwuid {
252- usage "getpwuid(uid)" if @_ != 1;
253- CORE::getpwuid($_[0]);
254-}
255-
256-sub longjmp {
257- unimpl "longjmp() is C-specific: use die instead";
258-}
259-
260-sub setjmp {
261- unimpl "setjmp() is C-specific: use eval {} instead";
262-}
263-
264-sub siglongjmp {
265- unimpl "siglongjmp() is C-specific: use die instead";
266-}
267-
268-sub sigsetjmp {
269- unimpl "sigsetjmp() is C-specific: use eval {} instead";
270-}
271-
272-sub kill {
273- usage "kill(pid, sig)" if @_ != 2;
274- CORE::kill $_[1], $_[0];
275-}
276-
277-sub raise {
278- usage "raise(sig)" if @_ != 1;
279- CORE::kill $_[0], $$; # Is this good enough?
280-}
281-
282-sub offsetof {
283- unimpl "offsetof() is C-specific, stopped";
284-}
285-
286-sub clearerr {
287- redef "IO::Handle::clearerr()";
288-}
289-
290-sub fclose {
291- redef "IO::Handle::close()";
292-}
293-
294-sub fdopen {
295- redef "IO::Handle::new_from_fd()";
296-}
297-
298-sub feof {
299- redef "IO::Handle::eof()";
300-}
301-
302-sub fgetc {
303- redef "IO::Handle::getc()";
304-}
305-
306-sub fgets {
307- redef "IO::Handle::gets()";
308-}
309-
310-sub fileno {
311- redef "IO::Handle::fileno()";
312-}
313-
314-sub fopen {
315- redef "IO::File::open()";
316-}
317-
318-sub fprintf {
319- unimpl "fprintf() is C-specific--use printf instead";
320-}
321-
322-sub fputc {
323- unimpl "fputc() is C-specific--use print instead";
324-}
325-
326-sub fputs {
327- unimpl "fputs() is C-specific--use print instead";
328-}
329-
330-sub fread {
331- unimpl "fread() is C-specific--use read instead";
332-}
333-
334-sub freopen {
335- unimpl "freopen() is C-specific--use open instead";
336-}
337-
338-sub fscanf {
339- unimpl "fscanf() is C-specific--use <> and regular expressions instead";
340-}
341-
342-sub fseek {
343- redef "IO::Seekable::seek()";
344-}
345-
346-sub fsync {
347- redef "IO::Handle::sync()";
348-}
349-
350-sub ferror {
351- redef "IO::Handle::error()";
352-}
353-
354-sub fflush {
355- redef "IO::Handle::flush()";
356-}
357-
358-sub fgetpos {
359- redef "IO::Seekable::getpos()";
360-}
361-
362-sub fsetpos {
363- redef "IO::Seekable::setpos()";
364-}
365-
366-sub ftell {
367- redef "IO::Seekable::tell()";
368-}
369-
370-sub fwrite {
371- unimpl "fwrite() is C-specific--use print instead";
372-}
373-
374-sub getc {
375- usage "getc(handle)" if @_ != 1;
376- CORE::getc($_[0]);
377-}
378-
379-sub getchar {
380- usage "getchar()" if @_ != 0;
381- CORE::getc(STDIN);
382-}
383-
384-sub gets {
385- usage "gets()" if @_ != 0;
386- scalar <STDIN>;
387-}
388-
389-sub perror {
390- print STDERR "@_: " if @_;
391- print STDERR $!,"\n";
392-}
393-
394-sub printf {
395- usage "printf(pattern, args...)" if @_ < 1;
396- CORE::printf STDOUT @_;
397-}
398-
399-sub putc {
400- unimpl "putc() is C-specific--use print instead";
401-}
402-
403-sub putchar {
404- unimpl "putchar() is C-specific--use print instead";
405-}
406-
407-sub puts {
408- unimpl "puts() is C-specific--use print instead";
409-}
410-
411-sub remove {
412- usage "remove(filename)" if @_ != 1;
413- (-d $_[0]) ? CORE::rmdir($_[0]) : CORE::unlink($_[0]);
414-}
415-
416-sub rename {
417- usage "rename(oldfilename, newfilename)" if @_ != 2;
418- CORE::rename($_[0], $_[1]);
419-}
420-
421-sub rewind {
422- usage "rewind(filehandle)" if @_ != 1;
423- CORE::seek($_[0],0,0);
424-}
425-
426-sub scanf {
427- unimpl "scanf() is C-specific--use <> and regular expressions instead";
428-}
429-
430-sub sprintf {
431- usage "sprintf(pattern,args)" if @_ == 0;
432- CORE::sprintf(shift,@_);
433-}
434-
435-sub sscanf {
436- unimpl "sscanf() is C-specific--use regular expressions instead";
437-}
438-
439-sub tmpfile {
440- redef "IO::File::new_tmpfile()";
441-}
442-
443-sub ungetc {
444- redef "IO::Handle::ungetc()";
445-}
446-
447-sub vfprintf {
448- unimpl "vfprintf() is C-specific";
449-}
450-
451-sub vprintf {
452- unimpl "vprintf() is C-specific";
453-}
454-
455-sub vsprintf {
456- unimpl "vsprintf() is C-specific";
457-}
458-
459-sub abs {
460- usage "abs(x)" if @_ != 1;
461- CORE::abs($_[0]);
462-}
463-
464-sub atexit {
465- unimpl "atexit() is C-specific: use END {} instead";
466-}
467-
468-sub atof {
469- unimpl "atof() is C-specific, stopped";
470-}
471-
472-sub atoi {
473- unimpl "atoi() is C-specific, stopped";
474-}
475-
476-sub atol {
477- unimpl "atol() is C-specific, stopped";
478-}
479-
480-sub bsearch {
481- unimpl "bsearch() not supplied";
482-}
483-
484-sub calloc {
485- unimpl "calloc() is C-specific, stopped";
486-}
487-
488-sub div {
489- unimpl "div() is C-specific, use /, % and int instead";
490-}
491-
492-sub exit {
493- usage "exit(status)" if @_ != 1;
494- CORE::exit($_[0]);
495-}
496-
497-sub free {
498- unimpl "free() is C-specific, stopped";
499-}
500-
501-sub getenv {
502- usage "getenv(name)" if @_ != 1;
503- $ENV{$_[0]};
504-}
505-
506-sub labs {
507- unimpl "labs() is C-specific, use abs instead";
508-}
509-
510-sub ldiv {
511- unimpl "ldiv() is C-specific, use /, % and int instead";
512-}
513-
514-sub malloc {
515- unimpl "malloc() is C-specific, stopped";
516-}
517-
518-sub qsort {
519- unimpl "qsort() is C-specific, use sort instead";
520-}
521-
522-sub rand {
523- unimpl "rand() is non-portable, use Perl's rand instead";
524-}
525-
526-sub realloc {
527- unimpl "realloc() is C-specific, stopped";
528-}
529-
530-sub srand {
531- unimpl "srand()";
532-}
533-
534-sub system {
535- usage "system(command)" if @_ != 1;
536- CORE::system($_[0]);
537-}
538-
539-sub memchr {
540- unimpl "memchr() is C-specific, use index() instead";
541-}
542-
543-sub memcmp {
544- unimpl "memcmp() is C-specific, use eq instead";
545-}
546-
547-sub memcpy {
548- unimpl "memcpy() is C-specific, use = instead";
549-}
550-
551-sub memmove {
552- unimpl "memmove() is C-specific, use = instead";
553-}
554-
555-sub memset {
556- unimpl "memset() is C-specific, use x instead";
557-}
558-
559-sub strcat {
560- unimpl "strcat() is C-specific, use .= instead";
561-}
562-
563-sub strchr {
564- unimpl "strchr() is C-specific, use index() instead";
565-}
566-
567-sub strcmp {
568- unimpl "strcmp() is C-specific, use eq instead";
569-}
570-
571-sub strcpy {
572- unimpl "strcpy() is C-specific, use = instead";
573-}
574-
575-sub strcspn {
576- unimpl "strcspn() is C-specific, use regular expressions instead";
577-}
578-
579-sub strerror {
580- usage "strerror(errno)" if @_ != 1;
581- local $! = $_[0];
582- $! . "";
583-}
584-
585-sub strlen {
586- unimpl "strlen() is C-specific, use length instead";
587-}
588-
589-sub strncat {
590- unimpl "strncat() is C-specific, use .= instead";
591-}
592-
593-sub strncmp {
594- unimpl "strncmp() is C-specific, use eq instead";
595-}
596-
597-sub strncpy {
598- unimpl "strncpy() is C-specific, use = instead";
599-}
600-
601-sub strpbrk {
602- unimpl "strpbrk() is C-specific, stopped";
603-}
604-
605-sub strrchr {
606- unimpl "strrchr() is C-specific, use rindex() instead";
607-}
608-
609-sub strspn {
610- unimpl "strspn() is C-specific, stopped";
611-}
612-
613-sub strstr {
614- usage "strstr(big, little)" if @_ != 2;
615- CORE::index($_[0], $_[1]);
616-}
617-
618-sub strtok {
619- unimpl "strtok() is C-specific, stopped";
620-}
621-
622-sub chmod {
623- usage "chmod(mode, filename)" if @_ != 2;
624- CORE::chmod($_[0], $_[1]);
625-}
626-
627-sub fstat {
628- usage "fstat(fd)" if @_ != 1;
629- local *TMP;
630- CORE::open(TMP, "<&$_[0]"); # Gross.
631- my @l = CORE::stat(TMP);
632- CORE::close(TMP);
633- @l;
634-}
635-
636-sub mkdir {
637- usage "mkdir(directoryname, mode)" if @_ != 2;
638- CORE::mkdir($_[0], $_[1]);
639-}
640-
641-sub stat {
642- usage "stat(filename)" if @_ != 1;
643- CORE::stat($_[0]);
644-}
645-
646-sub umask {
647- usage "umask(mask)" if @_ != 1;
648- CORE::umask($_[0]);
649-}
650-
651-sub wait {
652- usage "wait()" if @_ != 0;
653- CORE::wait();
654-}
655-
656-sub waitpid {
657- usage "waitpid(pid, options)" if @_ != 2;
658- CORE::waitpid($_[0], $_[1]);
659-}
660-
661-sub gmtime {
662- usage "gmtime(time)" if @_ != 1;
663- CORE::gmtime($_[0]);
664-}
665-
666-sub localtime {
667- usage "localtime(time)" if @_ != 1;
668- CORE::localtime($_[0]);
669-}
670-
671-sub time {
672- usage "time()" if @_ != 0;
673- CORE::time;
674-}
675-
676-sub alarm {
677- usage "alarm(seconds)" if @_ != 1;
678- CORE::alarm($_[0]);
679-}
680-
681-sub chdir {
682- usage "chdir(directory)" if @_ != 1;
683- CORE::chdir($_[0]);
684-}
685-
686-sub chown {
687- usage "chown(uid, gid, filename)" if @_ != 3;
688- CORE::chown($_[0], $_[1], $_[2]);
689-}
690-
691-sub execl {
692- unimpl "execl() is C-specific, stopped";
693-}
694-
695-sub execle {
696- unimpl "execle() is C-specific, stopped";
697-}
698-
699-sub execlp {
700- unimpl "execlp() is C-specific, stopped";
701-}
702-
703-sub execv {
704- unimpl "execv() is C-specific, stopped";
705-}
706-
707-sub execve {
708- unimpl "execve() is C-specific, stopped";
709-}
710-
711-sub execvp {
712- unimpl "execvp() is C-specific, stopped";
713-}
714-
715-sub fork {
716- usage "fork()" if @_ != 0;
717- CORE::fork;
718-}
719-
720-sub getegid {
721- usage "getegid()" if @_ != 0;
722- $) + 0;
723-}
724-
725-sub geteuid {
726- usage "geteuid()" if @_ != 0;
727- $> + 0;
728-}
729-
730-sub getgid {
731- usage "getgid()" if @_ != 0;
732- $( + 0;
733-}
734-
735-sub getgroups {
736- usage "getgroups()" if @_ != 0;
737- my %seen;
738- grep(!$seen{$_}++, split(' ', $) ));
739-}
740-
741-sub getlogin {
742- usage "getlogin()" if @_ != 0;
743- CORE::getlogin();
744-}
745-
746-sub getpgrp {
747- usage "getpgrp()" if @_ != 0;
748- CORE::getpgrp;
749-}
750-
751-sub getpid {
752- usage "getpid()" if @_ != 0;
753- $$;
754-}
755-
756-sub getppid {
757- usage "getppid()" if @_ != 0;
758- CORE::getppid;
759-}
760-
761-sub getuid {
762- usage "getuid()" if @_ != 0;
763- $<;
764-}
765-
766-sub isatty {
767- usage "isatty(filehandle)" if @_ != 1;
768- -t $_[0];
769-}
770-
771-sub link {
772- usage "link(oldfilename, newfilename)" if @_ != 2;
773- CORE::link($_[0], $_[1]);
774-}
775-
776-sub rmdir {
777- usage "rmdir(directoryname)" if @_ != 1;
778- CORE::rmdir($_[0]);
779-}
780-
781-sub setbuf {
782- redef "IO::Handle::setbuf()";
783-}
784-
785-sub setvbuf {
786- redef "IO::Handle::setvbuf()";
787-}
788-
789-sub sleep {
790- usage "sleep(seconds)" if @_ != 1;
791- $_[0] - CORE::sleep($_[0]);
792-}
793-
794-sub unlink {
795- usage "unlink(filename)" if @_ != 1;
796- CORE::unlink($_[0]);
797-}
798-
799-sub utime {
800- usage "utime(filename, atime, mtime)" if @_ != 3;
801- CORE::utime($_[1], $_[2], $_[0]);
802-}
803-
804-sub load_imports {
805-%EXPORT_TAGS = (
806-
807- assert_h => [qw(assert NDEBUG)],
808-
809- ctype_h => [qw(isalnum isalpha iscntrl isdigit isgraph islower
810- isprint ispunct isspace isupper isxdigit tolower toupper)],
811-
812- dirent_h => [],
813-
814- errno_h => [qw(E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT
815- EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED
816- ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT
817- EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS
818- EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK
819- EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH
820- ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM
821- ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR
822- ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM
823- EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE
824- ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT
825- ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY
826- EUSERS EWOULDBLOCK EXDEV errno)],
827-
828- fcntl_h => [qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK
829- F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK
830- O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK
831- O_RDONLY O_RDWR O_TRUNC O_WRONLY
832- creat
833- SEEK_CUR SEEK_END SEEK_SET
834- S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU
835- S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG S_ISUID
836- S_IWGRP S_IWOTH S_IWUSR)],
837-
838- float_h => [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG
839- DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP
840- DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP
841- FLT_DIG FLT_EPSILON FLT_MANT_DIG
842- FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP
843- FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP
844- FLT_RADIX FLT_ROUNDS
845- LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG
846- LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP
847- LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)],
848-
849- grp_h => [],
850-
851- limits_h => [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX
852- INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON
853- MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX
854- PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN
855- SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX
856- ULONG_MAX USHRT_MAX _POSIX_ARG_MAX _POSIX_CHILD_MAX
857- _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT
858- _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_OPEN_MAX
859- _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX
860- _POSIX_STREAM_MAX _POSIX_TZNAME_MAX)],
861-
862- locale_h => [qw(LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES
863- LC_MONETARY LC_NUMERIC LC_TIME NULL
864- localeconv setlocale)],
865-
866- math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod
867- frexp ldexp log10 modf pow sinh tan tanh)],
868-
869- pwd_h => [],
870-
871- setjmp_h => [qw(longjmp setjmp siglongjmp sigsetjmp)],
872-
873- signal_h => [qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK
874- SA_RESETHAND SA_RESTART SA_SIGINFO SIGABRT SIGALRM
875- SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL
876- SIGPIPE %SIGRT SIGRTMIN SIGRTMAX SIGQUIT SIGSEGV SIGSTOP
877- SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2
878- SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK SIG_UNBLOCK
879- raise sigaction signal sigpending sigprocmask sigsuspend)],
880-
881- stdarg_h => [],
882-
883- stddef_h => [qw(NULL offsetof)],
884-
885- stdio_h => [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid
886- L_tmpname NULL SEEK_CUR SEEK_END SEEK_SET
887- STREAM_MAX TMP_MAX stderr stdin stdout
888- clearerr fclose fdopen feof ferror fflush fgetc fgetpos
889- fgets fopen fprintf fputc fputs fread freopen
890- fscanf fseek fsetpos ftell fwrite getchar gets
891- perror putc putchar puts remove rewind
892- scanf setbuf setvbuf sscanf tmpfile tmpnam
893- ungetc vfprintf vprintf vsprintf)],
894-
895- stdlib_h => [qw(EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX
896- abort atexit atof atoi atol bsearch calloc div
897- free getenv labs ldiv malloc mblen mbstowcs mbtowc
898- qsort realloc strtod strtol strtoul wcstombs wctomb)],
899-
900- string_h => [qw(NULL memchr memcmp memcpy memmove memset strcat
901- strchr strcmp strcoll strcpy strcspn strerror strlen
902- strncat strncmp strncpy strpbrk strrchr strspn strstr
903- strtok strxfrm)],
904-
905- sys_stat_h => [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU
906- S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG
907- S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
908- fstat mkfifo)],
909-
910- sys_times_h => [],
911-
912- sys_types_h => [],
913-
914- sys_utsname_h => [qw(uname)],
915-
916- sys_wait_h => [qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED
917- WNOHANG WSTOPSIG WTERMSIG WUNTRACED)],
918-
919- termios_h => [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400
920- B300 B38400 B4800 B50 B600 B75 B9600 BRKINT CLOCAL
921- CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB ECHO ECHOE ECHOK
922- ECHONL HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR
923- INLCR INPCK ISIG ISTRIP IXOFF IXON NCCS NOFLSH OPOST
924- PARENB PARMRK PARODD TCIFLUSH TCIOFF TCIOFLUSH TCION
925- TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW
926- TOSTOP VEOF VEOL VERASE VINTR VKILL VMIN VQUIT VSTART
927- VSTOP VSUSP VTIME
928- cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcdrain
929- tcflow tcflush tcgetattr tcsendbreak tcsetattr )],
930-
931- time_h => [qw(CLK_TCK CLOCKS_PER_SEC NULL asctime clock ctime
932- difftime mktime strftime tzset tzname)],
933-
934- unistd_h => [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET
935- STDERR_FILENO STDIN_FILENO STDOUT_FILENO W_OK X_OK
936- _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON
937- _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX
938- _PC_PIPE_BUF _PC_VDISABLE _POSIX_CHOWN_RESTRICTED
939- _POSIX_JOB_CONTROL _POSIX_NO_TRUNC _POSIX_SAVED_IDS
940- _POSIX_VDISABLE _POSIX_VERSION _SC_ARG_MAX
941- _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL
942- _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS
943- _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
944- _exit access ctermid cuserid
945- dup2 dup execl execle execlp execv execve execvp
946- fpathconf fsync getcwd getegid geteuid getgid getgroups
947- getpid getuid isatty lseek pathconf pause setgid setpgid
948- setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)],
949-
950- utime_h => [],
951-
952-);
953-
954-# Exporter::export_tags();
955-{
956- # De-duplicate the export list:
957- my %export;
958- @export{map {@$_} values %EXPORT_TAGS} = ();
959- # Doing the de-dup with a temporary hash has the advantage that the SVs in
960- # @EXPORT are actually shared hash key sacalars, which will save some memory.
961- push @EXPORT, keys %export;
962-}
963-
964-@EXPORT_OK = qw(
965- abs
966- alarm
967- atan2
968- chdir
969- chmod
970- chown
971- close
972- closedir
973- cos
974- exit
975- exp
976- fcntl
977- fileno
978- fork
979- getc
980- getgrgid
981- getgrnam
982- getlogin
983- getpgrp
984- getppid
985- getpwnam
986- getpwuid
987- gmtime
988- isatty
989- kill
990- lchown
991- link
992- localtime
993- log
994- mkdir
995- nice
996- open
997- opendir
998- pipe
999- printf
1000- rand
1001- read
1002- readdir
1003- rename
1004- rewinddir
1005- rmdir
1006- sin
1007- sleep
1008- sprintf
1009- sqrt
1010- srand
1011- stat
1012- system
1013- time
1014- times
1015- umask
1016- unlink
1017- utime
1018- wait
1019- waitpid
1020- write
1021-);
1022-
1023-require Exporter;
1024-}
1025-
1026-package POSIX::SigAction;
1027-
1028-sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0, SAFE => 0}, $_[0] }
1029-sub handler { $_[0]->{HANDLER} = $_[1] if @_ > 1; $_[0]->{HANDLER} };
1030-sub mask { $_[0]->{MASK} = $_[1] if @_ > 1; $_[0]->{MASK} };
1031-sub flags { $_[0]->{FLAGS} = $_[1] if @_ > 1; $_[0]->{FLAGS} };
1032-sub safe { $_[0]->{SAFE} = $_[1] if @_ > 1; $_[0]->{SAFE} };
1033-
1034-package POSIX::SigRt;
1035-
1036-
1037-sub _init {
1038- $_SIGRTMIN = &POSIX::SIGRTMIN;
1039- $_SIGRTMAX = &POSIX::SIGRTMAX;
1040- $_sigrtn = $_SIGRTMAX - $_SIGRTMIN;
1041-}
1042-
1043-sub _croak {
1044- &_init unless defined $_sigrtn;
1045- die "POSIX::SigRt not available" unless defined $_sigrtn && $_sigrtn > 0;
1046-}
1047-
1048-sub _getsig {
1049- &_croak;
1050- my $rtsig = $_[0];
1051- # Allow (SIGRT)?MIN( + n)?, a common idiom when doing these things in C.
1052- $rtsig = $_SIGRTMIN + ($1 || 0)
1053- if $rtsig =~ /^(?:(?:SIG)?RT)?MIN(\s*\+\s*(\d+))?$/;
1054- return $rtsig;
1055-}
1056-
1057-sub _exist {
1058- my $rtsig = _getsig($_[1]);
1059- my $ok = $rtsig >= $_SIGRTMIN && $rtsig <= $_SIGRTMAX;
1060- ($rtsig, $ok);
1061-}
1062-
1063-sub _check {
1064- my ($rtsig, $ok) = &_exist;
1065- die "No POSIX::SigRt signal $_[1] (valid range SIGRTMIN..SIGRTMAX, or $_SIGRTMIN..$_SIGRTMAX)"
1066- unless $ok;
1067- return $rtsig;
1068-}
1069-
1070-sub new {
1071- my ($rtsig, $handler, $flags) = @_;
1072- my $sigset = POSIX::SigSet->new($rtsig);
1073- my $sigact = POSIX::SigAction->new($handler,
1074- $sigset,
1075- $flags);
1076- POSIX::sigaction($rtsig, $sigact);
1077-}
1078-
1079-sub EXISTS { &_exist }
1080-sub FETCH { my $rtsig = &_check;
1081- my $oa = POSIX::SigAction->new();
1082- POSIX::sigaction($rtsig, undef, $oa);
1083- return $oa->{HANDLER} }
1084-sub STORE { my $rtsig = &_check; new($rtsig, $_[2], $SIGACTION_FLAGS) }
1085-sub DELETE { delete $SIG{ &_check } }
1086-sub CLEAR { &_exist; delete @SIG{ &POSIX::SIGRTMIN .. &POSIX::SIGRTMAX } }
1087-sub SCALAR { &_croak; $_sigrtn + 1 }
1088diff --git a/ext/POSIX/POSIX.pod b/ext/POSIX/POSIX.pod
1089deleted file mode 100644
1090index 64852e9..0000000
1091--- a/ext/POSIX/POSIX.pod
1092+++ /dev/null
1093@@ -1,2218 +0,0 @@
1094-=head1 NAME
1095-
1096-POSIX - Perl interface to IEEE Std 1003.1
1097-
1098-=head1 SYNOPSIS
1099-
1100- use POSIX;
1101- use POSIX qw(setsid);
1102- use POSIX qw(:errno_h :fcntl_h);
1103-
1104- printf "EINTR is %d\n", EINTR;
1105-
1106- $sess_id = POSIX::setsid();
1107-
1108- $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
1109- # note: that's a filedescriptor, *NOT* a filehandle
1110-
1111-=head1 DESCRIPTION
1112-
1113-The POSIX module permits you to access all (or nearly all) the standard
1114-POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish
1115-interfaces.
1116-
1117-I<Everything is exported by default> with the exception of any POSIX
1118-functions with the same name as a built-in Perl function, such as
1119-C<abs>, C<alarm>, C<rmdir>, C<write>, etc.., which will be exported
1120-only if you ask for them explicitly. This is an unfortunate backwards
1121-compatibility feature. You can stop the exporting by saying C<use
1122-POSIX ()> and then use the fully qualified names (ie. C<POSIX::SEEK_END>).
1123-
1124-This document gives a condensed list of the features available in the POSIX
1125-module. Consult your operating system's manpages for general information on
1126-most features. Consult L<perlfunc> for functions which are noted as being
1127-identical to Perl's builtin functions.
1128-
1129-The first section describes POSIX functions from the 1003.1 specification.
1130-The second section describes some classes for signal objects, TTY objects,
1131-and other miscellaneous objects. The remaining sections list various
1132-constants and macros in an organization which roughly follows IEEE Std
1133-1003.1b-1993.
1134-
1135-=head1 NOTE
1136-
1137-The POSIX module is probably the most complex Perl module supplied with
1138-the standard distribution. It incorporates autoloading, namespace games,
1139-and dynamic loading of code that's in Perl, C, or both. It's a great
1140-source of wisdom.
1141-
1142-=head1 CAVEATS
1143-
1144-A few functions are not implemented because they are C specific. If you
1145-attempt to call these, they will print a message telling you that they
1146-aren't implemented, and suggest using the Perl equivalent should one
1147-exist. For example, trying to access the setjmp() call will elicit the
1148-message "setjmp() is C-specific: use eval {} instead".
1149-
1150-Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
1151-are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
1152-For example, one vendor may not define EDEADLK, or the semantics of the
1153-errno values set by open(2) might not be quite right. Perl does not
1154-attempt to verify POSIX compliance. That means you can currently
1155-successfully say "use POSIX", and then later in your program you find
1156-that your vendor has been lax and there's no usable ICANON macro after
1157-all. This could be construed to be a bug.
1158-
1159-=head1 FUNCTIONS
1160-
1161-=over 8
1162-
1163-=item _exit
1164-
1165-This is identical to the C function C<_exit()>. It exits the program
1166-immediately which means among other things buffered I/O is B<not> flushed.
1167-
1168-Note that when using threads and in Linux this is B<not> a good way to
1169-exit a thread because in Linux processes and threads are kind of the
1170-same thing (Note: while this is the situation in early 2003 there are
1171-projects under way to have threads with more POSIXly semantics in Linux).
1172-If you want not to return from a thread, detach the thread.
1173-
1174-=item abort
1175-
1176-This is identical to the C function C<abort()>. It terminates the
1177-process with a C<SIGABRT> signal unless caught by a signal handler or
1178-if the handler does not return normally (it e.g. does a C<longjmp>).
1179-
1180-=item abs
1181-
1182-This is identical to Perl's builtin C<abs()> function, returning
1183-the absolute value of its numerical argument.
1184-
1185-=item access
1186-
1187-Determines the accessibility of a file.
1188-
1189- if( POSIX::access( "/", &POSIX::R_OK ) ){
1190- print "have read permission\n";
1191- }
1192-
1193-Returns C<undef> on failure. Note: do not use C<access()> for
1194-security purposes. Between the C<access()> call and the operation
1195-you are preparing for the permissions might change: a classic
1196-I<race condition>.
1197-
1198-=item acos
1199-
1200-This is identical to the C function C<acos()>, returning
1201-the arcus cosine of its numerical argument. See also L<Math::Trig>.
1202-
1203-=item alarm
1204-
1205-This is identical to Perl's builtin C<alarm()> function,
1206-either for arming or disarming the C<SIGARLM> timer.
1207-
1208-=item asctime
1209-
1210-This is identical to the C function C<asctime()>. It returns
1211-a string of the form
1212-
1213- "Fri Jun 2 18:22:13 2000\n\0"
1214-
1215-and it is called thusly
1216-
1217- $asctime = asctime($sec, $min, $hour, $mday, $mon, $year,
1218- $wday, $yday, $isdst);
1219-
1220-The C<$mon> is zero-based: January equals C<0>. The C<$year> is
1221-1900-based: 2001 equals C<101>. C<$wday> and C<$yday> default to zero
1222-(and are usually ignored anyway), and C<$isdst> defaults to -1.
1223-
1224-=item asin
1225-
1226-This is identical to the C function C<asin()>, returning
1227-the arcus sine of its numerical argument. See also L<Math::Trig>.
1228-
1229-=item assert
1230-
1231-Unimplemented, but you can use L<perlfunc/die> and the L<Carp> module
1232-to achieve similar things.
1233-
1234-=item atan
1235-
1236-This is identical to the C function C<atan()>, returning the
1237-arcus tangent of its numerical argument. See also L<Math::Trig>.
1238-
1239-=item atan2
1240-
1241-This is identical to Perl's builtin C<atan2()> function, returning
1242-the arcus tangent defined by its two numerical arguments, the I<y>
1243-coordinate and the I<x> coordinate. See also L<Math::Trig>.
1244-
1245-=item atexit
1246-
1247-atexit() is C-specific: use C<END {}> instead, see L<perlsub>.
1248-
1249-=item atof
1250-
1251-atof() is C-specific. Perl converts strings to numbers transparently.
1252-If you need to force a scalar to a number, add a zero to it.
1253-
1254-=item atoi
1255-
1256-atoi() is C-specific. Perl converts strings to numbers transparently.
1257-If you need to force a scalar to a number, add a zero to it.
1258-If you need to have just the integer part, see L<perlfunc/int>.
1259-
1260-=item atol
1261-
1262-atol() is C-specific. Perl converts strings to numbers transparently.
1263-If you need to force a scalar to a number, add a zero to it.
1264-If you need to have just the integer part, see L<perlfunc/int>.
1265-
1266-=item bsearch
1267-
1268-bsearch() not supplied. For doing binary search on wordlists,
1269-see L<Search::Dict>.
1270-
1271-=item calloc
1272-
1273-calloc() is C-specific. Perl does memory management transparently.
1274-
1275-=item ceil
1276-
1277-This is identical to the C function C<ceil()>, returning the smallest
1278-integer value greater than or equal to the given numerical argument.
1279-
1280-=item chdir
1281-
1282-This is identical to Perl's builtin C<chdir()> function, allowing
1283-one to change the working (default) directory, see L<perlfunc/chdir>.
1284-
1285-=item chmod
1286-
1287-This is identical to Perl's builtin C<chmod()> function, allowing
1288-one to change file and directory permissions, see L<perlfunc/chmod>.
1289-
1290-=item chown
1291-
1292-This is identical to Perl's builtin C<chown()> function, allowing one
1293-to change file and directory owners and groups, see L<perlfunc/chown>.
1294-
1295-=item clearerr
1296-
1297-Use the method C<IO::Handle::clearerr()> instead, to reset the error
1298-state (if any) and EOF state (if any) of the given stream.
1299-
1300-=item clock
1301-
1302-This is identical to the C function C<clock()>, returning the
1303-amount of spent processor time in microseconds.
1304-
1305-=item close
1306-
1307-Close the file. This uses file descriptors such as those obtained by calling
1308-C<POSIX::open>.
1309-
1310- $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1311- POSIX::close( $fd );
1312-
1313-Returns C<undef> on failure.
1314-
1315-See also L<perlfunc/close>.
1316-
1317-=item closedir
1318-
1319-This is identical to Perl's builtin C<closedir()> function for closing
1320-a directory handle, see L<perlfunc/closedir>.
1321-
1322-=item cos
1323-
1324-This is identical to Perl's builtin C<cos()> function, for returning
1325-the cosine of its numerical argument, see L<perlfunc/cos>.
1326-See also L<Math::Trig>.
1327-
1328-=item cosh
1329-
1330-This is identical to the C function C<cosh()>, for returning
1331-the hyperbolic cosine of its numeric argument. See also L<Math::Trig>.
1332-
1333-=item creat
1334-
1335-Create a new file. This returns a file descriptor like the ones returned by
1336-C<POSIX::open>. Use C<POSIX::close> to close the file.
1337-
1338- $fd = POSIX::creat( "foo", 0611 );
1339- POSIX::close( $fd );
1340-
1341-See also L<perlfunc/sysopen> and its C<O_CREAT> flag.
1342-
1343-=item ctermid
1344-
1345-Generates the path name for the controlling terminal.
1346-
1347- $path = POSIX::ctermid();
1348-
1349-=item ctime
1350-
1351-This is identical to the C function C<ctime()> and equivalent
1352-to C<asctime(localtime(...))>, see L</asctime> and L</localtime>.
1353-
1354-=item cuserid
1355-
1356-Get the login name of the owner of the current process.
1357-
1358- $name = POSIX::cuserid();
1359-
1360-=item difftime
1361-
1362-This is identical to the C function C<difftime()>, for returning
1363-the time difference (in seconds) between two times (as returned
1364-by C<time()>), see L</time>.
1365-
1366-=item div
1367-
1368-div() is C-specific, use L<perlfunc/int> on the usual C</> division and
1369-the modulus C<%>.
1370-
1371-=item dup
1372-
1373-This is similar to the C function C<dup()>, for duplicating a file
1374-descriptor.
1375-
1376-This uses file descriptors such as those obtained by calling
1377-C<POSIX::open>.
1378-
1379-Returns C<undef> on failure.
1380-
1381-=item dup2
1382-
1383-This is similar to the C function C<dup2()>, for duplicating a file
1384-descriptor to an another known file descriptor.
1385-
1386-This uses file descriptors such as those obtained by calling
1387-C<POSIX::open>.
1388-
1389-Returns C<undef> on failure.
1390-
1391-=item errno
1392-
1393-Returns the value of errno.
1394-
1395- $errno = POSIX::errno();
1396-
1397-This identical to the numerical values of the C<$!>, see L<perlvar/$ERRNO>.
1398-
1399-=item execl
1400-
1401-execl() is C-specific, see L<perlfunc/exec>.
1402-
1403-=item execle
1404-
1405-execle() is C-specific, see L<perlfunc/exec>.
1406-
1407-=item execlp
1408-
1409-execlp() is C-specific, see L<perlfunc/exec>.
1410-
1411-=item execv
1412-
1413-execv() is C-specific, see L<perlfunc/exec>.
1414-
1415-=item execve
1416-
1417-execve() is C-specific, see L<perlfunc/exec>.
1418-
1419-=item execvp
1420-
1421-execvp() is C-specific, see L<perlfunc/exec>.
1422-
1423-=item exit
1424-
1425-This is identical to Perl's builtin C<exit()> function for exiting the
1426-program, see L<perlfunc/exit>.
1427-
1428-=item exp
1429-
1430-This is identical to Perl's builtin C<exp()> function for
1431-returning the exponent (I<e>-based) of the numerical argument,
1432-see L<perlfunc/exp>.
1433-
1434-=item fabs
1435-
1436-This is identical to Perl's builtin C<abs()> function for returning
1437-the absolute value of the numerical argument, see L<perlfunc/abs>.
1438-
1439-=item fclose
1440-
1441-Use method C<IO::Handle::close()> instead, or see L<perlfunc/close>.
1442-
1443-=item fcntl
1444-
1445-This is identical to Perl's builtin C<fcntl()> function,
1446-see L<perlfunc/fcntl>.
1447-
1448-=item fdopen
1449-
1450-Use method C<IO::Handle::new_from_fd()> instead, or see L<perlfunc/open>.
1451-
1452-=item feof
1453-
1454-Use method C<IO::Handle::eof()> instead, or see L<perlfunc/eof>.
1455-
1456-=item ferror
1457-
1458-Use method C<IO::Handle::error()> instead.
1459-
1460-=item fflush
1461-
1462-Use method C<IO::Handle::flush()> instead.
1463-See also L<perlvar/$OUTPUT_AUTOFLUSH>.
1464-
1465-=item fgetc
1466-
1467-Use method C<IO::Handle::getc()> instead, or see L<perlfunc/read>.
1468-
1469-=item fgetpos
1470-
1471-Use method C<IO::Seekable::getpos()> instead, or see L<L/seek>.
1472-
1473-=item fgets
1474-
1475-Use method C<IO::Handle::gets()> instead. Similar to E<lt>E<gt>, also known
1476-as L<perlfunc/readline>.
1477-
1478-=item fileno
1479-
1480-Use method C<IO::Handle::fileno()> instead, or see L<perlfunc/fileno>.
1481-
1482-=item floor
1483-
1484-This is identical to the C function C<floor()>, returning the largest
1485-integer value less than or equal to the numerical argument.
1486-
1487-=item fmod
1488-
1489-This is identical to the C function C<fmod()>.
1490-
1491- $r = fmod($x, $y);
1492-
1493-It returns the remainder C<$r = $x - $n*$y>, where C<$n = trunc($x/$y)>.
1494-The C<$r> has the same sign as C<$x> and magnitude (absolute value)
1495-less than the magnitude of C<$y>.
1496-
1497-=item fopen
1498-
1499-Use method C<IO::File::open()> instead, or see L<perlfunc/open>.
1500-
1501-=item fork
1502-
1503-This is identical to Perl's builtin C<fork()> function
1504-for duplicating the current process, see L<perlfunc/fork>
1505-and L<perlfork> if you are in Windows.
1506-
1507-=item fpathconf
1508-
1509-Retrieves the value of a configurable limit on a file or directory. This
1510-uses file descriptors such as those obtained by calling C<POSIX::open>.
1511-
1512-The following will determine the maximum length of the longest allowable
1513-pathname on the filesystem which holds C</var/foo>.
1514-
1515- $fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
1516- $path_max = POSIX::fpathconf( $fd, &POSIX::_PC_PATH_MAX );
1517-
1518-Returns C<undef> on failure.
1519-
1520-=item fprintf
1521-
1522-fprintf() is C-specific, see L<perlfunc/printf> instead.
1523-
1524-=item fputc
1525-
1526-fputc() is C-specific, see L<perlfunc/print> instead.
1527-
1528-=item fputs
1529-
1530-fputs() is C-specific, see L<perlfunc/print> instead.
1531-
1532-=item fread
1533-
1534-fread() is C-specific, see L<perlfunc/read> instead.
1535-
1536-=item free
1537-
1538-free() is C-specific. Perl does memory management transparently.
1539-
1540-=item freopen
1541-
1542-freopen() is C-specific, see L<perlfunc/open> instead.
1543-
1544-=item frexp
1545-
1546-Return the mantissa and exponent of a floating-point number.
1547-
1548- ($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
1549-
1550-=item fscanf
1551-
1552-fscanf() is C-specific, use E<lt>E<gt> and regular expressions instead.
1553-
1554-=item fseek
1555-
1556-Use method C<IO::Seekable::seek()> instead, or see L<perlfunc/seek>.
1557-
1558-=item fsetpos
1559-
1560-Use method C<IO::Seekable::setpos()> instead, or seek L<perlfunc/seek>.
1561-
1562-=item fstat
1563-
1564-Get file status. This uses file descriptors such as those obtained by
1565-calling C<POSIX::open>. The data returned is identical to the data from
1566-Perl's builtin C<stat> function.
1567-
1568- $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1569- @stats = POSIX::fstat( $fd );
1570-
1571-=item fsync
1572-
1573-Use method C<IO::Handle::sync()> instead.
1574-
1575-=item ftell
1576-
1577-Use method C<IO::Seekable::tell()> instead, or see L<perlfunc/tell>.
1578-
1579-=item fwrite
1580-
1581-fwrite() is C-specific, see L<perlfunc/print> instead.
1582-
1583-=item getc
1584-
1585-This is identical to Perl's builtin C<getc()> function,
1586-see L<perlfunc/getc>.
1587-
1588-=item getchar
1589-
1590-Returns one character from STDIN. Identical to Perl's C<getc()>,
1591-see L<perlfunc/getc>.
1592-
1593-=item getcwd
1594-
1595-Returns the name of the current working directory.
1596-See also L<Cwd>.
1597-
1598-=item getegid
1599-
1600-Returns the effective group identifier. Similar to Perl' s builtin
1601-variable C<$(>, see L<perlvar/$EGID>.
1602-
1603-=item getenv
1604-
1605-Returns the value of the specified environment variable.
1606-The same information is available through the C<%ENV> array.
1607-
1608-=item geteuid
1609-
1610-Returns the effective user identifier. Identical to Perl's builtin C<$E<gt>>
1611-variable, see L<perlvar/$EUID>.
1612-
1613-=item getgid
1614-
1615-Returns the user's real group identifier. Similar to Perl's builtin
1616-variable C<$)>, see L<perlvar/$GID>.
1617-
1618-=item getgrgid
1619-
1620-This is identical to Perl's builtin C<getgrgid()> function for
1621-returning group entries by group identifiers, see
1622-L<perlfunc/getgrgid>.
1623-
1624-=item getgrnam
1625-
1626-This is identical to Perl's builtin C<getgrnam()> function for
1627-returning group entries by group names, see L<perlfunc/getgrnam>.
1628-
1629-=item getgroups
1630-
1631-Returns the ids of the user's supplementary groups. Similar to Perl's
1632-builtin variable C<$)>, see L<perlvar/$GID>.
1633-
1634-=item getlogin
1635-
1636-This is identical to Perl's builtin C<getlogin()> function for
1637-returning the user name associated with the current session, see
1638-L<perlfunc/getlogin>.
1639-
1640-=item getpgrp
1641-
1642-This is identical to Perl's builtin C<getpgrp()> function for
1643-returning the process group identifier of the current process, see
1644-L<perlfunc/getpgrp>.
1645-
1646-=item getpid
1647-
1648-Returns the process identifier. Identical to Perl's builtin
1649-variable C<$$>, see L<perlvar/$PID>.
1650-
1651-=item getppid
1652-
1653-This is identical to Perl's builtin C<getppid()> function for
1654-returning the process identifier of the parent process of the current
1655-process , see L<perlfunc/getppid>.
1656-
1657-=item getpwnam
1658-
1659-This is identical to Perl's builtin C<getpwnam()> function for
1660-returning user entries by user names, see L<perlfunc/getpwnam>.
1661-
1662-=item getpwuid
1663-
1664-This is identical to Perl's builtin C<getpwuid()> function for
1665-returning user entries by user identifiers, see L<perlfunc/getpwuid>.
1666-
1667-=item gets
1668-
1669-Returns one line from C<STDIN>, similar to E<lt>E<gt>, also known
1670-as the C<readline()> function, see L<perlfunc/readline>.
1671-
1672-B<NOTE>: if you have C programs that still use C<gets()>, be very
1673-afraid. The C<gets()> function is a source of endless grief because
1674-it has no buffer overrun checks. It should B<never> be used. The
1675-C<fgets()> function should be preferred instead.
1676-
1677-=item getuid
1678-
1679-Returns the user's identifier. Identical to Perl's builtin C<$E<lt>> variable,
1680-see L<perlvar/$UID>.
1681-
1682-=item gmtime
1683-
1684-This is identical to Perl's builtin C<gmtime()> function for
1685-converting seconds since the epoch to a date in Greenwich Mean Time,
1686-see L<perlfunc/gmtime>.
1687-
1688-=item isalnum
1689-
1690-This is identical to the C function, except that it can apply to a
1691-single character or to a whole string. Note that locale settings may
1692-affect what characters are considered C<isalnum>. Does not work on
1693-Unicode characters code point 256 or higher. Consider using regular
1694-expressions and the C</[[:alnum:]]/> construct instead, or possibly
1695-the C</\w/> construct.
1696-
1697-=item isalpha
1698-
1699-This is identical to the C function, except that it can apply to
1700-a single character or to a whole string. Note that locale settings
1701-may affect what characters are considered C<isalpha>. Does not work
1702-on Unicode characters code point 256 or higher. Consider using regular
1703-expressions and the C</[[:alpha:]]/> construct instead.
1704-
1705-=item isatty
1706-
1707-Returns a boolean indicating whether the specified filehandle is connected
1708-to a tty. Similar to the C<-t> operator, see L<perlfunc/-X>.
1709-
1710-=item iscntrl
1711-
1712-This is identical to the C function, except that it can apply to
1713-a single character or to a whole string. Note that locale settings
1714-may affect what characters are considered C<iscntrl>. Does not work
1715-on Unicode characters code point 256 or higher. Consider using regular
1716-expressions and the C</[[:cntrl:]]/> construct instead.
1717-
1718-=item isdigit
1719-
1720-This is identical to the C function, except that it can apply to
1721-a single character or to a whole string. Note that locale settings
1722-may affect what characters are considered C<isdigit> (unlikely, but
1723-still possible). Does not work on Unicode characters code point 256
1724-or higher. Consider using regular expressions and the C</[[:digit:]]/>
1725-construct instead, or the C</\d/> construct.
1726-
1727-=item isgraph
1728-
1729-This is identical to the C function, except that it can apply to
1730-a single character or to a whole string. Note that locale settings
1731-may affect what characters are considered C<isgraph>. Does not work
1732-on Unicode characters code point 256 or higher. Consider using regular
1733-expressions and the C</[[:graph:]]/> construct instead.
1734-
1735-=item islower
1736-
1737-This is identical to the C function, except that it can apply to
1738-a single character or to a whole string. Note that locale settings
1739-may affect what characters are considered C<islower>. Does not work
1740-on Unicode characters code point 256 or higher. Consider using regular
1741-expressions and the C</[[:lower:]]/> construct instead. Do B<not> use
1742-C</[a-z]/>.
1743-
1744-=item isprint
1745-
1746-This is identical to the C function, except that it can apply to
1747-a single character or to a whole string. Note that locale settings
1748-may affect what characters are considered C<isprint>. Does not work
1749-on Unicode characters code point 256 or higher. Consider using regular
1750-expressions and the C</[[:print:]]/> construct instead.
1751-
1752-=item ispunct
1753-
1754-This is identical to the C function, except that it can apply to
1755-a single character or to a whole string. Note that locale settings
1756-may affect what characters are considered C<ispunct>. Does not work
1757-on Unicode characters code point 256 or higher. Consider using regular
1758-expressions and the C</[[:punct:]]/> construct instead.
1759-
1760-=item isspace
1761-
1762-This is identical to the C function, except that it can apply to
1763-a single character or to a whole string. Note that locale settings
1764-may affect what characters are considered C<isspace>. Does not work
1765-on Unicode characters code point 256 or higher. Consider using regular
1766-expressions and the C</[[:space:]]/> construct instead, or the C</\s/>
1767-construct. (Note that C</\s/> and C</[[:space:]]/> are slightly
1768-different in that C</[[:space:]]/> can normally match a vertical tab,
1769-while C</\s/> does not.)
1770-
1771-=item isupper
1772-
1773-This is identical to the C function, except that it can apply to
1774-a single character or to a whole string. Note that locale settings
1775-may affect what characters are considered C<isupper>. Does not work
1776-on Unicode characters code point 256 or higher. Consider using regular
1777-expressions and the C</[[:upper:]]/> construct instead. Do B<not> use
1778-C</[A-Z]/>.
1779-
1780-=item isxdigit
1781-
1782-This is identical to the C function, except that it can apply to a single
1783-character or to a whole string. Note that locale settings may affect what
1784-characters are considered C<isxdigit> (unlikely, but still possible).
1785-Does not work on Unicode characters code point 256 or higher.
1786-Consider using regular expressions and the C</[[:xdigit:]]/>
1787-construct instead, or simply C</[0-9a-f]/i>.
1788-
1789-=item kill
1790-
1791-This is identical to Perl's builtin C<kill()> function for sending
1792-signals to processes (often to terminate them), see L<perlfunc/kill>.
1793-
1794-=item labs
1795-
1796-(For returning absolute values of long integers.)
1797-labs() is C-specific, see L<perlfunc/abs> instead.
1798-
1799-=item lchown
1800-
1801-This is identical to the C function, except the order of arguments is
1802-consistent with Perl's builtin C<chown()> with the added restriction
1803-of only one path, not an list of paths. Does the same thing as the
1804-C<chown()> function but changes the owner of a symbolic link instead
1805-of the file the symbolic link points to.
1806-
1807-=item ldexp
1808-
1809-This is identical to the C function C<ldexp()>
1810-for multiplying floating point numbers with powers of two.
1811-
1812- $x_quadrupled = POSIX::ldexp($x, 2);
1813-
1814-=item ldiv
1815-
1816-(For computing dividends of long integers.)
1817-ldiv() is C-specific, use C</> and C<int()> instead.
1818-
1819-=item link
1820-
1821-This is identical to Perl's builtin C<link()> function
1822-for creating hard links into files, see L<perlfunc/link>.
1823-
1824-=item localeconv
1825-
1826-Get numeric formatting information. Returns a reference to a hash
1827-containing the current locale formatting values.
1828-
1829-Here is how to query the database for the B<de> (Deutsch or German) locale.
1830-
1831- $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
1832- print "Locale = $loc\n";
1833- $lconv = POSIX::localeconv();
1834- print "decimal_point = ", $lconv->{decimal_point}, "\n";
1835- print "thousands_sep = ", $lconv->{thousands_sep}, "\n";
1836- print "grouping = ", $lconv->{grouping}, "\n";
1837- print "int_curr_symbol = ", $lconv->{int_curr_symbol}, "\n";
1838- print "currency_symbol = ", $lconv->{currency_symbol}, "\n";
1839- print "mon_decimal_point = ", $lconv->{mon_decimal_point}, "\n";
1840- print "mon_thousands_sep = ", $lconv->{mon_thousands_sep}, "\n";
1841- print "mon_grouping = ", $lconv->{mon_grouping}, "\n";
1842- print "positive_sign = ", $lconv->{positive_sign}, "\n";
1843- print "negative_sign = ", $lconv->{negative_sign}, "\n";
1844- print "int_frac_digits = ", $lconv->{int_frac_digits}, "\n";
1845- print "frac_digits = ", $lconv->{frac_digits}, "\n";
1846- print "p_cs_precedes = ", $lconv->{p_cs_precedes}, "\n";
1847- print "p_sep_by_space = ", $lconv->{p_sep_by_space}, "\n";
1848- print "n_cs_precedes = ", $lconv->{n_cs_precedes}, "\n";
1849- print "n_sep_by_space = ", $lconv->{n_sep_by_space}, "\n";
1850- print "p_sign_posn = ", $lconv->{p_sign_posn}, "\n";
1851- print "n_sign_posn = ", $lconv->{n_sign_posn}, "\n";
1852-
1853-=item localtime
1854-
1855-This is identical to Perl's builtin C<localtime()> function for
1856-converting seconds since the epoch to a date see L<perlfunc/localtime>.
1857-
1858-=item log
1859-
1860-This is identical to Perl's builtin C<log()> function,
1861-returning the natural (I<e>-based) logarithm of the numerical argument,
1862-see L<perlfunc/log>.
1863-
1864-=item log10
1865-
1866-This is identical to the C function C<log10()>,
1867-returning the 10-base logarithm of the numerical argument.
1868-You can also use
1869-
1870- sub log10 { log($_[0]) / log(10) }
1871-
1872-or
1873-
1874- sub log10 { log($_[0]) / 2.30258509299405 }
1875-
1876-or
1877-
1878- sub log10 { log($_[0]) * 0.434294481903252 }
1879-
1880-=item longjmp
1881-
1882-longjmp() is C-specific: use L<perlfunc/die> instead.
1883-
1884-=item lseek
1885-
1886-Move the file's read/write position. This uses file descriptors such as
1887-those obtained by calling C<POSIX::open>.
1888-
1889- $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
1890- $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
1891-
1892-Returns C<undef> on failure.
1893-
1894-=item malloc
1895-
1896-malloc() is C-specific. Perl does memory management transparently.
1897-
1898-=item mblen
1899-
1900-This is identical to the C function C<mblen()>.
1901-Perl does not have any support for the wide and multibyte
1902-characters of the C standards, so this might be a rather
1903-useless function.
1904-
1905-=item mbstowcs
1906-
1907-This is identical to the C function C<mbstowcs()>.
1908-Perl does not have any support for the wide and multibyte
1909-characters of the C standards, so this might be a rather
1910-useless function.
1911-
1912-=item mbtowc
1913-
1914-This is identical to the C function C<mbtowc()>.
1915-Perl does not have any support for the wide and multibyte
1916-characters of the C standards, so this might be a rather
1917-useless function.
1918-
1919-=item memchr
1920-
1921-memchr() is C-specific, see L<perlfunc/index> instead.
1922-
1923-=item memcmp
1924-
1925-memcmp() is C-specific, use C<eq> instead, see L<perlop>.
1926-
1927-=item memcpy
1928-
1929-memcpy() is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
1930-
1931-=item memmove
1932-
1933-memmove() is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
1934-
1935-=item memset
1936-
1937-memset() is C-specific, use C<x> instead, see L<perlop>.
1938-
1939-=item mkdir
1940-
1941-This is identical to Perl's builtin C<mkdir()> function
1942-for creating directories, see L<perlfunc/mkdir>.
1943-
1944-=item mkfifo
1945-
1946-This is similar to the C function C<mkfifo()> for creating
1947-FIFO special files.
1948-
1949- if (mkfifo($path, $mode)) { ....
1950-
1951-Returns C<undef> on failure. The C<$mode> is similar to the
1952-mode of C<mkdir()>, see L<perlfunc/mkdir>, though for C<mkfifo>
1953-you B<must> specify the C<$mode>.
1954-
1955-=item mktime
1956-
1957-Convert date/time info to a calendar time.
1958-
1959-Synopsis:
1960-
1961- mktime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = -1)
1962-
1963-The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
1964-I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
1965-year (C<year>) is given in years since 1900. I.e. The year 1995 is 95; the
1966-year 2001 is 101. Consult your system's C<mktime()> manpage for details
1967-about these and the other arguments.
1968-
1969-Calendar time for December 12, 1995, at 10:30 am.
1970-
1971- $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
1972- print "Date = ", POSIX::ctime($time_t);
1973-
1974-Returns C<undef> on failure.
1975-
1976-=item modf
1977-
1978-Return the integral and fractional parts of a floating-point number.
1979-
1980- ($fractional, $integral) = POSIX::modf( 3.14 );
1981-
1982-=item nice
1983-
1984-This is similar to the C function C<nice()>, for changing
1985-the scheduling preference of the current process. Positive
1986-arguments mean more polite process, negative values more
1987-needy process. Normal user processes can only be more polite.
1988-
1989-Returns C<undef> on failure.
1990-
1991-=item offsetof
1992-
1993-offsetof() is C-specific, you probably want to see L<perlfunc/pack> instead.
1994-
1995-=item open
1996-
1997-Open a file for reading for writing. This returns file descriptors, not
1998-Perl filehandles. Use C<POSIX::close> to close the file.
1999-
2000-Open a file read-only with mode 0666.
2001-
2002- $fd = POSIX::open( "foo" );
2003-
2004-Open a file for read and write.
2005-
2006- $fd = POSIX::open( "foo", &POSIX::O_RDWR );
2007-
2008-Open a file for write, with truncation.
2009-
2010- $fd = POSIX::open( "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC );
2011-
2012-Create a new file with mode 0640. Set up the file for writing.
2013-
2014- $fd = POSIX::open( "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640 );
2015-
2016-Returns C<undef> on failure.
2017-
2018-See also L<perlfunc/sysopen>.
2019-
2020-=item opendir
2021-
2022-Open a directory for reading.
2023-
2024- $dir = POSIX::opendir( "/var" );
2025- @files = POSIX::readdir( $dir );
2026- POSIX::closedir( $dir );
2027-
2028-Returns C<undef> on failure.
2029-
2030-=item pathconf
2031-
2032-Retrieves the value of a configurable limit on a file or directory.
2033-
2034-The following will determine the maximum length of the longest allowable
2035-pathname on the filesystem which holds C</var>.
2036-
2037- $path_max = POSIX::pathconf( "/var", &POSIX::_PC_PATH_MAX );
2038-
2039-Returns C<undef> on failure.
2040-
2041-=item pause
2042-
2043-This is similar to the C function C<pause()>, which suspends
2044-the execution of the current process until a signal is received.
2045-
2046-Returns C<undef> on failure.
2047-
2048-=item perror
2049-
2050-This is identical to the C function C<perror()>, which outputs to the
2051-standard error stream the specified message followed by ": " and the
2052-current error string. Use the C<warn()> function and the C<$!>
2053-variable instead, see L<perlfunc/warn> and L<perlvar/$ERRNO>.
2054-
2055-=item pipe
2056-
2057-Create an interprocess channel. This returns file descriptors like those
2058-returned by C<POSIX::open>.
2059-
2060- my ($read, $write) = POSIX::pipe();
2061- POSIX::write( $write, "hello", 5 );
2062- POSIX::read( $read, $buf, 5 );
2063-
2064-See also L<perlfunc/pipe>.
2065-
2066-=item pow
2067-
2068-Computes C<$x> raised to the power C<$exponent>.
2069-
2070- $ret = POSIX::pow( $x, $exponent );
2071-
2072-You can also use the C<**> operator, see L<perlop>.
2073-
2074-=item printf
2075-
2076-Formats and prints the specified arguments to STDOUT.
2077-See also L<perlfunc/printf>.
2078-
2079-=item putc
2080-
2081-putc() is C-specific, see L<perlfunc/print> instead.
2082-
2083-=item putchar
2084-
2085-putchar() is C-specific, see L<perlfunc/print> instead.
2086-
2087-=item puts
2088-
2089-puts() is C-specific, see L<perlfunc/print> instead.
2090-
2091-=item qsort
2092-
2093-qsort() is C-specific, see L<perlfunc/sort> instead.
2094-
2095-=item raise
2096-
2097-Sends the specified signal to the current process.
2098-See also L<perlfunc/kill> and the C<$$> in L<perlvar/$PID>.
2099-
2100-=item rand
2101-
2102-C<rand()> is non-portable, see L<perlfunc/rand> instead.
2103-
2104-=item read
2105-
2106-Read from a file. This uses file descriptors such as those obtained by
2107-calling C<POSIX::open>. If the buffer C<$buf> is not large enough for the
2108-read then Perl will extend it to make room for the request.
2109-
2110- $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
2111- $bytes = POSIX::read( $fd, $buf, 3 );
2112-
2113-Returns C<undef> on failure.
2114-
2115-See also L<perlfunc/sysread>.
2116-
2117-=item readdir
2118-
2119-This is identical to Perl's builtin C<readdir()> function
2120-for reading directory entries, see L<perlfunc/readdir>.
2121-
2122-=item realloc
2123-
2124-realloc() is C-specific. Perl does memory management transparently.
2125-
2126-=item remove
2127-
2128-This is identical to Perl's builtin C<unlink()> function
2129-for removing files, see L<perlfunc/unlink>.
2130-
2131-=item rename
2132-
2133-This is identical to Perl's builtin C<rename()> function
2134-for renaming files, see L<perlfunc/rename>.
2135-
2136-=item rewind
2137-
2138-Seeks to the beginning of the file.
2139-
2140-=item rewinddir
2141-
2142-This is identical to Perl's builtin C<rewinddir()> function for
2143-rewinding directory entry streams, see L<perlfunc/rewinddir>.
2144-
2145-=item rmdir
2146-
2147-This is identical to Perl's builtin C<rmdir()> function
2148-for removing (empty) directories, see L<perlfunc/rmdir>.
2149-
2150-=item scanf
2151-
2152-scanf() is C-specific, use E<lt>E<gt> and regular expressions instead,
2153-see L<perlre>.
2154-
2155-=item setgid
2156-
2157-Sets the real group identifier and the effective group identifier for
2158-this process. Similar to assigning a value to the Perl's builtin
2159-C<$)> variable, see L<perlvar/$EGID>, except that the latter
2160-will change only the real user identifier, and that the setgid()
2161-uses only a single numeric argument, as opposed to a space-separated
2162-list of numbers.
2163-
2164-=item setjmp
2165-
2166-C<setjmp()> is C-specific: use C<eval {}> instead,
2167-see L<perlfunc/eval>.
2168-
2169-=item setlocale
2170-
2171-Modifies and queries program's locale. The following examples assume
2172-
2173- use POSIX qw(setlocale LC_ALL LC_CTYPE);
2174-
2175-has been issued.
2176-
2177-The following will set the traditional UNIX system locale behavior
2178-(the second argument C<"C">).
2179-
2180- $loc = setlocale( LC_ALL, "C" );
2181-
2182-The following will query the current LC_CTYPE category. (No second
2183-argument means 'query'.)
2184-
2185- $loc = setlocale( LC_CTYPE );
2186-
2187-The following will set the LC_CTYPE behaviour according to the locale
2188-environment variables (the second argument C<"">).
2189-Please see your systems C<setlocale(3)> documentation for the locale
2190-environment variables' meaning or consult L<perllocale>.
2191-
2192- $loc = setlocale( LC_CTYPE, "" );
2193-
2194-The following will set the LC_COLLATE behaviour to Argentinian
2195-Spanish. B<NOTE>: The naming and availability of locales depends on
2196-your operating system. Please consult L<perllocale> for how to find
2197-out which locales are available in your system.
2198-
2199- $loc = setlocale( LC_COLLATE, "es_AR.ISO8859-1" );
2200-
2201-=item setpgid
2202-
2203-This is similar to the C function C<setpgid()> for
2204-setting the process group identifier of the current process.
2205-
2206-Returns C<undef> on failure.
2207-
2208-=item setsid
2209-
2210-This is identical to the C function C<setsid()> for
2211-setting the session identifier of the current process.
2212-
2213-=item setuid
2214-
2215-Sets the real user identifier and the effective user identifier for
2216-this process. Similar to assigning a value to the Perl's builtin
2217-C<$E<lt>> variable, see L<perlvar/$UID>, except that the latter
2218-will change only the real user identifier.
2219-
2220-=item sigaction
2221-
2222-Detailed signal management. This uses C<POSIX::SigAction> objects for
2223-the C<action> and C<oldaction> arguments (the oldaction can also be
2224-just a hash reference). Consult your system's C<sigaction> manpage
2225-for details, see also C<POSIX::SigRt>.
2226-
2227-Synopsis:
2228-
2229- sigaction(signal, action, oldaction = 0)
2230-
2231-Returns C<undef> on failure. The C<signal> must be a number (like
2232-SIGHUP), not a string (like "SIGHUP"), though Perl does try hard
2233-to understand you.
2234-
2235-If you use the SA_SIGINFO flag, the signal handler will in addition to
2236-the first argument, the signal name, also receive a second argument, a
2237-hash reference, inside which are the following keys with the following
2238-semantics, as defined by POSIX/SUSv3:
2239-
2240- signo the signal number
2241- errno the error number
2242- code if this is zero or less, the signal was sent by
2243- a user process and the uid and pid make sense,
2244- otherwise the signal was sent by the kernel
2245-
2246-The following are also defined by POSIX/SUSv3, but unfortunately
2247-not very widely implemented:
2248-
2249- pid the process id generating the signal
2250- uid the uid of the process id generating the signal
2251- status exit value or signal for SIGCHLD
2252- band band event for SIGPOLL
2253-
2254-A third argument is also passed to the handler, which contains a copy
2255-of the raw binary contents of the siginfo structure: if a system has
2256-some non-POSIX fields, this third argument is where to unpack() them
2257-from.
2258-
2259-Note that not all siginfo values make sense simultaneously (some are
2260-valid only for certain signals, for example), and not all values make
2261-sense from Perl perspective, you should to consult your system's
2262-C<sigaction> and possibly also C<siginfo> documentation.
2263-
2264-=item siglongjmp
2265-
2266-siglongjmp() is C-specific: use L<perlfunc/die> instead.
2267-
2268-=item sigpending
2269-
2270-Examine signals that are blocked and pending. This uses C<POSIX::SigSet>
2271-objects for the C<sigset> argument. Consult your system's C<sigpending>
2272-manpage for details.
2273-
2274-Synopsis:
2275-
2276- sigpending(sigset)
2277-
2278-Returns C<undef> on failure.
2279-
2280-=item sigprocmask
2281-
2282-Change and/or examine calling process's signal mask. This uses
2283-C<POSIX::SigSet> objects for the C<sigset> and C<oldsigset> arguments.
2284-Consult your system's C<sigprocmask> manpage for details.
2285-
2286-Synopsis:
2287-
2288- sigprocmask(how, sigset, oldsigset = 0)
2289-
2290-Returns C<undef> on failure.
2291-
2292-=item sigsetjmp
2293-
2294-C<sigsetjmp()> is C-specific: use C<eval {}> instead,
2295-see L<perlfunc/eval>.
2296-
2297-=item sigsuspend
2298-
2299-Install a signal mask and suspend process until signal arrives. This uses
2300-C<POSIX::SigSet> objects for the C<signal_mask> argument. Consult your
2301-system's C<sigsuspend> manpage for details.
2302-
2303-Synopsis:
2304-
2305- sigsuspend(signal_mask)
2306-
2307-Returns C<undef> on failure.
2308-
2309-=item sin
2310-
2311-This is identical to Perl's builtin C<sin()> function
2312-for returning the sine of the numerical argument,
2313-see L<perlfunc/sin>. See also L<Math::Trig>.
2314-
2315-=item sinh
2316-
2317-This is identical to the C function C<sinh()>
2318-for returning the hyperbolic sine of the numerical argument.
2319-See also L<Math::Trig>.
2320-
2321-=item sleep
2322-
2323-This is functionally identical to Perl's builtin C<sleep()> function
2324-for suspending the execution of the current for process for certain
2325-number of seconds, see L<perlfunc/sleep>. There is one significant
2326-difference, however: C<POSIX::sleep()> returns the number of
2327-B<unslept> seconds, while the C<CORE::sleep()> returns the
2328-number of slept seconds.
2329-
2330-=item sprintf
2331-
2332-This is similar to Perl's builtin C<sprintf()> function
2333-for returning a string that has the arguments formatted as requested,
2334-see L<perlfunc/sprintf>.
2335-
2336-=item sqrt
2337-
2338-This is identical to Perl's builtin C<sqrt()> function.
2339-for returning the square root of the numerical argument,
2340-see L<perlfunc/sqrt>.
2341-
2342-=item srand
2343-
2344-Give a seed the pseudorandom number generator, see L<perlfunc/srand>.
2345-
2346-=item sscanf
2347-
2348-sscanf() is C-specific, use regular expressions instead,
2349-see L<perlre>.
2350-
2351-=item stat
2352-
2353-This is identical to Perl's builtin C<stat()> function
2354-for returning information about files and directories.
2355-
2356-=item strcat
2357-
2358-strcat() is C-specific, use C<.=> instead, see L<perlop>.
2359-
2360-=item strchr
2361-
2362-strchr() is C-specific, see L<perlfunc/index> instead.
2363-
2364-=item strcmp
2365-
2366-strcmp() is C-specific, use C<eq> or C<cmp> instead, see L<perlop>.
2367-
2368-=item strcoll
2369-
2370-This is identical to the C function C<strcoll()>
2371-for collating (comparing) strings transformed using
2372-the C<strxfrm()> function. Not really needed since
2373-Perl can do this transparently, see L<perllocale>.
2374-
2375-=item strcpy
2376-
2377-strcpy() is C-specific, use C<=> instead, see L<perlop>.
2378-
2379-=item strcspn
2380-
2381-strcspn() is C-specific, use regular expressions instead,
2382-see L<perlre>.
2383-
2384-=item strerror
2385-
2386-Returns the error string for the specified errno.
2387-Identical to the string form of the C<$!>, see L<perlvar/$ERRNO>.
2388-
2389-=item strftime
2390-
2391-Convert date and time information to string. Returns the string.
2392-
2393-Synopsis:
2394-
2395- strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1)
2396-
2397-The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
2398-I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
2399-year (C<year>) is given in years since 1900. I.e., the year 1995 is 95; the
2400-year 2001 is 101. Consult your system's C<strftime()> manpage for details
2401-about these and the other arguments.
2402-
2403-If you want your code to be portable, your format (C<fmt>) argument
2404-should use only the conversion specifiers defined by the ANSI C
2405-standard (C89, to play safe). These are C<aAbBcdHIjmMpSUwWxXyYZ%>.
2406-But even then, the B<results> of some of the conversion specifiers are
2407-non-portable. For example, the specifiers C<aAbBcpZ> change according
2408-to the locale settings of the user, and both how to set locales (the
2409-locale names) and what output to expect are non-standard.
2410-The specifier C<c> changes according to the timezone settings of the
2411-user and the timezone computation rules of the operating system.
2412-The C<Z> specifier is notoriously unportable since the names of
2413-timezones are non-standard. Sticking to the numeric specifiers is the
2414-safest route.
2415-
2416-The given arguments are made consistent as though by calling
2417-C<mktime()> before calling your system's C<strftime()> function,
2418-except that the C<isdst> value is not affected.
2419-
2420-The string for Tuesday, December 12, 1995.
2421-
2422- $str = POSIX::strftime( "%A, %B %d, %Y", 0, 0, 0, 12, 11, 95, 2 );
2423- print "$str\n";
2424-
2425-=item strlen
2426-
2427-strlen() is C-specific, use C<length()> instead, see L<perlfunc/length>.
2428-
2429-=item strncat
2430-
2431-strncat() is C-specific, use C<.=> instead, see L<perlop>.
2432-
2433-=item strncmp
2434-
2435-strncmp() is C-specific, use C<eq> instead, see L<perlop>.
2436-
2437-=item strncpy
2438-
2439-strncpy() is C-specific, use C<=> instead, see L<perlop>.
2440-
2441-=item strpbrk
2442-
2443-strpbrk() is C-specific, use regular expressions instead,
2444-see L<perlre>.
2445-
2446-=item strrchr
2447-
2448-strrchr() is C-specific, see L<perlfunc/rindex> instead.
2449-
2450-=item strspn
2451-
2452-strspn() is C-specific, use regular expressions instead,
2453-see L<perlre>.
2454-
2455-=item strstr
2456-
2457-This is identical to Perl's builtin C<index()> function,
2458-see L<perlfunc/index>.
2459-
2460-=item strtod
2461-
2462-String to double translation. Returns the parsed number and the number
2463-of characters in the unparsed portion of the string. Truly
2464-POSIX-compliant systems set $! ($ERRNO) to indicate a translation
2465-error, so clear $! before calling strtod. However, non-POSIX systems
2466-may not check for overflow, and therefore will never set $!.
2467-
2468-strtod should respect any POSIX I<setlocale()> settings.
2469-
2470-To parse a string $str as a floating point number use
2471-
2472- $! = 0;
2473- ($num, $n_unparsed) = POSIX::strtod($str);
2474-
2475-The second returned item and $! can be used to check for valid input:
2476-
2477- if (($str eq '') || ($n_unparsed != 0) || $!) {
2478- die "Non-numeric input $str" . ($! ? ": $!\n" : "\n");
2479- }
2480-
2481-When called in a scalar context strtod returns the parsed number.
2482-
2483-=item strtok
2484-
2485-strtok() is C-specific, use regular expressions instead, see
2486-L<perlre>, or L<perlfunc/split>.
2487-
2488-=item strtol
2489-
2490-String to (long) integer translation. Returns the parsed number and
2491-the number of characters in the unparsed portion of the string. Truly
2492-POSIX-compliant systems set $! ($ERRNO) to indicate a translation
2493-error, so clear $! before calling strtol. However, non-POSIX systems
2494-may not check for overflow, and therefore will never set $!.
2495-
2496-strtol should respect any POSIX I<setlocale()> settings.
2497-
2498-To parse a string $str as a number in some base $base use
2499-
2500- $! = 0;
2501- ($num, $n_unparsed) = POSIX::strtol($str, $base);
2502-
2503-The base should be zero or between 2 and 36, inclusive. When the base
2504-is zero or omitted strtol will use the string itself to determine the
2505-base: a leading "0x" or "0X" means hexadecimal; a leading "0" means
2506-octal; any other leading characters mean decimal. Thus, "1234" is
2507-parsed as a decimal number, "01234" as an octal number, and "0x1234"
2508-as a hexadecimal number.
2509-
2510-The second returned item and $! can be used to check for valid input:
2511-
2512- if (($str eq '') || ($n_unparsed != 0) || !$!) {
2513- die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
2514- }
2515-
2516-When called in a scalar context strtol returns the parsed number.
2517-
2518-=item strtoul
2519-
2520-String to unsigned (long) integer translation. strtoul() is identical
2521-to strtol() except that strtoul() only parses unsigned integers. See
2522-L</strtol> for details.
2523-
2524-Note: Some vendors supply strtod() and strtol() but not strtoul().
2525-Other vendors that do supply strtoul() parse "-1" as a valid value.
2526-
2527-=item strxfrm
2528-
2529-String transformation. Returns the transformed string.
2530-
2531- $dst = POSIX::strxfrm( $src );
2532-
2533-Used in conjunction with the C<strcoll()> function, see L</strcoll>.
2534-
2535-Not really needed since Perl can do this transparently, see
2536-L<perllocale>.
2537-
2538-=item sysconf
2539-
2540-Retrieves values of system configurable variables.
2541-
2542-The following will get the machine's clock speed.
2543-
2544- $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
2545-
2546-Returns C<undef> on failure.
2547-
2548-=item system
2549-
2550-This is identical to Perl's builtin C<system()> function, see
2551-L<perlfunc/system>.
2552-
2553-=item tan
2554-
2555-This is identical to the C function C<tan()>, returning the
2556-tangent of the numerical argument. See also L<Math::Trig>.
2557-
2558-=item tanh
2559-
2560-This is identical to the C function C<tanh()>, returning the
2561-hyperbolic tangent of the numerical argument. See also L<Math::Trig>.
2562-
2563-=item tcdrain
2564-
2565-This is similar to the C function C<tcdrain()> for draining
2566-the output queue of its argument stream.
2567-
2568-Returns C<undef> on failure.
2569-
2570-=item tcflow
2571-
2572-This is similar to the C function C<tcflow()> for controlling
2573-the flow of its argument stream.
2574-
2575-Returns C<undef> on failure.
2576-
2577-=item tcflush
2578-
2579-This is similar to the C function C<tcflush()> for flushing
2580-the I/O buffers of its argument stream.
2581-
2582-Returns C<undef> on failure.
2583-
2584-=item tcgetpgrp
2585-
2586-This is identical to the C function C<tcgetpgrp()> for returning the
2587-process group identifier of the foreground process group of the controlling
2588-terminal.
2589-
2590-=item tcsendbreak
2591-
2592-This is similar to the C function C<tcsendbreak()> for sending
2593-a break on its argument stream.
2594-
2595-Returns C<undef> on failure.
2596-
2597-=item tcsetpgrp
2598-
2599-This is similar to the C function C<tcsetpgrp()> for setting the
2600-process group identifier of the foreground process group of the controlling
2601-terminal.
2602-
2603-Returns C<undef> on failure.
2604-
2605-=item time
2606-
2607-This is identical to Perl's builtin C<time()> function
2608-for returning the number of seconds since the epoch
2609-(whatever it is for the system), see L<perlfunc/time>.
2610-
2611-=item times
2612-
2613-The times() function returns elapsed realtime since some point in the past
2614-(such as system startup), user and system times for this process, and user
2615-and system times used by child processes. All times are returned in clock
2616-ticks.
2617-
2618- ($realtime, $user, $system, $cuser, $csystem) = POSIX::times();
2619-
2620-Note: Perl's builtin C<times()> function returns four values, measured in
2621-seconds.
2622-
2623-=item tmpfile
2624-
2625-Use method C<IO::File::new_tmpfile()> instead, or see L<File::Temp>.
2626-
2627-=item tmpnam
2628-
2629-Returns a name for a temporary file.
2630-
2631- $tmpfile = POSIX::tmpnam();
2632-
2633-For security reasons, which are probably detailed in your system's
2634-documentation for the C library tmpnam() function, this interface
2635-should not be used; instead see L<File::Temp>.
2636-
2637-=item tolower
2638-
2639-This is identical to the C function, except that it can apply to a single
2640-character or to a whole string. Consider using the C<lc()> function,
2641-see L<perlfunc/lc>, or the equivalent C<\L> operator inside doublequotish
2642-strings.
2643-
2644-=item toupper
2645-
2646-This is identical to the C function, except that it can apply to a single
2647-character or to a whole string. Consider using the C<uc()> function,
2648-see L<perlfunc/uc>, or the equivalent C<\U> operator inside doublequotish
2649-strings.
2650-
2651-=item ttyname
2652-
2653-This is identical to the C function C<ttyname()> for returning the
2654-name of the current terminal.
2655-
2656-=item tzname
2657-
2658-Retrieves the time conversion information from the C<tzname> variable.
2659-
2660- POSIX::tzset();
2661- ($std, $dst) = POSIX::tzname();
2662-
2663-=item tzset
2664-
2665-This is identical to the C function C<tzset()> for setting
2666-the current timezone based on the environment variable C<TZ>,
2667-to be used by C<ctime()>, C<localtime()>, C<mktime()>, and C<strftime()>
2668-functions.
2669-
2670-=item umask
2671-
2672-This is identical to Perl's builtin C<umask()> function
2673-for setting (and querying) the file creation permission mask,
2674-see L<perlfunc/umask>.
2675-
2676-=item uname
2677-
2678-Get name of current operating system.
2679-
2680- ($sysname, $nodename, $release, $version, $machine) = POSIX::uname();
2681-
2682-Note that the actual meanings of the various fields are not
2683-that well standardized, do not expect any great portability.
2684-The C<$sysname> might be the name of the operating system,
2685-the C<$nodename> might be the name of the host, the C<$release>
2686-might be the (major) release number of the operating system,
2687-the C<$version> might be the (minor) release number of the
2688-operating system, and the C<$machine> might be a hardware identifier.
2689-Maybe.
2690-
2691-=item ungetc
2692-
2693-Use method C<IO::Handle::ungetc()> instead.
2694-
2695-=item unlink
2696-
2697-This is identical to Perl's builtin C<unlink()> function
2698-for removing files, see L<perlfunc/unlink>.
2699-
2700-=item utime
2701-
2702-This is identical to Perl's builtin C<utime()> function
2703-for changing the time stamps of files and directories,
2704-see L<perlfunc/utime>.
2705-
2706-=item vfprintf
2707-
2708-vfprintf() is C-specific, see L<perlfunc/printf> instead.
2709-
2710-=item vprintf
2711-
2712-vprintf() is C-specific, see L<perlfunc/printf> instead.
2713-
2714-=item vsprintf
2715-
2716-vsprintf() is C-specific, see L<perlfunc/sprintf> instead.
2717-
2718-=item wait
2719-
2720-This is identical to Perl's builtin C<wait()> function,
2721-see L<perlfunc/wait>.
2722-
2723-=item waitpid
2724-
2725-Wait for a child process to change state. This is identical to Perl's
2726-builtin C<waitpid()> function, see L<perlfunc/waitpid>.
2727-
2728- $pid = POSIX::waitpid( -1, POSIX::WNOHANG );
2729- print "status = ", ($? / 256), "\n";
2730-
2731-=item wcstombs
2732-
2733-This is identical to the C function C<wcstombs()>.
2734-Perl does not have any support for the wide and multibyte
2735-characters of the C standards, so this might be a rather
2736-useless function.
2737-
2738-=item wctomb
2739-
2740-This is identical to the C function C<wctomb()>.
2741-Perl does not have any support for the wide and multibyte
2742-characters of the C standards, so this might be a rather
2743-useless function.
2744-
2745-=item write
2746-
2747-Write to a file. This uses file descriptors such as those obtained by
2748-calling C<POSIX::open>.
2749-
2750- $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
2751- $buf = "hello";
2752- $bytes = POSIX::write( $fd, $buf, 5 );
2753-
2754-Returns C<undef> on failure.
2755-
2756-See also L<perlfunc/syswrite>.
2757-
2758-=back
2759-
2760-=head1 CLASSES
2761-
2762-=head2 POSIX::SigAction
2763-
2764-=over 8
2765-
2766-=item new
2767-
2768-Creates a new C<POSIX::SigAction> object which corresponds to the C
2769-C<struct sigaction>. This object will be destroyed automatically when
2770-it is no longer needed. The first parameter is the handler, a sub
2771-reference. The second parameter is a C<POSIX::SigSet> object, it
2772-defaults to the empty set. The third parameter contains the
2773-C<sa_flags>, it defaults to 0.
2774-
2775- $sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
2776- $sigaction = POSIX::SigAction->new( \&handler, $sigset, &POSIX::SA_NOCLDSTOP );
2777-
2778-This C<POSIX::SigAction> object is intended for use with the C<POSIX::sigaction()>
2779-function.
2780-
2781-=back
2782-
2783-=over 8
2784-
2785-=item handler
2786-
2787-=item mask
2788-
2789-=item flags
2790-
2791-accessor functions to get/set the values of a SigAction object.
2792-
2793- $sigset = $sigaction->mask;
2794- $sigaction->flags(&POSIX::SA_RESTART);
2795-
2796-=item safe
2797-
2798-accessor function for the "safe signals" flag of a SigAction object; see
2799-L<perlipc> for general information on safe (a.k.a. "deferred") signals. If
2800-you wish to handle a signal safely, use this accessor to set the "safe" flag
2801-in the C<POSIX::SigAction> object:
2802-
2803- $sigaction->safe(1);
2804-
2805-You may also examine the "safe" flag on the output action object which is
2806-filled in when given as the third parameter to C<POSIX::sigaction()>:
2807-
2808- sigaction(SIGINT, $new_action, $old_action);
2809- if ($old_action->safe) {
2810- # previous SIGINT handler used safe signals
2811- }
2812-
2813-=back
2814-
2815-=head2 POSIX::SigRt
2816-
2817-=over 8
2818-
2819-=item %SIGRT
2820-
2821-A hash of the POSIX realtime signal handlers. It is an extension of
2822-the standard %SIG, the $POSIX::SIGRT{SIGRTMIN} is roughly equivalent
2823-to $SIG{SIGRTMIN}, but the right POSIX moves (see below) are made with
2824-the POSIX::SigSet and POSIX::sigaction instead of accessing the %SIG.
2825-
2826-You can set the %POSIX::SIGRT elements to set the POSIX realtime
2827-signal handlers, use C<delete> and C<exists> on the elements, and use
2828-C<scalar> on the C<%POSIX::SIGRT> to find out how many POSIX realtime
2829-signals there are available (SIGRTMAX - SIGRTMIN + 1, the SIGRTMAX is
2830-a valid POSIX realtime signal).
2831-
2832-Setting the %SIGRT elements is equivalent to calling this:
2833-
2834- sub new {
2835- my ($rtsig, $handler, $flags) = @_;
2836- my $sigset = POSIX::SigSet($rtsig);
2837- my $sigact = POSIX::SigAction->new($handler, $sigset, $flags);
2838- sigaction($rtsig, $sigact);
2839- }
2840-
2841-The flags default to zero, if you want something different you can
2842-either use C<local> on $POSIX::SigRt::SIGACTION_FLAGS, or you can
2843-derive from POSIX::SigRt and define your own C<new()> (the tied hash
2844-STORE method of the %SIGRT calls C<new($rtsig, $handler, $SIGACTION_FLAGS)>,
2845-where the $rtsig ranges from zero to SIGRTMAX - SIGRTMIN + 1).
2846-
2847-Just as with any signal, you can use sigaction($rtsig, undef, $oa) to
2848-retrieve the installed signal handler (or, rather, the signal action).
2849-
2850-B<NOTE:> whether POSIX realtime signals really work in your system, or
2851-whether Perl has been compiled so that it works with them, is outside
2852-of this discussion.
2853-
2854-=item SIGRTMIN
2855-
2856-Return the minimum POSIX realtime signal number available, or C<undef>
2857-if no POSIX realtime signals are available.
2858-
2859-=item SIGRTMAX
2860-
2861-Return the maximum POSIX realtime signal number available, or C<undef>
2862-if no POSIX realtime signals are available.
2863-
2864-=back
2865-
2866-=head2 POSIX::SigSet
2867-
2868-=over 8
2869-
2870-=item new
2871-
2872-Create a new SigSet object. This object will be destroyed automatically
2873-when it is no longer needed. Arguments may be supplied to initialize the
2874-set.
2875-
2876-Create an empty set.
2877-
2878- $sigset = POSIX::SigSet->new;
2879-
2880-Create a set with SIGUSR1.
2881-
2882- $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
2883-
2884-=item addset
2885-
2886-Add a signal to a SigSet object.
2887-
2888- $sigset->addset( &POSIX::SIGUSR2 );
2889-
2890-Returns C<undef> on failure.
2891-
2892-=item delset
2893-
2894-Remove a signal from the SigSet object.
2895-
2896- $sigset->delset( &POSIX::SIGUSR2 );
2897-
2898-Returns C<undef> on failure.
2899-
2900-=item emptyset
2901-
2902-Initialize the SigSet object to be empty.
2903-
2904- $sigset->emptyset();
2905-
2906-Returns C<undef> on failure.
2907-
2908-=item fillset
2909-
2910-Initialize the SigSet object to include all signals.
2911-
2912- $sigset->fillset();
2913-
2914-Returns C<undef> on failure.
2915-
2916-=item ismember
2917-
2918-Tests the SigSet object to see if it contains a specific signal.
2919-
2920- if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
2921- print "contains SIGUSR1\n";
2922- }
2923-
2924-=back
2925-
2926-=head2 POSIX::Termios
2927-
2928-=over 8
2929-
2930-=item new
2931-
2932-Create a new Termios object. This object will be destroyed automatically
2933-when it is no longer needed. A Termios object corresponds to the termios
2934-C struct. new() mallocs a new one, getattr() fills it from a file descriptor,
2935-and setattr() sets a file descriptor's parameters to match Termios' contents.
2936-
2937- $termios = POSIX::Termios->new;
2938-
2939-=item getattr
2940-
2941-Get terminal control attributes.
2942-
2943-Obtain the attributes for stdin.
2944-
2945- $termios->getattr( 0 ) # Recommended for clarity.
2946- $termios->getattr()
2947-
2948-Obtain the attributes for stdout.
2949-
2950- $termios->getattr( 1 )
2951-
2952-Returns C<undef> on failure.
2953-
2954-=item getcc
2955-
2956-Retrieve a value from the c_cc field of a termios object. The c_cc field is
2957-an array so an index must be specified.
2958-
2959- $c_cc[1] = $termios->getcc(1);
2960-
2961-=item getcflag
2962-
2963-Retrieve the c_cflag field of a termios object.
2964-
2965- $c_cflag = $termios->getcflag;
2966-
2967-=item getiflag
2968-
2969-Retrieve the c_iflag field of a termios object.
2970-
2971- $c_iflag = $termios->getiflag;
2972-
2973-=item getispeed
2974-
2975-Retrieve the input baud rate.
2976-
2977- $ispeed = $termios->getispeed;
2978-
2979-=item getlflag
2980-
2981-Retrieve the c_lflag field of a termios object.
2982-
2983- $c_lflag = $termios->getlflag;
2984-
2985-=item getoflag
2986-
2987-Retrieve the c_oflag field of a termios object.
2988-
2989- $c_oflag = $termios->getoflag;
2990-
2991-=item getospeed
2992-
2993-Retrieve the output baud rate.
2994-
2995- $ospeed = $termios->getospeed;
2996-
2997-=item setattr
2998-
2999-Set terminal control attributes.
3000-
3001-Set attributes immediately for stdout.
3002-
3003- $termios->setattr( 1, &POSIX::TCSANOW );
3004-
3005-Returns C<undef> on failure.
3006-
3007-=item setcc
3008-
3009-Set a value in the c_cc field of a termios object. The c_cc field is an
3010-array so an index must be specified.
3011-
3012- $termios->setcc( &POSIX::VEOF, 1 );
3013-
3014-=item setcflag
3015-
3016-Set the c_cflag field of a termios object.
3017-
3018- $termios->setcflag( $c_cflag | &POSIX::CLOCAL );
3019-
3020-=item setiflag
3021-
3022-Set the c_iflag field of a termios object.
3023-
3024- $termios->setiflag( $c_iflag | &POSIX::BRKINT );
3025-
3026-=item setispeed
3027-
3028-Set the input baud rate.
3029-
3030- $termios->setispeed( &POSIX::B9600 );
3031-
3032-Returns C<undef> on failure.
3033-
3034-=item setlflag
3035-
3036-Set the c_lflag field of a termios object.
3037-
3038- $termios->setlflag( $c_lflag | &POSIX::ECHO );
3039-
3040-=item setoflag
3041-
3042-Set the c_oflag field of a termios object.
3043-
3044- $termios->setoflag( $c_oflag | &POSIX::OPOST );
3045-
3046-=item setospeed
3047-
3048-Set the output baud rate.
3049-
3050- $termios->setospeed( &POSIX::B9600 );
3051-
3052-Returns C<undef> on failure.
3053-
3054-=item Baud rate values
3055-
3056-B38400 B75 B200 B134 B300 B1800 B150 B0 B19200 B1200 B9600 B600 B4800 B50 B2400 B110
3057-
3058-=item Terminal interface values
3059-
3060-TCSADRAIN TCSANOW TCOON TCIOFLUSH TCOFLUSH TCION TCIFLUSH TCSAFLUSH TCIOFF TCOOFF
3061-
3062-=item c_cc field values
3063-
3064-VEOF VEOL VERASE VINTR VKILL VQUIT VSUSP VSTART VSTOP VMIN VTIME NCCS
3065-
3066-=item c_cflag field values
3067-
3068-CLOCAL CREAD CSIZE CS5 CS6 CS7 CS8 CSTOPB HUPCL PARENB PARODD
3069-
3070-=item c_iflag field values
3071-
3072-BRKINT ICRNL IGNBRK IGNCR IGNPAR INLCR INPCK ISTRIP IXOFF IXON PARMRK
3073-
3074-=item c_lflag field values
3075-
3076-ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH TOSTOP
3077-
3078-=item c_oflag field values
3079-
3080-OPOST
3081-
3082-=back
3083-
3084-=head1 PATHNAME CONSTANTS
3085-
3086-=over 8
3087-
3088-=item Constants
3089-
3090-_PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE
3091-
3092-=back
3093-
3094-=head1 POSIX CONSTANTS
3095-
3096-=over 8
3097-
3098-=item Constants
3099-
3100-_POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED _POSIX_JOB_CONTROL _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SAVED_IDS _POSIX_SSIZE_MAX _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION
3101-
3102-=back
3103-
3104-=head1 SYSTEM CONFIGURATION
3105-
3106-=over 8
3107-
3108-=item Constants
3109-
3110-_SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
3111-
3112-=back
3113-
3114-=head1 ERRNO
3115-
3116-=over 8
3117-
3118-=item Constants
3119-
3120-E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF
3121-EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ
3122-EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR
3123-EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG
3124-ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC
3125-ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR
3126-ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE
3127-EPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS
3128-ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS
3129-ETXTBSY EUSERS EWOULDBLOCK EXDEV
3130-
3131-=back
3132-
3133-=head1 FCNTL
3134-
3135-=over 8
3136-
3137-=item Constants
3138-
3139-FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_OK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY
3140-
3141-=back
3142-
3143-=head1 FLOAT
3144-
3145-=over 8
3146-
3147-=item Constants
3148-
3149-DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP FLT_DIG FLT_EPSILON FLT_MANT_DIG FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_ROUNDS LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP
3150-
3151-=back
3152-
3153-=head1 LIMITS
3154-
3155-=over 8
3156-
3157-=item Constants
3158-
3159-ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
3160-
3161-=back
3162-
3163-=head1 LOCALE
3164-
3165-=over 8
3166-
3167-=item Constants
3168-
3169-LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME
3170-
3171-=back
3172-
3173-=head1 MATH
3174-
3175-=over 8
3176-
3177-=item Constants
3178-
3179-HUGE_VAL
3180-
3181-=back
3182-
3183-=head1 SIGNAL
3184-
3185-=over 8
3186-
3187-=item Constants
3188-
3189-SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND SA_RESTART
3190-SA_SIGINFO SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT
3191-SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU
3192-SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK
3193-SIG_UNBLOCK
3194-
3195-=back
3196-
3197-=head1 STAT
3198-
3199-=over 8
3200-
3201-=item Constants
3202-
3203-S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
3204-
3205-=item Macros
3206-
3207-S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG
3208-
3209-=back
3210-
3211-=head1 STDLIB
3212-
3213-=over 8
3214-
3215-=item Constants
3216-
3217-EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX RAND_MAX
3218-
3219-=back
3220-
3221-=head1 STDIO
3222-
3223-=over 8
3224-
3225-=item Constants
3226-
3227-BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid L_tmpname TMP_MAX
3228-
3229-=back
3230-
3231-=head1 TIME
3232-
3233-=over 8
3234-
3235-=item Constants
3236-
3237-CLK_TCK CLOCKS_PER_SEC
3238-
3239-=back
3240-
3241-=head1 UNISTD
3242-
3243-=over 8
3244-
3245-=item Constants
3246-
3247-R_OK SEEK_CUR SEEK_END SEEK_SET STDIN_FILENO STDOUT_FILENO STDERR_FILENO W_OK X_OK
3248-
3249-=back
3250-
3251-=head1 WAIT
3252-
3253-=over 8
3254-
3255-=item Constants
3256-
3257-WNOHANG WUNTRACED
3258-
3259-=over 16
3260-
3261-=item WNOHANG
3262-
3263-Do not suspend the calling process until a child process
3264-changes state but instead return immediately.
3265-
3266-=item WUNTRACED
3267-
3268-Catch stopped child processes.
3269-
3270-=back
3271-
3272-=item Macros
3273-
3274-WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG
3275-
3276-=over 16
3277-
3278-=item WIFEXITED
3279-
3280-WIFEXITED($?) returns true if the child process exited normally
3281-(C<exit()> or by falling off the end of C<main()>)
3282-
3283-=item WEXITSTATUS
3284-
3285-WEXITSTATUS($?) returns the normal exit status of the child process
3286-(only meaningful if WIFEXITED($?) is true)
3287-
3288-=item WIFSIGNALED
3289-
3290-WIFSIGNALED($?) returns true if the child process terminated because
3291-of a signal
3292-
3293-=item WTERMSIG
3294-
3295-WTERMSIG($?) returns the signal the child process terminated for
3296-(only meaningful if WIFSIGNALED($?) is true)
3297-
3298-=item WIFSTOPPED
3299-
3300-WIFSTOPPED($?) returns true if the child process is currently stopped
3301-(can happen only if you specified the WUNTRACED flag to waitpid())
3302-
3303-=item WSTOPSIG
3304-
3305-WSTOPSIG($?) returns the signal the child process was stopped for
3306-(only meaningful if WIFSTOPPED($?) is true)
3307-
3308-=back
3309-
3310-=back
3311-
3312diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm
3313new file mode 100644
3314index 0000000..ffbd9de
3315--- /dev/null
3316+++ b/ext/POSIX/lib/POSIX.pm
3317@@ -0,0 +1,1042 @@
3318+package POSIX;
3319+use strict;
3320+use warnings;
3321+
3322+our(@ISA, %EXPORT_TAGS, @EXPORT_OK, @EXPORT, $AUTOLOAD, %SIGRT) = ();
3323+
3324+our $VERSION = "1.19";
3325+
3326+use AutoLoader;
3327+
3328+use XSLoader ();
3329+
3330+use Fcntl qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK F_SETFD
3331+ F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND
3332+ O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC
3333+ O_WRONLY SEEK_CUR SEEK_END SEEK_SET
3334+ S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG
3335+ S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID
3336+ S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR);
3337+
3338+# Grandfather old foo_h form to new :foo_h form
3339+my $loaded;
3340+
3341+sub import {
3342+ load_imports() unless $loaded++;
3343+ my $this = shift;
3344+ my @list = map { m/^\w+_h$/ ? ":$_" : $_ } @_;
3345+ local $Exporter::ExportLevel = 1;
3346+ Exporter::import($this,@list);
3347+}
3348+
3349+sub croak { require Carp; goto &Carp::croak }
3350+# declare usage to assist AutoLoad
3351+sub usage;
3352+
3353+XSLoader::load 'POSIX', $VERSION;
3354+
3355+sub AUTOLOAD {
3356+ no strict;
3357+ no warnings 'uninitialized';
3358+ if ($AUTOLOAD =~ /::(_?[a-z])/) {
3359+ # require AutoLoader;
3360+ $AutoLoader::AUTOLOAD = $AUTOLOAD;
3361+ goto &AutoLoader::AUTOLOAD
3362+ }
3363+ local $! = 0;
3364+ my $constname = $AUTOLOAD;
3365+ $constname =~ s/.*:://;
3366+ my ($error, $val) = constant($constname);
3367+ croak $error if $error;
3368+ *$AUTOLOAD = sub { $val };
3369+
3370+ goto &$AUTOLOAD;
3371+}
3372+
3373+package POSIX::SigAction;
3374+
3375+use AutoLoader 'AUTOLOAD';
3376+
3377+package POSIX::SigRt;
3378+
3379+use AutoLoader 'AUTOLOAD';
3380+
3381+use Tie::Hash;
3382+
3383+use vars qw($SIGACTION_FLAGS $_SIGRTMIN $_SIGRTMAX $_sigrtn @ISA);
3384+@POSIX::SigRt::ISA = qw(Tie::StdHash);
3385+
3386+$SIGACTION_FLAGS = 0;
3387+
3388+tie %POSIX::SIGRT, 'POSIX::SigRt';
3389+
3390+sub DESTROY {};
3391+
3392+package POSIX;
3393+
3394+1;
3395+__END__
3396+
3397+sub usage {
3398+ my ($mess) = @_;
3399+ croak "Usage: POSIX::$mess";
3400+}
3401+
3402+sub redef {
3403+ my ($mess) = @_;
3404+ croak "Use method $mess instead";
3405+}
3406+
3407+sub unimpl {
3408+ my ($mess) = @_;
3409+ $mess =~ s/xxx//;
3410+ croak "Unimplemented: POSIX::$mess";
3411+}
3412+
3413+sub assert {
3414+ usage "assert(expr)" if @_ != 1;
3415+ if (!$_[0]) {
3416+ croak "Assertion failed";
3417+ }
3418+}
3419+
3420+sub tolower {
3421+ usage "tolower(string)" if @_ != 1;
3422+ lc($_[0]);
3423+}
3424+
3425+sub toupper {
3426+ usage "toupper(string)" if @_ != 1;
3427+ uc($_[0]);
3428+}
3429+
3430+sub closedir {
3431+ usage "closedir(dirhandle)" if @_ != 1;
3432+ CORE::closedir($_[0]);
3433+}
3434+
3435+sub opendir {
3436+ usage "opendir(directory)" if @_ != 1;
3437+ my $dirhandle;
3438+ CORE::opendir($dirhandle, $_[0])
3439+ ? $dirhandle
3440+ : undef;
3441+}
3442+
3443+sub readdir {
3444+ usage "readdir(dirhandle)" if @_ != 1;
3445+ CORE::readdir($_[0]);
3446+}
3447+
3448+sub rewinddir {
3449+ usage "rewinddir(dirhandle)" if @_ != 1;
3450+ CORE::rewinddir($_[0]);
3451+}
3452+
3453+sub errno {
3454+ usage "errno()" if @_ != 0;
3455+ $! + 0;
3456+}
3457+
3458+sub creat {
3459+ usage "creat(filename, mode)" if @_ != 2;
3460+ &open($_[0], &O_WRONLY | &O_CREAT | &O_TRUNC, $_[1]);
3461+}
3462+
3463+sub fcntl {
3464+ usage "fcntl(filehandle, cmd, arg)" if @_ != 3;
3465+ CORE::fcntl($_[0], $_[1], $_[2]);
3466+}
3467+
3468+sub getgrgid {
3469+ usage "getgrgid(gid)" if @_ != 1;
3470+ CORE::getgrgid($_[0]);
3471+}
3472+
3473+sub getgrnam {
3474+ usage "getgrnam(name)" if @_ != 1;
3475+ CORE::getgrnam($_[0]);
3476+}
3477+
3478+sub atan2 {
3479+ usage "atan2(x,y)" if @_ != 2;
3480+ CORE::atan2($_[0], $_[1]);
3481+}
3482+
3483+sub cos {
3484+ usage "cos(x)" if @_ != 1;
3485+ CORE::cos($_[0]);
3486+}
3487+
3488+sub exp {
3489+ usage "exp(x)" if @_ != 1;
3490+ CORE::exp($_[0]);
3491+}
3492+
3493+sub fabs {
3494+ usage "fabs(x)" if @_ != 1;
3495+ CORE::abs($_[0]);
3496+}
3497+
3498+sub log {
3499+ usage "log(x)" if @_ != 1;
3500+ CORE::log($_[0]);
3501+}
3502+
3503+sub pow {
3504+ usage "pow(x,exponent)" if @_ != 2;
3505+ $_[0] ** $_[1];
3506+}
3507+
3508+sub sin {
3509+ usage "sin(x)" if @_ != 1;
3510+ CORE::sin($_[0]);
3511+}
3512+
3513+sub sqrt {
3514+ usage "sqrt(x)" if @_ != 1;
3515+ CORE::sqrt($_[0]);
3516+}
3517+
3518+sub getpwnam {
3519+ usage "getpwnam(name)" if @_ != 1;
3520+ CORE::getpwnam($_[0]);
3521+}
3522+
3523+sub getpwuid {
3524+ usage "getpwuid(uid)" if @_ != 1;
3525+ CORE::getpwuid($_[0]);
3526+}
3527+
3528+sub longjmp {
3529+ unimpl "longjmp() is C-specific: use die instead";
3530+}
3531+
3532+sub setjmp {
3533+ unimpl "setjmp() is C-specific: use eval {} instead";
3534+}
3535+
3536+sub siglongjmp {
3537+ unimpl "siglongjmp() is C-specific: use die instead";
3538+}
3539+
3540+sub sigsetjmp {
3541+ unimpl "sigsetjmp() is C-specific: use eval {} instead";
3542+}
3543+
3544+sub kill {
3545+ usage "kill(pid, sig)" if @_ != 2;
3546+ CORE::kill $_[1], $_[0];
3547+}
3548+
3549+sub raise {
3550+ usage "raise(sig)" if @_ != 1;
3551+ CORE::kill $_[0], $$; # Is this good enough?
3552+}
3553+
3554+sub offsetof {
3555+ unimpl "offsetof() is C-specific, stopped";
3556+}
3557+
3558+sub clearerr {
3559+ redef "IO::Handle::clearerr()";
3560+}
3561+
3562+sub fclose {
3563+ redef "IO::Handle::close()";
3564+}
3565+
3566+sub fdopen {
3567+ redef "IO::Handle::new_from_fd()";
3568+}
3569+
3570+sub feof {
3571+ redef "IO::Handle::eof()";
3572+}
3573+
3574+sub fgetc {
3575+ redef "IO::Handle::getc()";
3576+}
3577+
3578+sub fgets {
3579+ redef "IO::Handle::gets()";
3580+}
3581+
3582+sub fileno {
3583+ redef "IO::Handle::fileno()";
3584+}
3585+
3586+sub fopen {
3587+ redef "IO::File::open()";
3588+}
3589+
3590+sub fprintf {
3591+ unimpl "fprintf() is C-specific--use printf instead";
3592+}
3593+
3594+sub fputc {
3595+ unimpl "fputc() is C-specific--use print instead";
3596+}
3597+
3598+sub fputs {
3599+ unimpl "fputs() is C-specific--use print instead";
3600+}
3601+
3602+sub fread {
3603+ unimpl "fread() is C-specific--use read instead";
3604+}
3605+
3606+sub freopen {
3607+ unimpl "freopen() is C-specific--use open instead";
3608+}
3609+
3610+sub fscanf {
3611+ unimpl "fscanf() is C-specific--use <> and regular expressions instead";
3612+}
3613+
3614+sub fseek {
3615+ redef "IO::Seekable::seek()";
3616+}
3617+
3618+sub fsync {
3619+ redef "IO::Handle::sync()";
3620+}
3621+
3622+sub ferror {
3623+ redef "IO::Handle::error()";
3624+}
3625+
3626+sub fflush {
3627+ redef "IO::Handle::flush()";
3628+}
3629+
3630+sub fgetpos {
3631+ redef "IO::Seekable::getpos()";
3632+}
3633+
3634+sub fsetpos {
3635+ redef "IO::Seekable::setpos()";
3636+}
3637+
3638+sub ftell {
3639+ redef "IO::Seekable::tell()";
3640+}
3641+
3642+sub fwrite {
3643+ unimpl "fwrite() is C-specific--use print instead";
3644+}
3645+
3646+sub getc {
3647+ usage "getc(handle)" if @_ != 1;
3648+ CORE::getc($_[0]);
3649+}
3650+
3651+sub getchar {
3652+ usage "getchar()" if @_ != 0;
3653+ CORE::getc(STDIN);
3654+}
3655+
3656+sub gets {
3657+ usage "gets()" if @_ != 0;
3658+ scalar <STDIN>;
3659+}
3660+
3661+sub perror {
3662+ print STDERR "@_: " if @_;
3663+ print STDERR $!,"\n";
3664+}
3665+
3666+sub printf {
3667+ usage "printf(pattern, args...)" if @_ < 1;
3668+ CORE::printf STDOUT @_;
3669+}
3670+
3671+sub putc {
3672+ unimpl "putc() is C-specific--use print instead";
3673+}
3674+
3675+sub putchar {
3676+ unimpl "putchar() is C-specific--use print instead";
3677+}
3678+
3679+sub puts {
3680+ unimpl "puts() is C-specific--use print instead";
3681+}
3682+
3683+sub remove {
3684+ usage "remove(filename)" if @_ != 1;
3685+ (-d $_[0]) ? CORE::rmdir($_[0]) : CORE::unlink($_[0]);
3686+}
3687+
3688+sub rename {
3689+ usage "rename(oldfilename, newfilename)" if @_ != 2;
3690+ CORE::rename($_[0], $_[1]);
3691+}
3692+
3693+sub rewind {
3694+ usage "rewind(filehandle)" if @_ != 1;
3695+ CORE::seek($_[0],0,0);
3696+}
3697+
3698+sub scanf {
3699+ unimpl "scanf() is C-specific--use <> and regular expressions instead";
3700+}
3701+
3702+sub sprintf {
3703+ usage "sprintf(pattern,args)" if @_ == 0;
3704+ CORE::sprintf(shift,@_);
3705+}
3706+
3707+sub sscanf {
3708+ unimpl "sscanf() is C-specific--use regular expressions instead";
3709+}
3710+
3711+sub tmpfile {
3712+ redef "IO::File::new_tmpfile()";
3713+}
3714+
3715+sub ungetc {
3716+ redef "IO::Handle::ungetc()";
3717+}
3718+
3719+sub vfprintf {
3720+ unimpl "vfprintf() is C-specific";
3721+}
3722+
3723+sub vprintf {
3724+ unimpl "vprintf() is C-specific";
3725+}
3726+
3727+sub vsprintf {
3728+ unimpl "vsprintf() is C-specific";
3729+}
3730+
3731+sub abs {
3732+ usage "abs(x)" if @_ != 1;
3733+ CORE::abs($_[0]);
3734+}
3735+
3736+sub atexit {
3737+ unimpl "atexit() is C-specific: use END {} instead";
3738+}
3739+
3740+sub atof {
3741+ unimpl "atof() is C-specific, stopped";
3742+}
3743+
3744+sub atoi {
3745+ unimpl "atoi() is C-specific, stopped";
3746+}
3747+
3748+sub atol {
3749+ unimpl "atol() is C-specific, stopped";
3750+}
3751+
3752+sub bsearch {
3753+ unimpl "bsearch() not supplied";
3754+}
3755+
3756+sub calloc {
3757+ unimpl "calloc() is C-specific, stopped";
3758+}
3759+
3760+sub div {
3761+ unimpl "div() is C-specific, use /, % and int instead";
3762+}
3763+
3764+sub exit {
3765+ usage "exit(status)" if @_ != 1;
3766+ CORE::exit($_[0]);
3767+}
3768+
3769+sub free {
3770+ unimpl "free() is C-specific, stopped";
3771+}
3772+
3773+sub getenv {
3774+ usage "getenv(name)" if @_ != 1;
3775+ $ENV{$_[0]};
3776+}
3777+
3778+sub labs {
3779+ unimpl "labs() is C-specific, use abs instead";
3780+}
3781+
3782+sub ldiv {
3783+ unimpl "ldiv() is C-specific, use /, % and int instead";
3784+}
3785+
3786+sub malloc {
3787+ unimpl "malloc() is C-specific, stopped";
3788+}
3789+
3790+sub qsort {
3791+ unimpl "qsort() is C-specific, use sort instead";
3792+}
3793+
3794+sub rand {
3795+ unimpl "rand() is non-portable, use Perl's rand instead";
3796+}
3797+
3798+sub realloc {
3799+ unimpl "realloc() is C-specific, stopped";
3800+}
3801+
3802+sub srand {
3803+ unimpl "srand()";
3804+}
3805+
3806+sub system {
3807+ usage "system(command)" if @_ != 1;
3808+ CORE::system($_[0]);
3809+}
3810+
3811+sub memchr {
3812+ unimpl "memchr() is C-specific, use index() instead";
3813+}
3814+
3815+sub memcmp {
3816+ unimpl "memcmp() is C-specific, use eq instead";
3817+}
3818+
3819+sub memcpy {
3820+ unimpl "memcpy() is C-specific, use = instead";
3821+}
3822+
3823+sub memmove {
3824+ unimpl "memmove() is C-specific, use = instead";
3825+}
3826+
3827+sub memset {
3828+ unimpl "memset() is C-specific, use x instead";
3829+}
3830+
3831+sub strcat {
3832+ unimpl "strcat() is C-specific, use .= instead";
3833+}
3834+
3835+sub strchr {
3836+ unimpl "strchr() is C-specific, use index() instead";
3837+}
3838+
3839+sub strcmp {
3840+ unimpl "strcmp() is C-specific, use eq instead";
3841+}
3842+
3843+sub strcpy {
3844+ unimpl "strcpy() is C-specific, use = instead";
3845+}
3846+
3847+sub strcspn {
3848+ unimpl "strcspn() is C-specific, use regular expressions instead";
3849+}
3850+
3851+sub strerror {
3852+ usage "strerror(errno)" if @_ != 1;
3853+ local $! = $_[0];
3854+ $! . "";
3855+}
3856+
3857+sub strlen {
3858+ unimpl "strlen() is C-specific, use length instead";
3859+}
3860+
3861+sub strncat {
3862+ unimpl "strncat() is C-specific, use .= instead";
3863+}
3864+
3865+sub strncmp {
3866+ unimpl "strncmp() is C-specific, use eq instead";
3867+}
3868+
3869+sub strncpy {
3870+ unimpl "strncpy() is C-specific, use = instead";
3871+}
3872+
3873+sub strpbrk {
3874+ unimpl "strpbrk() is C-specific, stopped";
3875+}
3876+
3877+sub strrchr {
3878+ unimpl "strrchr() is C-specific, use rindex() instead";
3879+}
3880+
3881+sub strspn {
3882+ unimpl "strspn() is C-specific, stopped";
3883+}
3884+
3885+sub strstr {
3886+ usage "strstr(big, little)" if @_ != 2;
3887+ CORE::index($_[0], $_[1]);
3888+}
3889+
3890+sub strtok {
3891+ unimpl "strtok() is C-specific, stopped";
3892+}
3893+
3894+sub chmod {
3895+ usage "chmod(mode, filename)" if @_ != 2;
3896+ CORE::chmod($_[0], $_[1]);
3897+}
3898+
3899+sub fstat {
3900+ usage "fstat(fd)" if @_ != 1;
3901+ local *TMP;
3902+ CORE::open(TMP, "<&$_[0]"); # Gross.
3903+ my @l = CORE::stat(TMP);
3904+ CORE::close(TMP);
3905+ @l;
3906+}
3907+
3908+sub mkdir {
3909+ usage "mkdir(directoryname, mode)" if @_ != 2;
3910+ CORE::mkdir($_[0], $_[1]);
3911+}
3912+
3913+sub stat {
3914+ usage "stat(filename)" if @_ != 1;
3915+ CORE::stat($_[0]);
3916+}
3917+
3918+sub umask {
3919+ usage "umask(mask)" if @_ != 1;
3920+ CORE::umask($_[0]);
3921+}
3922+
3923+sub wait {
3924+ usage "wait()" if @_ != 0;
3925+ CORE::wait();
3926+}
3927+
3928+sub waitpid {
3929+ usage "waitpid(pid, options)" if @_ != 2;
3930+ CORE::waitpid($_[0], $_[1]);
3931+}
3932+
3933+sub gmtime {
3934+ usage "gmtime(time)" if @_ != 1;
3935+ CORE::gmtime($_[0]);
3936+}
3937+
3938+sub localtime {
3939+ usage "localtime(time)" if @_ != 1;
3940+ CORE::localtime($_[0]);
3941+}
3942+
3943+sub time {
3944+ usage "time()" if @_ != 0;
3945+ CORE::time;
3946+}
3947+
3948+sub alarm {
3949+ usage "alarm(seconds)" if @_ != 1;
3950+ CORE::alarm($_[0]);
3951+}
3952+
3953+sub chdir {
3954+ usage "chdir(directory)" if @_ != 1;
3955+ CORE::chdir($_[0]);
3956+}
3957+
3958+sub chown {
3959+ usage "chown(uid, gid, filename)" if @_ != 3;
3960+ CORE::chown($_[0], $_[1], $_[2]);
3961+}
3962+
3963+sub execl {
3964+ unimpl "execl() is C-specific, stopped";
3965+}
3966+
3967+sub execle {
3968+ unimpl "execle() is C-specific, stopped";
3969+}
3970+
3971+sub execlp {
3972+ unimpl "execlp() is C-specific, stopped";
3973+}
3974+
3975+sub execv {
3976+ unimpl "execv() is C-specific, stopped";
3977+}
3978+
3979+sub execve {
3980+ unimpl "execve() is C-specific, stopped";
3981+}
3982+
3983+sub execvp {
3984+ unimpl "execvp() is C-specific, stopped";
3985+}
3986+
3987+sub fork {
3988+ usage "fork()" if @_ != 0;
3989+ CORE::fork;
3990+}
3991+
3992+sub getegid {
3993+ usage "getegid()" if @_ != 0;
3994+ $) + 0;
3995+}
3996+
3997+sub geteuid {
3998+ usage "geteuid()" if @_ != 0;
3999+ $> + 0;
4000+}
4001+
4002+sub getgid {
4003+ usage "getgid()" if @_ != 0;
4004+ $( + 0;
4005+}
4006+
4007+sub getgroups {
4008+ usage "getgroups()" if @_ != 0;
4009+ my %seen;
4010+ grep(!$seen{$_}++, split(' ', $) ));
4011+}
4012+
4013+sub getlogin {
4014+ usage "getlogin()" if @_ != 0;
4015+ CORE::getlogin();
4016+}
4017+
4018+sub getpgrp {
4019+ usage "getpgrp()" if @_ != 0;
4020+ CORE::getpgrp;
4021+}
4022+
4023+sub getpid {
4024+ usage "getpid()" if @_ != 0;
4025+ $$;
4026+}
4027+
4028+sub getppid {
4029+ usage "getppid()" if @_ != 0;
4030+ CORE::getppid;
4031+}
4032+
4033+sub getuid {
4034+ usage "getuid()" if @_ != 0;
4035+ $<;
4036+}
4037+
4038+sub isatty {
4039+ usage "isatty(filehandle)" if @_ != 1;
4040+ -t $_[0];
4041+}
4042+
4043+sub link {
4044+ usage "link(oldfilename, newfilename)" if @_ != 2;
4045+ CORE::link($_[0], $_[1]);
4046+}
4047+
4048+sub rmdir {
4049+ usage "rmdir(directoryname)" if @_ != 1;
4050+ CORE::rmdir($_[0]);
4051+}
4052+
4053+sub setbuf {
4054+ redef "IO::Handle::setbuf()";
4055+}
4056+
4057+sub setvbuf {
4058+ redef "IO::Handle::setvbuf()";
4059+}
4060+
4061+sub sleep {
4062+ usage "sleep(seconds)" if @_ != 1;
4063+ $_[0] - CORE::sleep($_[0]);
4064+}
4065+
4066+sub unlink {
4067+ usage "unlink(filename)" if @_ != 1;
4068+ CORE::unlink($_[0]);
4069+}
4070+
4071+sub utime {
4072+ usage "utime(filename, atime, mtime)" if @_ != 3;
4073+ CORE::utime($_[1], $_[2], $_[0]);
4074+}
4075+
4076+sub load_imports {
4077+%EXPORT_TAGS = (
4078+
4079+ assert_h => [qw(assert NDEBUG)],
4080+
4081+ ctype_h => [qw(isalnum isalpha iscntrl isdigit isgraph islower
4082+ isprint ispunct isspace isupper isxdigit tolower toupper)],
4083+
4084+ dirent_h => [],
4085+
4086+ errno_h => [qw(E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT
4087+ EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED
4088+ ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT
4089+ EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS
4090+ EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK
4091+ EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH
4092+ ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM
4093+ ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR
4094+ ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM
4095+ EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE
4096+ ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT
4097+ ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY
4098+ EUSERS EWOULDBLOCK EXDEV errno)],
4099+
4100+ fcntl_h => [qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK
4101+ F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK
4102+ O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK
4103+ O_RDONLY O_RDWR O_TRUNC O_WRONLY
4104+ creat
4105+ SEEK_CUR SEEK_END SEEK_SET
4106+ S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU
4107+ S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG S_ISUID
4108+ S_IWGRP S_IWOTH S_IWUSR)],
4109+
4110+ float_h => [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG
4111+ DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP
4112+ DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP
4113+ FLT_DIG FLT_EPSILON FLT_MANT_DIG
4114+ FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP
4115+ FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP
4116+ FLT_RADIX FLT_ROUNDS
4117+ LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG
4118+ LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP
4119+ LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)],
4120+
4121+ grp_h => [],
4122+
4123+ limits_h => [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX
4124+ INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON
4125+ MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX
4126+ PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN
4127+ SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX
4128+ ULONG_MAX USHRT_MAX _POSIX_ARG_MAX _POSIX_CHILD_MAX
4129+ _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT
4130+ _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_OPEN_MAX
4131+ _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX
4132+ _POSIX_STREAM_MAX _POSIX_TZNAME_MAX)],
4133+
4134+ locale_h => [qw(LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES
4135+ LC_MONETARY LC_NUMERIC LC_TIME NULL
4136+ localeconv setlocale)],
4137+
4138+ math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod
4139+ frexp ldexp log10 modf pow sinh tan tanh)],
4140+
4141+ pwd_h => [],
4142+
4143+ setjmp_h => [qw(longjmp setjmp siglongjmp sigsetjmp)],
4144+
4145+ signal_h => [qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK
4146+ SA_RESETHAND SA_RESTART SA_SIGINFO SIGABRT SIGALRM
4147+ SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL
4148+ SIGPIPE %SIGRT SIGRTMIN SIGRTMAX SIGQUIT SIGSEGV SIGSTOP
4149+ SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2
4150+ SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK SIG_UNBLOCK
4151+ raise sigaction signal sigpending sigprocmask sigsuspend)],
4152+
4153+ stdarg_h => [],
4154+
4155+ stddef_h => [qw(NULL offsetof)],
4156+
4157+ stdio_h => [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid
4158+ L_tmpname NULL SEEK_CUR SEEK_END SEEK_SET
4159+ STREAM_MAX TMP_MAX stderr stdin stdout
4160+ clearerr fclose fdopen feof ferror fflush fgetc fgetpos
4161+ fgets fopen fprintf fputc fputs fread freopen
4162+ fscanf fseek fsetpos ftell fwrite getchar gets
4163+ perror putc putchar puts remove rewind
4164+ scanf setbuf setvbuf sscanf tmpfile tmpnam
4165+ ungetc vfprintf vprintf vsprintf)],
4166+
4167+ stdlib_h => [qw(EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX
4168+ abort atexit atof atoi atol bsearch calloc div
4169+ free getenv labs ldiv malloc mblen mbstowcs mbtowc
4170+ qsort realloc strtod strtol strtoul wcstombs wctomb)],
4171+
4172+ string_h => [qw(NULL memchr memcmp memcpy memmove memset strcat
4173+ strchr strcmp strcoll strcpy strcspn strerror strlen
4174+ strncat strncmp strncpy strpbrk strrchr strspn strstr
4175+ strtok strxfrm)],
4176+
4177+ sys_stat_h => [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU
4178+ S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG
4179+ S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
4180+ fstat mkfifo)],
4181+
4182+ sys_times_h => [],
4183+
4184+ sys_types_h => [],
4185+
4186+ sys_utsname_h => [qw(uname)],
4187+
4188+ sys_wait_h => [qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED
4189+ WNOHANG WSTOPSIG WTERMSIG WUNTRACED)],
4190+
4191+ termios_h => [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400
4192+ B300 B38400 B4800 B50 B600 B75 B9600 BRKINT CLOCAL
4193+ CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB ECHO ECHOE ECHOK
4194+ ECHONL HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR
4195+ INLCR INPCK ISIG ISTRIP IXOFF IXON NCCS NOFLSH OPOST
4196+ PARENB PARMRK PARODD TCIFLUSH TCIOFF TCIOFLUSH TCION
4197+ TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW
4198+ TOSTOP VEOF VEOL VERASE VINTR VKILL VMIN VQUIT VSTART
4199+ VSTOP VSUSP VTIME
4200+ cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcdrain
4201+ tcflow tcflush tcgetattr tcsendbreak tcsetattr )],
4202+
4203+ time_h => [qw(CLK_TCK CLOCKS_PER_SEC NULL asctime clock ctime
4204+ difftime mktime strftime tzset tzname)],
4205+
4206+ unistd_h => [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET
4207+ STDERR_FILENO STDIN_FILENO STDOUT_FILENO W_OK X_OK
4208+ _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON
4209+ _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX
4210+ _PC_PIPE_BUF _PC_VDISABLE _POSIX_CHOWN_RESTRICTED
4211+ _POSIX_JOB_CONTROL _POSIX_NO_TRUNC _POSIX_SAVED_IDS
4212+ _POSIX_VDISABLE _POSIX_VERSION _SC_ARG_MAX
4213+ _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL
4214+ _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS
4215+ _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
4216+ _exit access ctermid cuserid
4217+ dup2 dup execl execle execlp execv execve execvp
4218+ fpathconf fsync getcwd getegid geteuid getgid getgroups
4219+ getpid getuid isatty lseek pathconf pause setgid setpgid
4220+ setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)],
4221+
4222+ utime_h => [],
4223+
4224+);
4225+
4226+# Exporter::export_tags();
4227+{
4228+ # De-duplicate the export list:
4229+ my %export;
4230+ @export{map {@$_} values %EXPORT_TAGS} = ();
4231+ # Doing the de-dup with a temporary hash has the advantage that the SVs in
4232+ # @EXPORT are actually shared hash key sacalars, which will save some memory.
4233+ push @EXPORT, keys %export;
4234+}
4235+
4236+@EXPORT_OK = qw(
4237+ abs
4238+ alarm
4239+ atan2
4240+ chdir
4241+ chmod
4242+ chown
4243+ close
4244+ closedir
4245+ cos
4246+ exit
4247+ exp
4248+ fcntl
4249+ fileno
4250+ fork
4251+ getc
4252+ getgrgid
4253+ getgrnam
4254+ getlogin
4255+ getpgrp
4256+ getppid
4257+ getpwnam
4258+ getpwuid
4259+ gmtime
4260+ isatty
4261+ kill
4262+ lchown
4263+ link
4264+ localtime
4265+ log
4266+ mkdir
4267+ nice
4268+ open
4269+ opendir
4270+ pipe
4271+ printf
4272+ rand
4273+ read
4274+ readdir
4275+ rename
4276+ rewinddir
4277+ rmdir
4278+ sin
4279+ sleep
4280+ sprintf
4281+ sqrt
4282+ srand
4283+ stat
4284+ system
4285+ time
4286+ times
4287+ umask
4288+ unlink
4289+ utime
4290+ wait
4291+ waitpid
4292+ write
4293+);
4294+
4295+require Exporter;
4296+}
4297+
4298+package POSIX::SigAction;
4299+
4300+sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0, SAFE => 0}, $_[0] }
4301+sub handler { $_[0]->{HANDLER} = $_[1] if @_ > 1; $_[0]->{HANDLER} };
4302+sub mask { $_[0]->{MASK} = $_[1] if @_ > 1; $_[0]->{MASK} };
4303+sub flags { $_[0]->{FLAGS} = $_[1] if @_ > 1; $_[0]->{FLAGS} };
4304+sub safe { $_[0]->{SAFE} = $_[1] if @_ > 1; $_[0]->{SAFE} };
4305+
4306+package POSIX::SigRt;
4307+
4308+
4309+sub _init {
4310+ $_SIGRTMIN = &POSIX::SIGRTMIN;
4311+ $_SIGRTMAX = &POSIX::SIGRTMAX;
4312+ $_sigrtn = $_SIGRTMAX - $_SIGRTMIN;
4313+}
4314+
4315+sub _croak {
4316+ &_init unless defined $_sigrtn;
4317+ die "POSIX::SigRt not available" unless defined $_sigrtn && $_sigrtn > 0;
4318+}
4319+
4320+sub _getsig {
4321+ &_croak;
4322+ my $rtsig = $_[0];
4323+ # Allow (SIGRT)?MIN( + n)?, a common idiom when doing these things in C.
4324+ $rtsig = $_SIGRTMIN + ($1 || 0)
4325+ if $rtsig =~ /^(?:(?:SIG)?RT)?MIN(\s*\+\s*(\d+))?$/;
4326+ return $rtsig;
4327+}
4328+
4329+sub _exist {
4330+ my $rtsig = _getsig($_[1]);
4331+ my $ok = $rtsig >= $_SIGRTMIN && $rtsig <= $_SIGRTMAX;
4332+ ($rtsig, $ok);
4333+}
4334+
4335+sub _check {
4336+ my ($rtsig, $ok) = &_exist;
4337+ die "No POSIX::SigRt signal $_[1] (valid range SIGRTMIN..SIGRTMAX, or $_SIGRTMIN..$_SIGRTMAX)"
4338+ unless $ok;
4339+ return $rtsig;
4340+}
4341+
4342+sub new {
4343+ my ($rtsig, $handler, $flags) = @_;
4344+ my $sigset = POSIX::SigSet->new($rtsig);
4345+ my $sigact = POSIX::SigAction->new($handler,
4346+ $sigset,
4347+ $flags);
4348+ POSIX::sigaction($rtsig, $sigact);
4349+}
4350+
4351+sub EXISTS { &_exist }
4352+sub FETCH { my $rtsig = &_check;
4353+ my $oa = POSIX::SigAction->new();
4354+ POSIX::sigaction($rtsig, undef, $oa);
4355+ return $oa->{HANDLER} }
4356+sub STORE { my $rtsig = &_check; new($rtsig, $_[2], $SIGACTION_FLAGS) }
4357+sub DELETE { delete $SIG{ &_check } }
4358+sub CLEAR { &_exist; delete @SIG{ &POSIX::SIGRTMIN .. &POSIX::SIGRTMAX } }
4359+sub SCALAR { &_croak; $_sigrtn + 1 }
4360diff --git a/ext/POSIX/lib/POSIX.pod b/ext/POSIX/lib/POSIX.pod
4361new file mode 100644
4362index 0000000..64852e9
4363--- /dev/null
4364+++ b/ext/POSIX/lib/POSIX.pod
4365@@ -0,0 +1,2218 @@
4366+=head1 NAME
4367+
4368+POSIX - Perl interface to IEEE Std 1003.1
4369+
4370+=head1 SYNOPSIS
4371+
4372+ use POSIX;
4373+ use POSIX qw(setsid);
4374+ use POSIX qw(:errno_h :fcntl_h);
4375+
4376+ printf "EINTR is %d\n", EINTR;
4377+
4378+ $sess_id = POSIX::setsid();
4379+
4380+ $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644);
4381+ # note: that's a filedescriptor, *NOT* a filehandle
4382+
4383+=head1 DESCRIPTION
4384+
4385+The POSIX module permits you to access all (or nearly all) the standard
4386+POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish
4387+interfaces.
4388+
4389+I<Everything is exported by default> with the exception of any POSIX
4390+functions with the same name as a built-in Perl function, such as
4391+C<abs>, C<alarm>, C<rmdir>, C<write>, etc.., which will be exported
4392+only if you ask for them explicitly. This is an unfortunate backwards
4393+compatibility feature. You can stop the exporting by saying C<use
4394+POSIX ()> and then use the fully qualified names (ie. C<POSIX::SEEK_END>).
4395+
4396+This document gives a condensed list of the features available in the POSIX
4397+module. Consult your operating system's manpages for general information on
4398+most features. Consult L<perlfunc> for functions which are noted as being
4399+identical to Perl's builtin functions.
4400+
4401+The first section describes POSIX functions from the 1003.1 specification.
4402+The second section describes some classes for signal objects, TTY objects,
4403+and other miscellaneous objects. The remaining sections list various
4404+constants and macros in an organization which roughly follows IEEE Std
4405+1003.1b-1993.
4406+
4407+=head1 NOTE
4408+
4409+The POSIX module is probably the most complex Perl module supplied with
4410+the standard distribution. It incorporates autoloading, namespace games,
4411+and dynamic loading of code that's in Perl, C, or both. It's a great
4412+source of wisdom.
4413+
4414+=head1 CAVEATS
4415+
4416+A few functions are not implemented because they are C specific. If you
4417+attempt to call these, they will print a message telling you that they
4418+aren't implemented, and suggest using the Perl equivalent should one
4419+exist. For example, trying to access the setjmp() call will elicit the
4420+message "setjmp() is C-specific: use eval {} instead".
4421+
4422+Furthermore, some evil vendors will claim 1003.1 compliance, but in fact
4423+are not so: they will not pass the PCTS (POSIX Compliance Test Suites).
4424+For example, one vendor may not define EDEADLK, or the semantics of the
4425+errno values set by open(2) might not be quite right. Perl does not
4426+attempt to verify POSIX compliance. That means you can currently
4427+successfully say "use POSIX", and then later in your program you find
4428+that your vendor has been lax and there's no usable ICANON macro after
4429+all. This could be construed to be a bug.
4430+
4431+=head1 FUNCTIONS
4432+
4433+=over 8
4434+
4435+=item _exit
4436+
4437+This is identical to the C function C<_exit()>. It exits the program
4438+immediately which means among other things buffered I/O is B<not> flushed.
4439+
4440+Note that when using threads and in Linux this is B<not> a good way to
4441+exit a thread because in Linux processes and threads are kind of the
4442+same thing (Note: while this is the situation in early 2003 there are
4443+projects under way to have threads with more POSIXly semantics in Linux).
4444+If you want not to return from a thread, detach the thread.
4445+
4446+=item abort
4447+
4448+This is identical to the C function C<abort()>. It terminates the
4449+process with a C<SIGABRT> signal unless caught by a signal handler or
4450+if the handler does not return normally (it e.g. does a C<longjmp>).
4451+
4452+=item abs
4453+
4454+This is identical to Perl's builtin C<abs()> function, returning
4455+the absolute value of its numerical argument.
4456+
4457+=item access
4458+
4459+Determines the accessibility of a file.
4460+
4461+ if( POSIX::access( "/", &POSIX::R_OK ) ){
4462+ print "have read permission\n";
4463+ }
4464+
4465+Returns C<undef> on failure. Note: do not use C<access()> for
4466+security purposes. Between the C<access()> call and the operation
4467+you are preparing for the permissions might change: a classic
4468+I<race condition>.
4469+
4470+=item acos
4471+
4472+This is identical to the C function C<acos()>, returning
4473+the arcus cosine of its numerical argument. See also L<Math::Trig>.
4474+
4475+=item alarm
4476+
4477+This is identical to Perl's builtin C<alarm()> function,
4478+either for arming or disarming the C<SIGARLM> timer.
4479+
4480+=item asctime
4481+
4482+This is identical to the C function C<asctime()>. It returns
4483+a string of the form
4484+
4485+ "Fri Jun 2 18:22:13 2000\n\0"
4486+
4487+and it is called thusly
4488+
4489+ $asctime = asctime($sec, $min, $hour, $mday, $mon, $year,
4490+ $wday, $yday, $isdst);
4491+
4492+The C<$mon> is zero-based: January equals C<0>. The C<$year> is
4493+1900-based: 2001 equals C<101>. C<$wday> and C<$yday> default to zero
4494+(and are usually ignored anyway), and C<$isdst> defaults to -1.
4495+
4496+=item asin
4497+
4498+This is identical to the C function C<asin()>, returning
4499+the arcus sine of its numerical argument. See also L<Math::Trig>.
4500+
4501+=item assert
4502+
4503+Unimplemented, but you can use L<perlfunc/die> and the L<Carp> module
4504+to achieve similar things.
4505+
4506+=item atan
4507+
4508+This is identical to the C function C<atan()>, returning the
4509+arcus tangent of its numerical argument. See also L<Math::Trig>.
4510+
4511+=item atan2
4512+
4513+This is identical to Perl's builtin C<atan2()> function, returning
4514+the arcus tangent defined by its two numerical arguments, the I<y>
4515+coordinate and the I<x> coordinate. See also L<Math::Trig>.
4516+
4517+=item atexit
4518+
4519+atexit() is C-specific: use C<END {}> instead, see L<perlsub>.
4520+
4521+=item atof
4522+
4523+atof() is C-specific. Perl converts strings to numbers transparently.
4524+If you need to force a scalar to a number, add a zero to it.
4525+
4526+=item atoi
4527+
4528+atoi() is C-specific. Perl converts strings to numbers transparently.
4529+If you need to force a scalar to a number, add a zero to it.
4530+If you need to have just the integer part, see L<perlfunc/int>.
4531+
4532+=item atol
4533+
4534+atol() is C-specific. Perl converts strings to numbers transparently.
4535+If you need to force a scalar to a number, add a zero to it.
4536+If you need to have just the integer part, see L<perlfunc/int>.
4537+
4538+=item bsearch
4539+
4540+bsearch() not supplied. For doing binary search on wordlists,
4541+see L<Search::Dict>.
4542+
4543+=item calloc
4544+
4545+calloc() is C-specific. Perl does memory management transparently.
4546+
4547+=item ceil
4548+
4549+This is identical to the C function C<ceil()>, returning the smallest
4550+integer value greater than or equal to the given numerical argument.
4551+
4552+=item chdir
4553+
4554+This is identical to Perl's builtin C<chdir()> function, allowing
4555+one to change the working (default) directory, see L<perlfunc/chdir>.
4556+
4557+=item chmod
4558+
4559+This is identical to Perl's builtin C<chmod()> function, allowing
4560+one to change file and directory permissions, see L<perlfunc/chmod>.
4561+
4562+=item chown
4563+
4564+This is identical to Perl's builtin C<chown()> function, allowing one
4565+to change file and directory owners and groups, see L<perlfunc/chown>.
4566+
4567+=item clearerr
4568+
4569+Use the method C<IO::Handle::clearerr()> instead, to reset the error
4570+state (if any) and EOF state (if any) of the given stream.
4571+
4572+=item clock
4573+
4574+This is identical to the C function C<clock()>, returning the
4575+amount of spent processor time in microseconds.
4576+
4577+=item close
4578+
4579+Close the file. This uses file descriptors such as those obtained by calling
4580+C<POSIX::open>.
4581+
4582+ $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
4583+ POSIX::close( $fd );
4584+
4585+Returns C<undef> on failure.
4586+
4587+See also L<perlfunc/close>.
4588+
4589+=item closedir
4590+
4591+This is identical to Perl's builtin C<closedir()> function for closing
4592+a directory handle, see L<perlfunc/closedir>.
4593+
4594+=item cos
4595+
4596+This is identical to Perl's builtin C<cos()> function, for returning
4597+the cosine of its numerical argument, see L<perlfunc/cos>.
4598+See also L<Math::Trig>.
4599+
4600+=item cosh
4601+
4602+This is identical to the C function C<cosh()>, for returning
4603+the hyperbolic cosine of its numeric argument. See also L<Math::Trig>.
4604+
4605+=item creat
4606+
4607+Create a new file. This returns a file descriptor like the ones returned by
4608+C<POSIX::open>. Use C<POSIX::close> to close the file.
4609+
4610+ $fd = POSIX::creat( "foo", 0611 );
4611+ POSIX::close( $fd );
4612+
4613+See also L<perlfunc/sysopen> and its C<O_CREAT> flag.
4614+
4615+=item ctermid
4616+
4617+Generates the path name for the controlling terminal.
4618+
4619+ $path = POSIX::ctermid();
4620+
4621+=item ctime
4622+
4623+This is identical to the C function C<ctime()> and equivalent
4624+to C<asctime(localtime(...))>, see L</asctime> and L</localtime>.
4625+
4626+=item cuserid
4627+
4628+Get the login name of the owner of the current process.
4629+
4630+ $name = POSIX::cuserid();
4631+
4632+=item difftime
4633+
4634+This is identical to the C function C<difftime()>, for returning
4635+the time difference (in seconds) between two times (as returned
4636+by C<time()>), see L</time>.
4637+
4638+=item div
4639+
4640+div() is C-specific, use L<perlfunc/int> on the usual C</> division and
4641+the modulus C<%>.
4642+
4643+=item dup
4644+
4645+This is similar to the C function C<dup()>, for duplicating a file
4646+descriptor.
4647+
4648+This uses file descriptors such as those obtained by calling
4649+C<POSIX::open>.
4650+
4651+Returns C<undef> on failure.
4652+
4653+=item dup2
4654+
4655+This is similar to the C function C<dup2()>, for duplicating a file
4656+descriptor to an another known file descriptor.
4657+
4658+This uses file descriptors such as those obtained by calling
4659+C<POSIX::open>.
4660+
4661+Returns C<undef> on failure.
4662+
4663+=item errno
4664+
4665+Returns the value of errno.
4666+
4667+ $errno = POSIX::errno();
4668+
4669+This identical to the numerical values of the C<$!>, see L<perlvar/$ERRNO>.
4670+
4671+=item execl
4672+
4673+execl() is C-specific, see L<perlfunc/exec>.
4674+
4675+=item execle
4676+
4677+execle() is C-specific, see L<perlfunc/exec>.
4678+
4679+=item execlp
4680+
4681+execlp() is C-specific, see L<perlfunc/exec>.
4682+
4683+=item execv
4684+
4685+execv() is C-specific, see L<perlfunc/exec>.
4686+
4687+=item execve
4688+
4689+execve() is C-specific, see L<perlfunc/exec>.
4690+
4691+=item execvp
4692+
4693+execvp() is C-specific, see L<perlfunc/exec>.
4694+
4695+=item exit
4696+
4697+This is identical to Perl's builtin C<exit()> function for exiting the
4698+program, see L<perlfunc/exit>.
4699+
4700+=item exp
4701+
4702+This is identical to Perl's builtin C<exp()> function for
4703+returning the exponent (I<e>-based) of the numerical argument,
4704+see L<perlfunc/exp>.
4705+
4706+=item fabs
4707+
4708+This is identical to Perl's builtin C<abs()> function for returning
4709+the absolute value of the numerical argument, see L<perlfunc/abs>.
4710+
4711+=item fclose
4712+
4713+Use method C<IO::Handle::close()> instead, or see L<perlfunc/close>.
4714+
4715+=item fcntl
4716+
4717+This is identical to Perl's builtin C<fcntl()> function,
4718+see L<perlfunc/fcntl>.
4719+
4720+=item fdopen
4721+
4722+Use method C<IO::Handle::new_from_fd()> instead, or see L<perlfunc/open>.
4723+
4724+=item feof
4725+
4726+Use method C<IO::Handle::eof()> instead, or see L<perlfunc/eof>.
4727+
4728+=item ferror
4729+
4730+Use method C<IO::Handle::error()> instead.
4731+
4732+=item fflush
4733+
4734+Use method C<IO::Handle::flush()> instead.
4735+See also L<perlvar/$OUTPUT_AUTOFLUSH>.
4736+
4737+=item fgetc
4738+
4739+Use method C<IO::Handle::getc()> instead, or see L<perlfunc/read>.
4740+
4741+=item fgetpos
4742+
4743+Use method C<IO::Seekable::getpos()> instead, or see L<L/seek>.
4744+
4745+=item fgets
4746+
4747+Use method C<IO::Handle::gets()> instead. Similar to E<lt>E<gt>, also known
4748+as L<perlfunc/readline>.
4749+
4750+=item fileno
4751+
4752+Use method C<IO::Handle::fileno()> instead, or see L<perlfunc/fileno>.
4753+
4754+=item floor
4755+
4756+This is identical to the C function C<floor()>, returning the largest
4757+integer value less than or equal to the numerical argument.
4758+
4759+=item fmod
4760+
4761+This is identical to the C function C<fmod()>.
4762+
4763+ $r = fmod($x, $y);
4764+
4765+It returns the remainder C<$r = $x - $n*$y>, where C<$n = trunc($x/$y)>.
4766+The C<$r> has the same sign as C<$x> and magnitude (absolute value)
4767+less than the magnitude of C<$y>.
4768+
4769+=item fopen
4770+
4771+Use method C<IO::File::open()> instead, or see L<perlfunc/open>.
4772+
4773+=item fork
4774+
4775+This is identical to Perl's builtin C<fork()> function
4776+for duplicating the current process, see L<perlfunc/fork>
4777+and L<perlfork> if you are in Windows.
4778+
4779+=item fpathconf
4780+
4781+Retrieves the value of a configurable limit on a file or directory. This
4782+uses file descriptors such as those obtained by calling C<POSIX::open>.
4783+
4784+The following will determine the maximum length of the longest allowable
4785+pathname on the filesystem which holds C</var/foo>.
4786+
4787+ $fd = POSIX::open( "/var/foo", &POSIX::O_RDONLY );
4788+ $path_max = POSIX::fpathconf( $fd, &POSIX::_PC_PATH_MAX );
4789+
4790+Returns C<undef> on failure.
4791+
4792+=item fprintf
4793+
4794+fprintf() is C-specific, see L<perlfunc/printf> instead.
4795+
4796+=item fputc
4797+
4798+fputc() is C-specific, see L<perlfunc/print> instead.
4799+
4800+=item fputs
4801+
4802+fputs() is C-specific, see L<perlfunc/print> instead.
4803+
4804+=item fread
4805+
4806+fread() is C-specific, see L<perlfunc/read> instead.
4807+
4808+=item free
4809+
4810+free() is C-specific. Perl does memory management transparently.
4811+
4812+=item freopen
4813+
4814+freopen() is C-specific, see L<perlfunc/open> instead.
4815+
4816+=item frexp
4817+
4818+Return the mantissa and exponent of a floating-point number.
4819+
4820+ ($mantissa, $exponent) = POSIX::frexp( 1.234e56 );
4821+
4822+=item fscanf
4823+
4824+fscanf() is C-specific, use E<lt>E<gt> and regular expressions instead.
4825+
4826+=item fseek
4827+
4828+Use method C<IO::Seekable::seek()> instead, or see L<perlfunc/seek>.
4829+
4830+=item fsetpos
4831+
4832+Use method C<IO::Seekable::setpos()> instead, or seek L<perlfunc/seek>.
4833+
4834+=item fstat
4835+
4836+Get file status. This uses file descriptors such as those obtained by
4837+calling C<POSIX::open>. The data returned is identical to the data from
4838+Perl's builtin C<stat> function.
4839+
4840+ $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
4841+ @stats = POSIX::fstat( $fd );
4842+
4843+=item fsync
4844+
4845+Use method C<IO::Handle::sync()> instead.
4846+
4847+=item ftell
4848+
4849+Use method C<IO::Seekable::tell()> instead, or see L<perlfunc/tell>.
4850+
4851+=item fwrite
4852+
4853+fwrite() is C-specific, see L<perlfunc/print> instead.
4854+
4855+=item getc
4856+
4857+This is identical to Perl's builtin C<getc()> function,
4858+see L<perlfunc/getc>.
4859+
4860+=item getchar
4861+
4862+Returns one character from STDIN. Identical to Perl's C<getc()>,
4863+see L<perlfunc/getc>.
4864+
4865+=item getcwd
4866+
4867+Returns the name of the current working directory.
4868+See also L<Cwd>.
4869+
4870+=item getegid
4871+
4872+Returns the effective group identifier. Similar to Perl' s builtin
4873+variable C<$(>, see L<perlvar/$EGID>.
4874+
4875+=item getenv
4876+
4877+Returns the value of the specified environment variable.
4878+The same information is available through the C<%ENV> array.
4879+
4880+=item geteuid
4881+
4882+Returns the effective user identifier. Identical to Perl's builtin C<$E<gt>>
4883+variable, see L<perlvar/$EUID>.
4884+
4885+=item getgid
4886+
4887+Returns the user's real group identifier. Similar to Perl's builtin
4888+variable C<$)>, see L<perlvar/$GID>.
4889+
4890+=item getgrgid
4891+
4892+This is identical to Perl's builtin C<getgrgid()> function for
4893+returning group entries by group identifiers, see
4894+L<perlfunc/getgrgid>.
4895+
4896+=item getgrnam
4897+
4898+This is identical to Perl's builtin C<getgrnam()> function for
4899+returning group entries by group names, see L<perlfunc/getgrnam>.
4900+
4901+=item getgroups
4902+
4903+Returns the ids of the user's supplementary groups. Similar to Perl's
4904+builtin variable C<$)>, see L<perlvar/$GID>.
4905+
4906+=item getlogin
4907+
4908+This is identical to Perl's builtin C<getlogin()> function for
4909+returning the user name associated with the current session, see
4910+L<perlfunc/getlogin>.
4911+
4912+=item getpgrp
4913+
4914+This is identical to Perl's builtin C<getpgrp()> function for
4915+returning the process group identifier of the current process, see
4916+L<perlfunc/getpgrp>.
4917+
4918+=item getpid
4919+
4920+Returns the process identifier. Identical to Perl's builtin
4921+variable C<$$>, see L<perlvar/$PID>.
4922+
4923+=item getppid
4924+
4925+This is identical to Perl's builtin C<getppid()> function for
4926+returning the process identifier of the parent process of the current
4927+process , see L<perlfunc/getppid>.
4928+
4929+=item getpwnam
4930+
4931+This is identical to Perl's builtin C<getpwnam()> function for
4932+returning user entries by user names, see L<perlfunc/getpwnam>.
4933+
4934+=item getpwuid
4935+
4936+This is identical to Perl's builtin C<getpwuid()> function for
4937+returning user entries by user identifiers, see L<perlfunc/getpwuid>.
4938+
4939+=item gets
4940+
4941+Returns one line from C<STDIN>, similar to E<lt>E<gt>, also known
4942+as the C<readline()> function, see L<perlfunc/readline>.
4943+
4944+B<NOTE>: if you have C programs that still use C<gets()>, be very
4945+afraid. The C<gets()> function is a source of endless grief because
4946+it has no buffer overrun checks. It should B<never> be used. The
4947+C<fgets()> function should be preferred instead.
4948+
4949+=item getuid
4950+
4951+Returns the user's identifier. Identical to Perl's builtin C<$E<lt>> variable,
4952+see L<perlvar/$UID>.
4953+
4954+=item gmtime
4955+
4956+This is identical to Perl's builtin C<gmtime()> function for
4957+converting seconds since the epoch to a date in Greenwich Mean Time,
4958+see L<perlfunc/gmtime>.
4959+
4960+=item isalnum
4961+
4962+This is identical to the C function, except that it can apply to a
4963+single character or to a whole string. Note that locale settings may
4964+affect what characters are considered C<isalnum>. Does not work on
4965+Unicode characters code point 256 or higher. Consider using regular
4966+expressions and the C</[[:alnum:]]/> construct instead, or possibly
4967+the C</\w/> construct.
4968+
4969+=item isalpha
4970+
4971+This is identical to the C function, except that it can apply to
4972+a single character or to a whole string. Note that locale settings
4973+may affect what characters are considered C<isalpha>. Does not work
4974+on Unicode characters code point 256 or higher. Consider using regular
4975+expressions and the C</[[:alpha:]]/> construct instead.
4976+
4977+=item isatty
4978+
4979+Returns a boolean indicating whether the specified filehandle is connected
4980+to a tty. Similar to the C<-t> operator, see L<perlfunc/-X>.
4981+
4982+=item iscntrl
4983+
4984+This is identical to the C function, except that it can apply to
4985+a single character or to a whole string. Note that locale settings
4986+may affect what characters are considered C<iscntrl>. Does not work
4987+on Unicode characters code point 256 or higher. Consider using regular
4988+expressions and the C</[[:cntrl:]]/> construct instead.
4989+
4990+=item isdigit
4991+
4992+This is identical to the C function, except that it can apply to
4993+a single character or to a whole string. Note that locale settings
4994+may affect what characters are considered C<isdigit> (unlikely, but
4995+still possible). Does not work on Unicode characters code point 256
4996+or higher. Consider using regular expressions and the C</[[:digit:]]/>
4997+construct instead, or the C</\d/> construct.
4998+
4999+=item isgraph
5000+
5001+This is identical to the C function, except that it can apply to
5002+a single character or to a whole string. Note that locale settings
5003+may affect what characters are considered C<isgraph>. Does not work
5004+on Unicode characters code point 256 or higher. Consider using regular
5005+expressions and the C</[[:graph:]]/> construct instead.
5006+
5007+=item islower
5008+
5009+This is identical to the C function, except that it can apply to
5010+a single character or to a whole string. Note that locale settings
5011+may affect what characters are considered C<islower>. Does not work
5012+on Unicode characters code point 256 or higher. Consider using regular
5013+expressions and the C</[[:lower:]]/> construct instead. Do B<not> use
5014+C</[a-z]/>.
5015+
5016+=item isprint
5017+
5018+This is identical to the C function, except that it can apply to
5019+a single character or to a whole string. Note that locale settings
5020+may affect what characters are considered C<isprint>. Does not work
5021+on Unicode characters code point 256 or higher. Consider using regular
5022+expressions and the C</[[:print:]]/> construct instead.
5023+
5024+=item ispunct
5025+
5026+This is identical to the C function, except that it can apply to
5027+a single character or to a whole string. Note that locale settings
5028+may affect what characters are considered C<ispunct>. Does not work
5029+on Unicode characters code point 256 or higher. Consider using regular
5030+expressions and the C</[[:punct:]]/> construct instead.
5031+
5032+=item isspace
5033+
5034+This is identical to the C function, except that it can apply to
5035+a single character or to a whole string. Note that locale settings
5036+may affect what characters are considered C<isspace>. Does not work
5037+on Unicode characters code point 256 or higher. Consider using regular
5038+expressions and the C</[[:space:]]/> construct instead, or the C</\s/>
5039+construct. (Note that C</\s/> and C</[[:space:]]/> are slightly
5040+different in that C</[[:space:]]/> can normally match a vertical tab,
5041+while C</\s/> does not.)
5042+
5043+=item isupper
5044+
5045+This is identical to the C function, except that it can apply to
5046+a single character or to a whole string. Note that locale settings
5047+may affect what characters are considered C<isupper>. Does not work
5048+on Unicode characters code point 256 or higher. Consider using regular
5049+expressions and the C</[[:upper:]]/> construct instead. Do B<not> use
5050+C</[A-Z]/>.
5051+
5052+=item isxdigit
5053+
5054+This is identical to the C function, except that it can apply to a single
5055+character or to a whole string. Note that locale settings may affect what
5056+characters are considered C<isxdigit> (unlikely, but still possible).
5057+Does not work on Unicode characters code point 256 or higher.
5058+Consider using regular expressions and the C</[[:xdigit:]]/>
5059+construct instead, or simply C</[0-9a-f]/i>.
5060+
5061+=item kill
5062+
5063+This is identical to Perl's builtin C<kill()> function for sending
5064+signals to processes (often to terminate them), see L<perlfunc/kill>.
5065+
5066+=item labs
5067+
5068+(For returning absolute values of long integers.)
5069+labs() is C-specific, see L<perlfunc/abs> instead.
5070+
5071+=item lchown
5072+
5073+This is identical to the C function, except the order of arguments is
5074+consistent with Perl's builtin C<chown()> with the added restriction
5075+of only one path, not an list of paths. Does the same thing as the
5076+C<chown()> function but changes the owner of a symbolic link instead
5077+of the file the symbolic link points to.
5078+
5079+=item ldexp
5080+
5081+This is identical to the C function C<ldexp()>
5082+for multiplying floating point numbers with powers of two.
5083+
5084+ $x_quadrupled = POSIX::ldexp($x, 2);
5085+
5086+=item ldiv
5087+
5088+(For computing dividends of long integers.)
5089+ldiv() is C-specific, use C</> and C<int()> instead.
5090+
5091+=item link
5092+
5093+This is identical to Perl's builtin C<link()> function
5094+for creating hard links into files, see L<perlfunc/link>.
5095+
5096+=item localeconv
5097+
5098+Get numeric formatting information. Returns a reference to a hash
5099+containing the current locale formatting values.
5100+
5101+Here is how to query the database for the B<de> (Deutsch or German) locale.
5102+
5103+ $loc = POSIX::setlocale( &POSIX::LC_ALL, "de" );
5104+ print "Locale = $loc\n";
5105+ $lconv = POSIX::localeconv();
5106+ print "decimal_point = ", $lconv->{decimal_point}, "\n";
5107+ print "thousands_sep = ", $lconv->{thousands_sep}, "\n";
5108+ print "grouping = ", $lconv->{grouping}, "\n";
5109+ print "int_curr_symbol = ", $lconv->{int_curr_symbol}, "\n";
5110+ print "currency_symbol = ", $lconv->{currency_symbol}, "\n";
5111+ print "mon_decimal_point = ", $lconv->{mon_decimal_point}, "\n";
5112+ print "mon_thousands_sep = ", $lconv->{mon_thousands_sep}, "\n";
5113+ print "mon_grouping = ", $lconv->{mon_grouping}, "\n";
5114+ print "positive_sign = ", $lconv->{positive_sign}, "\n";
5115+ print "negative_sign = ", $lconv->{negative_sign}, "\n";
5116+ print "int_frac_digits = ", $lconv->{int_frac_digits}, "\n";
5117+ print "frac_digits = ", $lconv->{frac_digits}, "\n";
5118+ print "p_cs_precedes = ", $lconv->{p_cs_precedes}, "\n";
5119+ print "p_sep_by_space = ", $lconv->{p_sep_by_space}, "\n";
5120+ print "n_cs_precedes = ", $lconv->{n_cs_precedes}, "\n";
5121+ print "n_sep_by_space = ", $lconv->{n_sep_by_space}, "\n";
5122+ print "p_sign_posn = ", $lconv->{p_sign_posn}, "\n";
5123+ print "n_sign_posn = ", $lconv->{n_sign_posn}, "\n";
5124+
5125+=item localtime
5126+
5127+This is identical to Perl's builtin C<localtime()> function for
5128+converting seconds since the epoch to a date see L<perlfunc/localtime>.
5129+
5130+=item log
5131+
5132+This is identical to Perl's builtin C<log()> function,
5133+returning the natural (I<e>-based) logarithm of the numerical argument,
5134+see L<perlfunc/log>.
5135+
5136+=item log10
5137+
5138+This is identical to the C function C<log10()>,
5139+returning the 10-base logarithm of the numerical argument.
5140+You can also use
5141+
5142+ sub log10 { log($_[0]) / log(10) }
5143+
5144+or
5145+
5146+ sub log10 { log($_[0]) / 2.30258509299405 }
5147+
5148+or
5149+
5150+ sub log10 { log($_[0]) * 0.434294481903252 }
5151+
5152+=item longjmp
5153+
5154+longjmp() is C-specific: use L<perlfunc/die> instead.
5155+
5156+=item lseek
5157+
5158+Move the file's read/write position. This uses file descriptors such as
5159+those obtained by calling C<POSIX::open>.
5160+
5161+ $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
5162+ $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );
5163+
5164+Returns C<undef> on failure.
5165+
5166+=item malloc
5167+
5168+malloc() is C-specific. Perl does memory management transparently.
5169+
5170+=item mblen
5171+
5172+This is identical to the C function C<mblen()>.
5173+Perl does not have any support for the wide and multibyte
5174+characters of the C standards, so this might be a rather
5175+useless function.
5176+
5177+=item mbstowcs
5178+
5179+This is identical to the C function C<mbstowcs()>.
5180+Perl does not have any support for the wide and multibyte
5181+characters of the C standards, so this might be a rather
5182+useless function.
5183+
5184+=item mbtowc
5185+
5186+This is identical to the C function C<mbtowc()>.
5187+Perl does not have any support for the wide and multibyte
5188+characters of the C standards, so this might be a rather
5189+useless function.
5190+
5191+=item memchr
5192+
5193+memchr() is C-specific, see L<perlfunc/index> instead.
5194+
5195+=item memcmp
5196+
5197+memcmp() is C-specific, use C<eq> instead, see L<perlop>.
5198+
5199+=item memcpy
5200+
5201+memcpy() is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
5202+
5203+=item memmove
5204+
5205+memmove() is C-specific, use C<=>, see L<perlop>, or see L<perlfunc/substr>.
5206+
5207+=item memset
5208+
5209+memset() is C-specific, use C<x> instead, see L<perlop>.
5210+
5211+=item mkdir
5212+
5213+This is identical to Perl's builtin C<mkdir()> function
5214+for creating directories, see L<perlfunc/mkdir>.
5215+
5216+=item mkfifo
5217+
5218+This is similar to the C function C<mkfifo()> for creating
5219+FIFO special files.
5220+
5221+ if (mkfifo($path, $mode)) { ....
5222+
5223+Returns C<undef> on failure. The C<$mode> is similar to the
5224+mode of C<mkdir()>, see L<perlfunc/mkdir>, though for C<mkfifo>
5225+you B<must> specify the C<$mode>.
5226+
5227+=item mktime
5228+
5229+Convert date/time info to a calendar time.
5230+
5231+Synopsis:
5232+
5233+ mktime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = -1)
5234+
5235+The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
5236+I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
5237+year (C<year>) is given in years since 1900. I.e. The year 1995 is 95; the
5238+year 2001 is 101. Consult your system's C<mktime()> manpage for details
5239+about these and the other arguments.
5240+
5241+Calendar time for December 12, 1995, at 10:30 am.
5242+
5243+ $time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
5244+ print "Date = ", POSIX::ctime($time_t);
5245+
5246+Returns C<undef> on failure.
5247+
5248+=item modf
5249+
5250+Return the integral and fractional parts of a floating-point number.
5251+
5252+ ($fractional, $integral) = POSIX::modf( 3.14 );
5253+
5254+=item nice
5255+
5256+This is similar to the C function C<nice()>, for changing
5257+the scheduling preference of the current process. Positive
5258+arguments mean more polite process, negative values more
5259+needy process. Normal user processes can only be more polite.
5260+
5261+Returns C<undef> on failure.
5262+
5263+=item offsetof
5264+
5265+offsetof() is C-specific, you probably want to see L<perlfunc/pack> instead.
5266+
5267+=item open
5268+
5269+Open a file for reading for writing. This returns file descriptors, not
5270+Perl filehandles. Use C<POSIX::close> to close the file.
5271+
5272+Open a file read-only with mode 0666.
5273+
5274+ $fd = POSIX::open( "foo" );
5275+
5276+Open a file for read and write.
5277+
5278+ $fd = POSIX::open( "foo", &POSIX::O_RDWR );
5279+
5280+Open a file for write, with truncation.
5281+
5282+ $fd = POSIX::open( "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC );
5283+
5284+Create a new file with mode 0640. Set up the file for writing.
5285+
5286+ $fd = POSIX::open( "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640 );
5287+
5288+Returns C<undef> on failure.
5289+
5290+See also L<perlfunc/sysopen>.
5291+
5292+=item opendir
5293+
5294+Open a directory for reading.
5295+
5296+ $dir = POSIX::opendir( "/var" );
5297+ @files = POSIX::readdir( $dir );
5298+ POSIX::closedir( $dir );
5299+
5300+Returns C<undef> on failure.
5301+
5302+=item pathconf
5303+
5304+Retrieves the value of a configurable limit on a file or directory.
5305+
5306+The following will determine the maximum length of the longest allowable
5307+pathname on the filesystem which holds C</var>.
5308+
5309+ $path_max = POSIX::pathconf( "/var", &POSIX::_PC_PATH_MAX );
5310+
5311+Returns C<undef> on failure.
5312+
5313+=item pause
5314+
5315+This is similar to the C function C<pause()>, which suspends
5316+the execution of the current process until a signal is received.
5317+
5318+Returns C<undef> on failure.
5319+
5320+=item perror
5321+
5322+This is identical to the C function C<perror()>, which outputs to the
5323+standard error stream the specified message followed by ": " and the
5324+current error string. Use the C<warn()> function and the C<$!>
5325+variable instead, see L<perlfunc/warn> and L<perlvar/$ERRNO>.
5326+
5327+=item pipe
5328+
5329+Create an interprocess channel. This returns file descriptors like those
5330+returned by C<POSIX::open>.
5331+
5332+ my ($read, $write) = POSIX::pipe();
5333+ POSIX::write( $write, "hello", 5 );
5334+ POSIX::read( $read, $buf, 5 );
5335+
5336+See also L<perlfunc/pipe>.
5337+
5338+=item pow
5339+
5340+Computes C<$x> raised to the power C<$exponent>.
5341+
5342+ $ret = POSIX::pow( $x, $exponent );
5343+
5344+You can also use the C<**> operator, see L<perlop>.
5345+
5346+=item printf
5347+
5348+Formats and prints the specified arguments to STDOUT.
5349+See also L<perlfunc/printf>.
5350+
5351+=item putc
5352+
5353+putc() is C-specific, see L<perlfunc/print> instead.
5354+
5355+=item putchar
5356+
5357+putchar() is C-specific, see L<perlfunc/print> instead.
5358+
5359+=item puts
5360+
5361+puts() is C-specific, see L<perlfunc/print> instead.
5362+
5363+=item qsort
5364+
5365+qsort() is C-specific, see L<perlfunc/sort> instead.
5366+
5367+=item raise
5368+
5369+Sends the specified signal to the current process.
5370+See also L<perlfunc/kill> and the C<$$> in L<perlvar/$PID>.
5371+
5372+=item rand
5373+
5374+C<rand()> is non-portable, see L<perlfunc/rand> instead.
5375+
5376+=item read
5377+
5378+Read from a file. This uses file descriptors such as those obtained by
5379+calling C<POSIX::open>. If the buffer C<$buf> is not large enough for the
5380+read then Perl will extend it to make room for the request.
5381+
5382+ $fd = POSIX::open( "foo", &POSIX::O_RDONLY );
5383+ $bytes = POSIX::read( $fd, $buf, 3 );
5384+
5385+Returns C<undef> on failure.
5386+
5387+See also L<perlfunc/sysread>.
5388+
5389+=item readdir
5390+
5391+This is identical to Perl's builtin C<readdir()> function
5392+for reading directory entries, see L<perlfunc/readdir>.
5393+
5394+=item realloc
5395+
5396+realloc() is C-specific. Perl does memory management transparently.
5397+
5398+=item remove
5399+
5400+This is identical to Perl's builtin C<unlink()> function
5401+for removing files, see L<perlfunc/unlink>.
5402+
5403+=item rename
5404+
5405+This is identical to Perl's builtin C<rename()> function
5406+for renaming files, see L<perlfunc/rename>.
5407+
5408+=item rewind
5409+
5410+Seeks to the beginning of the file.
5411+
5412+=item rewinddir
5413+
5414+This is identical to Perl's builtin C<rewinddir()> function for
5415+rewinding directory entry streams, see L<perlfunc/rewinddir>.
5416+
5417+=item rmdir
5418+
5419+This is identical to Perl's builtin C<rmdir()> function
5420+for removing (empty) directories, see L<perlfunc/rmdir>.
5421+
5422+=item scanf
5423+
5424+scanf() is C-specific, use E<lt>E<gt> and regular expressions instead,
5425+see L<perlre>.
5426+
5427+=item setgid
5428+
5429+Sets the real group identifier and the effective group identifier for
5430+this process. Similar to assigning a value to the Perl's builtin
5431+C<$)> variable, see L<perlvar/$EGID>, except that the latter
5432+will change only the real user identifier, and that the setgid()
5433+uses only a single numeric argument, as opposed to a space-separated
5434+list of numbers.
5435+
5436+=item setjmp
5437+
5438+C<setjmp()> is C-specific: use C<eval {}> instead,
5439+see L<perlfunc/eval>.
5440+
5441+=item setlocale
5442+
5443+Modifies and queries program's locale. The following examples assume
5444+
5445+ use POSIX qw(setlocale LC_ALL LC_CTYPE);
5446+
5447+has been issued.
5448+
5449+The following will set the traditional UNIX system locale behavior
5450+(the second argument C<"C">).
5451+
5452+ $loc = setlocale( LC_ALL, "C" );
5453+
5454+The following will query the current LC_CTYPE category. (No second
5455+argument means 'query'.)
5456+
5457+ $loc = setlocale( LC_CTYPE );
5458+
5459+The following will set the LC_CTYPE behaviour according to the locale
5460+environment variables (the second argument C<"">).
5461+Please see your systems C<setlocale(3)> documentation for the locale
5462+environment variables' meaning or consult L<perllocale>.
5463+
5464+ $loc = setlocale( LC_CTYPE, "" );
5465+
5466+The following will set the LC_COLLATE behaviour to Argentinian
5467+Spanish. B<NOTE>: The naming and availability of locales depends on
5468+your operating system. Please consult L<perllocale> for how to find
5469+out which locales are available in your system.
5470+
5471+ $loc = setlocale( LC_COLLATE, "es_AR.ISO8859-1" );
5472+
5473+=item setpgid
5474+
5475+This is similar to the C function C<setpgid()> for
5476+setting the process group identifier of the current process.
5477+
5478+Returns C<undef> on failure.
5479+
5480+=item setsid
5481+
5482+This is identical to the C function C<setsid()> for
5483+setting the session identifier of the current process.
5484+
5485+=item setuid
5486+
5487+Sets the real user identifier and the effective user identifier for
5488+this process. Similar to assigning a value to the Perl's builtin
5489+C<$E<lt>> variable, see L<perlvar/$UID>, except that the latter
5490+will change only the real user identifier.
5491+
5492+=item sigaction
5493+
5494+Detailed signal management. This uses C<POSIX::SigAction> objects for
5495+the C<action> and C<oldaction> arguments (the oldaction can also be
5496+just a hash reference). Consult your system's C<sigaction> manpage
5497+for details, see also C<POSIX::SigRt>.
5498+
5499+Synopsis:
5500+
5501+ sigaction(signal, action, oldaction = 0)
5502+
5503+Returns C<undef> on failure. The C<signal> must be a number (like
5504+SIGHUP), not a string (like "SIGHUP"), though Perl does try hard
5505+to understand you.
5506+
5507+If you use the SA_SIGINFO flag, the signal handler will in addition to
5508+the first argument, the signal name, also receive a second argument, a
5509+hash reference, inside which are the following keys with the following
5510+semantics, as defined by POSIX/SUSv3:
5511+
5512+ signo the signal number
5513+ errno the error number
5514+ code if this is zero or less, the signal was sent by
5515+ a user process and the uid and pid make sense,
5516+ otherwise the signal was sent by the kernel
5517+
5518+The following are also defined by POSIX/SUSv3, but unfortunately
5519+not very widely implemented:
5520+
5521+ pid the process id generating the signal
5522+ uid the uid of the process id generating the signal
5523+ status exit value or signal for SIGCHLD
5524+ band band event for SIGPOLL
5525+
5526+A third argument is also passed to the handler, which contains a copy
5527+of the raw binary contents of the siginfo structure: if a system has
5528+some non-POSIX fields, this third argument is where to unpack() them
5529+from.
5530+
5531+Note that not all siginfo values make sense simultaneously (some are
5532+valid only for certain signals, for example), and not all values make
5533+sense from Perl perspective, you should to consult your system's
5534+C<sigaction> and possibly also C<siginfo> documentation.
5535+
5536+=item siglongjmp
5537+
5538+siglongjmp() is C-specific: use L<perlfunc/die> instead.
5539+
5540+=item sigpending
5541+
5542+Examine signals that are blocked and pending. This uses C<POSIX::SigSet>
5543+objects for the C<sigset> argument. Consult your system's C<sigpending>
5544+manpage for details.
5545+
5546+Synopsis:
5547+
5548+ sigpending(sigset)
5549+
5550+Returns C<undef> on failure.
5551+
5552+=item sigprocmask
5553+
5554+Change and/or examine calling process's signal mask. This uses
5555+C<POSIX::SigSet> objects for the C<sigset> and C<oldsigset> arguments.
5556+Consult your system's C<sigprocmask> manpage for details.
5557+
5558+Synopsis:
5559+
5560+ sigprocmask(how, sigset, oldsigset = 0)
5561+
5562+Returns C<undef> on failure.
5563+
5564+=item sigsetjmp
5565+
5566+C<sigsetjmp()> is C-specific: use C<eval {}> instead,
5567+see L<perlfunc/eval>.
5568+
5569+=item sigsuspend
5570+
5571+Install a signal mask and suspend process until signal arrives. This uses
5572+C<POSIX::SigSet> objects for the C<signal_mask> argument. Consult your
5573+system's C<sigsuspend> manpage for details.
5574+
5575+Synopsis:
5576+
5577+ sigsuspend(signal_mask)
5578+
5579+Returns C<undef> on failure.
5580+
5581+=item sin
5582+
5583+This is identical to Perl's builtin C<sin()> function
5584+for returning the sine of the numerical argument,
5585+see L<perlfunc/sin>. See also L<Math::Trig>.
5586+
5587+=item sinh
5588+
5589+This is identical to the C function C<sinh()>
5590+for returning the hyperbolic sine of the numerical argument.
5591+See also L<Math::Trig>.
5592+
5593+=item sleep
5594+
5595+This is functionally identical to Perl's builtin C<sleep()> function
5596+for suspending the execution of the current for process for certain
5597+number of seconds, see L<perlfunc/sleep>. There is one significant
5598+difference, however: C<POSIX::sleep()> returns the number of
5599+B<unslept> seconds, while the C<CORE::sleep()> returns the
5600+number of slept seconds.
5601+
5602+=item sprintf
5603+
5604+This is similar to Perl's builtin C<sprintf()> function
5605+for returning a string that has the arguments formatted as requested,
5606+see L<perlfunc/sprintf>.
5607+
5608+=item sqrt
5609+
5610+This is identical to Perl's builtin C<sqrt()> function.
5611+for returning the square root of the numerical argument,
5612+see L<perlfunc/sqrt>.
5613+
5614+=item srand
5615+
5616+Give a seed the pseudorandom number generator, see L<perlfunc/srand>.
5617+
5618+=item sscanf
5619+
5620+sscanf() is C-specific, use regular expressions instead,
5621+see L<perlre>.
5622+
5623+=item stat
5624+
5625+This is identical to Perl's builtin C<stat()> function
5626+for returning information about files and directories.
5627+
5628+=item strcat
5629+
5630+strcat() is C-specific, use C<.=> instead, see L<perlop>.
5631+
5632+=item strchr
5633+
5634+strchr() is C-specific, see L<perlfunc/index> instead.
5635+
5636+=item strcmp
5637+
5638+strcmp() is C-specific, use C<eq> or C<cmp> instead, see L<perlop>.
5639+
5640+=item strcoll
5641+
5642+This is identical to the C function C<strcoll()>
5643+for collating (comparing) strings transformed using
5644+the C<strxfrm()> function. Not really needed since
5645+Perl can do this transparently, see L<perllocale>.
5646+
5647+=item strcpy
5648+
5649+strcpy() is C-specific, use C<=> instead, see L<perlop>.
5650+
5651+=item strcspn
5652+
5653+strcspn() is C-specific, use regular expressions instead,
5654+see L<perlre>.
5655+
5656+=item strerror
5657+
5658+Returns the error string for the specified errno.
5659+Identical to the string form of the C<$!>, see L<perlvar/$ERRNO>.
5660+
5661+=item strftime
5662+
5663+Convert date and time information to string. Returns the string.
5664+
5665+Synopsis:
5666+
5667+ strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1)
5668+
5669+The month (C<mon>), weekday (C<wday>), and yearday (C<yday>) begin at zero.
5670+I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The
5671+year (C<year>) is given in years since 1900. I.e., the year 1995 is 95; the
5672+year 2001 is 101. Consult your system's C<strftime()> manpage for details
5673+about these and the other arguments.
5674+
5675+If you want your code to be portable, your format (C<fmt>) argument
5676+should use only the conversion specifiers defined by the ANSI C
5677+standard (C89, to play safe). These are C<aAbBcdHIjmMpSUwWxXyYZ%>.
5678+But even then, the B<results> of some of the conversion specifiers are
5679+non-portable. For example, the specifiers C<aAbBcpZ> change according
5680+to the locale settings of the user, and both how to set locales (the
5681+locale names) and what output to expect are non-standard.
5682+The specifier C<c> changes according to the timezone settings of the
5683+user and the timezone computation rules of the operating system.
5684+The C<Z> specifier is notoriously unportable since the names of
5685+timezones are non-standard. Sticking to the numeric specifiers is the
5686+safest route.
5687+
5688+The given arguments are made consistent as though by calling
5689+C<mktime()> before calling your system's C<strftime()> function,
5690+except that the C<isdst> value is not affected.
5691+
5692+The string for Tuesday, December 12, 1995.
5693+
5694+ $str = POSIX::strftime( "%A, %B %d, %Y", 0, 0, 0, 12, 11, 95, 2 );
5695+ print "$str\n";
5696+
5697+=item strlen
5698+
5699+strlen() is C-specific, use C<length()> instead, see L<perlfunc/length>.
5700+
5701+=item strncat
5702+
5703+strncat() is C-specific, use C<.=> instead, see L<perlop>.
5704+
5705+=item strncmp
5706+
5707+strncmp() is C-specific, use C<eq> instead, see L<perlop>.
5708+
5709+=item strncpy
5710+
5711+strncpy() is C-specific, use C<=> instead, see L<perlop>.
5712+
5713+=item strpbrk
5714+
5715+strpbrk() is C-specific, use regular expressions instead,
5716+see L<perlre>.
5717+
5718+=item strrchr
5719+
5720+strrchr() is C-specific, see L<perlfunc/rindex> instead.
5721+
5722+=item strspn
5723+
5724+strspn() is C-specific, use regular expressions instead,
5725+see L<perlre>.
5726+
5727+=item strstr
5728+
5729+This is identical to Perl's builtin C<index()> function,
5730+see L<perlfunc/index>.
5731+
5732+=item strtod
5733+
5734+String to double translation. Returns the parsed number and the number
5735+of characters in the unparsed portion of the string. Truly
5736+POSIX-compliant systems set $! ($ERRNO) to indicate a translation
5737+error, so clear $! before calling strtod. However, non-POSIX systems
5738+may not check for overflow, and therefore will never set $!.
5739+
5740+strtod should respect any POSIX I<setlocale()> settings.
5741+
5742+To parse a string $str as a floating point number use
5743+
5744+ $! = 0;
5745+ ($num, $n_unparsed) = POSIX::strtod($str);
5746+
5747+The second returned item and $! can be used to check for valid input:
5748+
5749+ if (($str eq '') || ($n_unparsed != 0) || $!) {
5750+ die "Non-numeric input $str" . ($! ? ": $!\n" : "\n");
5751+ }
5752+
5753+When called in a scalar context strtod returns the parsed number.
5754+
5755+=item strtok
5756+
5757+strtok() is C-specific, use regular expressions instead, see
5758+L<perlre>, or L<perlfunc/split>.
5759+
5760+=item strtol
5761+
5762+String to (long) integer translation. Returns the parsed number and
5763+the number of characters in the unparsed portion of the string. Truly
5764+POSIX-compliant systems set $! ($ERRNO) to indicate a translation
5765+error, so clear $! before calling strtol. However, non-POSIX systems
5766+may not check for overflow, and therefore will never set $!.
5767+
5768+strtol should respect any POSIX I<setlocale()> settings.
5769+
5770+To parse a string $str as a number in some base $base use
5771+
5772+ $! = 0;
5773+ ($num, $n_unparsed) = POSIX::strtol($str, $base);
5774+
5775+The base should be zero or between 2 and 36, inclusive. When the base
5776+is zero or omitted strtol will use the string itself to determine the
5777+base: a leading "0x" or "0X" means hexadecimal; a leading "0" means
5778+octal; any other leading characters mean decimal. Thus, "1234" is
5779+parsed as a decimal number, "01234" as an octal number, and "0x1234"
5780+as a hexadecimal number.
5781+
5782+The second returned item and $! can be used to check for valid input:
5783+
5784+ if (($str eq '') || ($n_unparsed != 0) || !$!) {
5785+ die "Non-numeric input $str" . $! ? ": $!\n" : "\n";
5786+ }
5787+
5788+When called in a scalar context strtol returns the parsed number.
5789+
5790+=item strtoul
5791+
5792+String to unsigned (long) integer translation. strtoul() is identical
5793+to strtol() except that strtoul() only parses unsigned integers. See
5794+L</strtol> for details.
5795+
5796+Note: Some vendors supply strtod() and strtol() but not strtoul().
5797+Other vendors that do supply strtoul() parse "-1" as a valid value.
5798+
5799+=item strxfrm
5800+
5801+String transformation. Returns the transformed string.
5802+
5803+ $dst = POSIX::strxfrm( $src );
5804+
5805+Used in conjunction with the C<strcoll()> function, see L</strcoll>.
5806+
5807+Not really needed since Perl can do this transparently, see
5808+L<perllocale>.
5809+
5810+=item sysconf
5811+
5812+Retrieves values of system configurable variables.
5813+
5814+The following will get the machine's clock speed.
5815+
5816+ $clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );
5817+
5818+Returns C<undef> on failure.
5819+
5820+=item system
5821+
5822+This is identical to Perl's builtin C<system()> function, see
5823+L<perlfunc/system>.
5824+
5825+=item tan
5826+
5827+This is identical to the C function C<tan()>, returning the
5828+tangent of the numerical argument. See also L<Math::Trig>.
5829+
5830+=item tanh
5831+
5832+This is identical to the C function C<tanh()>, returning the
5833+hyperbolic tangent of the numerical argument. See also L<Math::Trig>.
5834+
5835+=item tcdrain
5836+
5837+This is similar to the C function C<tcdrain()> for draining
5838+the output queue of its argument stream.
5839+
5840+Returns C<undef> on failure.
5841+
5842+=item tcflow
5843+
5844+This is similar to the C function C<tcflow()> for controlling
5845+the flow of its argument stream.
5846+
5847+Returns C<undef> on failure.
5848+
5849+=item tcflush
5850+
5851+This is similar to the C function C<tcflush()> for flushing
5852+the I/O buffers of its argument stream.
5853+
5854+Returns C<undef> on failure.
5855+
5856+=item tcgetpgrp
5857+
5858+This is identical to the C function C<tcgetpgrp()> for returning the
5859+process group identifier of the foreground process group of the controlling
5860+terminal.
5861+
5862+=item tcsendbreak
5863+
5864+This is similar to the C function C<tcsendbreak()> for sending
5865+a break on its argument stream.
5866+
5867+Returns C<undef> on failure.
5868+
5869+=item tcsetpgrp
5870+
5871+This is similar to the C function C<tcsetpgrp()> for setting the
5872+process group identifier of the foreground process group of the controlling
5873+terminal.
5874+
5875+Returns C<undef> on failure.
5876+
5877+=item time
5878+
5879+This is identical to Perl's builtin C<time()> function
5880+for returning the number of seconds since the epoch
5881+(whatever it is for the system), see L<perlfunc/time>.
5882+
5883+=item times
5884+
5885+The times() function returns elapsed realtime since some point in the past
5886+(such as system startup), user and system times for this process, and user
5887+and system times used by child processes. All times are returned in clock
5888+ticks.
5889+
5890+ ($realtime, $user, $system, $cuser, $csystem) = POSIX::times();
5891+
5892+Note: Perl's builtin C<times()> function returns four values, measured in
5893+seconds.
5894+
5895+=item tmpfile
5896+
5897+Use method C<IO::File::new_tmpfile()> instead, or see L<File::Temp>.
5898+
5899+=item tmpnam
5900+
5901+Returns a name for a temporary file.
5902+
5903+ $tmpfile = POSIX::tmpnam();
5904+
5905+For security reasons, which are probably detailed in your system's
5906+documentation for the C library tmpnam() function, this interface
5907+should not be used; instead see L<File::Temp>.
5908+
5909+=item tolower
5910+
5911+This is identical to the C function, except that it can apply to a single
5912+character or to a whole string. Consider using the C<lc()> function,
5913+see L<perlfunc/lc>, or the equivalent C<\L> operator inside doublequotish
5914+strings.
5915+
5916+=item toupper
5917+
5918+This is identical to the C function, except that it can apply to a single
5919+character or to a whole string. Consider using the C<uc()> function,
5920+see L<perlfunc/uc>, or the equivalent C<\U> operator inside doublequotish
5921+strings.
5922+
5923+=item ttyname
5924+
5925+This is identical to the C function C<ttyname()> for returning the
5926+name of the current terminal.
5927+
5928+=item tzname
5929+
5930+Retrieves the time conversion information from the C<tzname> variable.
5931+
5932+ POSIX::tzset();
5933+ ($std, $dst) = POSIX::tzname();
5934+
5935+=item tzset
5936+
5937+This is identical to the C function C<tzset()> for setting
5938+the current timezone based on the environment variable C<TZ>,
5939+to be used by C<ctime()>, C<localtime()>, C<mktime()>, and C<strftime()>
5940+functions.
5941+
5942+=item umask
5943+
5944+This is identical to Perl's builtin C<umask()> function
5945+for setting (and querying) the file creation permission mask,
5946+see L<perlfunc/umask>.
5947+
5948+=item uname
5949+
5950+Get name of current operating system.
5951+
5952+ ($sysname, $nodename, $release, $version, $machine) = POSIX::uname();
5953+
5954+Note that the actual meanings of the various fields are not
5955+that well standardized, do not expect any great portability.
5956+The C<$sysname> might be the name of the operating system,
5957+the C<$nodename> might be the name of the host, the C<$release>
5958+might be the (major) release number of the operating system,
5959+the C<$version> might be the (minor) release number of the
5960+operating system, and the C<$machine> might be a hardware identifier.
5961+Maybe.
5962+
5963+=item ungetc
5964+
5965+Use method C<IO::Handle::ungetc()> instead.
5966+
5967+=item unlink
5968+
5969+This is identical to Perl's builtin C<unlink()> function
5970+for removing files, see L<perlfunc/unlink>.
5971+
5972+=item utime
5973+
5974+This is identical to Perl's builtin C<utime()> function
5975+for changing the time stamps of files and directories,
5976+see L<perlfunc/utime>.
5977+
5978+=item vfprintf
5979+
5980+vfprintf() is C-specific, see L<perlfunc/printf> instead.
5981+
5982+=item vprintf
5983+
5984+vprintf() is C-specific, see L<perlfunc/printf> instead.
5985+
5986+=item vsprintf
5987+
5988+vsprintf() is C-specific, see L<perlfunc/sprintf> instead.
5989+
5990+=item wait
5991+
5992+This is identical to Perl's builtin C<wait()> function,
5993+see L<perlfunc/wait>.
5994+
5995+=item waitpid
5996+
5997+Wait for a child process to change state. This is identical to Perl's
5998+builtin C<waitpid()> function, see L<perlfunc/waitpid>.
5999+
6000+ $pid = POSIX::waitpid( -1, POSIX::WNOHANG );
6001+ print "status = ", ($? / 256), "\n";
6002+
6003+=item wcstombs
6004+
6005+This is identical to the C function C<wcstombs()>.
6006+Perl does not have any support for the wide and multibyte
6007+characters of the C standards, so this might be a rather
6008+useless function.
6009+
6010+=item wctomb
6011+
6012+This is identical to the C function C<wctomb()>.
6013+Perl does not have any support for the wide and multibyte
6014+characters of the C standards, so this might be a rather
6015+useless function.
6016+
6017+=item write
6018+
6019+Write to a file. This uses file descriptors such as those obtained by
6020+calling C<POSIX::open>.
6021+
6022+ $fd = POSIX::open( "foo", &POSIX::O_WRONLY );
6023+ $buf = "hello";
6024+ $bytes = POSIX::write( $fd, $buf, 5 );
6025+
6026+Returns C<undef> on failure.
6027+
6028+See also L<perlfunc/syswrite>.
6029+
6030+=back
6031+
6032+=head1 CLASSES
6033+
6034+=head2 POSIX::SigAction
6035+
6036+=over 8
6037+
6038+=item new
6039+
6040+Creates a new C<POSIX::SigAction> object which corresponds to the C
6041+C<struct sigaction>. This object will be destroyed automatically when
6042+it is no longer needed. The first parameter is the handler, a sub
6043+reference. The second parameter is a C<POSIX::SigSet> object, it
6044+defaults to the empty set. The third parameter contains the
6045+C<sa_flags>, it defaults to 0.
6046+
6047+ $sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);
6048+ $sigaction = POSIX::SigAction->new( \&handler, $sigset, &POSIX::SA_NOCLDSTOP );
6049+
6050+This C<POSIX::SigAction> object is intended for use with the C<POSIX::sigaction()>
6051+function.
6052+
6053+=back
6054+
6055+=over 8
6056+
6057+=item handler
6058+
6059+=item mask
6060+
6061+=item flags
6062+
6063+accessor functions to get/set the values of a SigAction object.
6064+
6065+ $sigset = $sigaction->mask;
6066+ $sigaction->flags(&POSIX::SA_RESTART);
6067+
6068+=item safe
6069+
6070+accessor function for the "safe signals" flag of a SigAction object; see
6071+L<perlipc> for general information on safe (a.k.a. "deferred") signals. If
6072+you wish to handle a signal safely, use this accessor to set the "safe" flag
6073+in the C<POSIX::SigAction> object:
6074+
6075+ $sigaction->safe(1);
6076+
6077+You may also examine the "safe" flag on the output action object which is
6078+filled in when given as the third parameter to C<POSIX::sigaction()>:
6079+
6080+ sigaction(SIGINT, $new_action, $old_action);
6081+ if ($old_action->safe) {
6082+ # previous SIGINT handler used safe signals
6083+ }
6084+
6085+=back
6086+
6087+=head2 POSIX::SigRt
6088+
6089+=over 8
6090+
6091+=item %SIGRT
6092+
6093+A hash of the POSIX realtime signal handlers. It is an extension of
6094+the standard %SIG, the $POSIX::SIGRT{SIGRTMIN} is roughly equivalent
6095+to $SIG{SIGRTMIN}, but the right POSIX moves (see below) are made with
6096+the POSIX::SigSet and POSIX::sigaction instead of accessing the %SIG.
6097+
6098+You can set the %POSIX::SIGRT elements to set the POSIX realtime
6099+signal handlers, use C<delete> and C<exists> on the elements, and use
6100+C<scalar> on the C<%POSIX::SIGRT> to find out how many POSIX realtime
6101+signals there are available (SIGRTMAX - SIGRTMIN + 1, the SIGRTMAX is
6102+a valid POSIX realtime signal).
6103+
6104+Setting the %SIGRT elements is equivalent to calling this:
6105+
6106+ sub new {
6107+ my ($rtsig, $handler, $flags) = @_;
6108+ my $sigset = POSIX::SigSet($rtsig);
6109+ my $sigact = POSIX::SigAction->new($handler, $sigset, $flags);
6110+ sigaction($rtsig, $sigact);
6111+ }
6112+
6113+The flags default to zero, if you want something different you can
6114+either use C<local> on $POSIX::SigRt::SIGACTION_FLAGS, or you can
6115+derive from POSIX::SigRt and define your own C<new()> (the tied hash
6116+STORE method of the %SIGRT calls C<new($rtsig, $handler, $SIGACTION_FLAGS)>,
6117+where the $rtsig ranges from zero to SIGRTMAX - SIGRTMIN + 1).
6118+
6119+Just as with any signal, you can use sigaction($rtsig, undef, $oa) to
6120+retrieve the installed signal handler (or, rather, the signal action).
6121+
6122+B<NOTE:> whether POSIX realtime signals really work in your system, or
6123+whether Perl has been compiled so that it works with them, is outside
6124+of this discussion.
6125+
6126+=item SIGRTMIN
6127+
6128+Return the minimum POSIX realtime signal number available, or C<undef>
6129+if no POSIX realtime signals are available.
6130+
6131+=item SIGRTMAX
6132+
6133+Return the maximum POSIX realtime signal number available, or C<undef>
6134+if no POSIX realtime signals are available.
6135+
6136+=back
6137+
6138+=head2 POSIX::SigSet
6139+
6140+=over 8
6141+
6142+=item new
6143+
6144+Create a new SigSet object. This object will be destroyed automatically
6145+when it is no longer needed. Arguments may be supplied to initialize the
6146+set.
6147+
6148+Create an empty set.
6149+
6150+ $sigset = POSIX::SigSet->new;
6151+
6152+Create a set with SIGUSR1.
6153+
6154+ $sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );
6155+
6156+=item addset
6157+
6158+Add a signal to a SigSet object.
6159+
6160+ $sigset->addset( &POSIX::SIGUSR2 );
6161+
6162+Returns C<undef> on failure.
6163+
6164+=item delset
6165+
6166+Remove a signal from the SigSet object.
6167+
6168+ $sigset->delset( &POSIX::SIGUSR2 );
6169+
6170+Returns C<undef> on failure.
6171+
6172+=item emptyset
6173+
6174+Initialize the SigSet object to be empty.
6175+
6176+ $sigset->emptyset();
6177+
6178+Returns C<undef> on failure.
6179+
6180+=item fillset
6181+
6182+Initialize the SigSet object to include all signals.
6183+
6184+ $sigset->fillset();
6185+
6186+Returns C<undef> on failure.
6187+
6188+=item ismember
6189+
6190+Tests the SigSet object to see if it contains a specific signal.
6191+
6192+ if( $sigset->ismember( &POSIX::SIGUSR1 ) ){
6193+ print "contains SIGUSR1\n";
6194+ }
6195+
6196+=back
6197+
6198+=head2 POSIX::Termios
6199+
6200+=over 8
6201+
6202+=item new
6203+
6204+Create a new Termios object. This object will be destroyed automatically
6205+when it is no longer needed. A Termios object corresponds to the termios
6206+C struct. new() mallocs a new one, getattr() fills it from a file descriptor,
6207+and setattr() sets a file descriptor's parameters to match Termios' contents.
6208+
6209+ $termios = POSIX::Termios->new;
6210+
6211+=item getattr
6212+
6213+Get terminal control attributes.
6214+
6215+Obtain the attributes for stdin.
6216+
6217+ $termios->getattr( 0 ) # Recommended for clarity.
6218+ $termios->getattr()
6219+
6220+Obtain the attributes for stdout.
6221+
6222+ $termios->getattr( 1 )
6223+
6224+Returns C<undef> on failure.
6225+
6226+=item getcc
6227+
6228+Retrieve a value from the c_cc field of a termios object. The c_cc field is
6229+an array so an index must be specified.
6230+
6231+ $c_cc[1] = $termios->getcc(1);
6232+
6233+=item getcflag
6234+
6235+Retrieve the c_cflag field of a termios object.
6236+
6237+ $c_cflag = $termios->getcflag;
6238+
6239+=item getiflag
6240+
6241+Retrieve the c_iflag field of a termios object.
6242+
6243+ $c_iflag = $termios->getiflag;
6244+
6245+=item getispeed
6246+
6247+Retrieve the input baud rate.
6248+
6249+ $ispeed = $termios->getispeed;
6250+
6251+=item getlflag
6252+
6253+Retrieve the c_lflag field of a termios object.
6254+
6255+ $c_lflag = $termios->getlflag;
6256+
6257+=item getoflag
6258+
6259+Retrieve the c_oflag field of a termios object.
6260+
6261+ $c_oflag = $termios->getoflag;
6262+
6263+=item getospeed
6264+
6265+Retrieve the output baud rate.
6266+
6267+ $ospeed = $termios->getospeed;
6268+
6269+=item setattr
6270+
6271+Set terminal control attributes.
6272+
6273+Set attributes immediately for stdout.
6274+
6275+ $termios->setattr( 1, &POSIX::TCSANOW );
6276+
6277+Returns C<undef> on failure.
6278+
6279+=item setcc
6280+
6281+Set a value in the c_cc field of a termios object. The c_cc field is an
6282+array so an index must be specified.
6283+
6284+ $termios->setcc( &POSIX::VEOF, 1 );
6285+
6286+=item setcflag
6287+
6288+Set the c_cflag field of a termios object.
6289+
6290+ $termios->setcflag( $c_cflag | &POSIX::CLOCAL );
6291+
6292+=item setiflag
6293+
6294+Set the c_iflag field of a termios object.
6295+
6296+ $termios->setiflag( $c_iflag | &POSIX::BRKINT );
6297+
6298+=item setispeed
6299+
6300+Set the input baud rate.
6301+
6302+ $termios->setispeed( &POSIX::B9600 );
6303+
6304+Returns C<undef> on failure.
6305+
6306+=item setlflag
6307+
6308+Set the c_lflag field of a termios object.
6309+
6310+ $termios->setlflag( $c_lflag | &POSIX::ECHO );
6311+
6312+=item setoflag
6313+
6314+Set the c_oflag field of a termios object.
6315+
6316+ $termios->setoflag( $c_oflag | &POSIX::OPOST );
6317+
6318+=item setospeed
6319+
6320+Set the output baud rate.
6321+
6322+ $termios->setospeed( &POSIX::B9600 );
6323+
6324+Returns C<undef> on failure.
6325+
6326+=item Baud rate values
6327+
6328+B38400 B75 B200 B134 B300 B1800 B150 B0 B19200 B1200 B9600 B600 B4800 B50 B2400 B110
6329+
6330+=item Terminal interface values
6331+
6332+TCSADRAIN TCSANOW TCOON TCIOFLUSH TCOFLUSH TCION TCIFLUSH TCSAFLUSH TCIOFF TCOOFF
6333+
6334+=item c_cc field values
6335+
6336+VEOF VEOL VERASE VINTR VKILL VQUIT VSUSP VSTART VSTOP VMIN VTIME NCCS
6337+
6338+=item c_cflag field values
6339+
6340+CLOCAL CREAD CSIZE CS5 CS6 CS7 CS8 CSTOPB HUPCL PARENB PARODD
6341+
6342+=item c_iflag field values
6343+
6344+BRKINT ICRNL IGNBRK IGNCR IGNPAR INLCR INPCK ISTRIP IXOFF IXON PARMRK
6345+
6346+=item c_lflag field values
6347+
6348+ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH TOSTOP
6349+
6350+=item c_oflag field values
6351+
6352+OPOST
6353+
6354+=back
6355+
6356+=head1 PATHNAME CONSTANTS
6357+
6358+=over 8
6359+
6360+=item Constants
6361+
6362+_PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE
6363+
6364+=back
6365+
6366+=head1 POSIX CONSTANTS
6367+
6368+=over 8
6369+
6370+=item Constants
6371+
6372+_POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED _POSIX_JOB_CONTROL _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SAVED_IDS _POSIX_SSIZE_MAX _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION
6373+
6374+=back
6375+
6376+=head1 SYSTEM CONFIGURATION
6377+
6378+=over 8
6379+
6380+=item Constants
6381+
6382+_SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
6383+
6384+=back
6385+
6386+=head1 ERRNO
6387+
6388+=over 8
6389+
6390+=item Constants
6391+
6392+E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF
6393+EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ
6394+EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR
6395+EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG
6396+ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC
6397+ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR
6398+ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE
6399+EPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS
6400+ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS
6401+ETXTBSY EUSERS EWOULDBLOCK EXDEV
6402+
6403+=back
6404+
6405+=head1 FCNTL
6406+
6407+=over 8
6408+
6409+=item Constants
6410+
6411+FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_OK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY
6412+
6413+=back
6414+
6415+=head1 FLOAT
6416+
6417+=over 8
6418+
6419+=item Constants
6420+
6421+DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP FLT_DIG FLT_EPSILON FLT_MANT_DIG FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_ROUNDS LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP
6422+
6423+=back
6424+
6425+=head1 LIMITS
6426+
6427+=over 8
6428+
6429+=item Constants
6430+
6431+ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
6432+
6433+=back
6434+
6435+=head1 LOCALE
6436+
6437+=over 8
6438+
6439+=item Constants
6440+
6441+LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME
6442+
6443+=back
6444+
6445+=head1 MATH
6446+
6447+=over 8
6448+
6449+=item Constants
6450+
6451+HUGE_VAL
6452+
6453+=back
6454+
6455+=head1 SIGNAL
6456+
6457+=over 8
6458+
6459+=item Constants
6460+
6461+SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND SA_RESTART
6462+SA_SIGINFO SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT
6463+SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU
6464+SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK
6465+SIG_UNBLOCK
6466+
6467+=back
6468+
6469+=head1 STAT
6470+
6471+=over 8
6472+
6473+=item Constants
6474+
6475+S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
6476+
6477+=item Macros
6478+
6479+S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG
6480+
6481+=back
6482+
6483+=head1 STDLIB
6484+
6485+=over 8
6486+
6487+=item Constants
6488+
6489+EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX RAND_MAX
6490+
6491+=back
6492+
6493+=head1 STDIO
6494+
6495+=over 8
6496+
6497+=item Constants
6498+
6499+BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid L_tmpname TMP_MAX
6500+
6501+=back
6502+
6503+=head1 TIME
6504+
6505+=over 8
6506+
6507+=item Constants
6508+
6509+CLK_TCK CLOCKS_PER_SEC
6510+
6511+=back
6512+
6513+=head1 UNISTD
6514+
6515+=over 8
6516+
6517+=item Constants
6518+
6519+R_OK SEEK_CUR SEEK_END SEEK_SET STDIN_FILENO STDOUT_FILENO STDERR_FILENO W_OK X_OK
6520+
6521+=back
6522+
6523+=head1 WAIT
6524+
6525+=over 8
6526+
6527+=item Constants
6528+
6529+WNOHANG WUNTRACED
6530+
6531+=over 16
6532+
6533+=item WNOHANG
6534+
6535+Do not suspend the calling process until a child process
6536+changes state but instead return immediately.
6537+
6538+=item WUNTRACED
6539+
6540+Catch stopped child processes.
6541+
6542+=back
6543+
6544+=item Macros
6545+
6546+WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG
6547+
6548+=over 16
6549+
6550+=item WIFEXITED
6551+
6552+WIFEXITED($?) returns true if the child process exited normally
6553+(C<exit()> or by falling off the end of C<main()>)
6554+
6555+=item WEXITSTATUS
6556+
6557+WEXITSTATUS($?) returns the normal exit status of the child process
6558+(only meaningful if WIFEXITED($?) is true)
6559+
6560+=item WIFSIGNALED
6561+
6562+WIFSIGNALED($?) returns true if the child process terminated because
6563+of a signal
6564+
6565+=item WTERMSIG
6566+
6567+WTERMSIG($?) returns the signal the child process terminated for
6568+(only meaningful if WIFSIGNALED($?) is true)
6569+
6570+=item WIFSTOPPED
6571+
6572+WIFSTOPPED($?) returns true if the child process is currently stopped
6573+(can happen only if you specified the WUNTRACED flag to waitpid())
6574+
6575+=item WSTOPSIG
6576+
6577+WSTOPSIG($?) returns the signal the child process was stopped for
6578+(only meaningful if WIFSTOPPED($?) is true)
6579+
6580+=back
6581+
6582+=back
6583+
diff --git a/meta/recipes-devtools/perl/perl-native_5.12.2.bb b/meta/recipes-devtools/perl/perl-native_5.12.2.bb
index 5996494c98..cd21e9e8bd 100644
--- a/meta/recipes-devtools/perl/perl-native_5.12.2.bb
+++ b/meta/recipes-devtools/perl/perl-native_5.12.2.bb
@@ -4,7 +4,7 @@ SECTION = "libs"
4LICENSE = "Artistic|GPL" 4LICENSE = "Artistic|GPL"
5LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \ 5LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \
6 file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8" 6 file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8"
7PR = "r5" 7PR = "r6"
8 8
9LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \ 9LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \
10 file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8" 10 file://Artistic;md5=f921793d03cc6d63ec4b15e9be8fd3f8"
@@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://Copying;md5=2b4c6ffbcfcbdee469f02565f253d81a \
12SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz \ 12SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz \
13 file://Configure-multilib.patch;patch=1 \ 13 file://Configure-multilib.patch;patch=1 \
14 file://perl-configpm-switch.patch;patch=1 \ 14 file://perl-configpm-switch.patch;patch=1 \
15 file://parallel_build_fix.patch \ 15 file://parallel_build_fix_1.patch \
16 file://parallel_build_fix_2.patch \
17 file://parallel_build_fix_3.patch \
16 file://native-nopacklist.patch;patch=1 \ 18 file://native-nopacklist.patch;patch=1 \
17 file://native-perlinc.patch;patch=1" 19 file://native-perlinc.patch;patch=1"
18 20
diff --git a/meta/recipes-devtools/perl/perl_5.12.2.bb b/meta/recipes-devtools/perl/perl_5.12.2.bb
index e659152d4b..18fad18c06 100644
--- a/meta/recipes-devtools/perl/perl_5.12.2.bb
+++ b/meta/recipes-devtools/perl/perl_5.12.2.bb
@@ -8,7 +8,7 @@ PRIORITY = "optional"
8# We need gnugrep (for -I) 8# We need gnugrep (for -I)
9DEPENDS = "virtual/db perl-native-${PV} grep-native" 9DEPENDS = "virtual/db perl-native-${PV} grep-native"
10DEPENDS += "gdbm zlib" 10DEPENDS += "gdbm zlib"
11PR = "r1" 11PR = "r2"
12 12
13# 5.10.1 has Module::Build built-in 13# 5.10.1 has Module::Build built-in
14PROVIDES += "libmodule-build-perl" 14PROVIDES += "libmodule-build-perl"
@@ -18,7 +18,9 @@ PROVIDES += "libmodule-build-perl"
18 18
19SRC_URI = "ftp://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz \ 19SRC_URI = "ftp://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz \
20 file://Makefile.patch;patch=1 \ 20 file://Makefile.patch;patch=1 \
21 file://parallel_build_fix.patch \ 21 file://parallel_build_fix_1.patch \
22 file://parallel_build_fix_2.patch \
23 file://parallel_build_fix_3.patch \
22 file://Makefile.SH.patch;patch=1 \ 24 file://Makefile.SH.patch;patch=1 \
23 file://installperl.patch;patch=1 \ 25 file://installperl.patch;patch=1 \
24 file://perl-dynloader.patch;patch=1 \ 26 file://perl-dynloader.patch;patch=1 \