add support for STASH and MAGIC information for REFs to sv_dump().
[p5sagit/p5-mst-13.2.git] / ext / POSIX / POSIX.pm
index 96555a5..5a1cbb9 100644 (file)
@@ -51,9 +51,12 @@ sub AUTOLOAD {
     goto &$AUTOLOAD;
 }
 
-sub POSIX::SigAction::new {
-    bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0}, $_[0];
-}
+package POSIX::SigAction;
+
+use AutoLoader 'AUTOLOAD';
+sub new { bless {HANDLER => $_[1], MASK => $_[2], FLAGS => $_[3] || 0}, $_[0] }
+
+package POSIX;
 
 1;
 __END__
@@ -720,7 +723,7 @@ sub setvbuf {
 
 sub sleep {
     usage "sleep(seconds)" if @_ != 1;
-    CORE::sleep($_[0]);
+    $_[0] - CORE::sleep($_[0]);
 }
 
 sub unlink {
@@ -871,7 +874,7 @@ sub load_imports {
                _POSIX_JOB_CONTROL _POSIX_NO_TRUNC _POSIX_SAVED_IDS
                _POSIX_VDISABLE _POSIX_VERSION _SC_ARG_MAX
                _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL
-               _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS
+               _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS
                _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION
                _exit access ctermid cuserid
                dup2 dup execl execle execlp execv execve execvp
@@ -889,23 +892,68 @@ for (values %EXPORT_TAGS) {
 }
 
 @EXPORT_OK = qw(
-    closedir opendir readdir rewinddir
-    fcntl open
-    getgrgid getgrnam
-    atan2 cos exp log sin sqrt
-    getpwnam getpwuid
-    kill
-    fileno getc printf rename sprintf
-    abs exit rand srand system
-    chmod mkdir stat umask
-    times
-    wait waitpid
-    gmtime localtime time
-    alarm chdir chown close fork getlogin getppid getpgrp link
-       pipe read rmdir sleep unlink write
-    utime
-    nice
+               abs
+               alarm
+               atan2
+               chdir
+               chmod
+               chown
+               close
+               closedir
+               cos
+               exit
+               exp
+               fcntl
+               fileno
+               fork
+               getc
+               getgrgid
+               getgrnam
+               getlogin
+               getpgrp
+               getppid
+               getpwnam
+               getpwuid
+               gmtime
+               isatty
+               kill
+               link
+               localtime
+               log
+               mkdir
+               nice
+               open
+               opendir
+               pipe
+               printf
+               rand
+               read
+               readdir
+               rename
+               rewinddir
+               rmdir
+               sin
+               sleep
+               sprintf
+               sqrt
+               srand
+               stat
+               system
+               time
+               times
+               umask
+               unlink
+               utime
+               wait
+               waitpid
+               write
 );
 
 require Exporter;
 }
+
+package POSIX::SigAction;
+
+sub handler { $_[0]->{HANDLER} = $_[1] if @_ > 1; $_[0]->{HANDLER} };
+sub mask    { $_[0]->{MASK}    = $_[1] if @_ > 1; $_[0]->{MASK} };
+sub flags   { $_[0]->{FLAGS}   = $_[1] if @_ > 1; $_[0]->{FLAGS} };