diff options
Diffstat (limited to 'conform')
54 files changed, 651 insertions, 41 deletions
diff --git a/conform/conformtest.pl b/conform/conformtest.pl index b15656bd60..e594d87972 100644 --- a/conform/conformtest.pl +++ b/conform/conformtest.pl @@ -1,6 +1,7 @@ #! /usr/bin/perl use Getopt::Long; +use POSIX; $CC = "gcc"; @@ -30,7 +31,8 @@ if (@headers == ()) { } if ($dialect ne "ISO" && $dialect ne "POSIX" && $dialect ne "XPG3" - && $dialect ne "XPG4" && $dialect ne "UNIX98" && $dialect ne "XOPEN2K") { + && $dialect ne "XPG4" && $dialect ne "UNIX98" && $dialect ne "XOPEN2K" + && $dialect ne "XOPEN2K8" && $dialect ne "POSIX2008") { die "unknown dialect \"$dialect\""; } @@ -40,6 +42,8 @@ $CFLAGS{"XPG3"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE"; $CFLAGS{"XPG4"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE_EXTENDED"; $CFLAGS{"UNIX98"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE=500"; $CFLAGS{"XOPEN2K"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE=600"; +$CFLAGS{"XOPEN2K8"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_XOPEN_SOURCE=700"; +$CFLAGS{"POSIX2008"} = "-I. -fno-builtin '-D__attribute__(x)=' -D_POSIX_C_SOURCE=200809L"; # These are the ISO C99 keywords. @@ -71,7 +75,10 @@ while ($#knownproblems >= 0) { $isknown{pop (@knownproblems)} = 1; } -$tmpdir = "/tmp"; +$uid = getuid(); +($pwname,$pwpasswd,$pwuid,$pwgid, + $pwquota,$pwcomment,$pwgcos,$pwdir,$pwshell,$pwexpire) = getpwuid($uid); +$tmpdir = "$pwdir"; $verbose = 1; @@ -660,9 +667,6 @@ while ($#headers >= 0) { $maybe_opaque = 1; } - # Remember that this name is allowed. - push @allow, $type; - # Generate a program to test for the availability of this constant. open (TESTFILE, ">$fnamebase.c"); print TESTFILE "$prepend"; @@ -690,9 +694,6 @@ while ($#headers >= 0) { $maybe_opaque = 1; } - # Remember that this name is allowed. - push @allow, $type; - # Generate a program to test for the availability of this type. open (TESTFILE, ">$fnamebase.c"); print TESTFILE "$prepend"; @@ -706,6 +707,27 @@ while ($#headers >= 0) { compiletest ($fnamebase, "Testing for type $type", "Type \"$type\" not available.", $missing, 0); + } elsif (/^tag *({([^}]*)|([a-zA-Z0-9_]*))/) { + my($type) = "$2$3"; + + # Remember that this name is allowed. + if ($type =~ /^struct *(.*)/) { + push @allow, $1; + } elsif ($type =~ /^union *(.*)/) { + push @allow, $1; + } else { + push @allow, $type; + } + + # Generate a program to test for the availability of this type. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "$type;\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Testing for type $type", + "Type \"$type\" not available.", $missing, 0); } elsif (/^optional-function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) { my($rettype) = "$2$3"; my($fname) = "$4"; diff --git a/conform/data/ctype.h-data b/conform/data/ctype.h-data index 7454bd3288..d082230f94 100644 --- a/conform/data/ctype.h-data +++ b/conform/data/ctype.h-data @@ -12,7 +12,7 @@ function int isxdigit (int) function int tolower (int) function int toupper (int) -#ifndef ISO +#if !defined ISO && !defined POSIX && !defined POSIX2008 function int isascii (int) function int toascii (int) @@ -26,4 +26,22 @@ allow is* allow to* allow *_t + +# if defined XOPEN2K8 || defined XOPEN2K8 || defined POSIX2008 +type locale_t + +function int isalnum_l (int, locale_t) +function int isalpha_l (int, locale_t) +function int iscntrl_l (int, locale_t) +function int isdigit_l (int, locale_t) +function int isgraph_l (int, locale_t) +function int islower_l (int, locale_t) +function int isprint_l (int, locale_t) +function int ispunct_l (int, locale_t) +function int isspace_l (int, locale_t) +function int isupper_l (int, locale_t) +function int isxdigit_l (int, locale_t) +function int tolower_l (int, locale_t) +function int toupper_l (int, locale_t) +# endif #endif diff --git a/conform/data/dirent.h-data b/conform/data/dirent.h-data index e496dab0dd..761d5786b5 100644 --- a/conform/data/dirent.h-data +++ b/conform/data/dirent.h-data @@ -3,7 +3,9 @@ type DIR type {struct dirent} +# if !defined POSIX && !defined POSIX2008 element {struct dirent} ino_t d_ino +# endif element {struct dirent} char d_name [] type ino_t @@ -13,9 +15,18 @@ function {DIR*} opendir (const char*) function {struct dirent*} readdir (DIR*) function int readdir_r (DIR*, struct dirent*, struct dirent**) function void rewinddir (DIR*) +# if !defined POSIX && !defined POSIX2008 function void seekdir (DIR*, long int) function {long int} telldir (DIR*) +# endif allow d_* allow *_t + +# if defined XOPEN2K8 || defined POSIX2008 +function int alphasort (const struct dirent**, const struct dirent**) +function int dirfd (DIR*) +function int scandir (const char*, struct dirent***, int(*)(const struct dirent*), int(*)(const struct dirent**,const struct dirent **)) +function {DIR*} fdopendir (int) +# endif #endif diff --git a/conform/data/errno.h-data b/conform/data/errno.h-data index 67225248a2..ffdf6b5c4d 100644 --- a/conform/data/errno.h-data +++ b/conform/data/errno.h-data @@ -79,6 +79,11 @@ constant ETXTBSY constant EWOULDBLOCK constant EXDEV +# if defined XOPEN2K8 || defined POSIX2008 +constant ENOTRECOVERABLE +constant EOWNERDEAD +# endif + // variable int errno allow errno diff --git a/conform/data/fcntl.h-data b/conform/data/fcntl.h-data index c8caf0360f..7769a446dd 100644 --- a/conform/data/fcntl.h-data +++ b/conform/data/fcntl.h-data @@ -60,9 +60,11 @@ constant S_IWOTH constant S_IXOTH constant S_ISUID constant S_ISGID +#if !defined POSIX && !defined POSIX2008 constant S_ISVTX +#endif -#ifdef XOPEN2K +#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 constant POSIX_FADV_NORMAL constant POSIX_FADV_SEQUENTIAL constant POSIX_FADV_RANDOM @@ -86,11 +88,32 @@ type pid_t function int creat (const char*, mode_t) function int fcntl (int, int, ...) function int open (const char*, int, ...) -#ifdef XOPEN2K +#if defined XOPEN2K8 || defined POSIX2008 +function int openat (int, const char*, int, ...) +#endif +#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 function int posix_fadvise (int, off_t, off_t, int) function int posix_fallocate (int, off_t, off_t) #endif +#if defined XOPEN2K8 || defined POSIX2008 +constant O_TTY_INIT +constant O_CLOEXEC +constant O_EXEC +constant O_SEARCH +constant O_DIRECTORY +constant O_NOFOLLOW +constant FD_CLOEXEC +constant F_DUPFD_CLOEXEC +constant AT_FDCWD +constant AT_EACCESS +constant AT_SYMLINK_NOFOLLOW +constant AT_SYMLINK_FOLLOW +constant AT_REMOVEDIR + +function int openat(int, const char*, int, ...) +#endif + allow-header sys/stat.h allow-header unistd.h @@ -99,4 +122,8 @@ allow F_* allow O_* allow S_* allow *_t + +allow timespec +allow tv_nsec +allow tv_sec #endif diff --git a/conform/data/fmtmsg.h-data b/conform/data/fmtmsg.h-data index da1ed65ac4..67c35c1c93 100644 --- a/conform/data/fmtmsg.h-data +++ b/conform/data/fmtmsg.h-data @@ -1,4 +1,4 @@ -#if !defined ISO && !defined POSIX +#if !defined ISO && !defined POSIX && !defined POSIX2008 macro MM_HARD constant MM_HARD diff --git a/conform/data/fnmatch.h-data b/conform/data/fnmatch.h-data index ef34fc4e04..96591d6d43 100644 --- a/conform/data/fnmatch.h-data +++ b/conform/data/fnmatch.h-data @@ -3,7 +3,9 @@ constant FNM_NOMATCH constant FNM_PATHNAME constant FNM_PERIOD constant FNM_NOESCAPE +#if !defined XOPEN2K8 && !defined POSIX2008 constant FNM_NOSYS +#endif function int fnmatch (const char*, const char*, int) diff --git a/conform/data/ftw.h-data b/conform/data/ftw.h-data index 81c50070d1..eb499243a5 100644 --- a/conform/data/ftw.h-data +++ b/conform/data/ftw.h-data @@ -1,4 +1,4 @@ -#if !defined ISO && !defined POSIX +#if !defined ISO && !defined POSIX && !defined POSIX2008 type {struct FTW} element {struct FTW} int base element {struct FTW} int level diff --git a/conform/data/glob.h-data b/conform/data/glob.h-data index 221a3154cb..9f90f8b84b 100644 --- a/conform/data/glob.h-data +++ b/conform/data/glob.h-data @@ -15,7 +15,9 @@ constant GLOB_NOSORT constant GLOB_ABORTED constant GLOB_NOMATCH constant GLOB_NOSPACE +# if !defined XOPEN2K8 && !defined POSIX2008 constant GLOB_NOSYS +# endif function int glob (const char*, int, int (*) (const char*, int), glob_t*) function void globfree (glob_t *) diff --git a/conform/data/grp.h-data b/conform/data/grp.h-data index 91401b31d9..16519506e5 100644 --- a/conform/data/grp.h-data +++ b/conform/data/grp.h-data @@ -7,6 +7,9 @@ element {struct group} {char**} gr_mem # ifndef POSIX type gid_t # endif +# if defined XOPEN2K8 || defined POSIX2008 +type size_t +# endif function {struct group*} getgrgid (gid_t) function {struct group*} getgrnam (const char*) @@ -15,7 +18,9 @@ function int getgrgid_r (gid_t, struct group*, char *, size_t, struct group**) function int getgrnam_r (const char *, struct group *, char *, size_t, struct group**) function {struct group*} getgrent (void) function void endgrent (void) +# ifndef POSIX2008 function void setgrent (void) +# endif # endif allow gr_* diff --git a/conform/data/iconv.h-data b/conform/data/iconv.h-data index f1e2ea0527..7071d90f60 100644 --- a/conform/data/iconv.h-data +++ b/conform/data/iconv.h-data @@ -1,5 +1,8 @@ #if !defined ISO && !defined POSIX type iconv_t +# if defined XOPEN2K8 || defined POSIX2008 +type size_t +# endif function iconv_t iconv_open (const char*, const char*) function size_t iconv (iconv_t, char**, size_t*, char**, size_t*) |
