Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 27 Nov 2004 22:47:48 +0000 (22:47 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 27 Nov 2004 22:47:48 +0000 (22:47 +0000)
* posix/Makefile (tests): Add tst-sysconf.
* posix/tst-sysconf.c: New file.

14 files changed:
ChangeLog
linuxthreads/ChangeLog
linuxthreads/sysdeps/unix/sysv/linux/bits/posix_opt.h
linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
linuxthreads/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
localedata/README
nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
nptl/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h
nptl/sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h
nptl/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h
posix/Makefile
posix/tst-sysconf.c [new file with mode: 0644]

index c85a1bd..e3b74a3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-11-27  Ulrich Drepper  <drepper@redhat.com>
 
+       * posix/Makefile (tests): Add tst-sysconf.
+       * posix/tst-sysconf.c: New file.
+
        * posix/getconf.c (vars): Add support for _SC_IPV6 and
        _SC_RAW_SOCKETS.
        * sysdeps/posix/sysconf.c (__sysconf): Add support for _SC_IPV6
index 3c797fe..3a0af11 100644 (file)
@@ -1,3 +1,12 @@
+2004-11-27  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
+       _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
+       _POSIX_THREAD_PRIO_PROTECT): Define.
+       * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
+
 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
index 23d3546..23baba8 100644 (file)
@@ -93,6 +93,8 @@
 #define _POSIX_ASYNC_IO                1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO   1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO  200112L
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO 1
 /* Raw socket support is available.  */
 #define _POSIX_RAW_SOCKETS     200112L
 
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM      200112L
+
 /* Neither process nor thread sporadic server interfaces is available.  */
 #define _POSIX_SPORADIC_SERVER -1
 #define _POSIX_THREAD_SPORADIC_SERVER  -1
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS    -1
 
+/* No support for priority inheritance or protection.  */
+#define _POSIX_THREAD_PRIO_INHERIT     -1
+#define _POSIX_THREAD_PRIO_PROTECT     -1
+
 #endif /* posix_opt.h */
index 883cb38..a9b9f09 100644 (file)
@@ -93,6 +93,8 @@
 #define _POSIX_ASYNC_IO                1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO   1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO  200112L
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO 1
 /* Raw socket support is available.  */
 #define _POSIX_RAW_SOCKETS     200112L
 
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM      200112L
+
 /* Neither process nor thread sporadic server interfaces is available.  */
 #define _POSIX_SPORADIC_SERVER -1
 #define _POSIX_THREAD_SPORADIC_SERVER  -1
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS    -1
 
+/* No support for priority inheritance or protection.  */
+#define _POSIX_THREAD_PRIO_INHERIT     -1
+#define _POSIX_THREAD_PRIO_PROTECT     -1
+
 #endif /* posix_opt.h */
index 5a6629b..95728c1 100644 (file)
@@ -93,6 +93,8 @@
 #define _POSIX_ASYNC_IO                1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO   1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO  200112L
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO 1
 /* Raw socket support is available.  */
 #define _POSIX_RAW_SOCKETS     200112L
 
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM      200112L
+
 /* Neither process nor thread sporadic server interfaces is available.  */
 #define _POSIX_SPORADIC_SERVER -1
 #define _POSIX_THREAD_SPORADIC_SERVER  -1
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS    -1
 
+/* No support for priority inheritance or protection.  */
+#define _POSIX_THREAD_PRIO_INHERIT     -1
+#define _POSIX_THREAD_PRIO_PROTECT     -1
+
 #endif /* posix_opt.h */
index c7c1b93..8973bc8 100644 (file)
@@ -93,6 +93,8 @@
 #define _POSIX_ASYNC_IO                1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO   1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO  200112L
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO 1
 /* Raw socket support is available.  */
 #define _POSIX_RAW_SOCKETS     200112L
 
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM      200112L
+
 /* Neither process nor thread sporadic server interfaces is available.  */
 #define _POSIX_SPORADIC_SERVER -1
 #define _POSIX_THREAD_SPORADIC_SERVER  -1
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS    -1
 
+/* No support for priority inheritance or protection.  */
+#define _POSIX_THREAD_PRIO_INHERIT     -1
+#define _POSIX_THREAD_PRIO_PROTECT     -1
+
 #endif /* posix_opt.h */
index 8ce09c1..f05bf15 100644 (file)
@@ -2,8 +2,8 @@
                                  and
                    POSIX character set descriptions
 
-Ulrich Drepper                 Time-stamp: <2000/07/20 13:08:24 aj>
-drepper@cygnus.com
+Ulrich Drepper                 Time-stamp: <2004/11/27 13:06:54 drepper>
+drepper@redhat.com
 
 
 This directory contains the data needed to build the locale data files
