]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 29 Jul 1998 12:34:57 +0000 (12:34 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 29 Jul 1998 12:34:57 +0000 (12:34 +0000)
1998-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

* manual/pattern.texi (More Flags for Globbing): Fix typo.

* manual/math.texi (Special Functions): Fix typo.

* sysdeps/unix/sysv/linux/bits/in.h (IPV6_ROUTER_ALERT): New
constant from Linux 2.1.112.

* posix/Makefile (install-lib): Compile libposix.a only if
build-static == yes.

1998-07-28  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

* sysdeps/generic/glob.c: Maintain const correctness.  Move extern
declarations to file level.  Cope with unsupported
_SC_GETPW_R_SIZE_MAX.

1998-07-29  Ulrich Drepper  <drepper@cygnus.com>

* stdio-common/tst-printf.c: %z is now recognized by printf.

* sysdeps/libm-ieee754/c_csqrt.c: Fix problems with some cancelation
errors.
* sysdeps/libm-ieee754/c_csqrtf.c: Likewise.
* sysdeps/libm-ieee754/c_csqrtlc: Likewise.
Patch by Stephen L Moshier <moshier@mediaone.net>.

* math/libm-test.c (csqrt_test): Correct typo in one test, add
another one.

* sysdeps/unix/sysv/linux/bits/siginfo.h: Adjust siginfo_t after
latest kernel change.

ChangeLog
manual/math.texi
manual/pattern.texi
math/libm-test.c
posix/Makefile
sysdeps/generic/glob.c
sysdeps/libm-ieee754/s_csqrt.c
sysdeps/libm-ieee754/s_csqrtf.c
sysdeps/libm-ieee754/s_csqrtl.c
sysdeps/unix/sysv/linux/bits/in.h
sysdeps/unix/sysv/linux/bits/siginfo.h

index 86ec5808d1ca850bf50d43a5572ac4afc31fee53..7db898fbf65ca003abec5f2a914b15fdafd8baf7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+1998-07-29  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+       * manual/pattern.texi (More Flags for Globbing): Fix typo.
+
+       * manual/math.texi (Special Functions): Fix typo.
+
+       * sysdeps/unix/sysv/linux/bits/in.h (IPV6_ROUTER_ALERT): New
+       constant from Linux 2.1.112.
+
+       * posix/Makefile (install-lib): Compile libposix.a only if
+       build-static == yes.
+
+1998-07-28  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * sysdeps/generic/glob.c: Maintain const correctness.  Move extern
+       declarations to file level.  Cope with unsupported
+       _SC_GETPW_R_SIZE_MAX.
+
+1998-07-29  Ulrich Drepper  <drepper@cygnus.com>
+
+       * stdio-common/tst-printf.c: %z is now recognized by printf.
+
+       * sysdeps/libm-ieee754/c_csqrt.c: Fix problems with some cancelation
+       errors.
+       * sysdeps/libm-ieee754/c_csqrtf.c: Likewise.
+       * sysdeps/libm-ieee754/c_csqrtlc: Likewise.
+       Patch by Stephen L Moshier <moshier@mediaone.net>.
+
+       * math/libm-test.c (csqrt_test): Correct typo in one test, add
+       another one.
+
+       * sysdeps/unix/sysv/linux/bits/siginfo.h: Adjust siginfo_t after
+       latest kernel change.
+
 1998-07-29  6:39  Kazushige Goto <goto@statabo.rim.or.jp>
 
        * sysdeps/alpha/fpu/e_sqrt.c [!_IEEE_FP]: Correctly handle
index e1d597d06aa96174ce9975d4e10a224a32e49c0f..2b804300f2f0a9c57736d65c927a4f6c863dc03b 100644 (file)
@@ -886,7 +886,7 @@ instead of in the @var{signgam} global.
 @deftypefunx {long double} gammal (long double @var{x})
 These functions exist for compatibility reasons.  They are equivalent to
 @code{lgamma} etc.  It is better to use @code{lgamma} since for one the
-name reflect better the actual computation and @code{lgamma} is also
+name reflects better the actual computation and @code{lgamma} is also
 standardized in @w{ISO C 9x} while @code{gamma} is not.
 @end deftypefun
 
index f2c3f8e584a50875585ddf4d40b2dda9affd0890..e81a29fb748287e1fdf42f6cbfca971343e3e730 100644 (file)
@@ -484,7 +484,7 @@ the home directory cannot be determined for other reasons this leads to
 an error.  @code{glob} will return @code{GLOB_NOMATCH} instead of using
 the pattern itself as the name.
 
-This funcationality is equivalent to what is available in C-shells if
+This functionality is equivalent to what is available in C-shells if
 @code{nonomatch} flag is not set.
 
 @comment glob.h
index 95d285e1c70f056c172eb24c3b239a121700bc83..049086641ada25b9e6de79b3124dc98aa55d45b5 100644 (file)
@@ -5157,10 +5157,16 @@ csqrt_test (void)
             0.5870453129635652115L, CHOOSE(7e-18L, 0, 0));
 
   result = FUNC(csqrt) (BUILD_COMPLEX (-2, -3));
