aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1996-12-12 03:24:48 +0000
committerUlrich Drepper <drepper@redhat.com>1996-12-12 03:24:48 +0000
commitf8b87ef0d47ea0db7304a9c59d5479aebdaea347 (patch)
treeba0101df45ef63d6dc7321d4bdb91ee761c915da
parent6259ec0d78fd301572fcb616fdfa0500b828a824 (diff)
downloadglibc-f8b87ef0d47ea0db7304a9c59d5479aebdaea347.tar.xz
glibc-f8b87ef0d47ea0db7304a9c59d5479aebdaea347.zip
update from main archive 961211cvs/libc-961214cvs/libc-961213cvs/libc-961212
Thu Dec 12 03:32:21 1996 Ulrich Drepper <drepper@cygnus.com> * libio/_G_config.h: Add definition of _G_int16_t, _G_int32_t, _G_uint16_t, _G_uin32_t, _G_HAVE_BOOL, _G_HAVE_MMAP, and _G_ARGS. Change libio buffer handling to allocate internal buffers using mmap if possible. * libio/filedoalloc.c (_IO_file_doallocate): Change call to ALLOC_BUF. * libio/genops.c (_IO_setb, _IO_default_finish): Change call to FREE_BUF. (_IO_default_doallocate): Change call to ALLOC_BUF. * libio/libioP.h: Change definition of ALLOC_BUF and FREE_BUF to use mmap/munmap when possible. * libio/memstream.c: Don't use ALLOC_BUF, but directly malloc. * libio/vasprintf.c: Likewise. Patch by HJ Lu. * libio/libio.h: Define NULL as __null only for gcc-2.8 and up. * libio/libioP.h: Likewise. * libio/fileops.c (_IO_file_read, _IO_file_write): Don't restart syscall when EINTR was returned. Necessary for POSIX.1. * libio/strops.c (_IO_str_overflow): Add cast to prevent warning. * new-malloc/malloc.c (heap_trim): Correctly place parentheses to prevent warnings. * nis/Makefile: Remove rules for bsd-tools which are not part of glibc. Patch by Thorsten Kukuk. * nis/ypclnt.c: Add prototype for xdr_free. Add const to first parameter for __yp_bind. * nis/nss_compat/compat-pwd.c (getpwent_next_netgr, getpwent_next_nis, getpwent_next_file): Variable `p2len' must have type size_t. * nis/nss_nis/nis-alias.c: Add casts to prevent warnings. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise. * nis/rpcsvc/yp_prot.h (ypreq_key): Change type of members to `const char *'. (ypmaplist): Change member names to `map' and `next' and provide #defines for old names. Patch by Thorsten Kukuk. * nss/nss_files/files-parse.c (parse_line, parse_list): Change type for `datalen' parameter to size_t. * shsdow/lckpwdf.c: Use fcntl forlocking, not flock. * stdio-common/printf.c [USE_IN_LIBIO]: Provide alias _IO_printf for printf. * stdio-common/sscanf.c [USE_IN_LIBIO]: Provide alias _IO_sscanf for sscanf. Patch by HJ Lu. * stdio-common/tmpfile.c: Update copyright. * stdio-common/vfscanf.c: Correctly handle EINTR error from fgetc function. Don't eat white space for `C' format. * stdlib/tst-strtol.c [~0UL != 0xffffffff]: Fix typo in test data. * sysdeps/generic/abort.c: Update copyright. De-ANSI-declfy. * sysdeps/i386/abort.c: Removed. This version does not use signal SIGABRT. * sysdeps/i386/fpu/__math.h: Define __NO_MATH_INLINES if not using gcc-2.8 or up. Patch by HJ Lu. * sysdeps/posix/tempname.c: Test for error but EEXIST after open call. If EMFILE, ENFILE, or EINTR return with error. Wed Dec 11 14:43:52 1996 Ulrich Drepper <drepper@cygnus.com> * gnu-versions.h: Set _GNU_OBSTACK_INTERFACE_VERSION back to 1. We are compatible again. * new-malloc/obstack.h (struct obstack): Add back alloc_failed bit even though it is not used. * malloc/obstack.h: Likewise. * new-malloc/obstack.c (_obstack_begin, _obstack_begin_1): Initialize alloc_failed bit to 0. * time/strftime.c: Extend for Emacs' needs. Recognize field width, %P format and `0' modifier. Tue Dec 10 21:20:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makerules (make-link): Don't discard exit codes of intermediate commands. Always use rellns-sh if symbolic links are available. Tue Dec 10 20:09:51 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/netinet/in.h: Enclose #include <linux/in.h> in __BEGIN_DECLS/__END_DECLS to avoid linkage conflict of ntohs etc. in <asm/byteorder.h>.
-rw-r--r--ChangeLog109
-rw-r--r--Makerules12
-rw-r--r--gnu-versions.h2
-rw-r--r--libio/_G_config.h14
-rw-r--r--libio/filedoalloc.c4
-rw-r--r--libio/fileops.c4
-rw-r--r--libio/genops.c10
-rw-r--r--libio/libio.h3
-rw-r--r--libio/libioP.h51
-rw-r--r--libio/memstream.c4
-rw-r--r--libio/strops.c2
-rw-r--r--libio/vasprintf.c11
-rw-r--r--malloc/malloc.c2
-rw-r--r--malloc/obstack.c4
-rw-r--r--malloc/obstack.h3
-rw-r--r--nis/Makefile18
-rw-r--r--nis/nss_compat/compat-pwd.c8
-rw-r--r--nis/nss_nis/nis-alias.c4
-rw-r--r--nis/nss_nis/nis-ethers.c6
-rw-r--r--nis/nss_nis/nis-grp.c6
-rw-r--r--nis/nss_nis/nis-hosts.c6
-rw-r--r--nis/nss_nis/nis-network.c6
-rw-r--r--nis/nss_nis/nis-proto.c6
-rw-r--r--nis/nss_nis/nis-pwd.c6
-rw-r--r--nis/nss_nis/nis-rpc.c4
-rw-r--r--nis/nss_nis/nis-service.c9
-rw-r--r--nis/nss_nis/nis-spwd.c4
-rw-r--r--nis/rpcsvc/yp_prot.h28
-rw-r--r--nis/ypclnt.c4
-rw-r--r--nss/nss_files/files-parse.c8
-rw-r--r--shadow/lckpwdf.c8
-rw-r--r--stdio-common/printf.c37
-rw-r--r--stdio-common/sscanf.c34
-rw-r--r--stdio-common/tmpfile.c32
-rw-r--r--stdio-common/vfscanf.c36
-rw-r--r--stdlib/tst-strtol.c2
-rw-r--r--sysdeps/generic/abort.c37
-rw-r--r--sysdeps/i386/abort.c28
-rw-r--r--sysdeps/i386/fpu/__math.h41
-rw-r--r--sysdeps/posix/tempname.c16
-rw-r--r--sysdeps/unix/sysv/linux/netinet/in.h3
-rw-r--r--time/strftime.c102
42 files changed, 500 insertions, 234 deletions
diff --git a/ChangeLog b/ChangeLog
index c67e8d1978..4e03465175 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,112 @@
+Thu Dec 12 03:32:21 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * libio/_G_config.h: Add definition of _G_int16_t, _G_int32_t,
+ _G_uint16_t, _G_uin32_t, _G_HAVE_BOOL, _G_HAVE_MMAP, and
+ _G_ARGS.
+
+ Change libio buffer handling to allocate internal buffers using
+ mmap if possible.
+ * libio/filedoalloc.c (_IO_file_doallocate): Change call to
+ ALLOC_BUF.
+ * libio/genops.c (_IO_setb, _IO_default_finish): Change call
+ to FREE_BUF.
+ (_IO_default_doallocate): Change call to ALLOC_BUF.
+ * libio/libioP.h: Change definition of ALLOC_BUF and FREE_BUF
+ to use mmap/munmap when possible.
+ * libio/memstream.c: Don't use ALLOC_BUF, but directly malloc.
+ * libio/vasprintf.c: Likewise.
+ Patch by HJ Lu.
+
+ * libio/libio.h: Define NULL as __null only for gcc-2.8 and up.
+ * libio/libioP.h: Likewise.
+
+ * libio/fileops.c (_IO_file_read, _IO_file_write): Don't
+ restart syscall when EINTR was returned. Necessary for POSIX.1.
+
+ * libio/strops.c (_IO_str_overflow): Add cast to prevent warning.
+
+ * new-malloc/malloc.c (heap_trim): Correctly place parentheses to
+ prevent warnings.
+
+ * nis/Makefile: Remove rules for bsd-tools which are not part
+ of glibc.
+ Patch by Thorsten Kukuk.
+
+ * nis/ypclnt.c: Add prototype for xdr_free.
+ Add const to first parameter for __yp_bind.
+ * nis/nss_compat/compat-pwd.c (getpwent_next_netgr, getpwent_next_nis,
+ getpwent_next_file): Variable `p2len' must have type size_t.
+ * nis/nss_nis/nis-alias.c: Add casts to prevent warnings.
+ * nis/nss_nis/nis-ethers.c: Likewise.
+ * nis/nss_nis/nis-grp.c: Likewise.
+ * nis/nss_nis/nis-hosts.c: Likewise.
+ * nis/nss_nis/nis-network.c: Likewise.
+ * nis/nss_nis/nis-proto.c: Likewise.
+ * nis/nss_nis/nis-pwd.c: Likewise.
+ * nis/nss_nis/nis-rpc.c: Likewise.
+ * nis/nss_nis/nis-service.c: Likewise.
+ * nis/nss_nis/nis-spwd.c: Likewise.
+
+ * nis/rpcsvc/yp_prot.h (ypreq_key): Change type of members to
+ `const char *'.
+ (ypmaplist): Change member names to `map' and `next' and provide
+ #defines for old names.
+ Patch by Thorsten Kukuk.
+
+ * nss/nss_files/files-parse.c (parse_line, parse_list): Change
+ type for `datalen' parameter to size_t.
+
+ * shsdow/lckpwdf.c: Use fcntl forlocking, not flock.
+
+ * stdio-common/printf.c [USE_IN_LIBIO]: Provide alias _IO_printf
+ for printf.
+ * stdio-common/sscanf.c [USE_IN_LIBIO]: Provide alias _IO_sscanf
+ for sscanf.
+ Patch by HJ Lu.
+
+ * stdio-common/tmpfile.c: Update copyright.
+
+ * stdio-common/vfscanf.c: Correctly handle EINTR error from fgetc
+ function.
+ Don't eat white space for `C' format.
+
+ * stdlib/tst-strtol.c [~0UL != 0xffffffff]: Fix typo in test data.
+
+ * sysdeps/generic/abort.c: Update copyright. De-ANSI-declfy.
+ * sysdeps/i386/abort.c: Removed. This version does not use
+ signal SIGABRT.
+
+ * sysdeps/i386/fpu/__math.h: Define __NO_MATH_INLINES if not using
+ gcc-2.8 or up.
+ Patch by HJ Lu.
+
+ * sysdeps/posix/tempname.c: Test for error but EEXIST after open
+ call. If EMFILE, ENFILE, or EINTR return with error.
+
+Wed Dec 11 14:43:52 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * gnu-versions.h: Set _GNU_OBSTACK_INTERFACE_VERSION back to 1.
+ We are compatible again.
+ * new-malloc/obstack.h (struct obstack): Add back alloc_failed bit
+ even though it is not used.
+ * malloc/obstack.h: Likewise.
+ * new-malloc/obstack.c (_obstack_begin, _obstack_begin_1): Initialize
+ alloc_failed bit to 0.
+
+ * time/strftime.c: Extend for Emacs' needs. Recognize field width,
+ %P format and `0' modifier.
+
+Tue Dec 10 21:20:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * Makerules (make-link): Don't discard exit codes of intermediate
+ commands. Always use rellns-sh if symbolic links are available.
+
+Tue Dec 10 20:09:51 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/unix/sysv/linux/netinet/in.h: Enclose #include
+ <linux/in.h> in __BEGIN_DECLS/__END_DECLS to avoid linkage
+ conflict of ntohs etc. in <asm/byteorder.h>.
+
Wed Dec 11 01:04:30 1996 Ulrich Drepper <drepper@cygnus.com>
Add NIS NSS implementation.
diff --git a/Makerules b/Makerules
index 1cb6855ffa..abff545546 100644
--- a/Makerules
+++ b/Makerules
@@ -601,19 +601,15 @@ $(slibdir)/%.so: $(objpfx)%.so; $(do-install-program)
ifneq ($(findstring -s,$(LN_S)),)
define make-link
-rm -f $@.new; \
-if test '$(@D)' = '$(<D)'; then \
- (cd $(@D); $(LN_S) $(<F) $(@F).new); \
-else \
- $(SHELL) $(..)rellns-sh $< $@.new; \
-fi; \
+rm -f $@.new
+$(SHELL) $(..)rellns-sh $< $@.new
mv -f $@.new $@
endef
else
# If we have no symbolic links don't bother with rellns-sh.
define make-link
-rm -f $@.new; \
-$(LN_S) $< $@.new; \
+rm -f $@.new
+$(LN_S) $< $@.new
mv -f $@.new $@
endef
endif
diff --git a/gnu-versions.h b/gnu-versions.h
index 6cb5c70dec..15b07999dd 100644
--- a/gnu-versions.h
+++ b/gnu-versions.h
@@ -44,7 +44,7 @@
remember, if any of these versions change, the libc.so major version
number must change too (so avoid it)! */
-#define _GNU_OBSTACK_INTERFACE_VERSION 2 /* vs malloc/obstack.c */
+#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
#define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */
#define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */
diff --git a/libio/_G_config.h b/libio/_G_config.h
index 34d77e2b80..5fa7300bf7 100644
--- a/libio/_G_config.h
+++ b/libio/_G_config.h
@@ -16,6 +16,13 @@
#define _G_pid_t __pid_t
#define _G_uid_t __uid_t
+typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
+typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
+typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
+
+#define _G_HAVE_BOOL 1
+
/* These library features are always available in the GNU C library. */
#define _G_HAVE_ATEXIT 1
@@ -25,6 +32,7 @@
#define _G_va_list __gnuc_va_list
#define _G_HAVE_PRINTF_FP 1
+#define _G_HAVE_MMAP 1
/* This is defined by <statbuf.h> if `st_blksize' exists. */
#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
@@ -37,4 +45,10 @@
#define _G_VTABLE_LABEL_HAS_LENGTH 1
+#if defined (__cplusplus) || defined (__STDC__)
+#define _G_ARGS(ARGLIST) ARGLIST
+#else
+#define _G_ARGS(ARGLIST) ()
+#endif
+
#endif /* _G_config.h */
diff --git a/libio/filedoalloc.c b/libio/filedoalloc.c
index eee489b825..f36bfb3e32 100644
--- a/libio/filedoalloc.c
+++ b/libio/filedoalloc.c
@@ -98,9 +98,7 @@ DEFUN(_IO_file_doallocate, (fp),
size = _IO_BUFSIZ;
#endif
}
- p = ALLOC_BUF(size);
- if (p == NULL)
- return EOF;
+ ALLOC_BUF(p, size, EOF);
_IO_setb(fp, p, p+size, 1);
if (couldbetty && __isatty (fp->_fileno))
fp->_flags |= _IO_LINE_BUF;
diff --git a/libio/fileops.c b/libio/fileops.c
index b5026e167a..3294befbd2 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -547,7 +547,7 @@ DEFUN(_IO_file_read, (fp, buf, size),
for (;;)
{
_IO_ssize_t count = _IO_read(fp->_fileno, buf, size);
-#ifdef EINTR
+#if 0 && defined EINTR
if (count == -1 && errno == EINTR)
continue;
#endif
@@ -586,7 +586,7 @@ DEFUN(_IO_file_write, (f, data, n),
_IO_ssize_t count = _IO_write(f->_fileno, data, to_do);
if (count == EOF)
{
-#ifdef EINTR
+#if 0 && defined EINTR
if (errno == EINTR)
continue;
else
diff --git a/libio/genops.c b/libio/genops.c
index 3a58cd2eaf..52b8fc312a 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -278,7 +278,7 @@ DEFUN(_IO_setb, (f, b, eb, a),
_IO_FILE *f AND char *b AND char *eb AND int a)
{
if (f->_IO_buf_base && !(f->_flags & _IO_USER_BUF))
- FREE_BUF(f->_IO_buf_base);
+ FREE_BUF(f->_IO_buf_base, _IO_blen (f));
f->_IO_buf_base = b;
f->_IO_buf_end = eb;
if (a)
@@ -438,9 +438,9 @@ int
DEFUN(_IO_default_doallocate, (fp),
_IO_FILE *fp)
{
- char *buf = ALLOC_BUF(_IO_BUFSIZ);
- if (buf == NULL)
- return EOF;
+ char *buf;
+
+ ALLOC_BUF(buf, _IO_BUFSIZ, EOF);
_IO_setb(fp, buf, buf+_IO_BUFSIZ, 1);
return 1;
}
@@ -487,7 +487,7 @@ DEFUN(_IO_default_finish, (fp),
struct _IO_marker *mark;
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
{
- FREE_BUF(fp->_IO_buf_base);
+ FREE_BUF(fp->_IO_buf_base, _IO_blen (fp));
fp->_IO_buf_base = fp->_IO_buf_end = NULL;
}
diff --git a/libio/libio.h b/libio/libio.h
index acc34c0d7a..49f1d8ccd4 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -83,7 +83,8 @@ the executable file might be covered by the GNU General Public License. */
#define EOF (-1)
#endif
#ifndef NULL
-#ifdef __GNUG__
+#if defined __GNUG__ && \
+ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
#define NULL (__null)
#else
#if !defined(__cplusplus)
diff --git a/libio/libioP.h b/libio/libioP.h
index 008f9b7edf..c9a639ab9a 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -396,7 +396,8 @@ extern void (*_IO_cleanup_registration_needed) __P ((void));
#define EOF (-1)
#endif
#ifndef NULL
-#ifdef __GNUG__
+#if defined __GNUG__ && \
+ (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
#define NULL (__null)
#else
#if !defined(__cplusplus)
@@ -407,8 +408,52 @@ extern void (*_IO_cleanup_registration_needed) __P ((void));
#endif
#endif
-#define FREE_BUF(_B) free(_B)
-#define ALLOC_BUF(_S) (char*)malloc(_S)
+#if _G_HAVE_MMAP
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/param.h>
+
+#if !defined