[REPATCH 5.005_61] Re: perldiag.pod omissions
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 3983619..8c0820f 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -230,7 +230,7 @@ static char zero_but_true[ZBTLEN + 1] = "0 but true";
        || defined(HAS_SETREGID) || defined(HAS_SETRESGID))
 /* The Hard Way. */
 STATIC int
-S_emulate_eaccess(pTHX_ const char* path, int mode)
+S_emulate_eaccess(pTHX_ const char* path, Mode_t mode)
 {
     Uid_t ruid = getuid();
     Uid_t euid = geteuid();
@@ -295,7 +295,7 @@ S_emulate_eaccess(pTHX_ const char* path, int mode)
 
 #if !defined(PERL_EFF_ACCESS_R_OK)
 STATIC int
-S_emulate_eaccess(pTHX_ const char* path, int mode)
+S_emulate_eaccess(pTHX_ const char* path, Mode_t mode)
 {
     Perl_croak(aTHX_ "switching effective uid is not implemented");
     /*NOTREACHED*/
@@ -1667,6 +1667,7 @@ PP(pp_send)
        else
 #endif
        {
+           /* See the note at doio.c:do_print about filesize limits. --jhi */
            length = PerlLIO_write(PerlIO_fileno(IoIFP(io)),
                                   buffer+offset, length);
        }
@@ -1764,7 +1765,7 @@ PP(pp_sysseek)
     djSP;
     GV *gv;
     int whence = POPi;
-    Off_t offset = POPl;
+    Off_t offset = (Off_t)SvIVx(POPs);
     MAGIC *mg;
 
     gv = PL_last_in_gv = (GV*)POPs;
@@ -2485,9 +2486,9 @@ PP(pp_stat)
 #endif
        PUSHs(sv_2mortal(newSViv(PL_statcache.st_size)));
 #ifdef BIG_TIME
-       PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_atime)));
-       PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_mtime)));
-       PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_ctime)));
+       PUSHs(sv_2mortal(newSVnv(PL_statcache.st_atime)));
+       PUSHs(sv_2mortal(newSVnv(PL_statcache.st_mtime)));
+       PUSHs(sv_2mortal(newSVnv(PL_statcache.st_ctime)));
 #else
        PUSHs(sv_2mortal(newSViv(PL_statcache.st_atime)));
        PUSHs(sv_2mortal(newSViv(PL_statcache.st_mtime)));
@@ -3764,21 +3765,21 @@ PP(pp_getpgrp)
 {
 #ifdef HAS_GETPGRP
     djSP; dTARGET;
-    int pid;
-    I32 value;
+    Pid_t pid;
+    Pid_t pgrp;
 
     if (MAXARG < 1)
        pid = 0;
     else
        pid = SvIVx(POPs);
 #ifdef BSD_GETPGRP
-    value = (I32)BSD_GETPGRP(pid);
+    pgrp = (I32)BSD_GETPGRP(pid);
 #else
     if (pid != 0 && pid != getpid())
        DIE(aTHX_ "POSIX getpgrp can't take an argument");
-    value = (I32)getpgrp();
+    pgrp = getpgrp();
 #endif
-    XPUSHi(value);
+    XPUSHi(pgrp);
     RETURN;
 #else
     DIE(aTHX_ PL_no_func, "getpgrp()");
@@ -3789,8 +3790,8 @@ PP(pp_setpgrp)
 {
 #ifdef HAS_SETPGRP
     djSP; dTARGET;
-    int pgrp;
-    int pid;
+    Pid_t pgrp;
+    Pid_t pid;
     if (MAXARG < 2) {
        pgrp = 0;
        pid = 0;
@@ -3939,13 +3940,13 @@ PP(pp_gmtime)
        if (!tmbuf)
            RETPUSHUNDEF;
        tsv = Perl_newSVpvf(aTHX_ "%s %s %2d %02d:%02d:%02d %d",
-                      dayname[tmbuf->tm_wday],
-                      monname[tmbuf->tm_mon],
-                      tmbuf->tm_mday,
-                      tmbuf->tm_hour,
-                      tmbuf->tm_min,
-                      tmbuf->tm_sec,
-                      tmbuf->tm_year + 1900);
+                           dayname[tmbuf->tm_wday],
+                           monname[tmbuf->tm_mon],
+                           (IV)tmbuf->tm_mday,
+                           (IV)tmbuf->tm_hour,
+                           (IV)tmbuf->tm_min,
+                           (IV)tmbuf->tm_sec,
+                           (IV)tmbuf->tm_year + 1900);
        PUSHs(sv_2mortal(tsv));
     }
     else if (tmbuf) {
@@ -5000,7 +5001,7 @@ fcntl_emulate_flock(int fd, int operation)
        return -1;
     }
     flock.l_whence = SEEK_SET;
-    flock.l_start = flock.l_len = 0L;
+    flock.l_start = flock.l_len = (Off_t)0;
  
     return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &flock);
 }