summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include/sys/config.h
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2001-03-06 01:04:43 +0000
committerJeff Johnston <jjohnstn@redhat.com>2001-03-06 01:04:43 +0000
commitcfc05d9675436a157ea959a5fb06da60722234c7 (patch)
treedfd096db23b4c24f2be67e69276e7b10c9cc04d6 /newlib/libc/include/sys/config.h
parenta887211b0012ee3ce20e1327bb0a6ed49719edf5 (diff)
downloadcygnal-cfc05d9675436a157ea959a5fb06da60722234c7.tar.gz
cygnal-cfc05d9675436a157ea959a5fb06da60722234c7.tar.bz2
cygnal-cfc05d9675436a157ea959a5fb06da60722234c7.zip
Mon Mar 5 21:48:54 2001 J"orn Rennecke <amylaar@redhat.com>
* libc/include/sys/config.h (_READ_WRITE_RETURN_TYPE): Define. For RTEMS, define to be ssize_t. Default to int if not defined. * libc/stdio/sscanf.c (eofread): Return _READ_WRITE_RETURN_TYPE. * libc/stdio/stdio.c (__sread, __swrite): Likewise. * libc/stdio/local.h (__sread, __swrite): Likewise. * libc/include/sys/reent.h (_read, _write): Likewise. * libc/include/sys/unistd.h (read, write, _read, _write): Likewise. * libc/syscalls/sysread.c (read): Likewise. * libc/syscalls/syswrite.c (write): Likewise.
Diffstat (limited to 'newlib/libc/include/sys/config.h')
-rw-r--r--newlib/libc/include/sys/config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index 0cf4b1e57..60c6eb9fb 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -137,11 +137,18 @@ typedef unsigned int __uint32_t;
#if defined(__rtems__)
#define __FILENAME_MAX__ 255
+#define _READ_WRITE_RETURN_TYPE ssize_t
#endif
#ifndef __IMPORT
#define __IMPORT
#endif
+/* Define return type of read/write routines. In POSIX, the return type
+ for read()/write() is "ssize_t" but legacy newlib code has been using
+ "int" for some time. If not specified, "int" is defaulted. */
+#ifndef _READ_WRITE_RETURN_TYPE
+#define _READ_WRITE_RETURN_TYPE int
+#endif
#endif /* __SYS_CONFIG_H__ */