summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perlio.c8
-rw-r--r--perlio.h4
-rw-r--r--perlsdio.h8
-rw-r--r--pp_sys.c2
4 files changed, 12 insertions, 10 deletions
diff --git a/perlio.c b/perlio.c
index d9b3d81ac3..0a0625cfba 100644
--- a/perlio.c
+++ b/perlio.c
@@ -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);
}
diff --git a/perlio.h b/perlio.h
index 9af62f5a63..59d1a193f8 100644
--- a/perlio.h
+++ b/perlio.h
@@ -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)
diff --git a/pp_sys.c b/pp_sys.c
index 45290d60de..fe11f85d07 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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;