]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
update from main archive 961211 cvs/libc-961212 cvs/libc-961213 cvs/libc-961214
authorUlrich Drepper <drepper@redhat.com>
Thu, 12 Dec 1996 03:24:48 +0000 (03:24 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 12 Dec 1996 03:24:48 +0000 (03:24 +0000)
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>.

42 files changed:
ChangeLog
Makerules
gnu-versions.h
libio/_G_config.h
libio/filedoalloc.c
libio/fileops.c
libio/genops.c
libio/libio.h
libio/libioP.h
libio/memstream.c
libio/strops.c
libio/vasprintf.c
malloc/malloc.c
malloc/obstack.c
malloc/obstack.h
nis/Makefile
nis/nss_compat/compat-pwd.c
nis/nss_nis/nis-alias.c
nis/nss_nis/nis-ethers.c
nis/nss_nis/nis-grp.c
nis/nss_nis/nis-hosts.c
nis/nss_nis/nis-network.c
nis/nss_nis/nis-proto.c
nis/nss_nis/nis-pwd.c
nis/nss_nis/nis-rpc.c
nis/nss_nis/nis-service.c
nis/nss_nis/nis-spwd.c
nis/rpcsvc/yp_prot.h
nis/ypclnt.c
nss/nss_files/files-parse.c
shadow/lckpwdf.c
stdio-common/printf.c
stdio-common/sscanf.c
stdio-common/tmpfile.c
stdio-common/vfscanf.c
stdlib/tst-strtol.c
sysdeps/generic/abort.c
sysdeps/i386/abort.c [deleted file]
sysdeps/i386/fpu/__math.h
sysdeps/posix/tempname.c
sysdeps/unix/sysv/linux/netinet/in.h
time/strftime.c

index c67e8d1978c23c3c0789290e4f97d6bd66126f87..4e03465175a7cf68cb76f93ebf8918ab9b0fff23 100644 (file)
--- 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.
index 1cb6855ffa949a3c934ff18260c7c7577ef953c1..abff5455467e36f79d88645ed4a13ca150313057 100644 (file)
--- 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
index 6cb5c70dece77a1c52eb4f3443bf9538f4907573..15b07999dd8c21bdb4a218d49708c5db14e7d391 100644 (file)
@@ -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 */
 
index 34d77e2b8058d3cd7f31cedb21ee3f8f949ad7ca..5fa7300bf7e69ba6fc56985c82546672af9063cb 100644 (file)
 #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)
 #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 */
index eee489b8259e090bdf90ee56385544faa84cc390..f36bfb3e32d736b001bdd984053c9309ba3461fc 100644 (file)
@@ -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;
index b5026e167ac61c5fc35f118cd311e03486694be2..3294befbd2070573a5afe8aa19e2457a357a1d1c 100644 (file)
@@ -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
index 3a58cd2eaf950bb5d2e465a610f20e2a43cc9c98..52b8fc312a20142daabe37c7a7621de11de66e99 100644 (file)
@@ -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;
     }
 
index acc34c0d7ae2ee8da20aa31a362fdccb254f3cb1..49f1d8ccd4ef313f1ab31d7f379d27ffbf2ffec3 100644 (file)
@@ -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)
index 008f9b7edf69904c3db87eaedb13437ba7d98c37..c9a639ab9a893247262e07c5c33f80842253764b 100644 (file)
@@ -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(MAP_ANONYMOUS) && defined(MAP_ANON)
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
+#if !defined(MAP_ANONYMOUS) || !defined(EXEC_PAGESIZE)
+#undef _G_HAVE_MMAP
+#define _G_HAVE_MMAP 0
+#endif
+
+#endif /* _G_HAVE_MMAP */
+
+#if _G_HAVE_MMAP
+
+#define ROUND_TO_PAGE(_S) \
+       (((_S) + EXEC_PAGESIZE - 1) & ~(EXEC_PAGESIZE - 1))
+
+#define FREE_BUF(_B, _S) \
+       munmap ((_B), ROUND_TO_PAGE (_S))
+#define ALLOC_BUF(_B, _S, _R) \
+       do {                                                                  \
+         (_B) = (char *) mmap (0, ROUND_TO_PAGE (_S),                        \
+                               PROT_READ | PROT_WRITE,                       \
+                               MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);          \
+         if ((_B) == (char *) -1)                                            \
+           return (_R);                                                      \
+       } while (0)
+
+#else /* _G_HAVE_MMAP */
+
+#define FREE_BUF(_B, _S) \
+       free(_B)
+#define ALLOC_BUF(_B, _S, _R) \
+       do {                                                                  \
+         (_B) = (char*)malloc(_S);                                           \
+         if ((_B) == NULL)                                                   \
+           return (_R);                                                      \
+       } while (0)
+
+#endif /* _G_HAVE_MMAP */
 
 #ifndef OS_FSTAT
 #define OS_FSTAT fstat
