[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r10123 - in /fsf/trunk/libc: ./ include/ posix/ sysdeps/unix/sysv/linux/ sysdeps/unix/sysv/linux/i386/



Author: eglibc
Date: Sun Mar 28 00:04:39 2010
New Revision: 10123

Log:
Import glibc-mainline for 2010-03-28

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/include/wchar.h
    fsf/trunk/libc/posix/glob.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/getpagesize.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fcntl.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Mar 28 00:04:39 2010
@@ -1,3 +1,19 @@
+2010-03-27  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/getpagesize.c (__getpagesize): If
+	__ASSUME_AT_PAGESIZE we can rely on the value being set.
+
+	* include/wchar.h: Undefine __need_mbstate_t and __need_wint_t
+	unconditionally in the end.
+
+	* posix/glob.c (glob): Initialize oldcount early, too.
+
+2010-03-26  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/i386/fcntl.c: Define miss_F_GETOWN_EX
+	only if needed.
+	Patch mostly by Paul Pluzhnikov <ppluzhnikov@xxxxxxxxxx>.
+
 2010-03-26  Richard Henderson  <rth@xxxxxxxxxx>
 
 	* sysdeps/generic/ldsodefs.h (_dl_random): Mark attribute_relro;

Modified: fsf/trunk/libc/include/wchar.h
==============================================================================
--- fsf/trunk/libc/include/wchar.h (original)
+++ fsf/trunk/libc/include/wchar.h Sun Mar 28 00:04:39 2010
@@ -195,3 +195,8 @@
 
 # endif
 #endif
+
+/* Undefine all __need_* constants in case we are included to get those
+   constants but the whole file was already read.  */
+#undef __need_mbstate_t
+#undef __need_wint_t

Modified: fsf/trunk/libc/posix/glob.c
==============================================================================
--- fsf/trunk/libc/posix/glob.c (original)
+++ fsf/trunk/libc/posix/glob.c Sun Mar 28 00:04:39 2010
@@ -436,6 +436,8 @@
 	}
     }
 
+  oldcount = pglob->gl_pathc + pglob->gl_offs;
+
   /* Find the filename.  */
   filename = strrchr (pattern, '/');
 #if defined __MSDOS__ || defined WINDOWS32
@@ -552,8 +554,6 @@
 	  return val;
 	}
     }
-
-  oldcount = pglob->gl_pathc + pglob->gl_offs;
 
 #ifndef VMS
   if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
