[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r1969 - in /trunk/libc: ./ bits/ nis/ nis/nss_nisplus/ nis/rpcsvc/ nptl/ nptl/sysdeps/unix/sysv/linux/powerpc/ nscd/ posix/ ...
- To: commits@xxxxxxxxxx
- Subject: [commits] r1969 - in /trunk/libc: ./ bits/ nis/ nis/nss_nisplus/ nis/rpcsvc/ nptl/ nptl/sysdeps/unix/sysv/linux/powerpc/ nscd/ posix/ ...
- From: joseph@xxxxxxxxxx
- Date: Fri, 13 Apr 2007 15:35:46 -0000
Author: joseph
Date: Fri Apr 13 08:35:45 2007
New Revision: 1969
Log:
Merge changes between r1748 and r1968 from /fsf/trunk.
Added:
trunk/libc/posix/sched_cpucount.c
- copied unchanged from r1968, fsf/trunk/libc/posix/sched_cpucount.c
trunk/libc/posix/tst-cpucount.c
- copied unchanged from r1968, fsf/trunk/libc/posix/tst-cpucount.c
trunk/libc/posix/tst-fnmatch2.c
- copied unchanged from r1968, fsf/trunk/libc/posix/tst-fnmatch2.c
Modified:
trunk/libc/ChangeLog
trunk/libc/bits/sched.h
trunk/libc/config.h.in
trunk/libc/configure
trunk/libc/configure.in
trunk/libc/nis/nis_call.c
trunk/libc/nis/nis_lookup.c
trunk/libc/nis/nis_table.c
trunk/libc/nis/nss_nisplus/nisplus-ethers.c
trunk/libc/nis/nss_nisplus/nisplus-network.c
trunk/libc/nis/nss_nisplus/nisplus-pwd.c
trunk/libc/nis/nss_nisplus/nisplus-rpc.c
trunk/libc/nis/nss_nisplus/nisplus-service.c
trunk/libc/nis/nss_nisplus/nisplus-spwd.c
trunk/libc/nis/rpcsvc/nislib.h
trunk/libc/nptl/ChangeLog
trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
trunk/libc/nptl/tst-locale1.c
trunk/libc/nptl/tst-locale2.c
trunk/libc/nscd/gai.c
trunk/libc/nscd/selinux.c
trunk/libc/nscd/selinux.h
trunk/libc/posix/Makefile
trunk/libc/posix/Versions
trunk/libc/posix/fnmatch.c
trunk/libc/posix/fnmatch_loop.c
trunk/libc/posix/sched.h
trunk/libc/posix/sys/wait.h
trunk/libc/scripts/check-local-headers.sh
trunk/libc/soft-fp/double.h
trunk/libc/soft-fp/extended.h
trunk/libc/soft-fp/quad.h
trunk/libc/sysdeps/ia64/fpu/fesetround.c
trunk/libc/sysdeps/powerpc/bits/atomic.h
trunk/libc/sysdeps/powerpc/powerpc32/bits/atomic.h
trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.c
trunk/libc/sysdeps/powerpc/powerpc32/memset.S
trunk/libc/sysdeps/powerpc/powerpc64/bits/atomic.h
trunk/libc/sysdeps/powerpc/powerpc64/memset.S
trunk/libc/sysdeps/unix/sysv/linux/Makefile
trunk/libc/sysdeps/unix/sysv/linux/Versions
trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
trunk/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
trunk/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c
trunk/libc/timezone/africa
trunk/libc/timezone/asia
trunk/libc/timezone/australasia
trunk/libc/timezone/backward
trunk/libc/timezone/europe
trunk/libc/timezone/iso3166.tab
trunk/libc/timezone/leapseconds
trunk/libc/timezone/northamerica
trunk/libc/timezone/private.h
trunk/libc/timezone/southamerica
trunk/libc/timezone/zdump.c
trunk/libc/timezone/zic.c
trunk/libc/timezone/zone.tab
Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Fri Apr 13 08:35:45 2007
@@ -1,3 +1,181 @@
+2007-04-07 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * posix/sys/wait.h: Remove unnecessary forward declaration.
+
+2007-04-05 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * nis/nis_call.c (__nisfind_server): Replace (*dir)->do_servers
+ with obj->do_servers after first_shoot.
+
+2007-04-03 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * posix/Makefile (routines): Add sched_cpucount.
+ (tests): Add tst-cpucount.
+ * posix/sched_cpucount.c: New file.
+ * posix/tst-cpucount.c: New file.
+ * posix/Versions: Export __sched_cpucount with version GLIBC_2.6.
+ * bits/sched.h: Define __CPU_COUNT. Declare __sched_cpucount.
+ * sysdeps/unix/sysv/linux/bits/sched.h: Likewise.
+ * posix/sched.h: Define CPU_COUNT.
+
+2007-03-27 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * posix/fnmatch.c (STRUCT): Define.
+ (fnmatch): Pass NULL as last argument to internal_fn{,w}match.
+ * posix/fnmatch_loop.c (struct STRUCT): New type.
+ (FCT): Add ends argument. If ends != NULL and normal * is
+ seen in the pattern, store current pattern and string pointers
+ and return. Adjust recursive calls.
+ (EXT): Adjust FCT callers.
+ (STRUCT): Undef at the end of the file.
+ * posix/Makefile (tests): Add tst-fnmatch2.
+ * posix/tst-fnmatch2.c: New test.
+
+2007-04-01 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * sysdeps/ia64/fpu/fesetround.c (fesetround): Return 0 on success
+ and 1 on failure.
+
+ * sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range):
+ Change last argument to unsigned int.
+
+2007-03-23 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * scripts/check-local-headers.sh: Filter out sys/capability.h.
+
+2007-03-22 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * config.h.in (HAVE_LIBCAP): Add.
+ * nscd/selinux.h: Include sys/capability.h rather than non-existent
+ sys/capabilities.h.
+ * nscd/selinux.c (preserve_capabilities): Use cap_free instead of
+ free_caps. Cast away const from 4th cap_set_flag argument.
+
+2007-03-26 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/Versions: Move sync_file_range to
+ GLIBC_2.6.
+ * sysdeps/unix/sysv/linux/Makefile [subdir=io] (sysdep_routines):
+ Add sync_file_range.
+ Reported by Atsushi Nemoto <anemo@xxxxxxxxxxxxx>.
+
+2007-03-19 Steven Munroe <sjmunroe@xxxxxxxxxx>
+
+ * sysdeps/powerpc/bits/atomic.h
+ [!MUTEX_HINT_ACQ]: Define MUTEX_HINT_ACQ.
+ [!MUTEX_HINT_REL]: Define MUTEX_HINT_REL.
+ (__arch_compare_and_exchange_val_32_acq): Add MUTEX_HINT_ACQ to lwarx.
+ (__arch_compare_and_exchange_val_32_rel): Add MUTEX_HINT_REL to lwarx.
+ (__arch_atomic_exchange_val_32_acq): Add MUTEX_HINT_ACQ to lwarx.
+ (__arch_atomic_exchange_rel_32_rel): Add MUTEX_HINT_REL to lwarx.
+ * sysdeps/powerpc/powerpc32/bits/atomic.h [_ARCH_PWR6 || _ARCH_PWR6X]:
+ Define MUTEX_HINT_ACQ as ",1" and MUTEX_HINT_REL as ",0".
+ (__arch_compare_and_exchange_bool_32_acq): Add MUTEX_HINT_ACQ to lwarx.
+ (__arch_compare_and_exchange_bool_32_rel): Add MUTEX_HINT_REL to lwarx.
+ * sysdeps/powerpc/powerpc64/bits/atomic.h [_ARCH_PWR6 || _ARCH_PWR6D]:
+ Define MUTEX_HINT_ACQ as ",1" and MUTEX_HINT_REL as ",0".
+ (__arch_compare_and_exchange_bool_32_acq): Add MUTEX_HINT_ACQ to lwarx.
+ (__arch_compare_and_exchange_bool_32_rel): Add MUTEX_HINT_REL to lwarx.
+ (__arch_compare_and_exchange_bool_64_acq): Add MUTEX_HINT_ACQ to lwarx.
+ (__arch_compare_and_exchange_bool_64_rel): Add MUTEX_HINT_REL to lwarx.
+ (__arch_compare_and_exchange_val_64_acq): Add MUTEX_HINT_ACQ to lwarx.
+ (__arch_compare_and_exchange_val_64_rel): Add MUTEX_HINT_REL to lwarx.
+ (__arch_atomic_exchange_val_64_acq): Add MUTEX_HINT_ACQ to lwarx.
+ (__arch_atomic_exchange_rel_64_rel): Add MUTEX_HINT_REL to lwarx.
+
+2007-03-20 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/powerpc/libc-start.c
+ (__cache_line_size): Define the variable here. Add
+ attribute_hidden, remove weak_extern.
+ (__libc_start_main): Set __cache_line_size
+ unconditionally.
+ * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+ (__cache_line_size): Define the variable here. Add
+ attribute_hidden, remove weak_extern.
+ (DL_PLATFORM_AUXV): Set __cache_line_size
+ unconditionally.
+ * sysdeps/powerpc/powerpc32/dl-machine.c (__cache_line_size): Remove
+ weak_extern, add attribute_hidden.
+ (__elf_machine_runtime_setup): Assume __cache_line_size is always
+ defined in ld.so.
+ * sysdeps/powerpc/powerpc32/memset.S (__cache_line_size): Remove
+ definition.
+ * sysdeps/powerpc/powerpc64/memset.S (__cache_line_size): Likewise.
+
+2007-03-26 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ [BZ #4276]
+ * timezone/africa: Update from tzdata2007d.
+ * timezone/asia: Likewise.
+ * timezone/australasia: Likewise.
+ * timezone/backward: Likewise.
+ * timezone/europe: Likewise.
+ * timezone/iso3166.tab: Likewise.
+ * timezone/leapseconds: Likewise.
+ * timezone/northamerica: Likewise.
+ * timezone/southamerica: Likewise.
+ * timezone/zone.tab: Likewise.
+
+ * timezone/private.h: Update from tzcode2007d.
+ * timezone/zdump.c: Likewise.
+ * timezone/zic.c: Likewise.
+
+2007-03-21 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * nis/nis_call.c: Include bits/libc-lock.h, sys/stat.h, unistd.h.
+ (nis_server_cache, nis_server_cache_lock, nis_cold_start_mtime): New
+ variables.
+ (nis_server_cache_search, nis_server_cache_add): New functions.
+ (__nisfind_server): Use them. Add dbp and flags argument, if
+ call __nisbind_create.
+ (__nisbind_create): Add server_used and current_ep arguments,
+ only call __nis_findfastest if server_used is ~0.
+ (__do_niscall2, __prepare_niscall): Adjust callers.
+ (ckey_cache, ckey_cache_size, ckey_cache_allocated, ckey_cache_pid,
+ ckey_cache_euid, ckey_cache_lock): New variables.
+ (get_ckey): New function.
+ (__nisbind_connect): If not dbp->use_udp, pass IPPROTO_TCP to
+ __pmap_getnisport. Save __pmap_getnisport result in
+ dbp->addr.sin_port if non-zero. Use get_ckey to create conversation
+ key.
+ * nis/nis_lookup.c (nis_lookup): Likewise.
+ * nis/nis_table.c (nis_list): Likewise.
+ * nis/rpcsvc/nislib.h (__nisbind_create, __nisfind_server): Adjust
+ prototypes.
+
+ * nis/nss_nisplus/nisplus-pwd.c (_nss_nisplus_getpwnam_r,
+ _nss_nisplus_getpwuid_r): Pass USE_DGRAM flag to nis_list.
+ * nis/nss_nisplus/nisplus-service.c (_nss_nisplus_getservbyname_r,
+ _nss_nisplus_getservbyport_r): Likewise.
+ * nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyname_r,
+ _nss_nisplus_getnetbyaddr_r): Likewise.
+ * nis/nss_nisplus/nisplus-spwd.c (_nss_nisplus_getspnam_r): Likewise.
+ * nis/nss_nisplus/nisplus-ethers.c (_nss_nisplus_gethostton_r,
+ _nss_nisplus_getntohost_r): Likewise.
+ * nis/nss_nisplus/nisplus-rpc.c (_nss_nisplus_getrpcbyname_r,
+ _nss_nisplus_getrpcbynumber_r): Likewise.
+
+2007-03-20 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * configure.in (libc_cv_gnu89_inline): Only do compile test.
+ * configure: Rebuilt.
+
+ * soft-fp/double.h (_FP_UNION_D): Use _FP_W_TYPE for frac
+ bit-fields.
+ * soft-fp/extended.h (_FP_UNION_E): Likewise.
+
+2006-06-07 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ [BZ #2831]
+ * soft-fp/quad.h (_FP_UNION_Q): Use _FP_W_TYPE for frac
+ bit-fields.
+
+2007-03-18 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * nscd/gai.c: Include alloca.h.
+ (__libc_use_alloca): Define.
+
2007-03-16 Jakub Jelinek <jakub@xxxxxxxxxx>
* elf/dl-open.c (dl_open_worker): Declare l in 2 different
Modified: trunk/libc/bits/sched.h
==============================================================================
--- trunk/libc/bits/sched.h (original)
+++ trunk/libc/bits/sched.h Fri Apr 13 08:35:45 2007
@@ -1,6 +1,6 @@
/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
- Copyright (C) 1996, 1997, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2001, 2003, 2007 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
@@ -68,4 +68,7 @@
((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
# define __CPU_ISSET(cpu, cpusetp) \
(((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
+extern int __sched_cpucount (size_t __setsize, cpu_set_t *__setp) __THROW;
+# define __CPU_COUNT(cpusetp) \
+ __sched_cpucount (sizeof (cpu_set_t), cpusetp)
#endif
Modified: trunk/libc/config.h.in
==============================================================================
--- trunk/libc/config.h.in (original)
+++ trunk/libc/config.h.in Fri Apr 13 08:35:45 2007
@@ -18,6 +18,9 @@
/* Defined if building with SELinux support & audit libs are detected. */
#undef HAVE_LIBAUDIT
+
+/* Defined if building with SELinux support & libcap libs are detected. */
+#undef HAVE_LIBCAP
/* Define if using XCOFF. Set by --with-xcoff. */
#undef HAVE_XCOFF
Modified: trunk/libc/configure
==============================================================================
--- trunk/libc/configure (original)
+++ trunk/libc/configure Fri Apr 13 08:35:45 2007
@@ -5975,8 +5975,8 @@
#error
#endif
EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -std=gnu99 -fgnu89-inline
- -o conftest conftest.c 1>&5'
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
+ -o conftest.s conftest.c 1>&5'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
Modified: trunk/libc/configure.in
==============================================================================
--- trunk/libc/configure.in (original)
+++ trunk/libc/configure.in Fri Apr 13 08:35:45 2007
@@ -1653,8 +1653,8 @@
#error
#endif
EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -std=gnu99 -fgnu89-inline
- -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -S -std=gnu99 -fgnu89-inline
+ -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD])
then
libc_cv_gnu89_inline=yes
else
Modified: trunk/libc/nis/nis_call.c
==============================================================================
--- trunk/libc/nis/nis_call.c (original)
+++ trunk/libc/nis/nis_call.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997,1998,2001,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2001, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxxxxxxxxxxxxxx>, 1997.
@@ -25,8 +26,11 @@
#include <rpc/auth.h>
#include <rpcsvc/nis.h>
#include <sys/socket.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <bits/libc-lock.h>
#include "nis_xdr.h"
#include "nis_intern.h"
@@ -107,10 +111,79 @@
}
libnsl_hidden_def (__nisbind_next)
+static struct ckey_cache_entry
+{
+ struct in_addr inaddr;
+ in_port_t port;
+ unsigned int protocol;
+ des_block ckey;
+} *ckey_cache;
+static size_t ckey_cache_size;
+static size_t ckey_cache_allocated;
+static pid_t ckey_cache_pid;
+static uid_t ckey_cache_euid;
+__libc_lock_define_initialized (static, ckey_cache_lock)
+
+static bool_t
+get_ckey (des_block *ckey, struct sockaddr_in *addr, unsigned int protocol)
+{
+ size_t i;
+ pid_t pid = getpid ();
+ uid_t euid = geteuid ();
+ bool_t ret = FALSE;
+
+ __libc_lock_lock (ckey_cache_lock);
+
+ if (ckey_cache_pid != pid || ckey_cache_euid != euid)
+ {
+ ckey_cache_size = 0;
+ ckey_cache_pid = pid;
+ ckey_cache_euid = euid;
+ }
+
+ for (i = 0; i < ckey_cache_size; ++i)
+ if (ckey_cache[i].port == addr->sin_port
+ && ckey_cache[i].protocol == protocol
+ && memcmp (&ckey_cache[i].inaddr, &addr->sin_addr,
+ sizeof (addr->sin_addr)) == 0)
+ {
+ *ckey = ckey_cache[i].ckey;
+ ret = TRUE;
+ break;
+ }
+
+ if (!ret && key_gendes (ckey) >= 0)
+ {
+ ret = TRUE;
+ /* Don't grow the cache indefinitely. */
+ if (ckey_cache_size == 256)
+ ckey_cache_size = 0;
+ if (ckey_cache_size == ckey_cache_allocated)
+ {
+ size_t size = ckey_cache_allocated ? ckey_cache_allocated * 2 : 16;
+ struct ckey_cache_entry *new_cache
+ = realloc (ckey_cache, size * sizeof (*ckey_cache));
+ if (new_cache != NULL)
+ {
+ ckey_cache = new_cache;
+ ckey_cache_allocated = size;
+ }
+ }
+ ckey_cache[ckey_cache_size].inaddr = addr->sin_addr;
+ ckey_cache[ckey_cache_size].port = addr->sin_port;
+ ckey_cache[ckey_cache_size].protocol = protocol;
+ ckey_cache[ckey_cache_size++].ckey = *ckey;
+ }
+
+ __libc_lock_unlock (ckey_cache_lock);
+ return ret;
+}
+
nis_error
__nisbind_connect (dir_binding *dbp)
{
nis_server *serv;
+ u_short port;
if (dbp == NULL)
return NIS_FAIL;
@@ -128,9 +201,12 @@
/* Check, if the host is online and rpc.nisd is running. Much faster
then the clnt*_create functions: */
- if (__pmap_getnisport (&dbp->addr, NIS_PROG, NIS_VERSION, IPPROTO_UDP) == 0)
+ port = __pmap_getnisport (&dbp->addr, NIS_PROG, NIS_VERSION,
+ dbp->use_udp ? IPPROTO_UDP : IPPROTO_TCP);
+ if (port == 0)
return NIS_RPCERROR;
+ dbp->addr.sin_port = htons (port);
dbp->socket = RPC_ANYSOCK;
if (dbp->use_udp)
dbp->clnt = clntudp_create (&dbp->addr, NIS_PROG, NIS_VERSION,
@@ -153,17 +229,16 @@
{
char netname[MAXNETNAMELEN + 1];
char *p;
-
- p = stpcpy (netname, "unix.");
+ des_block ckey;
+
+ p = stpcpy (netname, "unix@");
strncpy (p, serv->name, MAXNETNAMELEN - 5);
netname[MAXNETNAMELEN] = '\0';
- // XXX What is this supposed to do? If we really want to replace
- // XXX the first dot, then we might as well use unix@ as the
- // XXX prefix string. --drepper
- p = strchr (netname, '.');
- *p = '@';
- dbp->clnt->cl_auth =
- authdes_pk_create (netname, &serv->pkey, 300, NULL, NULL);
+ dbp->clnt->cl_auth = NULL;
+ if (get_ckey (&ckey, &dbp->addr,
+ dbp->use_udp ? IPPROTO_UDP : IPPROTO_TCP))
+ dbp->clnt->cl_auth =
+ authdes_pk_create (netname, &serv->pkey, 300, NULL, &ckey);
if (!dbp->clnt->cl_auth)
dbp->clnt->cl_auth = authunix_create_default ();
}
@@ -177,7 +252,8 @@
nis_error
__nisbind_create (dir_binding *dbp, const nis_server *serv_val,
- unsigned int serv_len, unsigned int flags)
+ unsigned int serv_len, unsigned int server_used,
+ unsigned int current_ep, unsigned int flags)
{
dbp->clnt = NULL;
@@ -203,8 +279,16 @@
dbp->trys = 1;
dbp->class = -1;
- if (__nis_findfastest (dbp) < 1)
- return NIS_NAMEUNREACHABLE;
+ if (server_used == ~0)
+ {
+ if (__nis_findfastest (dbp) < 1)
+ return NIS_NAMEUNREACHABLE;
+ }
+ else
+ {
+ dbp->server_used = server_used;
+ dbp->current_ep = current_ep;
+ }
return NIS_SUCCESS;
}
@@ -306,7 +390,7 @@
if (flags & MASTER_ONLY)
server_len = 1;
- status = __nisbind_create (&dbp, server, server_len, flags);
+ status = __nisbind_create (&dbp, server, server_len, ~0, ~0, flags);
if (status != NIS_SUCCESS)
return status;
@@ -499,41 +583,220 @@
return obj;
}
+static struct nis_server_cache
+{
+ int search_parent_first;
+ int uses;
+ unsigned int size;
+ unsigned int server_used;
+ unsigned int current_ep;
+ time_t expires;
+ char name[];
+} *nis_server_cache[16];
+static time_t nis_cold_start_mtime;
+__libc_lock_define_initialized (static, nis_server_cache_lock)
+
+static directory_obj *
+nis_server_cache_search (const_nis_name name, int search_parent_first,
+ unsigned int *server_used, unsigned int *current_ep,
+ struct timeval *now)
+{
+ directory_obj *ret = NULL;
+ int i;
+ char *addr;
+ XDR xdrs;
+ struct stat64 st;
+
+ if (stat64 ("/var/nis/NIS_COLD_START", &st) < 0)
+ st.st_mtime = nis_cold_start_mtime + 1;
+
+ __libc_lock_lock (nis_server_cache_lock);
+
+ for (i = 0; i < 16; ++i)
+ if (nis_server_cache[i] == NULL)
+ continue;
+ else if (st.st_mtime != nis_cold_start_mtime
+ || now->tv_sec > nis_server_cache[i]->expires)
+ {
+ free (nis_server_cache[i]);
+ nis_server_cache[i] = NULL;
+ }
+ else if (nis_server_cache[i]->search_parent_first == search_parent_first
+ && strcmp (nis_server_cache[i]->name, name) == 0)
+ {
+ ret = calloc (1, sizeof (directory_obj));
+ if (ret == NULL)
+ break;
+
+ addr = rawmemchr (nis_server_cache[i]->name, '\0') + 8;
+ addr = (char *) ((uintptr_t) addr & ~(uintptr_t) 7);
+ xdrmem_create (&xdrs, addr, nis_server_cache[i]->size, XDR_DECODE);
+ if (!_xdr_directory_obj (&xdrs, ret))
+ {
+ xdr_destroy (&xdrs);
+ free (ret);
+ ret = NULL;
+ free (nis_server_cache[i]);
+ nis_server_cache[i] = NULL;
+ break;
+ }
+ xdr_destroy (&xdrs);
+ *server_used = nis_server_cache[i]->server_used;
+ *current_ep = nis_server_cache[i]->current_ep;
+ break;
+ }
+
+ nis_cold_start_mtime = st.st_mtime;
+
+ __libc_lock_unlock (nis_server_cache_lock);
+ return ret;
+}
+
+static void
+nis_server_cache_add (const_nis_name name, int search_parent_first,
+ directory_obj *dir, unsigned int server_used,
+ unsigned int current_ep, struct timeval *now)
+{
+ struct nis_server_cache **loc;
+ struct nis_server_cache *new;
+ struct nis_server_cache *old;
+ int i;
+ char *addr;
+ unsigned int size;
+ XDR xdrs;
+
+ if (dir == NULL)
+ return;
+
+ size = xdr_sizeof ((xdrproc_t) _xdr_directory_obj, (char *) dir);
+ new = calloc (1, sizeof (*new) + strlen (name) + 8 + size);
+ if (new == NULL)
+ return;
+ new->search_parent_first = search_parent_first;
+ new->uses = 1;
+ new->expires = now->tv_sec + dir->do_ttl;
+ new->size = size;
+ new->server_used = server_used;
+ new->current_ep = current_ep;
+ addr = stpcpy (new->name, name) + 8;
+ addr = (char *) ((uintptr_t) addr & ~(uintptr_t) 7);
+
+ xdrmem_create(&xdrs, addr, size, XDR_ENCODE);
+ if (!_xdr_directory_obj (&xdrs, dir))
+ {
+ xdr_destroy (&xdrs);
+ free (new);
+ return;
+ }
+ xdr_destroy (&xdrs);
+
+ __libc_lock_lock (nis_server_cache_lock);
+
+ /* Choose which entry should be evicted from the cache. */
+ loc = &nis_server_cache[0];
+ if (*loc != NULL)
+ for (i = 1; i < 16; ++i)
+ if (nis_server_cache[i] == NULL)
+ {
+ loc = &nis_server_cache[i];
+ break;
+ }
+ else if ((*loc)->uses > nis_server_cache[i]->uses
+ || ((*loc)->uses == nis_server_cache[i]->uses
+ && (*loc)->expires > nis_server_cache[i]->expires))
+ loc = &nis_server_cache[i];
+ old = *loc;
+ *loc = new;
+
+ __libc_lock_unlock (nis_server_cache_lock);
+ free (old);
+}
+
nis_error
__nisfind_server (const_nis_name name, int search_parent_first,
- directory_obj **dir)
-{
+ directory_obj **dir, dir_binding *dbp, unsigned int flags)
+{
+ nis_error result = NIS_SUCCESS;
+ nis_error status;
+ directory_obj *obj;
+ struct timeval now;
+ unsigned int server_used = ~0;
+ unsigned int current_ep = ~0;
+
if (name == NULL)
return NIS_BADNAME;
-#if 0
- /* Search in local cache. In the moment, we ignore the fastest server */
- if (!(flags & NO_CACHE))
- dir = __nis_cache_search (name, flags, &cinfo);
-#endif
-
- nis_error result = NIS_SUCCESS;
+ if (*dir != NULL)
+ return NIS_SUCCESS;
+
+ (void) gettimeofday (&now, NULL);
+
+ if ((flags & NO_CACHE) == 0)
+ *dir = nis_server_cache_search (name, search_parent_first, &server_used,
+ ¤t_ep, &now);
+ if (*dir != NULL)
+ {
+ unsigned int server_len = (*dir)->do_servers.do_servers_len;
+ if (flags & MASTER_ONLY)
+ {
+ server_len = 1;
+ if (server_used != 0)
+ {
+ server_used = ~0;
+ current_ep = ~0;
+ }
+ }
+ result = __nisbind_create (dbp, (*dir)->do_servers.do_servers_val,
+ server_len, server_used, current_ep, flags);
+ if (result != NIS_SUCCESS)
+ {
+ nis_free_directory (*dir);
+ *dir = NULL;
+ }
+ return result;
+ }
+
+ *dir = readColdStartFile ();
if (*dir == NULL)
- {
- nis_error status;
- directory_obj *obj;
-
- *dir = readColdStartFile ();
- if (*dir == NULL)
- /* No /var/nis/NIS_COLD_START->no NIS+ installed. */
- return NIS_UNAVAIL;
-
- /* Try at first, if servers in "dir" know our object */
- obj = first_shoot (name, search_parent_first, *dir);
+ /* No /var/nis/NIS_COLD_START->no NIS+ installed. */
+ return NIS_UNAVAIL;
+
+ /* Try at first, if servers in "dir" know our object */
+ obj = first_shoot (name, search_parent_first, *dir);
+ if (obj == NULL)
+ {
+ obj = rec_dirsearch (name, *dir, &status);
if (obj == NULL)
- {
- obj = rec_dirsearch (name, *dir, &status);
- if (obj == NULL)
- result = status;
- }
-
- *dir = obj;
- }
+ result = status;
+ }
+
+ if (result == NIS_SUCCESS)
+ {
+ unsigned int server_len = obj->do_servers.do_servers_len;
+ if (flags & MASTER_ONLY)
+ server_len = 1;
+ result = __nisbind_create (dbp, obj->do_servers.do_servers_val,
+ server_len, ~0, ~0, flags);
+ if (result == NIS_SUCCESS)
+ {
+ if ((flags & MASTER_ONLY) == 0
+ || obj->do_servers.do_servers_len == 1)
+ {
+ server_used = dbp->server_used;
+ current_ep = dbp->current_ep;
+ }
+ if ((flags & NO_CACHE) == 0)
+ nis_server_cache_add (name, search_parent_first, obj,
+ server_used, current_ep, &now);
+ }
+ else
+ {
+ nis_free_directory (obj);
+ obj = NULL;
+ }
+ }
+
+ *dir = obj;
return result;
}
@@ -543,38 +806,19 @@
__prepare_niscall (const_nis_name name, directory_obj **dirp,
dir_binding *bptrp, unsigned int flags)
{
- nis_error retcode = __nisfind_server (name, 1, dirp);
+ nis_error retcode = __nisfind_server (name, 1, dirp, bptrp, flags);
if (__builtin_expect (retcode != NIS_SUCCESS, 0))
return retcode;
- nis_server *server;
- u_int server_len;
-
- if (flags & MASTER_ONLY)
- {
- server = (*dirp)->do_servers.do_servers_val;
- server_len = 1;
- }
- else
- {
- server = (*dirp)->do_servers.do_servers_val;
- server_len = (*dirp)->do_servers.do_servers_len;
- }
-
- retcode = __nisbind_create (bptrp, server, server_len, flags);
- if (retcode == NIS_SUCCESS)
- {
- do
- if (__nisbind_connect (bptrp) == NIS_SUCCESS)
- return NIS_SUCCESS;
- while (__nisbind_next (bptrp) == NIS_SUCCESS);
-
- __nisbind_destroy (bptrp);
- memset (bptrp, '\0', sizeof (*bptrp));
-
- retcode = NIS_NAMEUNREACHABLE;
- }
-
+ do
+ if (__nisbind_connect (bptrp) == NIS_SUCCESS)
+ return NIS_SUCCESS;
+ while (__nisbind_next (bptrp) == NIS_SUCCESS);
+
+ __nisbind_destroy (bptrp);
+ memset (bptrp, '\0', sizeof (*bptrp));
+
+ retcode = NIS_NAMEUNREACHABLE;
nis_free_directory (*dirp);
*dirp = NULL;
Modified: trunk/libc/nis/nis_lookup.c
==============================================================================
--- trunk/libc/nis/nis_lookup.c (original)
+++ trunk/libc/nis/nis_lookup.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997-1999, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-1999, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxxxxxxxxxxx>, 1997.
@@ -127,18 +128,10 @@
/* Otherwise __nisfind_server will not do anything. */
dir = NULL;
- if (__nisfind_server (req.ns_name, 1, &dir)
+ if (__nisfind_server (req.ns_name, 1, &dir, &bptr,
+ flags & ~MASTER_ONLY)
!= NIS_SUCCESS)
goto out;
-
- if (__nisbind_create (&bptr,
- dir->do_servers.do_servers_val,
- dir->do_servers.do_servers_len,
- flags) != NIS_SUCCESS)
- {
- nis_free_directory (dir);
- goto out;
- }
}
else
if (__nisbind_next (&bptr) != NIS_SUCCESS)
Modified: trunk/libc/nis/nis_table.c
==============================================================================
--- trunk/libc/nis/nis_table.c (original)
+++ trunk/libc/nis/nis_table.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,5 @@
-/* Copyright (c) 1997-1999,2003,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (c) 1997-1999, 2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxx>, 1997.
@@ -274,20 +275,13 @@
memset (res, '\0', sizeof (nis_result));
status = __nisfind_server (ibreq->ibr_name,
- ibreq->ibr_srch.ibr_srch_val != NULL, &dir);
+ ibreq->ibr_srch.ibr_srch_val != NULL,
+ &dir, &bptr, flags & ~MASTER_ONLY);
if (status != NIS_SUCCESS)
{
NIS_RES_STATUS (res) = status;
goto fail3;
}
-
- status = __nisbind_create (&bptr, dir->do_servers.do_servers_val,
- dir->do_servers.do_servers_len, flags);
- if (__builtin_expect (status != NIS_SUCCESS, 0))
- {
- NIS_RES_STATUS (res) = status;
- goto fail2;
- }
while (__nisbind_connect (&bptr) != NIS_SUCCESS)
if (__builtin_expect (__nisbind_next (&bptr) != NIS_SUCCESS, 0))
@@ -338,7 +332,6 @@
NIS_RES_STATUS (res) = NIS_NOMEMORY;
fail:
__nisbind_destroy (&bptr);
- fail2:
nis_free_directory (dir);
fail3:
free (tablepath);
Modified: trunk/libc/nis/nss_nisplus/nisplus-ethers.c
==============================================================================
--- trunk/libc/nis/nss_nisplus/nisplus-ethers.c (original)
+++ trunk/libc/nis/nss_nisplus/nisplus-ethers.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997,1998,2000-2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000-2003,2005,2006,2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxx>, 1997.
@@ -256,7 +257,8 @@
snprintf (buf, sizeof (buf), "[name=%s],%s", name, tablename_val);
- nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM,
+ NULL, NULL);
if (result == NULL)
{
@@ -322,7 +324,8 @@
addr->ether_addr_octet[4], addr->ether_addr_octet[5],
tablename_val);
- nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM,
+ NULL, NULL);
if (result == NULL)
{
Modified: trunk/libc/nis/nss_nisplus/nisplus-network.c
==============================================================================
--- trunk/libc/nis/nss_nisplus/nisplus-network.c (original)
+++ trunk/libc/nis/nss_nisplus/nisplus-network.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997,1998,2000-2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000-2003,2005,2006,2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxxxxxxxxxxxxxx>, 1997.
@@ -338,7 +339,7 @@
/* Search at first in the alias list, and use the correct name
for the next search */
snprintf (buf, sizeof (buf), "[name=%s],%s", name, tablename_val);
- result = nis_list (buf, FOLLOW_LINKS | FOLLOW_PATH, NULL, NULL);
+ result = nis_list (buf, FOLLOW_LINKS | FOLLOW_PATH | USE_DGRAM, NULL, NULL);
if (result != NULL)
{
@@ -366,7 +367,8 @@
}
nis_freeresult (result);
- result = nis_list (bufptr, FOLLOW_LINKS | FOLLOW_PATH, NULL, NULL);
+ result = nis_list (bufptr, FOLLOW_LINKS | FOLLOW_PATH | USE_DGRAM,
+ NULL, NULL);
}
if (result == NULL)
@@ -438,7 +440,8 @@
while (1)
{
snprintf (buf, sizeof (buf), "[addr=%s],%s", buf2, tablename_val);
- nis_result *result = nis_list (buf, EXPAND_NAME, NULL, NULL);
+ nis_result *result = nis_list (buf, EXPAND_NAME | USE_DGRAM,
+ NULL, NULL);
if (result == NULL)
{
Modified: trunk/libc/nis/nss_nisplus/nisplus-pwd.c
==============================================================================
--- trunk/libc/nis/nss_nisplus/nisplus-pwd.c (original)
+++ trunk/libc/nis/nss_nisplus/nisplus-pwd.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999, 2001, 2002, 2003, 2005, 2006
+/* Copyright (C) 1997, 1999, 2001, 2002, 2003, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxxxxxxxxxxxxxx>, 1997.
@@ -311,7 +311,7 @@
snprintf (buf, sizeof (buf), "[name=%s],%s", name, pwd_tablename_val);
- result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM, NULL, NULL);
if (result == NULL)
{
@@ -370,7 +370,7 @@
snprintf (buf, sizeof (buf), "[uid=%lu],%s",
(unsigned long int) uid, pwd_tablename_val);
- result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM, NULL, NULL);
if (result == NULL)
{
Modified: trunk/libc/nis/nss_nisplus/nisplus-rpc.c
==============================================================================
--- trunk/libc/nis/nss_nisplus/nisplus-rpc.c (original)
+++ trunk/libc/nis/nss_nisplus/nisplus-rpc.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2001, 2002, 2003, 2005, 2006
+/* Copyright (C) 1997, 1998, 2001, 2002, 2003, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxxxxxxxxxxxxxx>, 1997.
@@ -315,7 +315,8 @@
/* Search at first in the alias list, and use the correct name
for the next search */
snprintf (buf, sizeof (buf), "[name=%s],%s", name, tablename_val);
- nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM,
+ NULL, NULL);
if (result != NULL)
{
@@ -342,7 +343,8 @@
}
nis_freeresult (result);
- result = nis_list (bufptr, FOLLOW_PATH | FOLLOW_LINKS , NULL, NULL);
+ result = nis_list (bufptr, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM,
+ NULL, NULL);
}
if (result == NULL)
@@ -402,7 +404,8 @@
snprintf (buf, sizeof (buf), "[number=%d],%s", number, tablename_val);
- nis_result *result = nis_list (buf, FOLLOW_LINKS | FOLLOW_PATH, NULL, NULL);
+ nis_result *result = nis_list (buf, FOLLOW_LINKS | FOLLOW_PATH | USE_DGRAM,
+ NULL, NULL);
if (result == NULL)
{
Modified: trunk/libc/nis/nss_nisplus/nisplus-service.c
==============================================================================
--- trunk/libc/nis/nss_nisplus/nisplus-service.c (original)
+++ trunk/libc/nis/nss_nisplus/nisplus-service.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2005, 2006
+/* Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxx>, 1997.
@@ -322,7 +322,8 @@
for the next search */
snprintf (buf, sizeof (buf), "[name=%s,proto=%s],%s", name, protocol,
tablename_val);
- nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM,
+ NULL, NULL);
if (result != NULL)
{
@@ -351,7 +352,8 @@
}
nis_freeresult (result);
- result = nis_list (bufptr, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ result = nis_list (bufptr, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM,
+ NULL, NULL);
}
if (result == NULL)
@@ -420,7 +422,8 @@
snprintf (buf, sizeof (buf), "[port=%d,proto=%s],%s",
number, protocol, tablename_val);
- nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ nis_result *result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM,
+ NULL, NULL);
if (result == NULL)
{
Modified: trunk/libc/nis/nss_nisplus/nisplus-spwd.c
==============================================================================
--- trunk/libc/nis/nss_nisplus/nisplus-spwd.c (original)
+++ trunk/libc/nis/nss_nisplus/nisplus-spwd.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2002, 2003, 2005, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxxxxxxxxxxxxxx>, 1997.
@@ -182,7 +183,7 @@
snprintf (buf, sizeof (buf), "[name=%s],%s", name, pwd_tablename_val);
- result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+ result = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS | USE_DGRAM, NULL, NULL);
if (result == NULL)
{
Modified: trunk/libc/nis/rpcsvc/nislib.h
==============================================================================
--- trunk/libc/nis/rpcsvc/nislib.h (original)
+++ trunk/libc/nis/rpcsvc/nislib.h Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@xxxxxxx>, 1997.
@@ -272,12 +272,13 @@
typedef struct dir_binding dir_binding;
extern nis_error __nisbind_create (dir_binding *, const nis_server *,
- unsigned int, unsigned int) __THROW;
+ unsigned int, unsigned int, unsigned int,
+ unsigned int) __THROW;
extern nis_error __nisbind_connect (dir_binding *) __THROW;
extern nis_error __nisbind_next (dir_binding *) __THROW;
extern void __nisbind_destroy (dir_binding *) __THROW;
-extern nis_error __nisfind_server (const_nis_name, int, directory_obj **)
- __THROW;
+extern nis_error __nisfind_server (const_nis_name, int, directory_obj **,
+ dir_binding *, unsigned int) __THROW;
#endif
Modified: trunk/libc/nptl/ChangeLog
==============================================================================
--- trunk/libc/nptl/ChangeLog (original)
+++ trunk/libc/nptl/ChangeLog Fri Apr 13 08:35:45 2007
@@ -1,3 +1,13 @@
+2007-04-06 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * tst-locale1.c: Avoid warnings.
+ * tst-locale2.c: Likewise.
+
+2007-03-19 Steven Munroe <sjmunroe@xxxxxxxxxx>
+
+ * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+ (__lll_robust_trylock): Add MUTEX_HINT_ACQ to lwarx instruction.
+
2007-03-16 Jakub Jelinek <jakub@xxxxxxxxxx>
* sysdeps/pthread/bits/libc-lock.h: Use __extern_inline and
Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@xxxxxxxxxx>, 2003.
@@ -24,7 +24,6 @@
#include <sys/param.h>
#include <bits/pthreadtypes.h>
#include <atomic.h>
-
#ifndef __NR_futex
# define __NR_futex 221
@@ -133,7 +132,7 @@
/* Set *futex to ID if it is 0, atomically. Returns the old value */
#define __lll_robust_trylock(futex, id) \
({ int __val; \
- __asm __volatile ("1: lwarx %0,0,%2\n" \
+ __asm __volatile ("1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
" cmpwi 0,%0,0\n" \
" bne 2f\n" \
" stwcx. %3,0,%2\n" \
Modified: trunk/libc/nptl/tst-locale1.c
==============================================================================
--- trunk/libc/nptl/tst-locale1.c (original)
+++ trunk/libc/nptl/tst-locale1.c Fri Apr 13 08:35:45 2007
@@ -10,7 +10,8 @@
int
useless (void)
{
- pthread_create (0, 0, 0, 0);
+ pthread_t th;
+ pthread_create (&th, 0, (void *(*) (void *)) useless, 0);
/* This is to check __libc_current_sigrt* can be used in statically
linked apps. */
return SIGRTMIN;
Modified: trunk/libc/nptl/tst-locale2.c
==============================================================================
--- trunk/libc/nptl/tst-locale2.c (original)
+++ trunk/libc/nptl/tst-locale2.c Fri Apr 13 08:35:45 2007
@@ -6,8 +6,9 @@
#include <pthread.h>
/* This is never called, just here to get pthreads linked in. */
-void
-useless (void)
+void *
+useless (void *a)
{
- pthread_create (0, 0, 0, 0);
+ pthread_t th;
+ pthread_create (&th, 0, useless, a);
}
Modified: trunk/libc/nscd/gai.c
==============================================================================
--- trunk/libc/nscd/gai.c (original)
+++ trunk/libc/nscd/gai.c Fri Apr 13 08:35:45 2007
@@ -15,6 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#include <alloca.h>
/* This file uses the getaddrinfo code but it compiles it without NSCD
support. We just need a few symbol renames. */
#define __inet_aton inet_aton
@@ -25,6 +26,8 @@
#define __sendto sendto
#define __strchrnul strchrnul
#define __getline getline
+/* nscd uses 1MB or 2MB thread stacks. */
+#define __libc_use_alloca(size) (size <= __MAX_ALLOCA_CUTOFF)
#include <getaddrinfo.c>
Modified: trunk/libc/nscd/selinux.c
==============================================================================
--- trunk/libc/nscd/selinux.c (original)
+++ trunk/libc/nscd/selinux.c Fri Apr 13 08:35:45 2007
@@ -187,18 +187,22 @@
if (tmp_caps == NULL || new_caps == NULL)
{
if (tmp_caps != NULL)
- free_caps (tmp_caps);
+ cap_free (tmp_caps);
dbg_log (_("Failed to initialize drop of capabilities"));
error (EXIT_FAILURE, 0, _("cap_init failed"));
}
/* There is no reason why these should not work. */
- cap_set_flag (new_caps, CAP_PERMITTED, nnew_cap_list, new_cap_list, CAP_SET);
- cap_set_flag (new_caps, CAP_EFFECTIVE, nnew_cap_list, new_cap_list, CAP_SET);
-
- cap_set_flag (tmp_caps, CAP_PERMITTED, ntmp_cap_list, tmp_cap_list, CAP_SET);
- cap_set_flag (tmp_caps, CAP_EFFECTIVE, ntmp_cap_list, tmp_cap_list, CAP_SET);
+ cap_set_flag (new_caps, CAP_PERMITTED, nnew_cap_list,
+ (cap_value_t *) new_cap_list, CAP_SET);
+ cap_set_flag (new_caps, CAP_EFFECTIVE, nnew_cap_list,
+ (cap_value_t *) new_cap_list, CAP_SET);
+
+ cap_set_flag (tmp_caps, CAP_PERMITTED, ntmp_cap_list,
+ (cap_value_t *) tmp_cap_list, CAP_SET);
+ cap_set_flag (tmp_caps, CAP_EFFECTIVE, ntmp_cap_list,
+ (cap_value_t *) tmp_cap_list, CAP_SET);
int res = cap_set_proc (tmp_caps);
Modified: trunk/libc/nscd/selinux.h
==============================================================================
--- trunk/libc/nscd/selinux.h (original)
+++ trunk/libc/nscd/selinux.h Fri Apr 13 08:35:45 2007
@@ -1,5 +1,5 @@
/* Header for nscd SELinux access controls.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Matthew Rickard <mjricka@xxxxxxxxxxxxxx>, 2004.
@@ -23,7 +23,7 @@
#include "nscd.h"
#ifdef HAVE_LIBCAP
-# include <sys/capabilities.h>
+# include <sys/capability.h>
#endif
#ifdef HAVE_SELINUX
Modified: trunk/libc/posix/Makefile
==============================================================================
--- trunk/libc/posix/Makefile (original)
+++ trunk/libc/posix/Makefile Fri Apr 13 08:35:45 2007
@@ -66,7 +66,7 @@
spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \
spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam \
posix_madvise \
- get_child_max
+ get_child_max sched_cpucount
include ../Makeconfig
@@ -90,7 +90,7 @@
tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
tst-execvp3 tst-execvp4 tst-rfc3484 tst-rfc3484-2 \
- tst-getaddrinfo3
+ tst-getaddrinfo3 tst-fnmatch2 tst-cpucount
xtests := bug-ga2
ifeq (yes,$(build-shared))
test-srcs := globtest
Modified: trunk/libc/posix/Versions
==============================================================================
--- trunk/libc/posix/Versions (original)
+++ trunk/libc/posix/Versions Fri Apr 13 08:35:45 2007
@@ -122,6 +122,9 @@
GLIBC_2.3.4 {
regexec;
}
+ GLIBC_2.6 {
+ __sched_cpucount;
+ }
GLIBC_PRIVATE {
__libc_fork; __libc_pwrite;
}
Modified: trunk/libc/posix/fnmatch.c
==============================================================================
--- trunk/libc/posix/fnmatch.c (original)
+++ trunk/libc/posix/fnmatch.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -209,6 +209,7 @@
# define FCT internal_fnmatch
# define EXT ext_match
# define END end_pattern
+# define STRUCT fnmatch_struct
# define L(CS) CS
# ifdef _LIBC
# define BTOWC(C) __btowc (C)
@@ -235,7 +236,8 @@
# define INT wint_t
# define FCT internal_fnwmatch
# define EXT ext_wmatch
-# define END end_wpattern
+# define END end_wpattern
+# define STRUCT fnwmatch_struct
# define L(CS) L##CS
# define BTOWC(C) (C)
# define STRLEN(S) __wcslen (S)
@@ -397,12 +399,12 @@
}
return internal_fnwmatch (wpattern, wstring, wstring + n,
- flags & FNM_PERIOD, flags);
+ flags & FNM_PERIOD, flags, NULL);
}
# endif /* mbstate_t and mbsrtowcs or _LIBC. */
return internal_fnmatch (pattern, string, string + strlen (string),
- flags & FNM_PERIOD, flags);
+ flags & FNM_PERIOD, flags, NULL);
}
# ifdef _LIBC
Modified: trunk/libc/posix/fnmatch_loop.c
==============================================================================
--- trunk/libc/posix/fnmatch_loop.c (original)
+++ trunk/libc/posix/fnmatch_loop.c Fri Apr 13 08:35:45 2007
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2003,2004,2005
- Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2003,2004,2005,
+ 2007 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
@@ -17,10 +17,18 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+struct STRUCT
+{
+ const CHAR *pattern;
+ const CHAR *string;
+ int no_leading_period;
+};
+
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
static int FCT (const CHAR *pattern, const CHAR *string,
- const CHAR *string_end, int no_leading_period, int flags)
+ const CHAR *string_end, int no_leading_period, int flags,
+ struct STRUCT *ends)
internal_function;
static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
const CHAR *string_end, int no_leading_period, int flags)
@@ -29,12 +37,13 @@
static int
internal_function
-FCT (pattern, string, string_end, no_leading_period, flags)
+FCT (pattern, string, string_end, no_leading_period, flags, ends)
const CHAR *pattern;
const CHAR *string;
const CHAR *string_end;
int no_leading_period;
int flags;
+ struct STRUCT *ends;
{
register const CHAR *p = pattern, *n = string;
register UCHAR c;
@@ -96,6 +105,13 @@
flags);
if (res != -1)
return res;
+ }
+ else if (ends != NULL)
+ {
+ ends->pattern = p - 1;
+ ends->string = n;
+ ends->no_leading_period = no_leading_period;
+ return 0;
}
if (n != string_end && *n == L('.') && no_leading_period)
@@ -157,7 +173,9 @@
else
{
const CHAR *endp;
-
+ struct STRUCT end;
+
+ end.pattern = NULL;
endp = MEMCHR (n, (flags & FNM_FILE_NAME) ? L('/') : L('\0'),
string_end - n);
if (endp == NULL)
@@ -170,36 +188,46 @@
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
- int no_leading_period2 = no_leading_period;
-
- for (--p; n < endp; ++n, no_leading_period2 = 0)
- if (FCT (p, n, string_end, no_leading_period2, flags2)
- == 0)
- return 0;
+
+ for (--p; n < endp; ++n, no_leading_period = 0)
+ if (FCT (p, n, string_end, no_leading_period, flags2,
+ &end) == 0)
+ goto found;
}
else if (c == L('/') && (flags & FNM_FILE_NAME))
{
while (n < string_end && *n != L('/'))
++n;
if (n < string_end && *n == L('/')
- && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags)
- == 0))
+ && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags,
+ NULL) == 0))
return 0;
}
else
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
- int no_leading_period2 = no_leading_period;
if (c == L('\\') && !(flags & FNM_NOESCAPE))
c = *p;
c = FOLD (c);
- for (--p; n < endp; ++n, no_leading_period2 = 0)
+ for (--p; n < endp; ++n, no_leading_period = 0)
if (FOLD ((UCHAR) *n) == c
- && (FCT (p, n, string_end, no_leading_period2, flags2)
- == 0))
- return 0;
+ && (FCT (p, n, string_end, no_leading_period, flags2,
+ &end) == 0))
+ {
+ found:
+ if (end.pattern == NULL)
+ return 0;
+ break;
+ }
+ if (end.pattern != NULL)
+ {
+ p = end.pattern;
+ n = end.string;
+ no_leading_period = end.no_leading_period;
+ continue;
+ }
}
}
@@ -1098,7 +1126,7 @@
switch (opt)
{
case L('*'):
- if (FCT (p, string, string_end, no_leading_period, flags) == 0)
+ if (FCT (p, string, string_end, no_leading_period, flags, NULL) == 0)
return 0;
/* FALLTHROUGH */
@@ -1109,7 +1137,8 @@
/* First match the prefix with the current pattern with the
current pattern. */
if (FCT (list->str, string, rs, no_leading_period,
- flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL) == 0
/* This was successful. Now match the rest with the rest
of the pattern. */
&& (FCT (p, rs, string_end,
@@ -1117,7 +1146,7 @@
? no_leading_period
: rs[-1] == '/' && NO_LEADING_PERIOD (flags) ? 1 : 0,
flags & FNM_FILE_NAME
- ? flags : flags & ~FNM_PERIOD) == 0
+ ? flags : flags & ~FNM_PERIOD, NULL) == 0
/* This didn't work. Try the whole pattern. */
|| (rs != string
&& FCT (pattern - 1, rs, string_end,
@@ -1126,7 +1155,7 @@
: (rs[-1] == '/' && NO_LEADING_PERIOD (flags)
? 1 : 0),
flags & FNM_FILE_NAME
- ? flags : flags & ~FNM_PERIOD) == 0)))
+ ? flags : flags & ~FNM_PERIOD, NULL) == 0)))
/* It worked. Signal success. */
return 0;
}
@@ -1136,7 +1165,7 @@
return FNM_NOMATCH;
case L('?'):
- if (FCT (p, string, string_end, no_leading_period, flags) == 0)
+ if (FCT (p, string, string_end, no_leading_period, flags, NULL) == 0)
return 0;
/* FALLTHROUGH */
@@ -1148,7 +1177,8 @@
pattern list. */
if (FCT (STRCAT (list->str, p), string, string_end,
no_leading_period,
- flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0)
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL) == 0)
/* It worked. Signal success. */
return 0;
while ((list = list->next) != NULL);
@@ -1163,7 +1193,8 @@
for (runp = list; runp != NULL; runp = runp->next)
if (FCT (runp->str, string, rs, no_leading_period,
- flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0)
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL) == 0)
break;
/* If none of the patterns matched see whether the rest does. */
@@ -1172,8 +1203,8 @@
rs == string
? no_leading_period
: rs[-1] == '/' && NO_LEADING_PERIOD (flags) ? 1 : 0,
- flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD)
- == 0))
+ flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD,
+ NULL) == 0))
/* This is successful. */
return 0;
}
@@ -1198,6 +1229,7 @@
#undef FCT
#undef EXT
#undef END
+#undef STRUCT
#undef MEMPCPY
#undef MEMCHR
#undef STRCOLL
Modified: trunk/libc/posix/sched.h
==============================================================================
--- trunk/libc/posix/sched.h (original)
+++ trunk/libc/posix/sched.h Fri Apr 13 08:35:45 2007
@@ -1,5 +1,5 @@
/* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
- Copyright (C) 1996,1997,1999,2001-2003,2004 Free Software Foundation, Inc.
+ Copyright (C) 1996,1997,1999,2001-2004,2007 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
@@ -65,11 +65,12 @@
#ifdef __USE_GNU
/* Access macros for `cpu_set'. */
-#define CPU_SETSIZE __CPU_SETSIZE
-#define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp)
-#define CPU_CLR(cpu, cpusetp) __CPU_CLR (cpu, cpusetp)
-#define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp)
-#define CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp)
+# define CPU_SETSIZE __CPU_SETSIZE
+# define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp)
+# define CPU_CLR(cpu, cpusetp) __CPU_CLR (cpu, cpusetp)
+# define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp)
+# define CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp)
+# define CPU_COUNT(cpusetp) __CPU_COUNT (cpusetp)
/* Set the CPU affinity for a task */
Modified: trunk/libc/posix/sys/wait.h
==============================================================================
--- trunk/libc/posix/sys/wait.h (original)
+++ trunk/libc/posix/sys/wait.h Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005
+/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -171,10 +171,6 @@
#endif
#ifdef __USE_BSD
-/* This being here makes the prototypes valid whether or not
- we have already included <sys/resource.h> to define `struct rusage'. */
-struct rusage;
-
/* PID is like waitpid. Other args are like wait3. */
extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
struct rusage *__usage) __THROW;
Modified: trunk/libc/scripts/check-local-headers.sh
==============================================================================
--- trunk/libc/scripts/check-local-headers.sh (original)
+++ trunk/libc/scripts/check-local-headers.sh Fri Apr 13 08:35:45 2007
@@ -30,6 +30,7 @@
fgrep -v "$includedir/asm" |
fgrep -v "$includedir/linux" |
fgrep -v "$includedir/selinux" |
+fgrep -v "$includedir/sys/capability.h" |
fgrep -v "$includedir/gd"; then
# If we found a match something is wrong.
exit 1
Modified: trunk/libc/soft-fp/double.h
==============================================================================
--- trunk/libc/soft-fp/double.h (original)
+++ trunk/libc/soft-fp/double.h Fri Apr 13 08:35:45 2007
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Definitions for IEEE Double Precision
- Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@xxxxxxxxxx),
Jakub Jelinek (jj@xxxxxxxxxxxxxx),
@@ -168,13 +168,13 @@
DFtype flt;
struct {
#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned sign : 1;
- unsigned exp : _FP_EXPBITS_D;
- unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
-#else
- unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
- unsigned exp : _FP_EXPBITS_D;
- unsigned sign : 1;
+ unsigned sign : 1;
+ unsigned exp : _FP_EXPBITS_D;
+ _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+#else
+ _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
+ unsigned exp : _FP_EXPBITS_D;
+ unsigned sign : 1;
#endif
} bits __attribute__((packed));
};
Modified: trunk/libc/soft-fp/extended.h
==============================================================================
--- trunk/libc/soft-fp/extended.h (original)
+++ trunk/libc/soft-fp/extended.h Fri Apr 13 08:35:45 2007
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Definitions for IEEE Extended Precision.
- Copyright (C) 1999,2006 Free Software Foundation, Inc.
+ Copyright (C) 1999,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek (jj@xxxxxxxxxxxxxx).
@@ -277,14 +277,14 @@
XFtype flt;
struct {
#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
- unsigned sign : 1;
- unsigned exp : _FP_EXPBITS_E;
- unsigned long frac : _FP_W_TYPE_SIZE;
+ _FP_W_TYPE pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
+ unsigned sign : 1;
+ unsigned exp : _FP_EXPBITS_E;
+ _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
#else
- unsigned long frac : _FP_W_TYPE_SIZE;
- unsigned exp : _FP_EXPBITS_E;
- unsigned sign : 1;
+ _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
+ unsigned exp : _FP_EXPBITS_E;
+ unsigned sign : 1;
#endif
} bits;
};
Modified: trunk/libc/soft-fp/quad.h
==============================================================================
--- trunk/libc/soft-fp/quad.h (original)
+++ trunk/libc/soft-fp/quad.h Fri Apr 13 08:35:45 2007
@@ -1,6 +1,6 @@
/* Software floating-point emulation.
Definitions for IEEE Quad Precision.
- Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@xxxxxxxxxx),
Jakub Jelinek (jj@xxxxxxxxxxxxxx),
@@ -176,15 +176,15 @@
} longs;
struct {
#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned sign : 1;
- unsigned exp : _FP_EXPBITS_Q;
- _FP_W_TYPE frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
+ unsigned sign : 1;
+ unsigned exp : _FP_EXPBITS_Q;
+ _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
_FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
#else
_FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
- _FP_W_TYPE frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
- unsigned exp : _FP_EXPBITS_Q;
- unsigned sign : 1;
+ _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
+ unsigned exp : _FP_EXPBITS_Q;
+ unsigned sign : 1;
#endif
} bits;
};
Modified: trunk/libc/sysdeps/ia64/fpu/fesetround.c
==============================================================================
--- trunk/libc/sysdeps/ia64/fpu/fesetround.c (original)
+++ trunk/libc/sysdeps/ia64/fpu/fesetround.c Fri Apr 13 08:35:45 2007
@@ -1,5 +1,5 @@
/* Set current rounding direction.
- Copyright (C) 1999, 2000, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@xxxxxxx>, 1999.
@@ -26,7 +26,7 @@
fenv_t fpsr;
if (round & ~3)
- return 0;
+ return 1;
/* Get the current state. */
__asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));
@@ -37,6 +37,6 @@
/* Put the new state in effect. */
__asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr) : "memory");
- return 1;
+ return 0;
}
libm_hidden_def (fesetround)
Modified: trunk/libc/sysdeps/powerpc/bits/atomic.h
==============================================================================
--- trunk/libc/sysdeps/powerpc/bits/atomic.h (original)
+++ trunk/libc/sysdeps/powerpc/bits/atomic.h Fri Apr 13 08:35:45 2007
@@ -70,6 +70,13 @@
# endif
#endif
+#ifndef MUTEX_HINT_ACQ
+# define MUTEX_HINT_ACQ
+#endif
+#ifndef MUTEX_HINT_REL
+# define MUTEX_HINT_REL
+#endif
+
#define atomic_full_barrier() __asm ("sync" ::: "memory")
#define atomic_write_barrier() __asm ("eieio" ::: "memory")
@@ -78,7 +85,7 @@
__typeof (*(mem)) __tmp; \
__typeof (mem) __memp = (mem); \
__asm __volatile ( \
- "1: lwarx %0,0,%1\n" \
+ "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
" cmpw %0,%2\n" \
" bne 2f\n" \
" stwcx. %3,0,%1\n" \
@@ -95,7 +102,7 @@
__typeof (*(mem)) __tmp; \
__typeof (mem) __memp = (mem); \
__asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: lwarx %0,0,%1\n" \
+ "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
" cmpw %0,%2\n" \
" bne 2f\n" \
" stwcx. %3,0,%1\n" \
@@ -111,7 +118,7 @@
({ \
__typeof (*mem) __val; \
__asm __volatile ( \
- "1: lwarx %0,0,%2\n" \
+ "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
" stwcx. %3,0,%2\n" \
" bne- 1b\n" \
" " __ARCH_ACQ_INSTR \
@@ -125,7 +132,7 @@
({ \
__typeof (*mem) __val; \
__asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: lwarx %0,0,%2\n" \
+ "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
" stwcx. %3,0,%2\n" \
" bne- 1b" \
: "=&r" (__val), "=m" (*mem) \
Modified: trunk/libc/sysdeps/powerpc/powerpc32/bits/atomic.h
==============================================================================
--- trunk/libc/sysdeps/powerpc/powerpc32/bits/atomic.h (original)
+++ trunk/libc/sysdeps/powerpc/powerpc32/bits/atomic.h Fri Apr 13 08:35:45 2007
@@ -1,5 +1,5 @@
/* Atomic operations. PowerPC32 version.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@xxxxxxxxxx>, 2003.
@@ -18,17 +18,33 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+/* POWER6 adds a "Mutex Hint" to the Load and Reserve instruction.
+ This is a hint to the hardware to expect additional updates adjacent
+ to the lock word or not. If we are acquiring a Mutex, the hint
+ should be true. Otherwise we releasing a Mutex or doing a simple
+ atomic operation. In that case we don't expect addtional updates
+ adjacent to the lock word after the Store Conditional and the hint
+ should be false. */
+
+#if defined _ARCH_PWR6 || defined _ARCH_PWR6X
+# define MUTEX_HINT_ACQ ",1"
+# define MUTEX_HINT_REL ",0"
+#else
+# define MUTEX_HINT_ACQ
+# define MUTEX_HINT_REL
+#endif
+
/*
* The 32-bit exchange_bool is different on powerpc64 because the subf
* does signed 64-bit arthmatic while the lwarx is 32-bit unsigned
* (a load word and zero (high 32) form). So powerpc64 has a slightly
* different version in sysdeps/powerpc/powerpc64/bits/atomic.h.
*/
-# define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
+#define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
({ \
unsigned int __tmp; \
__asm __volatile ( \
- "1: lwarx %0,0,%1\n" \
+ "1: lwarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
" subf. %0,%2,%0\n" \
" bne 2f\n" \
" stwcx. %3,0,%1\n" \
@@ -40,11 +56,11 @@
__tmp != 0; \
})
-# define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \
+#define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \
({ \
unsigned int __tmp; \
__asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: lwarx %0,0,%1\n" \
+ "1: lwarx %0,0,%1" MUTEX_HINT_REL "\n" \
" subf. %0,%2,%0\n" \
" bne 2f\n" \
" stwcx. %3,0,%1\n" \
@@ -59,34 +75,34 @@
/* Powerpc32 processors don't implement the 64-bit (doubleword) forms of
load and reserve (ldarx) and store conditional (stdcx.) instructions.
So for powerpc32 we stub out the 64-bit forms. */
-# define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
+#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
(abort (), 0)
-# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
(abort (), (__typeof (*mem)) 0)
-# define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
+#define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
(abort (), 0)
-# define __arch_compare_and_exchange_val_64_rel(mem, newval, oldval) \
+#define __arch_compare_and_exchange_val_64_rel(mem, newval, oldval) \
(abort (), (__typeof (*mem)) 0)
-# define __arch_atomic_exchange_64_acq(mem, value) \
+#define __arch_atomic_exchange_64_acq(mem, value) \
({ abort (); (*mem) = (value); })
-# define __arch_atomic_exchange_64_rel(mem, value) \
+#define __arch_atomic_exchange_64_rel(mem, value) \
({ abort (); (*mem) = (value); })
-# define __arch_atomic_exchange_and_add_64(mem, value) \
+#define __arch_atomic_exchange_and_add_64(mem, value) \
({ abort (); (*mem) = (value); })
-# define __arch_atomic_increment_val_64(mem) \
+#define __arch_atomic_increment_val_64(mem) \
({ abort (); (*mem)++; })
-# define __arch_atomic_decrement_val_64(mem) \
+#define __arch_atomic_decrement_val_64(mem) \
({ abort (); (*mem)--; })
-# define __arch_atomic_decrement_if_positive_64(mem) \
+#define __arch_atomic_decrement_if_positive_64(mem) \
({ abort (); (*mem)--; })
#ifdef _ARCH_PWR4
Modified: trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.c
==============================================================================
--- trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.c (original)
+++ trunk/libc/sysdeps/powerpc/powerpc32/dl-machine.c Fri Apr 13 08:35:45 2007
@@ -26,10 +26,9 @@
#include <dl-machine.h>
#include <stdio-common/_itoa.h>
-/* The value __cache_line_size is defined in memset.S and is initialised
+/* The value __cache_line_size is defined in dl-sysdep.c and is initialised
by _dl_sysdep_start via DL_PLATFORM_INIT. */
-extern int __cache_line_size;
-weak_extern (__cache_line_size)
+extern int __cache_line_size attribute_hidden;
/* Because ld.so is now versioned, these functions can be in their own file;
no relocations need to be done to call them.
@@ -318,15 +317,9 @@
/* Default minimum 4 words per cache line. */
int line_size_words = 4;
- /* Don't try this until ld.so has relocated itself! */
- int *line_size_ptr = &__cache_line_size;
- if (lazy && line_size_ptr != NULL)
- {
- /* Verify that __cache_line_size is defined and set. */
- if (*line_size_ptr != 0)
- /* Convert bytes to words. */
- line_size_words = *line_size_ptr / 4;
- }
+ if (lazy && __cache_line_size != 0)
+ /* Convert bytes to words. */
+ line_size_words = __cache_line_size / 4;
size_modified = lazy ? rel_offset_words : 6;
for (i = 0; i < size_modified; i += line_size_words)
Modified: trunk/libc/sysdeps/powerpc/powerpc32/memset.S
==============================================================================
--- trunk/libc/sysdeps/powerpc/powerpc32/memset.S (original)
+++ trunk/libc/sysdeps/powerpc/powerpc32/memset.S Fri Apr 13 08:35:45 2007
@@ -1,5 +1,5 @@
/* Optimized memset implementation for PowerPC.
- Copyright (C) 1997, 1999, 2000, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2003, 2007 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
@@ -20,14 +20,6 @@
#include <sysdep.h>
#include <bp-sym.h>
#include <bp-asm.h>
-
-/* Define a global static that can hold the cache line size. The
- assumption is that startup code will access the "aux vector" to
- to obtain the value set by the kernel and store it into this
- variable. */
-
- .globl __cache_line_size
- .lcomm __cache_line_size,4,4
/* __ptr_t [r3] memset (__ptr_t s [r3], int c [r4], size_t n [r5]));
Returns 's'.
Modified: trunk/libc/sysdeps/powerpc/powerpc64/bits/atomic.h
==============================================================================
--- trunk/libc/sysdeps/powerpc/powerpc64/bits/atomic.h (original)
+++ trunk/libc/sysdeps/powerpc/powerpc64/bits/atomic.h Fri Apr 13 08:35:45 2007
@@ -1,5 +1,5 @@
/* Atomic operations. PowerPC64 version.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Paul Mackerras <paulus@xxxxxxxxxx>, 2003.
@@ -17,6 +17,22 @@
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+
+/* POWER6 adds a "Mutex Hint" to the Load and Reserve instruction.
+ This is a hint to the hardware to expect additional updates adjacent
+ to the lock word or not. If we are acquiring a Mutex, the hint
+ should be true. Otherwise we releasing a Mutex or doing a simple
+ atomic operation. In that case we don't expect addtional updates
+ adjacent to the lock word after the Store Conditional and the hint
+ should be false. */
+
+#if defined _ARCH_PWR6 || defined _ARCH_PWR6X
+# define MUTEX_HINT_ACQ ",1"
+# define MUTEX_HINT_REL ",0"
+#else
+# define MUTEX_HINT_ACQ
+# define MUTEX_HINT_REL
+#endif
/* The 32-bit exchange_bool is different on powerpc64 because the subf
does signed 64-bit arthmatic while the lwarx is 32-bit unsigned
@@ -24,11 +40,11 @@
In powerpc64 register values are 64-bit by default, including oldval.
The value in old val unknown sign extension, lwarx loads the 32-bit
value as unsigned. So we explicitly clear the high 32 bits in oldval. */
-# define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
+#define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \
({ \
unsigned int __tmp, __tmp2; \
__asm __volatile (" clrldi %1,%1,32\n" \
- "1: lwarx %0,0,%2\n" \
+ "1: lwarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
" subf. %0,%1,%0\n" \
" bne 2f\n" \
" stwcx. %4,0,%2\n" \
@@ -40,12 +56,12 @@
__tmp != 0; \
})
-# define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \
+#define __arch_compare_and_exchange_bool_32_rel(mem, newval, oldval) \
({ \
unsigned int __tmp, __tmp2; \
__asm __volatile (__ARCH_REL_INSTR "\n" \
" clrldi %1,%1,32\n" \
- "1: lwarx %0,0,%2\n" \
+ "1: lwarx %0,0,%2" MUTEX_HINT_REL "\n" \
" subf. %0,%1,%0\n" \
" bne 2f\n" \
" stwcx. %4,0,%2\n" \
@@ -62,11 +78,11 @@
* and Store doubleword conditional indexed (stdcx) instructions. So here
* we define the 64-bit forms.
*/
-# define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
+#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \
({ \
unsigned long __tmp; \
__asm __volatile ( \
- "1: ldarx %0,0,%1\n" \
+ "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
" subf. %0,%2,%0\n" \
" bne 2f\n" \
" stdcx. %3,0,%1\n" \
@@ -78,11 +94,11 @@
__tmp != 0; \
})
-# define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
+#define __arch_compare_and_exchange_bool_64_rel(mem, newval, oldval) \
({ \
unsigned long __tmp; \
__asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%1\n" \
+ "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
" subf. %0,%2,%0\n" \
" bne 2f\n" \
" stdcx. %3,0,%1\n" \
@@ -99,7 +115,7 @@
__typeof (*(mem)) __tmp; \
__typeof (mem) __memp = (mem); \
__asm __volatile ( \
- "1: ldarx %0,0,%1\n" \
+ "1: ldarx %0,0,%1" MUTEX_HINT_ACQ "\n" \
" cmpd %0,%2\n" \
" bne 2f\n" \
" stdcx. %3,0,%1\n" \
@@ -116,7 +132,7 @@
__typeof (*(mem)) __tmp; \
__typeof (mem) __memp = (mem); \
__asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%1\n" \
+ "1: ldarx %0,0,%1" MUTEX_HINT_REL "\n" \
" cmpd %0,%2\n" \
" bne 2f\n" \
" stdcx. %3,0,%1\n" \
@@ -128,11 +144,11 @@
__tmp; \
})
-# define __arch_atomic_exchange_64_acq(mem, value) \
+#define __arch_atomic_exchange_64_acq(mem, value) \
({ \
__typeof (*mem) __val; \
__asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%2\n" \
+ "1: ldarx %0,0,%2" MUTEX_HINT_ACQ "\n" \
" stdcx. %3,0,%2\n" \
" bne- 1b\n" \
" " __ARCH_ACQ_INSTR \
@@ -142,11 +158,11 @@
__val; \
})
-# define __arch_atomic_exchange_64_rel(mem, value) \
+#define __arch_atomic_exchange_64_rel(mem, value) \
({ \
__typeof (*mem) __val; \
__asm __volatile (__ARCH_REL_INSTR "\n" \
- "1: ldarx %0,0,%2\n" \
+ "1: ldarx %0,0,%2" MUTEX_HINT_REL "\n" \
" stdcx. %3,0,%2\n" \
" bne- 1b" \
: "=&r" (__val), "=m" (*mem) \
@@ -155,7 +171,7 @@
__val; \
})
-# define __arch_atomic_exchange_and_add_64(mem, value) \
+#define __arch_atomic_exchange_and_add_64(mem, value) \
({ \
__typeof (*mem) __val, __tmp; \
__asm __volatile ("1: ldarx %0,0,%3\n" \
@@ -168,7 +184,7 @@
__val; \
})
-# define __arch_atomic_increment_val_64(mem) \
+#define __arch_atomic_increment_val_64(mem) \
({ \
__typeof (*(mem)) __val; \
__asm __volatile ("1: ldarx %0,0,%2\n" \
@@ -181,7 +197,7 @@
__val; \
})
-# define __arch_atomic_decrement_val_64(mem) \
+#define __arch_atomic_decrement_val_64(mem) \
({ \
__typeof (*(mem)) __val; \
__asm __volatile ("1: ldarx %0,0,%2\n" \
@@ -194,7 +210,7 @@
__val; \
})
-# define __arch_atomic_decrement_if_positive_64(mem) \
+#define __arch_atomic_decrement_if_positive_64(mem) \
({ int __val, __tmp; \
__asm __volatile ("1: ldarx %0,0,%3\n" \
" cmpdi 0,%0,0\n" \
@@ -212,13 +228,13 @@
/*
* All powerpc64 processors support the new "light weight" sync (lwsync).
*/
-# define atomic_read_barrier() __asm ("lwsync" ::: "memory")
+#define atomic_read_barrier() __asm ("lwsync" ::: "memory")
/*
* "light weight" sync can also be used for the release barrier.
*/
-# ifndef UP
-# define __ARCH_REL_INSTR "lwsync"
-# endif
+#ifndef UP
+# define __ARCH_REL_INSTR "lwsync"
+#endif
/*
* Include the rest of the atomic ops macros which are common to both
Modified: trunk/libc/sysdeps/powerpc/powerpc64/memset.S
==============================================================================
--- trunk/libc/sysdeps/powerpc/powerpc64/memset.S (original)
+++ trunk/libc/sysdeps/powerpc/powerpc64/memset.S Fri Apr 13 08:35:45 2007
@@ -1,5 +1,6 @@
/* Optimized memset implementation for PowerPC64.
- Copyright (C) 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2002, 2003, 2007
+ 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
@@ -21,12 +22,6 @@
#include <bp-sym.h>
#include <bp-asm.h>
-/* Define a global static that can hold the cache line size. The
- assumption is that startup code will access the "aux vector" to
- to obtain the value set by the kernel and store it into this
- variable. */
- .globl __cache_line_size
- .lcomm __cache_line_size,4,4
.section ".toc","aw"
.LC0:
.tc __cache_line_size[TC],__cache_line_size
Modified: trunk/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/Makefile (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/Makefile Fri Apr 13 08:35:45 2007
@@ -134,7 +134,8 @@
endif
ifeq ($(subdir),io)
-sysdep_routines += xstatconv internal_statvfs internal_statvfs64
+sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
+ sync_file_range
endif
ifeq ($(subdir),elf)
Modified: trunk/libc/sysdeps/unix/sysv/linux/Versions
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/Versions (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/Versions Fri Apr 13 08:35:45 2007
@@ -124,10 +124,10 @@
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
}
GLIBC_2.5 {
- splice; sync_file_range; tee; vmsplice;
+ splice; tee; vmsplice;
}
GLIBC_2.6 {
- epoll_pwait;
+ epoll_pwait; sync_file_range;
}
GLIBC_PRIVATE {
# functions used in other libraries
Modified: trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h Fri Apr 13 08:35:45 2007
@@ -1,6 +1,7 @@
/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
- Copyright (C) 1996-1999,2001-2003,2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 1996-1999,2001-2003,2005,2006,2007
+ 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
@@ -127,4 +128,7 @@
((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
# define __CPU_ISSET(cpu, cpusetp) \
(((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
+extern int __sched_cpucount (size_t __setsize, cpu_set_t *__setp) __THROW;
+# define __CPU_COUNT(cpusetp) \
+ __sched_cpucount (sizeof (cpu_set_t), cpusetp)
#endif
Modified: trunk/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c Fri Apr 13 08:35:45 2007
@@ -1,5 +1,6 @@
/* Operating system support for run-time dynamic linker. Linux/PPC version.
- Copyright (C) 1997, 1998, 2001, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2001, 2003, 2006, 2007
+ 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
@@ -21,8 +22,7 @@
#include <kernel-features.h>
#include <ldsodefs.h>
-extern int __cache_line_size;
-weak_extern (__cache_line_size)
+int __cache_line_size attribute_hidden;
/* Scan the Aux Vector for the "Data Cache Block Size" entry. If found
verify that the static extern __cache_line_size is defined by checking
@@ -30,12 +30,8 @@
value to __cache_line_size. */
#define DL_PLATFORM_AUXV \
case AT_DCACHEBSIZE: \
- { \
- int *cls = & __cache_line_size; \
- if (cls != NULL) \
- *cls = av->a_un.a_val; \
- } \
- break;
+ __cache_line_size = av->a_un.a_val; \
+ break;
#ifndef __ASSUME_STD_AUXV
Modified: trunk/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/powerpc/libc-start.c Fri Apr 13 08:35:45 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1998,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ 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
@@ -22,8 +23,7 @@
#include <bp-start.h>
#include <bp-sym.h>
-extern int __cache_line_size;
-weak_extern (__cache_line_size)
+int __cache_line_size attribute_hidden;
/* The main work is done in the generic function. */
#define LIBC_START_MAIN generic_start_main
#define LIBC_START_DISABLE_INLINE
@@ -113,11 +113,7 @@
switch (av->a_type)
{
case AT_DCACHEBSIZE:
- {
- int *cls = &__cache_line_size;
- if (cls != NULL)
- *cls = av->a_un.a_val;
- }
+ __cache_line_size = av->a_un.a_val;
break;
}
#ifdef SHARED
Modified: trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sync_file_range.c Fri Apr 13 08:35:45 2007
@@ -1,5 +1,5 @@
/* Selective file content synch'ing.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007 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
@@ -27,7 +27,7 @@
#ifdef __NR_sync_file_range
int
-sync_file_range (int fd, __off64_t from, __off64_t to, int flags)
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
return INLINE_SYSCALL (sync_file_range, 6, fd,
__LONG_LONG_PAIR ((long) (from >> 32), (long) from),
@@ -36,7 +36,7 @@
}
#else
int
-sync_file_range (int fd, __off64_t from, __off64_t to, int flags)
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
__set_errno (ENOSYS);
return -1;
Modified: trunk/libc/timezone/africa
==============================================================================
--- trunk/libc/timezone/africa (original)
+++ trunk/libc/timezone/africa Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-# @(#)africa 8.5
+# @(#)africa 8.7
# <pre>
# This data is by no means authoritative; if you think you know better,
@@ -232,8 +232,8 @@
# Eritrea
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Africa/Asmera 2:35:32 - LMT 1870
- 2:35:32 - AMT 1890 # Asmera Mean Time
+Zone Africa/Asmara 2:35:32 - LMT 1870
+ 2:35:32 - AMT 1890 # Asmara Mean Time
2:35:20 - ADMT 1936 May 5 # Adis Dera MT
3:00 - EAT
Modified: trunk/libc/timezone/asia
==============================================================================
--- trunk/libc/timezone/asia (original)
+++ trunk/libc/timezone/asia Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-# @(#)asia 8.8
+# @(#)asia 8.10
# <pre>
# This data is by no means authoritative; if you think you know better,
@@ -217,7 +217,7 @@
# BTW, I did some research on-line and found some info regarding these five
# historic timezones from some Taiwan websites. And yes, there are official
# Chinese names for these locales (before 1949).
-#
+#
# From Jesper Norgaard Welen (2006-07-14):
# I have investigated the timezones around 1970 on the
# http://www.astro.com/atlas site [with provinces and county
@@ -413,6 +413,8 @@
# East Timor
+# See Indonesia for the 1945 transition.
+
# From Joao Carrascalao, brother of the former governor of East Timor, in
# <a href="http://etan.org/et99c/december/26-31/30ETMAY.htm">
# East Timor may be late for its millennium
@@ -437,7 +439,7 @@
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Dili 8:22:20 - LMT 1912
8:00 - TLT 1942 Feb 21 23:00 # E Timor Time
- 9:00 - JST 1945 Aug
+ 9:00 - JST 1945 Sep 23
9:00 - TLT 1976 May 3
8:00 - CIT 2000 Sep 17 00:00
9:00 - TLT
@@ -463,6 +465,19 @@
# time zone maps, I think that must refer to Western Borneo (Kalimantan Barat
# and Kalimantan Tengah) switching from UTC+8 to UTC+7.
#
+# From Paul Eggert (2007-03-10):
+# Here is another correction to Shanks & Pottenger.
+# JohnTWB writes that Japanese forces did not surrender control in
+# Indonesia until 1945-09-01 00:00 at the earliest (in Jakarta) and
+# other formal surrender ceremonies were September 9, 11, and 13, plus
+# September 12 for the regional surrender to Mountbatten in Singapore.
+# These would be the earliest possible times for a change.
+# Regimes horaires pour le monde entier, by Henri Le Corre, (Editions
+# Traditionnelles, 1987, Paris) says that Java and Madura switched
+# from JST to UTC+07:30 on 1945-09-23, and gives 1944-09-01 for Jayapura
+# (Hollandia). For now, assume all Indonesian locations other than Jayapura
+# switched on 1945-09-23.
+#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10
# Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
@@ -470,7 +485,7 @@
7:07:12 - JMT 1923 Dec 31 23:47:12 # Jakarta
7:20 - JAVT 1932 Nov # Java Time
7:30 - WIT 1942 Mar 23
- 9:00 - JST 1945 Aug
+ 9:00 - JST 1945 Sep 23
7:30 - WIT 1948 May
8:00 - WIT 1950 May
7:30 - WIT 1964
@@ -478,7 +493,7 @@
Zone Asia/Pontianak 7:17:20 - LMT 1908 May
7:17:20 - PMT 1932 Nov # Pontianak MT
7:30 - WIT 1942 Jan 29
- 9:00 - JST 1945 Aug
+ 9:00 - JST 1945 Sep 23
7:30 - WIT 1948 May
8:00 - WIT 1950 May
7:30 - WIT 1964
@@ -487,10 +502,10 @@
Zone Asia/Makassar 7:57:36 - LMT 1920
7:57:36 - MMT 1932 Nov # Macassar MT
8:00 - CIT 1942 Feb 9
- 9:00 - JST 1945 Aug
+ 9:00 - JST 1945 Sep 23
8:00 - CIT
Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
- 9:00 - EIT 1944
+ 9:00 - EIT 1944 Sep 1
9:30 - CST 1964
9:00 - EIT
@@ -614,7 +629,7 @@
Rule Iraq 1986 1990 - Mar lastSun 1:00s 1:00 D
# IATA SSIM (1991/1996) says Apr 1 12:01am UTC; guess the `:01' is a typo.
# Shanks & Pottenger say Iraq did not observe DST 1992/1997; ignore this.
-#
+#
Rule Iraq 1991 max - Apr 1 3:00s 1:00 D
Rule Iraq 1991 max - Oct 1 3:00s 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -1293,6 +1308,11 @@
# parliament passed during the tumultuous winter session."
# For now, let's ignore this information, until we have more confirmation.
+# From Ganbold Ts. (2007-02-26):
+# Parliament of Mongolia has just changed the daylight-saving rule in February.
+# They decided not to adopt daylight-saving time....
+# http://www.mongolnews.mn/index.php?module=unuudur&sec=view&id=15742
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Mongol 1983 1984 - Apr 1 0:00 1:00 S
Rule Mongol 1983 only - Oct 1 0:00 0 -
@@ -1311,8 +1331,8 @@
Rule Mongol 1984 1998 - Sep lastSun 0:00 0 -
# IATA SSIM (1999-09) says Mongolia no longer observes DST.
Rule Mongol 2001 only - Apr lastSat 2:00 1:00 S
-Rule Mongol 2001 max - Sep lastSat 2:00 0 -
-Rule Mongol 2002 max - Mar lastSat 2:00 1:00 S
+Rule Mongol 2001 2006 - Sep lastSat 2:00 0 -
+Rule Mongol 2002 2006 - Mar lastSat 2:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
# Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
Modified: trunk/libc/timezone/australasia
==============================================================================
--- trunk/libc/timezone/australasia (original)
+++ trunk/libc/timezone/australasia Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-# @(#)australasia 8.3
+# @(#)australasia 8.6
# <pre>
# This file also includes Pacific islands.
@@ -29,15 +29,24 @@
9:00 - CST 1899 May
9:30 Aus CST
# Western Australia
+#
+# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+Rule AW 1974 only - Oct lastSun 2:00s 1:00 -
+Rule AW 1975 only - Mar Sun>=1 2:00s 0 -
+Rule AW 1983 only - Oct lastSun 2:00s 1:00 -
+Rule AW 1984 only - Mar Sun>=1 2:00s 0 -
+Rule AW 1991 only - Nov 17 2:00s 1:00 -
+Rule AW 1992 only - Mar Sun>=1 2:00s 0 -
+Rule AW 2006 only - Dec 3 2:00s 1:00 -
+Rule AW 2007 2009 - Mar lastSun 2:00s 0 -
+Rule AW 2007 2008 - Oct lastSun 2:00s 1:00 -
Zone Australia/Perth 7:43:24 - LMT 1895 Dec
8:00 Aus WST 1943 Jul
- 8:00 - WST 1974 Oct lastSun 2:00s
- 8:00 1:00 WST 1975 Mar Sun>=1 2:00s
- 8:00 - WST 1983 Oct lastSun 2:00s
- 8:00 1:00 WST 1984 Mar Sun>=1 2:00s
- 8:00 - WST 1991 Nov 17 2:00s
- 8:00 1:00 WST 1992 Mar Sun>=1 2:00s
- 8:00 - WST
+ 8:00 AW WST
+Zone Australia/Eucla 8:35:28 - LMT 1895 Dec
+ 8:45 Aus CWST 1943 Jul
+ 8:45 AW CWST
+
# Queensland
#
# From Alex Livingston (1996-11-01):
@@ -193,16 +202,16 @@
#
# Ashmore Is, Cartier
# no indigenous inhabitants; only seasonal caretakers
-# like Australia/Perth, says Turner
+# no times are set
#
# Coral Sea Is
# no indigenous inhabitants; only meteorologists
-# no information
+# no times are set
#
# Macquarie
# permanent occupation (scientific station) since 1948;
# sealing and penguin oil station operated 1888/1917
-# like Australia/Hobart, says Turner
+# like Australia/Hobart
# Christmas
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -534,6 +543,7 @@
# std dst
# LMT Local Mean Time
# 8:00 WST WST Western Australia
+# 8:45 CWST CWST Central Western Australia*
# 9:00 JST Japan
# 9:30 CST CST Central Australia
# 10:00 EST EST Eastern Australia
@@ -806,37 +816,51 @@
# From Arthur David Olson (1992-03-08):
# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes.
+# From Christopher Hunt (2006-11-21), after an advance warning
+# from Jesper Norgaard Welen (2006-11-01):
+# WA are trialing DST for three years.
+# <http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf>
+
# From Rives McDow (2002-04-09):
# The most interesting region I have found consists of three towns on the
-# southern coast of Australia, population 10 at last report, along with
-# 50,000 sheep, about 100 kilometers long and 40 kilometers into the
-# continent. The primary town is Madura, with the other towns being
-# Mundrabilla and Eucla. According to the sheriff of Madura, the
-# residents got tired of having to change the time so often, as they are
-# located in a strip overlapping the border of South Australia and Western
-# Australia. South Australia observes daylight saving time; Western
+# southern coast.... South Australia observes daylight saving time; Western
# Australia does not. The two states are one and a half hours apart. The
# residents decided to forget about this nonsense of changing the clock so
# much and set the local time 20 hours and 45 minutes from the
# international date line, or right in the middle of the time of South
-# Australia and Western Australia. As it only affects about 10 people and
-# tourists staying at the Madura Motel, it has never really made as big an
-# impact as Broken Hill. However, as tourist visiting there or anyone
-# calling the local sheriff will attest, they do keep time in this way.
+# Australia and Western Australia....
#
# From Paul Eggert (2002-04-09):
# This is confirmed by the section entitled
# "What's the deal with time zones???" in
-# <http://www.earthsci.unimelb.edu.au/~awatkins/null.html>,
-# which says a few other things:
-#
-# * Border Village, SA also is 45 minutes ahead of Perth.
-# * The locals call this time zone "central W.A. Time" (presumably "CWAT").
-# * The locals also call Western Australia time "Perth time".
-#
-# It's not clear from context whether everyone in Western Australia
-# knows of this naming convention, or whether it's just the people in
-# this subregion.
+# <http://www.earthsci.unimelb.edu.au/~awatkins/null.html>.
+#
+# From Alex Livingston (2006-12-07):
+# ... it was just on four years ago that I drove along the Eyre Highway,
+# which passes through eastern Western Australia close to the southern
+# coast of the continent.
+#
+# I paid particular attention to the time kept there. There can be no
+# dispute that UTC+08:45 was considered "the time" from the border
+# village just inside the border with South Australia to as far west
+# as just east of Caiguna. There can also be no dispute that Eucla is
+# the largest population centre in this zone....
+#
+# Now that Western Australia is observing daylight saving, the
+# question arose whether this part of the state would follow suit. I
+# just called the border village and confirmed that indeed they have,
+# meaning that they are now observing UTC+09:45.
+#
+# (2006-12-09):
+# I personally doubt that either experimentation with daylight saving
+# in WA or its introduction in SA had anything to do with the genesis
+# of this time zone. My hunch is that it's been around since well
+# before 1975. I remember seeing it noted on road maps decades ago.
+
+# From Paul Eggert (2006-12-15):
+# For lack of better info, assume the tradition dates back to the
+# introduction of standard time in 1895.
+
# South Australia, Tasmania, Victoria
Modified: trunk/libc/timezone/backward
==============================================================================
--- trunk/libc/timezone/backward (original)
+++ trunk/libc/timezone/backward Fri Apr 13 08:35:45 2007
@@ -1,8 +1,9 @@
-# @(#)backward 8.2
+# @(#)backward 8.3
# This file provides links between current names for time zones
# and their old names. Many names changed in late 1993.
+Link Africa/Asmara Africa/Asmera
Link Africa/Bamako Africa/Timbuktu
Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
Link America/Adak America/Atka
@@ -28,6 +29,7 @@
Link Asia/Thimphu Asia/Thimbu
Link Asia/Makassar Asia/Ujung_Pandang
Link Asia/Ulaanbaatar Asia/Ulan_Bator
+Link Atlantic/Faroe Atlantic/Faeroe
Link Australia/Sydney Australia/ACT
Link Australia/Sydney Australia/Canberra
Link Australia/Lord_Howe Australia/LHI
Modified: trunk/libc/timezone/europe
==============================================================================
--- trunk/libc/timezone/europe (original)
+++ trunk/libc/timezone/europe Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-# @(#)europe 8.6
+# @(#)europe 8.10
# <pre>
# This data is by no means authoritative; if you think you know better,
@@ -259,32 +259,32 @@
# -- James Joyce, Ulysses
# From Joseph S. Myers (2005-01-26):
-# Irish laws are available online at www.irishstatutebook.ie. These include
+# Irish laws are available online at www.irishstatutebook.ie. These include
# various relating to legal time, for example:
-#
+#
# ZZA13Y1923.html ZZA12Y1924.html ZZA8Y1925.html ZZSIV20PG1267.html
-#
+#
# ZZSI71Y1947.html ZZSI128Y1948.html ZZSI23Y1949.html ZZSI41Y1950.html
# ZZSI27Y1951.html ZZSI73Y1952.html
-#
+#
# ZZSI11Y1961.html ZZSI232Y1961.html ZZSI182Y1962.html
# ZZSI167Y1963.html ZZSI257Y1964.html ZZSI198Y1967.html
# ZZA23Y1968.html ZZA17Y1971.html
-#
+#
# ZZSI67Y1981.html ZZSI212Y1982.html ZZSI45Y1986.html
# ZZSI264Y1988.html ZZSI52Y1990.html ZZSI371Y1992.html
# ZZSI395Y1994.html ZZSI484Y1997.html ZZSI506Y2001.html
#
# [These are all relative to the root, e.g., the first is
# <http://www.irishstatutebook.ie/ZZA13Y1923.html>.]
-#
-# (These are those I found, but there could be more. In any case these
-# should allow various updates to the comments in the europe file to cover
+#
+# (These are those I found, but there could be more. In any case these
+# should allow various updates to the comments in the europe file to cover
# the laws applicable in Ireland.)
-#
-# (Note that the time in the Republic of Ireland since 1968 has been defined
-# in terms of standard time being GMT+1 with a period of winter time when it
-# is GMT, rather than standard time being GMT with a period of summer time
+#
+# (Note that the time in the Republic of Ireland since 1968 has been defined
+# in terms of standard time being GMT+1 with a period of winter time when it
+# is GMT, rather than standard time being GMT with a period of summer time
# being GMT+1.)
# From Paul Eggert (1999-03-28):
@@ -754,7 +754,7 @@
1:00 Czech CE%sT 1979
1:00 EU CE%sT
-# Denmark, Faeroe Islands, and Greenland
+# Denmark, Faroe Islands, and Greenland
# From Jesper Norgaard Welen (2005-04-26):
# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law
@@ -809,7 +809,7 @@
1:00 C-Eur CE%sT 1945 Apr 2 2:00
1:00 Denmark CE%sT 1980
1:00 EU CE%sT
-Zone Atlantic/Faeroe -0:27:04 - LMT 1908 Jan 11 # Torshavn
+Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Torshavn
0:00 - WET 1981
0:00 EU WE%sT
#
@@ -2278,6 +2278,34 @@
1:00 EU CE%sT
# Turkey
+
+# From Amar Devegowda (2007-01-03):
+# The time zone rules for Istanbul, Turkey have not been changed for years now.
+# ... The latest rules are available at -
+# http://www.timeanddate.com/worldclock/timezone.html?n=107
+# From Steffen Thorsen (2007-01-03):
+# I have been able to find press records back to 1996 which all say that
+# DST started 01:00 local time and end at 02:00 local time. I am not sure
+# what happened before that. One example for each year from 1996 to 2001:
+# http://newspot.byegm.gov.tr/arsiv/1996/21/N4.htm
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING97/03/97X03X25.TXT
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING98/03/98X03X02.HTM
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING99/10/99X10X26.HTM#%2016
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2000/03/00X03X06.HTM#%2021
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2001/03/23x03x01.HTM#%2027
+# From Paul Eggert (2007-01-03):
+# Prefer the above source to Shanks & Pottenger for time stamps after 1990.
+
+# From Steffen Thorsen (2007-03-09):
+# Starting 2007 though, it seems that they are adopting EU's 1:00 UTC
+# start/end time, according to the following page (2007-03-07):
+# http://www.ntvmsnbc.com/news/402029.asp
+# The official document is located here - it is in Turkish...:
+# http://rega.basbakanlik.gov.tr/eskiler/2007/03/20070307-7.htm
+# I was able to locate the following seemingly official document
+# (on a non-government server though) describing dates between 2002 and 2006:
+# http://www.alomaliye.com/bkk_2002_3769.htm
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Turkey 1916 only - May 1 0:00 1:00 S
Rule Turkey 1916 only - Oct 1 0:00 0 -
@@ -2332,13 +2360,17 @@
Rule Turkey 1983 only - Oct 2 0:00 0 -
Rule Turkey 1985 only - Apr 20 0:00 1:00 S
Rule Turkey 1985 only - Sep 28 0:00 0 -
+Rule Turkey 1986 1990 - Mar lastSun 2:00s 1:00 S
+Rule Turkey 1986 1990 - Sep lastSun 2:00s 0 -
+Rule Turkey 1991 2006 - Mar lastSun 1:00s 1:00 S
+Rule Turkey 1991 1995 - Sep lastSun 1:00s 0 -
+Rule Turkey 1996 2006 - Oct lastSun 1:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Istanbul 1:55:52 - LMT 1880
1:56:56 - IMT 1910 Oct # Istanbul Mean Time?
2:00 Turkey EE%sT 1978 Oct 15
3:00 Turkey TR%sT 1985 Apr 20 # Turkey Time
- 2:00 Turkey EE%sT 1986
- 2:00 C-Eur EE%sT 1991
+ 2:00 Turkey EE%sT 2007
2:00 EU EE%sT
Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
Modified: trunk/libc/timezone/iso3166.tab
==============================================================================
--- trunk/libc/timezone/iso3166.tab (original)
+++ trunk/libc/timezone/iso3166.tab Fri Apr 13 08:35:45 2007
@@ -1,6 +1,6 @@
# ISO 3166 alpha-2 country codes
#
-# @(#)iso3166.tab 8.3
+# @(#)iso3166.tab 8.4
#
# From Paul Eggert (2006-09-27):
#
@@ -92,7 +92,7 @@
FJ Fiji
FK Falkland Islands
FM Micronesia
-FO Faeroe Islands
+FO Faroe Islands
FR France
GA Gabon
GB Britain (UK)
Modified: trunk/libc/timezone/leapseconds
==============================================================================
--- trunk/libc/timezone/leapseconds (original)
+++ trunk/libc/timezone/leapseconds Fri Apr 13 08:35:45 2007
@@ -1,4 +1,4 @@
-# @(#)leapseconds 8.1
+# @(#)leapseconds 8.3
# Allowance for leapseconds added to each timezone file.
@@ -45,48 +45,38 @@
Leap 1998 Dec 31 23:59:60 + S
Leap 2005 Dec 31 23:59:60 + S
-# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
+# ...
+# Sent: Thursday, February 01, 2007 9:49 AM
+# ...
+# Subject: Bulletin C number 33
+#
+# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
#
[... 585 lines stripped ...]