index ddcce676cbfe5f5610584e349231e52222331400..e3c34d0b34be786303d1a3f167a062b46d0270bf 100644 (file)
@@ -80,7 +80,9 @@ open_memstream (bufloc, sizeloc)
   new_f->fp._sf._sbf._f._lock = &new_f->lock;
 #endif
 
-  buf = ALLOC_BUF (_IO_BUFSIZ);
+  buf = malloc (_IO_BUFSIZ);
+  if (buf == NULL)
+    return NULL;
   _IO_init (&new_f->fp._sf._sbf._f, 0);
   _IO_JUMPS (&new_f->fp._sf._sbf._f) = &_IO_mem_jumps;
   _IO_str_init_static (&new_f->fp._sf._sbf._f, buf, _IO_BUFSIZ, buf);
index 8a6c56d055218ecc27a313293c0792770962afea..281141eba78a38ac5562d5b7d41ae6465c20e60d 100644 (file)
@@ -124,7 +124,7 @@ DEFUN(_IO_str_overflow, (fp, c),
       fp->_IO_read_ptr = fp->_IO_read_end;
     }
   pos =  fp->_IO_write_ptr - fp->_IO_write_base;
-  if (pos >= _IO_blen(fp) + flush_only)
+  if (pos >= (_IO_size_t) (_IO_blen(fp) + flush_only))
     {
       if (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */
        return EOF;
index f8dba80c38383256260f95d690251ae9ee179f43..02289407f40e81cfb42513fc7f503c8c59925c3f 100644 (file)
@@ -42,7 +42,7 @@ _IO_vasprintf (result_ptr, format, args)
   _IO_lock_t lock;
 #endif
   int ret;
-  string = ALLOC_BUF(init_string_size);
+  string = malloc (init_string_size);
   if (string == NULL)
     return -1;
 #ifdef _IO_MTSAFE_IO
@@ -52,13 +52,14 @@ _IO_vasprintf (result_ptr, format, args)
   _IO_JUMPS((_IO_FILE*)&sf) = &_IO_str_jumps;
   _IO_str_init_static ((_IO_FILE*)&sf, string, init_string_size, string);
   sf._sbf._f._flags &= ~_IO_USER_BUF;
-  sf._s._allocate_buffer = (_IO_alloc_type)malloc;
-  sf._s._free_buffer = (_IO_free_type)free;
+  sf._s._allocate_buffer = (_IO_alloc_type) malloc;
+  sf._s._free_buffer = (_IO_free_type) free;
   ret = _IO_vfprintf((_IO_FILE*)&sf, format, args);
   if (ret < 0)
     return ret;
-  *result_ptr = (char*)realloc(sf._sbf._f._IO_buf_base,
-                              (sf._sbf._f._IO_write_ptr - sf._sbf._f._IO_write_base) +1);
+  *result_ptr = (char *) realloc (sf._sbf._f._IO_buf_base,
+                                 (sf._sbf._f._IO_write_ptr
+                                  - sf._sbf._f._IO_write_base) +1);
   if (*result_ptr == NULL)
     *result_ptr = sf._sbf._f._IO_buf_base;
   (*result_ptr)[sf._sbf._f._IO_write_ptr-sf._sbf._f._IO_write_base] = '\0';
index 3e843541ebb216fbdcbf89f6aef1de587c22bcda..8b99da9f28af482e7eba52e2fe31108fe75c1589 100644 (file)
@@ -3232,7 +3232,7 @@ heap_trim(heap, pad) heap_info *heap; size_t pad;
     assert(p->size == (0|PREV_INUSE)); /* must be fencepost */
     p = prev_chunk(p);
     new_size = chunksize(p) + (MINSIZE-2*SIZE_SZ);
-    assert(new_size>0 && new_size<(long)2*MINSIZE);
+    assert(new_size>0 && new_size<(long int)(2*MINSIZE));
     if(!prev_inuse(p))
       new_size += p->prev_size;
     assert(new_size>0 && new_size<HEAP_MAX_SIZE);
index cc4147836ea1b37fda511e5451b12a25dbfb0036..e059b5a7d0200500b8f3fedc9b6c33c910a3e6a3 100644 (file)
@@ -24,7 +24,7 @@
 /* NOTE BEFORE MODIFYING THIS FILE: This version number must be
    incremented whenever callers compiled using an old obstack.h can no
    longer properly call the functions in this obstack.c.  */
-#define OBSTACK_INTERFACE_VERSION 2
+#define OBSTACK_INTERFACE_VERSION 1
 
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself, and the installed library
@@ -171,6 +171,7 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
   chunk->prev = 0;
   /* The initial chunk now contains no empty object.  */
   h->maybe_empty_object = 0;
+  h->alloc_failed = 0;
   return 1;
 }
 
@@ -220,6 +221,7 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
   chunk->prev = 0;
   /* The initial chunk now contains no empty object.  */
   h->maybe_empty_object = 0;
+  h->alloc_failed = 0;
   return 1;
 }
 
