Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

940 lines
19 KiB

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