diff options
-rw-r--r-- | perlio.c | 8 | ||||
-rw-r--r-- | perlio.h | 4 | ||||
-rw-r--r-- | perlsdio.h | 8 | ||||
-rw-r--r-- | pp_sys.c | 2 |
4 files changed, 12 insertions, 10 deletions
@@ -382,21 +382,21 @@ int ch; } #undef PerlIO_read -int +SSize_t PerlIO_read(f,buf,count) PerlIO *f; void *buf; -size_t count; +Size_t count; { return fread(buf,1,count,f); } #undef PerlIO_write -int +SSize_t PerlIO_write(f,buf,count) PerlIO *f; const void *buf; -size_t count; +Size_t count; { return fwrite1(buf,1,count,f); } @@ -120,10 +120,10 @@ extern FILE * PerlIO_findFILE _((PerlIO *)); extern void PerlIO_releaseFILE _((PerlIO *,FILE *)); #endif #ifndef PerlIO_read -extern int PerlIO_read _((PerlIO *,void *,size_t)); +extern SSize_t PerlIO_read _((PerlIO *,void *,Size_t)); #endif #ifndef PerlIO_write -extern int PerlIO_write _((PerlIO *,const void *,size_t)); +extern SSize_t PerlIO_write _((PerlIO *,const void *,Size_t)); #endif #ifndef PerlIO_setlinebuf extern void PerlIO_setlinebuf _((PerlIO *)); diff --git a/perlsdio.h b/perlsdio.h index 97add0f991..8bb50515bd 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -39,12 +39,14 @@ * VAXCRTL which causes read from a pipe after EOF has been returned * once to hang. */ -# define PerlIO_getc(f) (feof(f) ? EOF : getc(f)) -# define PerlIO_read(f,buf,count) (feof(f) ? 0 : fread(buf,1,count,f)) +# define PerlIO_getc(f) \ + (feof(f) ? EOF : getc(f)) +# define PerlIO_read(f,buf,count) \ + (feof(f) ? 0 : (SSize_t)fread(buf,1,count,f)) #else # define PerlIO_ungetc(f,c) ungetc(c,f) # define PerlIO_getc(f) getc(f) -# define PerlIO_read(f,buf,count) fread(buf,1,count,f) +# define PerlIO_read(f,buf,count) (SSize_t)fread(buf,1,count,f) #endif #define PerlIO_eof(f) feof(f) #define PerlIO_getname(f,b) fgetname(f,b) @@ -1155,7 +1155,7 @@ PP(pp_sysread) GV *gv; IO *io; char *buffer; - int length; + SSize_t length; Sock_size_t bufsize; SV *bufsv; STRLEN blen; |