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.
This commit is contained in:
Ulrich Drepper 1998-07-29 12:34:57 +00:00
parent ceeeaa3dcf
commit ec986e237a
11 changed files with 151 additions and 78 deletions

View File

@ -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> 1998-07-29 6:39 Kazushige Goto <goto@statabo.rim.or.jp>
* sysdeps/alpha/fpu/e_sqrt.c [!_IEEE_FP]: Correctly handle * sysdeps/alpha/fpu/e_sqrt.c [!_IEEE_FP]: Correctly handle

View File

@ -886,7 +886,7 @@ instead of in the @var{signgam} global.
@deftypefunx {long double} gammal (long double @var{x}) @deftypefunx {long double} gammal (long double @var{x})
These functions exist for compatibility reasons. They are equivalent to These functions exist for compatibility reasons. They are equivalent to
@code{lgamma} etc. It is better to use @code{lgamma} since for one the @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. standardized in @w{ISO C 9x} while @code{gamma} is not.
@end deftypefun @end deftypefun

View 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 an error. @code{glob} will return @code{GLOB_NOMATCH} instead of using
the pattern itself as the name. 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. @code{nonomatch} flag is not set.
@comment glob.h @comment glob.h

View File

@ -5157,10 +5157,16 @@ csqrt_test (void)
0.5870453129635652115L, CHOOSE(7e-18L, 0, 0)); 0.5870453129635652115L, CHOOSE(7e-18L, 0, 0));
result = FUNC(csqrt) (BUILD_COMPLEX (-2, -3)); 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)); 0.8959774761298381247L, CHOOSE(6e-20L, 2e-16, 6e-8));
check_eps ("imag(csqrt(-2 - i 3)) == -1.67414...", __imag__ result, check_eps ("imag(csqrt(-2 - i 3)) == -1.67414...", __imag__ result,
-1.6741492280355400404L, CHOOSE(0, 5e-16, 0)); -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));
} }

View File

@ -57,7 +57,9 @@ tests := tstgetopt testfnm runtests wordexp-test runptests
test-srcs := globtest test-srcs := globtest
others := getconf others := getconf
install-bin := getconf install-bin := getconf
ifeq (yes,$(build-static))
install-lib := libposix.a install-lib := libposix.a
endif
gpl2lgpl := getopt.c getopt1.c getopt.h regex.c regex.h gpl2lgpl := getopt.c getopt1.c getopt.h regex.c regex.h
before-compile := testcases.h ptestcases.h before-compile := testcases.h ptestcases.h

View File

