]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
update from main archive 970226
authorUlrich Drepper <drepper@redhat.com>
Wed, 26 Feb 1997 01:06:05 +0000 (01:06 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 26 Feb 1997 01:06:05 +0000 (01:06 +0000)
15 files changed:
ChangeLog
glibcbug.in
inet/Makefile
locale/C-time.c
malloc/malloc.c
malloc/malloc.h
math/math.h
misc/error.c
stdio-common/vfprintf.c
sysdeps/generic/netinet/in.h
sysdeps/libm-i387/e_acoshf.S
sysdeps/libm-ieee754/s_cbrtl.c
sysdeps/unix/syscalls.list
sysdeps/unix/sysv/linux/Dist
sysdeps/unix/sysv/linux/Makefile

index d4ac15862ed3b80e98d5cb1f1bbd9af031e68326..ec039720b60a9e9a0b5c5c04b72440057c6a5aa3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,54 @@
+1997-02-25 15:11  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/libm-i387/e_acoshf.S (__ieee754_acoshf): Test correct
+       word on stack for overflow.
+
+1997-02-24 23:05  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>
+
+       * malloc/malloc.c (malloc_get_state): New function.
+       Saves global malloc state to an opaque data structure which
+       is dynamically allocated in the heap.
+       * malloc/malloc.c (malloc_set_state): New function.
+       Restore previously obtained state.
+       * malloc/malloc.h: Add declaration of malloc_get_state()
+       and malloc_set_state().
+
+1997-02-24 23:29  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/libm-ieee754/s_cbrtl.c: Shift B1_EXP value to right
+       position.
+
+1997-02-24 17:38  Ulrich Drepper  <drepper@cygnus.com>
+
+       * misc/error.c: Make error and error_at_line weak aliases of
+       __error and __error_at_line respectively.
+       Suggested by David Mosberger-Tang <davidm@AZStarNet.COM>.
+
+1997-02-22 12:25  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * locale/C-time.c (_nl_C_LC_TIME): Add missing entry for
+       time-era-num-entries.
+
+1997-02-24 15:20  Jonathan T. Agnew  <jtagnew@amherst.edu>
+
+       * glibcbug.in: Don't mention destination on MAIL_AGENT command line
+       to avoid duplicate mail.
+
+1997-02-23 02:32  Ulrich Drepper  <drepper@cygnus.com>
+
+       * stdio-common/vfprintf.c (printf_unknown): Correct printing of
+       numeric values.
+
+1997-02-22 03:02  Ulrich Drepper  <drepper@cygnus.com>
+
+       * math/math.h: Prevent definition of struct exception when using
+       C++.
+
+1997-02-22 01:46  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/unix/syscalls.list: Dup takes only one argument.
+       Reported by Greg McGary.
+
 1997-02-20 17:51  Ulrich Drepper  <drepper@cygnus.com>
 
        * sysdeps/generic/netinet/in.h: Protect contents using
index 28087892a5f6516469a86437c3f650eec8bb4dba..0d46b325aba32b95d1aac6ca4c84f7977a257335 100644 (file)
@@ -232,7 +232,7 @@ sed  -e "
 /^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
 " $TEMP > $TEMP.x
 
-if $MAIL_AGENT $BUGGLIBC < $TEMP.x; then
+if $MAIL_AGENT < $TEMP.x; then
   echo "$COMMAND: problem report sent"
   xs=0; exit
 else
index 74a6741b7921209901d0164c87ff40c1e1fda162..e965390a636f2bbbe206aa37563ae897705440d6 100644 (file)
@@ -23,7 +23,7 @@ subdir        := inet
 
 headers        := netinet/ether.h netinet/in.h netinet/if_ether.h \
           netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \
-          aliases.h net/ethernet.h
+          aliases.h
 
 distribute := netgroup.h
 
index a71ea935175a6175d7c6ee347dc2cb0e874c013c..1078580f2007d24e9529a8e3a81f036bfacf967d 100644 (file)
@@ -26,7 +26,7 @@ const struct locale_data _nl_C_LC_TIME =
 {
   _nl_C_name,
   NULL, 0, /* no file mapped */
-  53,
+  54,
   {
     { string: "Sun" },
     { string: "Mon" },
@@ -79,6 +79,7 @@ const struct locale_data _nl_C_LC_TIME =
     { string: "" },
     { string: "" },
     { word: 0 },
+    { word: 0 },
     { string: "" },
     { string: "" },
   }
index 0380527f64fd45666d8961f2bd9fa9db5fc037dd..6b4fc72b200a6432b7b4ceb145b2f8bc9011fa1c 100644 (file)
@@ -19,7 +19,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* V2.6.4-pt2 Sat Dec 14 1996
+/* V2.6.4-pt3 Thu Feb 20 1997
 
   This work is mainly derived from malloc-2.6.4 by Doug Lea
   <dl@cs.oswego.edu>, which is available from:
@@ -874,6 +874,8 @@ extern Void_t*     sbrk();
 #define mALLOC_STATs    __malloc_stats
 #define mALLOC_USABLE_SIZe __malloc_usable_size
 #define mALLOC_TRIm     __malloc_trim
+#define mALLOC_GET_STATe __malloc_get_state
+#define mALLOC_SET_STATe __malloc_set_state
 
 #else
 
@@ -889,6 +891,8 @@ extern Void_t*     sbrk();
 #define mALLOC_STATs    malloc_stats
 #define mALLOC_USABLE_SIZe malloc_usable_size
 #define mALLOC_TRIm     malloc_trim
+#define mALLOC_GET_STATe malloc_get_state
+#define mALLOC_SET_STATe malloc_set_state
 
 #endif
 
@@ -912,7 +916,11 @@ size_t  mALLOC_USABLE_SIZe(Void_t*);
 void    mALLOC_STATs(void);
 int     mALLOPt(int, int);
 struct mallinfo mALLINFo(void);
-#else
+Void_t* mALLOC_GET_STATe(void);
+int     mALLOC_SET_STATe(Void_t*);
+
+#else /* !__STD_C */
+
 #ifndef _LIBC
 void    ptmalloc_init();
 #endif
@@ -929,7 +937,10 @@ size_t  mALLOC_USABLE_SIZe();
 void    mALLOC_STATs();
 int     mALLOPt();
 struct mallinfo mALLINFo();
-#endif
+Void_t* mALLOC_GET_STATe();
+int     mALLOC_SET_STATe();
+
+#endif /* __STD_C */
 
 
 #ifdef __cplusplus
@@ -3775,6 +3786,144 @@ int mALLOPt(param_number, value) int param_number; int value;
 
 \f
 
+/* Get/set state: malloc_get_state() records the current state of all
+   malloc variables (_except_ for the actual heap contents and `hook'
+   function pointers) in a system dependent, opaque data structure.
+   This data structure is dynamically allocated and can be free()d
+   after use.  malloc_set_state() restores the state of all malloc
+   variables to the previously obtained state.  This is especially
+   useful when using this malloc as part of a shared library, and when
+   the heap contents are saved/restored via some other method.  The
+   primary example for this is GNU Emacs with its `dumping' procedure.
+   `Hook' function pointers are never saved or restored by these
+   functions. */
+
+#define MALLOC_STATE_MAGIC   0x444c4541l
+#define MALLOC_STATE_VERSION (0*0x100l + 0l) /* major*0x100 + minor */
+
+struct malloc_state {
+  long          magic;
+  long          version;
+  mbinptr       av[NAV * 2 + 2];
+  char*         sbrk_base;
+  int           sbrked_mem_bytes;
+  unsigned long trim_threshold;
+  unsigned long top_pad;
+  unsigned int  n_mmaps_max;
+  unsigned long mmap_threshold;
+  int           check_action;
+  unsigned long max_sbrked_mem;
+  unsigned long max_total_mem;
+  unsigned int  n_mmaps;
+  unsigned int  max_n_mmaps;
+  unsigned long mmapped_mem;
+  unsigned long max_mmapped_mem;
+};
+
+Void_t*
+mALLOC_GET_STATe()
+{
+  mchunkptr victim;
+  struct malloc_state* ms;
+  int i;
+  mbinptr b;
+
+  ptmalloc_init();
+  (void)mutex_lock(&main_arena.mutex);
+  victim = chunk_alloc(&main_arena, request2size(sizeof(*ms)));
+  if(!victim) {
+    (void)mutex_unlock(&main_arena.mutex);
+    return 0;
+  }
+  ms = (struct malloc_state*)chunk2mem(victim);
+  ms->magic = MALLOC_STATE_MAGIC;
+  ms->version = MALLOC_STATE_VERSION;
+  ms->av[0] = main_arena.av[0];
+  ms->av[1] = main_arena.av[1];
+  for(i=0; i<NAV; i++) {
+    b = bin_at(&main_arena, i);
+    if(first(b) == b)
+      ms->av[2*i+2] = ms->av[2*i+3] = 0; /* empty bin (or initial top) */
+    else {
+      ms->av[2*i+2] = first(b);
+      ms->av[2*i+3] = last(b);
+    }
+  }
+  ms->sbrk_base = sbrk_base;
+  ms->sbrked_mem_bytes = sbrked_mem;
+  ms->trim_threshold = trim_threshold;
+  ms->top_pad = top_pad;
+  ms->n_mmaps_max = n_mmaps_max;
+  ms->mmap_threshold = mmap_threshold;
+  ms->check_action = check_action;
+  ms->max_sbrked_mem = max_sbrked_mem;
+#ifdef NO_THREADS
+  ms->max_total_mem = max_total_mem;
+#else
+  ms->max_total_mem = 0;
+#endif
+  ms->n_mmaps = n_mmaps;
+  ms->max_n_mmaps = max_n_mmaps;
+  ms->mmapped_mem = mmapped_mem;
+  ms->max_mmapped_mem = max_mmapped_mem;
+  (void)mutex_unlock(&main_arena.mutex);
+  return (Void_t*)ms;
+}
+
+int
+#if __STD_C
+mALLOC_SET_STATe(Void_t* msptr)
+#else
+mALLOC_SET_STATe(msptr) Void_t* msptr;
+#endif
+{
+  struct malloc_state* ms = (struct malloc_state*)msptr;
+  int i;
+  mbinptr b;
+
+  ptmalloc_init();
+  if(ms->magic != MALLOC_STATE_MAGIC) return -1;
+  /* Must fail if the major version is too high. */
+  if((ms->version & ~0xffl) > (MALLOC_STATE_VERSION & ~0xffl)) return -2;
+  (void)mutex_lock(&main_arena.mutex);
+  main_arena.av[0] = ms->av[0];
+  main_arena.av[1] = ms->av[1];
+  for(i=0; i<NAV; i++) {
+    b = bin_at(&main_arena, i);
+    if(ms->av[2*i+2] == 0)
+      first(b) = last(b) = b;
+    else {
+      first(b) = ms->av[2*i+2];
+      last(b) = ms->av[2*i+3];
+      if(i > 0) {
+        /* Make sure the links to the `av'-bins in the heap are correct. */
+        first(b)->bk = b;
+        last(b)->fd = b;
+      }
+    }
+  }
+  sbrk_base = ms->sbrk_base;
+  sbrked_mem = ms->sbrked_mem_bytes;
+  trim_threshold = ms->trim_threshold;
+  top_pad = ms->top_pad;
+  n_mmaps_max = ms->n_mmaps_max;
+  mmap_threshold = ms->mmap_threshold;
+  check_action = ms->check_action;
+  max_sbrked_mem = ms->max_sbrked_mem;
+#ifdef NO_THREADS
+  max_total_mem = ms->max_total_mem;
+#endif
+  n_mmaps = ms->n_mmaps;
+  max_n_mmaps = ms->max_n_mmaps;
+  mmapped_mem = ms->mmapped_mem;
+  max_mmapped_mem = ms->max_mmapped_mem;
+  /* add version-dependent code here */
+  (void)mutex_unlock(&main_arena.mutex);
+  return 0;
+}
+
+\f
+
 #if defined(_LIBC) || defined(MALLOC_HOOKS)
 
 /* A simple, standard set of debugging hooks.  Overhead is `only' one
@@ -4048,12 +4197,19 @@ weak_alias (__libc_mallopt, __mallopt) weak_alias (__libc_mallopt, mallopt)
 weak_alias (__malloc_stats, malloc_stats)
 weak_alias (__malloc_usable_size, malloc_usable_size)
 weak_alias (__malloc_trim, malloc_trim)
+weak_alias (__malloc_get_state, malloc_get_state)
+weak_alias (__malloc_set_state, malloc_set_state)
 #endif
 
 /*
 
 History:
 
+    V2.6.4-pt3 Thu Feb 20 1997 Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
+      * Added malloc_get/set_state() (mainly for use in GNU emacs),
+        using interface from Marcus Daniels
+      * All parameters are now adjustable via environment variables
+
     V2.6.4-pt2 Sat Dec 14 1996 Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
       * Added debugging hooks
       * Fixed possible deadlock in realloc() when out of memory
index b27d06252c25de3f4175c3042095c5f252645e0d..53b9d1b2066a3c749286054e64b72a039abccf8b 100644 (file)
@@ -171,6 +171,13 @@ extern size_t malloc_usable_size __MALLOC_P ((__malloc_ptr_t __ptr));
 /* Prints brief summary statistics on stderr. */
 extern void malloc_stats __MALLOC_P ((void));
 
+/* Record the state of all malloc variables in an opaque data structure. */
+extern __malloc_ptr_t malloc_get_state __MALLOC_P ((void));
+
+/* Restore the state of all malloc variables from data obtained with
+   malloc_get_state(). */
+extern int malloc_set_state __MALLOC_P ((__malloc_ptr_t __ptr));
+
 #if defined(__GLIBC__) || defined(MALLOC_HOOKS)
 
 /* Hooks for debugging versions. */
index b713163f7695099e58d032312fd9d6b20d3d92ab..eb8a4f202d9fae463ee9da4c2bbf3ee3ec9f7e8a 100644 (file)
@@ -1,5 +1,5 @@
 /* Declarations for math functions.
-   Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
+   Copyright (C) 1991, 92, 93, 95, 96, 97 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
@@ -99,9 +99,12 @@ extern _LIB_VERSION_TYPE _LIB_VERSION;
 #endif
 
 
-#ifdef __USE_SVID
+#if defined __USE_SVID && !defined __cplusplus
 /* In SVID error handling, `matherr' is called with this description
-   of the exceptional condition.  */
+   of the exceptional condition.
+
+   We have a problem when using C++ since `exception' is reserved in
+   C++.  */
 struct exception
   {
     int type;
@@ -128,7 +131,7 @@ extern int matherr __P ((struct exception *));
 #define HUGE           FLT_MAX
 #include <float.h>             /* Defines FLT_MAX.  */
 
-#endif
+#endif /* SVID && !C++ */
 
 
 #ifdef __USE_BSD
index 2a7df0210d7340b6d52b7cd1073932da5f26a29e..f49e4a7983fdddc888d43f5116fb2cb2dc6d9499 100644 (file)
@@ -71,6 +71,11 @@ unsigned int error_message_count;
 #define program_name program_invocation_name
 #include <errno.h>
 
+/* In GNU libc we want do not want to use the common name `error' directly.
+   Instead make it a weak alias.  */
+#define error __error
+#define error_at_line __error_at_line
+
 #else
 
 /* The calling program should define program_name and set it to the
@@ -230,3 +235,11 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
   if (status)
     exit (status);
 }
+
+#ifdef _LIBC
+/* Make the weak alias.  */
+#undef error
+#undef error_at_line
+weak_alias (__error, error)
+weak_alias (__error_at_line, error_at_line)
+#endif
index eda0d7bd8e2af262cf312e1028546d21f774a2c8..4bd564fdc064d0e6fa6ae1aa7965985ab1b10106 100644 (file)
@@ -1405,16 +1405,16 @@ printf_unknown (FILE *s, const struct printf_info *info,
   if (info->width != 0)
     {
       w = _itoa_word (info->width, workend + 1, 10, 0);
-      while (++w <= workend)
-       outchar (*w);
+      while (w <= workend)
+       outchar (*w++);
     }
 
   if (info->prec != -1)
     {
       outchar ('.');
       w = _itoa_word (info->prec, workend + 1, 10, 0);
-      while (++w <= workend)
-       outchar (*w);
+      while (w <= workend)
+       outchar (*w++);
     }
 
   if (info->spec != '\0')
index bc8af8809e9ec259fa06b6280022c3208e472d51..ad77c8be7d1d71200afe03d55739027d95e8a3aa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
@@ -23,6 +23,7 @@
 
 #include <sys/socket.h>
 
+__BEGIN_DECLS
 
 /* Standard well-defined IP protocols.  */
 enum
@@ -207,4 +208,6 @@ extern unsigned short int htons __P ((unsigned short int));
 #define        htons(x)        (x)
 #endif
 
+__END_DECLS
+
 #endif /* netinet/in.h */
index a4f50ba7ac39456b81a9519637b0525f91717d43..8aa78957e2f7ec03e270ee54866a8328ed271903 100644 (file)
@@ -1,5 +1,5 @@
 /* ix87 specific implementation of arcsinh.
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -42,7 +42,7 @@ limit:        .double 0.29
 
        .text
 ENTRY(__ieee754_acoshf)
-       movl    8(%esp), %ecx
+       movl    4(%esp), %ecx
        cmpl    $0x3f800000, %ecx
        jl      5f                      // < 1 => invalid
        fldln2                          // log(2)
index 9f45faa00cb436a5a96c84b30548f565e3c36ad4..21e7727728f32ce8879dca93157fb4a79488c6c1 100644 (file)
@@ -90,7 +90,7 @@ G =  3.57142857142857150787e-01L; /* 5/14 */
          {
            u_int64_t xxl = ((u_int64_t) se) << 32 | x0;
            xxl /= 3;
-           xxl += B1_EXP << 16 | B1_MANT;
+           xxl += ((u_int64_t) B1_EXP) << 32 | B1_MANT;
            SET_LDOUBLE_MSW(t,xxl&0xffffffffu);
            xxl >>= 32;
            SET_LDOUBLE_EXP(t,xxl);
index fba12457302fb3a2effc87fc20c547ae262ba0ee..9a2325c35c7533e75b0f90deeabfa01176f77267 100644 (file)
@@ -7,7 +7,7 @@ chmod           -       chmod           2       __chmod         chmod
 chown          -       chown           3       __chown         chown
 chroot         -       chroot          1       chroot
 close          -       close           1       __libc_close    __close close
-dup            -       dup             2       __dup           dup
+dup            -       dup             1       __dup           dup
 dup2           -       dup2            2       __dup2          dup2
 fchdir         -       fchdir          1       fchdir
 fcntl          -       fcntl           3       __libc_fcntl    __fcntl fcntl
index 0c5903dc89758822b8d262b4d66da056f82e1ca8..9c41e50b4c4fb9fe0b8fabac7f53364ab7ce2c2c 100644 (file)
@@ -5,6 +5,7 @@ llseek.c
 siglist.h
 sysctl.c
 termio.h
+net/ethernet.h
 net/if.h
 net/if_arp.h
 net/if_ppp.h
index a72fef234651ea83638221801ec0910378c9c50d..7a722c7d164b318c76c5e6011a26d398c8b504ab 100644 (file)
@@ -35,7 +35,7 @@ endif
 
 ifeq ($(subdir),socket)
 sysdep_headers += sys/socketcall.h net/if.h net/if_ppp.h net/ppp-comp.h \
-                 net/ppp_defs.h net/if_arp.h net/route.h
+                 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h
 sysdep_routines += cmsg_nxthdr
 endif