X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=doio.c;h=2baecec6b1a8d5ba31604c7b6446af4eb1214a73;hb=9741dab02becad0550bba7d5ca9e59f8ac608b2d;hp=d3d4d97abefada42fc957b3d37ece8dc6994e7f0;hpb=94e4c24434948b232e1a08fce7b0c2f871b1262e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/doio.c b/doio.c index d3d4d97..2baecec 100644 --- a/doio.c +++ b/doio.c @@ -141,7 +141,7 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, } if (as_raw) { -#if defined(USE_64_BIT_OFFSETS) && defined(O_LARGEFILE) +#if defined(USE_64_BIT_RAWIO) && defined(O_LARGEFILE) rawmode |= O_LARGEFILE; #endif @@ -283,8 +283,17 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, } if (IoIFP(thatio)) { PerlIO *fp = IoIFP(thatio); - /* Flush stdio buffer before dup */ + /* Flush stdio buffer before dup. --mjd + * Unfortunately SEEK_CURing 0 seems to + * be optimized away on most platforms; + * only Solaris and Linux seem to flush + * on that. --jhi */ PerlIO_seek(fp, 0, SEEK_CUR); + /* On the other hand, do all platforms + * take gracefully to flushing a read-only + * filehandle? Perhaps we should do + * fsetpos(src)+fgetpos(dst)? --nik */ + PerlIO_flush(fp); fd = PerlIO_fileno(fp); if (IoTYPE(thatio) == 's') IoTYPE(io) = 's'; @@ -1026,7 +1035,8 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp) * filesize limit we would need getrlimit(). We could then * also transparently raise the limit with setrlimit() -- * but only until the system hard limit/the filesystem limit, - * at which we would get EPERM. --jhi */ + * at which we would get EPERM. Note that when using buffered + * io the write failure can be delayed until the flush/close. --jhi */ if (len && (PerlIO_write(fp,tmps,len) == 0 || PerlIO_error(fp))) return FALSE; return !PerlIO_error(fp); @@ -1686,7 +1696,7 @@ Perl_do_ipcctl(pTHX_ I32 optype, SV **mark, SV **sp) else { IV i = SvIV(astr); - a = (char *)i; /* ouch */ + a = INT2PTR(char *,i); /* ouch */ } SETERRNO(0,0); switch (optype)