]> sourceware.org Git - newlib-cygwin.git/commitdiff
2002-06-27 Jeff Johnston <jjohnstn@redhat.com>
authorJeff Johnston <jjohnstn@redhat.com>
Thu, 27 Jun 2002 22:48:05 +0000 (22:48 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Thu, 27 Jun 2002 22:48:05 +0000 (22:48 +0000)
        * libc/include/sys/_types.h: Define _ssize_t as int if int is
        32-bits, otherwise define it as long.
        * libc/include/sys/types.h: Include <_ansi.h> and <sys/_types.h>
        and define ssize_t as _ssize_t.
        * libc/reent/readr.c: Change return type to _ssize_t.
        * libc/reent/writer.c: Ditto.
        * libc/sys/linux/Makefile.am: Add aio.c.
        * libc/sys/linux/Makefile.in: Regenerated.
        * libc/sys/linux/aio.c: New file.
        * libc/sys/linux/sys/cdefs.h: Add __restrict_arr definition.
        * libm/common/fdlibm.h: Undef __P before defining it.

newlib/ChangeLog
newlib/libc/include/sys/_types.h
newlib/libc/include/sys/types.h
newlib/libc/reent/readr.c
newlib/libc/reent/writer.c
newlib/libc/sys/linux/Makefile.am
newlib/libc/sys/linux/Makefile.in
newlib/libc/sys/linux/aio.c [new file with mode: 0644]
newlib/libc/sys/linux/sys/cdefs.h
newlib/libm/common/fdlibm.h

index 040d3bf7c22560326ba1290ce6e554415cdc2e67..66461ef1ea50300a96c6932aacc649885462f770 100644 (file)
@@ -1,3 +1,17 @@
+2002-06-27  Jeff Johnston  <jjohnstn@redhat.com>
+
+        * libc/include/sys/_types.h: Define _ssize_t as int if int is
+        32-bits, otherwise define it as long.
+        * libc/include/sys/types.h: Include <_ansi.h> and <sys/_types.h>
+        and define ssize_t as _ssize_t.
+        * libc/reent/readr.c: Change return type to _ssize_t.
+        * libc/reent/writer.c: Ditto.
+        * libc/sys/linux/Makefile.am: Add aio.c.
+        * libc/sys/linux/Makefile.in: Regenerated.
+        * libc/sys/linux/aio.c: New file.
+        * libc/sys/linux/sys/cdefs.h: Add __restrict_arr definition.
+        * libm/common/fdlibm.h: Undef __P before defining it.
+
 2002-06-27  Thomas Fitzsimmons  <fitzsim@redhat.com>
 
        * libm/mathfp/s_pow.c (pow): Fix checks on variable k.  Add
index 8186f2d9d7565097206060afc306ca895316165d..a2f6e3929552fecf19eb933fa94ae0191f59bcd3 100644 (file)
 #define _SYS__TYPES_H
 
 typedef long _off_t;
+
+#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
+typedef int _ssize_t;
+#else
 typedef long _ssize_t;
+#endif
 
 #endif /* _SYS__TYPES_H */
index 13e12a9df897b0a7473640eace62c7dfbeceac86..c562a23b4bfdef59e54d7b37eb1aa8247804b302 100644 (file)
@@ -18,6 +18,9 @@
 #ifndef _SYS_TYPES_H
 #define _SYS_TYPES_H
 
+#include <_ansi.h>
+#include <sys/_types.h>
+
 #if defined (_WIN32) || defined (__CYGWIN__)
 #define __MS_types__
 #endif
@@ -158,7 +161,7 @@ typedef     unsigned short  gid_t;
 
 typedef int pid_t;
 typedef        long key_t;
-typedef long ssize_t;
+typedef _ssize_t ssize_t;
 
 #ifdef __MS_types__
 typedef        char *  addr_t;
index e3deca9a718fc8f8ba59049f540dd7afaaead9d7..b05cbe2ab148295e07ebf83f9b8d6b6ff760e694 100644 (file)
@@ -28,12 +28,12 @@ INDEX
 
 ANSI_SYNOPSIS
        #include <reent.h>
-       long _read_r(struct _reent *<[ptr]>,
-                    int <[fd]>, void *<[buf]>, size_t <[cnt]>);
+       _ssize_t _read_r(struct _reent *<[ptr]>,
+                        int <[fd]>, void *<[buf]>, size_t <[cnt]>);
 
 TRAD_SYNOPSIS
        #include <reent.h>
-       long _read_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>)
+       _ssize_t _read_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>)
        struct _reent *<[ptr]>;
        int <[fd]>;
        char *<[buf]>;