@@ -1042,9 +1042,9 @@
 	     : (__stat64 (pglob->gl_pathv[i], &st64) == 0
 		&& S_ISDIR (st64.st_mode))))
 	  {
- 	    size_t len = strlen (pglob->gl_pathv[i]) + 2;
+	    size_t len = strlen (pglob->gl_pathv[i]) + 2;
 	    char *new = realloc (pglob->gl_pathv[i], len);
- 	    if (new == NULL)
+	    if (new == NULL)
 	      {
 		globfree (pglob);
 		pglob->gl_pathc = 0;

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/getpagesize.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/getpagesize.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/getpagesize.c Sun Mar 28 00:04:39 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1995-1997,2000,2002,2004
+/* Copyright (C) 1991,1992,1995-1997,2000,2002,2004,2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -17,30 +17,37 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <assert.h>
 #include <unistd.h>
 #include <sys/param.h>
 
 #include <ldsodefs.h>
+#include <kernel-features.h>
 
 /* Return the system page size.  */
 int
 __getpagesize ()
 {
+#ifdef __ASSUME_AT_PAGESIZE
+  assert (GLRO(dl_pagesize) != 0);
+  return GLRO(dl_pagesize);
+#else
   if (GLRO(dl_pagesize) != 0)
     return GLRO(dl_pagesize);
 
-#ifdef	EXEC_PAGESIZE
+# ifdef	EXEC_PAGESIZE
   return EXEC_PAGESIZE;
-#else	/* No EXEC_PAGESIZE.  */
-#ifdef	NBPG
-#ifndef	CLSIZE
-#define	CLSIZE	1
-#endif	/* No CLSIZE.  */
+# else	/* No EXEC_PAGESIZE.  */
+#  ifdef NBPG
+#   ifndef CLSIZE
+#    define CLSIZE	1
+#   endif	/* No CLSIZE.  */
   return NBPG * CLSIZE;
-#else	/* No NBPG.  */
+#  else	/* No NBPG.  */
   return NBPC;
-#endif	/* NBPG.  */
-#endif	/* EXEC_PAGESIZE.  */
+#  endif	/* NBPG.  */
+# endif	/* EXEC_PAGESIZE.  */
+#endif
 }
 libc_hidden_def (__getpagesize)
 weak_alias (__getpagesize, getpagesize)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fcntl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fcntl.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/fcntl.c Sun Mar 28 00:04:39 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2002,2003,2004,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000,2002-2004,2006,2009,2010 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,23 +25,23 @@
 #include <sys/syscall.h>
 #include <kernel-features.h>
 
-#if __ASSUME_FCNTL64 == 0
+#ifndef __ASSUME_FCNTL64
 /* This variable is shared with all files that check for fcntl64.  */
 int __have_no_fcntl64;
 #endif
 
 #ifdef __ASSUME_F_GETOWN_EX
 # define miss_F_GETOWN_EX 0
-#else
+#elif !defined __ASSUME_FCNTL64
 static int miss_F_GETOWN_EX;
 #endif
 
 
-#if defined NO_CANCELLATION && __ASSUME_FCNTL64 == 0
+#if defined NO_CANCELLATION && !defined __ASSUME_FCNTL64
 # define __fcntl_nocancel  __libc_fcntl
 #endif
 
-#if !defined NO_CANCELLATION || __ASSUME_FCNTL64 == 0
+#if !defined NO_CANCELLATION || !defined __ASSUME_FCNTL64
 int
 __fcntl_nocancel (int fd, int cmd, ...)
 {
@@ -52,7 +52,7 @@
   arg = va_arg (ap, void *);
   va_end (ap);
 
-#if __ASSUME_FCNTL64 == 0
+#ifndef __ASSUME_FCNTL64
 # ifdef __NR_fcntl64
   if (! __have_no_fcntl64)
     {
@@ -135,11 +135,11 @@
 	  if (!INTERNAL_SYSCALL_ERROR_P (res, err))
 	    return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
 
-#ifndef __ASSUME_F_GETOWN_EX
+# ifndef __ASSUME_F_GETOWN_EX
 	  if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
 	    miss_F_GETOWN_EX = 1;
 	  else
-#endif
+# endif
 	    {
 	      __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
 	      return -1;
@@ -168,21 +168,21 @@
   arg = va_arg (ap, void *);
   va_end (ap);
 
-#if __ASSUME_FCNTL64 > 0
+# ifdef __ASSUME_FCNTL64
   if (SINGLE_THREAD_P || (cmd != F_SETLKW && cmd != F_SETLKW64))
     return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
 
   int oldtype = LIBC_CANCEL_ASYNC ();
 
   int result = INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
-#else
+# else
   if (SINGLE_THREAD_P || (cmd != F_SETLKW && cmd != F_SETLKW64))
     return __fcntl_nocancel (fd, cmd, arg);
 
   int oldtype = LIBC_CANCEL_ASYNC ();
 
   int result = __fcntl_nocancel (fd, cmd, arg);
-#endif
+# endif
 
   LIBC_CANCEL_RESET (oldtype);
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h Sun Mar 28 00:04:39 2010
@@ -1,6 +1,6 @@
 /* Set flags signalling availability of kernel features based on given
    kernel version number.
-   Copyright (C) 1999-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -65,7 +65,7 @@
 # define __ASSUME_LCHOWN_SYSCALL	1
 #endif
 
-/* When did the `setresuid' sysall became available?  */
+/* When did the `setresuid' syscall became available?  */
 #if __LINUX_KERNEL_VERSION >= 131584 && !defined __sparc__
 # define __ASSUME_SETRESUID_SYSCALL	1
 #endif
@@ -126,7 +126,7 @@
 #endif
 
 /* I know for sure that these are in 2.3.35 on powerpc. But PowerPC64 does not
-   support separate 64-bit syscalls, already 64-bit */
+   support separate 64-bit syscalls, already 64-bit.  */
 #if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ \
     && !defined __powerpc64__
 # define __ASSUME_TRUNCATE64_SYSCALL	1
@@ -158,8 +158,8 @@
 # define __ASSUME_LDT_WORKS		1
 #endif
 
-/* Linux 2.4.0 on PPC introduced a correct IPC64. But PowerPC64 does not
-   support a separate 64-bit sys call, already 64-bit */
+/* Linux 2.4.0 on PPC introduced a correct IPC64.  But PowerPC64 does not
+   support a separate 64-bit syscall, already 64-bit.  */
 #if __LINUX_KERNEL_VERSION >= 132096 && defined __powerpc__ \
     && !defined __powerpc64__
 # define __ASSUME_IPC64			1
@@ -208,7 +208,7 @@
 # define __ASSUME_GETDENTS64_SYSCALL	1
 #endif
 
-/* When did O_DIRECTORY became available?  Early in 2.3 but when?
+/* When did O_DIRECTORY become available?  Early in 2.3 but when?
    Be safe, use 2.3.99.  */
 #if __LINUX_KERNEL_VERSION >= 131939
 # define __ASSUME_O_DIRECTORY		1
@@ -412,7 +412,7 @@
 
 /* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists.  */
 #if __LINUX_KERNEL_VERSION >= 0x020609 && defined __alpha__
-#define __ASSUME_IEEE_RAISE_EXCEPTION	1
+# define __ASSUME_IEEE_RAISE_EXCEPTION	1
 #endif
 
 /* On sparc64 stat64/lstat64/fstat64 syscalls were introduced in 2.6.12.  */