fix places that mean C<"word" character> but say C<alphanumeric
[p5sagit/p5-mst-13.2.git] / ext / POSIX / POSIX.pm
CommitLineData
a0d0e21e 1package POSIX;
2
17f410f9 3our(@ISA, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD) = ();
73c78b0a 4
3b35bae3 5use AutoLoader;
c07a80fd 6
9426adcd 7use XSLoader ();
a0d0e21e 8
17f410f9 9our $VERSION = "1.03" ;
c07a80fd 10
748a9306 11# Grandfather old foo_h form to new :foo_h form
66fbe9e2 12my $loaded;
13
a0d0e21e 14sub import {
66fbe9e2 15 load_imports() unless $loaded++;
a0d0e21e 16 my $this = shift;
748a9306 17 my @list = map { m/^\w+_h$/ ? ":$_" : $_ } @_;
a0d0e21e 18 local $Exporter::ExportLevel = 1;
19 Exporter::import($this,@list);
20}
21
66fbe9e2 22sub croak { require Carp; goto &Carp::croak }
4633a7c4 23
9426adcd 24XSLoader::load 'POSIX', $VERSION;
4633a7c4 25
26my $EINVAL = constant("EINVAL", 0);
27my $EAGAIN = constant("EAGAIN", 0);
28
a0d0e21e 29sub AUTOLOAD {
30 if ($AUTOLOAD =~ /::(_?[a-z])/) {
66fbe9e2 31 # require AutoLoader;
a0d0e21e 32 $AutoLoader::AUTOLOAD = $AUTOLOAD;
33 goto &AutoLoader::AUTOLOAD
34 }
4633a7c4 35 local $! = 0;
36 my $constname = $AUTOLOAD;
a0d0e21e 37 $constname =~ s/.*:://;
3f73d1e9 38 my $val = constant($constname, @_ ? $_[0] : 0);
4633a7c4 39 if ($! == 0) {
40 *$AUTOLOAD = sub { $val };
41 }
42 elsif ($! == $EAGAIN) { # Not really a constant, so always call.
43 *$AUTOLOAD = sub { constant($constname, $_[0]) };
44 }
45 elsif ($! == $EINVAL) {
46 croak "$constname is not a valid POSIX macro";
a0d0e21e 47 }
4633a7c4 48 else {
49 croak "Your vendor has not defined POSIX macro $constname, used";
50 }
51
a0d0e21e 52 goto &$AUTOLOAD;
53}
54
a0d0e21e 55sub usage {
c07a80fd 56 my ($mess) = @_;
a0d0e21e 57 croak "Usage: POSIX::$mess";
58}
59
60sub redef {
c07a80fd 61 my ($mess) = @_;
a0d0e21e 62 croak "Use method $mess instead";
63}
64
65sub unimpl {
c07a80fd 66 my ($mess) = @_;
a0d0e21e 67 $mess =~ s/xxx//;
68 croak "Unimplemented: POSIX::$mess";
69}
70
a0d0e21e 71############################
72package POSIX::SigAction;
73
74sub new {
28757baa 75 bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0}, $_[0];
a0d0e21e 76}
77
78############################
a0d0e21e 79package POSIX; # return to package POSIX so AutoSplit is happy
801;
81__END__
82
83sub assert {
84 usage "assert(expr)" if @_ != 1;
85 if (!$_[0]) {
86 croak "Assertion failed";
87 }
88}
89
90sub tolower {
91 usage "tolower(string)" if @_ != 1;
92 lc($_[0]);
93}
94
95sub toupper {
96 usage "toupper(string)" if @_ != 1;
97 uc($_[0]);
98}
99
100sub closedir {
101 usage "closedir(dirhandle)" if @_ != 1;
b56ec344 102 CORE::closedir($_[0]);
a0d0e21e 103}
104
105sub opendir {
106 usage "opendir(directory)" if @_ != 1;
66fbe9e2 107 my $dirhandle;
b56ec344 108 CORE::opendir($dirhandle, $_[0])
a0d0e21e 109 ? $dirhandle
4633a7c4 110 : undef;
a0d0e21e 111}
112
113sub readdir {
114 usage "readdir(dirhandle)" if @_ != 1;
b56ec344 115 CORE::readdir($_[0]);
a0d0e21e 116}
117
118sub rewinddir {
119 usage "rewinddir(dirhandle)" if @_ != 1;
b56ec344 120 CORE::rewinddir($_[0]);
a0d0e21e 121}
122
123sub errno {
124 usage "errno()" if @_ != 0;
125 $! + 0;
126}
127
128sub creat {
129 usage "creat(filename, mode)" if @_ != 2;
94b6baf5 130 &open($_[0], &O_WRONLY | &O_CREAT | &O_TRUNC, $_[1]);
a0d0e21e 131}
132
133sub fcntl {
134 usage "fcntl(filehandle, cmd, arg)" if @_ != 3;
b56ec344 135 CORE::fcntl($_[0], $_[1], $_[2]);
a0d0e21e 136}
137
138sub getgrgid {
139 usage "getgrgid(gid)" if @_ != 1;
b56ec344 140 CORE::getgrgid($_[0]);
a0d0e21e 141}
142
143sub getgrnam {
144 usage "getgrnam(name)" if @_ != 1;
b56ec344 145 CORE::getgrnam($_[0]);
a0d0e21e 146}
147
148sub atan2 {
149 usage "atan2(x,y)" if @_ != 2;
b56ec344 150 CORE::atan2($_[0], $_[1]);
a0d0e21e 151}
152
153sub cos {
154 usage "cos(x)" if @_ != 1;
b56ec344 155 CORE::cos($_[0]);
a0d0e21e 156}
157
158sub exp {
159 usage "exp(x)" if @_ != 1;
b56ec344 160 CORE::exp($_[0]);
a0d0e21e 161}
162
163sub fabs {
164 usage "fabs(x)" if @_ != 1;
b56ec344 165 CORE::abs($_[0]);
a0d0e21e 166}
167
168sub log {
169 usage "log(x)" if @_ != 1;
b56ec344 170 CORE::log($_[0]);
a0d0e21e 171}
172
173sub pow {
174 usage "pow(x,exponent)" if @_ != 2;
175 $_[0] ** $_[1];
176}
177
178sub sin {
179 usage "sin(x)" if @_ != 1;
b56ec344 180 CORE::sin($_[0]);
a0d0e21e 181}
182
183sub sqrt {
184 usage "sqrt(x)" if @_ != 1;
b56ec344 185 CORE::sqrt($_[0]);
a0d0e21e 186}
187
a0d0e21e 188sub getpwnam {
189 usage "getpwnam(name)" if @_ != 1;
b56ec344 190 CORE::getpwnam($_[0]);
a0d0e21e 191}
192
193sub getpwuid {
194 usage "getpwuid(uid)" if @_ != 1;
b56ec344 195 CORE::getpwuid($_[0]);
a0d0e21e 196}
197
198sub longjmp {
199 unimpl "longjmp() is C-specific: use die instead";
200}
201
202sub setjmp {
203 unimpl "setjmp() is C-specific: use eval {} instead";
204}
205
206sub siglongjmp {
207 unimpl "siglongjmp() is C-specific: use die instead";
208}
209
210sub sigsetjmp {
211 unimpl "sigsetjmp() is C-specific: use eval {} instead";
212}
213
214sub kill {
215 usage "kill(pid, sig)" if @_ != 2;
b56ec344 216 CORE::kill $_[1], $_[0];
a0d0e21e 217}
218
219sub raise {
220 usage "raise(sig)" if @_ != 1;
b56ec344 221 CORE::kill $_[0], $$; # Is this good enough?
a0d0e21e 222}
223
224sub offsetof {
225 unimpl "offsetof() is C-specific, stopped";
226}
227
228sub clearerr {
28757baa 229 redef "IO::Handle::clearerr()";
a0d0e21e 230}
231
232sub fclose {
28757baa 233 redef "IO::Handle::close()";
a0d0e21e 234}
235
236sub fdopen {
28757baa 237 redef "IO::Handle::new_from_fd()";
a0d0e21e 238}
239
240sub feof {
28757baa 241 redef "IO::Handle::eof()";
a0d0e21e 242}
243
244sub fgetc {
28757baa 245 redef "IO::Handle::getc()";
a0d0e21e 246}
247
248sub fgets {
28757baa 249 redef "IO::Handle::gets()";
a0d0e21e 250}
251
252sub fileno {
28757baa 253 redef "IO::Handle::fileno()";
a0d0e21e 254}
255
256sub fopen {
28757baa 257 redef "IO::File::open()";
a0d0e21e 258}
259
260sub fprintf {
261 unimpl "fprintf() is C-specific--use printf instead";
262}
263
264sub fputc {
265 unimpl "fputc() is C-specific--use print instead";
266}
267
268sub fputs {
269 unimpl "fputs() is C-specific--use print instead";
270}
271
272sub fread {
273 unimpl "fread() is C-specific--use read instead";
274}
275
276sub freopen {
277 unimpl "freopen() is C-specific--use open instead";
278}
279
280sub fscanf {
281 unimpl "fscanf() is C-specific--use <> and regular expressions instead";
282}
283
284sub fseek {
28757baa 285 redef "IO::Seekable::seek()";
a0d0e21e 286}
287
288sub ferror {
28757baa 289 redef "IO::Handle::error()";
a0d0e21e 290}
291
292sub fflush {
28757baa 293 redef "IO::Handle::flush()";
a0d0e21e 294}
295
296sub fgetpos {
28757baa 297 redef "IO::Seekable::getpos()";
a0d0e21e 298}
299
300sub fsetpos {
28757baa 301 redef "IO::Seekable::setpos()";
a0d0e21e 302}
303
304sub ftell {
28757baa 305 redef "IO::Seekable::tell()";
a0d0e21e 306}
307
308sub fwrite {
309 unimpl "fwrite() is C-specific--use print instead";
310}
311
312sub getc {
313 usage "getc(handle)" if @_ != 1;
b56ec344 314 CORE::getc($_[0]);
a0d0e21e 315}
316
317sub getchar {
318 usage "getchar()" if @_ != 0;
b56ec344 319 CORE::getc(STDIN);
a0d0e21e 320}
321
322sub gets {
323 usage "gets()" if @_ != 0;
324 scalar <STDIN>;
325}
326
327sub perror {
328 print STDERR "@_: " if @_;
329 print STDERR $!,"\n";
330}
331
332sub printf {
333 usage "printf(pattern, args...)" if @_ < 1;
b56ec344 334 CORE::printf STDOUT @_;
a0d0e21e 335}
336
337sub putc {
338 unimpl "putc() is C-specific--use print instead";
339}
340
341sub putchar {
342 unimpl "putchar() is C-specific--use print instead";
343}
344
345sub puts {
346 unimpl "puts() is C-specific--use print instead";
347}
348
349sub remove {
350 usage "remove(filename)" if @_ != 1;
b56ec344 351 CORE::unlink($_[0]);
a0d0e21e 352}
353
354sub rename {
355 usage "rename(oldfilename, newfilename)" if @_ != 2;
b56ec344 356 CORE::rename($_[0], $_[1]);
a0d0e21e 357}
358
359sub rewind {
360 usage "rewind(filehandle)" if @_ != 1;
b56ec344 361 CORE::seek($_[0],0,0);
a0d0e21e 362}
363
364sub scanf {
365 unimpl "scanf() is C-specific--use <> and regular expressions instead";
366}
367
368sub sprintf {
369 usage "sprintf(pattern,args)" if @_ == 0;
b56ec344 370 CORE::sprintf(shift,@_);
a0d0e21e 371}
372
373sub sscanf {
374 unimpl "sscanf() is C-specific--use regular expressions instead";
375}
376
377sub tmpfile {
28757baa 378 redef "IO::File::new_tmpfile()";
a0d0e21e 379}
380
381sub ungetc {
28757baa 382 redef "IO::Handle::ungetc()";
a0d0e21e 383}
384
385sub vfprintf {
386 unimpl "vfprintf() is C-specific";
387}
388
389sub vprintf {
390 unimpl "vprintf() is C-specific";
391}
392
393sub vsprintf {
394 unimpl "vsprintf() is C-specific";
395}
396
397sub abs {
398 usage "abs(x)" if @_ != 1;
b56ec344 399 CORE::abs($_[0]);
a0d0e21e 400}
401
402sub atexit {
403 unimpl "atexit() is C-specific: use END {} instead";
404}
405
406sub atof {
407 unimpl "atof() is C-specific, stopped";
408}
409
410sub atoi {
411 unimpl "atoi() is C-specific, stopped";
412}
413
414sub atol {
415 unimpl "atol() is C-specific, stopped";
416}
417
418sub bsearch {
37120919 419 unimpl "bsearch() not supplied";
a0d0e21e 420}
421
422sub calloc {
423 unimpl "calloc() is C-specific, stopped";
424}
425
426sub div {
427 unimpl "div() is C-specific, stopped";
428}
429
430sub exit {
431 usage "exit(status)" if @_ != 1;
b56ec344 432 CORE::exit($_[0]);
a0d0e21e 433}
434
435sub free {
436 unimpl "free() is C-specific, stopped";
a0d0e21e 437}
438
439sub getenv {
440 usage "getenv(name)" if @_ != 1;
441 $ENV{$_[0]};
442}
443
444sub labs {
445 unimpl "labs() is C-specific, use abs instead";
446}
447
448sub ldiv {
449 unimpl "ldiv() is C-specific, use / and int instead";
450}
451
452sub malloc {
453 unimpl "malloc() is C-specific, stopped";
454}
455
456sub qsort {
457 unimpl "qsort() is C-specific, use sort instead";
458}
459
460sub rand {
461 unimpl "rand() is non-portable, use Perl's rand instead";
462}
463
464sub realloc {
465 unimpl "realloc() is C-specific, stopped";
466}
467
468sub srand {
469 unimpl "srand()";
470}
471
a0d0e21e 472sub system {
473 usage "system(command)" if @_ != 1;
b56ec344 474 CORE::system($_[0]);
a0d0e21e 475}
476
477sub memchr {
478 unimpl "memchr() is C-specific, use index() instead";
479}
480
481sub memcmp {
482 unimpl "memcmp() is C-specific, use eq instead";
483}
484
485sub memcpy {
486 unimpl "memcpy() is C-specific, use = instead";
37120919 487}
a0d0e21e 488
489sub memmove {
490 unimpl "memmove() is C-specific, use = instead";
491}
492
493sub memset {
494 unimpl "memset() is C-specific, use x instead";
495}
496
497sub strcat {
498 unimpl "strcat() is C-specific, use .= instead";
499}
500
501sub strchr {
502 unimpl "strchr() is C-specific, use index() instead";
503}
504
505sub strcmp {
506 unimpl "strcmp() is C-specific, use eq instead";
507}
508
509sub strcpy {
510 unimpl "strcpy() is C-specific, use = instead";
511}
512
513sub strcspn {
514 unimpl "strcspn() is C-specific, use regular expressions instead";
515}
516
517sub strerror {
518 usage "strerror(errno)" if @_ != 1;
519 local $! = $_[0];
520 $! . "";
521}
522
523sub strlen {
524 unimpl "strlen() is C-specific, use length instead";
525}
526
527sub strncat {
528 unimpl "strncat() is C-specific, use .= instead";
529}
530
531sub strncmp {
532 unimpl "strncmp() is C-specific, use eq instead";
533}
534
535sub strncpy {
536 unimpl "strncpy() is C-specific, use = instead";
537}
538
539sub strpbrk {
540 unimpl "strpbrk() is C-specific, stopped";
541}
542
543sub strrchr {
544 unimpl "strrchr() is C-specific, use rindex() instead";
545}
546
547sub strspn {
548 unimpl "strspn() is C-specific, stopped";
549}
550
551sub strstr {
552 usage "strstr(big, little)" if @_ != 2;
b56ec344 553 CORE::index($_[0], $_[1]);
a0d0e21e 554}
555
556sub strtok {
557 unimpl "strtok() is C-specific, stopped";
558}
559
560sub chmod {
3b35bae3 561 usage "chmod(mode, filename)" if @_ != 2;
b56ec344 562 CORE::chmod($_[0], $_[1]);
a0d0e21e 563}
564
565sub fstat {
566 usage "fstat(fd)" if @_ != 1;
c07a80fd 567 local *TMP;
a0d0e21e 568 open(TMP, "<&$_[0]"); # Gross.
b56ec344 569 my @l = CORE::stat(TMP);
a0d0e21e 570 close(TMP);
571 @l;
572}
573
574sub mkdir {
575 usage "mkdir(directoryname, mode)" if @_ != 2;
b56ec344 576 CORE::mkdir($_[0], $_[1]);
a0d0e21e 577}
578
579sub stat {
580 usage "stat(filename)" if @_ != 1;
b56ec344 581 CORE::stat($_[0]);
a0d0e21e 582}
583
584sub umask {
585 usage "umask(mask)" if @_ != 1;
b56ec344 586 CORE::umask($_[0]);
a0d0e21e 587}
588
a0d0e21e 589sub wait {
cb1a09d0 590 usage "wait()" if @_ != 0;
b56ec344 591 CORE::wait();
a0d0e21e 592}
593
594sub waitpid {
cb1a09d0 595 usage "waitpid(pid, options)" if @_ != 2;
b56ec344 596 CORE::waitpid($_[0], $_[1]);
a0d0e21e 597}
598
599sub gmtime {
600 usage "gmtime(time)" if @_ != 1;
b56ec344 601 CORE::gmtime($_[0]);
a0d0e21e 602}
603
604sub localtime {
605 usage "localtime(time)" if @_ != 1;
b56ec344 606 CORE::localtime($_[0]);
a0d0e21e 607}
608
609sub time {
37120919 610 usage "time()" if @_ != 0;
b56ec344 611 CORE::time;
a0d0e21e 612}
613
614sub alarm {
615 usage "alarm(seconds)" if @_ != 1;
b56ec344 616 CORE::alarm($_[0]);
a0d0e21e 617}
618
619sub chdir {
620 usage "chdir(directory)" if @_ != 1;
b56ec344 621 CORE::chdir($_[0]);
a0d0e21e 622}
623
624sub chown {
625 usage "chown(filename, uid, gid)" if @_ != 3;
b56ec344 626 CORE::chown($_[0], $_[1], $_[2]);
a0d0e21e 627}
628
629sub execl {
630 unimpl "execl() is C-specific, stopped";
a0d0e21e 631}
632
633sub execle {
634 unimpl "execle() is C-specific, stopped";
a0d0e21e 635}
636
637sub execlp {
638 unimpl "execlp() is C-specific, stopped";
a0d0e21e 639}
640
641sub execv {
642 unimpl "execv() is C-specific, stopped";
a0d0e21e 643}
644
645sub execve {
646 unimpl "execve() is C-specific, stopped";
a0d0e21e 647}
648
649sub execvp {
650 unimpl "execvp() is C-specific, stopped";
a0d0e21e 651}
652
653sub fork {
654 usage "fork()" if @_ != 0;
b56ec344 655 CORE::fork;
a0d0e21e 656}
657
658sub getcwd
659{
660 usage "getcwd()" if @_ != 0;
6dead956 661 if ($^O eq 'MSWin32') {
662 # this perhaps applies to everyone else also?
663 require Cwd;
664 $cwd = &Cwd::cwd;
665 }
666 else {
667 chop($cwd = `pwd`);
668 }
a0d0e21e 669 $cwd;
670}
671
672sub getegid {
673 usage "getegid()" if @_ != 0;
674 $) + 0;
675}
676
677sub geteuid {
678 usage "geteuid()" if @_ != 0;
679 $> + 0;
680}
681
682sub getgid {
683 usage "getgid()" if @_ != 0;
684 $( + 0;
685}
686
687sub getgroups {
688 usage "getgroups()" if @_ != 0;
c07a80fd 689 my %seen;
a0d0e21e 690 grep(!$seen{$_}++, split(' ', $) ));
691}
692
693sub getlogin {
694 usage "getlogin()" if @_ != 0;
b56ec344 695 CORE::getlogin();
a0d0e21e 696}
697
698sub getpgrp {
699 usage "getpgrp()" if @_ != 0;
5507c093 700 CORE::getpgrp;
a0d0e21e 701}
702
703sub getpid {
704 usage "getpid()" if @_ != 0;
705 $$;
706}
707
708sub getppid {
709 usage "getppid()" if @_ != 0;
b56ec344 710 CORE::getppid;
a0d0e21e 711}
712
713sub getuid {
714 usage "getuid()" if @_ != 0;
715 $<;
716}
717
718sub isatty {
719 usage "isatty(filehandle)" if @_ != 1;
720 -t $_[0];
721}
722
723sub link {
724 usage "link(oldfilename, newfilename)" if @_ != 2;
b56ec344 725 CORE::link($_[0], $_[1]);
a0d0e21e 726}
727
728sub rmdir {
729 usage "rmdir(directoryname)" if @_ != 1;
b56ec344 730 CORE::rmdir($_[0]);
a0d0e21e 731}
732
a41ecaa8 733sub setbuf {
734 redef "IO::Handle::setbuf()";
735}
736
a0d0e21e 737sub setgid {
738 usage "setgid(gid)" if @_ != 1;
739 $( = $_[0];
740}
741
742sub setuid {
743 usage "setuid(uid)" if @_ != 1;
744 $< = $_[0];
745}
746
a41ecaa8 747sub setvbuf {
748 redef "IO::Handle::setvbuf()";
749}
750
a0d0e21e 751sub sleep {
752 usage "sleep(seconds)" if @_ != 1;
b56ec344 753 CORE::sleep($_[0]);
a0d0e21e 754}
755
756sub unlink {
757 usage "unlink(filename)" if @_ != 1;
b56ec344 758 CORE::unlink($_[0]);
a0d0e21e 759}
760
761sub utime {
762 usage "utime(filename, atime, mtime)" if @_ != 3;
b56ec344 763 CORE::utime($_[1], $_[2], $_[0]);
a0d0e21e 764}
765
66fbe9e2 766sub load_imports {
767%EXPORT_TAGS = (
768
769 assert_h => [qw(assert NDEBUG)],
770
771 ctype_h => [qw(isalnum isalpha iscntrl isdigit isgraph islower
772 isprint ispunct isspace isupper isxdigit tolower toupper)],
773
774 dirent_h => [qw()],
775
776 errno_h => [qw(E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT
777 EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED
778 ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT
779 EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS
780 EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK
781 EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH
782 ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM
783 ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR
784 ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM
785 EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE
786 ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT
787 ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY
788 EUSERS EWOULDBLOCK EXDEV errno)],
789
790 fcntl_h => [qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK
791 F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK
792 O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK
793 O_RDONLY O_RDWR O_TRUNC O_WRONLY
794 creat
795 SEEK_CUR SEEK_END SEEK_SET
796 S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU
797 S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG S_ISUID
798 S_IWGRP S_IWOTH S_IWUSR)],
799
800 float_h => [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG
801 DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP
802 DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP
803 FLT_DIG FLT_EPSILON FLT_MANT_DIG
804 FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP
805 FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP
806 FLT_RADIX FLT_ROUNDS
807 LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG
808 LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP
809 LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)],
810
811 grp_h => [qw()],
812
813 limits_h => [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX
814 INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON
815 MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX
816 PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN
817 SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX
818 ULONG_MAX USHRT_MAX _POSIX_ARG_MAX _POSIX_CHILD_MAX
819 _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT
820 _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_OPEN_MAX
821 _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX
822 _POSIX_STREAM_MAX _POSIX_TZNAME_MAX)],
823
824 locale_h => [qw(LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC
825 LC_TIME NULL localeconv setlocale)],
826
827 math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod
828 frexp ldexp log10 modf pow sinh tan tanh)],
829
830 pwd_h => [qw()],
831
832 setjmp_h => [qw(longjmp setjmp siglongjmp sigsetjmp)],
833
834 signal_h => [qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK
835 SA_RESETHAND SA_RESTART SA_SIGINFO SIGABRT SIGALRM
836 SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL
837 SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN
838 SIGTTOU SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR
839 SIG_IGN SIG_SETMASK SIG_UNBLOCK raise sigaction signal
840 sigpending sigprocmask sigsuspend)],
841
842 stdarg_h => [qw()],
843
844 stddef_h => [qw(NULL offsetof)],
845
846 stdio_h => [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid
847 L_tmpname NULL SEEK_CUR SEEK_END SEEK_SET
848 STREAM_MAX TMP_MAX stderr stdin stdout
849 clearerr fclose fdopen feof ferror fflush fgetc fgetpos
850 fgets fopen fprintf fputc fputs fread freopen
851 fscanf fseek fsetpos ftell fwrite getchar gets
852 perror putc putchar puts remove rewind
853 scanf setbuf setvbuf sscanf tmpfile tmpnam
854 ungetc vfprintf vprintf vsprintf)],
855
856 stdlib_h => [qw(EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX
857 abort atexit atof atoi atol bsearch calloc div
858 free getenv labs ldiv malloc mblen mbstowcs mbtowc
859 qsort realloc strtod strtol strtoul wcstombs wctomb)],
860
861 string_h => [qw(NULL memchr memcmp memcpy memmove memset strcat
862 strchr strcmp strcoll strcpy strcspn strerror strlen
863 strncat strncmp strncpy strpbrk strrchr strspn strstr
864 strtok strxfrm)],
865
866 sys_stat_h => [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU
867 S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG
868 S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
869 fstat mkfifo)],
870
871 sys_times_h => [qw()],
872
873 sys_types_h => [qw()],
874
875 sys_utsname_h => [qw(uname)],
876
877 sys_wait_h => [qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED
878 WNOHANG WSTOPSIG WTERMSIG WUNTRACED)],
879
880 termios_h => [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400
881 B300 B38400 B4800 B50 B600 B75 B9600 BRKINT CLOCAL
882 CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB ECHO ECHOE ECHOK
883 ECHONL HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR
884 INLCR INPCK ISIG ISTRIP IXOFF IXON NCCS NOFLSH OPOST
885 PARENB PARMRK PARODD TCIFLUSH TCIOFF TCIOFLUSH TCION
886 TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW
887 TOSTOP VEOF VEOL VERASE VINTR VKILL VMIN VQUIT VSTART
888 VSTOP VSUSP VTIME
889 cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcdrain
890 tcflow tcflush tcgetattr tcsendbreak tcsetattr )],
891
892 time_h => [qw(CLK_TCK CLOCKS_PER_SEC NULL asctime clock ctime
893 difftime mktime strftime tzset tzname)],
894
895 unistd_h => [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET
896 STRERR_FILENO STDIN_FILENO STDOUT_FILENO W_OK X_OK
897 _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON
898 _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX
899 _PC_PIPE_BUF _PC_VDISABLE _POSIX_CHOWN_RESTRICTED
900 _POSIX_JOB_CONTROL _POSIX_NO_TRUNC _POSIX_SAVED_IDS
901 _POSIX_VDISABLE _POSIX_VERSION _SC_ARG_MAX
902 _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL
903 _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS
904 _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
905 _exit access ctermid cuserid
906 dup2 dup execl execle execlp execv execve execvp
907 fpathconf getcwd getegid geteuid getgid getgroups
908 getpid getuid isatty lseek pathconf pause setgid setpgid
909 setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)],
910
911 utime_h => [qw()],
912
913);
914
915# Exporter::export_tags();
916for (values %EXPORT_TAGS) {
917 push @EXPORT, @$_;
918}
919
920@EXPORT_OK = qw(
921 closedir opendir readdir rewinddir
922 fcntl open
923 getgrgid getgrnam
924 atan2 cos exp log sin sqrt
925 getpwnam getpwuid
926 kill
927 fileno getc printf rename sprintf
928 abs exit rand srand system
929 chmod mkdir stat umask
930 times
931 wait waitpid
932 gmtime localtime time
933 alarm chdir chown close fork getlogin getppid getpgrp link
934 pipe read rmdir sleep unlink write
935 utime
936 nice
937);
938
939require Exporter;
940}