Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-06-28 02:48:05 +0400
committerJeff Johnston <jjohnstn@redhat.com>2002-06-28 02:48:05 +0400
commit533b4e664428a0ddd218eb62f0dc78f0a87ff079 (patch)
tree0365a7f691b361fcf0a9793b7b5c7d33a5a95149
parentbf75aae8b39dfe7a23c21389e84daa5a35a03ae9 (diff)
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.
-rw-r--r--newlib/ChangeLog14
-rw-r--r--newlib/libc/include/sys/_types.h5
-rw-r--r--newlib/libc/include/sys/types.h5
-rw-r--r--newlib/libc/reent/readr.c12
-rw-r--r--newlib/libc/reent/writer.c12
-rw-r--r--newlib/libc/sys/linux/Makefile.am1
-rw-r--r--newlib/libc/sys/linux/Makefile.in22
-rw-r--r--newlib/libc/sys/linux/aio.c67
-rw-r--r--newlib/libc/sys/linux/sys/cdefs.h2
-rw-r--r--newlib/libm/common/fdlibm.h1
10 files changed, 118 insertions, 23 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 040d3bf7c..66461ef1e 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -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
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 8186f2d9d..a2f6e3929 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -10,6 +10,11 @@
#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 */
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 13e12a9df..c562a23b4 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -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;
diff --git a/newlib/libc/reent/readr.c b/newlib/libc/reent/readr.c
index e3deca9a7..b05cbe2ab 100644
--- a/newlib/libc/reent/readr.c
+++ b/newlib/libc/reent/readr.c
@@ -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;
}
diff --git a/newlib/libc/reent/writer.c b/newlib/libc/reent/writer.c
index ac10286e8..7ede74fcc 100644
--- a/newlib/libc/reent/writer.c
+++ b/newlib/libc/reent/writer.c
@@ -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;
}
diff --git a/newlib/libc/sys/linux/Makefile.am b/newlib/libc/sys/linux/Makefile.am
index a21963ca6..6f05fc881 100644
--- a/newlib/libc/sys/linux/Makefile.am
+++ b/newlib/libc/sys/linux/Makefile.am
@@ -10,6 +10,7 @@ SUBLIBS = \
$(LINUX_MACH_LIB)
LIB_SOURCES = \
+ aio.c \
brk.c \
cfspeed.c \
clock_getres.c \
diff --git a/newlib/libc/sys/linux/Makefile.in b/newlib/libc/sys/linux/Makefile.in
index f740b67a1..4b7df11c6 100644
--- a/newlib/libc/sys/linux/Makefile.in
+++ b/newlib/libc/sys/linux/Makefile.in
@@ -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
index 000000000..7351a0342
--- /dev/null
+++ b/newlib/libc/sys/linux/aio.c
@@ -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;
+}
diff --git a/newlib/libc/sys/linux/sys/cdefs.h b/newlib/libc/sys/linux/sys/cdefs.h
index f0b6a27b4..1108a7dab 100644
--- a/newlib/libc/sys/linux/sys/cdefs.h
+++ b/newlib/libc/sys/linux/sys/cdefs.h
@@ -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)));
diff --git a/newlib/libm/common/fdlibm.h b/newlib/libm/common/fdlibm.h
index fc8e61716..2b1bb79c0 100644
--- a/newlib/libm/common/fdlibm.h
+++ b/newlib/libm/common/fdlibm.h
@@ -124,6 +124,7 @@
#endif
#ifdef __STDC__
+#undef __P
#define __P(p) p
#else
#define __P(p) ()