← Index
Performance Profile   « block view • line view • sub view »
For /wise/base/deliv/dev/bin/getfix
  Run on Thu May 20 15:30:03 2010
Reported on Thu May 20 16:25:21 2010

File/opt/wise/lib/perl5/5.10.0/x86_64-linux-thread-multi/POSIX.pm
Statements Executed125
Total Time0.003289 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
59809681218.6694618.66946POSIX::acos (xsub)
13870120.062790.06279POSIX::asin (xsub)
12980.001750.00415POSIX::import
5120.000500.00050POSIX::strftime (xsub)
1111.6e-51.6e-5POSIX::AUTOLOAD
00000POSIX::BEGIN
00000POSIX::SigAction::BEGIN
00000POSIX::SigRt::BEGIN
00000POSIX::SigRt::DESTROY
00000POSIX::__ANON__[:53]
00000POSIX::__ANON__[:57]
00000POSIX::croak

LineStmts.Exclusive
Time
Avg.Code
1package POSIX;
232.6e-58.7e-6use strict;
# spent 10µs making 1 call to strict::import
337.0e-52.3e-5use warnings;
# spent 23µs making 1 call to warnings::import
4
514.0e-64.0e-6our(@ISA, %EXPORT_TAGS, @EXPORT_OK, @EXPORT, $AUTOLOAD, %SIGRT) = ();
6
7100our $VERSION = "1.13";
8
930.000206.5e-5use AutoLoader;
# spent 733µs making 1 call to AutoLoader::import
10
1133.5e-51.2e-5use XSLoader ();
12
13use Fcntl qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK F_SETFD
# spent 249µs making 1 call to Exporter::import
14 F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND
15 O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC
1630.000390.00013 O_WRONLY);
17
18# Grandfather old foo_h form to new :foo_h form
1911.0e-61.0e-6my $loaded;
20
21
# spent 4.15ms (1.75+2.40) within POSIX::import which was called 12 times, avg 345µs/call: # 4 times (74µs+276µs) by WISE::UtilsLight::mytime at line 234 of /wise/base/deliv/dev/lib/perl/WISE/UtilsLight.pm, avg 88µs/call # once (1.49ms+775µs) at line 20 of /wise/base/deliv/dev/lib/perl/WISE/Time.pm # once (27µs+616µs) at line 73 of /wise/base/deliv/dev/lib/perl/WISE/Utils.pm # once (20µs+433µs) at line 6 of /wise/base/static/lib/perl5/site_perl/5.10.0/File/Slurp.pm # once (33µs+68µs) at line 5 of /wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/Storage/DBI/SQLite.pm # once (32µs+53µs) by WISE::Utils::area_2circle_overlap at line 1262 of /wise/base/deliv/dev/lib/perl/WISE/Utils.pm # once (26µs+56µs) at line 25 of /wise/base/deliv/dev/lib/perl/WISE/CoUtils.pm # once (21µs+61µs) at line 54 of /wise/base/static/lib/perl5/site_perl/5.10.0/Astro/Time.pm # once (22µs+58µs) at line 48 of /wise/base/static/lib/perl5/site_perl/5.10.0/Astro/Coord.pm
sub import {
22800.000263.3e-6 load_imports() unless $loaded++;
# spent 16µs making 1 call to POSIX::AUTOLOAD
23 my $this = shift;
24 my @list = map { m/^\w+_h$/ ? ":$_" : $_ } @_;
25 local $Exporter::ExportLevel = 1;
26 Exporter::import($this,@list);
# spent 2.30ms making 12 calls to Exporter::import, avg 191µs/call
27}
28
29sub croak { require Carp; goto &Carp::croak }
30# declare usage to assist AutoLoad
31sub usage;
32
3310.000850.00085XSLoader::load 'POSIX', $VERSION;
# spent 853µs making 1 call to XSLoader::load
34
3512.2e-52.2e-5my %NON_CONSTS = (map {($_,1)}
36 qw(S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG WEXITSTATUS
37 WIFEXITED WIFSIGNALED WIFSTOPPED WSTOPSIG WTERMSIG));
38
39
# spent 16µs within POSIX::AUTOLOAD which was called # once (16µs+0) by POSIX::import at line 22
sub AUTOLOAD {
4032.9e-59.7e-6 no strict;
# spent 9µs making 1 call to strict::unimport
4130.000258.2e-5 no warnings 'uninitialized';
# spent 25µs making 1 call to warnings::unimport
4231.2e-54.0e-6 if ($AUTOLOAD =~ /::(_?[a-z])/) {
43 # require AutoLoader;
44 $AutoLoader::AUTOLOAD = $AUTOLOAD;
45 goto &AutoLoader::AUTOLOAD
46 }
47 local $! = 0;
48 my $constname = $AUTOLOAD;
49 $constname =~ s/.*:://;
50 if ($NON_CONSTS{$constname}) {
51 my ($val, $error) = &int_macro_int($constname, $_[0]);
52 croak $error if $error;
53 *$AUTOLOAD = sub { &int_macro_int($constname, $_[0]) };
54 } else {
55 my ($error, $val) = constant($constname);
56 croak $error if $error;
57 *$AUTOLOAD = sub { $val };
58 }
59
60 goto &$AUTOLOAD;
61}
62
63package POSIX::SigAction;
64
6533.3e-51.1e-5use AutoLoader 'AUTOLOAD';
# spent 29µs making 1 call to AutoLoader::import
66
67package POSIX::SigRt;
68
6932.6e-58.7e-6use AutoLoader 'AUTOLOAD';
# spent 21µs making 1 call to AutoLoader::import
70
7130.000980.00033use Tie::Hash;
# spent 5µs making 1 call to import
72
7336.9e-52.3e-5use vars qw($SIGACTION_FLAGS $_SIGRTMIN $_SIGRTMAX $_sigrtn @ISA);
# spent 65µs making 1 call to vars::import
7411.5e-51.5e-5@POSIX::SigRt::ISA = qw(Tie::StdHash);
75
7611.0e-61.0e-6$SIGACTION_FLAGS = 0;
77
7815.0e-65.0e-6tie %POSIX::SIGRT, 'POSIX::SigRt';
79
80sub DESTROY {};
81
82package POSIX;
83
8411.3e-51.3e-51;
85__END__
86
87sub usage {
88 my ($mess) = @_;
89 croak "Usage: POSIX::$mess";
90}
91
92sub redef {
93 my ($mess) = @_;
94 croak "Use method $mess instead";
95}
96
97sub unimpl {
98 my ($mess) = @_;
99 $mess =~ s/xxx//;
100 croak "Unimplemented: POSIX::$mess";
101}
102
103sub assert {
104 usage "assert(expr)" if @_ != 1;
105 if (!$_[0]) {
106 croak "Assertion failed";
107 }
108}
109
110sub tolower {
111 usage "tolower(string)" if @_ != 1;
112 lc($_[0]);
113}
114
115sub toupper {
116 usage "toupper(string)" if @_ != 1;
117 uc($_[0]);
118}
119
120sub closedir {
121 usage "closedir(dirhandle)" if @_ != 1;
122 CORE::closedir($_[0]);
123}
124
125sub opendir {
126 usage "opendir(directory)" if @_ != 1;
127 my $dirhandle;
128 CORE::opendir($dirhandle, $_[0])
129 ? $dirhandle
130 : undef;
131}
132
133sub readdir {
134 usage "readdir(dirhandle)" if @_ != 1;
135 CORE::readdir($_[0]);
136}
137
138sub rewinddir {
139 usage "rewinddir(dirhandle)" if @_ != 1;
140 CORE::rewinddir($_[0]);
141}
142
143sub errno {
144 usage "errno()" if @_ != 0;
145 $! + 0;
146}
147
148sub creat {
149 usage "creat(filename, mode)" if @_ != 2;
150 &open($_[0], &O_WRONLY | &O_CREAT | &O_TRUNC, $_[1]);
151}
152
153sub fcntl {
154 usage "fcntl(filehandle, cmd, arg)" if @_ != 3;
155 CORE::fcntl($_[0], $_[1], $_[2]);
156}
157
158sub getgrgid {
159 usage "getgrgid(gid)" if @_ != 1;
160 CORE::getgrgid($_[0]);
161}
162
163sub getgrnam {
164 usage "getgrnam(name)" if @_ != 1;
165 CORE::getgrnam($_[0]);
166}
167
168sub atan2 {
169 usage "atan2(x,y)" if @_ != 2;
170 CORE::atan2($_[0], $_[1]);
171}
172
173sub cos {
174 usage "cos(x)" if @_ != 1;
175 CORE::cos($_[0]);
176}
177
178sub exp {
179 usage "exp(x)" if @_ != 1;
180 CORE::exp($_[0]);
181}
182
183sub fabs {
184 usage "fabs(x)" if @_ != 1;
185 CORE::abs($_[0]);
186}
187
188sub log {
189 usage "log(x)" if @_ != 1;
190 CORE::log($_[0]);
191}
192
193sub pow {
194 usage "pow(x,exponent)" if @_ != 2;
195 $_[0] ** $_[1];
196}
197
198sub sin {
199 usage "sin(x)" if @_ != 1;
200 CORE::sin($_[0]);
201}
202
203sub sqrt {
204 usage "sqrt(x)" if @_ != 1;
205 CORE::sqrt($_[0]);
206}
207
208sub getpwnam {
209 usage "getpwnam(name)" if @_ != 1;
210 CORE::getpwnam($_[0]);
211}
212
213sub getpwuid {
214 usage "getpwuid(uid)" if @_ != 1;
215 CORE::getpwuid($_[0]);
216}
217
218sub longjmp {
219 unimpl "longjmp() is C-specific: use die instead";
220}
221
222sub setjmp {
223 unimpl "setjmp() is C-specific: use eval {} instead";
224}
225
226sub siglongjmp {
227 unimpl "siglongjmp() is C-specific: use die instead";
228}
229
230sub sigsetjmp {
231 unimpl "sigsetjmp() is C-specific: use eval {} instead";
232}
233
234sub kill {
235 usage "kill(pid, sig)" if @_ != 2;
236 CORE::kill $_[1], $_[0];
237}
238
239sub raise {
240 usage "raise(sig)" if @_ != 1;
241 CORE::kill $_[0], $$; # Is this good enough?
242}
243
244sub offsetof {
245 unimpl "offsetof() is C-specific, stopped";
246}
247
248sub clearerr {
249 redef "IO::Handle::clearerr()";
250}
251
252sub fclose {
253 redef "IO::Handle::close()";
254}
255
256sub fdopen {
257 redef "IO::Handle::new_from_fd()";
258}
259
260sub feof {
261 redef "IO::Handle::eof()";
262}
263
264sub fgetc {
265 redef "IO::Handle::getc()";
266}
267
268sub fgets {
269 redef "IO::Handle::gets()";
270}
271
272sub fileno {
273 redef "IO::Handle::fileno()";
274}
275
276sub fopen {
277 redef "IO::File::open()";
278}
279
280sub fprintf {
281 unimpl "fprintf() is C-specific--use printf instead";
282}
283
284sub fputc {
285 unimpl "fputc() is C-specific--use print instead";
286}
287
288sub fputs {
289 unimpl "fputs() is C-specific--use print instead";
290}
291
292sub fread {
293 unimpl "fread() is C-specific--use read instead";
294}
295
296sub freopen {
297 unimpl "freopen() is C-specific--use open instead";
298}
299
300sub fscanf {
301 unimpl "fscanf() is C-specific--use <> and regular expressions instead";
302}
303
304sub fseek {
305 redef "IO::Seekable::seek()";
306}
307
308sub fsync {
309 redef "IO::Handle::sync()";
310}
311
312sub ferror {
313 redef "IO::Handle::error()";
314}
315
316sub fflush {
317 redef "IO::Handle::flush()";
318}
319
320sub fgetpos {
321 redef "IO::Seekable::getpos()";
322}
323
324sub fsetpos {
325 redef "IO::Seekable::setpos()";
326}
327
328sub ftell {
329 redef "IO::Seekable::tell()";
330}
331
332sub fwrite {
333 unimpl "fwrite() is C-specific--use print instead";
334}
335
336sub getc {
337 usage "getc(handle)" if @_ != 1;
338 CORE::getc($_[0]);
339}
340
341sub getchar {
342 usage "getchar()" if @_ != 0;
343 CORE::getc(STDIN);
344}
345
346sub gets {
347 usage "gets()" if @_ != 0;
348 scalar <STDIN>;
349}
350
351sub perror {
352 print STDERR "@_: " if @_;
353 print STDERR $!,"\n";
354}
355
356sub printf {
357 usage "printf(pattern, args...)" if @_ < 1;
358 CORE::printf STDOUT @_;
359}
360
361sub putc {
362 unimpl "putc() is C-specific--use print instead";
363}
364
365sub putchar {
366 unimpl "putchar() is C-specific--use print instead";
367}
368
369sub puts {
370 unimpl "puts() is C-specific--use print instead";
371}
372
373sub remove {
374 usage "remove(filename)" if @_ != 1;
375 (-d $_[0]) ? CORE::rmdir($_[0]) : CORE::unlink($_[0]);
376}
377
378sub rename {
379 usage "rename(oldfilename, newfilename)" if @_ != 2;
380 CORE::rename($_[0], $_[1]);
381}
382
383sub rewind {
384 usage "rewind(filehandle)" if @_ != 1;
385 CORE::seek($_[0],0,0);
386}
387
388sub scanf {
389 unimpl "scanf() is C-specific--use <> and regular expressions instead";
390}
391
392sub sprintf {
393 usage "sprintf(pattern,args)" if @_ == 0;
394 CORE::sprintf(shift,@_);
395}
396
397sub sscanf {
398 unimpl "sscanf() is C-specific--use regular expressions instead";
399}
400
401sub tmpfile {
402 redef "IO::File::new_tmpfile()";
403}
404
405sub ungetc {
406 redef "IO::Handle::ungetc()";
407}
408
409sub vfprintf {
410 unimpl "vfprintf() is C-specific";
411}
412
413sub vprintf {
414 unimpl "vprintf() is C-specific";
415}
416
417sub vsprintf {
418 unimpl "vsprintf() is C-specific";
419}
420
421sub abs {
422 usage "abs(x)" if @_ != 1;
423 CORE::abs($_[0]);
424}
425
426sub atexit {
427 unimpl "atexit() is C-specific: use END {} instead";
428}
429
430sub atof {
431 unimpl "atof() is C-specific, stopped";
432}
433
434sub atoi {
435 unimpl "atoi() is C-specific, stopped";
436}
437
438sub atol {
439 unimpl "atol() is C-specific, stopped";
440}
441
442sub bsearch {
443 unimpl "bsearch() not supplied";
444}
445
446sub calloc {
447 unimpl "calloc() is C-specific, stopped";
448}
449
450sub div {
451 unimpl "div() is C-specific, use /, % and int instead";
452}
453
454sub exit {
455 usage "exit(status)" if @_ != 1;
456 CORE::exit($_[0]);
457}
458
459sub free {
460 unimpl "free() is C-specific, stopped";
461}
462
463sub getenv {
464 usage "getenv(name)" if @_ != 1;
465 $ENV{$_[0]};
466}
467
468sub labs {
469 unimpl "labs() is C-specific, use abs instead";
470}
471
472sub ldiv {
473 unimpl "ldiv() is C-specific, use /, % and int instead";
474}
475
476sub malloc {
477 unimpl "malloc() is C-specific, stopped";
478}
479
480sub qsort {
481 unimpl "qsort() is C-specific, use sort instead";
482}
483
484sub rand {
485 unimpl "rand() is non-portable, use Perl's rand instead";
486}
487
488sub realloc {
489 unimpl "realloc() is C-specific, stopped";
490}
491
492sub srand {
493 unimpl "srand()";
494}
495
496sub system {
497 usage "system(command)" if @_ != 1;
498 CORE::system($_[0]);
499}
500
501sub memchr {
502 unimpl "memchr() is C-specific, use index() instead";
503}
504
505sub memcmp {
506 unimpl "memcmp() is C-specific, use eq instead";
507}
508
509sub memcpy {
510 unimpl "memcpy() is C-specific, use = instead";
511}
512
513sub memmove {
514 unimpl "memmove() is C-specific, use = instead";
515}
516
517sub memset {
518 unimpl "memset() is C-specific, use x instead";
519}
520
521sub strcat {
522 unimpl "strcat() is C-specific, use .= instead";
523}
524
525sub strchr {
526 unimpl "strchr() is C-specific, use index() instead";
527}
528
529sub strcmp {
530 unimpl "strcmp() is C-specific, use eq instead";
531}
532
533sub strcpy {
534 unimpl "strcpy() is C-specific, use = instead";
535}
536
537sub strcspn {
538 unimpl "strcspn() is C-specific, use regular expressions instead";
539}
540
541sub strerror {
542 usage "strerror(errno)" if @_ != 1;
543 local $! = $_[0];
544 $! . "";
545}
546
547sub strlen {
548 unimpl "strlen() is C-specific, use length instead";
549}
550
551sub strncat {
552 unimpl "strncat() is C-specific, use .= instead";
553}
554
555sub strncmp {
556 unimpl "strncmp() is C-specific, use eq instead";
557}
558
559sub strncpy {
560 unimpl "strncpy() is C-specific, use = instead";
561}
562
563sub strpbrk {
564 unimpl "strpbrk() is C-specific, stopped";
565}
566
567sub strrchr {
568 unimpl "strrchr() is C-specific, use rindex() instead";
569}
570
571sub strspn {
572 unimpl "strspn() is C-specific, stopped";
573}
574
575sub strstr {
576 usage "strstr(big, little)" if @_ != 2;
577 CORE::index($_[0], $_[1]);
578}
579
580sub strtok {
581 unimpl "strtok() is C-specific, stopped";
582}
583
584sub chmod {
585 usage "chmod(mode, filename)" if @_ != 2;
586 CORE::chmod($_[0], $_[1]);
587}
588
589sub fstat {
590 usage "fstat(fd)" if @_ != 1;
591 local *TMP;
592 CORE::open(TMP, "<&$_[0]"); # Gross.
593 my @l = CORE::stat(TMP);
594 CORE::close(TMP);
595 @l;
596}
597
598sub mkdir {
599 usage "mkdir(directoryname, mode)" if @_ != 2;
600 CORE::mkdir($_[0], $_[1]);
601}
602
603sub stat {
604 usage "stat(filename)" if @_ != 1;
605 CORE::stat($_[0]);
606}
607
608sub umask {
609 usage "umask(mask)" if @_ != 1;
610 CORE::umask($_[0]);
611}
612
613sub wait {
614 usage "wait()" if @_ != 0;
615 CORE::wait();
616}
617
618sub waitpid {
619 usage "waitpid(pid, options)" if @_ != 2;
620 CORE::waitpid($_[0], $_[1]);
621}
622
623sub gmtime {
624 usage "gmtime(time)" if @_ != 1;
625 CORE::gmtime($_[0]);
626}
627
628sub localtime {
629 usage "localtime(time)" if @_ != 1;
630 CORE::localtime($_[0]);
631}
632
633sub time {
634 usage "time()" if @_ != 0;
635 CORE::time;
636}
637
638sub alarm {
639 usage "alarm(seconds)" if @_ != 1;
640 CORE::alarm($_[0]);
641}
642
643sub chdir {
644 usage "chdir(directory)" if @_ != 1;
645 CORE::chdir($_[0]);
646}
647
648sub chown {
649 usage "chown(uid, gid, filename)" if @_ != 3;
650 CORE::chown($_[0], $_[1], $_[2]);
651}
652
653sub execl {
654 unimpl "execl() is C-specific, stopped";
655}
656
657sub execle {
658 unimpl "execle() is C-specific, stopped";
659}
660
661sub execlp {
662 unimpl "execlp() is C-specific, stopped";
663}
664
665sub execv {
666 unimpl "execv() is C-specific, stopped";
667}
668
669sub execve {
670 unimpl "execve() is C-specific, stopped";
671}
672
673sub execvp {
674 unimpl "execvp() is C-specific, stopped";
675}
676
677sub fork {
678 usage "fork()" if @_ != 0;
679 CORE::fork;
680}
681
682sub getegid {
683 usage "getegid()" if @_ != 0;
684 $) + 0;
685}
686
687sub geteuid {
688 usage "geteuid()" if @_ != 0;
689 $> + 0;
690}
691
692sub getgid {
693 usage "getgid()" if @_ != 0;
694 $( + 0;
695}
696
697sub getgroups {
698 usage "getgroups()" if @_ != 0;
699 my %seen;
700 grep(!$seen{$_}++, split(' ', $) ));
701}
702
703sub getlogin {
704 usage "getlogin()" if @_ != 0;
705 CORE::getlogin();
706}
707
708sub getpgrp {
709 usage "getpgrp()" if @_ != 0;
710 CORE::getpgrp;
711}
712
713sub getpid {
714 usage "getpid()" if @_ != 0;
715 $$;
716}
717
718sub getppid {
719 usage "getppid()" if @_ != 0;
720 CORE::getppid;
721}
722
723sub getuid {
724 usage "getuid()" if @_ != 0;
725 $<;
726}
727
728sub isatty {
729 usage "isatty(filehandle)" if @_ != 1;
730 -t $_[0];
731}
732
733sub link {
734 usage "link(oldfilename, newfilename)" if @_ != 2;
735 CORE::link($_[0], $_[1]);
736}
737
738sub rmdir {
739 usage "rmdir(directoryname)" if @_ != 1;
740 CORE::rmdir($_[0]);
741}
742
743sub setbuf {
744 redef "IO::Handle::setbuf()";
745}
746
747sub setvbuf {
748 redef "IO::Handle::setvbuf()";
749}
750
751sub sleep {
752 usage "sleep(seconds)" if @_ != 1;
753 $_[0] - CORE::sleep($_[0]);
754}
755
756sub unlink {
757 usage "unlink(filename)" if @_ != 1;
758 CORE::unlink($_[0]);
759}
760
761sub utime {
762 usage "utime(filename, atime, mtime)" if @_ != 3;
763 CORE::utime($_[1], $_[2], $_[0]);
764}
765
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 => [],
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 => [],
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_MESSAGES
825 LC_MONETARY LC_NUMERIC LC_TIME NULL
826 localeconv setlocale)],
827
828 math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod
829 frexp ldexp log10 modf pow sinh tan tanh)],
830
831 pwd_h => [],
832
833 setjmp_h => [qw(longjmp setjmp siglongjmp sigsetjmp)],
834
835 signal_h => [qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK
836 SA_RESETHAND SA_RESTART SA_SIGINFO SIGABRT SIGALRM
837 SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL
838 SIGPIPE %SIGRT SIGRTMIN SIGRTMAX SIGQUIT SIGSEGV SIGSTOP
839 SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2
840 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK SIG_UNBLOCK
841 raise sigaction signal sigpending sigprocmask sigsuspend)],
842
843 stdarg_h => [],
844
845 stddef_h => [qw(NULL offsetof)],
846
847 stdio_h => [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid
848 L_tmpname NULL SEEK_CUR SEEK_END SEEK_SET
849 STREAM_MAX TMP_MAX stderr stdin stdout
850 clearerr fclose fdopen feof ferror fflush fgetc fgetpos
851 fgets fopen fprintf fputc fputs fread freopen
852 fscanf fseek fsetpos ftell fwrite getchar gets
853 perror putc putchar puts remove rewind
854 scanf setbuf setvbuf sscanf tmpfile tmpnam
855 ungetc vfprintf vprintf vsprintf)],
856
857 stdlib_h => [qw(EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX
858 abort atexit atof atoi atol bsearch calloc div
859 free getenv labs ldiv malloc mblen mbstowcs mbtowc
860 qsort realloc strtod strtol strtoul wcstombs wctomb)],
861
862 string_h => [qw(NULL memchr memcmp memcpy memmove memset strcat
863 strchr strcmp strcoll strcpy strcspn strerror strlen
864 strncat strncmp strncpy strpbrk strrchr strspn strstr
865 strtok strxfrm)],
866
867 sys_stat_h => [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU
868 S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG
869 S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR
870 fstat mkfifo)],
871
872 sys_times_h => [],
873
874 sys_types_h => [],
875
876 sys_utsname_h => [qw(uname)],
877
878 sys_wait_h => [qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED
879 WNOHANG WSTOPSIG WTERMSIG WUNTRACED)],
880
881 termios_h => [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400
882 B300 B38400 B4800 B50 B600 B75 B9600 BRKINT CLOCAL
883 CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB ECHO ECHOE ECHOK
884 ECHONL HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR
885 INLCR INPCK ISIG ISTRIP IXOFF IXON NCCS NOFLSH OPOST
886 PARENB PARMRK PARODD TCIFLUSH TCIOFF TCIOFLUSH TCION
887 TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW
888 TOSTOP VEOF VEOL VERASE VINTR VKILL VMIN VQUIT VSTART
889 VSTOP VSUSP VTIME
890 cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcdrain
891 tcflow tcflush tcgetattr tcsendbreak tcsetattr )],
892
893 time_h => [qw(CLK_TCK CLOCKS_PER_SEC NULL asctime clock ctime
894 difftime mktime strftime tzset tzname)],
895
896 unistd_h => [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET
897 STDERR_FILENO STDIN_FILENO STDOUT_FILENO W_OK X_OK
898 _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON
899 _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX
900 _PC_PIPE_BUF _PC_VDISABLE _POSIX_CHOWN_RESTRICTED
901 _POSIX_JOB_CONTROL _POSIX_NO_TRUNC _POSIX_SAVED_IDS
902 _POSIX_VDISABLE _POSIX_VERSION _SC_ARG_MAX
903 _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL
904 _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS
905 _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
906 _exit access ctermid cuserid
907 dup2 dup execl execle execlp execv execve execvp
908 fpathconf fsync getcwd getegid geteuid getgid getgroups
909 getpid getuid isatty lseek pathconf pause setgid setpgid
910 setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)],
911
912 utime_h => [],
913
914);
915
916# Exporter::export_tags();
917{
918 # De-duplicate the export list:
919 my %export;
920 @export{map {@$_} values %EXPORT_TAGS} = ();
921 # Doing the de-dup with a temporary hash has the advantage that the SVs in
922 # @EXPORT are actually shared hash key sacalars, which will save some memory.
923 push @EXPORT, keys %export;
924}
925
926@EXPORT_OK = qw(
927 abs
928 alarm
929 atan2
930 chdir
931 chmod
932 chown
933 close
934 closedir
935 cos
936 exit
937 exp
938 fcntl
939 fileno
940 fork
941 getc
942 getgrgid
943 getgrnam
944 getlogin
945 getpgrp
946 getppid
947 getpwnam
948 getpwuid
949 gmtime
950 isatty
951 kill
952 lchown
953 link
954 localtime
955 log
956 mkdir
957 nice
958 open
959 opendir
960 pipe
961 printf
962 rand
963 read
964 readdir
965 rename
966 rewinddir
967 rmdir
968 sin
969 sleep
970 sprintf
971 sqrt
972 srand
973 stat
974 system
975 time
976 times
977 umask
978 unlink
979 utime
980 wait
981 waitpid
982 write
983);
984
985require Exporter;
986}
987
988package POSIX::SigAction;
989
990sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0, SAFE => 0}, $_[0] }
991sub handler { $_[0]->{HANDLER} = $_[1] if @_ > 1; $_[0]->{HANDLER} };
992sub mask { $_[0]->{MASK} = $_[1] if @_ > 1; $_[0]->{MASK} };
993sub flags { $_[0]->{FLAGS} = $_[1] if @_ > 1; $_[0]->{FLAGS} };
994sub safe { $_[0]->{SAFE} = $_[1] if @_ > 1; $_[0]->{SAFE} };
995
996package POSIX::SigRt;
997
998
999sub _init {
1000 $_SIGRTMIN = &POSIX::SIGRTMIN;
1001 $_SIGRTMAX = &POSIX::SIGRTMAX;
1002 $_sigrtn = $_SIGRTMAX - $_SIGRTMIN;
1003}
1004
1005sub _croak {
1006 &_init unless defined $_sigrtn;
1007 die "POSIX::SigRt not available" unless defined $_sigrtn && $_sigrtn > 0;
1008}
1009
1010sub _getsig {
1011 &_croak;
1012 my $rtsig = $_[0];
1013 # Allow (SIGRT)?MIN( + n)?, a common idiom when doing these things in C.
1014 $rtsig = $_SIGRTMIN + ($1 || 0)
1015 if $rtsig =~ /^(?:(?:SIG)?RT)?MIN(\s*\+\s*(\d+))?$/;
1016 return $rtsig;
1017}
1018
1019sub _exist {
1020 my $rtsig = _getsig($_[1]);
1021 my $ok = $rtsig >= $_SIGRTMIN && $rtsig <= $_SIGRTMAX;
1022 ($rtsig, $ok);
1023}
1024
1025sub _check {
1026 my ($rtsig, $ok) = &_exist;
1027 die "No POSIX::SigRt signal $_[1] (valid range SIGRTMIN..SIGRTMAX, or $_SIGRTMIN..$_SIGRTMAX)"
1028 unless $ok;
1029 return $rtsig;
1030}
1031
1032sub new {
1033 my ($rtsig, $handler, $flags) = @_;
1034 my $sigset = POSIX::SigSet->new($rtsig);
1035 my $sigact = POSIX::SigAction->new($handler,
1036 $sigset,
1037 $flags);
1038 POSIX::sigaction($rtsig, $sigact);
1039}
1040
1041sub EXISTS { &_exist }
1042sub FETCH { my $rtsig = &_check;
1043 my $oa = POSIX::SigAction->new();
1044 POSIX::sigaction($rtsig, undef, $oa);
1045 return $oa->{HANDLER} }
1046sub STORE { my $rtsig = &_check; new($rtsig, $_[2], $SIGACTION_FLAGS) }
1047sub DELETE { delete $SIG{ &_check } }
1048sub CLEAR { &_exist; delete @SIG{ &POSIX::SIGRTMIN .. &POSIX::SIGRTMAX } }
1049sub SCALAR { &_croak; $_sigrtn + 1 }
# spent 18.7s within POSIX::acos which was called 5980967 times, avg 3µs/call: # 5980967 times (18.7s+0) by WISE::CoUtils::angdist at line 203 of /wise/base/deliv/dev/lib/perl/WISE/CoUtils.pm, avg 3µs/call
sub POSIX::acos; # xsub
# spent 62.8ms within POSIX::asin which was called 13869 times, avg 5µs/call: # 13869 times (62.8ms+0) by Astro::Coord::r2pol at line 170 of /wise/base/static/lib/perl5/site_perl/5.10.0/Astro/Coord.pm, avg 5µs/call
sub POSIX::asin; # xsub
# spent 496µs within POSIX::strftime which was called 4 times, avg 124µs/call: # 4 times (496µs+0) by WISE::UtilsLight::mytime at line 238 of /wise/base/deliv/dev/lib/perl/WISE/UtilsLight.pm, avg 124µs/call
sub POSIX::strftime; # xsub