@@ -45,17 +45,17 @@ DESCRIPTION
        <<errno>>.
 */
 
-long
+_ssize_t
 _read_r (ptr, fd, buf, cnt)
      struct _reent *ptr;
      int fd;
      _PTR buf;
      size_t cnt;
 {
-  long ret;
+  _ssize_t ret;
 
   errno = 0;
-  if ((ret = _read (fd, buf, cnt)) == -1 && errno != 0)
+  if ((ret = (_ssize_t)_read (fd, buf, cnt)) == -1 && errno != 0)
     ptr->_errno = errno;
   return ret;
 }
index ac10286e8c7f4762bcdfd8e0a37ce800d2124c5c..7ede74fcc49964a3a0df1c1064e75abff86c9bf8 100644 (file)
@@ -28,12 +28,12 @@ INDEX
 
 ANSI_SYNOPSIS
        #include <reent.h>
-       long _write_r(struct _reent *<[ptr]>,
-                     int <[fd]>, const void *<[buf]>, size_t <[cnt]>);
+       _ssize_t _write_r(struct _reent *<[ptr]>,
+                         int <[fd]>, const void *<[buf]>, size_t <[cnt]>);
 
 TRAD_SYNOPSIS
        #include <reent.h>
-       long _write_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>)
+       _ssize_t _write_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>)
        struct _reent *<[ptr]>;
        int <[fd]>;
        char *<[buf]>;
@@ -45,17 +45,17 @@ DESCRIPTION
        <<errno>>.
 */
 
-long
+_ssize_t
 _write_r (ptr, fd, buf, cnt)
      struct _reent *ptr;
      int fd;
      _CONST _PTR buf;
      size_t cnt;
 {
-  long ret;
+  _ssize_t ret;
 
   errno = 0;
-  if ((ret = _write (fd, buf, cnt)) == -1 && errno != 0)
+  if ((ret = (_ssize_t)_write (fd, buf, cnt)) == -1 && errno != 0)
     ptr->_errno = errno;
   return ret;
 }
index a21963ca6328106e18aa2d88aa082d74224dd56a..6f05fc881398916d03c97c163397c40afe30f8cf 100644 (file)
@@ -10,6 +10,7 @@ SUBLIBS = \
        $(LINUX_MACH_LIB)
 
 LIB_SOURCES = \
+       aio.c \
        brk.c \
        cfspeed.c \
        clock_getres.c \
index f740b67a181e56d22e083a5d1597cb4a61abdc45..4b7df11c645a274cdd80e3f60c05037c42436121 100644 (file)
@@ -107,6 +107,7 @@ SUBLIBS = \
 
 
 LIB_SOURCES = \
+       aio.c \
        brk.c \
        cfspeed.c \
        clock_getres.c \
@@ -208,15 +209,16 @@ LIBRARIES =  $(noinst_LIBRARIES)
 DEFS = @DEFS@ -I. -I$(srcdir) 
 CPPFLAGS = @CPPFLAGS@
 LIBS = @LIBS@
-@USE_LIBTOOL_FALSE@lib_a_OBJECTS =  brk.$(OBJEXT) cfspeed.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@clock_getres.$(OBJEXT) clock_gettime.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@clock_settime.$(OBJEXT) flockfile.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@ftok.$(OBJEXT) funlockfile.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@getdate.$(OBJEXT) getdate_err.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@gethostname.$(OBJEXT) getoptlong.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@getreent.$(OBJEXT) ids.$(OBJEXT) inode.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@io.$(OBJEXT) io64.$(OBJEXT) ipc.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@linux.$(OBJEXT) mmap.$(OBJEXT) mq_close.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@lib_a_OBJECTS =  aio.$(OBJEXT) brk.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@cfspeed.$(OBJEXT) clock_getres.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@clock_gettime.$(OBJEXT) clock_settime.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@flockfile.$(OBJEXT) ftok.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@funlockfile.$(OBJEXT) getdate.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@getdate_err.$(OBJEXT) gethostname.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@getoptlong.$(OBJEXT) getreent.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@ids.$(OBJEXT) inode.$(OBJEXT) io.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@io64.$(OBJEXT) ipc.$(OBJEXT) linux.$(OBJEXT) \
+@USE_LIBTOOL_FALSE@mmap.$(OBJEXT) mq_close.$(OBJEXT) \
 @USE_LIBTOOL_FALSE@mq_getattr.$(OBJEXT) mq_notify.$(OBJEXT) \
 @USE_LIBTOOL_FALSE@mq_open.$(OBJEXT) mq_receive.$(OBJEXT) \
 @USE_LIBTOOL_FALSE@mq_send.$(OBJEXT) mq_setattr.$(OBJEXT) \
