-GNU C Library NEWS -- history of user-visible changes. 24 February 1995
+GNU C Library NEWS -- history of user-visible changes. 21 March 1995
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
See the end for copying conditions.
of many files which contained only symbol aliases, reducing the size of
the source and the compiled library; many other files were renamed to
less cryptic names previously occupied by the symbol alias files.
+ There is a new header file <elf.h> and new library `-lelf' for
+ programs which operate on files in the ELF format.
+
+* Converted to Autoconf version 2, so `configure' has more options.
+ Run `configure --help' to see the details.
+
+* The library can now be configured to build profiling, highly-optimized
+ (but undebuggable), and/or shared libraries (ELF with GNU ld only).
+ The `--enable-profile', `--enable-omitfp', and `--enable-shared'
+ options to `configure' enable building these extra libraries.
+ The shared library is built by default when using both ELF and GNU ld.
+
+* The new functions `strtoq' and `strtouq' parse integer values from
+ strings, like `strtol' and `strtoul', but they return `long long int' and
+ `unsigned long long int' values, respectively (64-bit quantities).
+
+* The new functions `strtof' and `strtold' parse floating-point values from
+ strings, like `strtod', but they return `float' and `long double' values,
+ respectively (on some machines `double' and `long double' are the same).
+
+* Ulrich Drepper has contributed new implementations of the floating-point
+ printing and reading code used in the `printf' family of functions and
+ `strtod', `strtof', and `strtold'. These new functions are perfectly
+ accurate, and much faster than the old ones.
+
+* The new header <langinfo.h> defines an interface for accessing
+ various locale-dependent data (using the locale chosen with `setlocale').
+
+* You can now use positional parameter specifications in format strings
+ for the `printf' and `scanf' families of functions. For example,
+ `printf ("Number %2$d, Mr %1$s\n", "Jones", 6);'' prints
+ ``Number 6, Mr Jones''. This is mainly useful when providing different
+ format strings for different languages, whose grammar may dictate
+ a different ordering of the values being printed. To support this
+ feature, the interface for `register_printf_handler' has changed; see
+ the header file <printf.h>.
+
+* The `printf' and `scanf' families of functions now understand a new
+ formatting flag for numeric conversions: the ' flag (e.g. %'d or %'f) says
+ to group numbers as indicated by the locale; for `scanf' and friends, this
+ says to accept as valid only a number with all the proper grouping
+ separators in the right places. In the default "C" locale, numbers are
+ not grouped; but locales for specific countries will define the usual
+ conventions (i.e. separate thousands with `,' in the US locale).
* The pgrp functions have been regularized, slightly incompatibly but much
less confusingly. The core functions are now `getpgid' and `setpgid',
* The new header file <fts.h> and suite of functions simplify programs that
operate on directory trees. This code comes from 4.4 BSD.
-* Converted to Autoconf version 2, so `configure' has more options.
- Run `configure --help' to see the details.
-
* The resolver code has been updated from the BIND-4.9.3-BETA14 release.
* The new function `malloc_find_object_address' finds the starting address
of a malloc'd block, given any address within the block. This can be
useful for debugging.
-* The new functions `strtoq' and `strtouq' parse integer values from
- strings, like `strtol' and `strtoul', but they return `long long int' and
- `unsigned long long int' values, respectively (64-bit quantities).
-
-* The new functions `strtof' and `strtold' parse floating-point values from
- strings, like `strtod', but they return `float' and `long double' values,
- respectively (on some machines `double' and `long double' are the same).
-
* There is a new malloc debugging hook `__memalign_hook'.
* There are new typedefs `ushort' for `unsigned short int' and `uint' for
* The `-lmcheck' library to enable standard malloc debugging hooks is now
done differently, so that it works even without GNU ld.
-* Ulrich Drepper has contributed new implementations of the floating-point
- printing and reading code used in the `printf' family of functions and
- `strtod', `strtof', and `strtold'. These new functions are perfectly
- accurate, and much faster than the old ones.
-
-* The `printf' family of functions now understand a new formatting flag
- for numeric conversions: the ' flag (e.g. %'d or %'f) says to group
- numbers as indicated by the locale. In the default "C" locale, numbers
- are not grouped; but locales for specific countries will define the
- usual conventions (i.e. separate thousands with `,' in the US locale).
-
* New function `euidaccess' checks allowed access to a file like `access',
but using the effective IDs instead of the real IDs.
+
+* The time zone data files have been updated for the latest and greatest
+ local time conventions of the countries of the world.
+
+* The new function `dirfd' extracts the file descriptor used by a DIR stream;
+ see <dirent.h>.
+
+* The new functions `ecvt', `fcvt', and `gcvt' provide an obsolete interface
+ for formatting floating-point numbers. They are provided only for
+ compatibility; new programs should use `sprintf' instead.
\f
Version 1.09
struct locale_data *
_nl_load_locale (int category, char **name)
{
- char *file;
int fd;
struct
{
*name = (char *) "local";
}
-/* XXX can't use asprintf here */
- if (asprintf (&file, "%s%s/%s",
- strchr (*name, '/') != NULL ? "" : "/share/locale/", /* XXX */
- *name, _nl_category_names[category]) == -1)
- return NULL;
-
- fd = __open (file, O_RDONLY);
- free (file);
- if (fd < 0)
- return NULL;
- if (__fstat (fd, &st) < 0)
- goto puntfd;
+ {
+ const char localedir[] = "/share/locale/"; /* XXX */
+ const char *catname = _nl_category_names[category];
+ size_t namelen = strlen (*name);
+ size_t catlen = strlen (catname);
+ char file[sizeof localedir + namelen + catlen * 2 + 4];
+ sprintf (file, "%s%s/%s",
+ strchr (*name, '/') != NULL ? "" : localedir, *name, catname);
+ fd = __open (file, O_RDONLY);
+ if (fd < 0)
+ return NULL;
+ if (__fstat (fd, &st) < 0)
+ goto puntfd;
+ if (S_ISDIR (st.st_mode))
+ {
+ /* LOCALE/LC_* is a directory; open LOCALE/LC_*/SYS_LC_* instead. */
+ __close (fd);
+ memcpy (stpcpy (strchr (file, '\0'), "SYS_"), catname, catlen);
+ fd = __open (file, O_RDONLY);
+ if (fd < 0)
+ return NULL;
+ if (__fstat (fd, &st) < 0)
+ goto puntfd;
+ }
+ }
{
/* Map in the file's data. */
remove rename \
memstream obstream \
internals sysd-stdio pipestream stdio_init libc_fatal
-
-# Several mpn functions from GNU MP are used by the printf_fp function.
-mpn-routines := add_1 add_n addmul_1 cmp divmod divmod_1 udiv_qrnnd \
- lshift rshift mod_1 mul mul_1 mul_n sub_n submul_1
-mpn-headers = longlong.h gmp.h gmp-impl.h gmp-mparam.h asm-syntax.h
-
-routines := $(strip $(routines) $(mpn-routines)) \
- dbl2mpn ldbl2mpn \
- mpn2flt mpn2dbl mpn2ldbl
-aux := errlist siglist defs glue mp_clz_tab fpioconst
-distribute = $(mpn-headers) gen-mpn-copy _itoa.h fpioconst.h
+aux := errlist siglist defs glue
+distribute := _itoa.h
tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
temptest tst-fileno test-fwrite \
include ../Rules
-
-
-ifdef gmp-srcdir
-
-gmp-srcdir := $(firstword $(filter-out ..//%,$(..)$(gmp-srcdir) $(gmp-srcdir)))
-
-# Copy the mpn source files we use from the GNU MP source directory.
-# `gmp-srcdir' is set by doing `configure --with-gmp=DIR'.
-# (Do not try this at home. You need an as yet unreleased version of GNU MP.)
-
-mpn-sysdep := $(addsuffix .c,$(mpn-routines)) \
- $(addsuffix .S,$(mpn-routines)) \
- $(addsuffix .s,$(mpn-routines)) gmp-mparam.h asm-syntax.h
-
-mpn-try := $(addprefix $(gmp-srcdir)/mpn/*/,$(mpn-sysdep))
-mpn-found := $(wildcard $(mpn-try))
-mpn-found := $(filter-out $(patsubst %.S,%.s,$(filter %.s,$(mpn-found))),\
- $(mpn-found))
-
-include mpn-copy.mk
-%.mk: gen-%; sh $< > $@
-
-mpn-copy-1 := $(patsubst $(gmp-srcdir)/mpn/%,$(sysdep_dir)/%,$(mpn-found))
-mpn-copy-sysdep := $(mpn-copy-sysdep) $(mpn-copy-1)
-$(mpn-copy-1): $(sysdep_dir)/%: $(ignore gmp2glibc.sed) $(gmp-srcdir)/mpn/%
- $(gmp2glibc)
-
-mpn-stuff = $(mpn-copy-sysdep) $(mpn-copy)
-
-# chmod so I don't edit them by mistake.
-define gmp2glibc
-$(ignore sed -f $^ > $@-tmp)
-cp $< $@-tmp
-chmod a-w $@-tmp
-mv -f $@-tmp $@
-endef
-
-mpn-copy = $(filter-out $(mpn-sysdep),$(mpn-headers) mp_clz_tab.c)
-$(mpn-copy): %: $(ignore gmp2glibc.sed) $(gmp-srcdir)/%; $(gmp2glibc)
-
-.PHONY: copy-mpn clean-mpn
-copy-mpn: $(mpn-stuff)
-clean-mpn:
- rm -f $(mpn-stuff)
-
-endif