Add first fixes for conformtest for POSIX2008
authorUlrich Drepper <drepper@gmail.com>
Mon, 27 Feb 2012 02:32:56 +0000 (21:32 -0500)
committerUlrich Drepper <drepper@gmail.com>
Mon, 27 Feb 2012 02:32:56 +0000 (21:32 -0500)
20 files changed:
ChangeLog
conform/conformtest.pl
conform/data/limits.h-data
conform/run-conformtest.sh
include/arpa/inet.h
include/bits/dlfcn.h
include/langinfo.h
include/monetary.h
include/sys/poll.h
io/fcntl.h
nptl/ChangeLog
nptl/sysdeps/pthread/pthread.h
posix/spawn.h
posix/sys/wait.h
posix/unistd.h
rt/aio.h
sysdeps/unix/sysv/linux/bits/socket.h
sysdeps/unix/sysv/linux/bits/uio.h
sysdeps/unix/sysv/linux/sparc/bits/socket.h
termios/termios.h

index b522826..a67840a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,29 @@
 2012-02-26  Ulrich Drepper  <drepper@gmail.com>
 
+       * conform/conformtest.pl: XPG7 and POSIX2008 require C99.
+       * conform/data/limits.h-data: Fixes for POSIX2008.
+       * conform/run-conformtest.sh: Run all tests.
+       * include/arpa/inet.h: Changes to allow conformtest.pl to use the
+       headers.
+       * include/bits/dlfcn.h: Likewise.
+       * include/langinfo.h: Likewise.
+       * include/monetary.h: Likewise.
+       * include/sys/poll.h: Likewise.
+
+       * io/fcntl.h: Define AT_NO_AUTOMOUNT and AT_EMPTY_PATH only
+       for __USE_GNU.
+       * posix/spawn.h: Define __need_sigset_t.
+       * posix/sys/wait.h: Don't include <sys/resource.h>, define id_t here.
+       * posix/unistd.h: Declare ctermid only for XPG before XPG6.
+       * rt/aio.h: Don't include fcntl.h and signal.h.  Use bits/siginfo.h
+       to get sigevent_t only.
+       * sysdeps/unix/sysv/linux/bits/socket.h: Declare sendmmsg and recvmmsg
+       only for __USE_GNU.
+       * sysdeps/unix/sysv/linux/sparc/bits/socket.h: Likewise.
+       * sysdeps/unix/sysv/linux/bits/uio.h: Declare process_vm_readv and
+       process_vm_writev only for __USE_GNU.
+       * termios/termios.h: Declare tcgetsid also for POSIX2008.
+
        * conform/Makefile: For now ignore errors from run-conformtest.
        * conform/conformtest.pl: Simplify code.  Add -ansi to CFLAGS for
        POSIX to avoid namespace pollution.  Don't prepend headers.
index fd45a8d..6a78020 100644 (file)
@@ -40,8 +40,8 @@ $CFLAGS{"XPG3"} = "-D_XOPEN_SOURCE";
 $CFLAGS{"XPG4"} = "-D_XOPEN_SOURCE_EXTENDED";
 $CFLAGS{"UNIX98"} = "-D_XOPEN_SOURCE=500";
 $CFLAGS{"XOPEN2K"} = "-D_XOPEN_SOURCE=600";
-$CFLAGS{"XOPEN2K8"} = "-D_XOPEN_SOURCE=700";
-$CFLAGS{"POSIX2008"} = "-D_POSIX_C_SOURCE=200809L";
+$CFLAGS{"XOPEN2K8"} = "-std=c99 -D_XOPEN_SOURCE=700";
+$CFLAGS{"POSIX2008"} = "-std=c99 -D_POSIX_C_SOURCE=200809L";
 
 $CFLAGS = "$flags -fno-builtin '-D__attribute__(x)=' $CFLAGS{$standard} -D_ISOMAC";
 
index 27ae77a..d7c9796 100644 (file)
@@ -87,7 +87,7 @@ constant _POSIX_CLOCKRES_MIN <= 20000000
 optional-constant _POSIX_AIO_LISTIO_MAX        2
 optional-constant _POSIX_AIO_MAX 1
 optional-constant _POSIX_ARG_MAX 4096
-#ifdef XOPEN2K
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
 optional-constant _POSIX_CHILD_MAX 25
 #else
 optional-constant _POSIX_CHILD_MAX 6