-  check_eps ("real(csqrt(-2 - i 3)) == -0.89597...", __real__ result,
+  check_eps ("real(csqrt(-2 - i 3)) == 0.89597...", __real__ result,
             0.8959774761298381247L, CHOOSE(6e-20L, 2e-16, 6e-8));
   check_eps ("imag(csqrt(-2 - i 3)) == -1.67414...", __imag__ result,
             -1.6741492280355400404L, CHOOSE(0, 5e-16, 0));
+
+  result = FUNC(csqrt) (BUILD_COMPLEX (-2, 3));
+  check_eps ("real(csqrt(-2 + i 3)) == 0.89597...", __real__ result,
+            0.8959774761298381247L, CHOOSE(6e-20L, 2e-16, 6e-8));
+  check_eps ("imag(csqrt(-2 + i 3)) == 1.67414...", __imag__ result,
+            1.6741492280355400404L, CHOOSE(0, 5e-16, 0));
 }
 
 
index 5eadf35eb729fcdf0210abc4f0cfa0ac057f5459..daf4960d86c9e8e29f906624e65cb316b4eaab5c 100644 (file)
@@ -57,7 +57,9 @@ tests         := tstgetopt testfnm runtests wordexp-test runptests
 test-srcs      := globtest
 others         := getconf
 install-bin    := getconf
+ifeq (yes,$(build-static))
 install-lib    := libposix.a
+endif
 gpl2lgpl := getopt.c getopt1.c getopt.h        regex.c regex.h
 
 before-compile := testcases.h ptestcases.h
index f54c3b3d212cf5d54a01d1339e26a94c7881fd07..2d7ee67ca3f1a2e3b5724b8177f46e3579ca7367 100644 (file)
@@ -155,6 +155,12 @@ extern void abort (), exit ();
 
 #endif /* Standard headers.  */
 
+#ifdef HAVE_GETLOGIN_R
+extern int getlogin_r __P ((char *, size_t));
+#else
+extern char *getlogin __P ((void));
+#endif
+
 #ifndef        ANSI_STRING
 
 # ifndef bzero
@@ -180,7 +186,6 @@ extern void bcopy ();
 # define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len)
 #endif
 
-
 #ifndef        __GNU_LIBRARY__
 # ifdef        __GNUC__
 __inline
@@ -245,6 +250,8 @@ extern char *alloca ();
 # define closedir(dir) __closedir (dir)
 # define opendir(name) __opendir (name)
 # define readdir(str) __readdir (str)
+# define getpwnam_r(name, bufp, buf, len, res) \
+   __getpwnam_r (name, bufp, buf, len, res)
 #endif
 
 #if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