@@ -40,22 +40,9 @@ current directory simply use
 How to use these data files is described in the GNU libc manual,
 especially in the section describing the `setlocale' function.
 
+All problems should be reported using
 
-The files contained here were originally from
-
-       ftp://dkuug.dk/i18n/WG15-collection
-
-Keld Jörn Simonsen from the Danish Unix User Group maintains this
-archive on behalf of the POSIX working groups.  When you find some wrong
-data or want to add something please contact
-
-       Keld Jörn Simonsen <keld@dkuug.dk>
-and
-       Ulrich Drepper <drepper@cygnus.com>
-
-Please make sure your corrections are relative to the originally
-distributed files.  Consult the CHECKSUMS file which contains the MD5
-sums for all data files.
+  http://sources.redhat.com/bugzilla/
 
 
 One more note: the `POSIX' locale definition is not meant to be used
index 902cbbf..4b2c1db 100644 (file)
@@ -1,3 +1,12 @@
+2004-11-27  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_PRIORITIZED_IO,
+       _POSIX2_CHAR_TERM, _POSIX_THREAD_PRIO_INHERIT,
+       _POSIX_THREAD_PRIO_PROTECT): Define.
+       * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
+
 2004-11-26  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_ADVISORY_INFO,
index b922d37..a32197e 100644 (file)
@@ -90,6 +90,8 @@
 #define _POSIX_ASYNC_IO                1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO   1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO  200112L
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO 1
 /* Raw socket support is available.  */
 #define _POSIX_RAW_SOCKETS     200112L
 
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM      200112L
+
 /* Neither process nor thread sporadic server interfaces is available.  */
 #define _POSIX_SPORADIC_SERVER -1
 #define _POSIX_THREAD_SPORADIC_SERVER  -1
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS    -1
 
+/* No support for priority inheritance or protection so far.  */
+#define _POSIX_THREAD_PRIO_INHERIT     -1
+#define _POSIX_THREAD_PRIO_PROTECT     -1
+
 #endif /* posix_opt.h */
index 7ea6bde..f46b381 100644 (file)
@@ -90,6 +90,8 @@
 #define _POSIX_ASYNC_IO                1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO   1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO  200112L
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO 1
 /* Raw socket support is available.  */
 #define _POSIX_RAW_SOCKETS     200112L
 
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM      200112L
+
 /* Neither process nor thread sporadic server interfaces is available.  */
 #define _POSIX_SPORADIC_SERVER -1
 #define _POSIX_THREAD_SPORADIC_SERVER  -1
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS    -1
 
+/* No support for priority inheritance or protection so far.  */
+#define _POSIX_THREAD_PRIO_INHERIT     -1
+#define _POSIX_THREAD_PRIO_PROTECT     -1
+
 #endif /* posix_opt.h */
index 7ea6bde..f46b381 100644 (file)
@@ -90,6 +90,8 @@
 #define _POSIX_ASYNC_IO                1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO   1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO  200112L
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO 1
 /* Raw socket support is available.  */
 #define _POSIX_RAW_SOCKETS     200112L
 
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM      200112L
+
 /* Neither process nor thread sporadic server interfaces is available.  */
 #define _POSIX_SPORADIC_SERVER -1
 #define _POSIX_THREAD_SPORADIC_SERVER  -1
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS    -1
 
+/* No support for priority inheritance or protection so far.  */
+#define _POSIX_THREAD_PRIO_INHERIT     -1
+#define _POSIX_THREAD_PRIO_PROTECT     -1
+
 #endif /* posix_opt.h */
index 7ea6bde..f46b381 100644 (file)
@@ -90,6 +90,8 @@
 #define _POSIX_ASYNC_IO                1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO   1
+/* Support for prioritization is also available.  */
+#define _POSIX_PRIORITIZED_IO  200112L
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO 1
 /* Raw socket support is available.  */
 #define _POSIX_RAW_SOCKETS     200112L
 
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM      200112L
+
 /* Neither process nor thread sporadic server interfaces is available.  */
 #define _POSIX_SPORADIC_SERVER -1
 #define _POSIX_THREAD_SPORADIC_SERVER  -1
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS    -1
 
+/* No support for priority inheritance or protection so far.  */
+#define _POSIX_THREAD_PRIO_INHERIT     -1
+#define _POSIX_THREAD_PRIO_PROTECT     -1
+
 #endif /* posix_opt.h */
index faee4bb..bdd3e71 100644 (file)
@@ -83,7 +83,7 @@ tests         := tstgetopt testfnm runtests runptests      \
                   tst-nice tst-nanosleep tst-regex2 \
                   transbug tst-rxspencer tst-pcre tst-boost \
                   bug-ga1 tst-vfork1 tst-vfork2 tst-waitid \
