summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--bits/confname.h4
-rw-r--r--nptl/ChangeLog8
-rw-r--r--nptl/sysdeps/i386/i686/Makefile13
-rw-r--r--posix/getconf.c3
-rw-r--r--sysdeps/generic/bits/confname.h4
-rw-r--r--sysdeps/posix/fpathconf.c7
-rw-r--r--sysdeps/posix/pathconf.c7
-rw-r--r--sysdeps/unix/sysv/linux/fpathconf.c7
-rw-r--r--sysdeps/unix/sysv/linux/linux_fsinfo.h6
-rw-r--r--sysdeps/unix/sysv/linux/pathconf.c7
-rw-r--r--sysdeps/unix/sysv/linux/pathconf.h41
12 files changed, 108 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e2eb34e0e..caaeed936c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2003-03-13  Ulrich Drepper  <drepper@redhat.com>
+
+	* posix/getconf.c: Recognize POSIX2_SYMLINKS.
+	* sysdeps/generic/bits/confname.h: Define _PC_2_SYMLINKS.
+	* sysdeps/posix/fpathconf.c: Handle _PC_2_SYMLINKS.
+	* sysdeps/posix/pathconf.c: Likewise.
+	* sysdeps/unix/sysv/linux/fpathconf.c: Likewise.
+	* sysdeps/unix/sysv/linux/pathconf.c: Likewise.
+	* sysdeps/unix/sysv/linux/pathconf.h: Define statfs_symlinks.
+
+	* sysdeps/unix/sysv/linux/linux_fsinfo.h: Define some more magic
+	words.
+
 2003-03-14  Alexandre Oliva  <aoliva@redhat.com>
 
 	* include/gmp.h: Include/gmp-mparam.h.
diff --git a/bits/confname.h b/bits/confname.h
index 8fecb8a40f..a12edab698 100644
--- a/bits/confname.h
+++ b/bits/confname.h
@@ -62,8 +62,10 @@ enum
 #define _PC_REC_XFER_ALIGN		_PC_REC_XFER_ALIGN
     _PC_ALLOC_SIZE_MIN,
 #define _PC_ALLOC_SIZE_MIN		_PC_ALLOC_SIZE_MIN
-    _PC_SYMLINK_MAX
+    _PC_SYMLINK_MAX,
 #define _PC_SYMLINK_MAX			_PC_SYMLINK_MAX
+    _PC_2_SYMLINKS
+#define _PC_2_SYMLINKS			_PC_2_SYMLINKS
   };
 
 /* Values for the argument to `sysconf'.  */
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 37464db175..c24573a2c4 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,11 @@
+2003-03-13  Ulrich Drepper  <drepper@redhat.com>
+
+	* allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
+	and the size of the stack which must be allocated is a multiple,
+	allocate one more page.
+	* sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
+	MULTI_PAGE_ALIASING.
+
 2003-03-13  Roland McGrath  <roland@redhat.com>
 
 	* pthread_create.c (start_thread): Set EXITING_BIT after the
diff --git a/nptl/sysdeps/i386/i686/Makefile b/nptl/sysdeps/i386/i686/Makefile
index 493a7ec49f..137c0a2f0c 100644
--- a/nptl/sysdeps/i386/i686/Makefile
+++ b/nptl/sysdeps/i386/i686/Makefile
@@ -18,6 +18,15 @@
 # 02111-1307 USA.
 
 ifeq ($(subdir),nptl)
-# For P4 processors we color the stack in 128 bit steps.
-CFLAGS-pthread_create.c += -DCOLORING_INCREMENT=128
+# It turns out that stack coloring is in general not good on P4s.  Some
+# applications will benefit.  We will probably have a configuration option
+# at some point.  Enabling coloring can be done with
+#
+#   -DCOLORING_INCREMENT=128
+#
+# What is useful is to avoid the 64k aliasing problem which reliably
+# happens if all stacks use sizes which are a multiple of 64k.  Tell
+# the stack allocator to disturb this by allocation one more page if
+# necessary.
+CFLAGS-pthread_create.c += -DMULTI_PAGE_ALIASING=65536
 endif