index 152fbbc655a020ae32b8cd6a3ca96699fa74ebf7..280288876352c8ec22dd303f86c384b4fc820d86 100644 (file)
@@ -183,6 +183,9 @@ struct obstack              /* control current object in current chunk */
                                   chunk contains a zero-length object.  This
                                   prevents freeing the chunk if we allocate
                                   a bigger chunk to replace it. */
+  unsigned alloc_failed:1;     /* No longer used, as we now call the failed
+                                  handler on error, but retained for binary
+                                  compatibility.  */
 };
 
 /* Declare the external functions we use; they are in obstack.c.  */
index 475ee6717563d268b2cb15e227167e366cb6cbe8..a6d4d4f56a579d1f628154bad3dc3b42c0384fdf 100644 (file)
@@ -36,12 +36,8 @@ extra-libs           = libnsl $(services:%=libnss_%)
 # the `lib' pass, because they depend on libc.so being built already.
 extra-libs-others      = $(extra-libs)
 
-others = ypcat ypmatch yppoll ypset ypwhich
-install-bin = ypcat ypmatch ypwhich
-install-sbin = ypset yppoll
-
 # The sources are found in the appropriate subdir.
-subdir-dirs = bsd-tools $(services:%=nss_%)
+subdir-dirs = $(services:%=nss_%)
 vpath %.c $(subdir-dirs)
 
 libnsl-routines = yp_xdr ypclnt ypupdate_xdr
@@ -69,15 +65,9 @@ CFLAGS-nis-pwd.c = -Wno-strict-prototypes
 CFLAGS-nis-rpc.c = -Wno-strict-prototypes
 CFLAGS-nis-service.c = -Wno-strict-prototypes
 CFLAGS-nis-spwd.c = -Wno-strict-prototypes
-CFLAGS-ypclnt.c = -Wno-strict-prototypes -Wno-write-strings
-CFLAGS-yp_xdr.c = -Wno-strict-prototypes
-CFLAGS-ypupdate_xdr.c = -Wno-strict-prototypes
-CFLAGS-ypcat.c = -Wno-strict-prototypes
-CFLAGS-ypmatch.c = -Wno-strict-prototypes
-CFLAGS-ypwhich.c = -Wno-strict-prototypes
-CFLAGS-ypset.c = -Wno-strict-prototypes
-CFLAGS-yppoll.c = -Wno-strict-prototypes
-
+CFLAGS-ypclnt.c = -Wno-strict-prototypes -Wno-write-strings -Irpcsvc
+CFLAGS-yp_xdr.c = -Wno-strict-prototypes -Irpcsvc
+CFLAGS-ypupdate_xdr.c = -Wno-strict-prototypes -Irpcsvc
 
 include ../Rules
 
