[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r1177 - in /fsf/trunk/libc: ./ nptl/ nscd/ scripts/ sysdeps/i386/i486/bits/ sysdeps/x86_64/bits/
- To: commits@xxxxxxxxxx
- Subject: [commits] r1177 - in /fsf/trunk/libc: ./ nptl/ nscd/ scripts/ sysdeps/i386/i486/bits/ sysdeps/x86_64/bits/
- From: eglibc@xxxxxxxxxx
- Date: Sat, 13 Jan 2007 08:01:30 -0000
Author: eglibc
Date: Sat Jan 13 00:01:30 2007
New Revision: 1177
Log:
Import glibc-mainline for 2007-01-13
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/nptl/ChangeLog
fsf/trunk/libc/nptl/tst-rwlock7.c
fsf/trunk/libc/nscd/connections.c
fsf/trunk/libc/nscd/nscd_gethst_r.c
fsf/trunk/libc/scripts/check-local-headers.sh
fsf/trunk/libc/sysdeps/i386/i486/bits/atomic.h
fsf/trunk/libc/sysdeps/x86_64/bits/atomic.h
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Jan 13 00:01:30 2007
@@ -1,3 +1,20 @@
+2007-01-12 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * nscd/nscd_gethst_r.c: Minor cleanups.
+
+ * nscd/connections.c (handle_request): Check selinux permissions
+ for all non-admin commands.
+
+ * sysdeps/i386/i486/bits/atomic.h: Define
+ atomic_compare_and_exchange_val_acq,
+ atomic_compare_and_exchange_bool_acq, and atomic_exchange_and_add
+ using __sync_* built-ins for gcc >= 4.1.
+ * sysdeps/x86_64/bits/atomic.h: Likewise.
+
+ [BZ #3840]
+ * scripts/check-local-headers.sh: Restrict to testing .o.d, .os.d,
+ and .oS.d files.
+
2007-01-05 Steven Munroe <sjmunroe@xxxxxxxxxx>
* stdlib/tst-makecontext.c: Include errno.h. Change main()
Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Sat Jan 13 00:01:30 2007
@@ -1,3 +1,8 @@
+2007-01-12 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * tst-rwlock7.c: Show some more information in case of correct
+ behavior.
+
2007-01-11 Ulrich Drepper <drepper@xxxxxxxxxx>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
Modified: fsf/trunk/libc/nptl/tst-rwlock7.c
==============================================================================
--- fsf/trunk/libc/nptl/tst-rwlock7.c (original)
+++ fsf/trunk/libc/nptl/tst-rwlock7.c Sat Jan 13 00:01:30 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -64,6 +64,7 @@
strerror (err), err, strerror (ETIMEDOUT), ETIMEDOUT);
pthread_exit ((void *) 1l);
}
+ puts ("child: timedwrlock failed with ETIMEDOUT");
struct timeval tv2;
(void) gettimeofday (&tv2, NULL);
@@ -93,6 +94,7 @@
puts ("2nd timedwrlock did not return EINVAL");
pthread_exit ((void *) 1l);
}
+ puts ("child: timedwrlock failed with EINVAL");
return NULL;
}
@@ -145,6 +147,7 @@
printf ("round %Zu: rwlock_timedrdlock failed\n", cnt);
exit (1);
}
+ printf ("%zu: got timedrdlock\n", cnt);
pthread_t th;
if (pthread_create (&th, NULL, tf, &r) != 0)
Modified: fsf/trunk/libc/nscd/connections.c
==============================================================================
--- fsf/trunk/libc/nscd/connections.c (original)
+++ fsf/trunk/libc/nscd/connections.c Sat Jan 13 00:01:30 2007
@@ -1,5 +1,5 @@
/* Inner loops of cache daemon.
- Copyright (C) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1998-2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -911,8 +911,9 @@
need to verify that the request type is valid, since it has not
yet been checked at this point. */
if (selinux_enabled
- && __builtin_expect (req->type, GETPWBYNAME) >= GETPWBYNAME
- && __builtin_expect (req->type, LASTREQ) < LASTREQ
+ && __builtin_expect (req->type >= GETPWBYNAME, 1)
+ && __builtin_expect (req->type < LASTREQ, 1)
+ && __builtin_expect (req->type < SHUTDOWN || req->type > INVALIDATE, 1)
&& nscd_request_avc_has_perm (fd, req->type) != 0)
return;
Modified: fsf/trunk/libc/nscd/nscd_gethst_r.c
==============================================================================
--- fsf/trunk/libc/nscd/nscd_gethst_r.c (original)
+++ fsf/trunk/libc/nscd/nscd_gethst_r.c Sat Jan 13 00:01:30 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -17,15 +17,10 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <assert.h>
#include <errno.h>
-#include <netdb.h>
#include <resolv.h>
-#include <stdint.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <arpa/nameser.h>
#include <not-cancel.h>
@@ -175,7 +170,7 @@
if (sock == -1)
{
__nss_not_use_nscd_hosts = 1;
- goto out;;
+ goto out;
}
hst_resp = &hst_resp_mem;
@@ -193,7 +188,6 @@
if (hst_resp->found == 1)
{
- struct iovec vec[4];
char *cp = buffer;
uintptr_t align1;
uintptr_t align2;
@@ -253,6 +247,8 @@
if (h_name == NULL)
{
+ struct iovec vec[4];
+
vec[0].iov_base = resultbuf->h_name;
vec[0].iov_len = hst_resp->h_name_len;
total_len = hst_resp->h_name_len;
Modified: fsf/trunk/libc/scripts/check-local-headers.sh
==============================================================================
--- fsf/trunk/libc/scripts/check-local-headers.sh (original)
+++ fsf/trunk/libc/scripts/check-local-headers.sh Sat Jan 13 00:01:30 2007
@@ -1,5 +1,5 @@
#! /bin/bash
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -26,7 +26,7 @@
# Search all dependency files for file names in the include directory.
# There are a few system headers we are known to use.
-if fgrep "$includedir" */*.d |
+if fgrep "$includedir" */*.{o,os,oS}.d |
fgrep -v "$includedir/asm" |
fgrep -v "$includedir/linux" |
fgrep -v "$includedir/selinux" |
Modified: fsf/trunk/libc/sysdeps/i386/i486/bits/atomic.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i486/bits/atomic.h (original)
+++ fsf/trunk/libc/sysdeps/i386/i486/bits/atomic.h Sat Jan 13 00:01:30 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -56,26 +56,33 @@
#endif
-#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
+#if __GNUC_PREREQ (4, 1)
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ __sync_val_compare_and_swap (mem, oldval, newval)
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ (! __sync_bool_compare_and_swap (mem, oldval, newval))
+#else
+# define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
__asm __volatile (LOCK_PREFIX "cmpxchgb %b2, %1" \
: "=a" (ret), "=m" (*mem) \
: "q" (newval), "m" (*mem), "0" (oldval)); \
ret; })
-#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
+# define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
__asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" (newval), "m" (*mem), "0" (oldval)); \
ret; })
-#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
__asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" (newval), "m" (*mem), "0" (oldval)); \
ret; })
+#endif
#define __arch_c_compare_and_exchange_val_8_acq(mem, newval, oldval) \
@@ -240,8 +247,13 @@
} \
__result; })
-#define atomic_exchange_and_add(mem, value) \
+#if __GNUC_PREREQ (4, 1)
+# define atomic_exchange_and_add(mem, value) \
+ __sync_fetch_and_add (mem, value)
+#else
+# define atomic_exchange_and_add(mem, value) \
__arch_exchange_and_add_body (LOCK_PREFIX, __arch, mem, value)
+#endif
#define __arch_exchange_and_add_cprefix \
"cmpl $0, %%gs:%P4\n\tje 0f\n\tlock\n0:\t"
Modified: fsf/trunk/libc/sysdeps/x86_64/bits/atomic.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/bits/atomic.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/bits/atomic.h Sat Jan 13 00:01:30 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
@@ -56,34 +56,41 @@
#endif
-#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
+#if __GNUC_PREREQ (4, 1)
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ __sync_val_compare_and_swap (mem, oldval, newval)
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ (! __sync_bool_compare_and_swap (mem, oldval, newval))
+#else
+# define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
__asm __volatile (LOCK_PREFIX "cmpxchgb %b2, %1" \
: "=a" (ret), "=m" (*mem) \
: "q" (newval), "m" (*mem), "0" (oldval)); \
ret; })
-#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
+# define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
__asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" (newval), "m" (*mem), "0" (oldval)); \
ret; })
-#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
__asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" (newval), "m" (*mem), "0" (oldval)); \
ret; })
-#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
+# define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
__asm __volatile (LOCK_PREFIX "cmpxchgq %q2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" ((long int) (newval)), "m" (*mem), \
"0" ((long int) (oldval))); \
ret; })
+#endif
#define __arch_c_compare_and_exchange_val_8_acq(mem, newval, oldval) \
@@ -178,8 +185,13 @@
"i" (offsetof (tcbhead_t, multiple_threads))); \
result; })
-#define atomic_exchange_and_add(mem, value) \
+#if __GNUC_PREREQ (4, 1)
+# define atomic_exchange_and_add(mem, value) \
+ __sync_fetch_and_add (mem, value)
+#else
+# define atomic_exchange_and_add(mem, value) \
__arch_exchange_and_add_body (LOCK_PREFIX, mem, value)
+#endif
#define __arch_exchange_and_add_cprefix \
"cmpl $0, %%fs:%P4\n\tje 0f\n\tlock\n0:\t"