diff --git a/posix/getconf.c b/posix/getconf.c
index e687225434..afe36018ce 100644
--- a/posix/getconf.c
+++ b/posix/getconf.c
@@ -865,6 +865,9 @@ static const struct conf vars[] =
 #ifdef _CS_GNU_LIBPTHREAD_VERSION
     { "GNU_LIBPTHREAD_VERSION", _CS_GNU_LIBPTHREAD_VERSION, CONFSTR },
 #endif
+#ifdef _PC_2_SYMLINKS
+    { "POSIX2_SYMLINKS", _PC_2_SYMLINKS, PATHCONF },
+#endif
 
     { NULL, 0, SYSCONF }
   };
diff --git a/sysdeps/generic/bits/confname.h b/sysdeps/generic/bits/confname.h
index 8fecb8a40f..a12edab698 100644
--- a/sysdeps/generic/bits/confname.h
+++ b/sysdeps/generic/bits/confname.h
@@ -62,8 +62,10 @@ enum
 #define _PC_REC_XFER_ALIGN		_PC_REC_XFER_ALIGN
     _PC_ALLOC_SIZE_MIN,
 #define _PC_ALLOC_SIZE_MIN		_PC_ALLOC_SIZE_MIN
-    _PC_SYMLINK_MAX
+    _PC_SYMLINK_MAX,
 #define _PC_SYMLINK_MAX			_PC_SYMLINK_MAX
+    _PC_2_SYMLINKS
+#define _PC_2_SYMLINKS			_PC_2_SYMLINKS
   };
 
 /* Values for the argument to `sysconf'.  */
diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c
index 642bedaa0c..605cd171d0 100644
--- a/sysdeps/posix/fpathconf.c
+++ b/sysdeps/posix/fpathconf.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1995,1996,1998,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1998,2000,2001,2003
+   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
@@ -229,6 +230,10 @@ __fpathconf (fd, name)
       /* In general there are no limits.  If a system has one it should
 	 overwrite this case.  */
       return -1;
+
+    case _PC_2_SYMLINKS:
+      /* Unix systems generally have symlinks.  */
+      return 1;
     }
 }
 
diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c
index 7e3fd0371c..75c99ee5c0 100644
--- a/sysdeps/posix/pathconf.c
+++ b/sysdeps/posix/pathconf.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1995,1996,1998,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1995,1996,1998,2000,2001,2003
+   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
@@ -225,6 +226,10 @@ __pathconf (const char *path, int name)
       /* In general there are no limits.  If a system has one it should
 	 overwrite this case.  */
       return -1;
+
+    case _PC_2_SYMLINKS:
+      /* Unix systems generally have symlinks.  */
+      return 1;
     }
 }
 
diff --git a/sysdeps/unix/sysv/linux/fpathconf.c b/sysdeps/unix/sysv/linux/fpathconf.c
index 4dd6059974..9eca7175cc 100644
--- a/sysdeps/unix/sysv/linux/fpathconf.c
+++ b/sysdeps/unix/sysv/linux/fpathconf.c
@@ -1,5 +1,5 @@
 /* Get file-specific information about descriptor FD.  Linux version.
-   Copyright (C) 1991,95,96,98,99,2000,2001,2002 Free Software Foundation, Inc.
+   Copyright (C) 1991,1995,1996,1998-2002,2003 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
@@ -38,8 +38,13 @@ __fpathconf (fd, name)
     {
     case _PC_LINK_MAX:
       return statfs_link_max (__fstatfs (fd, &fsbuf), &fsbuf);
+
     case _PC_FILESIZEBITS:
       return statfs_filesize_max (__fstatfs (fd, &fsbuf), &fsbuf);
+
+    case _PC_2_SYMLINKS:
+      return statfs_symlinks (__fstatfs (fd, &fsbuf), &fsbuf);
+
     default:
       return posix_fpathconf (fd, name);
     }
diff --git a/sysdeps/unix/sysv/linux/linux_fsinfo.h b/sysdeps/unix/sysv/linux/linux_fsinfo.h
index 0e67fe7245..d108753085 100644
--- a/sysdeps/unix/sysv/linux/linux_fsinfo.h
+++ b/sysdeps/unix/sysv/linux/linux_fsinfo.h
@@ -1,5 +1,5 @@
 /* Constants from kernel header for various FSes.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998,1999,2000,2001,2002,2003 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
@@ -40,6 +40,9 @@
 /* Constants that identify the `coherent' filesystem.  */
 #define COH_SUPER_MAGIC		0x012ff7b7
 
