From 5649a1d60d4e752b4941663ea63391b5f1a8b7e4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 4 Jun 1997 19:05:38 +0000 Subject: Update. 1997-06-04 20:57 Ulrich Drepper * manual/string.texi: Add comments to discourage use of index and rindex. (strtok, strsep): Apply function on copy of the strings in example. (l64a): Add example. * posix/unistd.h: Correct value for _POSIX_VERSION. * sunrpc/Makefile (defines): Remove definition. * sysdeps/ieee754/nan.h: Correct typo. 1997-06-04 10:50 Fila Kolodny * posix/unistd.h: Add definition of __fchdir corresponding to fchdir. * login/utmp_daemon.c: Correct location of utmpd.h. 1997-06-03 19:16 Andreas Schwab * Makerules: Rename $(common-objpfx)distinfo-$(subdir) to $(objpfx)distinfo. * rpm/Makefile (distinfo): Adapted. 1997-06-03 18:32 Andreas Schwab * rpm/Makefile (install-slib): Collect shared libraries here instead of in install-lib, including libc. (instvars): Add slib. 1997-06-03 18:23 Andreas Schwab * login/Makefile (libutil-routines): Add updwtmp. 1997-06-03 16:16 Andreas Schwab * monetary.h: New file, needed for localedata/tst-fmon.c. 1997-06-02 20:31 Andreas Schwab * math/libm-test.c (cpow_test): Add epsilon for long double in test for 2^10. (identities): Add epsilon for float in second identity test. * sysdeps/m68k/huge_val.h: Change GCC's HUGE_VAL{,F,L} to use DI and SI mode integers instead of bytes. Fix value of HUGE_VALL. * sysdeps/m68k/nan.h: New file. * sysdeps/m68k/fpu/__math.h (isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered): Fix assembler syntax. * sysdeps/m68k/fpu/fraiseexcpt.c: Do it right so that gcc doesn't optimize out the operations. * sysdeps/libm-ieee754/s_nan.c: Use NaN macro instead of static constant. * sysdeps/libm-ieee754/s_nanf.c: Likewise. * sysdeps/libm-ieee754/s_nanl.c: Likewise. * math/carg.c [NO_LONG_DOUBLE]: Add alias for long double function. * sysdeps/libm-ieee754/s_erf.c: Likewise. * sysdeps/libm-ieee754/s_fdim.c: Likewise. * sysdeps/libm-ieee754/s_fmax.c: Likewise. * sysdeps/libm-ieee754/s_fmin.c: Likewise. * sysdeps/libm-ieee754/s_log2.c: Likewise. * sysdeps/libm-ieee754/s_nan.c: Likewise. * sysdeps/libm-ieee754/s_remquo.c: Likewise. --- ChangeLog | 71 ++++++++++++++++++++++++ Makerules | 18 +++--- login/Makefile | 2 +- login/utmp_daemon.c | 2 +- manual/string.texi | 118 +++++++++++++++++++++++++++++++++++----- math/carg.c | 4 ++ math/libm-test.c | 5 +- posix/unistd.h | 10 ++-- rpm/Makefile | 28 +++++----- sunrpc/Makefile | 2 - sysdeps/ieee754/nan.h | 2 +- sysdeps/libm-ieee754/s_erf.c | 4 ++ sysdeps/libm-ieee754/s_fdim.c | 4 ++ sysdeps/libm-ieee754/s_fmax.c | 4 ++ sysdeps/libm-ieee754/s_fmin.c | 4 ++ sysdeps/libm-ieee754/s_log2.c | 4 ++ sysdeps/libm-ieee754/s_nan.c | 9 +-- sysdeps/libm-ieee754/s_nanf.c | 5 +- sysdeps/libm-ieee754/s_nanl.c | 6 +- sysdeps/libm-ieee754/s_remquo.c | 4 ++ sysdeps/m68k/fpu/__math.h | 12 ++-- sysdeps/m68k/fpu/fraiseexcpt.c | 22 +++----- sysdeps/m68k/huge_val.h | 51 +++++++++-------- sysdeps/m68k/nan.h | 59 ++++++++++++++++++++ 24 files changed, 346 insertions(+), 104 deletions(-) create mode 100644 sysdeps/m68k/nan.h diff --git a/ChangeLog b/ChangeLog index cb8400e278..0d9a0825a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,74 @@ +1997-06-04 20:57 Ulrich Drepper + + * manual/string.texi: Add comments to discourage use of index and + rindex. + (strtok, strsep): Apply function on copy of the strings in example. + (l64a): Add example. + + * posix/unistd.h: Correct value for _POSIX_VERSION. + + * sunrpc/Makefile (defines): Remove definition. + + * sysdeps/ieee754/nan.h: Correct typo. + +1997-06-04 10:50 Fila Kolodny + + * posix/unistd.h: Add definition of __fchdir corresponding to fchdir. + + * login/utmp_daemon.c: Correct location of utmpd.h. + +1997-06-03 19:16 Andreas Schwab + + * Makerules: Rename $(common-objpfx)distinfo-$(subdir) to + $(objpfx)distinfo. + * rpm/Makefile (distinfo): Adapted. + +1997-06-03 18:32 Andreas Schwab + + * rpm/Makefile (install-slib): Collect shared libraries here + instead of in install-lib, including libc. + (instvars): Add slib. + +1997-06-03 18:23 Andreas Schwab + + * login/Makefile (libutil-routines): Add updwtmp. + +1997-06-03 16:16 Andreas Schwab + + * monetary.h: New file, needed for localedata/tst-fmon.c. + +1997-06-02 20:31 Andreas Schwab + + * math/libm-test.c (cpow_test): Add epsilon for long double in + test for 2^10. + (identities): Add epsilon for float in second identity test. + + * sysdeps/m68k/huge_val.h: Change GCC's HUGE_VAL{,F,L} to use + DI and SI mode integers instead of bytes. Fix value of HUGE_VALL. + + * sysdeps/m68k/nan.h: New file. + + * sysdeps/m68k/fpu/__math.h (isgreater, isgreaterequal, isless, + islessequal, islessgreater, isunordered): Fix assembler syntax. + + * sysdeps/m68k/fpu/fraiseexcpt.c: Do it right so that gcc doesn't + optimize out the operations. + + * sysdeps/libm-ieee754/s_nan.c: Use NaN macro instead of static + constant. + * sysdeps/libm-ieee754/s_nanf.c: Likewise. + * sysdeps/libm-ieee754/s_nanl.c: Likewise. + + * math/carg.c [NO_LONG_DOUBLE]: Add alias for long double + function. + * sysdeps/libm-ieee754/s_erf.c: Likewise. + * sysdeps/libm-ieee754/s_fdim.c: Likewise. + * sysdeps/libm-ieee754/s_fmax.c: Likewise. + * sysdeps/libm-ieee754/s_fmin.c: Likewise. + * sysdeps/libm-ieee754/s_log2.c: Likewise. + * sysdeps/libm-ieee754/s_nan.c: Likewise. + * sysdeps/libm-ieee754/s_remquo.c: Likewise. + 1997-06-03 23:42 Ulrich Drepper * elf/dl-support.c: Define and initialize _dl_verbose used in diff --git a/Makerules b/Makerules index 31b965f3d7..dc3f652113 100644 --- a/Makerules +++ b/Makerules @@ -836,10 +836,10 @@ ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(..)config.h check: tests .PHONY: TAGS -TAGS: $(common-objpfx)distinfo-$(subdir) $(..)MakeTAGS +TAGS: $(objpfx)distinfo $(..)MakeTAGS $(MAKE) $(addprefix -f ,$^) $@ -$(..)po/%.pot: $(common-objpfx)distinfo-$(subdir) $(..)MakeTAGS FORCE +$(..)po/%.pot: $(objpfx)distinfo $(..)MakeTAGS FORCE $(MAKE) $(addprefix -f ,$(filter-out FORCE,$^)) $@ FORCE: @@ -874,7 +874,7 @@ common-clean: common-mostlyclean -rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles) -rm -fr $(addprefix $(objpfx),$(generated-dirs)) -rm -f $(addprefix $(common-objpfx),$(common-generated)) - -rm -f $(common-objpfx)distinfo-$(subdir) + -rm -f $(objpfx)distinfo # Produce a file `stub-$(subdir)' which contains `#define __stub_FUNCTION' # for each function which is a stub. We grovel over all the .d files @@ -897,7 +897,7 @@ $(common-objpfx)stub-$(subdir): $(+depfiles) # Make the distribution tar file. .PHONY: dist -dist: $(common-objpfx)distinfo-$(subdir) $(..)Make-dist +dist: $(objpfx)distinfo $(..)Make-dist $(MAKE) -f $< -f $(word 2,$^) $(Make-dist-args) # Avoid depending on source files found in sysdeps dirs, @@ -908,14 +908,12 @@ dist: $(filter-out %.c %.S %.s,$(distribute)) # environment get too large. Instead, we write all the information into # a generated makefile fragment `distinfo', and then include it with -f in # the sub-make that makes the distribution (above). -$(common-objpfx)distinfo-$(subdir): Makefile $(..)Makerules \ - $(wildcard $(foreach dir,$(sysdirs),\ - $(dir)/Makefile)) +$(objpfx)distinfo: Makefile $(..)Makerules \ + $(wildcard $(foreach dir,$(sysdirs),$(dir)/Makefile)) $(distinfo-vars) mv -f $@.new $@ -.PHONY: subdir_distinfo distinfo -subdir_distinfo: distinfo -distinfo: $(common-objpfx)distinfo-$(subdir) +.PHONY: subdir_distinfo +subdir_distinfo: $(objpfx)distinfo define distinfo-vars rm -f $@.new diff --git a/login/Makefile b/login/Makefile index 05913ee337..a94c5cb14d 100644 --- a/login/Makefile +++ b/login/Makefile @@ -42,7 +42,7 @@ vpath %.c programs extra-libs := libutil extra-libs-others := $(extra-libs) -libutil-routines:= login login_tty logout logwtmp pty +libutil-routines:= login login_tty logout logwtmp pty updwtmp include ../Rules diff --git a/login/utmp_daemon.c b/login/utmp_daemon.c index edaade1eff..9e02f24524 100644 --- a/login/utmp_daemon.c +++ b/login/utmp_daemon.c @@ -27,7 +27,7 @@ #include #include "utmp-private.h" -#include "utmpd/utmpd.h" +#include "programs/utmpd.h" #ifndef _LIBC #define __set_errno(val) errno = (val) diff --git a/manual/string.texi b/manual/string.texi index af95925a14..cb9f5412f8 100644 --- a/manual/string.texi +++ b/manual/string.texi @@ -890,6 +890,9 @@ specifying a null character as the value of the @var{c} argument. @comment BSD @deftypefun {char *} index (const char *@var{string}, int @var{c}) @code{index} is another name for @code{strchr}; they are exactly the same. +New code should always use @code{strchr} since this name is defined in +@w{ISO C} while @code{index} is a BSD invention which never was available +on @w{System V} derived systems. @end deftypefun @comment string.h @@ -910,6 +913,9 @@ strrchr ("hello, world", 'l') @comment BSD @deftypefun {char *} rindex (const char *@var{string}, int @var{c}) @code{rindex} is another name for @code{strrchr}; they are exactly the same. +New code should always use @code{strrchr} since this name is defined in +@w{ISO C} while @code{rindex} is a BSD invention which never was available +on @w{System V} derived systems. @end deftypefun @comment string.h @@ -1067,13 +1073,14 @@ Here is a simple example showing the use of @code{strtok}. @dots{} -char string[] = "words separated by spaces -- and, punctuation!"; +const char string[] = "words separated by spaces -- and, punctuation!"; const char delimiters[] = " .,;:!-"; -char *token; +char *token, *cp; @dots{} -token = strtok (string, delimiters); /* token => "words" */ +cp = strdupa (string); /* Make writable copy. */ +token = strtok (cp, delimiters); /* token => "words" */ token = strtok (NULL, delimiters); /* token => "separated" */ token = strtok (NULL, delimiters); /* token => "by" */ token = strtok (NULL, delimiters); /* token => "spaces" */ @@ -1097,7 +1104,7 @@ pointer. Calling @code{strtok_r} with a null pointer for @var{newstring} and leaving @var{save_ptr} between the calls unchanged does the job without limiting reentrancy. -This function was proposed for POSIX.1b and can be found on many systems +This function is defined in POSIX-1 and can be found on many systems which support multi-threading. @end deftypefun @@ -1123,14 +1130,14 @@ Here is how the above example looks like when @code{strsep} is used. @dots{} -char string[] = "words separated by spaces -- and, punctuation!"; +const char string[] = "words separated by spaces -- and, punctuation!"; const char delimiters[] = " .,;:!-"; char *running; char *token; @dots{} -running = string; +running = strdupa (string); token = strsep (&running, delimiters); /* token => "words" */ token = strsep (&running, delimiters); /* token => "separated" */ token = strsep (&running, delimiters); /* token => "by" */ @@ -1180,13 +1187,66 @@ The function returns a pointer to a static buffer which contains the string representing of the encoding of @var{n}. To encoded a series of bytes the use should append the new string to the destination buffer. @emph{Warning:} Since a static buffer is used this function should not -be used in multi-threaded programs. There is no thread-safe alternatice +be used in multi-threaded programs. There is no thread-safe alternative to this function in the C library. @end deftypefun +Alone the @code{l64a} function is not usable. To encode arbitrary +sequences of bytes one needs some more code and this could look like +this: + +@smallexample +char * +encode (const void *buf, size_t len) +@{ + /* @r{We know in advance how long the buffer has to be.} */ + unsigned char *in = (unsigned char *) buf; + char *out = malloc (6 + ((len + 3) / 4) * 6 + 1); + char *cp = out; + + /* @r{Encode the length.} */ + memcpy (cp, l64a (len), 6); + cp += 6; + + while (len > 3) + @{ + unsigned long int n = *in++; + n = (n << 8) | *in++; + n = (n << 8) | *in++; + n = (n << 8) | *in++; + len -= 4; + /* @r{Using `htonl' is necessary so that the data can be} + @r{decoded even on machines with different byte order.} */ + memcpy (cp, l64a (htonl (n)), 6); + cp += 6; + @} + if (len > 0) + @{ + unsigned long int n = *in++; + if (--len > 0) + @{ + n = (n << 8) | *in++; + if (--len > 0) + n = (n << 8) | *in; + @} + memcpy (cp, l64a (htonl (n)), 6); + cp += 6; + @} + *cp = '\0'; + return out; +@} +@end smallexample + +It is strange that the library does not provide the complete +functionality needed but so be it. There are some other encoding +methods which are much more widely used (UU encoding, Base64 encoding). +Generally, it is better to use one of these encodings. + To decode data produced with @code{l64a} the following function should be used. +@comment stdlib.h +@comment XPG @deftypefun {long int} a64l (const char *@var{string}) The parameter @var{string} should contain a string which was produced by a call to @code{l64a}. The function processes the next 6 characters and @@ -1205,17 +1265,17 @@ characters. @node Argz and Envz Vectors @section Argz and Envz Vectors -@cindex argz vectors +@cindex argz vectors (string vectors) @cindex string vectors, null-character separated @cindex argument vectors, null-character separated @dfn{argz vectors} are vectors of strings in a contiguous block of memory, each element separated from its neighbors by null-characters (@code{'\0'}). -@cindex envz vectors +@cindex envz vectors (environment vectors) @cindex environment vectors, null-character separated @dfn{Envz vectors} are an extension of argz vectors where each element is a -name-value pair, separated by a @code{'='} character (as in a unix +name-value pair, separated by a @code{'='} character (as in a Unix environment). @menu @@ -1247,13 +1307,17 @@ allocation error occurs. @pindex argz.h These functions are declared in the standard include file @file{argz.h}. +@comment argz.h +@comment GNU @deftypefun {error_t} argz_create (char *const @var{argv}[], char **@var{argz}, size_t *@var{argz_len}) -The @code{argz_create} function converts the unix-style argument vector +The @code{argz_create} function converts the Unix-style argument vector @var{argv} (a vector of pointers to normal C strings, terminated by @code{(char *)0}; @pxref{Program Arguments}) into an argz vector with the same elements, which is returned in @var{argz} and @var{argz_len}. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {error_t} argz_create_sep (const char *@var{string}, int @var{sep}, char **@var{argz}, size_t *@var{argz_len}) The @code{argz_create_sep} function converts the null-terminated string @var{string} into an argz vector (returned in @var{argz} and @@ -1261,14 +1325,18 @@ The @code{argz_create_sep} function converts the null-terminated string character @var{sep}. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {size_t} argz_count (const char *@var{argz}, size_t @var{arg_len}) Returns the number of elements in the argz vector @var{argz} and @var{argz_len}. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {void} argz_extract (char *@var{argz}, size_t @var{argz_len}, char **@var{argv}) The @code{argz_extract} function converts the argz vector @var{argz} and -@var{argz_len} into a unix-style argument vector stored in @var{argv}, +@var{argz_len} into a Unix-style argument vector stored in @var{argv}, by putting pointers to every element in @var{argz} into successive positions in @var{argv}, followed by a terminator of @code{0}. @var{Argv} must be pre-allocated with enough space to hold all the @@ -1281,6 +1349,8 @@ still active. This function is useful for passing the elements in @var{argz} to an exec function (@pxref{Executing a File}). @end deftypefun +@comment argz.h +@comment GNU @deftypefun {void} argz_stringify (char *@var{argz}, size_t @var{len}, int @var{sep}) The @code{argz_stringify} converts @var{argz} into a normal string with the elements separated by the character @var{sep}, by replacing each @@ -1289,20 +1359,26 @@ string) with @var{sep}. This is handy for printing @var{argz} in a readable manner. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {error_t} argz_add (char **@var{argz}, size_t *@var{argz_len}, const char *@var{str}) The @code{argz_add} function adds the string @var{str} to the end of the argz vector @code{*@var{argz}}, and updates @code{*@var{argz}} and @code{*@var{argz_len}} accordingly. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {error_t} argz_add_sep (char **@var{argz}, size_t *@var{argz_len}, const char *@var{str}, int @var{delim}) The @code{argz_add_sep} function is similar to @code{argz_add}, but @var{str} is split into separate elements in the result at occurances of the character @var{delim}. This is useful, for instance, for -adding the components of a unix search path to an argz vector, by using +adding the components of a Unix search path to an argz vector, by using a value of @code{':'} for @var{delim}. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {error_t} argz_append (char **@var{argz}, size_t *@var{argz_len}, const char *@var{buf}, size_t @var{buf_len}) The @code{argz_append} function appends @var{buf_len} bytes starting at @var{buf} to the argz vector @code{*@var{argz}}, reallocating @@ -1310,6 +1386,8 @@ The @code{argz_append} function appends @var{buf_len} bytes starting at @code{*@var{argz_len}}. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {error_t} argz_delete (char **@var{argz}, size_t *@var{argz_len}, char *@var{entry}) If @var{entry} points to the beginning of one of the elements in the argz vector @code{*@var{argz}}, the @code{argz_delete} function will @@ -1319,6 +1397,8 @@ destructive argz functions usually reallocate their argz argument, pointers into argz vectors such as @var{entry} will then become invalid. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {error_t} argz_insert (char **@var{argz}, size_t *@var{argz_len}, char *@var{before}, const char *@var{entry}) The @code{argz_insert} function inserts the string @var{entry} into the argz vector @code{*@var{argz}} at a point just before the existing @@ -1330,6 +1410,8 @@ is @code{0}, @var{entry} is added to the end instead (as if by @var{before} will result in @var{entry} being inserted at the beginning. @end deftypefun +@comment argz.h +@comment GNU @deftypefun {char *} argz_next (char *@var{argz}, size_t @var{argz_len}, const char *@var{entry}) The @code{argz_next} function provides a convenient way of iterating over the elements in the argz vector @var{argz}. It returns a pointer @@ -1387,6 +1469,8 @@ fail) have a return type of @code{error_t}, and return either @code{0} or @pindex envz.h These functions are declared in the standard include file @file{envz.h}. +@comment envz.h +@comment GNU @deftypefun {char *} envz_entry (const char *@var{envz}, size_t @var{envz_len}, const char *@var{name}) The @code{envz_entry} function finds the entry in @var{envz} with the name @var{name}, and returns a pointer to the whole entry---that is, the argz @@ -1394,6 +1478,8 @@ element which begins with @var{name} followed by a @code{'='} character. If there is no entry with that name, @code{0} is returned. @end deftypefun +@comment envz.h +@comment GNU @deftypefun {char *} envz_get (const char *@var{envz}, size_t @var{envz_len}, const char *@var{name}) The @code{envz_get} function finds the entry in @var{envz} with the name @var{name} (like @code{envz_entry}), and returns a pointer to the value @@ -1401,6 +1487,8 @@ portion of that entry (following the @code{'='}). If there is no entry with that name (or only a null entry), @code{0} is returned. @end deftypefun +@comment envz.h +@comment GNU @deftypefun {error_t} envz_add (char **@var{envz}, size_t *@var{envz_len}, const char *@var{name}, const char *@var{value}) The @code{envz_add} function adds an entry to @code{*@var{envz}} (updating @code{*@var{envz}} and @code{*@var{envz_len}}) with the name @@ -1410,6 +1498,8 @@ already exists in @var{envz}, it is removed first. If @var{value} is (mentioned above). @end deftypefun +@comment envz.h +@comment GNU @deftypefun {error_t} envz_merge (char **@var{envz}, size_t *@var{envz_len}, const char *@var{envz2}, size_t @var{envz2_len}, int @var{override}) The @code{envz_merge} function adds each entry in @var{envz2} to @var{envz}, as if with @code{envz_add}, updating @code{*@var{envz}} and @@ -1421,6 +1511,8 @@ entry in @var{envz} can prevent an entry of the same name in @var{envz2} from being added to @var{envz}, if @var{override} is false. @end deftypefun +@comment envz.h +@comment GNU @deftypefun {void} envz_strip (char **@var{envz}, size_t *@var{envz_len}) The @code{envz_strip} function removes any null entries from @var{envz}, updating @code{*@var{envz}} and @code{*@var{envz_len}}. diff --git a/math/carg.c b/math/carg.c index fb4dc8e52e..c977a39ebc 100644 --- a/math/carg.c +++ b/math/carg.c @@ -27,3 +27,7 @@ __carg (__complex__ double x) return __atan2 (__imag__ x, __real__ x); } weak_alias (__carg, carg) +#ifdef NO_LONG_DOUBLE +strong_alias (__carg, __cargl) +weak_alias (__carg, cargl) +#endif diff --git a/math/libm-test.c b/math/libm-test.c index 866313e963..b66371c212 100644 --- a/math/libm-test.c +++ b/math/libm-test.c @@ -3915,7 +3915,8 @@ cpow_test (void) check ("imag(cpow (1 + i0), (0 + i0)) = 0", __imag__ result, 0); result = FUNC (cpow) (BUILD_COMPLEX (2, 0), BUILD_COMPLEX (10, 0)); - check ("real(cpow (2 + i0), (10 + i0)) = 1024", __real__ result, 1024); + check_eps ("real(cpow (2 + i0), (10 + i0)) = 1024", __real__ result, 1024, + CHOOSE (2e-16L, 0, 0)); check ("imag(cpow (2 + i0), (10 + i0)) = 0", __imag__ result, 0); } @@ -4158,7 +4159,7 @@ static void identities (void) { identities1_test (0.2L, CHOOSE (1e-18L, 0, 2e-7)); - identities1_test (0.9L, CHOOSE (1e-18L, 0, 0)); + identities1_test (0.9L, CHOOSE (1e-18L, 0, 1e-7)); identities1_test (0, 0); identities1_test (-1, CHOOSE (1e-18L, 0, 1e-7)); diff --git a/posix/unistd.h b/posix/unistd.h index 868e7a48e0..b550d2c6f4 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -30,14 +30,15 @@ __BEGIN_DECLS /* These may be used to determine what facilities are present at compile time. Their values can be obtained at run time from `sysconf'. */ -/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988 and - extended by P1003.1b (aka POSIX.4). */ -#define _POSIX_VERSION 199309L +/* POSIX Standard approved as ISO/IEC 9945-1 as of August, 1988 and + extended by POSIX-1b (aka POSIX-4) and POSIX-1c (aka POSIX threads). */ +#define _POSIX_VERSION 199506L /* These are not #ifdef __USE_POSIX2 because they are in the theoretically application-owned namespace. */ -#define _POSIX2_C_VERSION 199209L /* Invalid until 1003.2 is done. */ +/* POSIX Standard approved as ISO/IEC 9945-2 as of December, 1993. */ +#define _POSIX2_C_VERSION 199209L /* If defined, the implementation supports the C Language Bindings Option. */ @@ -287,6 +288,7 @@ extern int chdir __P ((__const char *__path)); #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Change the process's working directory to the one FD is open on. */ +extern int __fchdir __P ((int __fd)); extern int fchdir __P ((int __fd)); #endif diff --git a/rpm/Makefile b/rpm/Makefile index 22544506f6..b83b8ea9e9 100644 --- a/rpm/Makefile +++ b/rpm/Makefile @@ -9,8 +9,8 @@ include ../Makeconfig include $(common-objpfx)soversions.mk include $(common-objpfx)version.mk -distinfo := $(common-objpfx)distinfo- \ - $(wildcard $(subdirs:%=$(common-objpfx)distinfo-%)) +distinfo := $(common-objpfx)distinfo \ + $(wildcard $(subdirs:%=$(common-objpfx)%/distinfo)) -include $(distinfo) config = $(config-machine)-$(config-vendor)-$(config-os) @@ -32,14 +32,15 @@ install-others := $(-install-others) \ install-sysconf := $(filter $(sysconfdir)/%,$(install-others)) install-others := $(filter-out $(sysconfdir)/%,$(install-others)) -# Add the unversioned lib*.so's to install-lib. -install-lib += $(install-lib.so) +# Add the unversioned lib*.so's. +install-slib = $(install-lib.so) -# For each versioned lib*.so, add three files: -# lib*-VERSION.so, lib*.so.MAJOR, and lib*.so -install-lib += $(foreach lib,$(versioned),\ - $(patsubst %.so,%-$(version).so,$(lib)) \ - $(lib)$($(lib)-version) $(lib)) +# For each versioned lib*.so, add two files: +# lib*-VERSION.so and lib*.so.MAJOR +install-slib += $(foreach lib,$(versioned),\ + $(patsubst %.so,%-$(version).so,$(lib)) \ + $(lib)$($(lib)-version)) +install-lib += $(versioned) # Add libc.a and libc_p.a. install-lib += $(foreach o,$(filter-out .so,$(object-suffixes)),\ @@ -48,18 +49,17 @@ install-lib += $(foreach o,$(filter-out .so,$(object-suffixes)),\ ifeq (yes,$(build-shared)) # Add libc.so itself, which is a special case in Makerules. ifndef libc.so-version -install-others += $(slibdir)/libc.so +install-slib += libc.so else -install-others += $(libdir)/libc.so \ - $(slibdir)/libc-$(version).so \ - $(slibdir)/libc.so$(libc.so-version) +install-lib += libc.so +install-slib += libc-$(version).so libc.so$(libc.so-version) endif endif all: glibc-$(version).$(config).rpm -instvars = include lib bin sbin data others +instvars = include lib slib bin sbin data others # Generate the rpm spec file for this configuration. $(config): template $(distinfo) Makefile diff --git a/sunrpc/Makefile b/sunrpc/Makefile index 5effc5ecbe..b5ed91dc3f 100644 --- a/sunrpc/Makefile +++ b/sunrpc/Makefile @@ -124,8 +124,6 @@ $(inst_includedir)/rpcsvc/bootparam_prot.h: \ # Install the rpc data base file. $(inst_sysconfdir)/rpc: etc.rpc $(do-install) - -defines := $(defines) -D_PATH_RPC='"$(sysconfdir)/rpc"' # Generate the rpcsvc headers with rpcgen. # We use a stamp file to avoid unnessary recompilation each time rpcgen is diff --git a/sysdeps/ieee754/nan.h b/sysdeps/ieee754/nan.h index d4e6842562..499edbac8c 100644 --- a/sysdeps/ieee754/nan.h +++ b/sysdeps/ieee754/nan.h @@ -32,7 +32,7 @@ #define NANF \ (__extension__ \ - ((union { unsigned __l __attribute__((__mode__(__SI__))); flaot __d; }) \ + ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \ { __l: 0x7fc00000UL }).__d) #else diff --git a/sysdeps/libm-ieee754/s_erf.c b/sysdeps/libm-ieee754/s_erf.c index 022cf11abe..f64f0fcefd 100644 --- a/sysdeps/libm-ieee754/s_erf.c +++ b/sysdeps/libm-ieee754/s_erf.c @@ -247,6 +247,10 @@ sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ if(hx>=0) return one-r/x; else return r/x-one; } weak_alias (__erf, erf) +#ifdef NO_LONG_DOUBLE +strong_alias (__erf, __erfl) +weak_alias (__erf, erfl) +#endif #ifdef __STDC__ double __erfc(double x) diff --git a/sysdeps/libm-ieee754/s_fdim.c b/sysdeps/libm-ieee754/s_fdim.c index cdd7886068..b45c413cb8 100644 --- a/sysdeps/libm-ieee754/s_fdim.c +++ b/sysdeps/libm-ieee754/s_fdim.c @@ -34,3 +34,7 @@ __fdim (double x, double y) return x < y ? 0 : x - y; } weak_alias (__fdim, fdim) +#ifdef NO_LONG_DOUBLE +strong_alias (__fdim, __fdiml) +weak_alias (__fdim, fdiml) +#endif diff --git a/sysdeps/libm-ieee754/s_fmax.c b/sysdeps/libm-ieee754/s_fmax.c index 651def8aac..bc6af7286c 100644 --- a/sysdeps/libm-ieee754/s_fmax.c +++ b/sysdeps/libm-ieee754/s_fmax.c @@ -27,3 +27,7 @@ __fmax (double x, double y) return (isgreaterequal (x, y) || isnan (y)) ? x : y; } weak_alias (__fmax, fmax) +#ifdef NO_LONG_DOUBLE +strong_alias (__fmax, __fmaxl) +weak_alias (__fmax, fmaxl) +#endif diff --git a/sysdeps/libm-ieee754/s_fmin.c b/sysdeps/libm-ieee754/s_fmin.c index 2a49a2e069..f9a937c850 100644 --- a/sysdeps/libm-ieee754/s_fmin.c +++ b/sysdeps/libm-ieee754/s_fmin.c @@ -27,3 +27,7 @@ __fmin (double x, double y) return (islessequal (x, y) || isnan (y)) ? x : y; } weak_alias (__fmin, fmin) +#ifdef NO_LONG_DOUBLE +strong_alias (__fmim, __fminl) +weak_alias (__fmin, fminl) +#endif diff --git a/sysdeps/libm-ieee754/s_log2.c b/sysdeps/libm-ieee754/s_log2.c index 7950dfa420..46b53cfeff 100644 --- a/sysdeps/libm-ieee754/s_log2.c +++ b/sysdeps/libm-ieee754/s_log2.c @@ -129,3 +129,7 @@ static double zero = 0.0; } weak_alias (__log2, log2) +#ifdef NO_LONG_DOUBLE +strong_alias (__log2, __log2l) +weak_alias (__log2, log2l) +#endif diff --git a/sysdeps/libm-ieee754/s_nan.c b/sysdeps/libm-ieee754/s_nan.c index 1d2319cbd8..ff3b26855f 100644 --- a/sysdeps/libm-ieee754/s_nan.c +++ b/sysdeps/libm-ieee754/s_nan.c @@ -28,9 +28,6 @@ double __nan (const char *tagp) { - static const union ieee754_double nan_value = - { ieee: { mantissa1: 0, mantissa0: 0x80000, exponent: 0x7ff, negative: 0 } }; - if (tagp[0] != '\0') { char buf[6 + strlen (tagp)]; @@ -38,6 +35,10 @@ __nan (const char *tagp) return strtod (buf, NULL); } - return nan_value.d; + return NAN; } weak_alias (__nan, nan) +#ifdef NO_LONG_DOUBLE +strong_alias (__nan, __nanl) +weak_alias (__nan, nanl) +#endif diff --git a/sysdeps/libm-ieee754/s_nanf.c b/sysdeps/libm-ieee754/s_nanf.c index 56fb9e7e3d..862327aa1e 100644 --- a/sysdeps/libm-ieee754/s_nanf.c +++ b/sysdeps/libm-ieee754/s_nanf.c @@ -28,9 +28,6 @@ float __nanf (const char *tagp) { - static const union ieee754_float nan_value = - { ieee: { mantissa: 0x400000, exponent: 0xff, negative: 0 } }; - if (tagp[0] != '\0') { char buf[6 + strlen (tagp)]; @@ -38,6 +35,6 @@ __nanf (const char *tagp) return strtof (buf, NULL); } - return nan_value.f; + return NANF; } weak_alias (__nanf, nanf) diff --git a/sysdeps/libm-ieee754/s_nanl.c b/sysdeps/libm-ieee754/s_nanl.c index 279e070492..223f95082e 100644 --- a/sysdeps/libm-ieee754/s_nanl.c +++ b/sysdeps/libm-ieee754/s_nanl.c @@ -28,10 +28,6 @@ long double __nanl (const char *tagp) { - static const union ieee854_long_double nan_value = - { ieee: { mantissa1: 0, mantissa0: 0xc0000000, - exponent: 0x7fff, negative: 0 } }; - if (tagp[0] != '\0') { char buf[6 + strlen (tagp)]; @@ -39,6 +35,6 @@ __nanl (const char *tagp) return strtold (buf, NULL); } - return nan_value.d; + return NANL; } weak_alias (__nanl, nanl) diff --git a/sysdeps/libm-ieee754/s_remquo.c b/sysdeps/libm-ieee754/s_remquo.c index 4103155e3f..f0a32130a2 100644 --- a/sysdeps/libm-ieee754/s_remquo.c +++ b/sysdeps/libm-ieee754/s_remquo.c @@ -110,3 +110,7 @@ __remquo (double x, double y, int *quo) return x; } weak_alias (__remquo, remquo) +#ifdef NO_LONG_DOUBLE +strong_alias (__remquo, __remquol) +weak_alias (__remquo, remquol) +#endif diff --git a/sysdeps/m68k/fpu/__math.h b/sysdeps/m68k/fpu/__math.h index 5dc4d2e066..fd90a2de1b 100644 --- a/sysdeps/m68k/fpu/__math.h +++ b/sysdeps/m68k/fpu/__math.h @@ -414,7 +414,7 @@ __inline_forward(void,sincosl, #define isgreater(x, y) \ __extension__ \ ({ char __result; \ - __asm__ ("fcmp %2,%1; fsogt %0" \ + __asm__ ("fcmp%.x %2,%1; fsogt %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) @@ -422,7 +422,7 @@ __inline_forward(void,sincosl, #define isgreaterequal(x, y) \ __extension__ \ ({ char __result; \ - __asm__ ("fcmp %2,%1; fsoge %0" \ + __asm__ ("fcmp%.x %2,%1; fsoge %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) @@ -430,7 +430,7 @@ __inline_forward(void,sincosl, #define isless(x, y) \ __extension__ \ ({ char __result; \ - __asm__ ("fcmp %2,%1; fsolt %0" \ + __asm__ ("fcmp%.x %2,%1; fsolt %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) @@ -438,7 +438,7 @@ __inline_forward(void,sincosl, #define islessequal(x, y) \ __extension__ \ ({ char __result; \ - __asm__ ("fcmp %2,%1; fsole %0" \ + __asm__ ("fcmp%.x %2,%1; fsole %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) @@ -446,7 +446,7 @@ __inline_forward(void,sincosl, #define islessgreater(x, y) \ __extension__ \ ({ char __result; \ - __asm__ ("fcmp %2,%1; fsogl %0" \ + __asm__ ("fcmp%.x %2,%1; fsogl %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) @@ -454,7 +454,7 @@ __inline_forward(void,sincosl, #define isunordered(x, y) \ __extension__ \ ({ char __result; \ - __asm__ ("fcmp %2,%1; fsun %0" \ + __asm__ ("fcmp%.x %2,%1; fsun %0" \ : "=dm" (__result) : "f" (x), "f" (y)); \ (int) __result; }) #endif diff --git a/sysdeps/m68k/fpu/fraiseexcpt.c b/sysdeps/m68k/fpu/fraiseexcpt.c index b6ff82760d..51411dd292 100644 --- a/sysdeps/m68k/fpu/fraiseexcpt.c +++ b/sysdeps/m68k/fpu/fraiseexcpt.c @@ -34,9 +34,8 @@ feraiseexcept (int excepts) if (excepts & FE_INVALID) { /* One example of a invalid operation is 0 * Infinity. */ - double d = 0.0 * HUGE_VAL; - /* Now force the exception. */ - __asm__ __volatile__ ("fnop" : : "f" (d)); + double d = HUGE_VAL; + __asm__ __volatile__ ("fmul%.s %#0r0,%0; fnop" : "=f" (d) : "0" (d)); } /* Next: division by zero. */ @@ -49,26 +48,21 @@ feraiseexcept (int excepts) /* Next: overflow. */ if (excepts & FE_OVERFLOW) { - long double d = LDBL_MAX * LDBL_MAX; - /* Now force the exception. */ - __asm__ __volatile__ ("fnop" : : "f" (d)); + long double d = LDBL_MAX; + __asm__ __volatile__ ("fmul%.x %0,%0; fnop" : "=f" (d) : "0" (d)); } /* Next: underflow. */ if (excepts & FE_UNDERFLOW) { - long double d = LDBL_MIN / 16.0; - /* Now force the exception. */ - __asm__ __volatile__ ("fnop" : : "f" (d)); + long double d = LDBL_MIN; + __asm__ __volatile__ ("fdiv%.s %#0r16,%0; fnop" : "=f" (d) : "0" (d)); } /* Last: inexact. */ if (excepts & FE_INEXACT) { - long double d1, d2 = 1.0; - __asm__ __volatile__ ("fmovecr %#0,%0\n\t" - "fdiv%.x %1,%0\n\t" - "fnop" - : "=&f" (d1) : "f" (d2)); + long double d = 1.0; + __asm__ __volatile__ ("fdiv%.s %#0r3,%0; fnop" : "=f" (d) : "0" (d)); } } diff --git a/sysdeps/m68k/huge_val.h b/sysdeps/m68k/huge_val.h index 8d45aaec2b..c71454e9a8 100644 --- a/sysdeps/m68k/huge_val.h +++ b/sysdeps/m68k/huge_val.h @@ -26,15 +26,19 @@ /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ -#define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } - -#define __huge_val_t union { unsigned char __c[8]; double __d; } #ifdef __GNUC__ -#define HUGE_VAL (__extension__ \ - ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d) -#else /* Not GCC. */ -static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; + +#define HUGE_VAL \ + (__extension__ \ + ((union { unsigned long long __l; double __d; }) \ + { __l: 0x7ff0000000000000ULL }).__d) + +#else /* not GCC */ + +static union { unsigned char __c[8]; double __d; } __huge_val = + { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; #define HUGE_VAL (__huge_val.__d) + #endif /* GCC. */ @@ -42,27 +46,28 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; #ifdef __USE_ISOC9X -#define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } +#ifdef __GNUC__ -#define __huge_valf_t union { unsigned char __c[4]; float __f; } -#ifdef __GNUC__ -#define HUGE_VALF (__extension__ \ - ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f) -#else /* Not GCC. */ -static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; -#define HUGE_VALF (__huge_valf.__f) -#endif /* GCC. */ +#define HUGE_VALF \ + (__extension__ \ + ((union { unsigned long __l; float __f; }) \ + { __l: 0x7f800000UL }).__f) +#define HUGE_VALL \ + (__extension__ \ + ((union { unsigned long __l[3]; long double __ld; }) \ + { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld) -#define __HUGE_VALL_bytes { 0x7f, 0xff, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +#else /* not GCC */ -#define __huge_vall_t union { unsigned char __c[12]; long double __ld; } -#ifdef __GNUC__ -#define HUGE_VALL (__extension__ \ - ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld) -#else /* Not GCC. */ -static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; +static union { unsigned char __c[4]; float __f; } __huge_valf = + { { 0x7f, 0x80, 0, 0 } }; +#define HUGE_VALF (__huge_valf.__f) + +static union { unsigned char __c[12]; long double __ld; } __huge_vall = + { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } }; #define HUGE_VALL (__huge_vall.__ld) + #endif /* GCC. */ #endif /* __USE_ISOC9X. */ diff --git a/sysdeps/m68k/nan.h b/sysdeps/m68k/nan.h new file mode 100644 index 0000000000..b4efddfe91 --- /dev/null +++ b/sysdeps/m68k/nan.h @@ -0,0 +1,59 @@ +/* `NAN' constants for m68k. + Copyright (C) 1997 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _NAN_H + +#define _NAN_H 1 + +/* IEEE Not A Number. */ + +#ifdef __GNUC__ + +#define NAN \ + (__extension__ \ + ((union { unsigned long long __l; double __d; }) \ + { __l: 0x7fffffffffffffffULL }).__d) + +#define NANF \ + (__extension__ \ + ((union { unsigned long __l; float __f; }) \ + { __l: 0x7fffffffUL }).__f) + +#define NANL \ + (__extension__ \ + ((union { unsigned long __l[3]; long double __ld; }) \ + { __l: { 0x7fff0000UL, 0xffffffffUL, 0xffffffffUL } }).__ld) + +#else + +static union { unsigned char __c[8]; double __d; } __nan = + { { 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } }; +#define NAN (__nan.__d) + +static union { unsigned char __c[4]; float __f; } __nanf = + { { 0x7f, 0xff, 0xff, 0xff } }; +#define NANF (__nanf.__f) + +static union { unsigned char __c[12]; long double __ld; } __nanl = + { { 0x7f, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } }; +#define NANL (__nanl.__ld) + +#endif /* GCC. */ + +#endif /* nan.h */ -- cgit v1.2.3