This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Fix libgloss read/write prototypes


Hi!

The following patch fixes problems with read/write definition.
A size_t is not an int and read()/write() prototypes are defined with size_t.
The implementation must follow that too. The size_t definition is provided by gcc
in <stddef.h> so that libgloss does not rely on any libc header.

Can you integrate this patch ?

Thanks,
	Stephane

2002-07-16  Stephane Carrez  <Stephane.Carrez@nerim.fr>

	* write.c (write): Use size_t for the size of the write.
	* read.c (read): Likewise.
diff -Nrup --exclude=Makefile.in --exclude=configure --exclude=CVS newlib-main/libgloss/read.c newlib-main-integrate/libgloss/read.c
--- newlib-main/libgloss/read.c	Fri Mar 17 23:48:49 2000
+++ newlib-main-integrate/libgloss/read.c	Sat Jul 13 15:23:34 2002
@@ -13,6 +13,7 @@
  * they apply.
  */
 #include "glue.h"
+#include <stddef.h>
 
 extern char _DEFUN_VOID (inbyte);
 
@@ -24,7 +25,7 @@ int
 _DEFUN (read, (fd, buf, nbytes),
        int fd _AND
        char *buf _AND
-       int nbytes)
+       size_t nbytes)
 {
   int i = 0;
 
diff -Nrup --exclude=Makefile.in --exclude=configure --exclude=CVS newlib-main/libgloss/write.c newlib-main-integrate/libgloss/write.c
--- newlib-main/libgloss/write.c	Fri Mar 17 23:48:49 2000
+++ newlib-main-integrate/libgloss/write.c	Sat Jul 13 15:23:34 2002
@@ -13,6 +13,7 @@
  * they apply.
  */
 #include "glue.h"
+#include <stddef.h>
 
 extern int  _EXFUN (outbyte, (char x));
 
@@ -25,7 +26,7 @@ int
 _DEFUN (write, (fd, buf, nbytes),
        int fd _AND
        char *buf _AND
-       int nbytes)
+       size_t nbytes)
 {
   int i;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]