@@ -100,12 +100,12 @@ optional-constant _POSIX_MAX_INPUT 255
 optional-constant _POSIX_MQ_OPEN_MAX 8
 optional-constant _POSIX_MQ_PRIO_MAX 32
 optional-constant _POSIX_NAME_MAX 14
-#ifdef XOPEN2K
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
 optional-constant _POSIX_NGROUPS_MAX 8
 #else
 optional-constant _POSIX_NGROUPS_MAX 0
 #endif
-#ifdef XOPEN2K
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
 optional-constant _POSIX_OPEN_MAX 20
 #else
 optional-constant _POSIX_OPEN_MAX 16
index 9600524..d83aa79 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 
 objpfx="$1"
 perl="$2"
@@ -7,8 +7,6 @@ includes="$4"
 
 standards=("ISO" "ISO99" "ISO11" "POSIX" "XPG3" "XPG4" "UNIX98"
           "XOPEN2K" "XOPEN2K8" "POSIX2008")
-standards=("POSIX" "XPG3" "XPG4" "UNIX98"
-          "XOPEN2K" "XOPEN2K8" "POSIX2008")
 
 exitval=0
 > ${objpfx}run-conformtest.out
index dc44341..63ece70 100644 (file)
@@ -1,5 +1,6 @@
 #include <inet/arpa/inet.h>
 
+#ifndef _ISOMAC
 extern int __inet_aton (const char *__cp, struct in_addr *__inp);
 libc_hidden_proto (__inet_aton)
 
@@ -8,3 +9,4 @@ libc_hidden_proto (inet_ntop)
 libc_hidden_proto (inet_pton)
 libc_hidden_proto (inet_makeaddr)
 libc_hidden_proto (inet_netof)
+#endif
index c31a645..47652a1 100644 (file)
@@ -1,3 +1,5 @@
 #include_next <bits/dlfcn.h>
 
+#ifndef _ISOMAC
 libc_hidden_proto (_dl_mcount_wrapper_check)
+#endif
index 37a91c6..d60d7f6 100644 (file)
@@ -2,9 +2,11 @@
 
 #include <locale/langinfo.h>
 
+#ifndef _ISOMAC
 libc_hidden_proto (nl_langinfo)
 
 extern __typeof (nl_langinfo_l) __nl_langinfo_l;
 libc_hidden_proto (__nl_langinfo_l)
+#endif
 
 #endif
index 98b3dbf..e687013 100644 (file)
@@ -1,5 +1,7 @@
 #include <stdlib/monetary.h>
+#ifndef _ISOMAC
 #include <stdarg.h>
 
 extern ssize_t __vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
                             const char *format, va_list ap);
+#endif
index 4285eee..a42bc93 100644 (file)
@@ -1,9 +1,11 @@
 #ifndef        _SYS_POLL_H
 # include <io/sys/poll.h>
 
+#ifndef _ISOMAC
 extern int __poll (struct pollfd *__fds, unsigned long int __nfds,
                   int __timeout);
 libc_hidden_proto (__poll)
 libc_hidden_proto (ppoll)
+#endif
 
 #endif
index a11f823..1192cf5 100644 (file)
@@ -109,9 +109,11 @@ __BEGIN_DECLS
 # define AT_REMOVEDIR          0x200   /* Remove directory instead of
                                           unlinking file.  */
 # define AT_SYMLINK_FOLLOW     0x400   /* Follow symbolic links.  */
-# define AT_NO_AUTOMOUNT       0x800   /* Suppress terminal automount
+# ifdef __USE_GNU
+#  define AT_NO_AUTOMOUNT      0x800   /* Suppress terminal automount
                                           traversal.  */
-# define AT_EMPTY_PATH         0x1000  /* Allow empty relative pathname.  */
+#  define AT_EMPTY_PATH                0x1000  /* Allow empty relative pathname.  */
+# endif
 # define AT_EACCESS            0x200   /* Test access permitted for
                                           effective IDs, not real IDs.  */
 #endif
index 00fc4e4..d376cf0 100644 (file)
@@ -1,5 +1,7 @@
 2012-02-26  Ulrich Drepper  <drepper@gmail.com>
 
