[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r2970 - in /fsf/trunk/libc: ./ debug/ iconv/ iconvdata/ include/ intl/ io/ libio/ locale/ locale/programs/ login/ nis/ nis/n...
- To: commits@xxxxxxxxxx
- Subject: [commits] r2970 - in /fsf/trunk/libc: ./ debug/ iconv/ iconvdata/ include/ intl/ io/ libio/ locale/ locale/programs/ login/ nis/ nis/n...
- From: eglibc@xxxxxxxxxx
- Date: Sun, 29 Jul 2007 07:03:46 -0000
Author: eglibc
Date: Sun Jul 29 00:03:45 2007
New Revision: 2970
Log:
Import glibc-mainline for 2007-07-29
Added:
fsf/trunk/libc/sysdeps/unix/sysv/linux/posix_fallocate.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/posix_fallocate64.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/debug/test-strcpy_chk.c
fsf/trunk/libc/iconv/gconv.h
fsf/trunk/libc/iconv/gconv_cache.c
fsf/trunk/libc/iconv/gconv_db.c
fsf/trunk/libc/iconv/gconv_int.h
fsf/trunk/libc/iconv/gconv_open.c
fsf/trunk/libc/iconvdata/cns11643.h
fsf/trunk/libc/iconvdata/euc-jp-ms.c
fsf/trunk/libc/iconvdata/euc-kr.c
fsf/trunk/libc/iconvdata/euc-tw.c
fsf/trunk/libc/iconvdata/gbk.c
fsf/trunk/libc/iconvdata/ibm1008_420.c
fsf/trunk/libc/iconvdata/iso-2022-cn-ext.c
fsf/trunk/libc/iconvdata/iso-2022-cn.c
fsf/trunk/libc/iconvdata/iso-2022-kr.c
fsf/trunk/libc/iconvdata/iso-ir-165.h
fsf/trunk/libc/iconvdata/jis0201.h
fsf/trunk/libc/iconvdata/jis0208.h
fsf/trunk/libc/iconvdata/jis0212.h
fsf/trunk/libc/include/time.h
fsf/trunk/libc/intl/dcigettext.c
fsf/trunk/libc/intl/gettextP.h
fsf/trunk/libc/intl/loadmsgcat.c
fsf/trunk/libc/intl/plural-eval.c
fsf/trunk/libc/intl/plural-exp.c
fsf/trunk/libc/intl/plural-exp.h
fsf/trunk/libc/io/tst-posix_fallocate.c
fsf/trunk/libc/libio/genops.c
fsf/trunk/libc/libio/libio.h
fsf/trunk/libc/locale/programs/ld-collate.c
fsf/trunk/libc/locale/programs/ld-ctype.c
fsf/trunk/libc/locale/programs/ld-monetary.c
fsf/trunk/libc/locale/programs/repertoire.c
fsf/trunk/libc/locale/weightwc.h
fsf/trunk/libc/login/logout.c
fsf/trunk/libc/login/logwtmp.c
fsf/trunk/libc/nis/nis_subr.c
fsf/trunk/libc/nis/nss_nis/nis-hosts.c
fsf/trunk/libc/nptl/ChangeLog
fsf/trunk/libc/nptl/allocatestack.c
fsf/trunk/libc/nptl/init.c
fsf/trunk/libc/nptl/pthread_create.c
fsf/trunk/libc/nptl/sysdeps/alpha/tls.h
fsf/trunk/libc/nptl/sysdeps/i386/tls.h
fsf/trunk/libc/nptl/sysdeps/ia64/tls.h
fsf/trunk/libc/nptl/sysdeps/powerpc/tls.h
fsf/trunk/libc/nptl/sysdeps/pthread/aio_misc.h
fsf/trunk/libc/nptl/sysdeps/pthread/gai_misc.h
fsf/trunk/libc/nptl/sysdeps/s390/tls.h
fsf/trunk/libc/nptl/sysdeps/sh/tls.h
fsf/trunk/libc/nptl/sysdeps/sparc/tls.h
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/pthread_once.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/pthread_once.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/pthread_once.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h
fsf/trunk/libc/nptl/tst-locale2.c
fsf/trunk/libc/nscd/selinux.c
fsf/trunk/libc/nss/nss_files/files-hosts.c
fsf/trunk/libc/nss/nsswitch.c
fsf/trunk/libc/nss/nsswitch.h
fsf/trunk/libc/posix/fnmatch.c
fsf/trunk/libc/posix/getconf.c
fsf/trunk/libc/posix/runtests.c
fsf/trunk/libc/resolv/inet_ntop.c
fsf/trunk/libc/rt/tst-mqueue1.c
fsf/trunk/libc/stdio-common/Makefile
fsf/trunk/libc/stdio-common/printf_fp.c
fsf/trunk/libc/stdio-common/tfformat.c
fsf/trunk/libc/stdio-common/tst-sprintf2.c
fsf/trunk/libc/stdio-common/vfprintf.c
fsf/trunk/libc/sunrpc/rpc_cmsg.c
fsf/trunk/libc/sysdeps/generic/_G_config.h
fsf/trunk/libc/sysdeps/gnu/_G_config.h
fsf/trunk/libc/sysdeps/ieee754/ldbl-96/s_roundl.c
fsf/trunk/libc/sysdeps/mach/hurd/_G_config.h
fsf/trunk/libc/sysdeps/posix/posix_fallocate64.c
fsf/trunk/libc/sysdeps/unix/clock_gettime.c
fsf/trunk/libc/time/strptime.c
fsf/trunk/libc/time/strptime_l.c
fsf/trunk/libc/timezone/Makefile
fsf/trunk/libc/wcsmbs/wchar.h
fsf/trunk/libc/wctype/wctype.h
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Jul 29 00:03:45 2007
@@ -1,3 +1,200 @@
+2007-07-28 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * posix/getconf.c (vars): Add missing _SC_LEVEL4_CACHE_LINESIZE
+ entry.
+
+ [BZ 4858]
+ * stdio-common/printf_fp.c (___printf_fp): Fix special case of
+ #.0g and value rounded to 1.0.
+ * stdio-common/tfformat.c (sprint_doubles): Add two new tests.
+
+2007-07-26 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * locale/programs/ld-monetary.c (monetary_finish): Avoid range check
+ for int_frac_digits and frac_digits.
+
+ * login/logout.c (logout): Avoid aliasing violation.
+ * login/logwtmp.c (logwtmp): Likewise.
+
+ * libio/genops.c (_IO_un_link): Avoid aliasing violation.
+
+ * nscd/selinux.c (preserve_capabilities): Initialize new_caps
+ to avoid warning.
+ * iconv/gconv_open.c (__gconv_open): Initialize ptr to avoid
+ warning.
+ * nis/nis_subr.c (nis_getnames): Initialize saveptr to avoid
+ warning.
+ * resolv/inet_ntop.c (inet_ntop6): Initialize best.len and cur.len
+ to avoid warnings.
+
+ * nss/nsswitch.c (__nss_lookup_function): Don't cast &ni->known to
+ void **.
+ * nss/nsswitch.h (service_user): Use void * type for KNOWN field.
+
+ * nss/nss_files/files-hosts.c (LINE_PARSER): Cast host_addr to
+ char * to avoid warning.
+ * nis/nss_nis/nis-hosts.c (LINE_PARSER): Likewise.
+
+ * timezone/Makefile (CFLAGS-zdump.c): Add -fwrapv.
+
+ * locale/programs/ld-ctype.c (ctype_finish, set_class_defaults,
+ allocate_arrays): Cast second argument to charmap_find_symbol
+ to char * to avoid warnings.
+
+ * locale/programs/repertoire.c (repertoire_new_char): Change
+ from_nr, to_nr and cnt to unsigned long, adjust printf format
+ string.
+
+ * locale/programs/ld-collate.c (insert_value, handle_ellipsis):
+ Cast second argument to new_element to char * to avoid warnings.
+
+ * locale/weightwc.h (findidx): Cast &extra[-i] to const int32_t *.
+
+ * intl/gettextP.h (struct loaded_domain): Change plural to const
+ struct expression *.
+ * intl/plural-eval.c (plural_eval): Change first argument to
+ const struct expression *.
+ * intl/plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Change first
+ argument to const struct expression **.
+ * intl/plural-exp.h (EXTRACT_PLURAL_EXPRESSION, plural_eval): Adjust
+ prototypes.
+ * intl/loadmsgcat (_nl_unload_domain): Cast away const
+ in call to __gettext_free_exp.
+
+ * posix/fnmatch.c (fnmatch): Rearrange code to avoid maybe
+ unitialized wstring/wpattern var warnings.
+
+ * posix/runtests.c (struct a_test): Make data field const char *.
+
+ * stdio-common/tst-sprintf2.c (main): Don't declere u, v and buf
+ vars if not LDBL_MANT_DIG >= 106.
+
+ * stdio-common/Makefile (CFLAGS-vfwprintf.c): Add -Wno-unitialized.
+
+ * stdio-common/vfprintf.c (vfprintf): Cast first arugment to
+ __find_specmb to avoid warning.
+
+ * rt/tst-mqueue1.c (do_one_test): Add casts to avoid warnings.
+
+ * debug/test-strcpy_chk.c (do_tests, do_random_tests): Add casts
+ to avoid warnings.
+
+ * sysdeps/ieee754/ldbl-96/s_roundl.c (huge): Add L suffix to
+ initializer.
+
+ * sysdeps/unix/clock_gettime.c (clock_gettime): Only define
+ tv var when it will be actually used.
+
+ * sunrpc/rpc_cmsg.c (xdr_callmsg): Cast IXDR_PUT_* to void
+ to avoid warnings.
+
+ * iconvdata/gbk.c (BODY): Make buf and cp char instead of unsigned
+ char array resp. pointer.
+ * iconvdata/iso-2022-kr.c (BODY): Make buf unsigned char instead of
+ char array.
+ * iconvdata/cns11643.h (cns11643_to_ucs4): Change first argument
+ to const unsigned char **.
+ (ucs4_to_cns11643): Change second argument to unsigned char *.
+ * iconvdata/euc-tw.c (BODY): Change endp type to
+ const unsigned char *.
+ * iconvdata/iso-ir-165.h (ucs4_to_isoir165): Change second argument
+ to unsigned char *.
+ * iconvdata/ibm1008_420.c (LOOP_NEED_FLAGS): Don't define.
+ * iconvdata/iso-2022-cn.c (BODY): Change buf to unsigned char array.
+ * iconvdata/iso-2022-cn-ext.c (BODY): Change buf, tmpbuf, tmp
+ types to unsigned char pointers/arrays instead of char.
+ * iconvdata/jis0201.h (ucs4_to_jisx0201): Change second argument
+ to unsigned char *.
+ * iconvdata/jis0208.h (ucs4_to_jisx0208): Likewise.
+ * iconvdata/jis0212.h: Include assert.h.
+ (ucs4_to_jisx0212): Change second argument to unsigned char *.
+ assert that if cp[0] is not '\0', cp[1] is not '\0' either instead
+ of trying to handle that.
+ * iconvdata/euc-kr.c (euckr_from_ucs4): Initialize also cp[1] to
+ shut up a warning.
+ * iconvdata/euc-jp-ms.c (from_ucs4_lat1, from_ucs4_greek,
+ from_ucs4_cjk, from_ucs4_cjkcpt, from_ucs4_extra): Change type to
+ two dimensional const unsigned char arrays.
+ (BODY): Cast "" to (const unsigned char *) for assignment to cp.
+ Initialize endp to inptr to shut up a warning.
+
+2007-07-20 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ [BZ #4772]
+ * time/strptime_l.c (__strptime_internal): Silently ignore
+ strftime modifiers and field width in recursive calls.
+
+ * include/time.h (enum ptime_locale_status): Remove.
+ (__strptime_internal): Remove decided and era_cnt arguments,
+ add statep argument.
+ * time/strptime_l.c (__strptime_internal): Remove decided
+ and era_cnt arguments, add statep argument. Don't recompute
+ any fields in recursive calls, only update caller's tm
+ and state, if recursive call fails, don't change tm nor
+ any state.
+ (get_alt_number): Adjust.
+ (recursive): Adjust caller.
+ (strptime): Likewise.
+ * time/strptime.c (strptime): Likewise.
+
+2007-07-19 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * iconv/gconv_int.h (__GCONV_NULCONV): New internal only error code.
+ * iconv/gconv_cache.c (__gconv_lookup_cache): Return __GCONV_NULCONV
+ if from and to charsets are the same.
+ * iconv/gconv_db.c (__gconv_find_transform): Likewise.
+ * intl/dcigettext.c (_nl_find_msg): Return NULL even if __gconv_open
+ returns __GCONV_NOCONV, but not for __GCONV_NULCONV.
+
+2007-07-17 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * wcsmbs/wchar.h: Only define wint_t if __need_wint_t.
+ Don't define wint_t when __need_mbstate_t unless it
+ is necessary.
+ (__mbstate_t): Use __WINT_TYPE__ rather than wint_t
+ in the typedef if possible.
+ * wctype/wctype.h (wint_t): Define by including
+ wchar.h with __need_wint_t instead of including stddef.h
+ with __need_wint_t and as fallback definining it ourselves.
+ * iconv/gconv.h (__need_wint_t): Define before including
+ wchar.h.
+ * sysdeps/gnu/_G_config.h: Don't include gconv.h if not _LIBC
+ or _GLIBCPP_USE_WCHAR_T.
+ (__need_wchar_t): Don't define
+ if not _LIBC or _GLIBCPP_USE_WCHAR_T.
+ (__need_wint_t): Don't define before including stddef.h,
+ define before including wchar.h only if _LIBC or
+ _GLIBCPP_USE_WCHAR_T.
+ (_G_iconv_t): Don't define if not _LIBC or _GLIBCPP_USE_WCHAR_T.
+ * sysdeps/mach/hurd/_G_config.h: Likewise.
+ * sysdeps/generic/_G_config.h: Likewise.
+ * libio/libio.h (__wunderflow, __wuflow, __woverflow): Only
+ prototype if _LIBC or _GLIBCPP_USE_WCHAR_T.
+ (_IO_getwc_unlocked, _IO_putwc_unlocked): Only define
+ if _LIBC or _GLIBCPP_USE_WCHAR_T.
+
+2007-07-28 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * sysdeps/posix/posix_fallocate64.c: Undefine
+ __posix_fallocate64_l64 before alias handling.
+ * sysdeps/unix/sysv/linux/posix_fallocate.c: New file.
+ * sysdeps/unix/sysv/linux/posix_fallocate64.c: New file.
+ * sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c: New file.
+ * sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate64.c: New file.
+
+ * io/tst-posix_fallocate.c: Include <fcntl.h>.
+
+2007-07-23 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * locale/programs/ld-collate.c (atwc): New variable.
+ (add_to_tablewc): New toplevel function, moved from collate_output.
+ (collate_output): Remove add_to_tablewc nested function.
+
+ * iconv/iconvconfig.c (hash_table, hash_size): New toplevel vars.
+ (name_insert): New function.
+ (write_output): Remove hash_table and hash_size vars and name_insert
+ nested function.
+
2007-07-24 Roland McGrath <roland@xxxxxxxxxx>
* Makerules (install-others-programs-nosubdir): New target.
Modified: fsf/trunk/libc/debug/test-strcpy_chk.c
==============================================================================
--- fsf/trunk/libc/debug/test-strcpy_chk.c (original)
+++ fsf/trunk/libc/debug/test-strcpy_chk.c Sun Jul 29 00:03:45 2007
@@ -141,8 +141,8 @@
if (align2 + len >= page_size)
return;
- s1 = buf1 + align1;
- s2 = buf2 + align2;
+ s1 = (char *) buf1 + align1;
+ s2 = (char *) buf2 + align2;
for (i = 0; i < len; i++)
s1[i] = 32 + 23 * i % (max_char - 32);
@@ -233,7 +233,9 @@
chk_fail_ok = 1;
if (setjmp (chk_fail_buf) == 0)
{
- res = CALL (impl, p2 + align2, p1 + align1, dlen);
+ res = (unsigned char *)
+ CALL (impl, (char *) p2 + align2,
+ (char *) p1 + align1, dlen);
printf ("Iteration %zd - did not __chk_fail\n", n);
chk_fail_ok = 0;
ret = 1;
@@ -242,7 +244,8 @@
continue;
}
memset (p2 - 64, '\1', 512 + 64);
- res = CALL (impl, p2 + align2, p1 + align1, dlen);
+ res = (unsigned char *)
+ CALL (impl, (char *) p2 + align2, (char *) p1 + align1, dlen);
if (res != STRCPY_RESULT (p2 + align2, len))
{
printf ("\
Modified: fsf/trunk/libc/iconv/gconv.h
==============================================================================
--- fsf/trunk/libc/iconv/gconv.h (original)
+++ fsf/trunk/libc/iconv/gconv.h Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-1999, 2000-2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997-1999, 2000-2002, 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
@@ -25,6 +25,7 @@
#include <features.h>
#define __need_mbstate_t
+#define __need_wint_t
#include <wchar.h>
#define __need_size_t
#define __need_wchar_t
Modified: fsf/trunk/libc/iconv/gconv_cache.c
==============================================================================
--- fsf/trunk/libc/iconv/gconv_cache.c (original)
+++ fsf/trunk/libc/iconv/gconv_cache.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Cache handling for iconv modules.
- Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2001.
@@ -285,7 +285,7 @@
/* Avoid copy-only transformations if the user requests. */
if (__builtin_expect (flags & GCONV_AVOID_NOCONV, 0) && fromidx == toidx)
- return __GCONV_NOCONV;
+ return __GCONV_NULCONV;
/* If there are special conversions available examine them first. */
if (fromidx != 0 && toidx != 0
Modified: fsf/trunk/libc/iconv/gconv_db.c
==============================================================================
--- fsf/trunk/libc/iconv/gconv_db.c (original)
+++ fsf/trunk/libc/iconv/gconv_db.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,6 @@
/* Provide access to the collection of available transformation modules.
- Copyright (C) 1997-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2003, 2004, 2005, 2006, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -756,7 +757,7 @@
{
/* Both character sets are the same. */
__libc_lock_unlock (__gconv_lock);
- return __GCONV_NOCONV;
+ return __GCONV_NULCONV;
}
result = find_derivation (toset, toset_expand, fromset, fromset_expand,
Modified: fsf/trunk/libc/iconv/gconv_int.h
==============================================================================
--- fsf/trunk/libc/iconv/gconv_int.h (original)
+++ fsf/trunk/libc/iconv/gconv_int.h Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -114,6 +114,12 @@
GCONV_AVOID_NOCONV = 1 << 0
};
+/* When GCONV_AVOID_NOCONV is set and no conversion is needed,
+ __GCONV_NULCONV should be returned. */
+enum
+{
+ __GCONV_NULCONV = -1
+};
/* Global variables. */
Modified: fsf/trunk/libc/iconv/gconv_open.c
==============================================================================
--- fsf/trunk/libc/iconv/gconv_open.c (original)
+++ fsf/trunk/libc/iconv/gconv_open.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Find matching transformation algorithms and initialize steps.
- Copyright (C) 1997,1998,1999,2000,2001,2004,2005
+ Copyright (C) 1997,1998,1999,2000,2001,2004,2005,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -56,7 +56,7 @@
/* Make copy without the error handling description. */
char *newtoset = (char *) alloca (errhand - toset + 1);
char *tok;
- char *ptr;
+ char *ptr = NULL /* Work around a bogus warning */;
newtoset[errhand - toset] = '\0';
toset = memcpy (newtoset, toset, errhand - toset);
Modified: fsf/trunk/libc/iconvdata/cns11643.h
==============================================================================
--- fsf/trunk/libc/iconvdata/cns11643.h (original)
+++ fsf/trunk/libc/iconvdata/cns11643.h Sun Jul 29 00:03:45 2007
@@ -1,5 +1,6 @@
/* Access functions for CNS 11643 handling.
- Copyright (C) 1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1998,1999,2000,2001,2002,2003,2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -41,7 +42,7 @@
static inline uint32_t
__attribute ((always_inline))
-cns11643_to_ucs4 (const char **s, size_t avail, unsigned char offset)
+cns11643_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset)
{
unsigned char ch = *(*s);
unsigned char ch2;
@@ -142,7 +143,7 @@
static inline size_t
__attribute ((always_inline))
-ucs4_to_cns11643 (uint32_t wch, char *s, size_t avail)
+ucs4_to_cns11643 (uint32_t wch, unsigned char *s, size_t avail)
{
unsigned int ch = (unsigned int) wch;
char buf[2];
Modified: fsf/trunk/libc/iconvdata/euc-jp-ms.c
==============================================================================
--- fsf/trunk/libc/iconvdata/euc-jp-ms.c (original)
+++ fsf/trunk/libc/iconvdata/euc-jp-ms.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Mapping tables for EUCJP-MS handling.
- Copyright (C) 1998,1999,2000,2001,2003 Free Software Foundation, Inc.
+ Copyright (C) 1998,1999,2000,2001,2003,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by MORIYAMA Masayuki <msyk@xxxxxxxxxxxxxxxxx>, 2003.
@@ -158,7 +158,7 @@
/* 0x8ff4fd */ 0xfa2d, 0x9ed1
};
-static const char from_ucs4_lat1[256][2] =
+static const unsigned char from_ucs4_lat1[256][2] =
{
/* start = 0x0000, end = 0x00ff */
[ 0] = "\x00\x00", [ 1] = "\x01\x00", [ 2] = "\x02\x00",
@@ -244,7 +244,7 @@
[ 255] = "\xab\x73"
};
-static const char from_ucs4_greek[864][2] =
+static const unsigned char from_ucs4_greek[864][2] =
{
/* start = 0x0100, end = 0x045f */
[ 0] = "\xaa\x27", [ 1] = "\xab\x27", [ 2] = "\xaa\x25",
@@ -351,7 +351,7 @@
[ 860] = "\xa7\x7c", [ 862] = "\xa7\x7d", [ 863] = "\xa7\x7e"
};
-static const char from_ucs4_cjk[32662][2] =
+static const unsigned char from_ucs4_cjk[32662][2] =
{
/* start = 0x2010, end = 0x9fa5 */
[ 0] = "\xa1\xbe", [ 4] = "\xa1\xbd", [ 5] = "\xa1\xbd",
@@ -4556,7 +4556,7 @@
[32661] = "\xed\x63"
};
-static const char from_ucs4_cjkcpt[261][2] =
+static const unsigned char from_ucs4_cjkcpt[261][2] =
{
/* start = 0xf929, end = 0xfa2d */
[ 0] = "\xf4\x45", [ 179] = "\xf4\x72", [ 229] = "\xf4\x34",
@@ -4573,7 +4573,7 @@
[ 260] = "\xf4\x7d"
};
-static const char from_ucs4_extra[229][2] =
+static const unsigned char from_ucs4_extra[229][2] =
{
/* start = 0xff01, end = 0xffe5 */
[ 0] = "\xa1\xaa", [ 1] = "\xf4\x2a", [ 2] = "\xa1\xf4",
@@ -4719,7 +4719,7 @@
} \
else \
{ \
- const unsigned char *endp; \
+ const unsigned char *endp = inptr; \
int mblen = 1; \
\
if (__builtin_expect(ch == 0x8f, 0)) \
@@ -4758,7 +4758,7 @@
ch = __UNKNOWN_10646_CHAR; \
} \
else \
- ch = __UNKNOWN_10646_CHAR; \
+ ch = __UNKNOWN_10646_CHAR; \
} \
else if (ch2 <= 0xfe) \
{ \
@@ -4766,7 +4766,7 @@
endp = inptr + mblen; \
} \
else \
- ch = __UNKNOWN_10646_CHAR; \
+ ch = __UNKNOWN_10646_CHAR; \
} \
} \
else if (__builtin_expect(0xa1 <= ch, 1)) \
@@ -4804,10 +4804,10 @@
endp = inptr + mblen; \
} \
else \
- ch = __UNKNOWN_10646_CHAR; \
+ ch = __UNKNOWN_10646_CHAR; \
} \
else \
- ch = __UNKNOWN_10646_CHAR; \
+ ch = __UNKNOWN_10646_CHAR; \
\
if (__builtin_expect (ch, 1) == 0) \
{ \
@@ -4880,7 +4880,7 @@
{ \
UNICODE_TAG_HANDLER (ch, 4); \
/* Illegal character. */ \
- cp = ""; \
+ cp = (const unsigned char *) ""; \
} \
} \
else \
Modified: fsf/trunk/libc/iconvdata/euc-kr.c
==============================================================================
--- fsf/trunk/libc/iconvdata/euc-kr.c (original)
+++ fsf/trunk/libc/iconvdata/euc-kr.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,6 @@
/* Mapping tables for EUC-KR handling.
- Copyright (C) 1998, 1999, 2000-2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000-2002, 2003, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jungshik Shin <jshin@xxxxxxxxxxxxxxxxx>
and Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -46,7 +47,7 @@
cp[1] |= 0x80;
}
else
- cp[0] = '\0';
+ cp[0] = cp[1] = '\0';
}
else
{
Modified: fsf/trunk/libc/iconvdata/euc-tw.c
==============================================================================
--- fsf/trunk/libc/iconvdata/euc-tw.c (original)
+++ fsf/trunk/libc/iconvdata/euc-tw.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,6 @@
/* Mapping tables for EUC-TW handling.
- Copyright (C) 1998, 1999, 2000-2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000-2002, 2003, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -74,7 +75,7 @@
if (ch == 0x8e) \
{ \
/* This is code set 2: CNS 11643, planes 1 to 16. */ \
- const char *endp = inptr + 1; \
+ const unsigned char *endp = inptr + 1; \
\
ch = cns11643_to_ucs4 (&endp, inend - inptr - 1, 0x80); \
\
Modified: fsf/trunk/libc/iconvdata/gbk.c
==============================================================================
--- fsf/trunk/libc/iconvdata/gbk.c (original)
+++ fsf/trunk/libc/iconvdata/gbk.c Sun Jul 29 00:03:45 2007
@@ -13213,8 +13213,8 @@
#define BODY \
{ \
uint32_t ch = get32 (inptr); \
- unsigned char buf[2]; \
- const unsigned char *cp = buf; \
+ char buf[2]; \
+ const char *cp = buf; \
\
if (ch <= L'\x7f') \
/* It's plain ASCII. */ \
Modified: fsf/trunk/libc/iconvdata/ibm1008_420.c
==============================================================================
--- fsf/trunk/libc/iconvdata/ibm1008_420.c (original)
+++ fsf/trunk/libc/iconvdata/ibm1008_420.c Sun Jul 29 00:03:45 2007
@@ -176,7 +176,6 @@
*outptr++ = ch; \
++inptr; \
}
-#define LOOP_NEED_FLAGS
#include <iconv/loop.c>
@@ -190,7 +189,6 @@
*outptr++ = ch; \
++inptr; \
}
-#define LOOP_NEED_FLAGS
#include <iconv/loop.c>
/* Now define the toplevel functions. */
Modified: fsf/trunk/libc/iconvdata/iso-2022-cn-ext.c
==============================================================================
--- fsf/trunk/libc/iconvdata/iso-2022-cn-ext.c (original)
+++ fsf/trunk/libc/iconvdata/iso-2022-cn-ext.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Conversion module for ISO-2022-CN-EXT.
- Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000-2002, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2000.
@@ -304,8 +304,8 @@
{ \
/* This is a character from CNS 11643 plane 3 or higher. \
XXX Currently GB7590 and GB13132 are not supported. */ \
- char buf[3]; \
- const char *tmp = buf; \
+ unsigned char buf[3]; \
+ const unsigned char *tmp = buf; \
\
buf[1] = inptr[2]; \
buf[2] = inptr[3]; \
@@ -426,7 +426,7 @@
} \
else \
{ \
- char buf[2]; \
+ unsigned char buf[2]; \
int used; \
\
if (set == GB2312_set || ((ann & SO_ann) != CNS11643_1_ann \
@@ -456,7 +456,7 @@
used = CNS11643_2_set; \
else \
{ \
- char tmpbuf[3]; \
+ unsigned char tmpbuf[3]; \
\
switch (0) \
{ \
Modified: fsf/trunk/libc/iconvdata/iso-2022-cn.c
==============================================================================
--- fsf/trunk/libc/iconvdata/iso-2022-cn.c (original)
+++ fsf/trunk/libc/iconvdata/iso-2022-cn.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Conversion module for ISO-2022-CN.
- Copyright (C) 1999, 2000-2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000-2002, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1999.
@@ -263,7 +263,7 @@
} \
else \
{ \
- char buf[2]; \
+ unsigned char buf[2]; \
int used; \
size_t written = 0; \
\
Modified: fsf/trunk/libc/iconvdata/iso-2022-kr.c
==============================================================================
--- fsf/trunk/libc/iconvdata/iso-2022-kr.c (original)
+++ fsf/trunk/libc/iconvdata/iso-2022-kr.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Conversion module for ISO-2022-KR.
- Copyright (C) 1998, 1999, 2000-2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000-2002, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -223,7 +223,7 @@
} \
else \
{ \
- char buf[2]; \
+ unsigned char buf[2]; \
size_t written; \
\
written = ucs4_to_ksc5601 (ch, buf, 2); \
Modified: fsf/trunk/libc/iconvdata/iso-ir-165.h
==============================================================================
--- fsf/trunk/libc/iconvdata/iso-ir-165.h (original)
+++ fsf/trunk/libc/iconvdata/iso-ir-165.h Sun Jul 29 00:03:45 2007
@@ -1,6 +1,6 @@
/* Tables for conversion to and from ISO-IR-165.
converting from UCS using gaps.
- Copyright (C) 2000, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2003, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2000.
@@ -72,7 +72,7 @@
static inline size_t
__attribute ((always_inline))
-ucs4_to_isoir165 (uint32_t wch, char *s, size_t avail)
+ucs4_to_isoir165 (uint32_t wch, unsigned char *s, size_t avail)
{
unsigned int ch = (unsigned int) wch;
const char *cp;
Modified: fsf/trunk/libc/iconvdata/jis0201.h
==============================================================================
--- fsf/trunk/libc/iconvdata/jis0201.h (original)
+++ fsf/trunk/libc/iconvdata/jis0201.h Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Access functions for JISX0201 conversion.
- Copyright (C) 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2003, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -40,9 +40,9 @@
static inline size_t
__attribute ((always_inline))
-ucs4_to_jisx0201 (uint32_t wch, char *s)
+ucs4_to_jisx0201 (uint32_t wch, unsigned char *s)
{
- char ch;
+ unsigned char ch;
if (wch == 0xa5)
ch = '\x5c';
Modified: fsf/trunk/libc/iconvdata/jis0208.h
==============================================================================
--- fsf/trunk/libc/iconvdata/jis0208.h (original)
+++ fsf/trunk/libc/iconvdata/jis0208.h Sun Jul 29 00:03:45 2007
@@ -1,5 +1,6 @@
/* Access functions for JISX0208 conversion.
- Copyright (C) 1997,1998,1999,2000,2003,2005 Free Software Foundation, Inc.
+ Copyright (C) 1997,1998,1999,2000,2003,2005,2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -75,7 +76,7 @@
static inline size_t
__attribute ((always_inline))
-ucs4_to_jisx0208 (uint32_t wch, char *s, size_t avail)
+ucs4_to_jisx0208 (uint32_t wch, unsigned char *s, size_t avail)
{
unsigned int ch = (unsigned int) wch;
const char *cp;
Modified: fsf/trunk/libc/iconvdata/jis0212.h
==============================================================================
--- fsf/trunk/libc/iconvdata/jis0212.h (original)
+++ fsf/trunk/libc/iconvdata/jis0212.h Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Access functions for JISX0212 conversion.
- Copyright (C) 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2003, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -21,6 +21,7 @@
#ifndef _JIS0212_H
#define _JIS0212_H 1
+#include <assert.h>
#include <gconv.h>
#include <stdint.h>
@@ -79,7 +80,7 @@
static inline size_t
__attribute ((always_inline))
-ucs4_to_jisx0212 (uint32_t wch, char *s, size_t avail)
+ucs4_to_jisx0212 (uint32_t wch, unsigned char *s, size_t avail)
{
const struct jisx0212_idx *rp = __jisx0212_from_ucs_idx;
unsigned int ch = (unsigned int) wch;
@@ -98,14 +99,11 @@
return __UNKNOWN_10646_CHAR;
s[0] = cp[0];
- if (cp[1] != '\0')
- {
- if (avail < 2)
- return 0;
+ assert (cp[1] != '\0');
+ if (avail < 2)
+ return 0;
- s[1] = cp[1];
- }
-
+ s[1] = cp[1];
return 2;
}
Modified: fsf/trunk/libc/include/time.h
==============================================================================
--- fsf/trunk/libc/include/time.h (original)
+++ fsf/trunk/libc/include/time.h Sun Jul 29 00:03:45 2007
@@ -93,17 +93,10 @@
/* strptime support. */
-/* Status of lookup: do we use the locale data or the raw data? */
-#ifndef __cplusplus
-/* C++ cannot deal with using 'not'. */
-enum ptime_locale_status { not, loc, raw };
-
extern char * __strptime_internal (const char *rp, const char *fmt,
- struct tm *tm,
- enum ptime_locale_status *decided,
- int era_cnt, __locale_t locparam)
+ struct tm *tm, void *statep,
+ __locale_t locparam)
internal_function;
-#endif
extern double __difftime (time_t time1, time_t time0);
Modified: fsf/trunk/libc/intl/dcigettext.c
==============================================================================
--- fsf/trunk/libc/intl/dcigettext.c (original)
+++ fsf/trunk/libc/intl/dcigettext.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Implementation of the internal dcigettext function.
- Copyright (C) 1995-2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
@@ -948,7 +948,7 @@
/* If the output encoding is the same there is
nothing to do. Otherwise do not use the
translation at all. */
- if (__builtin_expect (r != __GCONV_NOCONV, 1))
+ if (__builtin_expect (r != __GCONV_NULCONV, 1))
return NULL;
convd->conv = (__gconv_t) -1;
Modified: fsf/trunk/libc/intl/gettextP.h
==============================================================================
--- fsf/trunk/libc/intl/gettextP.h (original)
+++ fsf/trunk/libc/intl/gettextP.h Sun Jul 29 00:03:45 2007
@@ -1,5 +1,6 @@
/* Header describing internals of libintl library.
- Copyright (C) 1995-1999, 2000, 2001, 2004-2005 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000, 2001, 2004-2005, 2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@xxxxxxxxxx>, 1995.
@@ -147,7 +148,7 @@
struct converted_domain *conversions;
size_t nconversions;
- struct expression *plural;
+ const struct expression *plural;
unsigned long int nplurals;
};
Modified: fsf/trunk/libc/intl/loadmsgcat.c
==============================================================================
--- fsf/trunk/libc/intl/loadmsgcat.c (original)
+++ fsf/trunk/libc/intl/loadmsgcat.c Sun Jul 29 00:03:45 2007
@@ -1276,7 +1276,7 @@
size_t i;
if (domain->plural != &__gettext_germanic_plural)
- __gettext_free_exp (domain->plural);
+ __gettext_free_exp ((struct expression *) domain->plural);
for (i = 0; i < domain->nconversions; i++)
{
Modified: fsf/trunk/libc/intl/plural-eval.c
==============================================================================
--- fsf/trunk/libc/intl/plural-eval.c (original)
+++ fsf/trunk/libc/intl/plural-eval.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Plural expression evaluation.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 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,14 +17,14 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-static unsigned long int plural_eval (struct expression *pexp,
+static unsigned long int plural_eval (const struct expression *pexp,
unsigned long int n)
internal_function;
static unsigned long int
internal_function
plural_eval (pexp, n)
- struct expression *pexp;
+ const struct expression *pexp;
unsigned long int n;
{
switch (pexp->nargs)
Modified: fsf/trunk/libc/intl/plural-exp.c
==============================================================================
--- fsf/trunk/libc/intl/plural-exp.c (original)
+++ fsf/trunk/libc/intl/plural-exp.c Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Expression parsing for plural form selection.
- Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2005, 2007 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@xxxxxxxxxx>, 2000.
This file is part of the GNU C Library.
@@ -99,7 +99,7 @@
internal_function
EXTRACT_PLURAL_EXPRESSION (nullentry, pluralp, npluralsp)
const char *nullentry;
- struct expression **pluralp;
+ const struct expression **pluralp;
unsigned long int *npluralsp;
{
if (nullentry != NULL)
Modified: fsf/trunk/libc/intl/plural-exp.h
==============================================================================
--- fsf/trunk/libc/intl/plural-exp.h (original)
+++ fsf/trunk/libc/intl/plural-exp.h Sun Jul 29 00:03:45 2007
@@ -1,5 +1,5 @@
/* Expression parsing and evaluation for plural form selection.
- Copyright (C) 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@xxxxxxxxxx>, 2000.
This file is part of the GNU C Library.
@@ -114,13 +114,12 @@
internal_function;
extern int PLURAL_PARSE PARAMS ((void *arg));
extern const struct expression GERMANIC_PLURAL attribute_hidden;
-extern void EXTRACT_PLURAL_EXPRESSION PARAMS ((const char *nullentry,
- struct expression **pluralp,
- unsigned long int *npluralsp))
- internal_function;
+extern void EXTRACT_PLURAL_EXPRESSION PARAMS
+ ((const char *nullentry, const struct expression **pluralp,
+ unsigned long int *npluralsp)) internal_function;
#if !defined (_LIBC) && !defined (IN_LIBINTL)
-extern unsigned long int plural_eval PARAMS ((struct expression *pexp,
+extern unsigned long int plural_eval PARAMS ((const struct expression *pexp,
unsigned long int n));
#endif
Modified: fsf/trunk/libc/io/tst-posix_fallocate.c
==============================================================================
--- fsf/trunk/libc/io/tst-posix_fallocate.c (original)
+++ fsf/trunk/libc/io/tst-posix_fallocate.c Sun Jul 29 00:03:45 2007
@@ -1,3 +1,4 @@
+#include <fcntl.h>
#include <sys/stat.h>
static void do_prepare (void);
Modified: fsf/trunk/libc/libio/genops.c
==============================================================================
--- fsf/trunk/libc/libio/genops.c (original)
+++ fsf/trunk/libc/libio/genops.c Sun Jul 29 00:03:45 2007
@@ -64,23 +64,29 @@
{
if (fp->file._flags & _IO_LINKED)
{
- struct _IO_FILE_plus **f;
+ struct _IO_FILE **f;
#ifdef _IO_MTSAFE_IO
_IO_cleanup_region_start_noarg (flush_cleanup);
_IO_lock_lock (list_all_lock);
run_fp = (_IO_FILE *) fp;
_IO_flockfile ((_IO_FILE *) fp);
#endif
- for (f = &INTUSE(_IO_list_all); *f;
- f = (struct _IO_FILE_plus **) &(*f)->file._chain)
+ if (INTUSE(_IO_list_all) == NULL)
+ ;
+ else if (fp == INTUSE(_IO_list_all))
{
- if (*f == fp)
+ INTUSE(_IO_list_all)
+ = (struct _IO_FILE_plus *) INTUSE(_IO_list_all)->file._chain;
+ ++_IO_list_all_stamp;
+ }
+ else
+ for (f = &INTUSE(_IO_list_all)->file._chain; *f; f = &(*f)->_chain)
+ if (*f == (_IO_FILE *) fp)
{
- *f = (struct _IO_FILE_plus *) fp->file._chain;
+ *f = fp->file._chain;
++_IO_list_all_stamp;
break;
}
- }
fp->file._flags &= ~_IO_LINKED;
#ifdef _IO_MTSAFE_IO
_IO_funlockfile ((_IO_FILE *) fp);
Modified: fsf/trunk/libc/libio/libio.h
==============================================================================
--- fsf/trunk/libc/libio/libio.h (original)
+++ fsf/trunk/libc/libio/libio.h Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1995,1997-2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1995,1997-2006,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Per Bothner <bothner@xxxxxxxxxx>.
@@ -413,9 +413,11 @@
extern int __underflow (_IO_FILE *);
extern int __uflow (_IO_FILE *);
extern int __overflow (_IO_FILE *, int);
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
extern _IO_wint_t __wunderflow (_IO_FILE *);
extern _IO_wint_t __wuflow (_IO_FILE *);
extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);
+#endif
#if __GNUC__ >= 3
# define _IO_BE(expr, res) __builtin_expect ((expr), res)
@@ -435,15 +437,17 @@
? __overflow (_fp, (unsigned char) (_ch)) \
: (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))
-#define _IO_getwc_unlocked(_fp) \
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# define _IO_getwc_unlocked(_fp) \
(_IO_BE ((_fp)->_wide_data->_IO_read_ptr >= (_fp)->_wide_data->_IO_read_end,\
0) \
? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++)
-#define _IO_putwc_unlocked(_wch, _fp) \
+# define _IO_putwc_unlocked(_wch, _fp) \
(_IO_BE ((_fp)->_wide_data->_IO_write_ptr \
>= (_fp)->_wide_data->_IO_write_end, 0) \
? __woverflow (_fp, _wch) \
: (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))
+#endif
#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
Modified: fsf/trunk/libc/locale/programs/ld-collate.c
==============================================================================
--- fsf/trunk/libc/locale/programs/ld-collate.c (original)
+++ fsf/trunk/libc/locale/programs/ld-collate.c Sun Jul 29 00:03:45 2007
@@ -990,7 +990,8 @@
uint32_t wcs[2] = { wc, 0 };
/* We have to allocate an entry. */
- elem = new_element (collate, seq != NULL ? seq->bytes : NULL,
+ elem = new_element (collate,
+ seq != NULL ? (char *) seq->bytes : NULL,
seq != NULL ? seq->nbytes : 0,
wc == ILLEGAL_CHAR_VALUE ? NULL : wcs,
symstr, symlen, 1);
@@ -1385,7 +1386,8 @@
/* We have to allocate an entry. */
elem = new_element (collate,
- seq != NULL ? seq->bytes : NULL,
+ seq != NULL
+ ? (char *) seq->bytes : NULL,
seq != NULL ? seq->nbytes : 0,
wc == ILLEGAL_CHAR_VALUE
? NULL : wcs, buf, lenfrom, 1);
Modified: fsf/trunk/libc/locale/programs/ld-ctype.c
==============================================================================
--- fsf/trunk/libc/locale/programs/ld-ctype.c (original)
+++ fsf/trunk/libc/locale/programs/ld-ctype.c Sun Jul 29 00:03:45 2007
@@ -649,7 +649,8 @@
/* Find the UCS value for `bytes'. */
int inner;
uint32_t wch;
- struct charseq *seq = charmap_find_symbol (charmap, bytes, nbytes);
+ struct charseq *seq
+ = charmap_find_symbol (charmap, (char *) bytes, nbytes);
if (seq == NULL)
wch = ILLEGAL_CHAR_VALUE;
@@ -750,7 +751,7 @@
for (cnt = 0; cnt < 10; ++cnt)
{
ctype->mbdigits[cnt] = charmap_find_symbol (charmap,
- digits + cnt, 1);
+ (char *) digits + cnt, 1);
if (ctype->mbdigits[cnt] == NULL)
{
ctype->mbdigits[cnt] = charmap_find_symbol (charmap,
@@ -3470,7 +3471,8 @@
for (cnt = ctype->outdigits_act; cnt < 10; ++cnt)
{
ctype->mboutdigits[cnt] = charmap_find_symbol (charmap,
- digits + cnt, 1);
+ (char *) digits + cnt,
+ 1);
if (ctype->mboutdigits[cnt] == NULL)
ctype->mboutdigits[cnt] = charmap_find_symbol (charmap,
@@ -4025,7 +4027,7 @@
int inner;
uint32_t wch;
struct charseq *seq =
- charmap_find_symbol (charmap, bytes, nbytes);
+ charmap_find_symbol (charmap, (char *) bytes, nbytes);
if (seq == NULL)
wch = ILLEGAL_CHAR_VALUE;
Modified: fsf/trunk/libc/locale/programs/ld-monetary.c
==============================================================================
--- fsf/trunk/libc/locale/programs/ld-monetary.c (original)
+++ fsf/trunk/libc/locale/programs/ld-monetary.c Sun Jul 29 00:03:45 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-1999,2000,2001,2002,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999,2000,2001,2002,2005,2007
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxx>, 1995.
@@ -279,13 +280,14 @@
monetary->cat = initval; \
} \
else if ((monetary->cat < min || monetary->cat > max) \
+ && min < max \
&& !be_quiet && !nothing) \
WITH_CUR_LOCALE (error (0, 0, _("\
%s: value for field `%s' must be in range %d...%d"), \
"LC_MONETARY", #cat, min, max))
- TEST_ELEM (int_frac_digits, -128, 127, -1);
- TEST_ELEM (frac_digits, -128, 127, -1);
+ TEST_ELEM (int_frac_digits, 1, 0, -1);
+ TEST_ELEM (frac_digits, 1, 0, -1);
TEST_ELEM (p_cs_precedes, -1, 1, -1);
TEST_ELEM (p_sep_by_space, -1, 2, -1);
TEST_ELEM (n_cs_precedes, -1, 1, -1);
Modified: fsf/trunk/libc/locale/programs/repertoire.c
==============================================================================
--- fsf/trunk/libc/locale/programs/repertoire.c (original)
+++ fsf/trunk/libc/locale/programs/repertoire.c Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2002,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2002,2004,2005,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
@@ -393,7 +393,7 @@
const char *cp;
char *buf = NULL;
int prefix_len, len1, len2;
- unsigned int from_nr, to_nr, cnt;
+ unsigned long int from_nr, to_nr, cnt;
if (to == NULL)
{
@@ -462,7 +462,7 @@
{
uint32_t this_value = value + (cnt - from_nr);
- obstack_printf (ob, decimal_ellipsis ? "%.*s%0*d" : "%.*s%0*X",
+ obstack_printf (ob, decimal_ellipsis ? "%.*s%0*ld" : "%.*s%0*lX",
prefix_len, from, len1 - prefix_len, cnt);
obstack_1grow (ob, '\0');
Modified: fsf/trunk/libc/locale/weightwc.h
==============================================================================
--- fsf/trunk/libc/locale/weightwc.h (original)
+++ fsf/trunk/libc/locale/weightwc.h Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2001,2003,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2001,2003,2004,2005,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper, <drepper@xxxxxxxxxx>.
@@ -31,7 +31,7 @@
/* Oh well, more than one sequence starting with this byte.
Search for the correct one. */
- const int32_t *cp = &extra[-i];
+ const int32_t *cp = (const int32_t *) &extra[-i];
while (1)
{
size_t nhere;
Modified: fsf/trunk/libc/login/logout.c
==============================================================================
--- fsf/trunk/libc/login/logout.c (original)
+++ fsf/trunk/libc/login/logout.c Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2002, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
@@ -51,15 +51,10 @@
bzero (ut->ut_host, sizeof ut->ut_host);
#endif
#if _HAVE_UT_TV - 0
- if (sizeof (ut->ut_tv) == sizeof (struct timeval))
- __gettimeofday ((struct timeval *) &ut->ut_tv, NULL);
- else
- {
struct timeval tv;
__gettimeofday (&tv, NULL);
ut->ut_tv.tv_sec = tv.tv_sec;
ut->ut_tv.tv_usec = tv.tv_usec;
- }
#else
ut->ut_time = time (NULL);
#endif
Modified: fsf/trunk/libc/login/logwtmp.c
==============================================================================
--- fsf/trunk/libc/login/logwtmp.c (original)
+++ fsf/trunk/libc/login/logwtmp.c Sun Jul 29 00:03:45 2007
@@ -44,15 +44,10 @@
#endif
#if _HAVE_UT_TV - 0
- if (sizeof (ut.ut_tv) == sizeof (struct timeval))
- __gettimeofday ((struct timeval *) &ut.ut_tv, NULL);
- else
- {
- struct timeval tv;
- __gettimeofday (&tv, NULL);
- ut.ut_tv.tv_sec = tv.tv_sec;
- ut.ut_tv.tv_usec = tv.tv_usec;
- }
+ struct timeval tv;
+ __gettimeofday (&tv, NULL);
+ ut.ut_tv.tv_sec = tv.tv_sec;
+ ut.ut_tv.tv_usec = tv.tv_usec;
#else
ut.ut_time = time (NULL);
#endif
Modified: fsf/trunk/libc/nis/nis_subr.c
==============================================================================
--- fsf/trunk/libc/nis/nis_subr.c (original)
+++ fsf/trunk/libc/nis/nis_subr.c Sun Jul 29 00:03:45 2007
@@ -112,7 +112,7 @@
size_t name_len = strlen (name);
char *path;
int pos = 0;
- char *saveptr;
+ char *saveptr = NULL;
int have_point;
const char *cp;
const char *cp2;
Modified: fsf/trunk/libc/nis/nss_nis/nis-hosts.c
==============================================================================
--- fsf/trunk/libc/nis/nss_nis/nis-hosts.c (original)
+++ fsf/trunk/libc/nis/nss_nis/nis-hosts.c Sun Jul 29 00:03:45 2007
@@ -88,7 +88,7 @@
return 0;
/* Store a pointer to the address in the expected form. */
- entdata->h_addr_ptrs[0] = entdata->host_addr;
+ entdata->h_addr_ptrs[0] = (char *) entdata->host_addr;
entdata->h_addr_ptrs[1] = NULL;
result->h_addr_list = entdata->h_addr_ptrs;
Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Sun Jul 29 00:03:45 2007
@@ -1,3 +1,92 @@
+2007-07-26 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * tst-locale2.c (useless): Add return statement.
+
+2007-07-24 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ * allocatestack.c (__nptl_setxid, __wait_lookup_done): Replace
+ lll_private_futex_* (*) with lll_futex_* (*, LLL_PRIVATE).
+ * pthread_create.c (start_thread): Likewise.
+ * init.c (sighandler_setxid): Likewise.
+ * sysdeps/alpha/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
+ * sysdeps/ia64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
+ * sysdeps/i386/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
+ * sysdeps/s390/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
+ * sysdeps/powerpc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
+ * sysdeps/x86_64/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
+ * sysdeps/sparc/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
+ * sysdeps/sh/tls.h (THREAD_GSCOPE_RESET_FLAG): Likewise.
+ * sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY, AIO_MISC_WAIT):
+ Likewise.
+ * sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY, GAI_MISC_WAIT):
+ Likewise.
+ * sysdeps/unix/sysv/linux/unregister-atfork.c (__unregister_atfork):
+ Likewise.
+ * sysdeps/unix/sysv/linux/rtld-lowlevel.h (__rtld_waitzero,
+ __rtld_notify): Likewise.
+ * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/pthread_once.c (clear_once_control,
+ __pthread_once): Likewise.
+ * sysdeps/unix/sysv/linux/alpha/pthread_once.c (clear_once_control,
+ __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
+ * sysdeps/unix/sysv/linux/alpha/lowlevellock.h (FUTEX_PRIVATE_FLAG,
+ LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
+ (lll_futex_wait): Add private argument, define as wrapper around
+ lll_futex_timed_wait.
+ (lll_futex_timed_wait, lll_futex_wake): Add private argument,
+ use __lll_private_flag macro.
+ (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
+ __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
+ * sysdeps/unix/sysv/linux/ia64/pthread_once.c (clear_once_control,
+ __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
+ * sysdeps/unix/sysv/linux/ia64/lowlevellock.h (FUTEX_PRIVATE_FLAG,
+ LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
+ (lll_futex_wait): Add private argument, define as wrapper around
+ lll_futex_timed_wait.
+ (lll_futex_timed_wait, lll_futex_wake): Add private argument,
+ use __lll_private_flag macro.
+ (__lll_mutex_unlock, __lll_robust_mutex_unlock, lll_wait_tid,
+ __lll_mutex_unlock_force): Pass LLL_SHARED as last arg to lll_futex_*.
+ * sysdeps/unix/sysv/linux/i386/lowlevellock.h (__lll_private_flag):
+ Define.
+ (lll_futex_timed_wait, lll_futex_wake): Use it.
+ (lll_private_futex_wait, lll_private_futex_timed_wait,
+ lll_private_futex_wake): Removed.
+ * sysdeps/unix/sysv/linux/s390/pthread_once.c (clear_once_control,
+ __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
+ * sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_PRIVATE_FLAG,
+ LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
+ (lll_futex_wait): Add private argument, define as wrapper around
+ lll_futex_timed_wait.
+ (lll_futex_timed_wait, lll_futex_wake): Add private argument,
+ use __lll_private_flag macro.
+ (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
+ lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
+ to lll_futex_*.
+ * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+ (lll_private_futex_wait, lll_private_futex_timed_wait,
+ lll_private_futex_wake): Removed.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_private_flag):
+ Fix !__ASSUME_PRIVATE_FUTEX non-constant private case.
+ (lll_private_futex_wait, lll_private_futex_timed_wait,
+ lll_private_futex_wake): Removed.
+ * sysdeps/unix/sysv/linux/sparc/pthread_once.c (clear_once_control,
+ __pthread_once): Add LLL_PRIVATE as last argument to lll_futex_*.
+ * sysdeps/unix/sysv/linux/sparc/lowlevellock.h (FUTEX_PRIVATE_FLAG,
+ LLL_PRIVATE, LLL_SHARED, __lll_private_flag): Define.
+ (lll_futex_wait): Add private argument, define as wrapper around
+ lll_futex_timed_wait.
+ (lll_futex_timed_wait, lll_futex_wake): Add private argument,
+ use __lll_private_flag macro.
+ (lll_robust_mutex_dead, __lll_mutex_unlock, __lll_robust_mutex_unlock,
+ lll_wait_tid, __lll_mutex_unlock_force): Pass LLL_SHARED as last arg
+ to lll_futex_*.
+ * sysdeps/unix/sysv/linux/sh/lowlevellock.h (__lll_private_flag):
+ Define.
+ (lll_futex_timed_wait, lll_futex_wake): Use it.
+ (lll_private_futex_wait, lll_private_futex_timed_wait,
+ lll_private_futex_wake): Removed.
+
2007-07-27 Jakub Jelinek <jakub@xxxxxxxxxx>
* sysdeps/sparc/tls.h (tcbhead_t): Move gscope_flag to the end
Modified: fsf/trunk/libc/nptl/allocatestack.c
==============================================================================
--- fsf/trunk/libc/nptl/allocatestack.c (original)
+++ fsf/trunk/libc/nptl/allocatestack.c Sun Jul 29 00:03:45 2007
@@ -951,7 +951,7 @@
int cur = cmdp->cntr;
while (cur != 0)
{
- lll_private_futex_wait (&cmdp->cntr, cur);
+ lll_futex_wait (&cmdp->cntr, cur, LLL_PRIVATE);
cur = cmdp->cntr;
}
@@ -1037,7 +1037,7 @@
continue;
do
- lll_private_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
+ lll_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT, LLL_PRIVATE);
while (*gscope_flagp == THREAD_GSCOPE_FLAG_WAIT);
}
@@ -1059,7 +1059,7 @@
continue;
do
- lll_private_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT);
+ lll_futex_wait (gscope_flagp, THREAD_GSCOPE_FLAG_WAIT, LLL_PRIVATE);
while (*gscope_flagp == THREAD_GSCOPE_FLAG_WAIT);
}
Modified: fsf/trunk/libc/nptl/init.c
==============================================================================
--- fsf/trunk/libc/nptl/init.c (original)
+++ fsf/trunk/libc/nptl/init.c Sun Jul 29 00:03:45 2007
@@ -216,7 +216,7 @@
__xidcmd->id[1], __xidcmd->id[2]);
if (atomic_decrement_val (&__xidcmd->cntr) == 0)
- lll_private_futex_wake (&__xidcmd->cntr, 1);
+ lll_futex_wake (&__xidcmd->cntr, 1, LLL_PRIVATE);
/* Reset the SETXID flag. */
struct pthread *self = THREAD_SELF;
@@ -225,7 +225,7 @@
/* And release the futex. */
self->setxid_futex = 1;
- lll_private_futex_wake (&self->setxid_futex, 1);
+ lll_futex_wake (&self->setxid_futex, 1, LLL_PRIVATE);
}
Modified: fsf/trunk/libc/nptl/pthread_create.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_create.c (original)
+++ fsf/trunk/libc/nptl/pthread_create.c Sun Jul 29 00:03:45 2007
@@ -385,7 +385,7 @@
/* Some other thread might call any of the setXid functions and expect
us to reply. In this case wait until we did that. */
do
- lll_private_futex_wait (&pd->setxid_futex, 0);
+ lll_futex_wait (&pd->setxid_futex, 0, LLL_PRIVATE);
while (pd->cancelhandling & SETXID_BITMASK);
/* Reset the value so that the stack can be reused. */
Modified: fsf/trunk/libc/nptl/sysdeps/alpha/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/alpha/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/alpha/tls.h Sun Jul 29 00:03:45 2007
@@ -131,7 +131,7 @@
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
Modified: fsf/trunk/libc/nptl/sysdeps/i386/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/i386/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/i386/tls.h Sun Jul 29 00:03:45 2007
@@ -449,7 +449,7 @@
: "i" (offsetof (struct pthread, header.gscope_flag)), \
"0" (THREAD_GSCOPE_FLAG_UNUSED)); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
Modified: fsf/trunk/libc/nptl/sysdeps/ia64/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/ia64/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/ia64/tls.h Sun Jul 29 00:03:45 2007
@@ -173,7 +173,7 @@
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
Modified: fsf/trunk/libc/nptl/sysdeps/powerpc/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/powerpc/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/powerpc/tls.h Sun Jul 29 00:03:45 2007
@@ -190,7 +190,7 @@
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
Modified: fsf/trunk/libc/nptl/sysdeps/pthread/aio_misc.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/pthread/aio_misc.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/pthread/aio_misc.h Sun Jul 29 00:03:45 2007
@@ -30,7 +30,7 @@
#define AIO_MISC_NOTIFY(waitlist) \
do { \
if (*waitlist->counterp > 0 && --*waitlist->counterp == 0) \
- lll_private_futex_wake (waitlist->counterp, 1); \
+ lll_futex_wake (waitlist->counterp, 1, LLL_PRIVATE); \
} while (0)
#define AIO_MISC_WAIT(result, futex, timeout, cancel) \
@@ -49,8 +49,8 @@
int status; \
do \
{ \
- status = lll_private_futex_timed_wait (futexaddr, oldval, \
- timeout); \
+ status = lll_futex_timed_wait (futexaddr, oldval, timeout, \
+ LLL_PRIVATE); \
if (status != -EWOULDBLOCK) \
break; \
\
Modified: fsf/trunk/libc/nptl/sysdeps/pthread/gai_misc.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/pthread/gai_misc.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/pthread/gai_misc.h Sun Jul 29 00:03:45 2007
@@ -31,7 +31,7 @@
#define GAI_MISC_NOTIFY(waitlist) \
do { \
if (*waitlist->counterp > 0 && --*waitlist->counterp == 0) \
- lll_private_futex_wake (waitlist->counterp, 1); \
+ lll_futex_wake (waitlist->counterp, 1, LLL_PRIVATE); \
} while (0)
#define GAI_MISC_WAIT(result, futex, timeout, cancel) \
@@ -50,8 +50,8 @@
int status; \
do \
{ \
- status = lll_private_futex_timed_wait (futexaddr, oldval, \
- timeout); \
+ status = lll_futex_timed_wait (futexaddr, oldval, timeout, \
+ LLL_PRIVATE); \
if (status != -EWOULDBLOCK) \
break; \
\
Modified: fsf/trunk/libc/nptl/sysdeps/s390/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/s390/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/s390/tls.h Sun Jul 29 00:03:45 2007
@@ -183,7 +183,7 @@
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
Modified: fsf/trunk/libc/nptl/sysdeps/sh/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/sh/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/sh/tls.h Sun Jul 29 00:03:45 2007
@@ -164,7 +164,7 @@
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
Modified: fsf/trunk/libc/nptl/sysdeps/sparc/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/sparc/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/sparc/tls.h Sun Jul 29 00:03:45 2007
@@ -157,7 +157,7 @@
= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \
THREAD_GSCOPE_FLAG_UNUSED); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/lowlevellock.h Sun Jul 29 00:03:45 2007
@@ -36,34 +36,63 @@
#define FUTEX_LOCK_PI 6
#define FUTEX_UNLOCK_PI 7
#define FUTEX_TRYLOCK_PI 8
+#define FUTEX_PRIVATE_FLAG 128
+
+/* Values for 'private' parameter of locking macros. Yes, the
+ definition seems to be backwards. But it is not. The bit will be
+ reversed before passing to the system call. */
+#define LLL_PRIVATE 0
+#define LLL_SHARED FUTEX_PRIVATE_FLAG
+
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private. */
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+# define __lll_private_flag(fl, private) \
+ ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+# define __lll_private_flag(fl, private) \
+ (__builtin_constant_p (private) \
+ ? ((private) == 0 \
+ ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
+ : (fl)) \
+ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
+ & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif
+#endif
+
/* Initializer for compatibility lock. */
#define LLL_MUTEX_LOCK_INITIALIZER (0)
-#define lll_futex_wait(futexp, val) \
+#define lll_futex_wait(futexp, val, private) \
+ lll_futex_timed_wait (futexp, val, NULL, private)
+
+#define lll_futex_timed_wait(futexp, val, timespec, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
- __ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAIT, (val), 0); \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
+ __lll_private_flag (FUTEX_WAIT, private), \
+ (val), (timespec)); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret; \
})
-#define lll_futex_timed_wait(futexp, val, timespec) \
+#define lll_futex_wake(futexp, nr, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
- __ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAIT, (val), (timespec)); \
- INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret; \
- })
-
-#define lll_futex_wake(futexp, nr) \
- ({ \
- INTERNAL_SYSCALL_DECL (__err); \
- long int __ret; \
- __ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAKE, (nr), 0); \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
+ __lll_private_flag (FUTEX_WAKE, private), \
+ (nr), 0); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err)? -__ret : __ret; \
})
@@ -72,7 +101,7 @@
{ \
int *__futexp = &(futexv); \
atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1); \
+ lll_futex_wake (__futexp, 1, LLL_SHARED); \
} \
while (0)
@@ -198,7 +227,7 @@
{
int val = atomic_exchange_rel (futex, 0);
if (__builtin_expect (val > 1, 0))
- lll_futex_wake (futex, 1);
+ lll_futex_wake (futex, 1, LLL_SHARED);
}
#define lll_mutex_unlock(futex) __lll_mutex_unlock(&(futex))
@@ -208,7 +237,7 @@
{
int val = atomic_exchange_rel (futex, 0);
if (__builtin_expect (val & mask, 0))
- lll_futex_wake (futex, 1);
+ lll_futex_wake (futex, 1, LLL_SHARED);
}
#define lll_robust_mutex_unlock(futex) \
__lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
@@ -218,7 +247,7 @@
__lll_mutex_unlock_force (int *futex)
{
(void) atomic_exchange_rel (futex, 0);
- lll_futex_wake (futex, 1);
+ lll_futex_wake (futex, 1, LLL_SHARED);
}
#define lll_mutex_unlock_force(futex) __lll_mutex_unlock_force(&(futex))
@@ -252,10 +281,10 @@
thread ID while the clone is running and is reset to zero
afterwards. */
#define lll_wait_tid(tid) \
- do { \
- __typeof (tid) __tid; \
- while ((__tid = (tid)) != 0) \
- lll_futex_wait (&(tid), __tid); \
+ do { \
+ __typeof (tid) __tid; \
+ while ((__tid = (tid)) != 0) \
+ lll_futex_wait (&(tid), __tid, LLL_SHARED); \
} while (0)
extern int __lll_timedwait_tid (int *, const struct timespec *)
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/pthread_once.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/pthread_once.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/pthread_once.c Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* 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.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,7 +28,7 @@
pthread_once_t *once_control = (pthread_once_t *) arg;
*once_control = 0;
- lll_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
}
int
@@ -72,7 +72,7 @@
break;
/* Same generation, some other thread was faster. Wait. */
- lll_futex_wait (once_control, oldval);
+ lll_futex_wait (once_control, oldval, LLL_PRIVATE);
}
/* This thread is the first here. Do the initialization.
@@ -88,7 +88,7 @@
atomic_increment (once_control);
/* Wake up all other threads. */
- lll_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
return 0;
}
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/fork.c Sun Jul 29 00:03:45 2007
@@ -203,7 +203,7 @@
if (atomic_decrement_and_test (&allp->handler->refcntr)
&& allp->handler->need_signal)
- lll_private_futex_wake (allp->handler->refcntr, 1);
+ lll_futex_wake (allp->handler->refcntr, 1, LLL_PRIVATE);
allp = allp->next;
}
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h Sun Jul 29 00:03:45 2007
@@ -36,6 +36,39 @@
#define FUTEX_LOCK_PI 6
#define FUTEX_UNLOCK_PI 7
#define FUTEX_TRYLOCK_PI 8
+#define FUTEX_PRIVATE_FLAG 128
+
+/* Values for 'private' parameter of locking macros. Yes, the
+ definition seems to be backwards. But it is not. The bit will be
+ reversed before passing to the system call. */
+#define LLL_PRIVATE 0
+#define LLL_SHARED FUTEX_PRIVATE_FLAG
+
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private. */
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+# define __lll_private_flag(fl, private) \
+ ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+# define __lll_private_flag(fl, private) \
+ (__builtin_constant_p (private) \
+ ? ((private) == 0 \
+ ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
+ : (fl)) \
+ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
+ & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif
+#endif
+
/* Delay in spinlock loop. */
#define BUSY_WAIT_NOP asm ("hint @pause")
@@ -43,18 +76,22 @@
/* Initializer for compatibility lock. */
#define LLL_MUTEX_LOCK_INITIALIZER (0)
-#define lll_futex_wait(futex, val) lll_futex_timed_wait (futex, val, 0)
-
-#define lll_futex_timed_wait(ftx, val, timespec) \
+#define lll_futex_wait(futex, val, private) \
+ lll_futex_timed_wait (futex, val, NULL, private)
+
+#define lll_futex_timed_wait(ftx, val, timespec, private) \
({ \
- DO_INLINE_SYSCALL(futex, 4, (long) (ftx), FUTEX_WAIT, (int) (val), \
- (long) (timespec)); \
+ DO_INLINE_SYSCALL(futex, 4, (long) (ftx), \
+ __lll_private_flag (FUTEX_WAIT, private), \
+ (int) (val), (long) (timespec)); \
_r10 == -1 ? -_retval : _retval; \
})
-#define lll_futex_wake(ftx, nr) \
+#define lll_futex_wake(ftx, nr, private) \
({ \
- DO_INLINE_SYSCALL(futex, 3, (long) (ftx), FUTEX_WAKE, (int) (nr)); \
+ DO_INLINE_SYSCALL(futex, 3, (long) (ftx), \
+ __lll_private_flag (FUTEX_WAKE, private), \
+ (int) (nr)); \
_r10 == -1 ? -_retval : _retval; \
})
@@ -188,7 +225,7 @@
int __val = atomic_exchange_rel (__futex, 0); \
\
if (__builtin_expect (__val > 1, 0)) \
- lll_futex_wake (__futex, 1); \
+ lll_futex_wake (__futex, 1, LLL_SHARED); \
}))
#define lll_mutex_unlock(futex) \
__lll_mutex_unlock(&(futex))
@@ -200,7 +237,7 @@
int __val = atomic_exchange_rel (__futex, 0); \
\
if (__builtin_expect (__val & FUTEX_WAITERS, 0)) \
- lll_futex_wake (__futex, 1); \
+ lll_futex_wake (__futex, 1, LLL_SHARED); \
}))
#define lll_robust_mutex_unlock(futex) \
__lll_robust_mutex_unlock(&(futex))
@@ -210,7 +247,7 @@
((void) ({ \
int *__futex = (futex); \
(void) atomic_exchange_rel (__futex, 0); \
- lll_futex_wake (__futex, 1); \
+ lll_futex_wake (__futex, 1, LLL_SHARED); \
}))
#define lll_mutex_unlock_force(futex) \
__lll_mutex_unlock_force(&(futex))
@@ -241,12 +278,12 @@
thread ID while the clone is running and is reset to zero
afterwards. */
#define lll_wait_tid(tid) \
- do \
- { \
- __typeof (tid) __tid; \
- while ((__tid = (tid)) != 0) \
- lll_futex_wait (&(tid), __tid); \
- } \
+ do \
+ { \
+ __typeof (tid) __tid; \
+ while ((__tid = (tid)) != 0) \
+ lll_futex_wait (&(tid), __tid, LLL_SHARED); \
+ } \
while (0)
extern int __lll_timedwait_tid (int *, const struct timespec *)
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/pthread_once.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/pthread_once.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/pthread_once.c Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* 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 Jakub Jelinek <jakub@xxxxxxxxxx>, 2003.
@@ -30,7 +30,7 @@
pthread_once_t *once_control = (pthread_once_t *) arg;
*once_control = 0;
- lll_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
}
@@ -65,7 +65,7 @@
if (((oldval ^ newval) & -4) == 0)
{
/* Same generation, some other thread was faster. Wait. */
- lll_futex_wait (once_control, newval);
+ lll_futex_wait (once_control, newval, LLL_PRIVATE);
continue;
}
}
@@ -84,7 +84,7 @@
atomic_increment (once_control);
/* Wake up all other threads. */
- lll_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
break;
}
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h Sun Jul 29 00:03:45 2007
@@ -134,15 +134,6 @@
})
-#define lll_private_futex_wait(futexp, val) \
- lll_futex_timed_wait (futexp, val, NULL, LLL_PRIVATE)
-
-#define lll_private_futex_timed_wait(futexp, val, timeout) \
- lll_futex_timed_wait (futexp, val, timeout, LLL_PRIVATE)
-
-#define lll_private_futex_wake(futexp, val) \
- lll_futex_wake (futexp, val, LLL_PRIVATE)
-
#ifdef UP
# define __lll_acq_instr ""
# define __lll_rel_instr ""
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/pthread_once.c Sun Jul 29 00:03:45 2007
@@ -30,7 +30,7 @@
pthread_once_t *once_control = (pthread_once_t *) arg;
*once_control = 0;
- lll_private_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
}
@@ -74,7 +74,7 @@
break;
/* Same generation, some other thread was faster. Wait. */
- lll_private_futex_wait (once_control, oldval);
+ lll_futex_wait (once_control, oldval, LLL_PRIVATE);
}
@@ -92,7 +92,7 @@
atomic_increment (once_control);
/* Wake up all other threads. */
- lll_private_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
return 0;
}
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h Sun Jul 29 00:03:45 2007
@@ -33,12 +33,12 @@
int val = word; \
if (val == 0) \
break; \
- lll_private_futex_wait (&(word), val); \
+ lll_futex_wait (&(word), val, LLL_PRIVATE); \
} \
} while (0)
#define __rtld_notify(word) \
- lll_private_futex_wake (&(word), 1)
+ lll_futex_wake (&(word), 1, LLL_PRIVATE)
#endif
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h Sun Jul 29 00:03:45 2007
@@ -35,17 +35,53 @@
#define FUTEX_LOCK_PI 6
#define FUTEX_UNLOCK_PI 7
#define FUTEX_TRYLOCK_PI 8
+#define FUTEX_PRIVATE_FLAG 128
+
+/* Values for 'private' parameter of locking macros. Yes, the
+ definition seems to be backwards. But it is not. The bit will be
+ reversed before passing to the system call. */
+#define LLL_PRIVATE 0
+#define LLL_SHARED FUTEX_PRIVATE_FLAG
+
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private. */
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+# define __lll_private_flag(fl, private) \
+ ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+# define __lll_private_flag(fl, private) \
+ (__builtin_constant_p (private) \
+ ? ((private) == 0 \
+ ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
+ : (fl)) \
+ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
+ & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif
+#endif
/* Initializer for compatibility lock. */
#define LLL_MUTEX_LOCK_INITIALIZER (0)
-#define lll_futex_wait(futex, val) \
- ({ \
- register unsigned long int __r2 asm ("2") = (unsigned long int) (futex); \
- register unsigned long int __r3 asm ("3") = FUTEX_WAIT; \
- register unsigned long int __r4 asm ("4") = (unsigned long int) (val); \
- register unsigned long int __r5 asm ("5") = 0ul; \
- register unsigned long __result asm ("2"); \
+#define lll_futex_wait(futex, val, private) \
+ lll_futex_timed_wait (futex, val, NULL, private)
+
+#define lll_futex_timed_wait(futex, val, timespec, private) \
+ ({ \
+ register unsigned long int __r2 asm ("2") = (unsigned long int) (futex); \
+ register unsigned long int __r3 asm ("3") \
+ = __lll_private_flag (FUTEX_WAIT, private); \
+ register unsigned long int __r4 asm ("4") = (unsigned long int) (val); \
+ register unsigned long int __r5 asm ("5") = (unsigned long int)(timespec);\
+ register unsigned long int __result asm ("2"); \
\
__asm __volatile ("svc %b1" \
: "=d" (__result) \
@@ -56,27 +92,11 @@
})
-#define lll_futex_timed_wait(futex, val, timespec) \
+#define lll_futex_wake(futex, nr, private) \
({ \
register unsigned long int __r2 asm ("2") = (unsigned long int) (futex); \
- register unsigned long int __r3 asm ("3") = FUTEX_WAIT; \
- register unsigned long int __r4 asm ("4") = (unsigned long int) (val); \
- register unsigned long int __r5 asm ("5") = (unsigned long int)(timespec);\
- register unsigned long int __result asm ("2"); \
- \
- __asm __volatile ("svc %b1" \
- : "=d" (__result) \
- : "i" (SYS_futex), "0" (__r2), "d" (__r3), \
- "d" (__r4), "d" (__r5) \
- : "cc", "memory" ); \
- __result; \
- })
-
-
-#define lll_futex_wake(futex, nr) \
- ({ \
- register unsigned long int __r2 asm ("2") = (unsigned long int) (futex); \
- register unsigned long int __r3 asm ("3") = FUTEX_WAKE; \
+ register unsigned long int __r3 asm ("3") \
+ __lll_private_flag (FUTEX_WAKE, private); \
register unsigned long int __r4 asm ("4") = (unsigned long int) (nr); \
register unsigned long int __result asm ("2"); \
\
@@ -94,7 +114,7 @@
int *__futexp = &(futexv); \
\
atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1); \
+ lll_futex_wake (__futexp, 1, LLL_SHARED); \
} \
while (0)
@@ -271,7 +291,7 @@
lll_compare_and_swap (futex, oldval, newval, "slr %2,%2");
if (oldval > 1)
- lll_futex_wake (futex, 1);
+ lll_futex_wake (futex, 1, LLL_SHARED);
}
#define lll_mutex_unlock(futex) \
__lll_mutex_unlock(&(futex))
@@ -286,7 +306,7 @@
lll_compare_and_swap (futex, oldval, newval, "slr %2,%2");
if (oldval & mask)
- lll_futex_wake (futex, 1);
+ lll_futex_wake (futex, 1, LLL_SHARED);
}
#define lll_robust_mutex_unlock(futex) \
__lll_robust_mutex_unlock(&(futex), FUTEX_WAITERS)
@@ -297,7 +317,7 @@
__lll_mutex_unlock_force (int *futex)
{
*futex = 0;
- lll_futex_wake (futex, 1);
+ lll_futex_wake (futex, 1, LLL_SHARED);
}
#define lll_mutex_unlock_force(futex) \
__lll_mutex_unlock_force(&(futex))
@@ -338,7 +358,7 @@
int tid;
while ((tid = *ptid) != 0)
- lll_futex_wait (ptid, tid);
+ lll_futex_wait (ptid, tid, LLL_SHARED);
}
#define lll_wait_tid(tid) __lll_wait_tid(&(tid))
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/pthread_once.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/pthread_once.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/pthread_once.c Sun Jul 29 00:03:45 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@xxxxxxxxxx>, 2003.
@@ -30,7 +30,7 @@
pthread_once_t *once_control = (pthread_once_t *) arg;
*once_control = 0;
- lll_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
}
@@ -76,7 +76,7 @@
if (((oldval ^ newval) & -4) == 0)
{
/* Same generation, some other thread was faster. Wait. */
- lll_futex_wait (once_control, newval);
+ lll_futex_wait (once_control, newval, LLL_PRIVATE);
continue;
}
}
@@ -101,7 +101,7 @@
: "m" (*once_control) : "cc" );
/* Wake up all other threads. */
- lll_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
break;
}
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h Sun Jul 29 00:03:45 2007
@@ -38,6 +38,31 @@
reversed before passing to the system call. */
#define LLL_PRIVATE 0
#define LLL_SHARED FUTEX_PRIVATE_FLAG
+
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private. */
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+# define __lll_private_flag(fl, private) \
+ ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+# define __lll_private_flag(fl, private) \
+ (__builtin_constant_p (private) \
+ ? ((private) == 0 \
+ ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
+ : (fl)) \
+ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
+ & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif
+#endif
/* Initializer for compatibility lock. */
@@ -278,7 +303,7 @@
1: mov r1,r15"\
: "=&r" (__ignore) : "r" (__futex), "r" (FUTEX_OWNER_DIED) \
: "r0", "r1", "memory"); \
- lll_futex_wake (__futex, 1, 0); })
+ lll_futex_wake (__futex, 1, LLL_SHARED); })
#define lll_mutex_islocked(futex) \
(futex != 0)
@@ -312,7 +337,8 @@
int __status; \
register unsigned long __r3 asm ("r3") = SYS_futex; \
register unsigned long __r4 asm ("r4") = (unsigned long) (futex); \
- register unsigned long __r5 asm ("r5") = FUTEX_WAIT; \
+ register unsigned long __r5 asm ("r5") \
+ = __lll_private_flag (FUTEX_WAIT, private); \
register unsigned long __r6 asm ("r6") = (unsigned long) (val); \
register unsigned long __r7 asm ("r7") = (timeout); \
__asm __volatile (SYSCALL_WITH_INST_PAD \
@@ -329,7 +355,8 @@
int __ignore; \
register unsigned long __r3 asm ("r3") = SYS_futex; \
register unsigned long __r4 asm ("r4") = (unsigned long) (futex); \
- register unsigned long __r5 asm ("r5") = FUTEX_WAKE; \
+ register unsigned long __r5 asm ("r5") \
+ = __lll_private_flag (FUTEX_WAKE, private); \
register unsigned long __r6 asm ("r6") = (unsigned long) (nr); \
register unsigned long __r7 asm ("r7") = 0; \
__asm __volatile (SYSCALL_WITH_INST_PAD \
@@ -340,81 +367,6 @@
} while (0)
-#define lll_private_futex_wait(futex, val) \
- lll_private_futex_timed_wait (futex, val, NULL)
-
-
-#ifdef __ASSUME_PRIVATE_FUTEX
-# define lll_private_futex_timed_wait(futex, val, timeout) \
- ({ \
- int __status; \
- register unsigned long __r3 asm ("r3") = SYS_futex; \
- register unsigned long __r4 asm ("r4") = (unsigned long) (futex); \
- register unsigned long __r5 asm ("r5") = FUTEX_WAIT | FUTEX_PRIVATE_FLAG; \
- register unsigned long __r6 asm ("r6") = (unsigned long) (val); \
- register unsigned long __r7 asm ("r7") = (timeout); \
- __asm __volatile (SYSCALL_WITH_INST_PAD \
- : "=z" (__status) \
- : "r" (__r3), "r" (__r4), "r" (__r5), \
- "r" (__r6), "r" (__r7) \
- : "memory", "t"); \
- __status; \
- })
-
-
-# define lll_private_futex_wake(futex, nr) \
- do { \
- int __ignore; \
- register unsigned long __r3 asm ("r3") = SYS_futex; \
- register unsigned long __r4 asm ("r4") = (unsigned long) (futex); \
- register unsigned long __r5 asm ("r5") = FUTEX_WAKE | FUTEX_PRIVATE_FLAG; \
- register unsigned long __r6 asm ("r6") = (unsigned long) (nr); \
- register unsigned long __r7 asm ("r7") = 0; \
- __asm __volatile (SYSCALL_WITH_INST_PAD \
- : "=z" (__ignore) \
- : "r" (__r3), "r" (__r4), "r" (__r5), \
- "r" (__r6), "r" (__r7) \
- : "memory", "t"); \
- } while (0)
-
-
-#else
-# define lll_private_futex_timed_wait(futex, val, timeout) \
- ({ \
- int __status; \
- register unsigned long __r3 asm ("r3") = SYS_futex; \
- register unsigned long __r4 asm ("r4") = (unsigned long) (futex); \
- register unsigned long __r5 asm ("r5"); \
- register unsigned long __r6 asm ("r6") = (unsigned long) (val); \
- register unsigned long __r7 asm ("r7") = (timeout); \
- __r5 = THREAD_GETMEM (THREAD_SELF, header.private_futex); \
- __asm __volatile (SYSCALL_WITH_INST_PAD \
- : "=z" (__status) \
- : "r" (__r3), "r" (__r4), "r" (__r5), \
- "r" (__r6), "r" (__r7) \
- : "memory", "t"); \
- __status; \
- })
-
-
-# define lll_private_futex_wake(futex, nr) \
- do { \
- int __ignore; \
- register unsigned long __r3 asm ("r3") = SYS_futex; \
- register unsigned long __r4 asm ("r4") = (unsigned long) (futex); \
- register unsigned long __r5 asm ("r5") = FUTEX_WAKE; \
- register unsigned long __r6 asm ("r6") = (unsigned long) (nr); \
- register unsigned long __r7 asm ("r7") = 0; \
- __r5 |= THREAD_GETMEM (THREAD_SELF, header.private_futex); \
- __asm __volatile (SYSCALL_WITH_INST_PAD \
- : "=z" (__ignore) \
- : "r" (__r3), "r" (__r4), "r" (__r5), \
- "r" (__r6), "r" (__r7) \
- : "memory", "t"); \
- } while (0)
-#endif
-
-
/* The states of a lock are:
0 - untaken
1 - taken by one user
@@ -438,7 +390,7 @@
do { \
__typeof (tid) *__tid = &(tid); \
while (*__tid != 0) \
- lll_futex_wait (__tid, *__tid, 0); \
+ lll_futex_wait (__tid, *__tid, LLL_SHARED); \
} while (0)
extern int __lll_timedwait_tid (int *tid, const struct timespec *abstime)
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h Sun Jul 29 00:03:45 2007
@@ -35,37 +35,66 @@
#define FUTEX_LOCK_PI 6
#define FUTEX_UNLOCK_PI 7
#define FUTEX_TRYLOCK_PI 8
+#define FUTEX_PRIVATE_FLAG 128
+
+
+/* Values for 'private' parameter of locking macros. Yes, the
+ definition seems to be backwards. But it is not. The bit will be
+ reversed before passing to the system call. */
+#define LLL_PRIVATE 0
+#define LLL_SHARED FUTEX_PRIVATE_FLAG
+
+
+#if !defined NOT_IN_libc || defined IS_IN_rtld
+/* In libc.so or ld.so all futexes are private. */
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ ((fl) | FUTEX_PRIVATE_FLAG)
+# else
+# define __lll_private_flag(fl, private) \
+ ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
+# endif
+#else
+# ifdef __ASSUME_PRIVATE_FUTEX
+# define __lll_private_flag(fl, private) \
+ (((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
+# else
+# define __lll_private_flag(fl, private) \
+ (__builtin_constant_p (private) \
+ ? ((private) == 0 \
+ ? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
+ : (fl)) \
+ : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
+ & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
+# endif
+#endif
+
/* Initializer for compatibility lock. */
#define LLL_MUTEX_LOCK_INITIALIZER (0)
-#define lll_futex_wait(futexp, val) \
+#define lll_futex_wait(futexp, val, private) \
+ lll_futex_timed_wait (futexp, val, NULL, private)
+
+#define lll_futex_timed_wait(futexp, val, timespec, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
\
- __ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAIT, (val), 0); \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
+ __lll_private_flag (FUTEX_WAIT, private), \
+ (val), (timespec)); \
__ret; \
})
-#define lll_futex_timed_wait(futexp, val, timespec) \
+#define lll_futex_wake(futexp, nr, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
\
- __ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAIT, (val), (timespec)); \
- __ret; \
- })
-
-#define lll_futex_wake(futexp, nr) \
- ({ \
- INTERNAL_SYSCALL_DECL (__err); \
- long int __ret; \
- \
- __ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAKE, (nr), 0); \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
+ __lll_private_flag (FUTEX_WAKE, private), \
+ (nr), 0); \
__ret; \
})
@@ -86,7 +115,7 @@
{ \
int *__futexp = &(futexv); \
atomic_or (__futexp, FUTEX_OWNER_DIED); \
- lll_futex_wake (__futexp, 1); \
+ lll_futex_wake (__futexp, 1, LLL_SHARED); \
} \
while (0)
@@ -212,7 +241,7 @@
int *__futex = &(lock); \
int __val = atomic_exchange_24_rel (__futex, 0); \
if (__builtin_expect (__val > 1, 0)) \
- lll_futex_wake (__futex, 1); \
+ lll_futex_wake (__futex, 1, LLL_SHARED); \
}))
#define lll_robust_mutex_unlock(lock) \
@@ -220,14 +249,14 @@
int *__futex = &(lock); \
int __val = atomic_exchange_rel (__futex, 0); \
if (__builtin_expect (__val & FUTEX_WAITERS, 0)) \
- lll_futex_wake (__futex, 1); \
+ lll_futex_wake (__futex, 1, LLL_SHARED); \
}))
#define lll_mutex_unlock_force(lock) \
((void) ({ \
int *__futex = &(lock); \
(void) atomic_exchange_24_rel (__futex, 0); \
- lll_futex_wake (__futex, 1); \
+ lll_futex_wake (__futex, 1, LLL_SHARED); \
}))
#define lll_mutex_islocked(futex) \
@@ -255,12 +284,12 @@
thread ID while the clone is running and is reset to zero
afterwards. */
#define lll_wait_tid(tid) \
- do \
- { \
- __typeof (tid) __tid; \
- while ((__tid = (tid)) != 0) \
- lll_futex_wait (&(tid), __tid); \
- } \
+ do \
+ { \
+ __typeof (tid) __tid; \
+ while ((__tid = (tid)) != 0) \
+ lll_futex_wait (&(tid), __tid, LLL_SHARED); \
+ } \
while (0)
extern int __lll_timedwait_tid (int *, const struct timespec *)
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c Sun Jul 29 00:03:45 2007
@@ -30,7 +30,7 @@
pthread_once_t *once_control = (pthread_once_t *) arg;
*once_control = 0;
- lll_private_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
}
@@ -65,7 +65,7 @@
if (((oldval ^ newval) & -4) == 0)
{
/* Same generation, some other thread was faster. Wait. */
- lll_futex_wait (once_control, newval);
+ lll_futex_wait (once_control, newval, LLL_PRIVATE);
continue;
}
}
@@ -84,7 +84,7 @@
atomic_increment (once_control);
/* Wake up all other threads. */
- lll_private_futex_wake (once_control, INT_MAX);
+ lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
break;
}
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c Sun Jul 29 00:03:45 2007
@@ -104,7 +104,7 @@
atomic_decrement (&deleted->handler->refcntr);
unsigned int val;
while ((val = deleted->handler->refcntr) != 0)
- lll_private_futex_wait (&deleted->handler->refcntr, val);
+ lll_futex_wait (&deleted->handler->refcntr, val, LLL_PRIVATE);
deleted = deleted->next;
}
Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h Sun Jul 29 00:03:45 2007
@@ -71,8 +71,8 @@
: (fl)) \
: ({ unsigned int __fl = ((private) ^ FUTEX_PRIVATE_FLAG); \
asm ("andl %%fs:%P1, %0" : "+r" (__fl) \
- : "i" offsetof (struct pthread, header.private_futex)); \
- __fl | (fl); })
+ : "i" (offsetof (struct pthread, header.private_futex))); \
+ __fl | (fl); }))
# endif
#endif
@@ -215,15 +215,6 @@
} while (0)
-#define lll_private_futex_wait(futex, val) \
- lll_futex_timed_wait (futex, val, NULL, LLL_PRIVATE)
-
-#define lll_private_futex_timed_wait(futex, val, timeout) \
- lll_futex_timed_wait (futex, val, timeout, LLL_PRIVATE)
-
-#define lll_private_futex_wake(futex, nr) \
- lll_futex_wake (futex, nr, LLL_PRIVATE)
-
/* Does not preserve %eax and %ecx. */
extern int __lll_mutex_lock_wait (int *__futex, int __val) attribute_hidden;
Modified: fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h Sun Jul 29 00:03:45 2007
@@ -355,7 +355,7 @@
: "i" (offsetof (struct pthread, header.gscope_flag)), \
"0" (THREAD_GSCOPE_FLAG_UNUSED)); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
- lll_private_futex_wake (&THREAD_SELF->header.gscope_flag, 1); \
+ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \
} \
while (0)
#define THREAD_GSCOPE_SET_FLAG() \
Modified: fsf/trunk/libc/nptl/tst-locale2.c
==============================================================================
--- fsf/trunk/libc/nptl/tst-locale2.c (original)
+++ fsf/trunk/libc/nptl/tst-locale2.c Sun Jul 29 00:03:45 2007
@@ -11,4 +11,5 @@
{
pthread_t th;
pthread_create (&th, 0, useless, a);
+ return NULL;
}
Modified: fsf/trunk/libc/nscd/selinux.c
[... 1954 lines stripped ...]