diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-01-17 01:02:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-01-17 01:02:24 +0000 |
commit | 609b4783564008cafdeb947bfd613a1bcb5946f6 (patch) | |
tree | ec4d830d2bf9d55decdf5bc941ececfe91e71d7d /sysdeps/generic | |
parent | 7b7b9e70ea0d820c863c78fbf84fe52626a408d6 (diff) | |
download | glibc-609b4783564008cafdeb947bfd613a1bcb5946f6.tar.gz glibc-609b4783564008cafdeb947bfd613a1bcb5946f6.tar.xz glibc-609b4783564008cafdeb947bfd613a1bcb5946f6.zip |
Update.
2003-01-16 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h: New file. * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: New file. * sysdeps/unix/sysv/linux/configure.in: Minimum kernel for PPC64 is 2.4.21. 2003-01-16 Ulrich Drepper <drepper@redhat.com> * sysdeps/generic/glob.c (glob): Assume sysconf() always returns values != -1 for _LIBC. Use extend_alloca to reallocate alloca'ed buffers. * sysdeps/generic/sysconf.c: Unconditionally implement _SC_GETPW_R_SIZE_MAX and _SC_GETGR_R_SIZE_MAX. * sysdeps/posix/sysconf.c: Likewise.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/glob.c | 20 | ||||
-rw-r--r-- | sysdeps/generic/sysconf.c | 11 |
2 files changed, 25 insertions, 6 deletions
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c index 5e56629082..fa23f8cac1 100644 --- a/sysdeps/generic/glob.c +++ b/sysdeps/generic/glob.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1991-2002, 2003 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 @@ -284,6 +284,7 @@ extern char *alloca (); #endif #ifdef _LIBC +# include <alloca.h> # undef strdup # define strdup(str) __strdup (str) # define sysconf(id) __sysconf (id) @@ -697,10 +698,12 @@ glob (pattern, flags, errfunc, pglob) struct passwd pwbuf; int save = errno; +# ifndef _LIBC if (pwbuflen == -1) /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX. Try a moderate value. */ pwbuflen = 1024; +# endif pwtmpbuf = (char *) __alloca (pwbuflen); while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p) @@ -711,8 +714,13 @@ glob (pattern, flags, errfunc, pglob) p = NULL; break; } +# ifdef _LIBC + pwtmpbuf = extend_alloca (pwtmpbuf, pwbuflen, + 2 * pwbuflen); +# else pwbuflen *= 2; pwtmpbuf = (char *) __alloca (pwbuflen); +# endif __set_errno (save); } # else @@ -781,10 +789,12 @@ glob (pattern, flags, errfunc, pglob) struct passwd pwbuf; int save = errno; +# ifndef _LIBC if (buflen == -1) /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX. Try a moderate value. */ buflen = 1024; +# endif pwtmpbuf = (char *) __alloca (buflen); while (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) != 0) @@ -794,8 +804,12 @@ glob (pattern, flags, errfunc, pglob) p = NULL; break; } +# ifdef _LIBC + pwtmpbuf = extend_alloca (pwtmpbuf, buflen, 2 * buflen); +# else buflen *= 2; pwtmpbuf = __alloca (buflen); +# endif __set_errno (save); } # else @@ -1326,9 +1340,9 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0) #if defined _AMIGA || defined VMS - | FNM_CASEFOLD + | FNM_CASEFOLD #endif - ); + ); nfound = 0; flags |= GLOB_MAGCHAR; diff --git a/sysdeps/generic/sysconf.c b/sysdeps/generic/sysconf.c index f1b64d58eb..d67e3568a3 100644 --- a/sysdeps/generic/sysconf.c +++ b/sysdeps/generic/sysconf.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,1993,1995-1997,2001,2002 Free Software Foundation, Inc. +/* Copyright (C) 1991,1993,1995-1997,2001,2002,2003 + 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 @@ -142,6 +143,12 @@ __sysconf (name) case _SC_USHRT_MAX: return USHRT_MAX; + case _SC_GETGR_R_SIZE_MAX: + return NSS_BUFLEN_GROUP; + + case _SC_GETPW_R_SIZE_MAX: + return NSS_BUFLEN_PASSWD; + case _SC_ARG_MAX: case _SC_CHILD_MAX: case _SC_CLK_TCK: @@ -211,8 +218,6 @@ __sysconf (name) case _SC_THREADS: case _SC_THREAD_SAFE_FUNCTIONS: - case _SC_GETGR_R_SIZE_MAX: - case _SC_GETPW_R_SIZE_MAX: case _SC_LOGIN_NAME_MAX: case _SC_TTY_NAME_MAX: case _SC_THREAD_DESTRUCTOR_ITERATIONS: |