@ -155,6 +155,12 @@ extern void abort (), exit ();
#endif /* Standard headers. */ #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 ANSI_STRING
# ifndef bzero # ifndef bzero
@ -180,7 +186,6 @@ extern void bcopy ();
# define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len) # define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len)
#endif #endif
#ifndef __GNU_LIBRARY__ #ifndef __GNU_LIBRARY__
# ifdef __GNUC__ # ifdef __GNUC__
__inline __inline
@ -245,6 +250,8 @@ extern char *alloca ();
# define closedir(dir) __closedir (dir) # define closedir(dir) __closedir (dir)
# define opendir(name) __opendir (name) # define opendir(name) __opendir (name)
# define readdir(str) __readdir (str) # define readdir(str) __readdir (str)
# define getpwnam_r(name, bufp, buf, len, res) \
__getpwnam_r (name, bufp, buf, len, res)
#endif #endif
#if !(defined STDC_HEADERS || defined __GNU_LIBRARY__) #if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
@ -349,7 +356,7 @@ glob (pattern, flags, errfunc, pglob)
glob_t *pglob; glob_t *pglob;
{ {
const char *filename; const char *filename;
char *dirname; const char *dirname;
size_t dirlen; size_t dirlen;
int status; int status;
int oldcount; int oldcount;
@ -507,9 +514,9 @@ glob (pattern, flags, errfunc, pglob)
{ {
filename = pattern; filename = pattern;
#ifdef _AMIGA #ifdef _AMIGA
dirname = (char *) ""; dirname = "";
#else #else
dirname = (char *) "."; dirname = ".";
#endif #endif
dirlen = 0; dirlen = 0;
} }
@ -517,20 +524,22 @@ glob (pattern, flags, errfunc, pglob)
else if (filename == pattern) else if (filename == pattern)
{ {
/* "/pattern". */ /* "/pattern". */
dirname = (char *) "/"; dirname = "/";
dirlen = 1; dirlen = 1;
++filename; ++filename;
} }
else else
{ {
char *newp;
dirlen = filename - pattern; dirlen = filename - pattern;
dirname = (char *) __alloca (dirlen + 1); newp = (char *) __alloca (dirlen + 1);
#ifdef HAVE_MEMPCPY #ifdef HAVE_MEMPCPY
*((char *) mempcpy (dirname, pattern, dirlen)) = '\0'; *((char *) mempcpy (newp, pattern, dirlen)) = '\0';
#else #else
memcpy (dirname, pattern, dirlen); memcpy (newp, pattern, dirlen);
dirname[dirlen] = '\0'; newp[dirlen] = '\0';
#endif #endif
dirname = newp;
++filename; ++filename;
if (filename[0] == '\0' && dirlen > 1) if (filename[0] == '\0' && dirlen > 1)
@ -558,7 +567,7 @@ glob (pattern, flags, errfunc, pglob)
if (dirname[1] == '\0' || dirname[1] == '/') if (dirname[1] == '\0' || dirname[1] == '/')
{ {
/* Look up home directory. */ /* Look up home directory. */
char *home_dir = getenv ("HOME"); const char *home_dir = getenv ("HOME");
# ifdef _AMIGA # ifdef _AMIGA
if (home_dir == NULL || home_dir[0] == '\0') if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "SYS:"; home_dir = "SYS:";
@ -570,37 +579,38 @@ glob (pattern, flags, errfunc, pglob)
if (home_dir == NULL || home_dir[0] == '\0') if (home_dir == NULL || home_dir[0] == '\0')
{ {
int success; int success;
# 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; char *name;
# if defined HAVE_GETLOGIN_R || defined _LIBC
size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
if (buflen == 0) if (buflen == 0)
/* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try /* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try
a moderate value. */ a moderate value. */
buflen = 16; buflen = 20;
name = (char *) __alloca (buflen); name = (char *) __alloca (buflen);
success = getlogin_r (name, buflen) >= 0; success = getlogin_r (name, buflen) >= 0;
# else # else
extern char *getlogin __P ((void));
char *name;
success = (name = getlogin ()) != NULL; success = (name = getlogin ()) != NULL;
# endif # endif
if (success) if (success)
{ {
struct passwd *p;
# if defined HAVE_GETPWNAM_R || defined _LIBC # if defined HAVE_GETPWNAM_R || defined _LIBC
size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX); size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf; 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); pwtmpbuf = (char *) __alloca (pwbuflen);
success = (__getpwnam_r (name, &pwbuf, pwtmpbuf, success = (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
pwbuflen, &p) >= 0); >= 0);
# else # else
struct passwd *p = getpwnam (name); p = getpwnam (name);
success = p != NULL; success = p != NULL;
# endif # endif
if (success) if (success)
@ -611,7 +621,7 @@ glob (pattern, flags, errfunc, pglob)
if (flags & GLOB_TILDE_CHECK) if (flags & GLOB_TILDE_CHECK)
return GLOB_NOMATCH; return GLOB_NOMATCH;
else else
home_dir = (char *) "~"; /* No luck. */ home_dir = "~"; /* No luck. */
# endif /* WINDOWS32 */ # endif /* WINDOWS32 */
# endif # endif
/* Now construct the full directory. */ /* Now construct the full directory. */
@ -636,35 +646,45 @@ glob (pattern, flags, errfunc, pglob)
else else
{ {
char *end_name = strchr (dirname, '/'); char *end_name = strchr (dirname, '/');
char *user_name; const char *user_name;
char *home_dir; const char *home_dir;
if (end_name == NULL) if (end_name == NULL)
user_name = dirname + 1; user_name = dirname + 1;
else else
{ {
user_name = (char *) __alloca (end_name - dirname); char *newp;
newp = (char *) __alloca (end_name - dirname);
# ifdef HAVE_MEMPCPY # ifdef HAVE_MEMPCPY
*((char *) mempcpy (user_name, dirname + 1, end_name - dirname)) *((char *) mempcpy (newp, dirname + 1, end_name - dirname))
= '\0'; = '\0';
# else # else
memcpy (user_name, dirname + 1, end_name - dirname); memcpy (newp, dirname + 1, end_name - dirname);
user_name[end_name - dirname - 1] = '\0'; newp[end_name - dirname - 1] = '\0';
# endif # endif
user_name = newp;
} }
/* Look up specific user's home directory. */ /* Look up specific user's home directory. */
{ {
struct passwd *p;
# if defined HAVE_GETPWNAM_R || defined _LIBC # if defined HAVE_GETPWNAM_R || defined _LIBC
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX); size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf = (char *) __alloca (buflen); char *pwtmpbuf;
struct passwd pwbuf, *p; struct passwd pwbuf;
if (__getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) >= 0)
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; home_dir = p->pw_dir;
else else
home_dir = NULL; home_dir = NULL;
# else # else
struct passwd *p = getpwnam (user_name); p = getpwnam (user_name);
if (p != NULL) if (p != NULL)
home_dir = p->pw_dir; home_dir = p->pw_dir;
else else

View File

@ -1,5 +1,5 @@
/* Complex square root of double value. /* 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. This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>. Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@ -84,22 +84,25 @@ __csqrt (__complex__ double x)
} }
else else
{ {
#if 0 /* FIXME: this is broken. */ #if 0
__complex__ double q; double d, r, s;
double t, r;
if (fabs (__imag__ x) < 2.0e-4 * fabs (__real__ x)) d = __ieee754_hypot (__real__ x, __imag__ x);
t = 0.25 * __imag__ x * (__imag__ x / __real__ 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 else
t = 0.5 * (__ieee754_hypot (__real__ x, __imag__ x) - __real__ x); {
s = __ieee754_sqrt (0.5 * d - 0.5 * __real__ x);
r = (0.5 * __imag__ x) / s;
}
r = __ieee754_sqrt (t); __real__ res = r;
__imag__ res = __copysign (s, __imag__ x);
__real__ q = __imag__ x / (2.0 * r);
__imag__ q = r;
/* Heron iteration in complex arithmetic. */
res = 0.5 * (q + q / x);
#else #else
double d, imag; double d, imag;

View File

@ -1,5 +1,5 @@
/* Complex square root of float value. /* 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. This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>. Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@ -84,22 +84,25 @@ __csqrtf (__complex__ float x)
} }
else else
{ {
#if 0 /* FIXME: this is broken. */ #if 0
__complex__ float q; float d, r, s;
float t, r;
if (fabsf (__imag__ x) < 2.0e-4 * fabsf (__real__ x)) d = __ieee754_hypotf (__real__ x, __imag__ x);
t = 0.25 * __imag__ x * (__imag__ x / __real__ 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 else
t = 0.5 * (__ieee754_hypotf (__real__ x, __imag__ x) - __real__ x); {
s = __ieee754_sqrtf (0.5f * d - 0.5f * __real__ x);
r = (0.5f * __imag__ x) / s;
}
r = __ieee754_sqrtf (t); __real__ res = r;
__imag__ res = __copysignf (s, __imag__ x);
__real__ q = __imag__ x / (2.0 * r);
__imag__ q = r;
/* Heron iteration in complex arithmetic. */
res = 0.5 * (q + q / x);
#else #else
float d, imag; float d, imag;

View File

@ -1,5 +1,5 @@
/* Complex square root of long double value. /* 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. This file is part of the GNU C Library.
Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>. Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@ -84,22 +84,25 @@ __csqrtl (__complex__ long double x)
} }
else else
{ {
#if 0 /* FIXME: this is broken. */ #if 0
__complex__ long double q; long double d, r, s;
long double t, r;
if (fabsl (__imag__ x) < 2.0e-4 * fabsl (__real__ x)) d = __ieee754_hypotl (__real__ x, __imag__ x);
t = 0.25 * __imag__ x * (__imag__ x / __real__ 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 else
t = 0.5 * (__ieee754_hypotl (__real__ x, __imag__ x) - __real__ x); {
s = __ieee754_sqrtl (0.5L * d - 0.5L * __real__ x);
r = (0.5L * __imag__ x) / s;
}
r = __ieee754_sqrtl (t); __real__ res = r;
__imag__ res = __copysignl (s, __imag__ x);
__real__ q = __imag__ x / (2.0 * r);
__imag__ q = r;
/* Heron iteration in complex arithmetic. */
res = 0.5 * (q + q / x);
#else #else
long double d, imag; long double d, imag;

View 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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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_MULTICAST_LOOP 19
#define IPV6_ADD_MEMBERSHIP 20 #define IPV6_ADD_MEMBERSHIP 20
#define IPV6_DROP_MEMBERSHIP 21 #define IPV6_DROP_MEMBERSHIP 21
#define IPV6_ROUTER_ALERT 22

View File

@ -72,6 +72,7 @@ typedef struct siginfo
struct struct
{ {
__pid_t si_pid; /* Which child. */ __pid_t si_pid; /* Which child. */
__uid_t si_uid; /* Real user ID of sending process. */
int si_status; /* Exit value or signal. */ int si_status; /* Exit value or signal. */
__clock_t si_utime; __clock_t si_utime;
__clock_t si_stime; __clock_t si_stime;