2002-12-13 Ulrich Drepper <drepper@redhat.com>
* misc/syslog.c (log_cleanup): Don't use parameter in
__libc_lock_unlock call, use syslog_lock directly. Adjust callers to
pass NULL instead of a pointer to syslog_lock.
* misc/error.c (strerror_r): Do not declare unless [!_LIBC].
Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
Use strerror_r that is only a macro, even if it is not a function.
(strerror): Check for HAVE_DECL_STRERROR before declaring.
(private_strerror): Use prototypes, not old-style function definition.
(print_errno_message): New function.
Support the POSIX 'int'-flavored strerror_r, as well as the traditional
char*-flavored one.
(error_tail, error, error_at_line): Use it.
2002-10-09 Ulrich Drepper <drepper@redhat.com>
* Versions.def (libc): Add GLIBC_2.3.1.
(libpthread): Add GLIBC_2.3.1.
* include/signal.h: Add libc_hidden_proto for __sigwait, __sigwaitinfo,
and __sigtimedwait.
* signal/Versions: Add __sigtimedwait, __sigwait, and __sigwaitinfo.
* sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Add
libc_hidden_def.
* sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise.
* include/sys/msg.h: Declare __libc_msgrcv and __libc_msgsnd.
* sysdeps/unix/sysv/linux/msgrcv.c (__msgrcv): Rename to __libc_msgrcv
and make old name an alias.
* sysdeps/unix/sysv/linux/msgsnd.c (__msgsnd): Rename to __libc_msgsnd
and make old name an alias.
* sysvipc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_msgrcv and
__libc_msgsnd.
* include/sys/uio.h: Declare __libc_readv and __libc_writev.
* misc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_readv and
__libc_writev.
* sysdeps/generic/readv.c (__readv): Rename to __libc_readv and make
old name an alias.
* sysdeps/posix/readv.c: Likewise
* sysdeps/unix/sysv/aix/readv.c: Likewise.
* sysdeps/unix/sysv/linux/readv.c: Likewise.
* sysdeps/generic/writev.c (__writev): Rename to __libc_writev and make
old name an alias.
* sysdeps/posix/writev.c: Likewise
* sysdeps/unix/sysv/aix/writev.c: Likewise.
* sysdeps/unix/sysv/linux/writev.c: Likewise.
* include/sys/wait.h: Declare __waitid.
* posix/Versions (libc) [GLIBC_PRIVATE]: Add __waitid.
* sysdeps/generic/waitid.c (waitid): Rename to __waitid and make old
name an alias.
* sysdeps/posix/waitid.c: Likewise.
* sysdeps/unix/sysv/aix/waitid.c: Likewise.
* sysdeps/unix/sysv/linux/syscalls.list: Add creat syscall.
2002-10-07 Jakub Jelinek <jakub@redhat.com>
* include/alloca.h (__libc_use_alloca, __libc_alloca_cutoff): New
prototypes.
(__MAX_ALLOCA_CUTOFF): Define.
Include allocalim.h.
* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r,
_nss_dns_gethostbyaddr_r): Use alloca or malloc to allocate
host_buffer depending on __libc_use_alloca.
* resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r,
_nss_dns_getnetbyaddr_r): Use alloca or malloc to allocate
net_buffer depending on __libc_use_alloca.
* resolv/res_query.c (res_nquery): Use alloca or malloc to allocate
buf depending on __libc_use_alloca.
* resolv/gethnamaddr.c (gethostbyname2, gethostbyaddr): Likewise.
* stdio-common/vfprintf.c (vfprintf): Use __libc_use_alloca
instead of hardcoded constants.
Pass proper size argument to alloca and compute end for wide char
version.
* stdio-common/printf_fp.c (__printf_fp): Use __libc_use_alloca
instead of hardcoded constants.
* string/strcoll.c (strcoll): Likewise.
* string/strxfrm.c (strxfrm): Likewise.
* sysdeps/posix/readv.c (__readv): Likewise.
* sysdeps/posix/writev.c (__writev): Likewise.
* sysdeps/generic/allocalim.h: New file.
name to find codeset name (if any) and normalize it. If the
normalized name differs, look up only that in the archive.
* locale/programs/locarchive.c (add_locale_to_archive): If the name
contains a codeset, normalize the codeset store only the normalized
name in the archive. If not, add an alias containing the locale's
normalized codeset name. Apply codeset name normalization when
matching entries in the alias file.
* locale/programs/locarchive.c (delete_locales_from_archive): Don't
decrement HEAD->namehash_used here.
(add_locale): Only need to insert name string when name_offset != 0.
* locale/programs/localedef.c (options): Add -A/--alias-file.
(alias_file): New variable.
(parse_opt): Grok -A, set that.
* locale/programs/localedef.h: Declare it.
* locale/programs/locarchive.c (insert_name): New function, broken out
of ...
(add_locale_to_archive): ... here. Call that.
(add_alias): New function.
(add_locale): New static function, add_locale_to_archive renamed.
(add_locale_to_archive): Call that and use add_alias to add an alias
for the name with codeset if the given name lacks it.
(enlarge_archive): Call add_locale instead of add_locale_to_archive.
* locale/Makefile (routines): Add loadarchive.
* locale/loadarchive.c: New file, started from code by Ulrich Drepper.
(_nl_load_locale_from_archive): New function.
* locale/localeinfo.h: Declare it.
* locale/findlocale.c (_nl_find_locale): If using default locale path,
try _nl_load_locale_from_archive first.
* locale/loadlocale.c (_nl_intern_locale_data): New function,
broken out of _nl_load_locale.
(_nl_load_locale): Call that.
* locale/localeinfo.h: Declare it.
(struct locale_data): Replace member `mmaped' with `alloc', an enum.
(struct locale_data): Remove unused member `options'.
* locale/findlocale.c (_nl_remove_locale): Update uses.
* locale/loadlocale.c (_nl_load_locale, _nl_unload_locale): Likewise.
* locale/C-collate.c: Update initializer.
* locale/C-identification.c: Likewise.
* locale/C-measurement.c: Likewise.
* locale/C-telephone.c: Likewise.
* locale/C-address.c: Likewise.
* locale/C-name.c: Likewise.
* locale/C-paper.c: Likewise.
* locale/C-time.c: Likewise.
* locale/C-numeric.c: Likewise.
* locale/C-monetary.c: Likewise.
* locale/C-messages.c : Likewise.
* locale/C-ctype.c: Likewise.
* locale/hashval.h [! LONGBITS]: Include <limits.h> here and
use CHAR_BIT instead of BITSPERBYTE.
* locale/localeinfo.h (_nl_find_locale, _nl_load_locale,
_nl_unload_locale): Add `internal_function attribute_hidden' to decls.
* locale/findlocale.c (_nl_find_locale): Add internal_function to defn.
(_nl_remove_locale): Likewise.
* locale/loadlocale.c (_nl_load_locale, _nl_unload_locale): Likewise.
* locale/findlocale.c (_nl_default_locale_path): New variable.
(_nl_find_locale): If LOCALE_PATH is null, default to that.
* locale/localeinfo.h: Declare it.
* locale/setlocale.c (setlocale): Use _nl_default_locale_path
in place of LOCALEDIR. If no LOCPATH, pass null to _nl_find_locale.
* locale/newlocale.c (__newlocale): Likewise.
* misc/err.c (vwarnx, vwarn): Fix typos in libc_hidden_def uses.
* inet/rexec.c (rexec_af): Add libc_hidden_def.
* sysdeps/generic/morecore.c: Likewise.
* signal/allocrtsig.c (__libc_current_sigrtmin): Likewise.
(__libc_current_sigrtmax): Likewise.
2002-08-08 Roland McGrath <roland@redhat.com>
* locale/loadlocale.c (_nl_load_locale): Don't use MAP_INHERIT.
* catgets/open_catalog.c (__open_catalog): Likewise.
* locale/programs/locarchive.c (INITIAL_NUM_NAMES): Renamed
from typo INITIAL_NUM_NANES.
(create_archive): Update use.
[USE_TLS && HAVE___THREAD]: Just include the sysdeps/generic file,
which does the right thing when __thread support is available.
* descr.h (struct _pthread_descr_struct) [USE_TLS && HAVE___THREAD]:
Omit `p_libc_specific', `p_errnop', `p_errno', `p_h_errnop',
`p_h_errno', `p_resp', and `p_res' members.
* pthread.c (__pthread_initialize_minimal) [USE_TLS && HAVE___THREAD]:
Don't initialize `p_errnop' and `p_h_errnop' members.
(__pthread_reset_main_thread): Likewise.
(__pthread_initialize_manager): Likewise.
* manager.c (__pthread_manager, pthread_handle_create): Likewise.
* pthread.c (pthread_initialize) [USE_TLS && HAVE___THREAD]:
Don't initialize `p_resp' member.
(__pthread_reset_main_thread): Likewise.
* manager.c (pthread_handle_create): Likewise.
* specific.c (libc_internal_tsd_set, libc_internal_tsd_get):
Conditionalize these on [!(USE_TLS && HAVE___THREAD)].
* errno.c [USE_TLS && HAVE___THREAD]
(__h_errno_location, __res_state): Don't define these at all.
* sysdeps/i386/tls.h (INSTALL_DTV): Add parens around arguments!
(INSTALL_NEW_DTV, GET_DTV): Likewise.
* sysdeps/sh/tls.h (INSTALL_DTV, INSTALL_NEW_DTV, GET_DTV): Likewise.
* weaks.c: Don't include <errno.h> here.
2002-08-01 Roland McGrath <roland@redhat.com>
* sysdeps/i386/tls.h (TLS_DO_MODIFY_LDT): New macro, broken out of
TLS_INIT_TP.
(TLS_DO_SET_THREAD_AREA): New macro, uses thread_set_area syscall.
(TLS_SETUP_GS_SEGMENT): New macro, try one or the other or both.
(TLS_INIT_TP): Use that.
* sysdeps/mach/hurd/chown.c: Use INTDEF for __chown.
* sysdeps/unix/sysv/aix/chown.c: Likewise.
* sysdeps/unix/grantpt.c: Use INTUSE for __chown calls.
* sysdeps/unix/sysv/linux/m68k/chown.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/chown.c: Likewise.
* sysdeps/unix/sysv/linux/i386/chown.c: Use INTDEF2 to define
__chown_internal.
* sysdeps/unix/sysv/linux/s390/s390-32//chown.c: Likewise.
* intl/dcngettext.c [_LIBC]: Use INTUSE for __dcngettext.
* intl/dngettext.c [_LIBC] (DCNGETTEXT): Use INTUSE.
* intl/ngettext.c: Likewise.
* include/sys/socket.h: Declare __connect_internal and define
__connect macro if not NOT_IN_libc.
* sysdeps/mach/hurd/connect.c: Use INTDEF for __connect.
* sysdeps/unix/sysv/aix/connect.c: Likewise.
* sysdeps/unix/sysv/linux/connect.S: Add __connect_internal alias.
* include/unistd.h: Declare __close_internal and define __close macro
if not NOT_IN_libc.
* libio/libioP.h (JUMO0, JUMP1, JUMP2, JUMP3, WJUMP0, WJUMP1, WJUMP2,
WJUMP3): Add extra parenthesis to avoid expanding element names with
macors like __close.
* sysdeps/unix/syscalls.list: Add __close_internal alias.
* include/unistd.h: Declare __dup2_internal and define __dup2 macro
if not NOT_IN_libc.
* sysdeps/mach/hurd/dup2.c: Use INTDEF for __dup2.
* sysdeps/posix/dup2.c: Use INTDEF for __dup2.
* sysdeps/unix/syscalls.list: Add __dup2_internal alias.
* include/unistd.h: Declare __fork_internal and define __fork macro
if not NOT_IN_libc.
* sysdeps/mach/hurd/fork.c: Use INTDEF for __fork.
* sysdeps/unix/sysv/aix/fork.c: Likewise.
* sysdeps/unix/sysv/linux/syscalls.list: Add __fork_internal alias.
* include/stdio_ext.h: Declare __fsetlocking_internal and define
__fsetlocking macro to use it if not NOT_IN_libc.
* libio/__fsetlocking.c: Use INTDEF for __fsetlocking.
* libio/__fbufsize.c: Correct copyright.
* libio/__flbf.c: Likewise.
* libio/__fpending.c: Likewise.
* libio/__fpurge.c: Likewise.
* libio/__freadable.c: Likewise.
* libio/__freading.c: Likewise.
* libio/__fsetlocking.c: Likewise.
* libio/__fwritable.c: Likewise.
* libio/__fwriting.c: Likewise.
* include/stdio.h: Declare __asprintf_internal and define __asprintf
macro to use it if not NOT_IN_libc.
* stdio-common/asprintf.c: Use INTDEF for __asprintf.
* include/mntent.h: Declare __setmntent_internal,
__getmntent_r_internal, __endmntent_internal. Define __setmntent,
__getmntent_r, and __endmntent macros to use these functions if not
NOT_IN_libc.
* misc/mntent_r.c: Use INTDEF for __setmntent, __getmntent_r, and
__endmntent.
* include/math.h: Declare __finite_internal, __finitef_internal, and
__finitel_internal. Redefine isfinite macro if in libc or libm using
these functions.
* sysdeps/generic/s_ldexp.c: Use INTUSE for __finite calls.
* sysdeps/generic/s_ldexpf.c: Use INTUSE for __finitef calls.
* sysdeps/generic/s_ldexpl.c: Use INTUSE for __finitel calls.
* sysdeps/i386/fpu/s_finite.S: Define _internal alias.
* sysdeps/i386/fpu/s_finitef.S: Likewise.
* sysdeps/i386/fpu/s_finitel.S: Likewise.
* sysdeps/ieee754/dbl-64/s_finite.c: Likewise.
* sysdeps/ieee754/flt-32/s_finitef.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_finitel.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_finitel.c: Likewise.
* include/fcntl.h: Declare __fcntl_internal. Define __fcntl macro
to use this function if not NOT_IN_libc.
* libio/iofdopen.c (_IO_fcntl): Use INTUSE.
* sysdeps/generic/fcntl.c: Use INTDEF for __fcntl.
* sysdeps/mach/hurd/fcntl.c: Likewise.
* sysdeps/unix/sysv/aix/fcntl.c: Likewise.
* sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
* include/argz.h: Declare __argz_count_internal and
__argz_stringify_internal.
* intl/l10nflist.c [_LIBC]: Use INTUSE for __argz_count and
__argz_stringify.
* string/argz-count.c: Use INTDEF for __argz_count.
* string/argz-stringify.c: Use INTDEF for __argz_stringify.
* include/stdlib.h: Declare __cxa_atexit_internal and define
__cxa_atexit macro if not NOT_IN_libc.
* stdlib/cxa_atexit.c: Use INTDEF for __cxa_atexit.
* dlfcn/Makefile: Define NOT_IN_libc when compiling modcxaatexit.c.
* assert/assert.c: Use INTDEF for __assert_fail.
* assert/__assert.c: Use INTUSE for call to __assert_fail.
* include/assert.h: Declare __assert_fail_internal.
2002-04-04 Ulrich Drepper <drepper@redhat.com>
* misc/dirname.c (dirname): Ignore trailing slashes at end of
non-null result [PR libc/2600].
* misc/tst-dirname.c: Add more tests.
2002-04-03 Ulrich Drepper <drepper@redhat.com>
* locale/programs/charmap.c (charmap_read): If the charmap doesn't
define a code_set_name provide one based on the filename.
* malloc/hooks.c: Define weak_variable correctly for _LIBC.
2001-12-28 Andreas Jaeger <aj@suse.de>
* time/mktime.c (__mktime_internal): Check for year < 70
[PR libc/2738].
* sysdeps/generic/w_lgamma.c: Initialized local_signgam.
* sysdeps/generic/w_lgammaf.c: Likewise.
* sysdeps/generic/w_lgammal.c: Likewise [PR libc/2854].
* debug/catchsegv.sh (exval): Quote [ in pattern [PR libc/2902].
Adjust for new output format of the backtrace functions.
* misc/syslog.c (vsyslog): Only use cleanup handler if
_LIBC_REENTRANT is defined [PR libc/2924].
* sysdeps/s390/s390-64/bits/byteswap.h: Likewise [PR libc/2757].
2002-03-03 Andreas Jaeger <aj@suse.de>
* elf/nodlopenmod2.c: Provide prototype to avoid warning.
* elf/tst-tlsmod1.c: Likewise.
* posix/regcomp.c: Get regex.h from include dir for internal
prototypes.
* sysdeps/unix/sysv/linux/init-first.c: Move __init_misc prototype
to libc-internal.h and include it.
* include/libc-internal.h: Add __init_misc.
* misc/init-misc.c: Include libc-internal.h for prototypes.
* sysdeps/wordsize-32/divdi3.c: Add prototypes to avoid warnings.
* misc/error.c [_LIBC]: Include libioP.h for prototype of
_IO_putc_internal.
2001-08-30 Ulrich Drepper <drepper@redhat.com>
* string/argz-stringify.c (__argz_stringify): Use __strnlen
instead of strnlen.
* include/string.h (strndupa): Redefine here to use __strnlen
instead of strnlen.
* string/strndup.c (__strndup): Use __strnlen not strnlen.
* misc/syslog.c (vsyslog): Fix typo in last change (connect ->
connected).
2001-08-27 Ulrich Drepper <drepper@redhat.com>
* misc/syslog.c (vsyslog): Try a bit harder to use syslogd. If
the connection went down after we first used it try to connect
again and resend the message before printing to the console.
Reported by Coserea Gh. Tudor <tudore@tudore.gecadsoftware.com>.
2001-08-27 Jakub Jelinek <jakub@redhat.com>
* string/tst-strlen.c (main): Test strnlen (, -1) too.
* sysdeps/generic/strnlen.c (__strnlen): Fix for maxlens with top
bit set.
2001-08-27 Ulrich Drepper <drepper@redhat.com>
* iconv/strtab.c (searchstring): Use correct length for
comparison.
(strtabadd): Account total size correct if new string has old string as
substring.
sysdeps/mach version. Implement counting ("recursive") mutexes
on top of cthreads mutexes.
* sysdeps/mach/hurd/bits/stdio-lock.h: File removed; generic now works.
* sysdeps/generic/bits/stdio-lock.h (_IO_lock_initializer): Define to
_LIBC_LOCK_RECURSIVE_INITIALIZER if defined, else do an #error.
(__libc_cleanup_region_start, __libc_cleanup_region_end,
__libc_clean_end): Define these to call the cleanup function after
normal exit when they're supposed to.
* sysdeps/mach/bits/libc-lock.h (__libc_cleanup_region_start):
Take new first arg DOIT, a boolean saying whether to really install
any cleanup handler.
(__libc_cleanup_region_end): Do nothing if start's DOIT arg was zero.
(__libc_cleanup_end): Likewise.
* stdio-common/vfscanf.c (LOCK_STREAM): Pass new arg.
* stdio-common/vfprintf.c (buffered_vfprintf, vfprintf): Likewise.
* sysdeps/mach/hurd/bits/stdio-lock.h (_IO_cleanup_region_start):
Likewise.
* misc/syslog.c (vsyslog, openlog, closelog): Likewise.
* sysdeps/generic/bits/stdio-lock.h
(_IO_cleanup_region_start, _IO_cleanup_region_start_noarg): Likewise.
2001-08-20 Ulrich Drepper <drepper@redhat.com>
* misc/error.c (error_tail): Use fputws_unlocked instead of fputws.
* misc/err.c (convert_and_print): Likewise.
* malloc/obstack.c (print_and_abort): Use fprintf instead of two
function calls.
* time/time.h (struct timespec): Use __time_t for tv_sec element.
* sysdeps/generic/inttypes.h: Define __wchar_t. Use it instead of
wchar_t for function declarations and defintions.
* misc/sys/select.h: Define __need_time_t before including <time.h>.
Define suseconds_t if it hasn't happened yet.
* iconv/gconv.h: Define __need_wchar_t before including <stddef.h>.
* conform/data/sys/uio.h-data: Allow UIO_MAXIOV to be defined.
* sysdeps/generic/stdint.h: Don't get definition of wchar_t from
<stddef.h>.
* conform/data/stddef.h-data: Remove wint_t.
* misc/error.c (error): Handle wide oriented stderr stream correctly.
* stdio-common/perror.c (perror): Implement according to standard.
The stream orientation must not be changed if the stream was not
oriented before the call.
* stdio-common/Makefile (tests): Add tst-perror.
* stdio-common/tst-perror.c: New file.
See ChangeLog.12 for earlier changes.
2001-07-22 Bruno Haible <haible@clisp.cons.org>
* intl/libintl.h (ngettext, dngettext, dcngettext): Use both msgid1
and msgid2 for printf format argument checking.
2001-07-06 Paul Eggert <eggert@twinsun.com>
* manual/argp.texi: Remove ignored LGPL copyright notice; it's
not appropriate for documentation anyway.
* manual/libc-texinfo.sh: "Library General Public License" ->
"Lesser General Public License".
2001-07-06 Andreas Jaeger <aj@suse.de>
* All files under GPL/LGPL version 2: Place under LGPL version
2.1.