This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH] Re: pod2man bug in date generated line
[perl5.git] / doio.c
diff --git a/doio.c b/doio.c
index 271218f..0cdf87d 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -125,9 +125,14 @@ do_open(GV *gv, register char *name, I32 len, int as_raw, int rawmode, int rawpe
     }
 
     if (as_raw) {
+#if defined(O_LARGEFILE)
+       rawmode |= O_LARGEFILE;
+#endif
+
 #ifndef O_ACCMODE
 #define O_ACCMODE 3            /* Assume traditional implementation */
 #endif
+
        switch (result = rawmode & O_ACCMODE) {
        case O_RDONLY:
             IoTYPE(io) = '<';
@@ -301,7 +306,7 @@ do_open(GV *gv, register char *name, I32 len, int as_raw, int rawmode, int rawpe
     if (!fp) {
        dTHR;
        if (ckWARN(WARN_NEWLINE) && IoTYPE(io) == '<' && strchr(name, '\n'))
-           warner(WARN_NEWLINE, warn_nl, "open");
+           warner(WARN_NEWLINE, PL_warn_nl, "open");
        goto say_false;
     }
     if (IoTYPE(io) &&
@@ -705,7 +710,7 @@ do_eof(GV *gv)
     return TRUE;
 }
 
-long
+Off_t
 do_tell(GV *gv)
 {
     register IO *io;
@@ -724,11 +729,11 @@ do_tell(GV *gv)
            warner(WARN_UNOPENED, "tell() on unopened file");
     }
     SETERRNO(EBADF,RMS$_IFI);
-    return -1L;
+    return (Off_t)-1;
 }
 
 bool
-do_seek(GV *gv, long int pos, int whence)
+do_seek(GV *gv, Off_t pos, int whence)
 {
     register IO *io;
     register PerlIO *fp;
@@ -749,8 +754,8 @@ do_seek(GV *gv, long int pos, int whence)
     return FALSE;
 }
 
-long
-do_sysseek(GV *gv, long int pos, int whence)
+Off_t
+do_sysseek(GV *gv, Off_t pos, int whence)
 {
     register IO *io;
     register PerlIO *fp;
@@ -884,7 +889,7 @@ do_print(register SV *sv, PerlIO *fp)
        {
            dTHR;
            if (ckWARN(WARN_UNINITIALIZED))
-               warner(WARN_UNINITIALIZED, warn_uninit);
+               warner(WARN_UNINITIALIZED, PL_warn_uninit);
        }
        return TRUE;
     case SVt_IV:
@@ -952,7 +957,7 @@ my_stat(ARGSproto)
        PL_laststype = OP_STAT;
        PL_laststatval = PerlLIO_stat(s, &PL_statcache);
        if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(s, '\n'))
-           warner(WARN_NEWLINE, warn_nl, "stat");
+           warner(WARN_NEWLINE, PL_warn_nl, "stat");
        return PL_laststatval;
     }
 }
@@ -983,7 +988,7 @@ my_lstat(ARGSproto)
     PL_laststatval = PerlLIO_stat(SvPV(sv, PL_na),&PL_statcache);
 #endif
     if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(SvPV(sv, PL_na), '\n'))
-       warner(WARN_NEWLINE, warn_nl, "lstat");
+       warner(WARN_NEWLINE, PL_warn_nl, "lstat");
     return PL_laststatval;
 }
 
@@ -1439,7 +1444,7 @@ do_ipcget(I32 optype, SV **mark, SV **sp)
 #endif
 #if !defined(HAS_MSG) || !defined(HAS_SEM) || !defined(HAS_SHM)
     default:
-       croak("%s not implemented", op_desc[optype]);
+       croak("%s not implemented", PL_op_desc[optype]);
 #endif
     }
     return -1;                 /* should never happen */
@@ -1496,7 +1501,7 @@ do_ipcctl(I32 optype, SV **mark, SV **sp)
 #endif
 #if !defined(HAS_MSG) || !defined(HAS_SEM) || !defined(HAS_SHM)
     default:
-       croak("%s not implemented", op_desc[optype]);
+       croak("%s not implemented", PL_op_desc[optype]);
 #endif
     }
 
@@ -1513,7 +1518,9 @@ do_ipcctl(I32 optype, SV **mark, SV **sp)
            a = SvPV(astr, len);
            if (len != infosize)
                croak("Bad arg length for %s, is %lu, should be %ld",
-                       op_desc[optype], (unsigned long)len, (long)infosize);
+                     PL_op_desc[optype],
+                     (unsigned long)len,
+                     (long)infosize);
        }
     }
     else