+2006-06-23 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #2980]
+ * posix/Makefile (CFLAGS-waitid.c): Add
+ -fasynchronous-unwind-tables.
+
+2006-08-02 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/dl-addr.c (_dl_addr): If GNU-style hash tables are present,
+ walk them instead of the symbol table.
+
+2006-08-01 Ulrich Drepper <drepper@redhat.com>
+
+ * nscd/initgrcache.c (addinitgroupsX): Judge successful lookups by
+ status of NSS calls, not the number of returned entries.
+
+ * sysdeps/unix/sysv/linux/syscalls.list: Remove add_key,
+ request_key, keyctl.
+
+2006-07-31 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/dl-osinfo.h: Remove unnecessary include.
+
+2006-07-16 Jeff Bailey <jbailey@ubuntu.com>
+
+ * elf/tst-auditmod1.c: Fix typo in #error.
+
+2006-07-31 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/tst-auditmod1.c: Remove code for unsupported architectures.
+
+ * iconvdata/run-iconv-test.sh: Run cmp in C locale.
+
+2006-07-20 Adam Nemet <anemet@caviumnetworks.com>
+
+ * stdlib/test-canon.c (do_test): Close fd before unlinking file so
+ that the directory is empty even on non-POSIX filesystems.
+
+2006-07-31 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/dl-open.c (dl_open_worker): Add branch prediction.
+
+ * nis/nss_compat/compat-grp.c: Avoid unnecessary setgrent calls into
+ the backend NSS module. If backend setgrent call failed, don't have
+ internal_setgrent fail. Just remember this until it is needed.
+ * nis/nss_compat/compat-pwd.c: Likewise.
+ * nis/nss_compat/compat-spwd.c: Likewise.
+
2006-07-30 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/ia64/sigsuspend.c: File removed.
ElfW(Word) strtabsize = match->l_info[DT_STRSZ]->d_un.d_val;
- const ElfW(Sym) *symtabend;
- if (match->l_info[DT_HASH] != NULL)
- symtabend = (symtab
- + ((Elf_Symndx *) D_PTR (match, l_info[DT_HASH]))[1]);
+ const ElfW(Sym) *matchsym = NULL;
+ if (match->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM + DT_THISPROCNUM
+ + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] != NULL)
+ {
+ /* We look at all symbol table entries referenced by the
+ hash table. */
+ for (Elf_Symndx bucket = 0; bucket < match->l_nbuckets; ++bucket)
+ {
+ Elf32_Word symndx = match->l_gnu_buckets[bucket];
+ if (bucket != 0)
+ {
+ const Elf32_Word *hasharr = &match->l_gnu_chain_zero[symndx];
+
+ do
+ {
+ /* The hash table never references local symbols
+ so we can omit that test here. */
+ if (symtab[symndx].st_shndx != SHN_UNDEF
+#ifdef USE_TLS
+ && ELFW(ST_TYPE) (symtab[symndx].st_info) != STT_TLS
+#endif
+ && DL_ADDR_SYM_MATCH (match, &symtab[symndx],
+ matchsym, addr)
+ && symtab[symndx].st_name < strtabsize)
+ matchsym = (ElfW(Sym) *) &symtab[symndx];
+
+ ++symndx;
+ }
+ while ((*hasharr++ & 1u) == 0);
+ }
+ }
+ }
else
- /* There is no direct way to determine the number of symbols in the
- dynamic symbol table and no hash table is present. The ELF
- binary is ill-formed but what shall we do? Use the beginning of
- the string table which generally follows the symbol table. */
- symtabend = (const ElfW(Sym) *) strtab;
-
- const ElfW(Sym) *matchsym;
- for (matchsym = NULL; (void *) symtab < (void *) symtabend; ++symtab)
- if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
- || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
-#if defined USE_TLS
- && ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
+ {
+ const ElfW(Sym) *symtabend;
+ if (match->l_info[DT_HASH] != NULL)
+ symtabend = (symtab
+ + ((Elf_Symndx *) D_PTR (match, l_info[DT_HASH]))[1]);
+ else
+ /* There is no direct way to determine the number of symbols in the
+ dynamic symbol table and no hash table is present. The ELF
+ binary is ill-formed but what shall we do? Use the beginning of
+ the string table which generally follows the symbol table. */
+ symtabend = (const ElfW(Sym) *) strtab;
+
+ for (; (void *) symtab < (void *) symtabend; ++symtab)
+ if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
+ || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
+#ifdef USE_TLS
+ && ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
#endif
- && symtab->st_shndx != SHN_UNDEF
- && DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)
- && symtab->st_name < strtabsize)
- matchsym = (ElfW(Sym) *) symtab;
+ && symtab->st_shndx != SHN_UNDEF
+ && DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)
+ && symtab->st_name < strtabsize)
+ matchsym = (ElfW(Sym) *) symtab;
+ }
if (mapp)
*mapp = match;
/* Load a shared object at runtime, relocate it, and run its initializer.
- Copyright (C) 1996-2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1996-2004, 2005, 2006 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
if (! l->l_real->l_relocated)
{
#ifdef SHARED
- if (GLRO(dl_profile) != NULL)
+ if (__builtin_expect (GLRO(dl_profile) != NULL, 0))
{
/* If this here is the shared object which we want to profile
make sure the profile is started. We can find out whether
# define La_regs La_sh_regs
# define La_retval La_sh_retval
# define int_retval lrv_r0
-#elif defined __mc68000__
-# define pltenter la_m68k_gnu_pltenter
-# define pltexit la_m68k_gnu_pltexit
-# define La_regs La_m68k_regs
-# define La_retval La_m68k_retval
-# define int_retval lrv_d0
#elif defined __alpha__
# define pltenter la_alpha_gnu_pltenter
# define pltexit la_alpha_gnu_pltexit
# define La_regs La_ia64_regs
# define La_retval La_ia64_retval
# define int_retval lrv_r8
-#elif defined __mips__ && _MIPS_SIM == _ABIO32
-# define pltenter la_mips_o32_gnu_pltenter
-# define pltexit la_mips_o32_gnu_pltexit
-# define La_regs La_mips_32_regs
-# define La_retval La_mips_32_retval
-# define int_retval lrv_v0
-#elif defined __mips__ && _MIPS_SIM == _ABIN32
-# define pltenter la_mips_n32_gnu_pltenter
-# define pltexit la_mips_n32_gnu_pltexit
-# define La_regs La_mips_64_regs
-# define La_retval La_mips_64_retval
-# define int_retval lrv_v0
-#elif defined __mips__ && _MIPS_SIM == _ABI64
-# define pltenter la_mips_n64_gnu_pltenter
-# define pltexit la_mips_n64_gnu_pltexit
-# define La_regs La_mips_64_regs
-# define La_retval La_mips_64_retval
-# define int_retval lrv_v0
#elif defined __sparc__ && __WORDSIZE == 32
# define pltenter la_sparc32_gnu_pltenter
# define pltexit la_sparc32_gnu_pltexit
#include <tst-audit.h>
#if (!defined (pltenter) || !defined (pltexit) || !defined (La_regs) \
|| !defined (La_retval) || !defined (int_retval))
-# error "architecture specific code needed in sysdeps/CPU/tls-audit.h or here"
+# error "architecture specific code needed in sysdeps/CPU/tst-audit.h or here"
#endif
glibc-base := HEAD
DIST_BRANCH := devel
COLLECTION := dist-fc4
-fedora-sync-date := 2006-07-31 07:06 UTC
-fedora-sync-tag := fedora-glibc-20060731T0706
+fedora-sync-date := 2006-08-02 16:50 UTC
+fedora-sync-tag := fedora-glibc-20060802T1650
-%define glibcrelease 15
+%define glibcrelease 16
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define xenarches i686 athlon
%ifarch %{xenarches}
%endif
%changelog
+* Wed Aug 2 2006 Jakub Jelinek <jakub@redhat.com> 2.4.90-16
+- fix dladdr on binaries/libraries with only DT_GNU_HASH and no
+ DT_HASH (#200635)
+- fix early timeout of initgroups data in nscd (#173019)
+- add am/pm display to es_PE and es_NI locales (#167101)
+- fix nss_compat failures when nis/nis+ unavailable (#192072)
+
* Mon Jul 31 2006 Roland McGrath <roland@redhat.com> 2.4.90-15
- fix missing destructor calls in dlclose (#197932)
+- enable transliteration support in all locales (#196713)
+- disallow RTLD_GLOBAL flag for dlmopen in secondary namespaces (#197462)
- PI mutex support
* Tue Jul 10 2006 Jakub Jelinek <jakub@redhat.com> 2.4.90-13
#! /bin/sh -f
# Run available iconv(1) tests.
-# Copyright (C) 1998-2002, 2005 Free Software Foundation, Inc.
+# Copyright (C) 1998-2002, 2005, 2006 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
#
echo "FAILED"; failed=1; continue; }
echo $ac_n "OK$ac_c"
if test -s testdata/$from..$t; then
- cmp $temp1 testdata/$from..$t > /dev/null 2>&1 ||
+ LC_ALL=C cmp $temp1 testdata/$from..$t > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
echo $ac_n "/OK$ac_c"
fi
{ if test $? -gt 128; then exit 1; fi
echo "FAILED"; failed=1; continue; }
echo $ac_n "OK$ac_c"
- test -s $temp1 && cmp testdata/$from $temp2 > /dev/null 2>&1 ||
+ test -s $temp1 &&
+ LC_ALL=C cmp testdata/$from $temp2 > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
echo "/OK"
rm -f $temp1 $temp2
{ if test $? -gt 128; then exit 1; fi
echo "FAILED"; failed=1; continue; }
echo $ac_n "OK$ac_c"
- cmp testdata/suntzus $temp1 ||
+ LC_ALL=C cmp testdata/suntzus $temp1 ||
{ echo "/FAILED"; failed=1; continue; }
echo "/OK"
fi
echo "FAILED"; failed=1; continue; }
echo $ac_n "OK$ac_c"
if test -s testdata/$from..$t; then
- cmp $temp1 testdata/$from..$t > /dev/null 2>&1 ||
+ LC_ALL=C cmp $temp1 testdata/$from..$t > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
echo $ac_n "/OK$ac_c"
fi
{ if test $? -gt 128; then exit 1; fi
echo "FAILED"; failed=1; continue; }
echo $ac_n "OK$ac_c"
- test -s $temp1 && cmp testdata/$from $temp2 > /dev/null 2>&1 ||
+ test -s $temp1 &&
+ LC_ALL=C cmp testdata/$from $temp2 > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
echo "/OK"
rm -f $temp1 $temp2
{ if test $? -gt 128; then exit 1; fi
echo "FAILED"; failed=1; continue; }
echo $ac_n "OK$ac_c"
- cmp testdata/suntzus $temp1 ||
+ LC_ALL=C cmp testdata/suntzus $temp1 ||
{ echo "/FAILED"; failed=1; continue; }
echo "/OK"
fi
# Test conversion to the endianness dependent encoding.
echo $ac_n "test encoder: $utf8 -> $from $ac_c"
$PROG -f $utf8 -t $from < testdata/${filename}..${utf8} > $temp1
- cmp $temp1 testdata/${filename}..${from}.BE > /dev/null 2>&1 ||
- cmp $temp1 testdata/${filename}..${from}.LE > /dev/null 2>&1 ||
+ LC_ALL=C cmp $temp1 testdata/${filename}..${from}.BE > /dev/null 2>&1 ||
+ LC_ALL=C cmp $temp1 testdata/${filename}..${from}.LE > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
echo "OK"
# Test conversion from the endianness dependent encoding.
echo $ac_n "test decoder: $from -> $utf8 $ac_c"
$PROG -f $from -t $utf8 < testdata/${filename}..${from}.BE > $temp1
- cmp $temp1 testdata/${filename}..${utf8} > /dev/null 2>&1 ||
+ LC_ALL=C cmp $temp1 testdata/${filename}..${utf8} > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
$PROG -f $from -t $utf8 < testdata/${filename}..${from}.LE > $temp1
- cmp $temp1 testdata/${filename}..${utf8} > /dev/null 2>&1 ||
+ LC_ALL=C cmp $temp1 testdata/${filename}..${utf8} > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
echo "OK"
# Test byte swapping behaviour.
echo $ac_n "test non-BOM: ${from}BE -> ${from}LE $ac_c"
$PROG -f ${from}BE -t ${from}LE < testdata/${filename}..${from}.BE > $temp1
- cmp $temp1 testdata/${filename}..${from}.LE > /dev/null 2>&1 ||
+ LC_ALL=C cmp $temp1 testdata/${filename}..${from}.LE > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
echo "OK"
# Test byte swapping behaviour.
echo $ac_n "test non-BOM: ${from}LE -> ${from}BE $ac_c"
$PROG -f ${from}LE -t ${from}BE < testdata/${filename}..${from}.LE > $temp1
- cmp $temp1 testdata/${filename}..${from}.BE > /dev/null 2>&1 ||
+ LC_ALL=C cmp $temp1 testdata/${filename}..${from}.BE > /dev/null 2>&1 ||
{ echo "/FAILED"; failed=1; continue; }
echo "OK"
+2006-08-01 Ulrich Drepper <drepper@redhat.com>
+
+ * locales/es_NI: Define real t_fmt_ampm and am_pm.
+ * locales/es_PE: Likewise.
+
2006-07-30 Ulrich Drepper <drepper@redhat.com>
* locales/te_IN: Minor fixups.
d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>"
t_fmt "<U0025><U0054>"
-am_pm "";""
-t_fmt_ampm ""
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U0070>"
+am_pm "<U0041><U004D>";"<U0050><U004D>"
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>"
t_fmt "<U0025><U0054>"
-am_pm "";""
-t_fmt_ampm ""
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U0070>"
+am_pm "<U0041><U004D>";"<U0050><U004D>"
date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"
struct ent_t
{
bool_t files;
+ enum nss_status setent_status;
FILE *stream;
struct blacklist_t blacklist;
};
typedef struct ent_t ent_t;
-static ent_t ext_ent = {TRUE, NULL, {NULL, 0, 0}};
+static ent_t ext_ent = { TRUE, NSS_STATUS_SUCCESS, NULL, { NULL, 0, 0 }};
/* Protect global state against multiple changers. */
__libc_lock_define_initialized (static, lock)
}
static enum nss_status
-internal_setgrent (ent_t *ent, int stayopen)
+internal_setgrent (ent_t *ent, int stayopen, int needent)
{
enum nss_status status = NSS_STATUS_SUCCESS;
else
rewind (ent->stream);
- if (status == NSS_STATUS_SUCCESS && nss_setgrent)
- {
- status = nss_setgrent (stayopen);
- if (status == NSS_STATUS_UNAVAIL)
- status = NSS_STATUS_SUCCESS;
- }
+ if (needent && status == NSS_STATUS_SUCCESS && nss_setgrent)
+ ent->setent_status = nss_setgrent (stayopen);
return status;
}
if (ni == NULL)
init_nss_interface ();
- result = internal_setgrent (&ext_ent, stayopen);
+ result = internal_setgrent (&ext_ent, stayopen, 1);
__libc_lock_unlock (lock);
if (!nss_getgrent_r)
return NSS_STATUS_UNAVAIL;
+ /* If the setgrent call failed, say so. */
+ if (ent->setent_status != NSS_STATUS_SUCCESS)
+ return ent->setent_status;
+
do
{
enum nss_status status;
init_nss_interface ();
if (ext_ent.stream == NULL)
- result = internal_setgrent (&ext_ent, 1);
+ result = internal_setgrent (&ext_ent, 1, 1);
if (result == NSS_STATUS_SUCCESS)
{
_nss_compat_getgrnam_r (const char *name, struct group *grp,
char *buffer, size_t buflen, int *errnop)
{
- ent_t ent = {TRUE, NULL, {NULL, 0, 0}};
+ ent_t ent = { TRUE, NSS_STATUS_SUCCESS, NULL, { NULL, 0, 0 }};
enum nss_status result;
if (name[0] == '-' || name[0] == '+')
__libc_lock_unlock (lock);
- result = internal_setgrent (&ent, 0);
+ result = internal_setgrent (&ent, 0, 0);
if (result == NSS_STATUS_SUCCESS)
result = internal_getgrnam_r (name, grp, &ent, buffer, buflen, errnop);
_nss_compat_getgrgid_r (gid_t gid, struct group *grp,
char *buffer, size_t buflen, int *errnop)
{
- ent_t ent = {TRUE, NULL, {NULL, 0, 0}};
+ ent_t ent = { TRUE, NSS_STATUS_SUCCESS, NULL, { NULL, 0, 0 }};
enum nss_status result;
__libc_lock_lock (lock);
__libc_lock_unlock (lock);
- result = internal_setgrent (&ent, 0);
+ result = internal_setgrent (&ent, 0, 0);
if (result == NSS_STATUS_SUCCESS)
result = internal_getgrgid_r (gid, grp, &ent, buffer, buflen, errnop);
struct ent_t
{
- bool_t netgroup;
- bool_t first;
- bool_t files;
+ bool netgroup;
+ bool first;
+ bool files;
+ enum nss_status setent_status;
FILE *stream;
struct blacklist_t blacklist;
struct passwd pwd;
};
typedef struct ent_t ent_t;
-static ent_t ext_ent = {0, 0, TRUE, NULL, {NULL, 0, 0},
- {NULL, NULL, 0, 0, NULL, NULL, NULL}};
+static ent_t ext_ent = { false, false, true, NSS_STATUS_SUCCESS, NULL,
+ { NULL, 0, 0 },
+ { NULL, NULL, 0, 0, NULL, NULL, NULL }};
/* Protect global state against multiple changers. */
__libc_lock_define_initialized (static, lock)
}
static enum nss_status
-internal_setpwent (ent_t *ent, int stayopen)
+internal_setpwent (ent_t *ent, int stayopen, int needent)
{
enum nss_status status = NSS_STATUS_SUCCESS;
- ent->first = ent->netgroup = FALSE;
- ent->files = TRUE;
+ ent->first = ent->netgroup = false;
+ ent->files = true;
+ ent->setent_status = NSS_STATUS_SUCCESS;
/* If something was left over free it. */
if (ent->netgroup)
give_pwd_free (&ent->pwd);
- if (status == NSS_STATUS_SUCCESS && nss_setpwent)
- {
- status = nss_setpwent (stayopen);
- if (status == NSS_STATUS_UNAVAIL)
- status = NSS_STATUS_SUCCESS;
- }
+ if (needent && status == NSS_STATUS_SUCCESS && nss_setpwent)
+ ent->setent_status = nss_setpwent (stayopen);
return status;
}
if (ni == NULL)
init_nss_interface ();
- result = internal_setpwent (&ext_ent, stayopen);
+ result = internal_setpwent (&ext_ent, stayopen, 1);
__libc_lock_unlock (lock);
if (ent->netgroup)
__internal_endnetgrent (&ent->netgrdata);
- ent->first = ent->netgroup = FALSE;
+ ent->first = ent->netgroup = false;
if (ent->blacklist.data != NULL)
{
if (yp_get_default_domain (&curdomain) != YPERR_SUCCESS)
{
- ent->netgroup = FALSE;
- ent->first = FALSE;
+ ent->netgroup = false;
+ ent->first = false;
give_pwd_free (&ent->pwd);
return NSS_STATUS_UNAVAIL;
}
- if (ent->first == TRUE)
+ if (ent->first == true)
{
memset (&ent->netgrdata, 0, sizeof (struct __netgrent));
__internal_setnetgrent (group, &ent->netgrdata);
- ent->first = FALSE;
+ ent->first = false;
}
while (1)
if (!nss_getpwent_r)
return NSS_STATUS_UNAVAIL;
+ /* If the setpwent call failed, say so. */
+ if (ent->setent_status != NSS_STATUS_SUCCESS)
+ return ent->setent_status;
+
p2len = pwd_need_buflen (&ent->pwd);
if (p2len > buflen)
{
buflen -= p2len;
if (ent->first)
- ent->first = FALSE;
+ ent->first = false;
do
{
{
enum nss_status status;
- ent->netgroup = TRUE;
- ent->first = TRUE;
+ ent->netgroup = true;
+ ent->first = true;
copy_pwd_changes (&ent->pwd, result, NULL, 0);
status = getpwent_next_nss_netgr (NULL, result, ent,
/* +:... */
if (result->pw_name[0] == '+' && result->pw_name[1] == '\0')
{
- ent->files = FALSE;
- ent->first = TRUE;
+ ent->files = false;
+ ent->first = true;
copy_pwd_changes (&ent->pwd, result, NULL, 0);
return getpwent_next_nss (result, ent, buffer, buflen, errnop);
init_nss_interface ();
if (ext_ent.stream == NULL)
- result = internal_setpwent (&ext_ent, 1);
+ result = internal_setpwent (&ext_ent, 1, 1);
if (result == NSS_STATUS_SUCCESS)
result = internal_getpwent_r (pwd, &ext_ent, buffer, buflen, errnop);
char *buffer, size_t buflen, int *errnop)
{
enum nss_status result;
- ent_t ent = {0, 0, TRUE, NULL, {NULL, 0, 0},
- {NULL, NULL, 0, 0, NULL, NULL, NULL}};
+ ent_t ent = { false, false, true, NSS_STATUS_SUCCESS, NULL, { NULL, 0, 0 },
+ { NULL, NULL, 0, 0, NULL, NULL, NULL }};
if (name[0] == '-' || name[0] == '+')
return NSS_STATUS_NOTFOUND;
__libc_lock_unlock (lock);
- result = internal_setpwent (&ent, 0);
+ result = internal_setpwent (&ent, 0, 0);
if (result == NSS_STATUS_SUCCESS)
result = internal_getpwnam_r (name, pwd, &ent, buffer, buflen, errnop);
char *buffer, size_t buflen, int *errnop)
{
enum nss_status result;
- ent_t ent = {0, 0, TRUE, NULL, {NULL, 0, 0},
- {NULL, NULL, 0, 0, NULL, NULL, NULL}};
+ ent_t ent = { false, false, true, NSS_STATUS_SUCCESS, NULL, { NULL, 0, 0 },
+ { NULL, NULL, 0, 0, NULL, NULL, NULL }};
__libc_lock_lock (lock);
__libc_lock_unlock (lock);
- result = internal_setpwent (&ent, 0);
+ result = internal_setpwent (&ent, 0, 0);
if (result == NSS_STATUS_SUCCESS)
result = internal_getpwuid_r (uid, pwd, &ent, buffer, buflen, errnop);
return;
}
-/* returns TRUE if ent->blacklist contains name, else FALSE */
+/* Returns TRUE if ent->blacklist contains name, else FALSE. */
static bool_t
in_blacklist (const char *name, int namelen, ent_t *ent)
{
struct ent_t
{
- bool_t netgroup;
- bool_t files;
- bool_t first;
+ bool netgroup;
+ bool files;
+ bool first;
+ enum nss_status setent_status;
FILE *stream;
struct blacklist_t blacklist;
struct spwd pwd;
};
typedef struct ent_t ent_t;
-static ent_t ext_ent = {0, TRUE, 0, NULL, {NULL, 0, 0},
- {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}};
+static ent_t ext_ent = { false, true, false, NSS_STATUS_SUCCESS, NULL,
+ { NULL, 0, 0},
+ { NULL, NULL, 0, 0, 0, 0, 0, 0, 0}};
/* Protect global state against multiple changers. */
__libc_lock_define_initialized (static, lock)
enum nss_status status = NSS_STATUS_SUCCESS;
ent->first = ent->netgroup = 0;
- ent->files = TRUE;
+ ent->files = true;
/* If something was left over free it. */
if (ent->netgroup)
give_spwd_free (&ent->pwd);
if (status == NSS_STATUS_SUCCESS && nss_setspent)
- {
- status = nss_setspent (stayopen);
- if (status == NSS_STATUS_UNAVAIL)
- status = NSS_STATUS_SUCCESS;
- }
+ ent->setent_status = nss_setspent (stayopen);
return status;
}
if (ent->netgroup)
__internal_endnetgrent (&ent->netgrdata);
- ent->first = ent->netgroup = FALSE;
- ent->files = TRUE;
+ ent->first = ent->netgroup = false;
+ ent->files = true;
if (ent->blacklist.data != NULL)
{
if (!nss_getspnam_r)
return NSS_STATUS_UNAVAIL;
+ /* If the setpwent call failed, say so. */
+ if (ent->setent_status != NSS_STATUS_SUCCESS)
+ return ent->setent_status;
+
if (yp_get_default_domain (&curdomain) != YPERR_SUCCESS)
{
- ent->netgroup = FALSE;
- ent->first = FALSE;
+ ent->netgroup = false;
+ ent->first = false;
give_spwd_free (&ent->pwd);
return NSS_STATUS_UNAVAIL;
}
- if (ent->first == TRUE)
+ if (ent->first == true)
{
memset (&ent->netgrdata, 0, sizeof (struct __netgrent));
__internal_setnetgrent (group, &ent->netgrdata);
- ent->first = FALSE;
+ ent->first = false;
}
while (1)
if (status != 1)
{
__internal_endnetgrent (&ent->netgrdata);
- ent->netgroup = FALSE;
+ ent->netgroup = false;
give_spwd_free (&ent->pwd);
return NSS_STATUS_RETURN;
}
return NSS_STATUS_SUCCESS;
}
+
/* This function handle the +user entrys in /etc/shadow */
static enum nss_status
getspnam_plususer (const char *name, struct spwd *result, ent_t *ent,
return NSS_STATUS_SUCCESS;
}
+
static enum nss_status
getspent_next_file (struct spwd *result, ent_t *ent,
char *buffer, size_t buflen, int *errnop)
{
int status;
- ent->netgroup = TRUE;
- ent->first = TRUE;
+ ent->netgroup = true;
+ ent->first = true;
copy_spwd_changes (&ent->pwd, result, NULL, 0);
status = getspent_next_nss_netgr (NULL, result, ent,
/* +:... */
if (result->sp_namp[0] == '+' && result->sp_namp[1] == '\0')
{
- ent->files = FALSE;
- ent->first = TRUE;
+ ent->files = false;
+ ent->first = true;
copy_spwd_changes (&ent->pwd, result, NULL, 0);
return getspent_next_nss (result, ent, buffer, buflen, errnop);
return getspent_next_nss (pw, ent, buffer, buflen, errnop);
}
+
enum nss_status
_nss_compat_getspent_r (struct spwd *pwd, char *buffer, size_t buflen,
int *errnop)
return result;
}
+
/* Searches in /etc/passwd and the NIS/NIS+ map for a special user */
static enum nss_status
internal_getspnam_r (const char *name, struct spwd *result, ent_t *ent,
return NSS_STATUS_SUCCESS;
}
+
enum nss_status
_nss_compat_getspnam_r (const char *name, struct spwd *pwd,
char *buffer, size_t buflen, int *errnop)
{
enum nss_status result;
- ent_t ent = {0, TRUE, 0, NULL, {NULL, 0, 0},
- {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}};
+ ent_t ent = { false, true, false, NSS_STATUS_SUCCESS, NULL, { NULL, 0, 0},
+ { NULL, NULL, 0, 0, 0, 0, 0, 0, 0}};
if (name[0] == '-' || name[0] == '+')
return NSS_STATUS_NOTFOUND;
return result;
}
+
/* Support routines for remembering -@netgroup and -user entries.
The names are stored in a single string with `|' as separator. */
static void
return;
}
+
/* Returns TRUE if ent->blacklist contains name, else FALSE. */
static bool_t
in_blacklist (const char *name, int namelen, ent_t *ent)
char *cp;
if (ent->blacklist.data == NULL)
- return FALSE;
+ return false;
buf[0] = '|';
cp = stpcpy (&buf[1], name);
+2006-08-01 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/smp.h: New file. Old Linux-specific
+ file. Don't use sysctl.
+ * sysdeps/unix/sysv/linux/smp.h: Always assume SMP. Archs can
+ overwrite the file if this is likely not true.
+
+2006-07-31 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * allocatestack.c (__reclaim_stacks): Reset the PID on cached stacks.
+ * Makefile (tests): Add tst-getpid3.
+ * tst-getpid3.c: New file.
+
2006-07-30 Roland McGrath <roland@redhat.com>
* Makefile (libpthread-routines): Add ptw-sigsuspend.
tst-backtrace1 \
tst-oddstacklimit \
tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \
- tst-getpid1 tst-getpid2 \
+ tst-getpid1 tst-getpid2 tst-getpid3 \
tst-initializers1 $(patsubst %,tst-initializers1-%,c89 gnu89 c99 gnu99)
xtests = tst-setuid1 tst-setuid1-static
list_t *runp;
list_for_each (runp, &stack_used)
{
- struct pthread *curp;
-
- curp = list_entry (runp, struct pthread, list);
+ struct pthread *curp = list_entry (runp, struct pthread, list);
if (curp != self)
{
/* This marks the stack as free. */
}
}
+ /* Reset the PIDs in any cached stacks. */
+ list_for_each (runp, &stack_cache)
+ {
+ struct pthread *curp = list_entry (runp, struct pthread, list);
+ curp->pid = self->pid;
+ }
+
/* Add the stack of all running threads to the cache. */
list_splice (&stack_used, &stack_cache);
--- /dev/null
+/* Determine whether the host has multiple processors. Linux version.
+ Copyright (C) 1996, 2002, 2004, 2006 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. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/utsname.h>
+#include <not-cancel.h>
+
+/* Test whether the machine has more than one processor. This is not the
+ best test but good enough. More complicated tests would require `malloc'
+ which is not available at that time. */
+static inline int
+is_smp_system (void)
+{
+ union
+ {
+ struct utsname uts;
+ char buf[512];
+ } u;
+ char *cp;
+
+ /* Try reading the number using `sysctl' first. */
+ if (uname (&u.uts) == 0)
+ cp = u.uts.version;
+ else
+ {
+ /* This was not successful. Now try reading the /proc filesystem. */
+ int fd = open_not_cancel_2 ("/proc/sys/kernel/version", O_RDONLY);
+ if (__builtin_expect (fd, 0) == -1
+ || read_not_cancel (fd, u.buf, sizeof (u.buf)) <= 0)
+ /* This also didn't work. We give up and say it's a UP machine. */
+ u.buf[0] = '\0';
+
+ close_not_cancel_no_status (fd);
+ cp = u.buf;
+ }
+
+ return strstr (cp, "SMP") != NULL;
+}
/* Determine whether the host has multiple processors. Linux version.
- Copyright (C) 1996, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1996, 2002, 2004, 2006 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
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/sysctl.h>
-#include <not-cancel.h>
-
/* Test whether the machine has more than one processor. This is not the
best test but good enough. More complicated tests would require `malloc'
which is not available at that time. */
static inline int
is_smp_system (void)
{
- static const int sysctl_args[] = { CTL_KERN, KERN_VERSION };
- char buf[512];
- size_t reslen = sizeof (buf);
-
- /* Try reading the number using `sysctl' first. */
- if (__sysctl ((int *) sysctl_args,
- sizeof (sysctl_args) / sizeof (sysctl_args[0]),
- buf, &reslen, NULL, 0) < 0)
- {
- /* This was not successful. Now try reading the /proc filesystem. */
- int fd = open_not_cancel_2 ("/proc/sys/kernel/version", O_RDONLY);
- if (__builtin_expect (fd, 0) == -1
- || (reslen = read_not_cancel (fd, buf, sizeof (buf))) <= 0)
- /* This also didn't work. We give up and say it's a UP machine. */
- buf[0] = '\0';
-
- close_not_cancel_no_status (fd);
- }
-
- return strstr (buf, "SMP") != NULL;
+ /* Assume all machines are SMP and/or CMT and/or SMT. */
+ return 1;
}
--- /dev/null
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+
+static pid_t pid;
+
+static void *
+pid_thread (void *arg)
+{
+ if (pid != getpid ())
+ {
+ printf ("pid wrong in thread: should be %d, is %d\n",
+ (int) pid, (int) getpid ());
+ return (void *) 1L;
+ }
+
+ return NULL;
+}
+
+static int
+do_test (void)
+{
+ pid = getpid ();
+
+ pthread_t thr;
+ int ret = pthread_create (&thr, NULL, pid_thread, NULL);
+ if (ret)
+ {
+ printf ("pthread_create failed: %d\n", ret);
+ return 1;
+ }
+
+ void *thr_ret;
+ ret = pthread_join (thr, &thr_ret);
+ if (ret)
+ {
+ printf ("pthread_create failed: %d\n", ret);
+ return 1;
+ }
+ else if (thr_ret)
+ {
+ printf ("thread getpid failed\n");
+ return 1;
+ }
+
+ pid_t child = fork ();
+ if (child == -1)
+ {
+ printf ("fork failed: %m\n");
+ return 1;
+ }
+ else if (child == 0)
+ {
+ if (pid == getpid ())
+ {
+ puts ("pid did not change after fork");
+ exit (1);
+ }
+
+ pid = getpid ();
+ ret = pthread_create (&thr, NULL, pid_thread, NULL);
+ if (ret)
+ {
+ printf ("pthread_create failed: %d\n", ret);
+ return 1;
+ }
+
+ ret = pthread_join (thr, &thr_ret);
+ if (ret)
+ {
+ printf ("pthread_create failed: %d\n", ret);
+ return 1;
+ }
+ else if (thr_ret)
+ {
+ printf ("thread getpid failed\n");
+ return 1;
+ }
+
+ return 0;
+ }
+
+ int status;
+ if (TEMP_FAILURE_RETRY (waitpid (child, &status, 0)) != child)
+ {
+ puts ("waitpid failed");
+ kill (child, SIGKILL);
+ return 1;
+ }
+
+ if (!WIFEXITED (status))
+ {
+ if (WIFSIGNALED (status))
+ printf ("died from signal %s\n", strsignal (WTERMSIG (status)));
+ else
+ puts ("did not terminate correctly");
+ return 1;
+ }
+ if (WEXITSTATUS (status) != 0)
+ {
+ printf ("exit code %d\n", WEXITSTATUS (status));
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
goto out;
/* Nothing added yet. */
+ bool any_success = false;
while (! no_more)
{
long int prev_start = start;
if (NSS_STATUS_TRYAGAIN > status || status > NSS_STATUS_RETURN)
__libc_fatal ("illegal status in internal_getgrouplist");
+ any_success |= status == NSS_STATUS_SUCCESS;
+
if (status != NSS_STATUS_SUCCESS
&& nss_next_action (nip, status) == NSS_ACTION_RETURN)
break;
ssize_t total;
ssize_t written;
out:
- if (start == 0)
+ if (!any_success)
{
/* Nothing found. Create a negative result record. */
written = total = sizeof (notfound);
CFLAGS-pwrite64.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-sleep.c = -fexceptions
CFLAGS-wait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-waitid.c = -fexceptions
+CFLAGS-waitid.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-waitpid.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-getopt.c = -fexceptions
CFLAGS-wordexp.c = -fexceptions
/* Test program for returning the canonical absolute name of a given file.
- Copyright (C) 1996,1997,2000,2002,2004,2005 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,2000,2002,2004,2005,2006
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger <davidm@azstarnet.com>.
}
if (fd >= 0)
- unlink ("doesExist/someFile");
+ {
+ close (fd);
+ unlink ("doesExist/someFile");
+ }
if (has_dir)
rmdir ("doesExist");
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#include <sys/sysctl.h>
#include <sys/utsname.h>
#include <kernel-features.h>
#include <dl-sysdep.h>
# File name Caller Syscall name Args Strong name Weak names
-add_key EXTRA add_key i:pppii add_key
adjtimex adjtime adjtimex i:p __adjtimex adjtimex ntp_adjtime __adjtimex_internal
bdflush EXTRA bdflush i:ii bdflush
capget EXTRA capget i:pp capget
inotify_rm_watch EXTRA inotify_rm_watch i:ii inotify_rm_watch
ioperm - ioperm i:iii ioperm
iopl - iopl i:i iopl
-keyctl EXTRA keyctl i:iiiii keyctl
klogctl EXTRA syslog i:isi klogctl
lchown - lchown i:sii __lchown lchown
posix_madvise - madvise Vi:pii posix_madvise
query_module EXTRA query_module i:sipip query_module
quotactl EXTRA quotactl i:isip quotactl
remap_file_pages - remap_file_pages i:piiii __remap_file_pages remap_file_pages
-request_key EXTRA request_key i:pppi request_key
sched_getp - sched_getparam i:ip __sched_getparam sched_getparam
sched_gets - sched_getscheduler i:i __sched_getscheduler sched_getscheduler
sched_primax - sched_get_priority_max i:i __sched_get_priority_max sched_get_priority_max