index 503aafb51eb2b179bc872f9b3b07c3f748a5afa7..39ee2c59013361e1800517d7ff4f919442f4cf1f 100644 (file)
@@ -270,7 +270,8 @@ getpwent_next_netgr (struct passwd *result, ent_t *ent, char *group,
                     char *buffer, size_t buflen)
 {
   char *ypdomain, *host, *user, *domain, *outval, *p, *p2;
-  int status, outvallen, p2len;
+  int status, outvallen;
+  size_t p2len;
 
   if (yp_get_default_domain (&ypdomain) != YPERR_SUCCESS)
     {
@@ -337,7 +338,8 @@ getpwent_next_nis (struct passwd *result, ent_t *ent, char *buffer,
                   size_t buflen)
 {
   char *domain, *outkey, *outval, *p, *p2;
-  int outkeylen, outvallen, p2len;
+  int outkeylen, outvallen;
+  size_t p2len;
 
   if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
     {
@@ -413,7 +415,7 @@ getpwent_next_file (struct passwd *result, ent_t *ent,
   while (1)
     {
       char *p, *p2;
-      int p2len;
+      size_t p2len;
 
       do
        {
index af83d9cd7c607f8d303b73e11b2bf6d926ea4f6e..df884d6faa017a6292d0eee4fa2a3f5f600336d8 100644 (file)
@@ -172,7 +172,7 @@ internal_nis_getaliasent_r (struct aliasent *alias, char *buffer,
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
          free (result);
           __set_errno (ERANGE);
@@ -244,7 +244,7 @@ _nss_nis_getaliasbyname_r (const char *name, struct aliasent *alias,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
index 26449720bb21969aa45032e65bc5f69d5b51ece6..ae3ba76adfc354a2948d9584c8654414c3d99f80 100644 (file)
@@ -107,7 +107,7 @@ internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen)
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
           free (result);
           __set_errno (ERANGE);
@@ -175,7 +175,7 @@ _nss_nis_getethernam_r (const char *name, struct ether *eth,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
@@ -237,7 +237,7 @@ _nss_nis_getetherbyaddr_r (struct ether_addr *addr, struct ether *eth,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
index 1bab862c2f223fb029499aa2744a5f6312dd39e2..72de8b3c8346e2bbbe839b416b7bcbd5762906df 100644 (file)
@@ -101,7 +101,7 @@ internal_nis_getgrent_r (struct group *grp, char *buffer, size_t buflen)
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
           free (result);
           __set_errno (ERANGE);
@@ -169,7 +169,7 @@ _nss_nis_getgrnam_r (const char *name, struct group *grp,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
@@ -219,7 +219,7 @@ _nss_nis_getgrgid_r (gid_t gid, struct group *grp,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
index 9adce18ca35184dc18891cfbf2f22ab33315f0c7..bab7f4c5f4d754b969beb1fa66ec8e979b044761 100644 (file)
@@ -195,7 +195,7 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
          return retval;
        }
 
-      if (len + 1 > linebuflen)
+      if ((size_t) (len + 1) > linebuflen)
         {
           free (result);
          *h_errnop = NETDB_INTERNAL;
@@ -281,7 +281,7 @@ _nss_nis_gethostbyname_r (const char *name, struct hostent *host,
       return retval;
     }
 
-  if (len + 1 > linebuflen)
+  if ((size_t) (len + 1) > linebuflen)
     {
       free (result);
       *h_errnop = NETDB_INTERNAL;
@@ -354,7 +354,7 @@ _nss_nis_gethostbyaddr_r (char *addr, int addrlen, int type,
       return retval;
     }
 
-  if (len + 1 > linebuflen)
+  if ((size_t) (len + 1) > linebuflen)
     {
       free (result);
       __set_errno (ERANGE);
index 2795feb42143ba7c8d63b6cd1174602b24648e20..e82b40143e55881789367f9e9c81acde8642a825 100644 (file)
@@ -106,7 +106,7 @@ internal_nis_getnetent_r (struct netent *net, char *buffer, size_t buflen,
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
           free (result);
           __set_errno (ERANGE);
@@ -183,7 +183,7 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
@@ -261,7 +261,7 @@ _nss_nis_getnetbyaddr_r (unsigned long addr, int type, struct netent *net,
              }
          }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
        {
          free (result);
          __set_errno (ERANGE);
index f62dfb1492c0b4dd621b022151b70b310a89e6de..6feae632585c440d6d23964f1b4402c35dc7c09e 100644 (file)
@@ -101,7 +101,7 @@ internal_nis_getprotoent_r (struct protoent *proto,
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
           free (result);
           __set_errno (ERANGE);
@@ -169,7 +169,7 @@ _nss_nis_getprotobyname_r (const char *name, struct protoent *proto,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
@@ -219,7 +219,7 @@ _nss_nis_getprotobynumber_r (int number, struct protoent *proto,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
index afcc7a428e990bb2ff1a2149daa79f6b0ea81a26..752f7032a68f1990ead91c5e6eeab1e4d8a80c91 100644 (file)
@@ -101,7 +101,7 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen)
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
           free (result);
           __set_errno (ERANGE);
@@ -169,7 +169,7 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
@@ -219,7 +219,7 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
index 91f54be3a9ffe98a0cb1648a9f13ecb94d9486d7..a5490765374084ad5be893bfdbf70aca86038c95 100644 (file)
@@ -128,7 +128,7 @@ internal_nis_getrpcent_r (struct rpcent *rpc, char *buffer, size_t buflen,
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
           free (result);
           __set_errno (ERANGE);
@@ -243,7 +243,7 @@ _nss_nis_getrpcbynumber_r (int number, struct rpcent *rpc,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
index 03a9fbf48e99ac064abfce4d3ada5836cc075007..6d07479ee22096e675c091826f9a829674edbcbb 100644 (file)
 
 #include "nss-nis.h"
 
+
+/* The parser is defined in a different module.  */
+extern int _nss_files_parse_servent (char *line, struct servent *result,
+                                    char *data, size_t datalen);
+
+
+
 __libc_lock_define_initialized (static, lock)
 
 struct intern_t
@@ -127,7 +134,7 @@ internal_nis_getservent_r (struct servent *serv, char *buffer,
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
           free (result);
           __set_errno (ERANGE);
index 928489245b6aa8ad765057622dc7dea0a8342f8b..b5f8c3afd2584401ac258c1491881973d980f425 100644 (file)
@@ -101,7 +101,7 @@ internal_nis_getspent_r (struct spwd *sp, char *buffer, size_t buflen)
           return retval;
         }
 
-      if (len + 1 > buflen)
+      if ((size_t) (len + 1) > buflen)
         {
           free (result);
           __set_errno (ERANGE);
@@ -169,7 +169,7 @@ _nss_nis_getspnam_r (const char *name, struct spwd *sp,
       return retval;
     }
 
-  if (len + 1 > buflen)
+  if ((size_t) (len + 1) > buflen)
     {
       free (result);
       __set_errno (ERANGE);
index 60c24a2f5ff9e7dfcadea23253b4d908f11f22d3..a52b43fac0fe03f712b132fb416e3a1f6391a2ce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file contains symbols and structures defining the rpc protocol
  * between the NIS clients and the NIS servers.  The servers
- * are the NIS database servers, and the NIS binders.  
+ * are the NIS database servers, and the NIS binders.
  */
 
 #ifndef _RPCSVC_YP_PROT_H
 
 /*
  * The following procedures are supported by the protocol:
- * 
+ *
  * YPPROC_NULL() returns () takes nothing, returns nothing.  This indicates
  * that the NIS server is alive.
- * 
+ *
  * YPPROC_DOMAIN (char *) returns (bool_t) TRUE.  Indicates that the
  * responding NIS server does serve the named domain; FALSE indicates no
  * support.
- * 
+ *
  * YPPROC_DOMAIN_NONACK (char *) returns (TRUE) if the NIS server does serve
  * the named domain, otherwise does not return.  Used in the broadcast case.
- * 
+ *
  * YPPROC_MATCH (struct ypreq_key) returns (struct ypresp_val).  Returns the
  * right-hand value for a passed left-hand key, within a named map and
  * domain.
- * 
+ *
  * YPPROC_FIRST (struct ypreq_nokey) returns (struct ypresp_key_val).
  * Returns the first key-value pair from a named domain and map.
- * 
+ *
  * YPPROC_NEXT (struct ypreq_key) returns (struct ypresp_key_val).  Returns
  * the key-value pair following a passed key-value pair within a named
  * domain and map.
@@ -42,7 +42,7 @@
  * YPPROC_CLEAR        takes nothing, returns nothing.  Instructs a NIS server to
  * close the current map, so that old versions of the disk file don't get
  * held open.
- * 
+ *
  * YPPROC_ALL (struct ypreq_nokey), returns
  *     union switch (bool_t more) {
  *             TRUE:   (struct ypresp_key_val);
@@ -89,8 +89,8 @@ struct ypmap_parms {
  */
 
 struct ypreq_key {
-  char *domain;
-  char *map;
+  const char *domain;
+  const char *map;
   datum keydat;
 };
 
@@ -144,8 +144,10 @@ struct ypresp_order {
 };
 
 struct ypmaplist {
-  char ypml_name[YPMAXMAP + 1];
-  struct ypmaplist *ypml_next;
+  char map[YPMAXMAP + 1];
+#define ypml_name map
+  struct ypmaplist *next;
+#define ypml_next next
 };
 
 struct ypresp_maplist {
@@ -201,7 +203,7 @@ struct ypresp_maplist {
  *
  * YPBINDPROC_SETDOM takes (struct ypbind_setdom) returns nothing
  */
+
 /* Program and version symbols, magic numbers */
 
 #define YPBINDPROG             ((u_long)100007)
index 3e05cf984cc0fb69c2962cfbe4877ca25bedcf60..8e24ca468d52cf1a922778e07b61a31ef5a0b08c 100644 (file)
@@ -42,8 +42,10 @@ static char __ypdomainname[MAXHOSTNAMELEN + 1] = "\0";
 __libc_lock_define_initialized (static, ypbindlist_lock)
 static dom_binding *__ypbindlist = NULL;
 
+extern void xdr_free (xdrproc_t proc, char *objp);
+
 static int
-__yp_bind (char *domain, dom_binding ** ypdb)
+__yp_bind (const char *domain, dom_binding ** ypdb)
 {
   struct sockaddr_in clnt_saddr;
   struct ypbind_resp ypbr;
index 83a80f35c0920537fd3f02e5cfc627615c6b7d23..2e84d762f006ffeb3d9f75c20a27c91316025c04 100644 (file)
@@ -69,7 +69,7 @@ struct parser_data
 
 /* The parser is defined in a different module.  */
 extern int parse_line (char *line, struct STRUCTURE *result,
-                      struct parser_data *data, int datalen);
+                      struct parser_data *data, size_t datalen);
 
 # define LINE_PARSER(EOLSET, BODY) /* Do nothing */
 
@@ -80,7 +80,7 @@ extern int parse_line (char *line, struct STRUCTURE *result,
 # define LINE_PARSER(EOLSET, BODY)                                           \
 parser_stclass int                                                           \
 parse_line (char *line, struct STRUCTURE *result,                            \
-           struct parser_data *data, int datalen)                            \
+           struct parser_data *data, size_t datalen)                         \
 {                                                                            \
   ENTDATA_DECL (data)                                                        \
   char *p = strpbrk (line, EOLSET "\n");                                     \
@@ -156,7 +156,7 @@ parse_line (char *line, struct STRUCTURE *result,                         \
 }
 
 static inline char **
-parse_list (char *line, struct parser_data *data, int datalen)
+parse_list (char *line, struct parser_data *data, size_t datalen)
 {
   char *eol, **list, **p;
 
@@ -180,7 +180,7 @@ parse_list (char *line, struct parser_data *data, int datalen)
     {
       char *elt;
 
-      if ((char *) &p[1] - (char *) data > datalen)
+      if ((size_t) ((char *) &p[1] - (char *) data) > datalen)
        {
          /* We cannot fit another pointer in the buffer.  */
          __set_errno (ERANGE);
index d21a744336bebba74b26ba3ca0237797f4ca4a2b..ffe157e119cdf39922fc24610b36f0e1bc71472e 100644 (file)
@@ -86,6 +86,7 @@ __lckpwdf ()
   struct sigaction saved_act;          /* Saved signal action.  */
   sigset_t new_set;                    /* New set of caught signals.  */
   struct sigaction new_act;            /* New signal action.  */
+  struct flock fl;                     /* Information struct for locking.  */
   int result;
 
   if (lock_fd != -1)
@@ -139,7 +140,10 @@ __lckpwdf ()
   alarm (TIMEOUT);
 
   /* Try to get the lock.  */
-  result = flock (lock_fd, LOCK_EX);
+  memset (&fl, '\0', sizeof (struct flock));
+  fl.l_type = F_WRLCK;
+  fl.l_whence = SEEK_SET;
+  result = fcntl (lock_fd, F_SETLKW, &fl);
 
   RETURN_CLEAR_ALARM (result);
 }
@@ -177,5 +181,5 @@ static void
 noop_handler (sig)
      int sig;
 {
-  /* We simply return which makes the `flock' call return with an error.  */
+  /* We simply return which makes the `fcntl' call return with an error.  */
 }
index edb13da43996e4eb7dd7b99ca0a063f1e9c7cf89..c92cd94d99e026fc4d1faa962e5e0eb9624ee5a9 100644 (file)
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -22,8 +22,7 @@ Cambridge, MA 02139, USA.  */
 /* Write formatted output to stdout from the format string FORMAT.  */
 /* VARARGS1 */
 int
-printf (format)
-     const char *format;
+printf (const char *format, ...)
 {
   va_list arg;
   int done;
@@ -34,3 +33,9 @@ printf (format)
 
   return done;
 }
+
+#ifdef USE_IN_LIBIO
+# undef _IO_printf
+/* This is for libg++.  */
+strong_alias (printf, _IO_printf);
+#endif
index d9c31bf32faa48ecaec4a56b2984c0c85220f6f7..c1061523cbe099c0f12cabffe8f3dfad055941a0 100644 (file)
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -35,3 +35,9 @@ sscanf (s, format)
 
   return done;
 }
+
+#ifdef USE_IN_LIBIO
+# undef _IO_sscanf
+/* This is for libg++.  */
+strong_alias (sscanf, _IO_sscanf)
+#endif
index 924df9b6bb94d7cdb7faadb89ad34762df11742c..2cc03d6b89e42eeea79b09144d45af313938f8ed 100644 (file)
@@ -1,20 +1,20 @@
 /* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
-
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 
index 7985602443dbe18d07a80773f7ac0305e04f58bd..71945bbf2e60ed0875fa544eb0abe4fc9f9c7354 100644 (file)
     {                                                                        \
       /* Check file argument for consistence.  */                            \
       CHECK_FILE (s, EOF);                                                   \
-      if (s->_flags & _IO_NO_READS || format == NULL)                        \
-       {                                                                     \
-         MAYBE_SET_EINVAL;                                                   \
-         return EOF;                                                         \
-       }                                                                     \
+      if (s->_flags & _IO_NO_READS)                                          \
+       {                                                                     \
+         __set_errno (EBADF);                                                \
+         return EOF;                                                         \
+       }                                                                     \
+      else if (format == NULL)                                               \
+       {                                                                     \
+         MAYBE_SET_EINVAL;                                                   \
+         return EOF;                                                         \
+       }                                                                     \
     } while (0)
 # define LOCK_STREAM(S)                                                              \
   __libc_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, (S));    \
   do                                                                         \
     {                                                                        \
       /* Check file argument for consistence.  */                            \
-      if (!__validfp (s) || !s->__mode.__read || format == NULL)             \
+      if (!__validfp (s) || !s->__mode.__read)                               \
+       {                                                                     \
+         __set_errno (EBADF);                                                \
+         return EOF;                                                         \
+       }                                                                     \
+      else if (format == NULL)                                               \
        {                                                                     \
          __set_errno (EINVAL);                                               \
          return EOF;                                                         \
@@ -159,7 +169,7 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
   register unsigned char fc;   /* Current character of the format.  */
   register size_t done = 0;    /* Assignments done.  */
   register size_t read_in = 0; /* Chars read in.  */
-  register int c;              /* Last char read.  */
+  register int c = 0;          /* Last char read.  */
   register int width;          /* Maximum field width.  */
   register int flags;          /* Modifiers for current format element.  */
 
@@ -296,7 +306,8 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
          if (skip_space)
            {
              while (isspace (c))
-               (void) inchar ();
+               if (inchar () == EOF && errno == EINTR)
+                 conv_error ();
              skip_space = 0;
            }
 
@@ -409,13 +420,18 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
       if (*f == '\0')
        conv_error ();
 
+      /* We must take care for EINTR errors.  */
+      if (c == EOF && errno == EINTR)
+       input_error ();
+
       /* Find the conversion specifier.  */
       fc = *f++;
-      if (skip_space || (fc != '[' && fc != 'c' && fc != 'n'))
+      if (skip_space || (fc != '[' && fc != 'c' && fc != 'C' && fc != 'n'))
        {
          /* Eat whitespace.  */
          do
-           (void) inchar ();
+           if (inchar () == EOF && errno == EINTR)
+             input_error ();
          while (isspace (c));
          ungetc (c, s);
          skip_space = 0;
index 620181b13d0cbbe9e23dbc6eccdf74259375d3e8..1566364b32d807a689f4da5b1e729a32655c9a8c 100644 (file)
@@ -65,7 +65,7 @@ static const struct ltest tests[] =
     { "0xffffffffg",   0xffffffff,     0,      'g',    0 },
     { "0xffffffffffffffffg",   0xffffffffffffffff,     0,      'g',    0 },
     { "0xf1f2f3f4f5f6f7f8f9",  0xffffffffffffffff,     0,      0,      ERANGE },
-    { "-0x123456789abcdef01",  0,                      0,      0,      EINVA{ },
+    { "-0x123456789abcdef01",  0,                      0,      0,      EINVAL },
     { "-0xfedcba987654321",    0,                      0,      0,      EINVAL },
     { NULL,            0,              0,      0,      0 },
 #endif
index 1a27c4946b7950832284c167d7080785f600a91d..8eb45b3fde5975dbeab4a71fc6e06ffc2959a38c 100644 (file)
@@ -1,22 +1,21 @@
-/* Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1993, 1995, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
-#include <ansidecl.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -25,13 +24,13 @@ Cambridge, MA 02139, USA.  */
 
 /* Cause an abnormal program termination with core-dump.  */
 void
-DEFUN_VOID(abort)
+abort (void)
 {
   sigset_t sigs;
 
-  if (__sigemptyset(&sigs) == 0 &&
-      __sigaddset(&sigs, SIGABRT) == 0)
-    (void) __sigprocmask(SIG_UNBLOCK, &sigs, (sigset_t *) NULL);
+  if (__sigemptyset (&sigs) == 0 &&
+      __sigaddset (&sigs, SIGABRT) == 0)
+    __sigprocmask (SIG_UNBLOCK, &sigs, (sigset_t *) NULL);
 
   while (1)
     if (raise (SIGABRT))
diff --git a/sysdeps/i386/abort.c b/sysdeps/i386/abort.c
deleted file mode 100644 (file)
index 28513fd..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 1993, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
-
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
-
-#include <ansidecl.h>
-#include <stdlib.h>
-
-/* Cause an abnormal program termination with core-dump.  */
-void
-DEFUN_VOID(abort)
-{
-  while (1)
-    asm ("hlt");
-}
index d6b0bc6988df7eba7efe44eb90d8be66f95c895c..3728d45be654f8dc71d34c3a40f30453f473fd80 100644 (file)
@@ -1,26 +1,33 @@
 /* Inline math functions for i387.
-Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-Contributed by John C. Bowman <bowman@ipp-garching.mpg.de>
+   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by John C. Bowman <bowman@ipp-garching.mpg.de>, 1995.
 
-This file is part of the GNU C Library.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #ifndef __MATH_H
-#define __MATH_H
+#define __MATH_H       1
+
+#if defined __GNUG__ && \
+    (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ <= 7))
+/* gcc 2.7.2 and 2.7.2.1 have problems with inlining `long double'
+   functions so we disable this now.  */
+#undef __NO_MATH_INLINES
+#define __NO_MATH_INLINES
+#endif
 
 #ifdef __GNUC__
 #ifndef __NO_MATH_INLINES
index 61774a0b3e9cb7f015bc607ed249e8ac9d0d9c31..bb921c172f6d64a3826e5bb9b84c2d1b629ae07b 100644 (file)
@@ -254,6 +254,22 @@ __stdio_gen_tempname (char *buf, size_t bufsize, const char *dir,
              (*streamptr)->__mode.__binary = 1;
 #endif
            }
+#if defined EMFILE || defined ENFILE || defined EINTR
+         else if (0
+# ifdef EMFILE
+                  || errno == EMFILE
+# endif
+# ifdef ENFILE
+                  || errno == ENFILE
+# endif
+# ifdef EINTR
+                  || errno == EINTR
+# endif
+                  )
+           /* We cannot open anymore files since all descriptors are
+              used or because we got a signal.  */
+           return NULL;
+#endif
          else
            continue;
        }
index 86d1274a0cf4d1fa18bbcd6f62c9a74a8907f016..91c88835db1bac04adb8f0df540823e50adad06c 100644 (file)
 #include <features.h>
 
 #include <sys/socket.h>
+
+__BEGIN_DECLS
 #include <linux/in.h>
+__END_DECLS
 
 /* Standard well-known ports.  The use of these constants is
    deprecated.  Instead use the contents of the file `/etc/services'
index 5447b3e84773e2733ed1b229b27be1b763c416d6..092739d16530f0e894572f01abb9a5139e45f13f 100644 (file)
@@ -33,6 +33,7 @@
 # include "../locale/localeinfo.h"
 #endif
 
+#include <ctype.h>
 #include <sys/types.h>         /* Some systems define `time_t' here.  */
 
 #ifdef TIME_WITH_SYS_TIME
@@ -161,20 +162,59 @@ localtime_r (t, tp)
 #endif /* ! defined (_LIBC) */
 
 
-#define        add(n, f)                                                             \
+static const char spaces[16] = "                ";
+#define        add(n, f) \
   do                                                                         \
     {                                                                        \
-      i += (n);                                                                      \
+      int _n = (n);                                                          \
+      int _delta = width - _n;                                               \
+      i += _n + (_delta > 0 ? _delta : 0);                                   \
       if (i >= maxsize)                                                              \
        return 0;                                                             \
       else                                                                   \
        if (p)                                                                \
          {                                                                   \
+           while (_delta > 0)                                                \
+             {                                                               \
+               int _this = _delta > 16 ? 16 : _delta;                        \
+               memcpy (p, spaces, _this);                                    \
+               p += _this;                                                   \
+               _delta -= _this;                                              \
+             }                                                               \
            f;                                                                \
-           p += (n);                                                         \
+           p += _n;                                                          \
          }                                                                   \
     } while (0)
-#define        cpy(n, s)       add ((n), memcpy((PTR) p, (PTR) (s), (n)))
+
+#define        cpy(n, s) \
+    add ((n),                                                                \
+        if (to_lowcase)                                                      \
+          memcpy_lowcase (p, (s), _n);                                       \
+        else                                                                 \
+          memcpy ((PTR) p, (PTR) (s), _n))
+
+
+
+#ifdef _LIBC
+# define TOUPPER(Ch) toupper (Ch)
+# define TOLOWER(Ch) tolower (Ch)
+#else
+# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
+# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+#endif
+
+static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len));
+
+static char *
+memcpy_lowcase (dest, src, len)
+     char *dest;
+     const char *src;
+     size_t len;
+{
+  while (len-- > 0)
+    dest[len] = TOLOWER (src[len]);
+  return dest;
+}
 
 #if ! HAVE_TM_GMTOFF
 /* Yield the difference between *A and *B,
@@ -254,7 +294,7 @@ strftime (s, maxsize, format, tp)
       char *s;
       size_t maxsize;
       const char *format;
-      register const struct tm *tp;
+      const struct tm *tp;
 {
   int hour12 = tp->tm_hour;
 #ifdef _NL_CURRENT
@@ -281,9 +321,9 @@ strftime (s, maxsize, format, tp)
   size_t month_len = strlen (f_month);
   const char *zone;
   size_t zonelen;
-  register size_t i = 0;
-  register char *p = s;
-  register const char *f;
+  size_t i = 0;
+  char *p = s;
+  const char *f;
 
   zone = 0;
 #if HAVE_TM_ZONE
@@ -315,6 +355,8 @@ strftime (s, maxsize, format, tp)
       char buf[1 + (sizeof (int) < sizeof (time_t)
                    ? INT_STRLEN_BOUND (time_t)
                    : INT_STRLEN_BOUND (int))];
+      int width = -1;
+      int to_lowcase = 0;
 
 #if DO_MULTIBYTE
 
@@ -391,18 +433,35 @@ strftime (s, maxsize, format, tp)
 
       /* Check for flags that can modify a number format.  */
       ++f;
-      switch (*f)
+      while (1)
        {
-       case '_':
-       case '-':
-         pad = *f++;
-         break;
+         switch (*f)
+           {
+           case '_':
+           case '-':
+           case '0':
+             pad = *f++;
+             break;
 
-       default:
-         pad = 0;
+           default:
+             pad = 0;
+             break;
+           }
          break;
        }
 
+      /* As a GNU extension we allow to specify the field width.  */
+      if (isdigit (*f))
+       {
+         width = 0;
+         do
+           {
+             width *= 10;
+             width += *f - '0';
+           }
+         while (isdigit (*++f));
+       }
+
       /* Check for modifiers.  */
       switch (*f)
        {
@@ -468,10 +527,10 @@ strftime (s, maxsize, format, tp)
 
        subformat:
          {
-           size_t len = strftime (p, maxsize - i, subfmt, tp);
+           size_t len = strftime (NULL, maxsize - i, subfmt, tp);
            if (len == 0 && *subfmt)
              return 0;
-           add (len, ;);
+           add (len, strftime (p, maxsize - i, subfmt, tp));
          }
          break;
 
@@ -527,8 +586,9 @@ strftime (s, maxsize, format, tp)
             jump to one of these two labels.  */
 
        do_number_spacepad:
-         /* Force `_' flag.  */
-         pad = '_';
+         /* Force `_' flag unless overwritten by `0' flag.  */
+         if (pad != '0')
+           pad = '_';
 
        do_number:
          /* Format the number according to the MODIFIER flag.  */
@@ -638,6 +698,10 @@ strftime (s, maxsize, format, tp)
          add (1, *p = '\n');
          break;
 
+       case 'P':
+         to_lowcase = 1;
+         /* FALLTHROUGH */
+
        case 'p':
          cpy (ap_len, ampm);
          break;