+       * sysdeps/pthread/pthread.h: Define __need_clockid_t for __USE_XOPEN2K.
+
        * sysdeps/pthread/pthread.h: Define __need_timespec before including
        <time.h>.
        * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Name pthread_attr_t
index df7445e..0d33cbd 100644 (file)
@@ -21,6 +21,9 @@
 #include <features.h>
 #include <endian.h>
 #include <sched.h>
+#ifdef __USE_XOPEN2K
+# define __need_clockid_t
+#endif
 #define __need_timespec
 #include <time.h>
 
index 36205da..9a82f03 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <features.h>
 #include <sched.h>
+#define __need_sigset_t
 #include <signal.h>
 #include <sys/types.h>
 
index 8983a8f..07d0374 100644 (file)
@@ -137,9 +137,15 @@ extern __pid_t wait (__WAIT_STATUS __stat_loc);
 extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
 
 #if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
-# include <sys/resource.h>
+# ifndef __id_t_defined
+#  include <bits/types.h>
+typedef __id_t id_t;
+#  define __id_t_defined
+# endif
+
 # define __need_siginfo_t
 # include <bits/siginfo.h>
+
 /* Wait for a childing matching IDTYPE and ID to change the status and
    place appropriate information in *INFOP.
    If IDTYPE is P_PID, match any process whose process ID is ID.
index 6f509e9..1f4d645 100644 (file)
@@ -1158,7 +1158,7 @@ extern void swab (const void *__restrict __from, void *__restrict __to,
 
 /* The Single Unix specification demands this prototype to be here.
    It is also found in <stdio.h>.  */
-#if defined __USE_XOPEN || defined __USE_XOPEN2K8
+#if defined __USE_XOPEN && !defined __USE_XOPEN2K
 /* Return the name of the controlling terminal.  */
 extern char *ctermid (char *__s) __THROW;
 #endif
index 8c63159..b0340e3 100644 (file)
--- a/rt/aio.h
+++ b/rt/aio.h
 #define _AIO_H 1
 
 #include <features.h>
-#include <fcntl.h>
-#include <signal.h>
+#include <sys/types.h>
+#define __need_sigevent_t
+#include <bits/siginfo.h>
 #define __need_timespec
 #include <time.h>
-#include <sys/types.h>
 
 __BEGIN_DECLS
 
index e4ae3c2..0b052a4 100644 (file)
@@ -422,6 +422,7 @@ struct linger
 
 __BEGIN_DECLS
 
+#ifdef __USE_GNU
 /* Receive up to VLEN messages as described by VMESSAGES from socket FD.
    Returns the number of bytes read or -1 for errors.
 
@@ -437,6 +438,7 @@ This function is a cancellation point and therefore not marked with
    __THROW.  */
 extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
                     unsigned int __vlen, int __flags);
+#endif
 
 __END_DECLS
 
index 0706845..fd4dff5 100644 (file)
@@ -48,8 +48,10 @@ struct iovec
 
 #endif
 
-#if defined _SYS_UIO_H && !defined _BITS_UIO_H_FOR_SYS_UIO_H
-#define _BITS_UIO_H_FOR_SYS_UIO_H 1
+
+#ifdef __USE_GNU
+# if defined _SYS_UIO_H && !defined _BITS_UIO_H_FOR_SYS_UIO_H
+#  define _BITS_UIO_H_FOR_SYS_UIO_H 1
 
 __BEGIN_DECLS
 
@@ -71,4 +73,5 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
 
 __END_DECLS
 
+# endif
 #endif
index e1fb941..221009e 100644 (file)
@@ -422,6 +422,7 @@ struct linger
 
 __BEGIN_DECLS
 
+#ifdef __USE_GNU
 /* Receive a message as described by MESSAGE from socket FD.
    Returns the number of bytes read or -1 for errors.
 
@@ -430,6 +431,7 @@ __BEGIN_DECLS
 extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
                     unsigned int __vlen, int __flags,
                     const struct timespec *__tmo);
+#endif
 
 __END_DECLS
 
index c42c62c..762e751 100644 (file)
@@ -95,7 +95,7 @@ extern int tcflush (int __fd, int __queue_selector) __THROW;
 extern int tcflow (int __fd, int __action) __THROW;
 
 
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
 /* Get process group ID for session leader for controlling terminal FD.  */
 extern __pid_t tcgetsid (int __fd) __THROW;
 #endif