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:
Diffstat (limited to 'newlib/libc/reent')
-rw-r--r--newlib/libc/reent/Makefile.am40
-rw-r--r--newlib/libc/reent/Makefile.in104
-rw-r--r--newlib/libc/reent/execr.c20
-rw-r--r--newlib/libc/reent/fcntlr.c65
-rw-r--r--newlib/libc/reent/fstat64r.c72
-rw-r--r--newlib/libc/reent/getreent.c10
-rw-r--r--newlib/libc/reent/impure.c4
-rw-r--r--newlib/libc/reent/linkr.c8
-rw-r--r--newlib/libc/reent/lseek64r.c68
-rw-r--r--newlib/libc/reent/lseekr.c16
-rw-r--r--newlib/libc/reent/open64r.c69
-rw-r--r--newlib/libc/reent/openr.c10
-rw-r--r--newlib/libc/reent/readr.c22
-rw-r--r--newlib/libc/reent/reent.c41
-rw-r--r--newlib/libc/reent/reent.tex13
-rw-r--r--newlib/libc/reent/sbrkr.c12
-rw-r--r--newlib/libc/reent/signalr.c12
-rw-r--r--newlib/libc/reent/signgam.c4
-rw-r--r--newlib/libc/reent/statr.c8
-rw-r--r--newlib/libc/reent/timer.c14
-rw-r--r--newlib/libc/reent/unlinkr.c6
-rw-r--r--newlib/libc/reent/writer.c22
22 files changed, 141 insertions, 499 deletions
diff --git a/newlib/libc/reent/Makefile.am b/newlib/libc/reent/Makefile.am
index dd396c33c..c01ffb593 100644
--- a/newlib/libc/reent/Makefile.am
+++ b/newlib/libc/reent/Makefile.am
@@ -4,38 +4,12 @@ AUTOMAKE_OPTIONS = cygnus
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-if HAVE_STDIO64_DIR
-STDIO64_OBJECTS = \
- fstat64r.$(oext) \
- lseek64r.$(oext) \
- open64r.$(oext)
-
-STDIO64_DEFS = \
- fstat64r.def \
- lseek64r.def \
- open64r.def
-endif
-
-ELIX_2_OBJS = $(STDIO64_OBJECTS)
-ELIX_3_OBJS = execr.$(oext)
-
-if ELIX_LEVEL_1
-LIB_OBJS =
-else
-if ELIX_LEVEL_2
-LIB_OBJS = $(ELIX_2_OBJS)
-else
-LIB_OBJS = $(ELIX_2_OBJS) $(ELIX_3_OBJS)
-endif
-endif
-
-GENERAL_SOURCES = \
+LIB_SOURCES = \
closer.c \
reent.c \
impure.c \
- fcntlr.c \
+ execr.c \
fstatr.c \
- getreent.c \
linkr.c \
lseekr.c \
openr.c \
@@ -52,15 +26,11 @@ libreent_la_LDFLAGS = -Xcompiler -nostdlib
if USE_LIBTOOL
noinst_LTLIBRARIES = libreent.la
-libreent_la_SOURCES = $(GENERAL_SOURCES)
-libreent_la_LIBADD = $(LIB_OBJS)
-libreent_la_DEPENDENCIES = $(LIB_OBJS)
+libreent_la_SOURCES = $(LIB_SOURCES)
noinst_DATA = objectlist.awk.in
else
noinst_LIBRARIES = lib.a
-lib_a_SOURCES = $(GENERAL_SOURCES)
-lib_a_LIBADD = $(LIB_OBJS)
-lib_a_DEPENDENCIES = $(LIB_OBJS)
+lib_a_SOURCES = $(LIB_SOURCES)
noinst_DATA =
endif # USE_LIBTOOL
@@ -70,7 +40,6 @@ CHEWOUT_FILES = \
closer.def \
reent.def \
execr.def \
- fcntlr.def \
fstatr.def \
linkr.def \
lseekr.def \
@@ -81,7 +50,6 @@ CHEWOUT_FILES = \
statr.def \
timer.def \
unlinkr.def \
- $(STDIO64_DEFS) \
writer.def
SUFFIXES = .def .h
diff --git a/newlib/libc/reent/Makefile.in b/newlib/libc/reent/Makefile.in
index ab087bc67..dcd9ba71d 100644
--- a/newlib/libc/reent/Makefile.in
+++ b/newlib/libc/reent/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -58,32 +58,20 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-build_alias = @build_alias@
-build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
-target_alias = @target_alias@
-target_triplet = @target@
AR = @AR@
AS = @AS@
CC = @CC@
CPP = @CPP@
CRT0 = @CRT0@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
LDFLAGS = @LDFLAGS@
-LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@
-LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@
LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@
LIBC_POSIX_LIB = @LIBC_POSIX_LIB@
LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@
LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@
-LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@
-LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@
LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@
LIBC_SYS_LIB = @LIBC_SYS_LIB@
LIBC_UNIX_LIB = @LIBC_UNIX_LIB@
@@ -93,13 +81,10 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
-STRIP = @STRIP@
VERSION = @VERSION@
aext = @aext@
-extra_dir = @extra_dir@
libm_machine_dir = @libm_machine_dir@
machine_dir = @machine_dir@
newlib_basedir = @newlib_basedir@
@@ -110,33 +95,49 @@ AUTOMAKE_OPTIONS = cygnus
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-@HAVE_STDIO64_DIR_TRUE@STDIO64_OBJECTS = fstat64r.$(oext) lseek64r.$(oext) open64r.$(oext)
-
-@HAVE_STDIO64_DIR_TRUE@STDIO64_DEFS = fstat64r.def lseek64r.def open64r.def
-
-ELIX_2_OBJS = $(STDIO64_OBJECTS)
-ELIX_3_OBJS = execr.$(oext)
-@ELIX_LEVEL_1_TRUE@LIB_OBJS =
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@LIB_OBJS = $(ELIX_2_OBJS)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@LIB_OBJS = $(ELIX_2_OBJS) $(ELIX_3_OBJS)
-
-GENERAL_SOURCES = closer.c reent.c impure.c fcntlr.c fstatr.c getreent.c linkr.c lseekr.c openr.c readr.c signalr.c signgam.c sbrkr.c statr.c timer.c unlinkr.c writer.c
+LIB_SOURCES = \
+ closer.c \
+ reent.c \
+ impure.c \
+ execr.c \
+ fstatr.c \
+ linkr.c \
+ lseekr.c \
+ openr.c \
+ readr.c \
+ signalr.c \
+ signgam.c \
+ sbrkr.c \
+ statr.c \
+ timer.c \
+ unlinkr.c \
+ writer.c
libreent_la_LDFLAGS = -Xcompiler -nostdlib
-@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libreent.la
-@USE_LIBTOOL_TRUE@libreent_la_SOURCES = $(GENERAL_SOURCES)
-@USE_LIBTOOL_TRUE@libreent_la_LIBADD = $(LIB_OBJS)
-@USE_LIBTOOL_TRUE@libreent_la_DEPENDENCIES = $(LIB_OBJS)
-@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in
+@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = @USE_LIBTOOL_TRUE@libreent.la
+@USE_LIBTOOL_TRUE@libreent_la_SOURCES = @USE_LIBTOOL_TRUE@$(LIB_SOURCES)
+@USE_LIBTOOL_TRUE@noinst_DATA = @USE_LIBTOOL_TRUE@objectlist.awk.in
@USE_LIBTOOL_FALSE@noinst_DATA =
-@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
-@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(GENERAL_SOURCES)
-@USE_LIBTOOL_FALSE@lib_a_LIBADD = $(LIB_OBJS)
-@USE_LIBTOOL_FALSE@lib_a_DEPENDENCIES = $(LIB_OBJS)
-
-CHEWOUT_FILES = closer.def reent.def execr.def fcntlr.def fstatr.def linkr.def lseekr.def openr.def readr.def signalr.def sbrkr.def statr.def timer.def unlinkr.def $(STDIO64_DEFS) writer.def
+@USE_LIBTOOL_FALSE@noinst_LIBRARIES = @USE_LIBTOOL_FALSE@lib.a
+@USE_LIBTOOL_FALSE@lib_a_SOURCES = @USE_LIBTOOL_FALSE@$(LIB_SOURCES)
+
+CHEWOUT_FILES = \
+ closer.def \
+ reent.def \
+ execr.def \
+ fstatr.def \
+ linkr.def \
+ lseekr.def \
+ openr.def \
+ readr.def \
+ signalr.def \
+ sbrkr.def \
+ statr.def \
+ timer.def \
+ unlinkr.def \
+ writer.def
SUFFIXES = .def .h
@@ -154,18 +155,17 @@ LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
-@USE_LIBTOOL_FALSE@lib_a_OBJECTS = closer.$(OBJEXT) reent.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@impure.$(OBJEXT) fcntlr.$(OBJEXT) fstatr.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@getreent.$(OBJEXT) linkr.$(OBJEXT) lseekr.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@openr.$(OBJEXT) readr.$(OBJEXT) signalr.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@signgam.$(OBJEXT) sbrkr.$(OBJEXT) statr.$(OBJEXT) \
-@USE_LIBTOOL_FALSE@timer.$(OBJEXT) unlinkr.$(OBJEXT) writer.$(OBJEXT)
+lib_a_LIBADD =
+@USE_LIBTOOL_FALSE@lib_a_OBJECTS = closer.o reent.o impure.o execr.o \
+@USE_LIBTOOL_FALSE@fstatr.o linkr.o lseekr.o openr.o readr.o signalr.o \
+@USE_LIBTOOL_FALSE@signgam.o sbrkr.o statr.o timer.o unlinkr.o writer.o
LTLIBRARIES = $(noinst_LTLIBRARIES)
+libreent_la_LIBADD =
@USE_LIBTOOL_TRUE@libreent_la_OBJECTS = closer.lo reent.lo impure.lo \
-@USE_LIBTOOL_TRUE@fcntlr.lo fstatr.lo getreent.lo linkr.lo lseekr.lo \
-@USE_LIBTOOL_TRUE@openr.lo readr.lo signalr.lo signgam.lo sbrkr.lo \
-@USE_LIBTOOL_TRUE@statr.lo timer.lo unlinkr.lo writer.lo
+@USE_LIBTOOL_TRUE@execr.lo fstatr.lo linkr.lo lseekr.lo openr.lo \
+@USE_LIBTOOL_TRUE@readr.lo signalr.lo signgam.lo sbrkr.lo statr.lo \
+@USE_LIBTOOL_TRUE@timer.lo unlinkr.lo writer.lo
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -185,7 +185,7 @@ OBJECTS = $(lib_a_OBJECTS) $(libreent_la_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .def .h .lo .o .obj .s
+.SUFFIXES: .S .c .def .h .lo .o .s
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(srcdir)/../../Makefile.shared
cd $(top_srcdir) && $(AUTOMAKE) --cygnus reent/Makefile
@@ -206,11 +206,6 @@ maintainer-clean-noinstLIBRARIES:
.c.o:
$(COMPILE) -c $<
-# FIXME: We should only use cygpath when building on Windows,
-# and only if it is available.
-.c.obj:
- $(COMPILE) -c `cygpath -w $<`
-
.s.o:
$(COMPILE) -c $<
@@ -219,7 +214,6 @@ maintainer-clean-noinstLIBRARIES:
mostlyclean-compile:
-rm -f *.o core *.core
- -rm -f *.$(OBJEXT)
clean-compile:
diff --git a/newlib/libc/reent/execr.c b/newlib/libc/reent/execr.c
index 8bc1208d7..0fbddb94d 100644
--- a/newlib/libc/reent/execr.c
+++ b/newlib/libc/reent/execr.c
@@ -53,11 +53,11 @@ DESCRIPTION
*/
int
-_DEFUN (_execve_r, (ptr, name, argv, env),
- struct _reent *ptr _AND
- char *name _AND
- char **argv _AND
- char **env)
+_execve_r (ptr, name, argv, env)
+ struct _reent *ptr;
+ char *name;
+ char **argv;
+ char **env;
{
int ret;
@@ -93,8 +93,8 @@ DESCRIPTION
#ifndef NO_FORK
int
-_DEFUN (_fork_r, (ptr),
- struct _reent *ptr)
+_fork_r (ptr)
+ struct _reent *ptr;
{
int ret;
@@ -130,9 +130,9 @@ DESCRIPTION
*/
int
-_DEFUN (_wait_r, (ptr, status),
- struct _reent *ptr _AND
- int *status)
+_wait_r (ptr, status)
+ struct _reent *ptr;
+ int *status;
{
int ret;
diff --git a/newlib/libc/reent/fcntlr.c b/newlib/libc/reent/fcntlr.c
deleted file mode 100644
index d632d183f..000000000
--- a/newlib/libc/reent/fcntlr.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Reentrant versions of fcntl system call. This implementation just
- calls the fcntl system call. */
-
-#include <reent.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <_syslist.h>
-
-/* Some targets provides their own versions of these functions. Those
- targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
-
-#ifdef _REENT_ONLY
-#ifndef REENTRANT_SYSCALLS_PROVIDED
-#define REENTRANT_SYSCALLS_PROVIDED
-#endif
-#endif
-
-#ifndef REENTRANT_SYSCALLS_PROVIDED
-
-/* We use the errno variable used by the system dependent layer. */
-#undef errno
-extern int errno;
-
-/*
-FUNCTION
- <<_fcntl_r>>---Reentrant version of fcntl
-
-INDEX
- _fcntl_r
-
-ANSI_SYNOPSIS
- #include <reent.h>
- int _fcntl_r(struct _reent *<[ptr]>,
- int <[fd]>, int <[cmd]>, <[arg]>);
-
-TRAD_SYNOPSIS
- #include <reent.h>
- int _fcntl_r(<[ptr]>, <[fd]>, <[cmd]>, <[arg]>)
- struct _reent *<[ptr]>;
- int <[fd]>;
- int <[cmd]>;
- int <[arg]>;
-
-DESCRIPTION
- This is a reentrant version of <<fcntl>>. It
- takes a pointer to the global data block, which holds
- <<errno>>.
-*/
-
-int
-_DEFUN (_fcntl_r, (ptr, fd, cmd, arg),
- struct _reent *ptr _AND
- int fd _AND
- int cmd _AND
- int arg)
-{
- int ret;
-
- errno = 0;
- if ((ret = _fcntl (fd, cmd, arg)) == -1 && errno != 0)
- ptr->_errno = errno;
- return ret;
-}
-
-#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
diff --git a/newlib/libc/reent/fstat64r.c b/newlib/libc/reent/fstat64r.c
deleted file mode 100644
index 1c4589713..000000000
--- a/newlib/libc/reent/fstat64r.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Reentrant versions of fstat system call. This implementation just
- calls the fstat system call. */
-
-#include <reent.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <_syslist.h>
-
-#ifdef __LARGE64_FILES
-
-/* Some targets provides their own versions of these functions. Those
- targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
-
-#ifdef _REENT_ONLY
-#ifndef REENTRANT_SYSCALLS_PROVIDED
-#define REENTRANT_SYSCALLS_PROVIDED
-#endif
-#endif
-
-#ifdef REENTRANT_SYSCALLS_PROVIDED
-
-int _dummy_fstat_syscalls = 1;
-
-#else
-
-/* We use the errno variable used by the system dependent layer. */
-#undef errno
-extern int errno;
-
-/*
-FUNCTION
- <<_fstat64_r>>---Reentrant version of fstat64
-
-INDEX
- _fstat64_r
-
-ANSI_SYNOPSIS
- #include <reent.h>
- int _fstat64_r(struct _reent *<[ptr]>,
- int <[fd]>, struct stat64 *<[pstat]>);
-
-TRAD_SYNOPSIS
- #include <reent.h>
- int _fstat64_r(<[ptr]>, <[fd]>, <[pstat]>)
- struct _reent *<[ptr]>;
- int <[fd]>;
- struct stat *<[pstat]>;
-
-DESCRIPTION
- This is a reentrant version of <<fstat64>>. It
- takes a pointer to the global data block, which holds
- <<errno>>. This function is only enabled on systems
- that define __LARGE64_FILES.
-*/
-
-int
-_DEFUN (_fstat64_r, (ptr, fd, pstat),
- struct _reent *ptr _AND
- int fd _AND
- struct stat64 *pstat)
-{
- int ret;
-
- errno = 0;
- if ((ret = _fstat64 (fd, pstat)) == -1 && errno != 0)
- ptr->_errno = errno;
- return ret;
-}
-
-#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
-
-#endif /* __LARGE64_FILES */
diff --git a/newlib/libc/reent/getreent.c b/newlib/libc/reent/getreent.c
deleted file mode 100644
index b53ff26c8..000000000
--- a/newlib/libc/reent/getreent.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* default reentrant pointer when multithread enabled */
-
-#include <_ansi.h>
-#include <reent.h>
-
-struct _reent *
-_DEFUN_VOID(__getreent)
-{
- return _impure_ptr;
-}
diff --git a/newlib/libc/reent/impure.c b/newlib/libc/reent/impure.c
index 12ee7177b..a14f5c3cd 100644
--- a/newlib/libc/reent/impure.c
+++ b/newlib/libc/reent/impure.c
@@ -10,8 +10,4 @@
#endif
static struct _reent __ATTRIBUTE_IMPURE_DATA__ impure_data = _REENT_INIT (impure_data);
-#ifdef __CYGWIN__
-extern struct _reent reent_data __attribute__ ((alias("impure_data")));
-#endif
struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &impure_data;
-struct _reent *_CONST __ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &impure_data;
diff --git a/newlib/libc/reent/linkr.c b/newlib/libc/reent/linkr.c
index ded636af7..eda8d038c 100644
--- a/newlib/libc/reent/linkr.c
+++ b/newlib/libc/reent/linkr.c
@@ -50,10 +50,10 @@ DESCRIPTION
*/
int
-_DEFUN (_link_r, (ptr, old, new),
- struct _reent *ptr _AND
- _CONST char *old _AND
- _CONST char *new)
+_link_r (ptr, old, new)
+ struct _reent *ptr;
+ _CONST char *old;
+ _CONST char *new;
{
int ret;
diff --git a/newlib/libc/reent/lseek64r.c b/newlib/libc/reent/lseek64r.c
deleted file mode 100644
index 0207a1220..000000000
--- a/newlib/libc/reent/lseek64r.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Reentrant versions of lseek system call. */
-
-#include <reent.h>
-#include <unistd.h>
-#include <_syslist.h>
-
-/* Some targets provides their own versions of this functions. Those
- targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
-
-#ifdef __LARGE64_FILES
-
-#ifdef _REENT_ONLY
-#ifndef REENTRANT_SYSCALLS_PROVIDED
-#define REENTRANT_SYSCALLS_PROVIDED
-#endif
-#endif
-
-#ifndef REENTRANT_SYSCALLS_PROVIDED
-
-/* We use the errno variable used by the system dependent layer. */
-#undef errno
-extern int errno;
-
-/*
-FUNCTION
- <<_lseek64_r>>---Reentrant version of lseek
-
-INDEX
- _lseek64_r
-
-ANSI_SYNOPSIS
- #include <reent.h>
- off64_t _lseek64_r(struct _reent *<[ptr]>,
- int <[fd]>, off64_t <[pos]>, int <[whence]>);
-
-TRAD_SYNOPSIS
- #include <reent.h>
- off64_t _lseek64_r(<[ptr]>, <[fd]>, <[pos]>, <[whence]>)
- struct _reent *<[ptr]>;
- int <[fd]>;
- off64_t <[pos]>;
- int <[whence]>;
-
-DESCRIPTION
- This is a reentrant version of <<lseek64>>. It
- takes a pointer to the global data block, which holds
- <<errno>>. This function only exists on a system
- with large file support.
-*/
-
-_off64_t
-_DEFUN (_lseek64_r, (ptr, fd, pos, whence),
- struct _reent *ptr _AND
- int fd _AND
- _off64_t pos _AND
- int whence)
-{
- _off64_t ret;
-
- errno = 0;
- if ((ret = _lseek64 (fd, pos, whence)) == (_off64_t) -1 && errno != 0)
- ptr->_errno = errno;
- return ret;
-}
-
-#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
-
-#endif /* __LARGE64_FILES */
diff --git a/newlib/libc/reent/lseekr.c b/newlib/libc/reent/lseekr.c
index fa00695a8..ed8ba13ed 100644
--- a/newlib/libc/reent/lseekr.c
+++ b/newlib/libc/reent/lseekr.c
@@ -45,17 +45,17 @@ DESCRIPTION
<<errno>>.
*/
-_off_t
-_DEFUN (_lseek_r, (ptr, fd, pos, whence),
- struct _reent *ptr _AND
- int fd _AND
- _off_t pos _AND
- int whence)
+off_t
+_lseek_r (ptr, fd, pos, whence)
+ struct _reent *ptr;
+ int fd;
+ off_t pos;
+ int whence;
{
- _off_t ret;
+ off_t ret;
errno = 0;
- if ((ret = _lseek (fd, pos, whence)) == (_off_t) -1 && errno != 0)
+ if ((ret = _lseek (fd, pos, whence)) == (off_t) -1 && errno != 0)
ptr->_errno = errno;
return ret;
}
diff --git a/newlib/libc/reent/open64r.c b/newlib/libc/reent/open64r.c
deleted file mode 100644
index 30310d301..000000000
--- a/newlib/libc/reent/open64r.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Reentrant versions of open system call. */
-
-#include <reent.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <_syslist.h>
-
-#ifdef __LARGE64_FILES
-
-/* Some targets provides their own versions of this functions. Those
- targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
-
-#ifdef _REENT_ONLY
-#ifndef REENTRANT_SYSCALLS_PROVIDED
-#define REENTRANT_SYSCALLS_PROVIDED
-#endif
-#endif
-
-#ifndef REENTRANT_SYSCALLS_PROVIDED
-
-/* We use the errno variable used by the system dependent layer. */
-#undef errno
-extern int errno;
-
-/*
-FUNCTION
- <<_open64_r>>---Reentrant version of open64
-
-INDEX
- _open64_r
-
-ANSI_SYNOPSIS
- #include <reent.h>
- int _open64_r(struct _reent *<[ptr]>,
- const char *<[file]>, int <[flags]>, int <[mode]>);
-
-TRAD_SYNOPSIS
- #include <reent.h>
- int _open64_r(<[ptr]>, <[file]>, <[flags]>, <[mode]>)
- struct _reent *<[ptr]>;
- char *<[file]>;
- int <[flags]>;
- int <[mode]>;
-
-DESCRIPTION
- This is a reentrant version of <<open64>>. It
- takes a pointer to the global data block, which holds
- <<errno>>. This function only exists on systems with
- large file support.
-*/
-
-int
-_open64_r (ptr, file, flags, mode)
- struct _reent *ptr;
- _CONST char *file;
- int flags;
- int mode;
-{
- int ret;
-
- errno = 0;
- if ((ret = _open64 (file, flags, mode)) == -1 && errno != 0)
- ptr->_errno = errno;
- return ret;
-}
-
-#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
-
-#endif /* __LARGE64_FILES */
diff --git a/newlib/libc/reent/openr.c b/newlib/libc/reent/openr.c
index 35138c6de..c77310394 100644
--- a/newlib/libc/reent/openr.c
+++ b/newlib/libc/reent/openr.c
@@ -47,11 +47,11 @@ DESCRIPTION
*/
int
-_DEFUN (_open_r, (ptr, file, flags, mode),
- struct _reent *ptr _AND
- _CONST char *file _AND
- int flags _AND
- int mode)
+_open_r (ptr, file, flags, mode)
+ struct _reent *ptr;
+ _CONST char *file;
+ int flags;
+ int mode;
{
int ret;
diff --git a/newlib/libc/reent/readr.c b/newlib/libc/reent/readr.c
index 38c1d9e39..e3deca9a7 100644
--- a/newlib/libc/reent/readr.c
+++ b/newlib/libc/reent/readr.c
@@ -28,12 +28,12 @@ INDEX
ANSI_SYNOPSIS
#include <reent.h>
- _ssize_t _read_r(struct _reent *<[ptr]>,
- int <[fd]>, void *<[buf]>, size_t <[cnt]>);
+ long _read_r(struct _reent *<[ptr]>,
+ int <[fd]>, void *<[buf]>, size_t <[cnt]>);
TRAD_SYNOPSIS
#include <reent.h>
- _ssize_t _read_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>)
+ long _read_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>)
struct _reent *<[ptr]>;
int <[fd]>;
char *<[buf]>;
@@ -45,17 +45,17 @@ DESCRIPTION
<<errno>>.
*/
-_ssize_t
-_DEFUN (_read_r, (ptr, fd, buf, cnt),
- struct _reent *ptr _AND
- int fd _AND
- _PTR buf _AND
- size_t cnt)
+long
+_read_r (ptr, fd, buf, cnt)
+ struct _reent *ptr;
+ int fd;
+ _PTR buf;
+ size_t cnt;
{
- _ssize_t ret;
+ long ret;
errno = 0;
- if ((ret = (_ssize_t)_read (fd, buf, cnt)) == -1 && errno != 0)
+ if ((ret = _read (fd, buf, cnt)) == -1 && errno != 0)
ptr->_errno = errno;
return ret;
}
diff --git a/newlib/libc/reent/reent.c b/newlib/libc/reent/reent.c
index ddf6a8267..f35d95711 100644
--- a/newlib/libc/reent/reent.c
+++ b/newlib/libc/reent/reent.c
@@ -30,9 +30,9 @@ int errno;
/* Interim cleanup code */
void
-_DEFUN (cleanup_glue, (ptr, glue),
- struct _reent *ptr _AND
- struct _glue *glue)
+cleanup_glue (ptr, glue)
+ struct _reent *ptr;
+ struct _glue *glue;
{
/* Have to reclaim these in reverse order: */
if (glue->_next)
@@ -42,23 +42,20 @@ _DEFUN (cleanup_glue, (ptr, glue),
}
void
-_DEFUN (_reclaim_reent, (ptr),
- struct _reent *ptr)
+_reclaim_reent (ptr)
+ struct _reent *ptr;
{
if (ptr != _impure_ptr)
{
/* used by mprec routines. */
-#ifdef _REENT_SMALL
- if (ptr->_mp) /* don't bother allocating it! */
-#endif
- if (_REENT_MP_FREELIST(ptr))
+ if (ptr->_freelist)
{
int i;
for (i = 0; i < 15 /* _Kmax */; i++)
{
struct _Bigint *thisone, *nextone;
- nextone = _REENT_MP_FREELIST(ptr)[i];
+ nextone = ptr->_freelist[i];
while (nextone)
{
thisone = nextone;
@@ -67,23 +64,9 @@ _DEFUN (_reclaim_reent, (ptr),
}
}
- _free_r (ptr, _REENT_MP_FREELIST(ptr));
+ _free_r (ptr, ptr->_freelist);
}
-#ifdef _REENT_SMALL
- if (ptr->_emergency)
- _free_r (ptr, ptr->_emergency);
- if (ptr->_mp)
- _free_r (ptr, ptr->_mp);
- if (ptr->_r48)
- _free_r (ptr, ptr->_r48);
- if (ptr->_localtime_buf)
- _free_r (ptr, ptr->_localtime_buf);
- if (ptr->_asctime_buf)
- _free_r (ptr, ptr->_asctime_buf);
- if (ptr->_atexit->_on_exit_args_ptr)
- _free_r (ptr, ptr->_atexit->_on_exit_args_ptr);
-#else
/* atexit stuff */
if ((ptr->_atexit) && (ptr->_atexit != &ptr->_atexit0))
{
@@ -95,7 +78,6 @@ _DEFUN (_reclaim_reent, (ptr),
_free_r (ptr, q);
}
}
-#endif
if (ptr->_cvtbuf)
_free_r (ptr, ptr->_cvtbuf);
@@ -123,7 +105,7 @@ _DEFUN (_reclaim_reent, (ptr),
*/
void
-_DEFUN (_wrapup_reent, (ptr), struct _reent *ptr)
+_wrapup_reent(struct _reent *ptr)
{
register struct _atexit *p;
register int n;
@@ -131,14 +113,9 @@ _DEFUN (_wrapup_reent, (ptr), struct _reent *ptr)
if (ptr == 0)
ptr = _REENT;
-#ifdef _REENT_SMALL
- for (p = &ptr->_atexit, n = p->_ind; --n >= 0;)
- (*p->_fns[n]) ();
-#else
for (p = ptr->_atexit; p; p = p->_next)
for (n = p->_ind; --n >= 0;)
(*p->_fns[n]) ();
-#endif
if (ptr->__cleanup)
(*ptr->__cleanup) (ptr);
}
diff --git a/newlib/libc/reent/reent.tex b/newlib/libc/reent/reent.tex
index 881c572c6..71a0a0dcd 100644
--- a/newlib/libc/reent/reent.tex
+++ b/newlib/libc/reent/reent.tex
@@ -4,8 +4,8 @@
@cindex reentrancy
Reentrancy is a characteristic of library functions which allows multiple
processes to use the same address space with assurance that the values stored
-in those spaces will remain constant between calls. The Red Hat
-newlib implementation of the library functions ensures that
+in those spaces will remain constant between calls. Cygnus's implementation
+of the library functions ensures that
whenever possible, these library functions are reentrant. However,
there are some functions that can not be trivially made reentrant.
Hooks have been provided to allow you to use these functions in a fully
@@ -29,10 +29,6 @@ and @var{mode}, and uses the global reentrancy structure. The function
pointer to an instance of the reentrancy structure, @var{file}
and @var{mode}.
-There are two versions of @samp{struct _reent}, a normal one and one
-for small memory systems, controlled by the @code{_REENT_SMALL}
-definition from the (automatically included) @file{<sys/config.h>}.
-
@cindex global reentrancy structure
@findex _impure_ptr
Each function which uses the global reentrancy structure uses the global
@@ -107,11 +103,6 @@ _fstat_r _sbrk_r
_gettimeofday_r _stat_r
_getpid_r _times_r
-@ifset STDIO64
-@exdent @emph{Additional 64-bit I/O System functions:}
-_fstat64_r _lseek64_r _open64_r
-@end ifset
-
@exdent @emph{Time function:}
_asctime_r
@end example
diff --git a/newlib/libc/reent/sbrkr.c b/newlib/libc/reent/sbrkr.c
index b963307b6..31c9de3d5 100644
--- a/newlib/libc/reent/sbrkr.c
+++ b/newlib/libc/reent/sbrkr.c
@@ -34,13 +34,13 @@ INDEX
ANSI_SYNOPSIS
#include <reent.h>
- void *_sbrk_r(struct _reent *<[ptr]>, ptrdiff_t <[incr]>);
+ void *_sbrk_r(struct _reent *<[ptr]>, size_t <[incr]>);
TRAD_SYNOPSIS
#include <reent.h>
void *_sbrk_r(<[ptr]>, <[incr]>)
struct _reent *<[ptr]>;
- ptrdiff_t <[incr]>;
+ size_t <[incr]>;
DESCRIPTION
This is a reentrant version of <<sbrk>>. It
@@ -49,12 +49,12 @@ DESCRIPTION
*/
void *
-_DEFUN (_sbrk_r, (ptr, incr),
- struct _reent *ptr _AND
- ptrdiff_t incr)
+_sbrk_r (ptr, incr)
+ struct _reent *ptr;
+ size_t incr;
{
char *ret;
- void *_sbrk(ptrdiff_t);
+ void *_sbrk(size_t);
errno = 0;
if ((ret = (char *)(_sbrk (incr))) == (void *) -1 && errno != 0)
diff --git a/newlib/libc/reent/signalr.c b/newlib/libc/reent/signalr.c
index 7d8aa7d71..3ac3e2cf8 100644
--- a/newlib/libc/reent/signalr.c
+++ b/newlib/libc/reent/signalr.c
@@ -50,10 +50,10 @@ DESCRIPTION
*/
int
-_DEFUN (_kill_r, (ptr, pid, sig),
- struct _reent *ptr _AND
- int pid _AND
- int sig)
+_kill_r (ptr, pid, sig)
+ struct _reent *ptr;
+ int pid;
+ int sig;
{
int ret;
@@ -89,8 +89,8 @@ DESCRIPTION
*/
int
-_DEFUN (_getpid_r, (ptr),
- struct _reent *ptr)
+_getpid_r (ptr)
+ struct _reent *ptr;
{
int ret;
ret = _getpid ();
diff --git a/newlib/libc/reent/signgam.c b/newlib/libc/reent/signgam.c
index bfb2dea51..905386686 100644
--- a/newlib/libc/reent/signgam.c
+++ b/newlib/libc/reent/signgam.c
@@ -8,9 +8,9 @@
#ifndef _REENT_ONLY
int *
-_DEFUN_VOID (__signgam)
+__signgam ()
{
- return &_REENT_SIGNGAM(_REENT);
+ return &_REENT->_new._reent._gamma_signgam;
}
#endif
diff --git a/newlib/libc/reent/statr.c b/newlib/libc/reent/statr.c
index 9ad2bb209..48a377344 100644
--- a/newlib/libc/reent/statr.c
+++ b/newlib/libc/reent/statr.c
@@ -52,10 +52,10 @@ DESCRIPTION
*/
int
-_DEFUN (_stat_r, (ptr, file, pstat),
- struct _reent *ptr _AND
- _CONST char *file _AND
- struct stat *pstat)
+_stat_r (ptr, file, pstat)
+ struct _reent *ptr;
+ _CONST char *file;
+ struct stat *pstat;
{
int ret;
diff --git a/newlib/libc/reent/timer.c b/newlib/libc/reent/timer.c
index b604b90f3..689595249 100644
--- a/newlib/libc/reent/timer.c
+++ b/newlib/libc/reent/timer.c
@@ -55,9 +55,9 @@ DESCRIPTION
*/
clock_t
-_DEFUN (_times_r, (ptr, ptms),
- struct _reent *ptr _AND
- struct tms *ptms)
+_times_r (ptr, ptms)
+ struct _reent *ptr;
+ struct tms *ptms;
{
clock_t ret;
@@ -97,10 +97,10 @@ DESCRIPTION
*/
int
-_DEFUN (_gettimeofday_r, (ptr, ptimeval, ptimezone),
- struct _reent *ptr _AND
- struct timeval *ptimeval _AND
- struct timezone *ptimezone)
+_gettimeofday_r (ptr, ptimeval, ptimezone)
+ struct _reent *ptr;
+ struct timeval *ptimeval;
+ struct timezone *ptimezone;
{
int ret;
diff --git a/newlib/libc/reent/unlinkr.c b/newlib/libc/reent/unlinkr.c
index 95b815f1b..dbfc7e667 100644
--- a/newlib/libc/reent/unlinkr.c
+++ b/newlib/libc/reent/unlinkr.c
@@ -44,9 +44,9 @@ DESCRIPTION
*/
int
-_DEFUN (_unlink_r, (ptr, file),
- struct _reent *ptr _AND
- _CONST char *file)
+_unlink_r (ptr, file)
+ struct _reent *ptr;
+ _CONST char *file;
{
int ret;
diff --git a/newlib/libc/reent/writer.c b/newlib/libc/reent/writer.c
index 128f7f7ac..ac10286e8 100644
--- a/newlib/libc/reent/writer.c
+++ b/newlib/libc/reent/writer.c
@@ -28,12 +28,12 @@ INDEX
ANSI_SYNOPSIS
#include <reent.h>
- _ssize_t _write_r(struct _reent *<[ptr]>,
- int <[fd]>, const void *<[buf]>, size_t <[cnt]>);
+ long _write_r(struct _reent *<[ptr]>,
+ int <[fd]>, const void *<[buf]>, size_t <[cnt]>);
TRAD_SYNOPSIS
#include <reent.h>
- _ssize_t _write_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>)
+ long _write_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>)
struct _reent *<[ptr]>;
int <[fd]>;
char *<[buf]>;
@@ -45,17 +45,17 @@ DESCRIPTION
<<errno>>.
*/
-_ssize_t
-_DEFUN (_write_r, (ptr, fd, buf, cnt),
- struct _reent *ptr _AND
- int fd _AND
- _CONST _PTR buf _AND
- size_t cnt)
+long
+_write_r (ptr, fd, buf, cnt)
+ struct _reent *ptr;
+ int fd;
+ _CONST _PTR buf;
+ size_t cnt;
{
- _ssize_t ret;
+ long ret;
errno = 0;
- if ((ret = (_ssize_t)_write (fd, buf, cnt)) == -1 && errno != 0)
+ if ((ret = _write (fd, buf, cnt)) == -1 && errno != 0)
ptr->_errno = errno;
return ret;
}