+/* Constant that identifies the `ramfs' filesystem.  */
+#define CRAMFS_MAGIC		0x28cd3d45
+
 /* Constant that identifies the `devfs' filesystem.  */
 #define DEVFS_SUPER_MAGIC	0x1373
 
@@ -48,6 +51,7 @@
 
 /* Constant that identifies the `efs' filesystem.  */
 #define EFS_SUPER_MAGIC		0x414A53
+#define EFS_MAGIC		0x072959
 
 /* Constant that identifies the `ext2' and `ext3' filesystems.  */
 #define EXT2_SUPER_MAGIC	0xef53
diff --git a/sysdeps/unix/sysv/linux/pathconf.c b/sysdeps/unix/sysv/linux/pathconf.c
index 6115335334..b4886158f3 100644
--- a/sysdeps/unix/sysv/linux/pathconf.c
+++ b/sysdeps/unix/sysv/linux/pathconf.c
@@ -1,5 +1,5 @@
 /* Get file-specific information about a file.  Linux version.
-   Copyright (C) 1991,95,96,98,99,2000,2001,2002 Free Software Foundation, Inc.
+   Copyright (C) 1991,1995,1996,1998-2002,2003 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
@@ -36,8 +36,13 @@ __pathconf (const char *file, int name)
     {
     case _PC_LINK_MAX:
       return statfs_link_max (__statfs (file, &fsbuf), &fsbuf);
+
     case _PC_FILESIZEBITS:
       return statfs_filesize_max (__statfs (file, &fsbuf), &fsbuf);
+
+    case _PC_2_SYMLINKS:
+      return statfs_symlinks (__statfs (file, &fsbuf), &fsbuf);
+
     default:
       return posix_pathconf (file, name);
     }
diff --git a/sysdeps/unix/sysv/linux/pathconf.h b/sysdeps/unix/sysv/linux/pathconf.h
index b7f201d436..80ec8fa4e0 100644
--- a/sysdeps/unix/sysv/linux/pathconf.h
+++ b/sysdeps/unix/sysv/linux/pathconf.h
@@ -1,5 +1,5 @@
 /* Common parts of Linux implementation of pathconf and fpathconf.
-   Copyright (C) 1991,95,96,98,99,2000,2001,2002 Free Software Foundation, Inc.
+   Copyright (C) 1991,1995,1996,1998-2002,2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,8 +22,8 @@
 #include <sys/statfs.h>
 #include "linux_fsinfo.h"
 
-/* Used like: return statfs_link_max (__statfs (name, &buf), &buf); */
 
+/* Used like: return statfs_link_max (__statfs (name, &buf), &buf); */
 static inline long int
 statfs_link_max (int result, const struct statfs *fsbuf)
 {
@@ -75,8 +75,8 @@ statfs_link_max (int result, const struct statfs *fsbuf)
     }
 }
 
-/* Used like: return statfs_filesize_max (__statfs (name, &buf), &buf); */
 
+/* Used like: return statfs_filesize_max (__statfs (name, &buf), &buf); */
 static inline long int
 statfs_filesize_max (int result, const struct statfs *fsbuf)
 {
@@ -114,3 +114,38 @@ statfs_filesize_max (int result, const struct statfs *fsbuf)
       return 32;
     }
 }
+
+
+/* Used like: return statfs_link_max (__statfs (name, &buf), &buf); */
+static inline long int
+statfs_symlinks (int result, const struct statfs *fsbuf)
+{
+  if (result < 0)
+    {
+      if (errno == ENOSYS)
+	/* Not possible, return the default value.  */
+	return 1;
+
+      /* Some error occured.  */
+      return -1;
+    }
+
+  switch (fsbuf->f_type)
+    {
+    case ADFS_SUPER_MAGIC:
+    case BFS_MAGIC:
+    case CRAMFS_MAGIC:
+    case DEVPTS_SUPER_MAGIC:
+    case EFS_SUPER_MAGIC:
+    case EFS_MAGIC:
+    case MSDOS_SUPER_MAGIC:
+    case NTFS_SUPER_MAGIC:
+    case QNX4_SUPER_MAGIC:
+    case ROMFS_SUPER_MAGIC:
+      /* No symlink support.  */
+      return 0;
+
+    default:
+      return 1;
+    }
+}