2024-01-01 18:12:26 +00:00
|
|
|
/* Copyright (C) 1991-2024 Free Software Foundation, Inc.
|
1997-02-15 04:31:36 +00:00
|
|
|
This file is part of the GNU C Library.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
1997-02-15 04:31:36 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:
sed -ri '
s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
$(find $(git ls-files) -prune -type f \
! -name '*.po' \
! -name 'ChangeLog*' \
! -path COPYING ! -path COPYING.LIB \
! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
! -path manual/texinfo.tex ! -path scripts/config.guess \
! -path scripts/config.sub ! -path scripts/install-sh \
! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
! -path INSTALL ! -path locale/programs/charmap-kw.h \
! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
! '(' -name configure \
-execdir test -f configure.ac -o -f configure.in ';' ')' \
! '(' -name preconfigure \
-execdir test -f preconfigure.ac ';' ')' \
-print)
and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:
chmod a+x sysdeps/unix/sysv/linux/riscv/configure
# Omit irrelevant whitespace and comment-only changes,
# perhaps from a slightly-different Autoconf version.
git checkout -f \
sysdeps/csky/configure \
sysdeps/hppa/configure \
sysdeps/riscv/configure \
sysdeps/unix/sysv/linux/csky/configure
# Omit changes that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
git checkout -f \
sysdeps/powerpc/powerpc64/ppc-mcount.S \
sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
# Omit change that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 05:40:42 +00:00
|
|
|
<https://www.gnu.org/licenses/>. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#ifndef _LIBC
|
|
|
|
# include <libc-config.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
#endif
|
|
|
|
|
1996-01-19 10:00:23 +00:00
|
|
|
/* Enable GNU extensions in fnmatch.h. */
|
|
|
|
#ifndef _GNU_SOURCE
|
2020-12-30 19:15:38 +00:00
|
|
|
# define _GNU_SOURCE 1
|
1996-01-19 10:00:23 +00:00
|
|
|
#endif
|
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#include <fnmatch.h>
|
|
|
|
|
2000-01-18 01:46:57 +00:00
|
|
|
#include <assert.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <errno.h>
|
|
|
|
#include <ctype.h>
|
2014-08-01 08:53:38 +00:00
|
|
|
#include <string.h>
|
2020-12-30 19:15:38 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
#include <wctype.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdbool.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2000-05-24 20:22:51 +00:00
|
|
|
/* We need some of the locale data (the collation sequence information)
|
|
|
|
but there is no interface to get this information in general. Therefore
|
|
|
|
we support a correct implementation only in glibc. */
|
|
|
|
#ifdef _LIBC
|
|
|
|
# include "../locale/localeinfo.h"
|
Update.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* string/strxfrm.c (strxfrm, wcsxfrm): Include <sys/param.h>.
If nrules == 0 and srclen < n, copy only srclen + 1 characters.
* sysdeps/generic/getdomain.c (getdomainname): Include <sys/param.h>.
If the result is fits in the buffer, copy only as many bytes as needed.
* sysdeps/generic/_strerror.c (__strerror_r): Don't zero-fill the
buffer after copying numbuf into it.
* sysdeps/mach/_strerror.c (__strerror_r): Likewise.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* posix/confstr.c (confstr): When string_len > len, NUL-terminate
the result. When string_len < len, don't clear the rest of the buffer.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
Support for new LC_COLLATE format.
* locale/coll-lookup.h: New file.
* locale/weightwc.h (findidx): When size == 0, call
collidx_table_lookup.
* wcsmbs/wcscoll.c: Include coll-lookup.h.
* wcsmbs/wcsxfrm.c: Likewise.
* posix/fnmatch.c: Likewise.
* posix/fnmatch_loop.c (internal_fnwmatch): When size == 0, call
collseq_table_lookup.
* locale/programs/3level.h: New file.
* locale/programs/ld-ctype.c: (wcwidth_table, wctrans_table): Define
by including "3level.h".
* locale/programs/ld-collate.c (wchead_table, collidx_table,
collseq_table): New types, defined by including "3level.h".
(locale_collate_t): New wcheads_3level, wcseqorder_3level fields.
(encoding_mask, encoding_byte): Remove.
(utf8_encode): Use simple shifts instead.
(collate_finish): When !oldstyle_tables, set plane_size and plane_cnt
to 0, and initialize and fill wcheads_3level and wcseqorder_3level.
(collate_output): New local variable tablewc_3level. When
!oldstyle_tables, set table_size to 0 and names to NULL and fill
tablewc_3level instead of tablewc. Change format of TABLEWC and
COLLSEQWC entries written to the file.
* locale/C-collate.c (collseqwc): Change format.
(_nl_C_LC_COLLATE): Set HASH_SIZE and HASH_LAYERS to 0, change format
of COLLSEQWC.
* locale/Makefile (distribute): Add coll-lookup.h, programs/3level.h.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/programs/ld-ctype.c (MAX_CHARNAMES_IDX): New macro.
(locale_ctype_t): New charnames_idx field.
(ctype_startup): Initialize charnames_idx field.
(find_idx): Speed up dramatically by using charnames_idx inverse table.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* locale/C-ctype.c: Switch to new locale format.
(_nl_C_LC_CTYPE_names): Remove array.
(STRUCT_CTYPE_CLASS): New macro.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New three-level tables.
(_nl_C_LC_CTYPE_width): Change from array to three-level table.
(_nl_C_LC_CTYPE): Fix nstrings value. Set HASH_SIZE and HASH_LAYERS
to 0. Change WIDTH format. Set CLASS_OFFSET and MAP_OFFSET. Add
12 class tables and 2 map tables at the end.
* ctype/ctype-info.c (_nl_C_LC_CTYPE_names): Remove declaration.
(_nl_C_LC_CTYPE_class_{upper,lower,alpha,digit,xdigit,space,print,
graph,blank,cntrl,punct,alnum}, _nl_C_LC_CTYPE_map_{toupper,tolower}):
New declarations.
(b): Remove trailing semicolon.
(__ctype_names, __ctype_width): Don't initialize.
(__ctype32_wctype, __ctype32_wctrans, __ctype32_width): Initialize.
2000-08-27 Bruno Haible <haible@clisp.cons.org>
* elf/dl-load.c (open_path): Add a argument telling whether *dirsp
is guaranteed to be allocated with the same malloc() and may be
passed to free().
(_dl_map_object): Update open_path calls. If rtld_search_dirs has
been set to empty by an earlier open_path call, don't pass it again.
2000-08-29 01:20:23 +00:00
|
|
|
# include "../locale/coll-lookup.h"
|
2001-03-15 20:04:25 +00:00
|
|
|
# include <shlib-compat.h>
|
2000-05-24 20:22:51 +00:00
|
|
|
|
|
|
|
# define CONCAT(a,b) __CONCAT(a,b)
|
2020-12-30 19:15:38 +00:00
|
|
|
# define btowc __btowc
|
|
|
|
# define iswctype __iswctype
|
2000-08-21 04:18:25 +00:00
|
|
|
# define mbsrtowcs __mbsrtowcs
|
2020-12-30 19:15:38 +00:00
|
|
|
# define mempcpy __mempcpy
|
|
|
|
# define strnlen __strnlen
|
|
|
|
# define towlower __towlower
|
|
|
|
# define wcscat __wcscat
|
|
|
|
# define wcslen __wcslen
|
|
|
|
# define wctype __wctype
|
|
|
|
# define wmemchr __wmemchr
|
|
|
|
# define wmempcpy __wmempcpy
|
2001-03-15 20:04:25 +00:00
|
|
|
# define fnmatch __fnmatch
|
|
|
|
extern int fnmatch (const char *pattern, const char *string, int flags);
|
2000-05-24 20:22:51 +00:00
|
|
|
#endif
|
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#ifdef _LIBC
|
2021-01-20 16:07:59 +00:00
|
|
|
# if __GNUC__ >= 7
|
2020-12-30 19:15:38 +00:00
|
|
|
# define FALLTHROUGH __attribute__ ((__fallthrough__))
|
|
|
|
# else
|
|
|
|
# define FALLTHROUGH ((void) 0)
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# include "attribute.h"
|
|
|
|
#endif
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#include <intprops.h>
|
|
|
|
#include <flexmember.h>
|
2021-01-04 17:26:30 +00:00
|
|
|
#include <scratch_buffer.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#ifdef _LIBC
|
|
|
|
typedef ptrdiff_t idx_t;
|
|
|
|
#else
|
|
|
|
# include "idx.h"
|
|
|
|
#endif
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
/* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */
|
|
|
|
#define NO_LEADING_PERIOD(flags) \
|
|
|
|
((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD))
|
update from main archive 961030
Thu Oct 31 00:01:39 1996 Ulrich Drepper <drepper@cygnus.com>
* signal/Makefile (routines): Add sigwait.
* signal/signal.h: Add prototype for sigwait.
* sysdeps/posix/sigwait.c: New file. Implementation of sigwait
function from POSIX.1c.
* sysdeps/stub/sigwait.c: New file. Stub version of sigwait.
Wed Oct 30 02:01:17 1996 Richard Henderson <rth@tamu.edu>
* sunrpc/xdr_float.c (xdr_float): Handle sizeof(float)!=sizeof(long),
but don't bother going farther than sizeof(float)==sizeof(int).
(xdr_double): Handle little-endian machines! Handle sizeof(double)
!= 2*sizeof(long), though again don't bother with more than int.
Thu Oct 29 16:09:42 1996 Craig Metz <cmetz@inner.net>
* sysdeps/posix/getaddrinfo.c: Use buffer limits for inet_ntop
function.
Tue Oct 29 12:37:22 1996 Ulrich Drepper <drepper@cygnus.com>
* Makerules: Create symbolic links for linking in $(libdir).
(make-link): Use absolute path for destination if this is not in
the same directory.
* elf/rtld.c (dl_main): When verifying don't check the name of
the dynamic linker.
* shlib-versions: Change entries for Hurd specific libs from
*-*-gnu* to *-*-gnu?* so that i586-pc-linux-gnu does not match
these entries.
* assert/assert.h: Reformat copyright.
Change reference to ANSI into reference to ISO C.
* ctype/ctype.h: Likewise.
* errno.h: Likewise.
* limits.h: Likewise.
* math/math.h: Likewise.
* setjmp/setjmp.h: Likewise.
* stdio/stdio.h: Likewise.
* libio/stdio.h: Likewise.
* stdlib/stdlib.h: Likewise.
* string/string.h: Likewise.
* time/time.h: Likewise.
* string/argz.h: Use __const is definitions.
* elf/dlfcn.h: Use __const and __P. Reformat copyright.
* misc/err.h: Likewise.
* wctype/wctype.h (wctrans_t): Use __const instead of const.
* Makeconfig ($(common-objpfx)soversions.mk): Generate list of
sonames for versioned libraries.
* Makefile: Remove code to generate libc-version.h.
Generate gnu/lib-names.h with info from soversions.mk.
* features.h: Define __GLIBC__ and __GLIBC_MINOR__.
* dirent/tst-seekdir.c: Initialize save3.
* grp/testgrp.c: Initialize my_group.
* grp/fgetgrent_r.c: Change interface to follow POSIX.1c.
* grp/grp.h: Likewise.
* nss/getXXbyYY.c: Likewise.
* nss/getXXbyYY_r.c: Likewise.
* nss/getXXent.c: Likewise.
* nss/getXXent_r.c: Likewise.
* pwd/fgetpwent_r.c: Likewise.
* pwd/pwd.h: Likewise.
* shadow/fgetspent_r.c: Likewise.
* shadow/sgetspent.c: Likewise.
* shadow/sgetspent_r.c: Likewise.
* grp/fgetgrent.c: Adapt for change in interface of fgetgrent_r.
* pwd/fgetpwent.c: Likewise, for fgetpwent_r.c.
* shadow/fgetspent.c: Likewise, for fgetpwent_r.c.
* resolv/netdb.h: Adapt prototypes for reentrant functions to
follow POSIX.1c.
* sunrpc/rpc/netdb.h: Likewise,
* shadow/shadow.h: Likewise.
* inet/getnetgrent_r.c: Follow change in pwd/grp function interface.
* sysdeps/unix/getlogin_r.c: Return ERANGE when buffer is too small.
* inet/herrno.c: Don't define __h_errno. Only h_errno otherwise the
ELF aliasing creates strange situations.
* sysdeps/unix/sysv/linux/errnos.H: Define __set_errno as inline
function.
* sysdeps/unix/sysv/linux/i386/sysdep.S: Don't define __errno.
* sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise.
* libio/libio.h: Don't declare _IO_flockfile and _IO_funlockfile
weak.
* locale/programs/charmap.c: Add casts to prevent warnings.
* locale/programs/linereader.h: Likewise.
* locale/programs/ld-collate.c: Likewise.
* locale/programs/stringtrans.c: Likewise.
Change types for various variables to prevent warnings.
* locale/programs/ld-ctype.c: Likewise.
* locale/programs/linereader.h (lr_ungetc): Likewise.
* locale/programs/charset.h (struct charset): Use `unsigned int'
as type for width_default.
* posix/regex.c: Change type of `this_reg' variables.
* stdio-common/Makefile: Use -Wno-format for tstdiomisc.c.
* stdio-common/bug5.c: De-ANSI-fy. Use correct types for
variables.
* stdio-common/printf_fp.c: Initialize to_shift.
* stdio-common/test_rdwr.c: Add cast.
* stdio-common/vfprintf.c: Add casts and use correct types to
prevent warnings.
* stdio-common/vfscanf.c: Initialize str and strptr.
* sysdeps/libm-ieee754/e_jnf.c: Use correct types to prevent warnings.
* sysdeps/libm-ieee754/e_pow.c: Likewise.
* sysdeps/libm-ieee754/e_powf.c: Likewise.
* sysdeps/libm-ieee754/e_rem_pio2f.c: Likewise.
* time/test-tz.c: Likewise.
* manual/creature.texi: Document _REENTRANT and _THREAD_SAFE.
* manual/libc.texinfo: Prevent makeinfo failure by avoiding
libc.cp index. This must be fixed.
* manual/nss.texi: Adapt for correct POSIX.1c interface of
reentrant functions.
* manual/users.texi: Document netgroup functions.
* po/es.po: Updated.
* po/fr.po: Updated.
* posix/fnmatch.c: Change to match libit version.
* posix/unistd.h: Change prototype for ttyname_r to match POSIX.1c.
* sysdep/posix/ttyname_r.c: Likewise.
* stdlib/atexit.h (__new_exitfn): Add internal locking.
* stdlib/exit.c: De-ANSI-fy. Handle new ef_us value for flavor.
* stdlib/exit.h: De-ANSI-fy. Define new ef_us value for flavor.
* stdlib/random.c (__srandom): Add internal locking.
(__initstate): Likewise.
(__setstate): Likewise.
(__random): Likewise.
Mon Oct 28 22:28:37 1996 NIIBE Yutaka <gniibe@mri.co.jp>
* sysdeps/generic/crypt-entry.c (crypt_r): Use __set_errno.
(crypt): Likewise.
* resolv/gethnamaddr.c (gethostbyname2): Likewise.
* sysdeps/generic/uname.c: Likewise.
* sysdeps/posix/rename.c: Likewise.
* sysdeps/stub/setrlimit.c: Likewise.
* nss/nss_db/db-netgrp.c (_nss_db_setnetgrent): Fix typo.
Sun Oct 27 11:12:50 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* locale/programs/ld-collate.c (collate_order_elem): Fix format
string.
(collate_element_to): Cast field width argument to `int' for
format string.
(collate_symbol): Likewise.
(collate_order_elem): Likewise.
(collate_weight_bsymbol): Likewise.
(collate_simple_weight): Likewise.
* locale/programs/ld-time.c (STRARR_ELEM): Fix format string.
* locale/programs/ld-ctype.c (ctype_class_newP): Add missing
argument for format string.
(ctype_map_newP): Likewise.
(set_class_defaults): Fix format string.
* locale/programs/localedef.c (construct_output_path): Putting an
explicit \0 into the format string does not work, use %c.
Sat Oct 26 20:38:36 1996 Richard Henderson <rth@tamu.edu>
* Makerules: Install all shared libraries in $(slibdir).
* login/Makefile: Build libutil.so in others pass after
libc.so is created.
* misc/mntent.h: Include <paths.h> for _PATH_MNTTAB & _PATH_MOUNTED.
* string/stratcliff.c: Allocate 3 pages instead of one, then use
mprotect so that we know that the adjacent pages are inaccessible.
* resource/sys/resource.h: Move all structures and enums to ...
* sysdeps/generic/resourcebits.h: ... here ...
* sysdeps/unix/bsd/sun/sunos4/resourcebits.h: ... and here.
* sysdeps/unix/sysv/linux/alpha/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/i386/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/m68k/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/mips/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/resourcebits.h: New file. Use kernel
header for RLIMIT_* definitions. The members of struct rlimit
are longs.
Thu Oct 24 17:43:34 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* MakeTAGS (sysdep-dirs): Fix typo.
Wed Oct 23 03:45:22 1996 Ulrich Drepper <drepper@cygnus.com>
* Makefile (headers): Don't mention libc-version.h.
(install-others): ...but here.
* time/strptime.c: Recognize %s, %u, %g, and %G format.
nothing is found. This guarantees all subsequent calls behave
* sysdeps/unix/sysv/linux/syscalls.list: Change function name for
* io/getwd.c (getwd) [! PATH_MAX]: Don't assume that the user's
buffer is any longer than the amount necessary to hold the
filename; the Hurd getcwd uses the *entire* contents of the
buffer, however long it is specified to be.
* posix/getconf.c: De-ANSI-fy. Recognize POSIX.2 constant names.
since these do not depend on the platform.
1996-10-31 02:57:12 +00:00
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
/* Provide support for user-defined character classes, based on the functions
|
|
|
|
from ISO C 90 amendment 1. */
|
|
|
|
#ifdef CHARCLASS_NAME_MAX
|
|
|
|
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
|
|
|
|
#else
|
Update.
1998-07-20 17:09 Ulrich Drepper <drepper@cygnus.com>
* shlib-versions: Remove definition for libSegFault.
* memory.texi: Comment out the relocating allocator description.
* manual/signal.texi: Remove reference to relocating allocator.
* manual/top-menu.texi: Regenerated.
* posix/fnmatch.c: Implement [: :] and change to recognize
^ as negation only when not _POSIXLY_CORRECT.
* sysdeps/generic/glob.c: Add several optimizations.
* posix/glob.h: Undefine __PMT to prevent warnings.
Reported by Roland McGrath.
* posix/regex.c: Define namespace macros only for _LIBC.
* sysdeps/arm/dl-machine.h: Fix typo.
* sysdeps/unix/sysv/sysv4/solaris2/sigpending.c: New file.
* sysdeps/unix/sysv/sysv4/solaris2/sigstack.c: New file.
* sysdeps/unix/sysv/sysv4/solaris2/sigwaitinfo.c: New file.
* sysdeps/unix/sysv/sysv4/solaris2/syscalls.list: Add sigaltstack,
sigpending, sigqueue, and sigtimedwait.
* sysdeps/unix/sysv/sysv4/solaris2/sparc/sparc32/syscall.S: New file.
* timezone/leapseconds: Update from tzdata1998f.
1998-07-18 Mark Kettenis <kettenis@phys.uva.nl>
* stdio/stdio.h [__USE_GNU]: Add prototype for fputs_unlocked.
* stdio/Versions [GLIBC_2.1]: Add fputs_unlocked.
* libio/stdio.h: Fix typo.
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): #if 0 out the
magic memobj port arg parsing stuff. Fix it someday when we are ready
to really use it.
(_dl_sysdep_output): New function, modified from _dl_sysdep_error.
(_dl_sysdep_error, _dl_sysdep_message, _dl_sysdep_fatal): Removed.
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
* stdio/fputs.c: Add fputs_unlocked as weak alias for fputs.
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
* sysdeps/posix/sigsuspend.c: Define __sigsuspend with sigsuspend as
a weak alias.
* sysdeps/mach/hurd/sigsuspend.c: Likewise.
* sysdeps/generic/sigsuspend.c: Likewise.
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
* sysdeps/mach/hurd/i386/sigcontextinfo.h: New file.
1998-07-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makerules (map-file): Don't use $(wildcard) to find the
generated version script, instead look in $(version-maps).
($(common-objpfx)libc.so): Only depend on libc.map if versioning
is used.
* extra-lib.mk ($(objpfx)$(lib).so): Only depend on version script
if versioning is used. Don't use $(wildcard) to find the
generated version script, instead look in $(verson-maps).
1998-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/segfault.c: Rename GET_EIP to GET_PC. Remove
unused function handle.
* sysdeps/generic/sigcontextinfo.h: Rename GET_EIP to GET_PC.
* sysdeps/unix/sysv/linux/i386/sigcontextinfo.h: Likewise.
* debug/catchsegv.sh: Fix argument processing, quoting and various
typos. Put the crash info always in the current directory. Find
program in $PATH if it contains no directory component.
* Makerules (install-lib.so-versioned,
install-lib.so-unversioned): New variables.
(install-lib-nosubdir): Depend on unversioned libs in
slibdir, not libdir.
1998-07-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Make-dist (+tsrcs): Remove references to %-map variables and
*.map files. Add Versions in subdirs.
* Makerules (distinfo-vars): Don't write out %-map variables.
1998-07-20 13:55 Ulrich Drepper <drepper@cygnus.com>
* inet/protocols/rwhod.h: Remove definition of _PATH_RWHODIR.
Include <paths.h> instead.
* sysdeps/generic/paths.h: Define _PATH_RWHODIR.
* sysdeps/unix/sysv/linux/paths.h: Likewise.
Reported by Dale Scheetz <dwarf@polaris.net>.
1998-07-17 21:44 Ulrich Drepper <drepper@cygnus.com>
* catgets/open_catalog.c: Strictly check whether catalog file is
larger enough for the data. Reported by Andries.Brouwer@cwi.nl.
1998-07-20 17:25:48 +00:00
|
|
|
/* This shouldn't happen but some implementation might still have this
|
|
|
|
problem. Use a reasonable default value. */
|
2020-12-30 19:15:38 +00:00
|
|
|
# define CHAR_CLASS_MAX_LENGTH 256
|
|
|
|
#endif
|
2000-01-18 01:46:57 +00:00
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#define IS_CHAR_CLASS(string) wctype (string)
|
Update.
1998-07-20 17:09 Ulrich Drepper <drepper@cygnus.com>
* shlib-versions: Remove definition for libSegFault.
* memory.texi: Comment out the relocating allocator description.
* manual/signal.texi: Remove reference to relocating allocator.
* manual/top-menu.texi: Regenerated.
* posix/fnmatch.c: Implement [: :] and change to recognize
^ as negation only when not _POSIXLY_CORRECT.
* sysdeps/generic/glob.c: Add several optimizations.
* posix/glob.h: Undefine __PMT to prevent warnings.
Reported by Roland McGrath.
* posix/regex.c: Define namespace macros only for _LIBC.
* sysdeps/arm/dl-machine.h: Fix typo.
* sysdeps/unix/sysv/sysv4/solaris2/sigpending.c: New file.
* sysdeps/unix/sysv/sysv4/solaris2/sigstack.c: New file.
* sysdeps/unix/sysv/sysv4/solaris2/sigwaitinfo.c: New file.
* sysdeps/unix/sysv/sysv4/solaris2/syscalls.list: Add sigaltstack,
sigpending, sigqueue, and sigtimedwait.
* sysdeps/unix/sysv/sysv4/solaris2/sparc/sparc32/syscall.S: New file.
* timezone/leapseconds: Update from tzdata1998f.
1998-07-18 Mark Kettenis <kettenis@phys.uva.nl>
* stdio/stdio.h [__USE_GNU]: Add prototype for fputs_unlocked.
* stdio/Versions [GLIBC_2.1]: Add fputs_unlocked.
* libio/stdio.h: Fix typo.
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): #if 0 out the
magic memobj port arg parsing stuff. Fix it someday when we are ready
to really use it.
(_dl_sysdep_output): New function, modified from _dl_sysdep_error.
(_dl_sysdep_error, _dl_sysdep_message, _dl_sysdep_fatal): Removed.
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
* stdio/fputs.c: Add fputs_unlocked as weak alias for fputs.
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
* sysdeps/posix/sigsuspend.c: Define __sigsuspend with sigsuspend as
a weak alias.
* sysdeps/mach/hurd/sigsuspend.c: Likewise.
* sysdeps/generic/sigsuspend.c: Likewise.
1998-07-19 Roland McGrath <roland@baalperazim.frob.com>
* sysdeps/mach/hurd/i386/sigcontextinfo.h: New file.
1998-07-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makerules (map-file): Don't use $(wildcard) to find the
generated version script, instead look in $(version-maps).
($(common-objpfx)libc.so): Only depend on libc.map if versioning
is used.
* extra-lib.mk ($(objpfx)$(lib).so): Only depend on version script
if versioning is used. Don't use $(wildcard) to find the
generated version script, instead look in $(verson-maps).
1998-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/segfault.c: Rename GET_EIP to GET_PC. Remove
unused function handle.
* sysdeps/generic/sigcontextinfo.h: Rename GET_EIP to GET_PC.
* sysdeps/unix/sysv/linux/i386/sigcontextinfo.h: Likewise.
* debug/catchsegv.sh: Fix argument processing, quoting and various
typos. Put the crash info always in the current directory. Find
program in $PATH if it contains no directory component.
* Makerules (install-lib.so-versioned,
install-lib.so-unversioned): New variables.
(install-lib-nosubdir): Depend on unversioned libs in
slibdir, not libdir.
1998-07-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Make-dist (+tsrcs): Remove references to %-map variables and
*.map files. Add Versions in subdirs.
* Makerules (distinfo-vars): Don't write out %-map variables.
1998-07-20 13:55 Ulrich Drepper <drepper@cygnus.com>
* inet/protocols/rwhod.h: Remove definition of _PATH_RWHODIR.
Include <paths.h> instead.
* sysdeps/generic/paths.h: Define _PATH_RWHODIR.
* sysdeps/unix/sysv/linux/paths.h: Likewise.
Reported by Dale Scheetz <dwarf@polaris.net>.
1998-07-17 21:44 Ulrich Drepper <drepper@cygnus.com>
* catgets/open_catalog.c: Strictly check whether catalog file is
larger enough for the data. Reported by Andries.Brouwer@cwi.nl.
1998-07-20 17:25:48 +00:00
|
|
|
|
|
|
|
/* Avoid depending on library functions or files
|
|
|
|
whose names are inconsistent. */
|
update from main archive 961030
Thu Oct 31 00:01:39 1996 Ulrich Drepper <drepper@cygnus.com>
* signal/Makefile (routines): Add sigwait.
* signal/signal.h: Add prototype for sigwait.
* sysdeps/posix/sigwait.c: New file. Implementation of sigwait
function from POSIX.1c.
* sysdeps/stub/sigwait.c: New file. Stub version of sigwait.
Wed Oct 30 02:01:17 1996 Richard Henderson <rth@tamu.edu>
* sunrpc/xdr_float.c (xdr_float): Handle sizeof(float)!=sizeof(long),
but don't bother going farther than sizeof(float)==sizeof(int).
(xdr_double): Handle little-endian machines! Handle sizeof(double)
!= 2*sizeof(long), though again don't bother with more than int.
Thu Oct 29 16:09:42 1996 Craig Metz <cmetz@inner.net>
* sysdeps/posix/getaddrinfo.c: Use buffer limits for inet_ntop
function.
Tue Oct 29 12:37:22 1996 Ulrich Drepper <drepper@cygnus.com>
* Makerules: Create symbolic links for linking in $(libdir).
(make-link): Use absolute path for destination if this is not in
the same directory.
* elf/rtld.c (dl_main): When verifying don't check the name of
the dynamic linker.
* shlib-versions: Change entries for Hurd specific libs from
*-*-gnu* to *-*-gnu?* so that i586-pc-linux-gnu does not match
these entries.
* assert/assert.h: Reformat copyright.
Change reference to ANSI into reference to ISO C.
* ctype/ctype.h: Likewise.
* errno.h: Likewise.
* limits.h: Likewise.
* math/math.h: Likewise.
* setjmp/setjmp.h: Likewise.
* stdio/stdio.h: Likewise.
* libio/stdio.h: Likewise.
* stdlib/stdlib.h: Likewise.
* string/string.h: Likewise.
* time/time.h: Likewise.
* string/argz.h: Use __const is definitions.
* elf/dlfcn.h: Use __const and __P. Reformat copyright.
* misc/err.h: Likewise.
* wctype/wctype.h (wctrans_t): Use __const instead of const.
* Makeconfig ($(common-objpfx)soversions.mk): Generate list of
sonames for versioned libraries.
* Makefile: Remove code to generate libc-version.h.
Generate gnu/lib-names.h with info from soversions.mk.
* features.h: Define __GLIBC__ and __GLIBC_MINOR__.
* dirent/tst-seekdir.c: Initialize save3.
* grp/testgrp.c: Initialize my_group.
* grp/fgetgrent_r.c: Change interface to follow POSIX.1c.
* grp/grp.h: Likewise.
* nss/getXXbyYY.c: Likewise.
* nss/getXXbyYY_r.c: Likewise.
* nss/getXXent.c: Likewise.
* nss/getXXent_r.c: Likewise.
* pwd/fgetpwent_r.c: Likewise.
* pwd/pwd.h: Likewise.
* shadow/fgetspent_r.c: Likewise.
* shadow/sgetspent.c: Likewise.
* shadow/sgetspent_r.c: Likewise.
* grp/fgetgrent.c: Adapt for change in interface of fgetgrent_r.
* pwd/fgetpwent.c: Likewise, for fgetpwent_r.c.
* shadow/fgetspent.c: Likewise, for fgetpwent_r.c.
* resolv/netdb.h: Adapt prototypes for reentrant functions to
follow POSIX.1c.
* sunrpc/rpc/netdb.h: Likewise,
* shadow/shadow.h: Likewise.
* inet/getnetgrent_r.c: Follow change in pwd/grp function interface.
* sysdeps/unix/getlogin_r.c: Return ERANGE when buffer is too small.
* inet/herrno.c: Don't define __h_errno. Only h_errno otherwise the
ELF aliasing creates strange situations.
* sysdeps/unix/sysv/linux/errnos.H: Define __set_errno as inline
function.
* sysdeps/unix/sysv/linux/i386/sysdep.S: Don't define __errno.
* sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise.
* libio/libio.h: Don't declare _IO_flockfile and _IO_funlockfile
weak.
* locale/programs/charmap.c: Add casts to prevent warnings.
* locale/programs/linereader.h: Likewise.
* locale/programs/ld-collate.c: Likewise.
* locale/programs/stringtrans.c: Likewise.
Change types for various variables to prevent warnings.
* locale/programs/ld-ctype.c: Likewise.
* locale/programs/linereader.h (lr_ungetc): Likewise.
* locale/programs/charset.h (struct charset): Use `unsigned int'
as type for width_default.
* posix/regex.c: Change type of `this_reg' variables.
* stdio-common/Makefile: Use -Wno-format for tstdiomisc.c.
* stdio-common/bug5.c: De-ANSI-fy. Use correct types for
variables.
* stdio-common/printf_fp.c: Initialize to_shift.
* stdio-common/test_rdwr.c: Add cast.
* stdio-common/vfprintf.c: Add casts and use correct types to
prevent warnings.
* stdio-common/vfscanf.c: Initialize str and strptr.
* sysdeps/libm-ieee754/e_jnf.c: Use correct types to prevent warnings.
* sysdeps/libm-ieee754/e_pow.c: Likewise.
* sysdeps/libm-ieee754/e_powf.c: Likewise.
* sysdeps/libm-ieee754/e_rem_pio2f.c: Likewise.
* time/test-tz.c: Likewise.
* manual/creature.texi: Document _REENTRANT and _THREAD_SAFE.
* manual/libc.texinfo: Prevent makeinfo failure by avoiding
libc.cp index. This must be fixed.
* manual/nss.texi: Adapt for correct POSIX.1c interface of
reentrant functions.
* manual/users.texi: Document netgroup functions.
* po/es.po: Updated.
* po/fr.po: Updated.
* posix/fnmatch.c: Change to match libit version.
* posix/unistd.h: Change prototype for ttyname_r to match POSIX.1c.
* sysdep/posix/ttyname_r.c: Likewise.
* stdlib/atexit.h (__new_exitfn): Add internal locking.
* stdlib/exit.c: De-ANSI-fy. Handle new ef_us value for flavor.
* stdlib/exit.h: De-ANSI-fy. Define new ef_us value for flavor.
* stdlib/random.c (__srandom): Add internal locking.
(__initstate): Likewise.
(__setstate): Likewise.
(__random): Likewise.
Mon Oct 28 22:28:37 1996 NIIBE Yutaka <gniibe@mri.co.jp>
* sysdeps/generic/crypt-entry.c (crypt_r): Use __set_errno.
(crypt): Likewise.
* resolv/gethnamaddr.c (gethostbyname2): Likewise.
* sysdeps/generic/uname.c: Likewise.
* sysdeps/posix/rename.c: Likewise.
* sysdeps/stub/setrlimit.c: Likewise.
* nss/nss_db/db-netgrp.c (_nss_db_setnetgrent): Fix typo.
Sun Oct 27 11:12:50 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* locale/programs/ld-collate.c (collate_order_elem): Fix format
string.
(collate_element_to): Cast field width argument to `int' for
format string.
(collate_symbol): Likewise.
(collate_order_elem): Likewise.
(collate_weight_bsymbol): Likewise.
(collate_simple_weight): Likewise.
* locale/programs/ld-time.c (STRARR_ELEM): Fix format string.
* locale/programs/ld-ctype.c (ctype_class_newP): Add missing
argument for format string.
(ctype_map_newP): Likewise.
(set_class_defaults): Fix format string.
* locale/programs/localedef.c (construct_output_path): Putting an
explicit \0 into the format string does not work, use %c.
Sat Oct 26 20:38:36 1996 Richard Henderson <rth@tamu.edu>
* Makerules: Install all shared libraries in $(slibdir).
* login/Makefile: Build libutil.so in others pass after
libc.so is created.
* misc/mntent.h: Include <paths.h> for _PATH_MNTTAB & _PATH_MOUNTED.
* string/stratcliff.c: Allocate 3 pages instead of one, then use
mprotect so that we know that the adjacent pages are inaccessible.
* resource/sys/resource.h: Move all structures and enums to ...
* sysdeps/generic/resourcebits.h: ... here ...
* sysdeps/unix/bsd/sun/sunos4/resourcebits.h: ... and here.
* sysdeps/unix/sysv/linux/alpha/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/i386/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/m68k/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/mips/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/resourcebits.h: New file. Use kernel
header for RLIMIT_* definitions. The members of struct rlimit
are longs.
Thu Oct 24 17:43:34 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* MakeTAGS (sysdep-dirs): Fix typo.
Wed Oct 23 03:45:22 1996 Ulrich Drepper <drepper@cygnus.com>
* Makefile (headers): Don't mention libc-version.h.
(install-others): ...but here.
* time/strptime.c: Recognize %s, %u, %g, and %G format.
nothing is found. This guarantees all subsequent calls behave
* sysdeps/unix/sysv/linux/syscalls.list: Change function name for
* io/getwd.c (getwd) [! PATH_MAX]: Don't assume that the user's
buffer is any longer than the amount necessary to hold the
filename; the Hurd getcwd uses the *entire* contents of the
buffer, however long it is specified to be.
* posix/getconf.c: De-ANSI-fy. Recognize POSIX.2 constant names.
since these do not depend on the platform.
1996-10-31 02:57:12 +00:00
|
|
|
|
2001-03-15 09:36:19 +00:00
|
|
|
/* Global variable. */
|
|
|
|
static int posixly_correct;
|
|
|
|
|
1996-12-20 01:39:50 +00:00
|
|
|
/* Note that this evaluates C many times. */
|
2020-12-30 19:15:38 +00:00
|
|
|
#define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
|
|
|
|
#define CHAR char
|
|
|
|
#define UCHAR unsigned char
|
|
|
|
#define INT int
|
|
|
|
#define FCT internal_fnmatch
|
|
|
|
#define EXT ext_match
|
|
|
|
#define END end_pattern
|
|
|
|
#define STRUCT fnmatch_struct
|
|
|
|
#define L_(CS) CS
|
|
|
|
#define BTOWC(C) btowc (C)
|
|
|
|
#define STRLEN(S) strlen (S)
|
|
|
|
#define STRCAT(D, S) strcat (D, S)
|
|
|
|
#define MEMPCPY(D, S, N) mempcpy (D, S, N)
|
|
|
|
#define MEMCHR(S, C, N) memchr (S, C, N)
|
|
|
|
#define WIDE_CHAR_VERSION 0
|
|
|
|
#ifdef _LIBC
|
2014-09-11 23:02:17 +00:00
|
|
|
# include <locale/weight.h>
|
|
|
|
# define FINDIDX findidx
|
2020-12-30 19:15:38 +00:00
|
|
|
#endif
|
|
|
|
#include "fnmatch_loop.c"
|
|
|
|
|
|
|
|
|
|
|
|
#define FOLD(c) ((flags & FNM_CASEFOLD) ? towlower (c) : (c))
|
|
|
|
#define CHAR wchar_t
|
|
|
|
#define UCHAR wint_t
|
|
|
|
#define INT wint_t
|
|
|
|
#define FCT internal_fnwmatch
|
|
|
|
#define EXT ext_wmatch
|
|
|
|
#define END end_wpattern
|
|
|
|
#define L_(CS) L##CS
|
|
|
|
#define BTOWC(C) (C)
|
|
|
|
#define STRLEN(S) wcslen (S)
|
|
|
|
#define STRCAT(D, S) wcscat (D, S)
|
|
|
|
#define MEMPCPY(D, S, N) wmempcpy (D, S, N)
|
|
|
|
#define MEMCHR(S, C, N) wmemchr (S, C, N)
|
|
|
|
#define WIDE_CHAR_VERSION 1
|
|
|
|
#ifdef _LIBC
|
2014-09-11 23:02:17 +00:00
|
|
|
/* Change the name the header defines so it doesn't conflict with
|
|
|
|
the <locale/weight.h> version included above. */
|
2020-12-30 19:15:38 +00:00
|
|
|
# define findidx findidxwc
|
|
|
|
# include <locale/weightwc.h>
|
|
|
|
# undef findidx
|
|
|
|
# define FINDIDX findidxwc
|
|
|
|
#endif
|
2000-05-24 20:22:51 +00:00
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#undef IS_CHAR_CLASS
|
2000-01-18 01:46:57 +00:00
|
|
|
/* We have to convert the wide character string in a multibyte string. But
|
2000-07-28 19:52:40 +00:00
|
|
|
we know that the character class names consist of alphanumeric characters
|
|
|
|
from the portable character set, and since the wide character encoding
|
|
|
|
for a member of the portable character set is the same code point as
|
|
|
|
its single-byte encoding, we can use a simplified method to convert the
|
|
|
|
string to a multibyte character string. */
|
2000-01-18 01:46:57 +00:00
|
|
|
static wctype_t
|
|
|
|
is_char_class (const wchar_t *wcs)
|
|
|
|
{
|
|
|
|
char s[CHAR_CLASS_MAX_LENGTH + 1];
|
|
|
|
char *cp = s;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2000-01-18 01:46:57 +00:00
|
|
|
do
|
|
|
|
{
|
2000-07-28 19:52:40 +00:00
|
|
|
/* Test for a printable character from the portable character set. */
|
2020-12-30 19:15:38 +00:00
|
|
|
#ifdef _LIBC
|
2000-07-28 19:52:40 +00:00
|
|
|
if (*wcs < 0x20 || *wcs > 0x7e
|
2020-12-30 19:15:38 +00:00
|
|
|
|| *wcs == 0x24 || *wcs == 0x40 || *wcs == 0x60)
|
|
|
|
return (wctype_t) 0;
|
|
|
|
#else
|
2000-07-28 19:52:40 +00:00
|
|
|
switch (*wcs)
|
2020-12-30 19:15:38 +00:00
|
|
|
{
|
|
|
|
case L' ': case L'!': case L'"': case L'#': case L'%':
|
|
|
|
case L'&': case L'\'': case L'(': case L')': case L'*':
|
|
|
|
case L'+': case L',': case L'-': case L'.': case L'/':
|
|
|
|
case L'0': case L'1': case L'2': case L'3': case L'4':
|
|
|
|
case L'5': case L'6': case L'7': case L'8': case L'9':
|
|
|
|
case L':': case L';': case L'<': case L'=': case L'>':
|
|
|
|
case L'?':
|
|
|
|
case L'A': case L'B': case L'C': case L'D': case L'E':
|
|
|
|
case L'F': case L'G': case L'H': case L'I': case L'J':
|
|
|
|
case L'K': case L'L': case L'M': case L'N': case L'O':
|
|
|
|
case L'P': case L'Q': case L'R': case L'S': case L'T':
|
|
|
|
case L'U': case L'V': case L'W': case L'X': case L'Y':
|
|
|
|
case L'Z':
|
|
|
|
case L'[': case L'\\': case L']': case L'^': case L'_':
|
|
|
|
case L'a': case L'b': case L'c': case L'd': case L'e':
|
|
|
|
case L'f': case L'g': case L'h': case L'i': case L'j':
|
|
|
|
case L'k': case L'l': case L'm': case L'n': case L'o':
|
|
|
|
case L'p': case L'q': case L'r': case L's': case L't':
|
|
|
|
case L'u': case L'v': case L'w': case L'x': case L'y':
|
|
|
|
case L'z': case L'{': case L'|': case L'}': case L'~':
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return (wctype_t) 0;
|
|
|
|
}
|
|
|
|
#endif
|
2000-01-18 01:46:57 +00:00
|
|
|
|
2000-07-28 19:52:40 +00:00
|
|
|
/* Avoid overrunning the buffer. */
|
|
|
|
if (cp == s + CHAR_CLASS_MAX_LENGTH)
|
2020-12-30 19:15:38 +00:00
|
|
|
return (wctype_t) 0;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2000-07-28 19:52:40 +00:00
|
|
|
*cp++ = (char) *wcs++;
|
|
|
|
}
|
|
|
|
while (*wcs != L'\0');
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2000-07-28 19:52:40 +00:00
|
|
|
*cp = '\0';
|
update from main archive 961030
Thu Oct 31 00:01:39 1996 Ulrich Drepper <drepper@cygnus.com>
* signal/Makefile (routines): Add sigwait.
* signal/signal.h: Add prototype for sigwait.
* sysdeps/posix/sigwait.c: New file. Implementation of sigwait
function from POSIX.1c.
* sysdeps/stub/sigwait.c: New file. Stub version of sigwait.
Wed Oct 30 02:01:17 1996 Richard Henderson <rth@tamu.edu>
* sunrpc/xdr_float.c (xdr_float): Handle sizeof(float)!=sizeof(long),
but don't bother going farther than sizeof(float)==sizeof(int).
(xdr_double): Handle little-endian machines! Handle sizeof(double)
!= 2*sizeof(long), though again don't bother with more than int.
Thu Oct 29 16:09:42 1996 Craig Metz <cmetz@inner.net>
* sysdeps/posix/getaddrinfo.c: Use buffer limits for inet_ntop
function.
Tue Oct 29 12:37:22 1996 Ulrich Drepper <drepper@cygnus.com>
* Makerules: Create symbolic links for linking in $(libdir).
(make-link): Use absolute path for destination if this is not in
the same directory.
* elf/rtld.c (dl_main): When verifying don't check the name of
the dynamic linker.
* shlib-versions: Change entries for Hurd specific libs from
*-*-gnu* to *-*-gnu?* so that i586-pc-linux-gnu does not match
these entries.
* assert/assert.h: Reformat copyright.
Change reference to ANSI into reference to ISO C.
* ctype/ctype.h: Likewise.
* errno.h: Likewise.
* limits.h: Likewise.
* math/math.h: Likewise.
* setjmp/setjmp.h: Likewise.
* stdio/stdio.h: Likewise.
* libio/stdio.h: Likewise.
* stdlib/stdlib.h: Likewise.
* string/string.h: Likewise.
* time/time.h: Likewise.
* string/argz.h: Use __const is definitions.
* elf/dlfcn.h: Use __const and __P. Reformat copyright.
* misc/err.h: Likewise.
* wctype/wctype.h (wctrans_t): Use __const instead of const.
* Makeconfig ($(common-objpfx)soversions.mk): Generate list of
sonames for versioned libraries.
* Makefile: Remove code to generate libc-version.h.
Generate gnu/lib-names.h with info from soversions.mk.
* features.h: Define __GLIBC__ and __GLIBC_MINOR__.
* dirent/tst-seekdir.c: Initialize save3.
* grp/testgrp.c: Initialize my_group.
* grp/fgetgrent_r.c: Change interface to follow POSIX.1c.
* grp/grp.h: Likewise.
* nss/getXXbyYY.c: Likewise.
* nss/getXXbyYY_r.c: Likewise.
* nss/getXXent.c: Likewise.
* nss/getXXent_r.c: Likewise.
* pwd/fgetpwent_r.c: Likewise.
* pwd/pwd.h: Likewise.
* shadow/fgetspent_r.c: Likewise.
* shadow/sgetspent.c: Likewise.
* shadow/sgetspent_r.c: Likewise.
* grp/fgetgrent.c: Adapt for change in interface of fgetgrent_r.
* pwd/fgetpwent.c: Likewise, for fgetpwent_r.c.
* shadow/fgetspent.c: Likewise, for fgetpwent_r.c.
* resolv/netdb.h: Adapt prototypes for reentrant functions to
follow POSIX.1c.
* sunrpc/rpc/netdb.h: Likewise,
* shadow/shadow.h: Likewise.
* inet/getnetgrent_r.c: Follow change in pwd/grp function interface.
* sysdeps/unix/getlogin_r.c: Return ERANGE when buffer is too small.
* inet/herrno.c: Don't define __h_errno. Only h_errno otherwise the
ELF aliasing creates strange situations.
* sysdeps/unix/sysv/linux/errnos.H: Define __set_errno as inline
function.
* sysdeps/unix/sysv/linux/i386/sysdep.S: Don't define __errno.
* sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise.
* libio/libio.h: Don't declare _IO_flockfile and _IO_funlockfile
weak.
* locale/programs/charmap.c: Add casts to prevent warnings.
* locale/programs/linereader.h: Likewise.
* locale/programs/ld-collate.c: Likewise.
* locale/programs/stringtrans.c: Likewise.
Change types for various variables to prevent warnings.
* locale/programs/ld-ctype.c: Likewise.
* locale/programs/linereader.h (lr_ungetc): Likewise.
* locale/programs/charset.h (struct charset): Use `unsigned int'
as type for width_default.
* posix/regex.c: Change type of `this_reg' variables.
* stdio-common/Makefile: Use -Wno-format for tstdiomisc.c.
* stdio-common/bug5.c: De-ANSI-fy. Use correct types for
variables.
* stdio-common/printf_fp.c: Initialize to_shift.
* stdio-common/test_rdwr.c: Add cast.
* stdio-common/vfprintf.c: Add casts and use correct types to
prevent warnings.
* stdio-common/vfscanf.c: Initialize str and strptr.
* sysdeps/libm-ieee754/e_jnf.c: Use correct types to prevent warnings.
* sysdeps/libm-ieee754/e_pow.c: Likewise.
* sysdeps/libm-ieee754/e_powf.c: Likewise.
* sysdeps/libm-ieee754/e_rem_pio2f.c: Likewise.
* time/test-tz.c: Likewise.
* manual/creature.texi: Document _REENTRANT and _THREAD_SAFE.
* manual/libc.texinfo: Prevent makeinfo failure by avoiding
libc.cp index. This must be fixed.
* manual/nss.texi: Adapt for correct POSIX.1c interface of
reentrant functions.
* manual/users.texi: Document netgroup functions.
* po/es.po: Updated.
* po/fr.po: Updated.
* posix/fnmatch.c: Change to match libit version.
* posix/unistd.h: Change prototype for ttyname_r to match POSIX.1c.
* sysdep/posix/ttyname_r.c: Likewise.
* stdlib/atexit.h (__new_exitfn): Add internal locking.
* stdlib/exit.c: De-ANSI-fy. Handle new ef_us value for flavor.
* stdlib/exit.h: De-ANSI-fy. Define new ef_us value for flavor.
* stdlib/random.c (__srandom): Add internal locking.
(__initstate): Likewise.
(__setstate): Likewise.
(__random): Likewise.
Mon Oct 28 22:28:37 1996 NIIBE Yutaka <gniibe@mri.co.jp>
* sysdeps/generic/crypt-entry.c (crypt_r): Use __set_errno.
(crypt): Likewise.
* resolv/gethnamaddr.c (gethostbyname2): Likewise.
* sysdeps/generic/uname.c: Likewise.
* sysdeps/posix/rename.c: Likewise.
* sysdeps/stub/setrlimit.c: Likewise.
* nss/nss_db/db-netgrp.c (_nss_db_setnetgrent): Fix typo.
Sun Oct 27 11:12:50 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* locale/programs/ld-collate.c (collate_order_elem): Fix format
string.
(collate_element_to): Cast field width argument to `int' for
format string.
(collate_symbol): Likewise.
(collate_order_elem): Likewise.
(collate_weight_bsymbol): Likewise.
(collate_simple_weight): Likewise.
* locale/programs/ld-time.c (STRARR_ELEM): Fix format string.
* locale/programs/ld-ctype.c (ctype_class_newP): Add missing
argument for format string.
(ctype_map_newP): Likewise.
(set_class_defaults): Fix format string.
* locale/programs/localedef.c (construct_output_path): Putting an
explicit \0 into the format string does not work, use %c.
Sat Oct 26 20:38:36 1996 Richard Henderson <rth@tamu.edu>
* Makerules: Install all shared libraries in $(slibdir).
* login/Makefile: Build libutil.so in others pass after
libc.so is created.
* misc/mntent.h: Include <paths.h> for _PATH_MNTTAB & _PATH_MOUNTED.
* string/stratcliff.c: Allocate 3 pages instead of one, then use
mprotect so that we know that the adjacent pages are inaccessible.
* resource/sys/resource.h: Move all structures and enums to ...
* sysdeps/generic/resourcebits.h: ... here ...
* sysdeps/unix/bsd/sun/sunos4/resourcebits.h: ... and here.
* sysdeps/unix/sysv/linux/alpha/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/i386/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/m68k/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/mips/resourcebits.h: Remove.
* sysdeps/unix/sysv/linux/resourcebits.h: New file. Use kernel
header for RLIMIT_* definitions. The members of struct rlimit
are longs.
Thu Oct 24 17:43:34 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* MakeTAGS (sysdep-dirs): Fix typo.
Wed Oct 23 03:45:22 1996 Ulrich Drepper <drepper@cygnus.com>
* Makefile (headers): Don't mention libc-version.h.
(install-others): ...but here.
* time/strptime.c: Recognize %s, %u, %g, and %G format.
nothing is found. This guarantees all subsequent calls behave
* sysdeps/unix/sysv/linux/syscalls.list: Change function name for
* io/getwd.c (getwd) [! PATH_MAX]: Don't assume that the user's
buffer is any longer than the amount necessary to hold the
filename; the Hurd getcwd uses the *entire* contents of the
buffer, however long it is specified to be.
* posix/getconf.c: De-ANSI-fy. Recognize POSIX.2 constant names.
since these do not depend on the platform.
1996-10-31 02:57:12 +00:00
|
|
|
|
2000-01-19 02:23:18 +00:00
|
|
|
return wctype (s);
|
2000-07-28 19:52:40 +00:00
|
|
|
}
|
2020-12-30 19:15:38 +00:00
|
|
|
#define IS_CHAR_CLASS(string) is_char_class (string)
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#include "fnmatch_loop.c"
|
1999-04-26 23:21:01 +00:00
|
|
|
|
2021-01-04 17:26:30 +00:00
|
|
|
static int
|
|
|
|
fnmatch_convert_to_wide (const char *str, struct scratch_buffer *buf,
|
|
|
|
size_t *n)
|
|
|
|
{
|
|
|
|
mbstate_t ps;
|
|
|
|
memset (&ps, '\0', sizeof (ps));
|
|
|
|
|
|
|
|
size_t nw = buf->length / sizeof (wchar_t);
|
|
|
|
*n = strnlen (str, nw - 1);
|
|
|
|
if (__glibc_likely (*n < nw))
|
|
|
|
{
|
|
|
|
const char *p = str;
|
|
|
|
*n = mbsrtowcs (buf->data, &p, *n + 1, &ps);
|
|
|
|
if (__glibc_unlikely (*n == (size_t) -1))
|
|
|
|
/* Something wrong.
|
|
|
|
XXX Do we have to set 'errno' to something which mbsrtows hasn't
|
|
|
|
already done? */
|
|
|
|
return -1;
|
|
|
|
if (p == NULL)
|
|
|
|
return 0;
|
|
|
|
memset (&ps, '\0', sizeof (ps));
|
|
|
|
}
|
|
|
|
|
|
|
|
*n = mbsrtowcs (NULL, &str, 0, &ps);
|
|
|
|
if (__glibc_unlikely (*n == (size_t) -1))
|
|
|
|
return -1;
|
|
|
|
if (!scratch_buffer_set_array_size (buf, *n + 1, sizeof (wchar_t)))
|
|
|
|
{
|
|
|
|
__set_errno (ENOMEM);
|
|
|
|
return -2;
|
|
|
|
}
|
|
|
|
assert (mbsinit (&ps));
|
|
|
|
mbsrtowcs (buf->data, &str, *n + 1, &ps);
|
|
|
|
return 0;
|
|
|
|
}
|
2000-07-28 19:52:40 +00:00
|
|
|
|
1999-04-26 23:21:01 +00:00
|
|
|
int
|
2015-10-20 11:54:09 +00:00
|
|
|
fnmatch (const char *pattern, const char *string, int flags)
|
1999-04-26 23:21:01 +00:00
|
|
|
{
|
2020-12-30 19:15:38 +00:00
|
|
|
if (__glibc_unlikely (MB_CUR_MAX != 1))
|
2001-03-15 09:36:19 +00:00
|
|
|
{
|
|
|
|
size_t n;
|
2021-01-04 17:26:30 +00:00
|
|
|
struct scratch_buffer wpattern;
|
|
|
|
scratch_buffer_init (&wpattern);
|
|
|
|
struct scratch_buffer wstring;
|
|
|
|
scratch_buffer_init (&wstring);
|
|
|
|
int r;
|
|
|
|
|
|
|
|
/* Convert the strings into wide characters. Any conversion issue
|
|
|
|
fallback to the ascii version. */
|
|
|
|
r = fnmatch_convert_to_wide (pattern, &wpattern, &n);
|
|
|
|
if (r == 0)
|
2020-12-30 19:15:38 +00:00
|
|
|
{
|
2021-01-04 17:26:30 +00:00
|
|
|
r = fnmatch_convert_to_wide (string, &wstring, &n);
|
|
|
|
if (r == 0)
|
|
|
|
r = internal_fnwmatch (wpattern.data, wstring.data,
|
|
|
|
(wchar_t *) wstring.data + n,
|
2021-01-04 18:46:52 +00:00
|
|
|
flags & FNM_PERIOD, flags, NULL);
|
2021-01-04 17:26:30 +00:00
|
|
|
}
|
2010-08-10 04:09:37 +00:00
|
|
|
|
2021-01-04 17:26:30 +00:00
|
|
|
scratch_buffer_free (&wstring);
|
|
|
|
scratch_buffer_free (&wpattern);
|
2010-08-10 04:09:37 +00:00
|
|
|
|
2021-01-04 17:26:30 +00:00
|
|
|
if (r == -2 || r == 0)
|
|
|
|
return r;
|
2001-03-15 09:36:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return internal_fnmatch (pattern, string, string + strlen (string),
|
2021-01-04 18:46:52 +00:00
|
|
|
flags & FNM_PERIOD, flags, NULL);
|
1999-04-26 23:21:01 +00:00
|
|
|
}
|
|
|
|
|
2020-12-30 19:15:38 +00:00
|
|
|
#undef fnmatch
|
2001-03-15 20:04:25 +00:00
|
|
|
versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3);
|
2020-12-30 19:15:38 +00:00
|
|
|
#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_3)
|
2001-03-15 20:04:25 +00:00
|
|
|
strong_alias (__fnmatch, __fnmatch_old)
|
|
|
|
compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0);
|
2020-12-30 19:15:38 +00:00
|
|
|
#endif
|
2002-08-04 03:50:21 +00:00
|
|
|
libc_hidden_ver (__fnmatch, fnmatch)
|