@@ -349,7 +356,7 @@ glob (pattern, flags, errfunc, pglob)
      glob_t *pglob;
 {
   const char *filename;
-  char *dirname;
+  const char *dirname;
   size_t dirlen;
   int status;
   int oldcount;
@@ -507,9 +514,9 @@ glob (pattern, flags, errfunc, pglob)
        {
          filename = pattern;
 #ifdef _AMIGA
-         dirname = (char *) "";
+         dirname = "";
 #else
-         dirname = (char *) ".";
+         dirname = ".";
 #endif
          dirlen = 0;
        }
@@ -517,20 +524,22 @@ glob (pattern, flags, errfunc, pglob)
   else if (filename == pattern)
     {
       /* "/pattern".  */
-      dirname = (char *) "/";
+      dirname = "/";
       dirlen = 1;
       ++filename;
     }
   else
     {
+      char *newp;
       dirlen = filename - pattern;
-      dirname = (char *) __alloca (dirlen + 1);
+      newp = (char *) __alloca (dirlen + 1);
 #ifdef HAVE_MEMPCPY
-      *((char *) mempcpy (dirname, pattern, dirlen)) = '\0';
+      *((char *) mempcpy (newp, pattern, dirlen)) = '\0';
 #else
-      memcpy (dirname, pattern, dirlen);
-      dirname[dirlen] = '\0';
+      memcpy (newp, pattern, dirlen);
+      newp[dirlen] = '\0';
 #endif
+      dirname = newp;
       ++filename;
 
       if (filename[0] == '\0' && dirlen > 1)
@@ -558,7 +567,7 @@ glob (pattern, flags, errfunc, pglob)
       if (dirname[1] == '\0' || dirname[1] == '/')
        {
          /* Look up home directory.  */
-         char *home_dir = getenv ("HOME");
+         const char *home_dir = getenv ("HOME");
 # ifdef _AMIGA
          if (home_dir == NULL || home_dir[0] == '\0')
            home_dir = "SYS:";
@@ -570,37 +579,38 @@ glob (pattern, flags, errfunc, pglob)
          if (home_dir == NULL || home_dir[0] == '\0')
            {
              int success;
+             char *name;
 #   if defined HAVE_GETLOGIN_R || defined _LIBC
-             extern int getlogin_r __P ((char *, size_t));
              size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
-             char *name;
 
              if (buflen == 0)
                /* `sysconf' does not support _SC_LOGIN_NAME_MAX.  Try
                   a moderate value.  */
-               buflen = 16;
+               buflen = 20;
              name = (char *) __alloca (buflen);
 
              success = getlogin_r (name, buflen) >= 0;
 #   else
-             extern char *getlogin __P ((void));
-             char *name;
-
              success = (name = getlogin ()) != NULL;
 #   endif
              if (success)
                {
+                 struct passwd *p;
 #   if defined HAVE_GETPWNAM_R || defined _LIBC
                  size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
                  char *pwtmpbuf;
-                 struct passwd pwbuf, *p;
+                 struct passwd pwbuf;
 
+                 if (pwbuflen == -1)
+                   /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
+                      Try a moderate value.  */
+                   pwbuflen = 1024;
                  pwtmpbuf = (char *) __alloca (pwbuflen);
 
-                 success = (__getpwnam_r (name, &pwbuf, pwtmpbuf,
-                                          pwbuflen, &p) >= 0);
+                 success = (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
+                            >= 0);
 #   else
-                 struct passwd *p = getpwnam (name);
+                 p = getpwnam (name);
                  success = p != NULL;
 #   endif
                  if (success)
@@ -611,7 +621,7 @@ glob (pattern, flags, errfunc, pglob)
            if (flags & GLOB_TILDE_CHECK)
              return GLOB_NOMATCH;
            else
-             home_dir = (char *) "~"; /* No luck.  */
+             home_dir = "~"; /* No luck.  */
 #  endif /* WINDOWS32 */
 # endif
          /* Now construct the full directory.  */
@@ -636,35 +646,45 @@ glob (pattern, flags, errfunc, pglob)
       else
        {
          char *end_name = strchr (dirname, '/');
-         char *user_name;
-         char *home_dir;
+         const char *user_name;
+         const char *home_dir;
 
          if (end_name == NULL)
            user_name = dirname + 1;
          else
            {
-             user_name = (char *) __alloca (end_name - dirname);
+             char *newp;
+             newp = (char *) __alloca (end_name - dirname);
 # ifdef HAVE_MEMPCPY
-             *((char *) mempcpy (user_name, dirname + 1, end_name - dirname))
+             *((char *) mempcpy (newp, dirname + 1, end_name - dirname))
                = '\0';
 # else
-             memcpy (user_name, dirname + 1, end_name - dirname);
-             user_name[end_name - dirname - 1] = '\0';
+             memcpy (newp, dirname + 1, end_name - dirname);
+             newp[end_name - dirname - 1] = '\0';
 # endif
+             user_name = newp;
            }
 
          /* Look up specific user's home directory.  */
          {
+           struct passwd *p;
 #  if defined HAVE_GETPWNAM_R || defined _LIBC
            size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
-           char *pwtmpbuf = (char *) __alloca (buflen);
-           struct passwd pwbuf, *p;
-           if (__getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0)
+           char *pwtmpbuf;
+           struct passwd pwbuf;
+
+           if (buflen == -1)
+             /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.  Try a
+                moderate value.  */
+             buflen = 1024;
+           pwtmpbuf = (char *) __alloca (buflen);
+
+           if (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0)
              home_dir = p->pw_dir;
            else
              home_dir = NULL;
 #  else
-           struct passwd *p = getpwnam (user_name);
+           p = getpwnam (user_name);
            if (p != NULL)
              home_dir = p->pw_dir;
            else
index cda23c702d7f7e5e9bee457195c27b46e7af92fb..ae106bdad89d843c1a807b1d938e9def9f8c0314 100644 (file)
@@ -1,5 +1,5 @@
 /* Complex square root of double value.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -84,22 +84,25 @@ __csqrt (__complex__ double x)
        }
       else
        {
-#if 0 /* FIXME: this is broken. */
-         __complex__ double q;
-         double t, r;
+#if 0
+         double d, r, s;
 
-         if (fabs (__imag__ x) < 2.0e-4 * fabs (__real__ x))
-           t = 0.25 * __imag__ x * (__imag__ x / __real__ x);
+         d = __ieee754_hypot (__real__ x, __imag__ x);
+         /* Use the identity   2  Re res  Im res = Im x
+            to avoid cancellation error in  d +/- Re x.  */
+         if (__real__ x > 0)
+           {
+             r = __ieee754_sqrt (0.5 * d + 0.5 * __real__ x);
+             s = (0.5 * __imag__ x) / r;
+           }
          else
-           t = 0.5 * (__ieee754_hypot (__real__ x, __imag__ x) - __real__ x);
-
-         r = __ieee754_sqrt (t);
-
-         __real__ q = __imag__ x / (2.0 * r);
-         __imag__ q = r;
+           {
+             s = __ieee754_sqrt (0.5 * d - 0.5 * __real__ x);
+             r = (0.5 * __imag__ x) / s;
+           }
 
-         /* Heron iteration in complex arithmetic.  */
-         res = 0.5 * (q + q / x);
+         __real__ res = r;
+         __imag__ res = __copysign (s, __imag__ x);
 #else
          double d, imag;
 
index 5fdf2c1d6604823a3fb39ecc3d8eb3f6273763d0..015b0cd57f5d5be85a2d6373f7d612c6584acb2c 100644 (file)
@@ -1,5 +1,5 @@
 /* Complex square root of float value.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -84,22 +84,25 @@ __csqrtf (__complex__ float x)
        }
       else
        {
-#if 0 /* FIXME: this is broken. */
-         __complex__ float q;
-         float t, r;
+#if 0
+         float d, r, s;
 
-         if (fabsf (__imag__ x) < 2.0e-4 * fabsf (__real__ x))
-           t = 0.25 * __imag__ x * (__imag__ x / __real__ x);
+         d = __ieee754_hypotf (__real__ x, __imag__ x);
+         /* Use the identity   2  Re res  Im res = Im x
+            to avoid cancellation error in  d +/- Re x.  */
+         if (__real__ x > 0)
+           {
+             r = __ieee754_sqrtf (0.5f * d + 0.5f * __real__ x);
+             s = (0.5f * __imag__ x) / r;
+           }
          else
-           t = 0.5 * (__ieee754_hypotf (__real__ x, __imag__ x) - __real__ x);
-
-         r = __ieee754_sqrtf (t);
-
-         __real__ q = __imag__ x / (2.0 * r);
-         __imag__ q = r;
+           {
+             s = __ieee754_sqrtf (0.5f * d - 0.5f * __real__ x);
+             r = (0.5f * __imag__ x) / s;
+           }
 
-         /* Heron iteration in complex arithmetic.  */
-         res = 0.5 * (q + q / x);
+         __real__ res = r;
+         __imag__ res = __copysignf (s, __imag__ x);
 #else
          float d, imag;
 
index b7727099475801b94e852d353458bfbb0a6cca45..4b7ed983d8d83c7d05969005c403ed58a31818b7 100644 (file)
@@ -1,5 +1,5 @@
 /* Complex square root of long double value.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -84,22 +84,25 @@ __csqrtl (__complex__ long double x)
        }
       else
        {
-#if 0 /* FIXME: this is broken. */
-         __complex__ long double q;
-         long double t, r;
+#if 0
+         long double d, r, s;
 
-         if (fabsl (__imag__ x) < 2.0e-4 * fabsl (__real__ x))
-           t = 0.25 * __imag__ x * (__imag__ x / __real__ x);
+         d = __ieee754_hypotl (__real__ x, __imag__ x);
+         /* Use the identity   2  Re res  Im res = Im x
+            to avoid cancellation error in  d +/- Re x.  */
+         if (__real__ x > 0)
+           {
+             r = __ieee754_sqrtl (0.5L * d + 0.5L * __real__ x);
+             s = (0.5L * __imag__ x) / r;
+           }
          else
-           t = 0.5 * (__ieee754_hypotl (__real__ x, __imag__ x) - __real__ x);
-
-         r = __ieee754_sqrtl (t);
-
-         __real__ q = __imag__ x / (2.0 * r);
-         __imag__ q = r;
+           {
+             s = __ieee754_sqrtl (0.5L * d - 0.5L * __real__ x);
+             r = (0.5L * __imag__ x) / s;
+           }
 
-         /* Heron iteration in complex arithmetic.  */
-         res = 0.5 * (q + q / x);
+         __real__ res = r;
+         __imag__ res = __copysignl (s, __imag__ x);
 #else
          long double d, imag;
 
index bfa7aae571b1af2456b07a34dc871f879eca0736..2e9b66fc4c0aad2625dbe8c4117b82de33a02256 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,98 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
@@ -74,3 +74,4 @@ struct ip_mreq
 #define IPV6_MULTICAST_LOOP    19
 #define IPV6_ADD_MEMBERSHIP    20
 #define IPV6_DROP_MEMBERSHIP   21
+#define IPV6_ROUTER_ALERT      22
index 429edac7482fe0503825eb139eb5a2152167154e..25cd78293e09135652bd74215803dff7fd4c2448 100644 (file)
@@ -72,6 +72,7 @@ typedef struct siginfo
        struct
          {
            __pid_t si_pid;     /* Which child.  */
+           __uid_t si_uid;     /* Real user ID of sending process.  */
            int si_status;      /* Exit value or signal.  */
            __clock_t si_utime;
            __clock_t si_stime;