@@ -238,7 +240,7 @@ LIBS = @LIBS@
 @USE_LIBTOOL_FALSE@usleep.$(OBJEXT) wait.$(OBJEXT)
 LTLIBRARIES =  $(noinst_LTLIBRARIES)
 
-@USE_LIBTOOL_TRUE@liblinux_la_OBJECTS =  brk.lo cfspeed.lo \
+@USE_LIBTOOL_TRUE@liblinux_la_OBJECTS =  aio.lo brk.lo cfspeed.lo \
 @USE_LIBTOOL_TRUE@clock_getres.lo clock_gettime.lo clock_settime.lo \
 @USE_LIBTOOL_TRUE@flockfile.lo ftok.lo funlockfile.lo getdate.lo \
 @USE_LIBTOOL_TRUE@getdate_err.lo gethostname.lo getoptlong.lo \
diff --git a/newlib/libc/sys/linux/aio.c b/newlib/libc/sys/linux/aio.c
new file mode 100644 (file)
index 0000000..7351a03
--- /dev/null
@@ -0,0 +1,67 @@
+/* libc/sys/linux/aio.c - asychronous I/O */
+
+/* Copyright 2002, Red Hat Inc. */
+
+/* Currently asynchronous I/O is not implemented. */
+
+#include <sys/types.h>
+#include <aio.h>
+#include <errno.h>
+
+int
+aio_cancel (int fd, struct aiocb *cb)
+{
+  errno = ENOSYS;
+  return -1;
+}
+
+int
+aio_error (const struct aiocb *cb)
+{
+  errno = ENOSYS;
+  return -1;
+}
+
+int
+aio_fsync (int op, struct aiocb *cb)
+{
+  errno = ENOSYS;
+  return -1;
+}
+
+int
+aio_read (struct aiocb *cb)
+{
+  errno = ENOSYS;
+  return -1;
+}
+
+ssize_t
+aio_return (struct aiocb *cb)
+{
+  errno = ENOSYS;
+  return -1;
+}
+
+int
+aio_suspend (const struct aiocb *const list[], int nent,
+             const struct timespec *timeout)
+{
+  errno = ENOSYS;
+  return -1;
+}
+
+int
+aio_write (struct aiocb *cb)
+{
+  errno = ENOSYS;
+  return -1;
+}
+
+int
+lio_listio (int mode, struct aiocb * const list[], int nent,
+            struct sigevent *sig)
+{
+  errno = ENOSYS;
+  return -1;
+}
index f0b6a27b42d92a037247571a4107ac04d70779de..1108a7dabf85f8834782ab247d10bf994d783919 100644 (file)
@@ -65,6 +65,7 @@
 #define __attribute_pure__
 #define __attribute_format_strfmon__(a,b)
 #define __flexarr      [0]
+#define __restrict_arr
 
 #ifdef  __cplusplus
 # define __BEGIN_DECLS  extern "C" {
@@ -80,6 +81,7 @@
 # define __ptrvalue     /* nothing */
 #endif
 
+
 #ifdef __GNUC__
 #define        __strong_reference(sym,aliassym)        \
        extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
index fc8e61716fa4deee80e13551fbd04691758fb256..2b1bb79c0a60517998d7235d7d3d045ebf6ac887 100644 (file)
 #endif
 
 #ifdef __STDC__
+#undef __P
 #define        __P(p)  p
 #else
 #define        __P(p)  ()
This page took 0.053029 seconds and 5 git commands to generate.