-                  tst-getaddrinfo2 bug-glob1 bug-glob2
+                  tst-getaddrinfo2 bug-glob1 bug-glob2 tst-sysconf
 xtests         := bug-ga2
 ifeq (yes,$(build-shared))
 test-srcs      := globtest
diff --git a/posix/tst-sysconf.c b/posix/tst-sysconf.c
new file mode 100644 (file)
index 0000000..e9ff06a
--- /dev/null
@@ -0,0 +1,114 @@
+#include <stdbool.h>
+#include <stdio.h>
+#include <unistd.h>
+
+static struct
+{
+  long int _P_val;
+  const char *name;
+  int _SC_val;
+  bool positive;
+  bool posix2;
+} posix_options[] =
+  {
+#define N_(name, pos) { _POSIX_##name, #name, _SC_##name, pos, false }
+#define NP(name) N_ (name, true)
+#define N(name) N_ (name, false)
+#define N2(name) { _POSIX2_##name, #name, _SC_2_##name, false, true }
+    N (ADVISORY_INFO),
+    N (ASYNCHRONOUS_IO),
+    N (BARRIERS),
+    N (CLOCK_SELECTION),
+    N (CPUTIME),
+    N (FSYNC),
+    N (IPV6),
+    NP (JOB_CONTROL),
+    N (MAPPED_FILES),
+    N (MEMLOCK),
+    N (MEMLOCK_RANGE),
+    N (MEMORY_PROTECTION),
+    N (MESSAGE_PASSING),
+    N (MONOTONIC_CLOCK),
+    N (PRIORITIZED_IO),
+    N (PRIORITY_SCHEDULING),
+    N (RAW_SOCKETS),
+    N (READER_WRITER_LOCKS),
+    N (REALTIME_SIGNALS),
+    NP (REGEXP),
+    NP (SAVED_IDS),
+    N (SEMAPHORES),
+    N (SHARED_MEMORY_OBJECTS),
+    NP (SHELL),
+    N (SPAWN),
+    N (SPIN_LOCKS),
+    N (SPORADIC_SERVER),
+    N (SYNCHRONIZED_IO),
+    N (THREAD_ATTR_STACKADDR),
+    N (THREAD_ATTR_STACKSIZE),
+    N (THREAD_CPUTIME),
+    N (THREAD_PRIO_INHERIT),
+    N (THREAD_PRIO_PROTECT),
+    N (THREAD_PRIORITY_SCHEDULING),
+    N (THREAD_PROCESS_SHARED),
+    N (THREAD_SAFE_FUNCTIONS),
+    N (THREAD_SPORADIC_SERVER),
+    N (THREADS),
+    N (TIMEOUTS),
+    N (TIMERS),
+    N (TRACE),
+    N (TRACE_EVENT_FILTER),
+    N (TRACE_INHERIT),
+    N (TRACE_LOG),
+    N (TYPED_MEMORY_OBJECTS),
+    N2 (C_BIND),
+    N2 (C_DEV),
+    N2 (CHAR_TERM)
+  };
+#define nposix_options (sizeof (posix_options) / sizeof (posix_options[0]))
+
+static int
+do_test (void)
+{
+  int result = 0;
+
+  for (int i = 0; i < nposix_options; ++i)
+    {
+      long int scret = sysconf (posix_options[i]._SC_val);
+
+      if (scret == 0)
+       {
+         printf ("sysconf(_SC_%s%s) returned zero\n",
+                 posix_options[i].posix2 ? "2_" : "", posix_options[i].name);
+         result = 1;
+       }
+      if (posix_options[i]._P_val != 0 && posix_options[i]._P_val != scret)
+       {
+         printf ("sysconf(_SC_%s%s) = %ld does not match _POSIX%s_%s = %ld\n",
+                 posix_options[i].posix2 ? "2_" : "", posix_options[i].name,
+                 scret,
+                 posix_options[i].posix2 ? "2" : "", posix_options[i].name,
+                 posix_options[i]._P_val);
+         result = 1;
+       }
+      else if (posix_options[i].positive && scret < 0)
+       {
+         printf ("sysconf(_SC_%s%s) must be > 0\n",
+                 posix_options[i].posix2 ? "2_" : "", posix_options[i].name);
+         result = 1;
+       }
+
+#define STDVER 200112L
+      if (scret > 0 && scret != STDVER && !posix_options[i].positive)
+       {
+         printf ("sysconf(_SC_%s%s) must be %ldL\n",
+                 posix_options[i].posix2 ? "2_" : "", posix_options[i].name,
+                 STDVER);
+         result = 1;
+       }
+    }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"