diff options
Diffstat (limited to 'REORG.TODO/conform')
93 files changed, 7624 insertions, 0 deletions
diff --git a/REORG.TODO/conform/GlibcConform.pm b/REORG.TODO/conform/GlibcConform.pm new file mode 100644 index 0000000000..fbe65b5cb4 --- /dev/null +++ b/REORG.TODO/conform/GlibcConform.pm @@ -0,0 +1,74 @@ +#!/usr/bin/perl + +# Shared code for glibc conformance tests. + +# Copyright (C) 2014-2017 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 +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# <http://www.gnu.org/licenses/>. + +package GlibcConform; +require Exporter; +@ISA = qw(Exporter); +@EXPORT = qw(%CFLAGS list_exported_functions); + +# Compiler options for each standard. +$CFLAGS{"ISO"} = "-ansi"; +$CFLAGS{"ISO99"} = "-std=c99"; +$CFLAGS{"ISO11"} = "-std=c11"; +$CFLAGS{"POSIX"} = "-D_POSIX_C_SOURCE=199506L -ansi"; +$CFLAGS{"XPG4"} = "-ansi -D_XOPEN_SOURCE"; +$CFLAGS{"XPG42"} = "-ansi -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED"; +$CFLAGS{"UNIX98"} = "-ansi -D_XOPEN_SOURCE=500"; +$CFLAGS{"XOPEN2K"} = "-std=c99 -D_XOPEN_SOURCE=600"; +$CFLAGS{"XOPEN2K8"} = "-std=c99 -D_XOPEN_SOURCE=700"; +$CFLAGS{"POSIX2008"} = "-std=c99 -D_POSIX_C_SOURCE=200809L"; + +# Return a list of functions exported by a header, empty if an include +# of the header does not compile. +sub list_exported_functions { + my ($cc, $standard, $header, $tmpdir) = @_; + my ($cc_all) = "$cc -D_ISOMAC $CFLAGS{$standard}"; + my ($tmpfile) = "$tmpdir/list-$$.c"; + my ($auxfile) = "$tmpdir/list-$$.c.aux"; + my ($ret); + my (%res) = (); + open (TMPFILE, ">$tmpfile") || die ("open $tmpfile: $!\n"); + print TMPFILE "#include <$header>\n"; + close (TMPFILE) || die ("close $tmpfile: $!\n"); + $ret = system "$cc_all -c $tmpfile -o /dev/null -aux-info $auxfile > /dev/null"; + unlink ($tmpfile) || die ("unlink $tmpfile: $!\n"); + if ($ret != 0) { + return; + } + open (AUXFILE, "<$auxfile") || die ("open $auxfile: $!\n"); + while (<AUXFILE>) { + s|/\*.*?\*/||g; + if (/^\s*$/) { + next; + } + # The word before a '(' that isn't '(*' is the function name + # before the argument list (not fully general, but sufficient for + # -aux-info output on standard headers). + if (/(\w+)\s*\([^*]/) { + $res{$1} = 1; + } else { + die ("couldn't parse -aux-info output: $_\n"); + } + } + close (AUXFILE) || die ("close $auxfile: $!\n"); + unlink ($auxfile) || die ("unlink $auxfile: $!\n"); + return sort keys %res; +} diff --git a/REORG.TODO/conform/Makefile b/REORG.TODO/conform/Makefile new file mode 100644 index 0000000000..63556b5bdb --- /dev/null +++ b/REORG.TODO/conform/Makefile @@ -0,0 +1,259 @@ +# Copyright (C) 1999-2017 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 +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# <http://www.gnu.org/licenses/>. + +# +# Sub-makefile for conform portion of the library. +# +subdir := conform + +include ../Makeconfig + +conformtest-headers-data := $(wildcard data/*.h-data) \ + $(wildcard data/*/*.h-data) + +conformtest-standards := ISO ISO99 ISO11 POSIX XPG4 XPG42 UNIX98 XOPEN2K \ + POSIX2008 XOPEN2K8 + +conformtest-headers-ISO := assert.h ctype.h errno.h float.h limits.h locale.h \ + math.h setjmp.h signal.h stdarg.h stddef.h stdio.h \ + stdlib.h string.h time.h +conformtest-headers-ISO99 := $(conformtest-headers-ISO) complex.h fenv.h \ + inttypes.h iso646.h stdbool.h stdint.h tgmath.h \ + wchar.h wctype.h +# Missing ISO11 expectations for: stdatomic.h threads.h. +conformtest-headers-ISO11 := $(conformtest-headers-ISO99) stdalign.h \ + stdnoreturn.h uchar.h +conformtest-headers-POSIX := $(conformtest-headers-ISO) aio.h dirent.h \ + fcntl.h fnmatch.h glob.h grp.h mqueue.h \ + pthread.h pwd.h regex.h sched.h semaphore.h \ + sys/mman.h sys/stat.h sys/times.h sys/types.h \ + sys/utsname.h sys/wait.h tar.h termios.h \ + unistd.h utime.h wordexp.h +# Missing XPG4 expectations for: regexp.h wchar.h. +conformtest-headers-XPG4 := $(conformtest-headers-ISO) cpio.h dirent.h \ + fcntl.h fnmatch.h ftw.h glob.h grp.h iconv.h \ + langinfo.h monetary.h nl_types.h pwd.h regex.h \ + search.h sys/ipc.h sys/msg.h sys/sem.h sys/shm.h \ + sys/stat.h sys/times.h sys/types.h sys/utsname.h \ + sys/wait.h tar.h termios.h ulimit.h unistd.h \ + utime.h varargs.h wordexp.h +# Missing XPG42 expectations for: re_comp.h regexp.h wchar.h. +# XPG42 includes XTI, but xti.h is outside the scope of these tests. +conformtest-headers-XPG42 := $(conformtest-headers-XPG4) arpa/inet.h fmtmsg.h \ + libgen.h ndbm.h netdb.h netinet/in.h poll.h \ + strings.h stropts.h sys/mman.h sys/resource.h \ + sys/socket.h sys/statvfs.h sys/time.h sys/timeb.h \ + sys/uio.h sys/un.h syslog.h ucontext.h utmpx.h +# Missing UNIX98 expectations for: inttypes.h re_comp.h regexp.h. +# The online UNIX98 includes XCURSES, but curses.h, term.h and +# unctrl.h are outside the scope of these tests. It also includes +# XTI, but xti.h is outside the scope of these tests. +conformtest-headers-UNIX98 := $(conformtest-headers-POSIX) arpa/inet.h cpio.h \ + dlfcn.h fmtmsg.h ftw.h iconv.h iso646.h \ + langinfo.h libgen.h monetary.h ndbm.h netdb.h \ + netinet/in.h nl_types.h poll.h search.h \ + strings.h stropts.h sys/ipc.h sys/msg.h \ + sys/resource.h sys/sem.h sys/shm.h sys/socket.h \ + sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \ + sys/un.h syslog.h ucontext.h ulimit.h utmpx.h \ + varargs.h wchar.h wctype.h +# Missing XOPEN2K expectations for: trace.h. +conformtest-headers-XOPEN2K := $(conformtest-headers-POSIX) arpa/inet.h \ + complex.h cpio.h dlfcn.h fenv.h fmtmsg.h ftw.h \ + iconv.h inttypes.h iso646.h langinfo.h \ + libgen.h monetary.h ndbm.h net/if.h netdb.h \ + netinet/in.h netinet/tcp.h nl_types.h poll.h \ + search.h spawn.h stdbool.h stdint.h strings.h \ + stropts.h sys/ipc.h sys/msg.h sys/resource.h \ + sys/select.h sys/sem.h sys/shm.h sys/socket.h \ + sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \ + sys/un.h syslog.h tgmath.h ucontext.h ulimit.h \ + utmpx.h wchar.h wctype.h +# Missing POSIX2008 expectations for: trace.h. +conformtest-headers-POSIX2008 := $(conformtest-headers-POSIX) arpa/inet.h \ + complex.h cpio.h dlfcn.h fenv.h iconv.h \ + inttypes.h iso646.h langinfo.h monetary.h \ + net/if.h netdb.h netinet/in.h netinet/tcp.h \ + nl_types.h poll.h spawn.h stdbool.h stdint.h \ + strings.h stropts.h sys/select.h \ + sys/socket.h sys/statvfs.h sys/un.h tgmath.h \ + wchar.h wctype.h +# Missing XOPEN2K8 expectations for: trace.h. +conformtest-headers-XOPEN2K8 := $(conformtest-headers-POSIX2008) fmtmsg.h \ + ftw.h libgen.h ndbm.h search.h sys/ipc.h \ + sys/msg.h sys/resource.h sys/sem.h sys/shm.h \ + sys/time.h sys/uio.h syslog.h ulimit.h utmpx.h + +conformtest-header-list-base := $(foreach std,$(conformtest-standards),\ + header-list-$(std).out) +conformtest-header-list-tests := $(addprefix $(objpfx),\ + $(conformtest-header-list-base)) +tests-special += $(conformtest-header-list-tests) +generated += $(conformtest-header-list-base) + +conformtest-header-base := $(foreach std,\ + $(conformtest-standards),\ + $(foreach h,\ + $(conformtest-headers-$(std)),\ + $(std)/$(h)/conform.out)) +conformtest-header-tests := $(addprefix $(objpfx),$(conformtest-header-base)) +ifneq (yes,$(fast-check)) +tests-special += $(conformtest-header-tests) +generated += $(conformtest-header-base) +endif + +linknamespace-symlists-base := $(foreach std,$(conformtest-standards),\ + symlist-$(std)) +linknamespace-symlists-tests := $(addprefix $(objpfx),\ + $(linknamespace-symlists-base)) +tests-special += $(linknamespace-symlists-tests) + +linknamespace-symlist-stdlibs-base := $(foreach std,$(conformtest-standards),\ + symlist-stdlibs-$(std)) +linknamespace-symlist-stdlibs-tests := \ + $(addprefix $(objpfx),\ + $(linknamespace-symlist-stdlibs-base)) + +tests-special += $(linknamespace-symlist-stdlibs-tests) + +linknamespace-header-base := $(foreach std,\ + $(conformtest-standards),\ + $(foreach h,\ + $(conformtest-headers-$(std)),\ + $(std)/$(h)/linknamespace.out)) +linknamespace-header-tests := $(addprefix $(objpfx),\ + $(linknamespace-header-base)) +tests-special += $(linknamespace-header-tests) + +include ../Rules + +$(conformtest-header-list-tests): $(objpfx)header-list-%.out: \ + check-header-lists.sh \ + $(conformtest-headers-data) + $(SHELL) $< "$*" "$(CC)" "$(strip $(conformtest-headers-$*))" \ + "$(conformtest-headers-data)" > $@; \ + $(evaluate-test) + +# Pre-standard C feature no longer supported by GCC (obsoleted in +# newer POSIX standards). +test-xfail-XPG4/varargs.h/conform = yes +test-xfail-XPG42/varargs.h/conform = yes +test-xfail-UNIX98/varargs.h/conform = yes + +# Header not provided by glibc. +test-xfail-XPG42/ndbm.h/conform = yes +test-xfail-UNIX98/ndbm.h/conform = yes +test-xfail-XOPEN2K/ndbm.h/conform = yes +test-xfail-XOPEN2K8/ndbm.h/conform = yes + +# Unsorted expected failures. +test-xfail-XPG4/signal.h/conform = yes +test-xfail-XPG4/sys/wait.h/conform = yes +test-xfail-XPG42/signal.h/conform = yes +test-xfail-XPG42/sys/wait.h/conform = yes +test-xfail-XPG42/ucontext.h/conform = yes +test-xfail-POSIX/sys/wait.h/conform = yes +test-xfail-UNIX98/signal.h/conform = yes +test-xfail-UNIX98/sys/wait.h/conform = yes +test-xfail-UNIX98/ucontext.h/conform = yes +test-xfail-XOPEN2K/signal.h/conform = yes +test-xfail-XOPEN2K/sys/wait.h/conform = yes +test-xfail-XOPEN2K/ucontext.h/conform = yes +test-xfail-POSIX2008/signal.h/conform = yes +test-xfail-POSIX2008/sys/wait.h/conform = yes +test-xfail-XOPEN2K8/signal.h/conform = yes +test-xfail-XOPEN2K8/sys/wait.h/conform = yes + +conformtest-cc-flags = -I../include $(+sysdep-includes) $(sysincludes) -I.. +# conformtest-xfail-conds may be set by a sysdeps Makefile fragment to +# a list of conditions that are considered to be true when encountered +# in xfail[cond]- lines in test expectations. +conformtest-xfail = $(if $(conformtest-xfail-conds),\ + --xfail='$(conformtest-xfail-conds)') +ifeq (no,$(cross-compiling)) +conformtest-cross = +else +conformtest-cross = --cross +endif +$(conformtest-header-tests): $(objpfx)%/conform.out: \ + conformtest.pl $(conformtest-headers-data) + (set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \ + mkdir -p $(@D)/scratch; \ + $(PERL) -I. conformtest.pl --tmpdir=$(@D)/scratch --cc='$(CC)' \ + --flags='$(conformtest-cc-flags)' --standard=$$std \ + --headers=$$hdr $(conformtest-xfail) $(conformtest-cross) \ + > $@); \ + $(evaluate-test) + +$(linknamespace-symlists-tests): $(objpfx)symlist-%: list-header-symbols.pl + $(PERL) -I. -w $< --tmpdir=$(objpfx) --cc='$(CC)' \ + --flags='$(conformtest-cc-flags)' --standard=$* \ + --headers="$(strip $(conformtest-headers-$*))" \ + > $@ 2> $@.err; \ + $(evaluate-test) + +linknamespace-libs-isoc = $(common-objpfx)libc.a $(common-objpfx)math/libm.a +linknamespace-libs-thr = $(linknamespace-libs-isoc) \ + $(common-objpfx)rt/librt.a $(static-thread-library) +linknamespace-libs-posix = $(linknamespace-libs-thr) \ + $(common-objpfx)dlfcn/libdl.a +linknamespace-libs-xsi = $(linknamespace-libs-posix) \ + $(common-objpfx)crypt/libcrypt.a +linknamespace-libs-ISO = $(linknamespace-libs-isoc) +linknamespace-libs-ISO99 = $(linknamespace-libs-isoc) +linknamespace-libs-ISO11 = $(linknamespace-libs-isoc) +linknamespace-libs-XPG4 = $(linknamespace-libs-isoc) \ + $(common-objpfx)crypt/libcrypt.a +linknamespace-libs-XPG42 = $(linknamespace-libs-XPG4) +linknamespace-libs-POSIX = $(linknamespace-libs-thr) +linknamespace-libs-UNIX98 = $(linknamespace-libs-xsi) +linknamespace-libs-XOPEN2K = $(linknamespace-libs-xsi) +linknamespace-libs-POSIX2008 = $(linknamespace-libs-posix) +linknamespace-libs-XOPEN2K8 = $(linknamespace-libs-xsi) +linknamespace-libs = $(foreach std,$(conformtest-standards),\ + $(linknamespace-libs-$(std))) + +$(linknamespace-symlist-stdlibs-tests): $(objpfx)symlist-stdlibs-%: \ + $(linknamespace-libs) + LC_ALL=C $(READELF) -W -s $(linknamespace-libs-$*) > $@; \ + $(evaluate-test) + +$(linknamespace-header-tests): $(objpfx)%/linknamespace.out: \ + linknamespace.pl \ + $(linknamespace-symlists-tests) \ + $(linknamespace-symlist-stdlibs-tests) + (set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \ + mkdir -p $(@D)/scratch; \ + $(PERL) -I. -w $< --tmpdir=$(@D)/scratch --cc='$(CC)' \ + --flags='$(conformtest-cc-flags)' --standard=$$std \ + --stdsyms=$(objpfx)symlist-$$std --header=$$hdr \ + --libsyms=$(objpfx)symlist-stdlibs-$$std \ + --readelf='$(READELF)' \ + > $@ 2>&1); \ + $(evaluate-test) + +# Pre-standard C feature no longer supported by GCC (obsoleted in +# newer POSIX standards). +test-xfail-XPG4/varargs.h/linknamespace = yes +test-xfail-XPG42/varargs.h/linknamespace = yes +test-xfail-UNIX98/varargs.h/linknamespace = yes + +# Header not provided by glibc. +test-xfail-XPG42/ndbm.h/linknamespace = yes +test-xfail-UNIX98/ndbm.h/linknamespace = yes +test-xfail-XOPEN2K/ndbm.h/linknamespace = yes +test-xfail-XOPEN2K8/ndbm.h/linknamespace = yes diff --git a/REORG.TODO/conform/check-header-lists.sh b/REORG.TODO/conform/check-header-lists.sh new file mode 100755 index 0000000000..b89fcc9316 --- /dev/null +++ b/REORG.TODO/conform/check-header-lists.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# Check the set of headers with conformtest expectations for a given standard. +# Copyright (C) 2014-2017 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 +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# <http://www.gnu.org/licenses/>. + +set -e + +std=$1 +CC=$2 +expected_list=$3 +all_data_files=$4 + +new_list= + +for f in $all_data_files; do + h=${f#data/} + h=${h%-data} + exp=$($CC -D$std -x c -E $f | sed -e '/^#/d' -e '/^[ ]*$/d') + if [ "$exp" ]; then + new_list="$new_list $h" + fi +done + +echo "Headers with expectations for $std: $new_list" +echo "Expected list: $expected_list" + +rc=0 + +for h in $expected_list; do + case " $new_list " in + (*" $h "*) + ;; + (*) + echo "Missing expectations for $h." + rc=1 + ;; + esac +done + +for h in $new_list; do + case " $expected_list " in + (*" $h "*) + ;; + (*) + echo "Spurious expectations for $h." + rc=1 + ;; + esac +done + +exit $rc diff --git a/REORG.TODO/conform/conformtest.pl b/REORG.TODO/conform/conformtest.pl new file mode 100644 index 0000000000..cb500f0e76 --- /dev/null +++ b/REORG.TODO/conform/conformtest.pl @@ -0,0 +1,898 @@ +#!/usr/bin/perl + +use GlibcConform; +use Getopt::Long; +use POSIX; + +$standard = "XOPEN2K8"; +$CC = "gcc"; +$tmpdir = "/tmp"; +$cross = ""; +$xfail_str = ""; +GetOptions ('headers=s' => \@headers, 'standard=s' => \$standard, + 'flags=s' => \$flags, 'cc=s' => \$CC, 'tmpdir=s' => \$tmpdir, + 'cross' => \$cross, 'xfail=s' => \$xfail_str); +@headers = split(/,/,join(',',@headers)); + +# List of the headers we are testing. +if (@headers == ()) { + @headers = ("wordexp.h", "wctype.h", "wchar.h", "varargs.h", "utmpx.h", + "utime.h", "unistd.h", "ulimit.h", "ucontext.h", "uchar.h", + "time.h", "tgmath.h", "termios.h", "tar.h", "sys/wait.h", + "sys/utsname.h", "sys/un.h", "sys/uio.h", "sys/types.h", + "sys/times.h", "sys/timeb.h", "sys/time.h", "sys/statvfs.h", + "sys/stat.h", "sys/socket.h", "sys/shm.h", "sys/sem.h", + "sys/select.h", "sys/resource.h", "sys/msg.h", "sys/mman.h", + "sys/ipc.h", "syslog.h", "stropts.h", "strings.h", "string.h", + "stdnoreturn.h", "stdlib.h", "stdio.h", "stdint.h", "stddef.h", + "stdbool.h", "stdarg.h", "stdalign.h", "spawn.h", "signal.h", + "setjmp.h", "semaphore.h", "search.h", "sched.h", "regex.h", + "pwd.h", "pthread.h", "poll.h", "nl_types.h", "netinet/tcp.h", + "netinet/in.h", "net/if.h", "netdb.h", "ndbm.h", "mqueue.h", + "monetary.h", "math.h", "locale.h", "libgen.h", "limits.h", + "langinfo.h", "iso646.h", "inttypes.h", "iconv.h", "grp.h", + "glob.h", "ftw.h", "fnmatch.h", "fmtmsg.h", "float.h", "fenv.h", + "fcntl.h", "errno.h", "dlfcn.h", "dirent.h", "ctype.h", "cpio.h", + "complex.h", "assert.h", "arpa/inet.h", "aio.h"); +} + +$CFLAGS_namespace = "$flags -fno-builtin $CFLAGS{$standard} -D_ISOMAC"; +$CFLAGS = "$CFLAGS_namespace '-D__attribute__(x)='"; + +# Check standard name for validity. +die "unknown standard \"$standard\"" if ($CFLAGS{$standard} eq ""); + +# if ($standard ne "XOPEN2K8" && $standard ne "POSIX2008") { +# # Some headers need a bit more attention. At least with XPG7 +# # all headers should be self-contained. +# $mustprepend{'inttypes.h'} = "#include <stddef.h>\n"; +# $mustprepend{'glob.h'} = "#include <sys/types.h>\n"; +# $mustprepend{'grp.h'} = "#include <sys/types.h>\n"; +# $mustprepend{'regex.h'} = "#include <sys/types.h>\n"; +# $mustprepend{'pwd.h'} = "#include <sys/types.h>\n"; +# $mustprepend{'sched.h'} = "#include <sys/types.h>\n"; +# $mustprepend{'signal.h'} = "#include <pthread.h>\n#include <sys/types.h>\n"; +# $mustprepend{'stdio.h'} = "#include <sys/types.h>\n"; +# $mustprepend{'sys/stat.h'} = "#include <sys/types.h>\n"; +# $mustprepend{'wchar.h'} = "#include <stdarg.h>\n"; +# $mustprepend{'wordexp.h'} = "#include <stddef.h>\n"; +# } + +# These are the ISO C90 keywords. +@keywords = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default', + 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto', + 'if', 'int', 'long', 'register', 'return', + 'short', 'signed', 'sizeof', 'static', 'struct', 'switch', + 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while'); +if ($CFLAGS{$standard} =~ /-std=(c99|c1x)/) { + push (@keywords, 'inline', 'restrict'); +} + +# Make a hash table from this information. +while ($#keywords >= 0) { + $iskeyword{pop (@keywords)} = 1; +} + +$verbose = 1; + +$total = 0; +$skipped = 0; +$errors = 0; +$xerrors = 0; + +sub note_error { + my($xfail) = @_; + if ($xfail) { + $xerrors++; + printf ("Ignoring this failure.\n"); + } else { + $errors++; + } +} + + +sub poorfnmatch { + my($pattern, $string) = @_; + my($strlen) = length ($string); + my($res); + + if (substr ($pattern, 0, 1) eq '*') { + my($patlen) = length ($pattern) - 1; + $res = ($strlen >= $patlen + && substr ($pattern, -$patlen, $patlen) eq substr ($string, -$patlen, $patlen)); + } elsif (substr ($pattern, -1, 1) eq '*') { + if (substr ($pattern, -2, 1) eq ']') { + my($patlen) = index ($pattern, '['); + my($range) = substr ($pattern, $patlen + 1, -2); + $res = ($strlen > $patlen + && substr ($pattern, 0, $patlen) eq substr ($string, 0, $patlen) + && index ($range, substr ($string, $patlen, 1)) != -1); + } else { + my($patlen) = length ($pattern) - 1; + $res = ($strlen >= $patlen + && substr ($pattern, 0, $patlen) eq substr ($string, 0, $patlen)); + } + } else { + $res = $pattern eq $string; + } + return $res; +} + + +sub compiletest +{ + my($fnamebase, $msg, $errmsg, $skip, $optional, $xfail) = @_; + my($result) = $skip; + my($printlog) = 0; + + ++$total; + printf (" $msg..."); + + if ($skip != 0) { + ++$skipped; + printf (" SKIP\n"); + } else { + $ret = system "$CC $CFLAGS -c $fnamebase.c -o $fnamebase.o > $fnamebase.out 2>&1"; + if ($ret != 0) { + if ($optional != 0) { + printf (" $errmsg\n"); + $result = 1; + } else { + printf (" FAIL\n"); + if ($verbose != 0) { + printf (" $errmsg Compiler message:\n"); + $printlog = 1; + } + note_error($xfail); + $result = 1; + } + } else { + printf (" OK\n"); + if ($verbose > 1 && -s "$fnamebase.out") { + # We print all warnings issued. + $printlog = 1; + } + } + if ($printlog != 0) { + printf (" " . "-" x 71 . "\n"); + open (MESSAGE, "< $fnamebase.out"); + while (<MESSAGE>) { + printf (" %s", $_); + } + close (MESSAGE); + printf (" " . "-" x 71 . "\n"); + } + } + unlink "$fnamebase.c"; + unlink "$fnamebase.o"; + unlink "$fnamebase.out"; + + $result; +} + + +sub runtest +{ + my($fnamebase, $msg, $errmsg, $skip, $xfail) = @_; + my($result) = $skip; + my($printlog) = 0; + + ++$total; + printf (" $msg..."); + + if ($skip != 0) { + ++$skipped; + printf (" SKIP\n"); + } else { + $ret = system "$CC $CFLAGS -o $fnamebase $fnamebase.c > $fnamebase.out 2>&1"; + if ($ret != 0) { + printf (" FAIL\n"); + if ($verbose != 0) { + printf (" $errmsg Compiler message:\n"); + $printlog = 1; + } + note_error($xfail); + $result = 1; + } elsif ($cross) { + printf (" SKIP\n"); + } else { + # Now run the program. If the exit code is not zero something is wrong. + $result = system "$fnamebase > $fnamebase.out2 2>&1"; + if ($result == 0) { + printf (" OK\n"); + if ($verbose > 1 && -s "$fnamebase.out") { + # We print all warnings issued. + $printlog = 1; + system "cat $fnamebase.out2 >> $fnamebase.out"; + } + } else { + printf (" FAIL\n"); + note_error($xfail); + $printlog = 1; + unlink "$fnamebase.out"; + rename "$fnamebase.out2", "$fnamebase.out"; + } + } + if ($printlog != 0) { + printf (" " . "-" x 71 . "\n"); + open (MESSAGE, "< $fnamebase.out"); + while (<MESSAGE>) { + printf (" %s", $_); + } + close (MESSAGE); + printf (" " . "-" x 71 . "\n"); + } + } + unlink "$fnamebase"; + unlink "$fnamebase.c"; + unlink "$fnamebase.o"; + unlink "$fnamebase.out"; + unlink "$fnamebase.out2"; + + $result; +} + + +sub newtoken { + my($token, @allow) = @_; + my($idx); + + return if ($token =~ /^[0-9_]/ || $iskeyword{$token}); + + for ($idx = 0; $idx <= $#allow; ++$idx) { + return if (poorfnmatch ($allow[$idx], $token)); + } + + $errors{$token} = 1; +} + + +sub removetoken { + my($token) = @_; + my($idx); + + return if ($token =~ /^[0-9_]/ || $iskeyword{$token}); + + if (exists $errors{$token}) { + undef $errors{$token}; + } +} + + +sub checknamespace { + my($h, $fnamebase, @allow) = @_; + + ++$total; + + # Generate a program to get the contents of this header. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "#include <$h>\n"; + close (TESTFILE); + + undef %errors; + open (CONTENT, "$CC $CFLAGS_namespace -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |"); + loop: while (<CONTENT>) { + chop; + if (/^#define (.*)/) { + newtoken ($1, @allow); + } elsif (/^#undef (.*)/) { + removetoken ($1); + } else { + # We have to tokenize the line. + my($str) = $_; + + $str =~ s/"[^"]*"//g; + foreach $token (split(/[^a-zA-Z0-9_]/, $str)) { + if ($token ne "") { + newtoken ($token, @allow); + } + } + } + } + close (CONTENT); + unlink "$fnamebase.c"; + $realerror = 0; + if ($#errors != 0) { + # Sort the output list so it's easier to compare results with diff. + foreach $f (sort keys(%errors)) { + if ($errors{$f} == 1) { + if ($realerror == 0) { + printf ("FAIL\n " . "-" x 72 . "\n"); + $realerror = 1; + ++$errors; + } + printf (" Namespace violation: \"%s\"\n", $f); + } + } + printf (" " . "-" x 72 . "\n") if ($realerror != 0); + } + + if ($realerror == 0) { + printf ("OK\n"); + } +} + + +while ($#headers >= 0) { + my($h) = pop (@headers); + my($hf) = $h; + $hf =~ s|/|-|; + my($fnamebase) = "$tmpdir/$hf-test"; + my($missing) = 1; + my(@allow) = (); + my(@allowheader) = (); + my(%seenheader) = (); + my($prepend) = $mustprepend{$h}; + my($test_exist) = 1; + + printf ("Testing <$h>\n"); + printf ("----------" . "-" x length ($h) . "\n"); + + open (CONTROL, "$CC -E -D$standard -std=c99 -x c data/$h-data |"); + control: while (<CONTROL>) { + chop; + next control if (/^#/); + next control if (/^[ ]*$/); + + if ($test_exist) { + $test_exist = 0; + # Generate a program to test for the availability of this header. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + close (TESTFILE); + + $missing = compiletest ($fnamebase, "Checking whether <$h> is available", + "Header <$h> not available", 0, 0, 0); + printf ("\n"); + last control if ($missing); + } + + my($xfail) = 0; + if (/^xfail-/) { + s/^xfail-//; + $xfail = 1; + } elsif (/^xfail\[([^\]]*)\]-/) { + my($xfail_cond) = $1; + s/^xfail\[([^\]]*)\]-//; + # "xfail[cond]-" or "xfail[cond1|cond2|...]-" means a failure of + # the test is allowed if any of the listed conditions are in the + # --xfail command-line option argument. + if ($xfail_str =~ /\b($xfail_cond)\b/) { + $xfail = 1; + } + } + my($optional) = 0; + if (/^optional-/) { + s/^optional-//; + $optional = 1; + } + if (/^element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) { + my($struct) = "$2$3"; + my($type) = "$5$6"; + my($member) = "$7"; + my($rest) = "$8"; + my($res) = $missing; + + # Remember that this name is allowed. + push @allow, $member; + + # Generate a program to test for the availability of this member. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "$struct a;\n"; + print TESTFILE "$struct b;\n"; + print TESTFILE "extern void xyzzy (__typeof__ (&b.$member), __typeof__ (&a.$member), unsigned);\n"; + print TESTFILE "void foobarbaz (void) {\n"; + print TESTFILE " xyzzy (&a.$member, &b.$member, sizeof (a.$member));\n"; + print TESTFILE "}\n"; + close (TESTFILE); + + $res = compiletest ($fnamebase, "Testing for member $member", + ($optional + ? "NOT AVAILABLE." + : "Member \"$member\" not available."), $res, + $optional, $xfail); + + if ($res == 0 || $missing != 0 || !$optional) { + # Test the types of the members. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "$struct a;\n"; + print TESTFILE "extern $type b$rest;\n"; + print TESTFILE "extern __typeof__ (a.$member) b;\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Testing for type of member $member", + "Member \"$member\" does not have the correct type.", + $res, 0, $xfail); + } + } elsif (/^(macro|constant|macro-constant|macro-int-constant) +([a-zA-Z0-9_]*) *(?:{([^}]*)} *)?(?:([>=<!]+) ([A-Za-z0-9_\\'-]*))?/) { + my($symbol_type) = $1; + my($symbol) = $2; + my($type) = $3; + my($op) = $4; + my($value) = $5; + my($res) = $missing; + my($mres) = $missing; + my($cres) = $missing; + + # Remember that this name is allowed. + push @allow, $symbol; + + if ($symbol_type =~ /macro/) { + # Generate a program to test for availability of this macro. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "#ifndef $symbol\n"; + print TESTFILE "# error \"Macro $symbol not defined\"\n"; + print TESTFILE "#endif\n"; + close (TESTFILE); + + $mres = compiletest ($fnamebase, "Test availability of macro $symbol", + ($optional + ? "NOT PRESENT" + : "Macro \"$symbol\" is not available."), $res, + $optional, $xfail); + } + + if ($symbol_type =~ /constant/) { + # Generate a program to test for the availability of this constant. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "__typeof__ ($symbol) a = $symbol;\n"; + close (TESTFILE); + + $cres = compiletest ($fnamebase, "Testing for constant $symbol", + ($optional + ? "NOT PRESENT" + : "Constant \"$symbol\" not available."), $res, + $optional, $xfail); + } + + $res = $res || $mres || $cres; + + if ($symbol_type eq "macro-int-constant" && ($res == 0 || !$optional)) { + # Test that the symbol is usable in #if. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "#if $symbol < 0\n"; + print TESTFILE "# define conformtest_negative 1\n"; + my($s) = "0"; + for (my $i = 0; $i < 63; $i++) { + print TESTFILE "# if $symbol & (1LL << $i)\n"; + print TESTFILE "# define conformtest_bit_$i 0LL\n"; + print TESTFILE "# else\n"; + print TESTFILE "# define conformtest_bit_$i (1LL << $i)\n"; + print TESTFILE "# endif\n"; + $s .= "|conformtest_bit_$i"; + } + print TESTFILE "# define conformtest_value ~($s)\n"; + print TESTFILE "#else\n"; + print TESTFILE "# define conformtest_negative 0\n"; + $s = "0"; + for (my $i = 0; $i < 64; $i++) { + print TESTFILE "# if $symbol & (1ULL << $i)\n"; + print TESTFILE "# define conformtest_bit_$i (1ULL << $i)\n"; + print TESTFILE "# else\n"; + print TESTFILE "# define conformtest_bit_$i 0ULL\n"; + print TESTFILE "# endif\n"; + $s .= "|conformtest_bit_$i"; + } + print TESTFILE "# define conformtest_value ($s)\n"; + print TESTFILE "#endif\n"; + print TESTFILE "_Static_assert ((($symbol < 0) == conformtest_negative) && ($symbol == conformtest_value), \"value match inside and outside #if\");\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Testing for #if usability of symbol $symbol", + "Symbol \"$symbol\" not usable in #if.", $res, 0, $xfail); + } + + if (defined ($type) && ($res == 0 || !$optional)) { + # Test the type of the symbol. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + if ($type =~ /^promoted:/) { + $type =~ s/^promoted://; + print TESTFILE "__typeof__ (($type) 0 + ($type) 0) a;\n"; + } else { + print TESTFILE "__typeof__ (($type) 0) a;\n"; + } + print TESTFILE "extern __typeof__ ($symbol) a;\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Testing for type of symbol $symbol", + "Symbol \"$symbol\" does not have the correct type.", + $res, 0, $xfail); + } + + if (defined ($op) && ($res == 0 || !$optional)) { + # Generate a program to test for the value of this symbol. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "_Static_assert ($symbol $op $value, \"value constraint\");\n"; + close (TESTFILE); + + $res = compiletest ($fnamebase, "Testing for value of symbol $symbol", + "Symbol \"$symbol\" has not the right value.", + $res, 0, $xfail); + } + } elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) { + my($symbol) = $1; + my($value) = $2; + my($res) = $missing; + + # Remember that this name is allowed. + push @allow, $symbol; + + # Generate a program to test for the availability of this constant. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "void foobarbaz (void) {\n"; + print TESTFILE "__typeof__ ($symbol) a = $symbol;\n"; + print TESTFILE "}\n"; + close (TESTFILE); + + $res = compiletest ($fnamebase, "Testing for symbol $symbol", + "Symbol \"$symbol\" not available.", $res, 0, $xfail); + + if ($value ne "") { + # Generate a program to test for the value of this constant. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "int main (void) { return $symbol != $value; }\n"; + close (TESTFILE); + + $res = runtest ($fnamebase, "Testing for value of symbol $symbol", + "Symbol \"$symbol\" has not the right value.", $res, + $xfail); + } + } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) { + my($type) = "$2$3"; + my($maybe_opaque) = 0; + + # Remember that this name is allowed. + if ($type =~ /^struct *(.*)/) { + push @allow, $1; + } elsif ($type =~ /^union *(.*)/) { + push @allow, $1; + } else { + push @allow, $type; + $maybe_opaque = 1; + } + + # Generate a program to test for the availability of this type. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + if ($maybe_opaque == 1) { + print TESTFILE "$type *a;\n"; + } else { + print TESTFILE "$type a;\n"; + } + close (TESTFILE); + + compiletest ($fnamebase, "Testing for type $type", + ($optional + ? "NOT AVAILABLE" + : "Type \"$type\" not available."), $missing, $optional, + $xfail); + } 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, $xfail); + } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) { + my($rettype) = "$2$3"; + my($fname) = "$4"; + my($args) = "$5"; + my($res) = $missing; + + # Remember that this name is allowed. + push @allow, $fname; + + # Generate a program to test for availability of this function. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + # print TESTFILE "#undef $fname\n"; + print TESTFILE "$rettype (*(*foobarbaz) $args = $fname;\n"; + close (TESTFILE); + + $res = compiletest ($fnamebase, "Test availability of function $fname", + ($optional + ? "NOT AVAILABLE" + : "Function \"$fname\" is not available."), $res, + $optional, $xfail); + + if ($res == 0 || $missing == 1 || !$optional) { + # Generate a program to test for the type of this function. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + # print TESTFILE "#undef $fname\n"; + print TESTFILE "extern $rettype (*(*foobarbaz) $args;\n"; + print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Test for type of function $fname", + "Function \"$fname\" has incorrect type.", $res, 0, + $xfail); + } + } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { + my($rettype) = "$2$3"; + my($fname) = "$4"; + my($args) = "$5"; + my($res) = $missing; + + # Remember that this name is allowed. + push @allow, $fname; + + # Generate a program to test for availability of this function. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + # print TESTFILE "#undef $fname\n"; + print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n"; + close (TESTFILE); + + $res = compiletest ($fnamebase, "Test availability of function $fname", + ($optional + ? "NOT AVAILABLE" + : "Function \"$fname\" is not available."), $res, + $optional, $xfail); + + if ($res == 0 || $missing != 0 || !$optional) { + # Generate a program to test for the type of this function. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + # print TESTFILE "#undef $fname\n"; + print TESTFILE "extern $rettype (*foobarbaz) $args;\n"; + print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Test for type of function $fname", + "Function \"$fname\" has incorrect type.", $res, 0, + $xfail); + } + } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) *(.*)/) { + my($type) = "$2$3"; + my($vname) = "$4"; + my($rest) = "$5"; + my($res) = $missing; + + # Remember that this name is allowed. + push @allow, $vname; + + # Generate a program to test for availability of this function. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + # print TESTFILE "#undef $fname\n"; + print TESTFILE "typedef $type xyzzy$rest;\n"; + print TESTFILE "$xyzzy *foobarbaz = &$vname;\n"; + close (TESTFILE); + + $res = compiletest ($fnamebase, "Test availability of variable $vname", + "Variable \"$vname\" is not available.", $res, 0, + $xfail); + + # Generate a program to test for the type of this function. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + # print TESTFILE "#undef $fname\n"; + print TESTFILE "extern $type $vname$rest;\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Test for type of variable $fname", + "Variable \"$vname\" has incorrect type.", $res, 0, $xfail); + } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { + my($rettype) = "$2$3"; + my($fname) = "$4"; + my($args) = "$5"; + my($res) = $missing; + + # Remember that this name is allowed. + push @allow, $fname; + + # Generate a program to test for availability of this function. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "#ifndef $fname\n"; + print TESTFILE "$rettype (*foobarbaz) $args = $fname;\n"; + print TESTFILE "#endif\n"; + close (TESTFILE); + + $res = compiletest ($fnamebase, "Test availability of macro $fname", + "Function \"$fname\" is not available.", $res, 0, + $xfail); + + # Generate a program to test for the type of this function. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "#ifndef $fname\n"; + print TESTFILE "extern $rettype (*foobarbaz) $args;\n"; + print TESTFILE "extern __typeof__ (&$fname) foobarbaz;\n"; + print TESTFILE "#endif\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Test for type of macro $fname", + "Function \"$fname\" has incorrect type.", $res, 0, $xfail); + } elsif (/^macro-str *([^ ]*) *(\".*\")/) { + # The above regex doesn't handle a \" in a string. + my($macro) = "$1"; + my($string) = "$2"; + my($res) = $missing; + + # Remember that this name is allowed. + push @allow, $macro; + + # Generate a program to test for availability of this macro. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + print TESTFILE "#ifndef $macro\n"; + print TESTFILE "# error \"Macro $macro not defined\"\n"; + print TESTFILE "#endif\n"; + close (TESTFILE); + + compiletest ($fnamebase, "Test availability of macro $macro", + "Macro \"$macro\" is not available.", $missing, 0, $xfail); + + # Generate a program to test for the value of this macro. + open (TESTFILE, ">$fnamebase.c"); + print TESTFILE "$prepend"; + print TESTFILE "#include <$h>\n"; + # We can't include <string.h> here. + print TESTFILE "extern int (strcmp)(const char *, const char *);\n"; + print TESTFILE "int main (void) { return (strcmp) ($macro, $string) != 0;}\n"; + close (TESTFILE); + + $res = runtest ($fnamebase, "Testing for value of macro $macro", + "Macro \"$macro\" has not the right value.", $res, + $xfail); + } elsif (/^allow-header *(.*)/) { + my($pattern) = $1; + if ($seenheader{$pattern} != 1) { + push @allowheader, $pattern; + $seenheader{$pattern} = 1; + } + next control; + } elsif (/^allow *(.*)/) { + my($pattern) = $1; + push @allow, $pattern; + next control; + } else { + # printf ("line is `%s'\n", $_); + next control; + } + + printf ("\n"); + } + close (CONTROL); + + # Read the data files for the header files which are allowed to be included. + while ($#allowheader >= 0) { + my($ah) = pop @allowheader; + + open (ALLOW, "$CC -E -D$standard -x c data/$ah-data |"); + acontrol: while (<ALLOW>) { + chop; + next acontrol if (/^#/); + next acontrol if (/^[ ]*$/); + + s/^xfail(\[([^\]]*)\])?-//; + s/^optional-//; + if (/^element *({([^}]*)}|([^ ]*)) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) { + push @allow, $7; + } elsif (/^(macro|constant|macro-constant|macro-int-constant) +([a-zA-Z0-9_]*) *(?:{([^}]*)} *)?(?:([>=<!]+) ([A-Za-z0-9_-]*))?/) { + push @allow, $2; + } elsif (/^(type|tag) *({([^}]*)|([a-zA-Z0-9_]*))/) { + my($type) = "$3$4"; + + # Remember that this name is allowed. + if ($type =~ /^struct *(.*)/) { + push @allow, $1; + } elsif ($type =~ /^union *(.*)/) { + push @allow, $1; + } else { + push @allow, $type; + } + } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) { + push @allow, $4; + } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { + push @allow, $4; + } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) { + push @allow, $4; + } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { + push @allow, $4; + } elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) { + push @allow, $1; + } elsif (/^allow-header *(.*)/) { + if ($seenheader{$1} != 1) { + push @allowheader, $1; + $seenheader{$1} = 1; + } + } elsif (/^allow *(.*)/) { + push @allow, $1; + } + } + close (ALLOW); + } + + if ($test_exist) { + printf (" Not defined\n"); + } else { + # Now check the namespace. + printf (" Checking the namespace of \"%s\"... ", $h); + if ($missing) { + ++$skipped; + printf ("SKIP\n"); + } else { + checknamespace ($h, $fnamebase, @allow); + } + } + + printf ("\n\n"); +} + +printf "-" x 76 . "\n"; +printf (" Total number of tests : %4d\n", $total); + +printf (" Number of failed tests : %4d (", $errors); +$percent = ($errors * 100) / $total; +if ($errors > 0 && $percent < 1.0) { + printf (" <1%%)\n"); +} else { + printf ("%3d%%)\n", $percent); +} + +printf (" Number of xfailed tests : %4d (", $xerrors); +$percent = ($xerrors * 100) / $total; +if ($xerrors > 0 && $percent < 1.0) { + printf (" <1%%)\n"); +} else { + printf ("%3d%%)\n", $percent); +} + +printf (" Number of skipped tests : %4d (", $skipped); +$percent = ($skipped * 100) / $total; +if ($skipped > 0 && $percent < 1.0) { + printf (" <1%%)\n"); +} else { + printf ("%3d%%)\n", $percent); +} + +exit $errors != 0; +# Local Variables: +# perl-indent-level: 2 +# End: diff --git a/REORG.TODO/conform/data/aio.h-data b/REORG.TODO/conform/data/aio.h-data new file mode 100644 index 0000000000..adb291b6e1 --- /dev/null +++ b/REORG.TODO/conform/data/aio.h-data @@ -0,0 +1,43 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined XPG42 +type {struct aiocb} + +// Test elements of the AIO control struct. +element {struct aiocb} int aio_fildes +element {struct aiocb} off_t aio_offset +element {struct aiocb} {volatile void*} aio_buf +element {struct aiocb} size_t aio_nbytes +element {struct aiocb} int aio_reqprio +element {struct aiocb} {struct sigevent} aio_sigevent +element {struct aiocb} int aio_lio_opcode + +constant AIO_CANCELED +constant AIO_NOTCANCELED +constant AIO_ALLDONE +constant LIO_WAIT +constant LIO_NOWAIT +constant LIO_READ +constant LIO_WRITE +constant LIO_NOP + +function int aio_cancel (int, struct aiocb*) +function int aio_error (const struct aiocb*) +function int aio_fsync (int, struct aiocb*) +function int aio_read (struct aiocb*) +function ssize_t aio_return (struct aiocb*) +function int aio_suspend (const struct aiocb* const[], int, const struct timespec*) +function int aio_write (struct aiocb*) +function int lio_listio (int, struct aiocb *const[], int, struct sigevent*) + +// POSIX in theory doesn't allow the header to be self contained but +// this was fixed later and we do not test for this here. +allow-header fcntl.h +allow-header signal.h +allow-header sys/types.h +allow-header time.h + +allow aio_* +allow lio_* +allow AIO_* +allow LIO_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/arpa/inet.h-data b/REORG.TODO/conform/data/arpa/inet.h-data new file mode 100644 index 0000000000..d4ab6bb72a --- /dev/null +++ b/REORG.TODO/conform/data/arpa/inet.h-data @@ -0,0 +1,31 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +// in_port_t should have exactly 16 bits +type in_port_t +// in_addr_t should have exactly 32 bits +type in_addr_t + +type uint32_t +type uint16_t + +macro INET_ADDRSTRLEN +macro INET6_ADDRSTRLEN + +// The following can be declared as functions, defined as macros or both: +function uint32_t htonl (uint32_t); +function uint16_t htons (uint16_t); +function uint32_t ntohl (uint32_t); +function uint16_t htons (uint16_t); + +function in_addr_t inet_addr (const char*); +function in_addr_t inet_lnaof (struct in_addr); +function {struct in_addr} inet_makeaddr (in_addr_t, in_addr_t); +function in_addr_t inet_netof (struct in_addr); +function in_addr_t inet_network (const char *); +function {char*} inet_ntoa (struct in_addr); +function {const char*} inet_ntop (int, const void*, char*, socklen_t); +function int inet_pton (int, const char*, void*); + +allow-header netinet/in.h +allow-header inttypes.h + +#endif diff --git a/REORG.TODO/conform/data/assert.h-data b/REORG.TODO/conform/data/assert.h-data new file mode 100644 index 0000000000..acdfef99e1 --- /dev/null +++ b/REORG.TODO/conform/data/assert.h-data @@ -0,0 +1,9 @@ +macro assert + +#ifdef ISO11 +macro static_assert +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif diff --git a/REORG.TODO/conform/data/complex.h-data b/REORG.TODO/conform/data/complex.h-data new file mode 100644 index 0000000000..4af7757bd7 --- /dev/null +++ b/REORG.TODO/conform/data/complex.h-data @@ -0,0 +1,113 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +macro complex +macro _Complex_I +optional-macro imaginary +optional-macro _Imaginary_I +macro I + +function double cabs (double complex) +function {double complex} cacos (double complex) +function {double complex} cacosh (double complex) +function double carg (double complex) +function {double complex} casin (double complex) +function {double complex} casinh (double complex) +function {double complex} catan (double complex) +function {double complex} catanh (double complex) +function {double complex} ccos (double complex) +function {double complex} ccosh (double complex) +function {double complex} cexp (double complex) +function double cimag (double complex) +function {double complex} clog (double complex) +function {double complex} conj (double complex) +function {double complex} cpow (double complex, double complex) +function {double complex} cproj (double complex) +function double creal (double complex) +function {double complex} csin (double complex) +function {double complex} csinh (double complex) +function {double complex} csqrt (double complex) +function {double complex} ctan (double complex) +function {double complex} ctanh (double complex) + +function float cabsf (float complex) +function {float complex} cacosf (float complex) +function {float complex} cacoshf (float complex) +function float cargf (float complex) +function {float complex} casinf (float complex) +function {float complex} casinhf (float complex) +function {float complex} catanf (float complex) +function {float complex} catanhf (float complex) +function {float complex} ccosf (float complex) +function {float complex} ccoshf (float complex) +function {float complex} cexpf (float complex) +function float cimagf (float complex) +function {float complex} clogf (float complex) +function {float complex} conjf (float complex) +function {float complex} cpowf (float complex, float complex) +function {float complex} cprojf (float complex) +function float crealf (float complex) +function {float complex} csinf (float complex) +function {float complex} csinhf (float complex) +function {float complex} csqrtf (float complex) +function {float complex} ctanf (float complex) +function {float complex} ctanhf (float complex) + +function {long double} cabsl (long double complex) +function {long double complex} cacosl (long double complex) +function {long double complex} cacoshl (long double complex) +function {long double} cargl (long double complex) +function {long double complex} casinhl (long double complex) +function {long double complex} casinl (long double complex) +function {long double complex} catanhl (long double complex) +function {long double complex} catanl (long double complex) +function {long double complex} ccoshl (long double complex) +function {long double complex} ccosl (long double complex) +function {long double complex} cexpl (long double complex) +function {long double} cimagl (long double complex) +function {long double complex} clogl (long double complex) +function {long double complex} conjl (long double complex) +function {long double complex} cpowl (long double complex, long double complex) +function {long double complex} cprojl (long double complex) +function {long double} creall (long double complex) +function {long double complex} csinhl (long double complex) +function {long double complex} csinl (long double complex) +function {long double complex} csqrtl (long double complex) +function {long double complex} ctanhl (long double complex) +function {long double complex} ctanl (long double complex) + +# if defined ISO11 +macro-function {double complex} CMPLX (double, double) +macro-function {float complex} CMPLXF (float, float) +macro-function {long double complex} CMPLXL (long double, long double) +# endif + +allow cerf +allow cerfc +allow cexp2 +allow cexpm1 +allow clog10 +allow clog1p +allow clog2 +allow clgamma +allow ctgamma + +allow cerff +allow cerfcf +allow cexp2f +allow cexpm1f +allow clog10f +allow clog1pf +allow clog2f +allow clgammaf +allow ctgammaf + +allow cerfl +allow cerfcl +allow cexp2l +allow cexpm1l +allow clog10l +allow clog1pl +allow clog2l +allow clgammal +allow ctgammal + +#endif diff --git a/REORG.TODO/conform/data/cpio.h-data b/REORG.TODO/conform/data/cpio.h-data new file mode 100644 index 0000000000..ac7d40fd5e --- /dev/null +++ b/REORG.TODO/conform/data/cpio.h-data @@ -0,0 +1,26 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +constant C_IRUSR == 0000400 +constant C_IWUSR == 0000200 +constant C_IXUSR == 0000100 +constant C_IRGRP == 0000040 +constant C_IWGRP == 0000020 +constant C_IXGRP == 0000010 +constant C_IROTH == 0000004 +constant C_IWOTH == 0000002 +constant C_IXOTH == 0000001 +constant C_ISUID == 0004000 +constant C_ISGID == 0002000 +constant C_ISVTX == 0001000 +constant C_ISDIR == 0040000 +constant C_ISFIFO == 0010000 +constant C_ISREG == 0100000 +constant C_ISBLK == 0060000 +constant C_ISCHR == 0020000 +constant C_ISCTG == 0110000 +constant C_ISLNK == 0120000 +constant C_ISSOCK == 0140000 + +macro-str MAGIC "070707" + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/ctype.h-data b/REORG.TODO/conform/data/ctype.h-data new file mode 100644 index 0000000000..7e10794e46 --- /dev/null +++ b/REORG.TODO/conform/data/ctype.h-data @@ -0,0 +1,51 @@ +function int isalnum (int) +function int isalpha (int) +function int iscntrl (int) +function int isdigit (int) +function int isgraph (int) +function int islower (int) +function int isprint (int) +function int ispunct (int) +function int isspace (int) +function int isupper (int) +function int isxdigit (int) +function int tolower (int) +function int toupper (int) + +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int isblank (int) +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function int isascii (int) +function int toascii (int) + +// XPG says the following two are macros. But we test a bit more strictly. +function int _toupper (int) +function int _tolower (int) +#endif + +# if 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 + +allow is[abcdefghijklmnopqrstuvwxyz]* +allow to[abcdefghijklmnopqrstuvwxyz]* + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif diff --git a/REORG.TODO/conform/data/dirent.h-data b/REORG.TODO/conform/data/dirent.h-data new file mode 100644 index 0000000000..be7ad06fd8 --- /dev/null +++ b/REORG.TODO/conform/data/dirent.h-data @@ -0,0 +1,34 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +type DIR + +type {struct dirent} + +# if !defined POSIX && !defined POSIX2008 +element {struct dirent} ino_t d_ino +# endif +element {struct dirent} char d_name [] + +# if !defined POSIX && !defined POSIX2008 +type ino_t +#endif + +function int closedir (DIR*) +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/REORG.TODO/conform/data/dlfcn.h-data b/REORG.TODO/conform/data/dlfcn.h-data new file mode 100644 index 0000000000..b6658ae8ca --- /dev/null +++ b/REORG.TODO/conform/data/dlfcn.h-data @@ -0,0 +1,14 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 +macro RTLD_LAZY +macro RTLD_NOW +macro RTLD_GLOBAL +macro RTLD_LOCAL + +function {void*} dlopen (const char*, int) +function {void*} dlsym (void *, const char*) +function int dlclose (void*) +function {char*} dlerror (void) + +allow *_t +allow RTLD_* +#endif diff --git a/REORG.TODO/conform/data/errno.h-data b/REORG.TODO/conform/data/errno.h-data new file mode 100644 index 0000000000..12730ba974 --- /dev/null +++ b/REORG.TODO/conform/data/errno.h-data @@ -0,0 +1,134 @@ +macro-int-constant EDOM {int} > 0 +#if !defined ISO && !defined POSIX +macro-int-constant EILSEQ {int} > 0 +#endif +macro-int-constant ERANGE {int} > 0 + +// variable int errno +allow errno + +#if !defined ISO && !defined ISO99 && !defined ISO11 +macro-int-constant E2BIG {int} > 0 +macro-int-constant EACCES {int} > 0 +# if !defined POSIX +macro-int-constant EADDRINUSE {int} > 0 +macro-int-constant EADDRNOTAVAIL {int} > 0 +macro-int-constant EAFNOSUPPORT {int} > 0 +# endif +macro-int-constant EAGAIN {int} > 0 +# if !defined POSIX +macro-int-constant EALREADY {int} > 0 +# endif +macro-int-constant EBADF {int} > 0 +macro-int-constant EBADMSG {int} > 0 +macro-int-constant EBUSY {int} > 0 +macro-int-constant ECANCELED {int} > 0 +macro-int-constant ECHILD {int} > 0 +# if !defined POSIX +macro-int-constant ECONNABORTED {int} > 0 +macro-int-constant ECONNREFUSED {int} > 0 +macro-int-constant ECONNRESET {int} > 0 +# endif +macro-int-constant EDEADLK {int} > 0 +# if !defined POSIX +macro-int-constant EDESTADDRREQ {int} > 0 +macro-int-constant EDQUOT {int} > 0 +# endif +macro-int-constant EEXIST {int} > 0 +macro-int-constant EFAULT {int} > 0 +macro-int-constant EFBIG {int} > 0 +# if !defined POSIX +macro-int-constant EHOSTUNREACH {int} > 0 +macro-int-constant EIDRM {int} > 0 +# endif +macro-int-constant EINPROGRESS {int} > 0 +macro-int-constant EINTR {int} > 0 +macro-int-constant EINVAL {int} > 0 +macro-int-constant EIO {int} > 0 +# if !defined POSIX +macro-int-constant EISCONN {int} > 0 +# endif +macro-int-constant EISDIR {int} > 0 +# if !defined POSIX +macro-int-constant ELOOP {int} > 0 +# endif +macro-int-constant EMFILE {int} > 0 +macro-int-constant EMLINK {int} > 0 +macro-int-constant EMSGSIZE {int} > 0 +# if !defined POSIX +macro-int-constant EMULTIHOP {int} > 0 +# endif +macro-int-constant ENAMETOOLONG {int} > 0 +# if !defined POSIX +macro-int-constant ENETDOWN {int} > 0 +macro-int-constant ENETUNREACH {int} > 0 +# endif +macro-int-constant ENFILE {int} > 0 +# if !defined POSIX +macro-int-constant ENOBUFS {int} > 0 +macro-int-constant ENODATA {int} > 0 +# endif +macro-int-constant ENODEV {int} > 0 +macro-int-constant ENOENT {int} > 0 +macro-int-constant ENOEXEC {int} > 0 +macro-int-constant ENOLCK {int} > 0 +# if !defined POSIX +macro-int-constant ENOLINK {int} > 0 +# endif +macro-int-constant ENOMEM {int} > 0 +# if !defined POSIX +macro-int-constant ENOMSG {int} > 0 +macro-int-constant ENOPROTOOPT {int} > 0 +# endif +macro-int-constant ENOSPC {int} > 0 +# if !defined POSIX +macro-int-constant ENOSR {int} > 0 +macro-int-constant ENOSTR {int} > 0 +# endif +macro-int-constant ENOSYS {int} > 0 +# if !defined POSIX +macro-int-constant ENOTCONN {int} > 0 +# endif +macro-int-constant ENOTDIR {int} > 0 +macro-int-constant ENOTEMPTY {int} > 0 +# if !defined POSIX +macro-int-constant ENOTSOCK {int} > 0 +# endif +macro-int-constant ENOTSUP {int} > 0 +macro-int-constant ENOTTY {int} > 0 +macro-int-constant ENXIO {int} > 0 +# if !defined POSIX +macro-int-constant EOPNOTSUPP {int} > 0 +macro-int-constant EOVERFLOW {int} > 0 +# endif +macro-int-constant EPERM {int} > 0 +macro-int-constant EPIPE {int} > 0 +# if !defined POSIX +macro-int-constant EPROTO {int} > 0 +macro-int-constant EPROTONOSUPPORT {int} > 0 +macro-int-constant EPROTOTYPE {int} > 0 +# endif +macro-int-constant EROFS {int} > 0 +macro-int-constant ESPIPE {int} > 0 +macro-int-constant ESRCH {int} > 0 +# if !defined POSIX +macro-int-constant ESTALE {int} > 0 +macro-int-constant ETIME {int} > 0 +# endif +macro-int-constant ETIMEDOUT {int} > 0 +# if !defined POSIX +macro-int-constant ETXTBSY {int} > 0 +macro-int-constant EWOULDBLOCK {int} > 0 +# endif +macro-int-constant EXDEV {int} > 0 + +# if defined XOPEN2K8 || defined POSIX2008 +macro-int-constant ENOTRECOVERABLE {int} > 0 +macro-int-constant EOWNERDEAD {int} > 0 +# endif + +allow *_t +#endif + +allow E[0123456789]* +allow E[ABCDEFGHIJKLMNOPQRSTUVWXYZ]* diff --git a/REORG.TODO/conform/data/fcntl.h-data b/REORG.TODO/conform/data/fcntl.h-data new file mode 100644 index 0000000000..17596f5ff1 --- /dev/null +++ b/REORG.TODO/conform/data/fcntl.h-data @@ -0,0 +1,134 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +constant F_DUPFD +constant F_GETFD +constant F_SETFD +constant F_GETFL +constant F_SETFL +constant F_GETLK +constant F_SETLK +constant F_SETLKW +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +constant F_GETOWN +constant F_SETOWN +#endif + +constant FD_CLOEXEC + +constant F_RDLCK +constant F_UNLCK +constant F_WRLCK + +#if defined POSIX +allow SEEK_SET +allow SEEK_CUR +allow SEEK_END +#else +constant SEEK_SET +constant SEEK_CUR +constant SEEK_END +#endif + +constant O_CREAT +constant O_EXCL +constant O_NOCTTY +constant O_TRUNC + +constant O_APPEND +constant O_NONBLOCK +constant O_SYNC +#if !defined XPG4 && !defined XPG42 +constant O_DSYNC +constant O_RSYNC +#endif + +constant O_ACCMODE + +constant O_RDONLY +constant O_RDWR +constant O_WRONLY + +#if !defined POSIX +constant S_IRWXU +constant S_IRUSR +constant S_IWUSR +constant S_IXUSR +constant S_IRWXG +constant S_IRGRP +constant S_IWGRP +constant S_IXGRP +constant S_IRWXO +constant S_IROTH +constant S_IWOTH +constant S_IXOTH +constant S_ISUID +constant S_ISGID +#if !defined POSIX2008 +constant S_ISVTX +#endif +#endif + +#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +constant POSIX_FADV_NORMAL +constant POSIX_FADV_SEQUENTIAL +constant POSIX_FADV_RANDOM +constant POSIX_FADV_WILLNEED +constant POSIX_FADV_DONTNEED +constant POSIX_FADV_NOREUSE +#endif + +type {struct flock} + +element {struct flock} short l_type +element {struct flock} short l_whence +element {struct flock} off_t l_start +element {struct flock} off_t l_len +element {struct flock} pid_t l_pid + +#if !defined POSIX +# if !defined UNIX98 +type mode_t +# endif +type off_t +type pid_t +#endif + +function int creat (const char*, mode_t) +function int fcntl (int, int, ...) +function int open (const char*, int, ...) +#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 +// Bug 18228: O_TTY_INIT, O_EXEC, O_SEARCH missing. +xfail-constant O_TTY_INIT +constant O_CLOEXEC +xfail-constant O_EXEC +xfail-constant O_SEARCH +constant O_DIRECTORY +constant O_NOFOLLOW +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 + +#if !defined POSIX +allow-header sys/stat.h +allow-header unistd.h +#endif + +allow l_* +allow F_* +allow O_* +allow S_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/fenv.h-data b/REORG.TODO/conform/data/fenv.h-data new file mode 100644 index 0000000000..280b72864c --- /dev/null +++ b/REORG.TODO/conform/data/fenv.h-data @@ -0,0 +1,36 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +type fenv_t +type fexcept_t + +optional-macro-int-constant FE_DIVBYZERO +optional-macro-int-constant FE_INEXACT +optional-macro-int-constant FE_INVALID +optional-macro-int-constant FE_OVERFLOW +optional-macro-int-constant FE_UNDERFLOW +macro-int-constant FE_ALL_EXCEPT + +optional-macro-int-constant FE_DOWNWARD +optional-macro-int-constant FE_TONEAREST +optional-macro-int-constant FE_TOWARDZERO +optional-macro-int-constant FE_UPWARD + +allow FE_[ABCDEFGHIJKLMNOPQRSTUVWXYZ]* + +macro FE_DFL_ENV {const fenv_t *} + +function int feclearexcept (int) +function int fegetexceptflag (fexcept_t*, int) +function int feraiseexcept (int) +function int fesetexceptflag (const fexcept_t*, int) +function int fetestexcept (int) +function int fegetround (void) +function int fesetround (int) +function int fegetenv (fenv_t*) +function int feholdexcept (fenv_t*) +function int fesetenv (const fenv_t*) +function int feupdateenv (const fenv_t *) + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif +#endif diff --git a/REORG.TODO/conform/data/float.h-data b/REORG.TODO/conform/data/float.h-data new file mode 100644 index 0000000000..7b98fc0344 --- /dev/null +++ b/REORG.TODO/conform/data/float.h-data @@ -0,0 +1,62 @@ +macro-int-constant FLT_RADIX >= 2 + +macro FLT_ROUNDS + +macro-int-constant FLT_MANT_DIG +macro-int-constant DBL_MANT_DIG +macro-int-constant LDBL_MANT_DIG + +macro-int-constant FLT_DIG >= 6 +macro-int-constant DBL_DIG >= 10 +macro-int-constant LDBL_DIG >= 10 + +macro-int-constant FLT_MIN_EXP < 0 +macro-int-constant DBL_MIN_EXP < 0 +macro-int-constant LDBL_MIN_EXP < 0 + +macro-int-constant FLT_MIN_10_EXP <= -37 +macro-int-constant DBL_MIN_10_EXP <= -37 +macro-int-constant LDBL_MIN_10_EXP <= -37 + +macro-int-constant FLT_MAX_EXP +macro-int-constant DBL_MAX_EXP +macro-int-constant LDBL_MAX_EXP + +macro-int-constant FLT_MAX_10_EXP >= 37 +macro-int-constant DBL_MAX_10_EXP >= 37 +macro-int-constant LDBL_MAX_10_EXP >= 37 + +macro-constant FLT_MAX >= 1.0E37 +macro-constant DBL_MAX >= 1.0E37 +macro-constant LDBL_MAX >= 1.0E37 + +macro-constant FLT_EPSILON <= 1.0E-5 +macro-constant DBL_EPSILON <= 1.0E-9 +macro-constant LDBL_EPSILON <= 1.0E-9 + +macro-constant FLT_MIN <= 1.0E-37 +macro-constant DBL_MIN <= 1.0E-37 +macro-constant LDBL_MIN <= 1.0E-37 + +#if !defined ISO && !defined XPG4 && !defined XPG42 && !defined POSIX && !defined UNIX98 +macro-int-constant DECIMAL_DIG >= 10 +macro-int-constant FLT_EVAL_METHOD +#endif + +#if defined ISO11 +macro-int-constant DBL_HAS_SUBNORM +macro-int-constant FLT_HAS_SUBNORM +macro-int-constant LDBL_HAS_SUBNORM + +macro-int-constant DBL_DECIMAL_DIG >= 10 +macro-int-constant FLT_DECIMAL_DIG >= 6 +macro-int-constant LDBL_DECIMAL_DIG >= 10 + +macro-constant DBL_TRUE_MIN <= 1E-37 +macro-constant FLT_TRUE_MIN <= 1E-37 +macro-constant LDBL_TRUE_MIN <= 1E-37 +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif diff --git a/REORG.TODO/conform/data/fmtmsg.h-data b/REORG.TODO/conform/data/fmtmsg.h-data new file mode 100644 index 0000000000..c1b18ad4a4 --- /dev/null +++ b/REORG.TODO/conform/data/fmtmsg.h-data @@ -0,0 +1,63 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 && !defined XPG4 +macro MM_HARD +constant MM_HARD + +macro MM_SOFT +constant MM_SOFT + +macro MM_FIRM +constant MM_FIRM + +macro MM_APPL +constant MM_APPL + +macro MM_UTIL +constant MM_UTIL + +macro MM_OPSYS +constant MM_OPSYS + +macro MM_RECOVER +constant MM_RECOVER + +macro MM_NRECOV +constant MM_NRECOV + +macro MM_HALT +constant MM_HALT + +macro MM_ERROR +constant MM_ERROR + +macro MM_WARNING +constant MM_WARNING + +macro MM_INFO +constant MM_INFO + +macro MM_NOSEV +constant MM_NOSEV + +macro MM_PRINT +constant MM_PRINT + +macro MM_CONSOLE +constant MM_CONSOLE + +constant MM_NULLLBL == 0 +constant MM_NULLSEV == 0 +constant MM_NULLMC == 0 +constant MM_NULLTXT == 0 +constant MM_NULLACT == 0 +constant MM_NULLTAG == 0 + +macro MM_OK +macro MM_NOTOK +macro MM_NOMSG +macro MM_NOCON + +function int fmtmsg (long, const char*, int, const char*, const char*, const char*) + +allow *_t +allow MM_* +#endif diff --git a/REORG.TODO/conform/data/fnmatch.h-data b/REORG.TODO/conform/data/fnmatch.h-data new file mode 100644 index 0000000000..12a9a4ac2e --- /dev/null +++ b/REORG.TODO/conform/data/fnmatch.h-data @@ -0,0 +1,14 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +constant FNM_NOMATCH +constant FNM_PATHNAME +constant FNM_PERIOD +constant FNM_NOESCAPE +#if !defined POSIX && !defined XOPEN2K8 && !defined POSIX2008 +constant FNM_NOSYS +#endif + +function int fnmatch (const char*, const char*, int) + +allow FNM_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/ftw.h-data b/REORG.TODO/conform/data/ftw.h-data new file mode 100644 index 0000000000..340334bfd4 --- /dev/null +++ b/REORG.TODO/conform/data/ftw.h-data @@ -0,0 +1,35 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +# ifndef XPG4 +type {struct FTW} +element {struct FTW} int base +element {struct FTW} int level +# endif + +macro FTW_F +macro FTW_D +macro FTW_DNR +# if !defined XPG4 && !defined XPG42 +macro FTW_DP +# endif +macro FTW_NS + +# ifndef XPG4 +macro FTW_SL +macro FTW_SLN + +macro FTW_PHYS +macro FTW_MOUNT +macro FTW_DEPTH +macro FTW_CHDIR +# endif + +function int ftw (const char*, int (*) (const char *, const struct stat*, int), int) +# ifndef XPG4 +function int nftw (const char*, int (*) (const char *, const struct stat*, int, struct FTW *), int, int) +# endif + +allow-header sys/stat.h + +allow *_t +allow FTW* +#endif diff --git a/REORG.TODO/conform/data/glob.h-data b/REORG.TODO/conform/data/glob.h-data new file mode 100644 index 0000000000..eca83937af --- /dev/null +++ b/REORG.TODO/conform/data/glob.h-data @@ -0,0 +1,32 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +#ifdef POSIX +# define size_t __size_t +#endif + +type glob_t +element glob_t size_t gl_pathc +element glob_t {char**} gl_pathv +element glob_t size_t gl_offs + +constant GLOB_APPEND +constant GLOB_DOOFFS +constant GLOB_ERR +constant GLOB_MARK +constant GLOB_NOCHECK +constant GLOB_NOESCAPE +constant GLOB_NOSORT + +constant GLOB_ABORTED +constant GLOB_NOMATCH +constant GLOB_NOSPACE +# if !defined XOPEN2K8 && !defined POSIX2008 && !defined POSIX +constant GLOB_NOSYS +# endif + +function int glob (const char*, int, int (*) (const char*, int), glob_t*) +function void globfree (glob_t *) + +allow gl_* +allow GLOB_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/grp.h-data b/REORG.TODO/conform/data/grp.h-data new file mode 100644 index 0000000000..1688444586 --- /dev/null +++ b/REORG.TODO/conform/data/grp.h-data @@ -0,0 +1,30 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +#ifdef POSIX +# define gid_t __gid_t +#endif + +type {struct group} +element {struct group} {char*} gr_name +element {struct group} gid_t gr_gid +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*) +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**) +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function {struct group*} getgrent (void) +function void endgrent (void) +function void setgrent (void) +# endif + +allow gr_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/iconv.h-data b/REORG.TODO/conform/data/iconv.h-data new file mode 100644 index 0000000000..79fb2d6def --- /dev/null +++ b/REORG.TODO/conform/data/iconv.h-data @@ -0,0 +1,12 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !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*) +function int iconv_close (iconv_t) + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/inttypes.h-data b/REORG.TODO/conform/data/inttypes.h-data new file mode 100644 index 0000000000..2ae5b951be --- /dev/null +++ b/REORG.TODO/conform/data/inttypes.h-data @@ -0,0 +1,177 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +#include "stdint.h-data" + +type imaxdiv_t +element imaxdiv_t intmax_t rem +element imaxdiv_t intmax_t quot + +function intmax_t imaxabs (intmax_t) +function imaxdiv_t imaxdiv (intmax_t, intmax_t) +function intmax_t strtoimax (const char*, char**, int) +function uintmax_t strtoumax (const char*, char**, int) +function intmax_t wcstoimax (const __gwchar_t*, __gwchar_t**, int) +function uintmax_t wcstoumax (const __gwchar_t*, __gwchar_t**, int) + +macro PRId8 +macro PRIi8 +macro PRIo8 +macro PRIu8 +macro PRIx8 +macro PRIX8 +macro SCNd8 +macro SCNi8 +macro SCNo8 +macro SCNu8 +macro SCNx8 +macro PRIdLEAST8 +macro PRIiLEAST8 +macro PRIoLEAST8 +macro PRIuLEAST8 +macro PRIxLEAST8 +macro PRIXLEAST8 +macro SCNdLEAST8 +macro SCNiLEAST8 +macro SCNoLEAST8 +macro SCNuLEAST8 +macro SCNxLEAST8 +macro PRIdFAST8 +macro PRIiFAST8 +macro PRIoFAST8 +macro PRIuFAST8 +macro PRIxFAST8 +macro PRIXFAST8 +macro SCNdFAST8 +macro SCNiFAST8 +macro SCNoFAST8 +macro SCNuFAST8 +macro SCNxFAST8 + +macro PRId16 +macro PRIi16 +macro PRIo16 +macro PRIu16 +macro PRIx16 +macro PRIX16 +macro SCNd16 +macro SCNi16 +macro SCNo16 +macro SCNu16 +macro SCNx16 +macro PRIdLEAST16 +macro PRIiLEAST16 +macro PRIoLEAST16 +macro PRIuLEAST16 +macro PRIxLEAST16 +macro PRIXLEAST16 +macro SCNdLEAST16 +macro SCNiLEAST16 +macro SCNoLEAST16 +macro SCNuLEAST16 +macro SCNxLEAST16 +macro PRIdFAST16 +macro PRIiFAST16 +macro PRIoFAST16 +macro PRIuFAST16 +macro PRIxFAST16 +macro PRIXFAST16 +macro SCNdFAST16 +macro SCNiFAST16 +macro SCNoFAST16 +macro SCNuFAST16 +macro SCNxFAST16 + +macro PRId32 +macro PRIi32 +macro PRIo32 +macro PRIu32 +macro PRIx32 +macro PRIX32 +macro SCNd32 +macro SCNi32 +macro SCNo32 +macro SCNu32 +macro SCNx32 +macro PRIdLEAST32 +macro PRIiLEAST32 +macro PRIoLEAST32 +macro PRIuLEAST32 +macro PRIxLEAST32 +macro PRIXLEAST32 +macro SCNdLEAST32 +macro SCNiLEAST32 +macro SCNoLEAST32 +macro SCNuLEAST32 +macro SCNxLEAST32 +macro PRIdFAST32 +macro PRIiFAST32 +macro PRIoFAST32 +macro PRIuFAST32 +macro PRIxFAST32 +macro PRIXFAST32 +macro SCNdFAST32 +macro SCNiFAST32 +macro SCNoFAST32 +macro SCNuFAST32 +macro SCNxFAST32 + +macro PRId64 +macro PRIi64 +macro PRIo64 +macro PRIu64 +macro PRIx64 +macro PRIX64 +macro SCNd64 +macro SCNi64 +macro SCNo64 +macro SCNu64 +macro SCNx64 +macro PRIdLEAST64 +macro PRIiLEAST64 +macro PRIoLEAST64 +macro PRIuLEAST64 +macro PRIxLEAST64 +macro PRIXLEAST64 +macro SCNdLEAST64 +macro SCNiLEAST64 +macro SCNoLEAST64 +macro SCNuLEAST64 +macro SCNxLEAST64 +macro PRIdFAST64 +macro PRIiFAST64 +macro PRIoFAST64 +macro PRIuFAST64 +macro PRIxFAST64 +macro PRIXFAST64 +macro SCNdFAST64 +macro SCNiFAST64 +macro SCNoFAST64 +macro SCNuFAST64 +macro SCNxFAST64 + +macro PRIdMAX +macro PRIiMAX +macro PRIoMAX +macro PRIuMAX +macro PRIxMAX +macro PRIXMAX +macro SCNdMAX +macro SCNiMAX +macro SCNoMAX +macro SCNuMAX +macro SCNxMAX + +macro PRIdPTR +macro PRIiPTR +macro PRIoPTR +macro PRIuPTR +macro PRIxPTR +macro PRIXPTR +macro SCNdPTR +macro SCNiPTR +macro SCNoPTR +macro SCNuPTR +macro SCNxPTR + +allow PRI[Xa-z]* +allow SCN[Xa-z]* +#endif diff --git a/REORG.TODO/conform/data/iso646.h-data b/REORG.TODO/conform/data/iso646.h-data new file mode 100644 index 0000000000..9e307f734d --- /dev/null +++ b/REORG.TODO/conform/data/iso646.h-data @@ -0,0 +1,17 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 +macro and +macro and_eq +macro bitand +macro bitor +macro compl +macro not +macro not_eq +macro or +macro or_eq +macro xor +macro xor_eq + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif +#endif diff --git a/REORG.TODO/conform/data/langinfo.h-data b/REORG.TODO/conform/data/langinfo.h-data new file mode 100644 index 0000000000..6bbb3872a0 --- /dev/null +++ b/REORG.TODO/conform/data/langinfo.h-data @@ -0,0 +1,76 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +constant CODESET +constant D_T_FMT +constant D_FMT +constant T_FMT +constant T_FMT_AMPM +constant AM_STR +constant PM_STR +constant DAY_1 +constant DAY_2 +constant DAY_3 +constant DAY_4 +constant DAY_5 +constant DAY_6 +constant DAY_7 +constant ABDAY_1 +constant ABDAY_2 +constant ABDAY_3 +constant ABDAY_4 +constant ABDAY_5 +constant ABDAY_6 +constant ABDAY_7 +constant MON_1 +constant MON_2 +constant MON_3 +constant MON_4 +constant MON_5 +constant MON_6 +constant MON_7 +constant MON_8 +constant MON_9 +constant MON_10 +constant MON_11 +constant MON_12 +constant ABMON_1 +constant ABMON_2 +constant ABMON_3 +constant ABMON_4 +constant ABMON_5 +constant ABMON_6 +constant ABMON_7 +constant ABMON_8 +constant ABMON_9 +constant ABMON_10 +constant ABMON_11 +constant ABMON_12 +constant ERA +constant ERA_D_FMT +constant ERA_D_T_FMT +constant ERA_T_FMT +constant ALT_DIGITS +constant RADIXCHAR +constant THOUSEP +constant YESEXPR +constant NOEXPR +constant CRNCYSTR + +# if defined XPG4 || defined XPG42 || defined UNIX98 +constant YESSTR +constant NOSTR +# endif + +type nl_item +# if defined XOPEN2K8 || defined POSIX2008 +type locale_t +# endif + +function {char*} nl_langinfo (nl_item) +# if defined XOPEN2K8 || defined POSIX2008 +function {char*} nl_langinfo_l (nl_item, locale_t) +# endif + +allow-header nl_types.h + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/libgen.h-data b/REORG.TODO/conform/data/libgen.h-data new file mode 100644 index 0000000000..e9eb5fafc9 --- /dev/null +++ b/REORG.TODO/conform/data/libgen.h-data @@ -0,0 +1,6 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 && !defined XPG4 +function {char*} basename (char*) +function {char*} dirname (char*) + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/limits.h-data b/REORG.TODO/conform/data/limits.h-data new file mode 100644 index 0000000000..23114a5fa0 --- /dev/null +++ b/REORG.TODO/conform/data/limits.h-data @@ -0,0 +1,200 @@ +macro-int-constant CHAR_BIT >= 8 +macro-int-constant SCHAR_MIN {promoted:signed char} <= -127 +macro-int-constant SCHAR_MAX {promoted:signed char} >= 127 +macro-int-constant UCHAR_MAX {promoted:unsigned char} >= 255 +#ifdef __CHAR_UNSIGNED__ +macro-int-constant CHAR_MIN {promoted:char} == 0 +macro-int-constant CHAR_MAX {promoted:char} == UCHAR_MAX +#else +macro-int-constant CHAR_MIN {promoted:char} == SCHAR_MIN +macro-int-constant CHAR_MAX {promoted:char} == SCHAR_MAX +#endif +macro-int-constant MB_LEN_MAX >= 1 +macro-int-constant SHRT_MIN {promoted:short int} <= -32767 +macro-int-constant SHRT_MAX {promoted:short int} >= 32767 +macro-int-constant USHRT_MAX {promoted:unsigned short int} >= 65535 +// The ranges for int and unsigned int are from POSIX. +macro-int-constant INT_MAX {int} >= 2147483647 +macro-int-constant INT_MIN {int} <= -2147483647 +macro-int-constant UINT_MAX {unsigned int} >= 4294967295U +macro-int-constant LONG_MAX {long int} >= 2147483647L +macro-int-constant LONG_MIN {long int} <= -2147483647L +macro-int-constant ULONG_MAX {unsigned long int} >= 4294967295UL +#if defined ISO99 || defined ISO11 || defined XOPEN2K8 || defined POSIX2008 +macro-int-constant LLONG_MIN {long long int} <= -9223372036854775807ll +macro-int-constant LLONG_MAX {long long int} >= 9223372036854775807ll +macro-int-constant ULLONG_MAX {unsigned long long int} >= 18446744073709551615ull +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +// if these values exist, we should check the minimal value +allow AIO_LISTIO_MAX +allow AIO_MAX +allow AIO_PRIO_DELTA_MAX +allow ARG_MAX +#if !defined POSIX && !defined XPG4 +allow ATEXIT_MAX +#endif +allow CHILD_MAX +allow DELAYTIMER_MAX +#if !defined POSIX && !defined POSIX2008 && !defined XPG4 +allow IOV_MAX +#endif +allow LOGIN_NAME_MAX +allow MQ_OPEN_MAX +allow MQ_PRIO_MAX +allow OPEN_MAX +allow PAGESIZE +#if !defined POSIX && !defined POSIX2008 +allow PAGE_SIZE +#endif +allow PTHREAD_DESTRUCTOR_ITERATIONS +allow PTHREAD_KEYS_MAX +allow PTHREAD_STACK_MIN +allow PTHREAD_THREADS_MAX +allow RTSIG_MAX +allow SEM_NSEMS_MAX +allow SEM_VALUE_MAX +allow SIGQUEUE_MAX +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +allow SS_REPL_MAX +#endif +allow STREAM_MAX +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +allow SYMLOOP_MAX +#endif +allow TIMER_MAX +allow TTY_NAME_MAX +allow TZNAME_MAX + +#if !defined POSIX && !defined XPG4 && !defined XPG42 +allow FILESIZEBITS +#endif +allow LINK_MAX +allow MAX_CANON +allow MAX_INPUT +allow NAME_MAX +allow PATH_MAX +allow PIPE_BUF +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +allow POSIX_ALLOC_SIZE_MIN +allow POSIX_REC_INCR_XFER_SIZE +allow POSIX_REC_MAX_XFER_SIZE +allow POSIX_REC_XFER_ALIGN +allow SYMLINK_MAX +#endif + +macro-constant BC_BASE_MAX >= _POSIX2_BC_BASE_MAX +macro-constant BC_DIM_MAX >= _POSIX2_BC_DIM_MAX +macro-constant BC_SCALE_MAX >= _POSIX2_BC_SCALE_MAX +macro-constant BC_STRING_MAX >= _POSIX2_BC_STRING_MAX +#if !defined POSIX && !defined XPG4 && !defined XPG42 +macro CHARCLASS_NAME_MAX +#endif +macro-constant COLL_WEIGHTS_MAX >= _POSIX2_COLL_WEIGHTS_MAX +macro-constant EXPR_NEST_MAX >= _POSIX2_EXPR_NEST_MAX +macro-constant LINE_MAX >= _POSIX2_LINE_MAX +constant NGROUPS_MAX >= 8 +macro-constant RE_DUP_MAX >= _POSIX2_RE_DUP_MAX + +constant _POSIX_CLOCKRES_MIN == 20000000 + +constant _POSIX_AIO_LISTIO_MAX == 2 +constant _POSIX_AIO_MAX == 1 +constant _POSIX_ARG_MAX == 4096 +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +constant _POSIX_CHILD_MAX == 25 +#else +constant _POSIX_CHILD_MAX == 6 +#endif +constant _POSIX_DELAYTIMER_MAX == 32 +constant _POSIX_LINK_MAX == 8 +constant _POSIX_LOGIN_NAME_MAX == 9 +constant _POSIX_MAX_CANON == 255 +constant _POSIX_MAX_INPUT == 255 +constant _POSIX_MQ_OPEN_MAX == 8 +constant _POSIX_MQ_PRIO_MAX == 32 +constant _POSIX_NAME_MAX == 14 +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +constant _POSIX_NGROUPS_MAX == 8 +#else +constant _POSIX_NGROUPS_MAX == 0 +#endif +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +constant _POSIX_OPEN_MAX == 20 +#else +constant _POSIX_OPEN_MAX == 16 +#endif +// Value was 255, corrected to 256 following an interpretation request. +constant _POSIX_PATH_MAX == 256 +constant _POSIX_PIPE_BUF == 512 +constant _POSIX_RTSIG_MAX == 8 +constant _POSIX_SEM_NSEMS_MAX == 256 +constant _POSIX_SEM_VALUE_MAX == 32767 +constant _POSIX_SIGQUEUE_MAX == 32 +constant _POSIX_SSIZE_MAX == 32767 +constant _POSIX_STREAM_MAX == 8 +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +optional-constant _POSIX_SS_REPL_MAX == 4 +optional-constant _POSIX_SYMLINK_MAX == 255 +optional-constant _POSIX_SYMLOOP_MAX == 8 +#endif +constant _POSIX_THREAD_DESTRUCTOR_ITERATIONS == 4 +constant _POSIX_THREAD_KEYS_MAX == 128 +constant _POSIX_THREAD_THREADS_MAX == 64 +constant _POSIX_TIMER_MAX == 32 +constant _POSIX_TTY_NAME_MAX == 9 +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +constant _POSIX_TZNAME_MAX == 6 +#else +constant _POSIX_TZNAME_MAX == 3 +#endif +macro-constant _POSIX2_BC_BASE_MAX == 99 +macro-constant _POSIX2_BC_DIM_MAX == 2048 +macro-constant _POSIX2_BC_SCALE_MAX == 99 +macro-constant _POSIX2_BC_STRING_MAX == 1000 +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +constant _POSIX2_CHARCLASS_NAME_MAX == 14 +#endif +macro-constant _POSIX2_COLL_WEIGHTS_MAX == 2 +macro-constant _POSIX2_EXPR_NEST_MAX == 32 +macro-constant _POSIX2_LINE_MAX == 2048 +macro-constant _POSIX2_RE_DUP_MAX == 255 +#if !defined POSIX && !defined POSIX2008 && !defined XPG4 +optional-constant _XOPEN_IOV_MAX == 16 +#endif + +#if !defined POSIX && !defined POSIX2008 +constant WORD_BIT >= 16 +constant LONG_BIT >= 32 +#endif +constant SSIZE_MAX + +#if !defined POSIX +optional-constant CHARCLASS_NAME_MAX >= 14 +#endif +#if !defined POSIX +optional-constant NL_ARGMAX >= 9 +# if !defined POSIX2008 +optional-constant NL_LANGMAX >= 14 +# endif +optional-constant NL_MSGMAX >= 32767 +# if !defined XOPEN2K8 && !defined POSIX2008 +optional-constant NL_NMAX +# endif +optional-constant NL_SETMAX >= 255 +optional-constant NL_TEXTMAX +# if !defined POSIX2008 +optional-constant NZERO >= 20 +# endif +#endif +#if defined XPG4 || defined XPG42 || defined UNIX98 +optional-constant TMP_MAX >= 10000 +#endif + +allow *_MAX +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +allow *_MIN +#endif +allow *_t +#endif diff --git a/REORG.TODO/conform/data/locale.h-data b/REORG.TODO/conform/data/locale.h-data new file mode 100644 index 0000000000..266264ac6d --- /dev/null +++ b/REORG.TODO/conform/data/locale.h-data @@ -0,0 +1,70 @@ +type {struct lconv} +element {struct lconv} {char*} currency_symbol +element {struct lconv} {char*} decimal_point +element {struct lconv} char frac_digits +element {struct lconv} {char*} grouping +element {struct lconv} {char*} int_curr_symbol +element {struct lconv} char int_frac_digits +element {struct lconv} {char*} mon_decimal_point +element {struct lconv} {char*} mon_thousands_sep +element {struct lconv} {char*} mon_grouping +element {struct lconv} {char*} negative_sign +element {struct lconv} char n_cs_precedes +element {struct lconv} char n_sep_by_space +element {struct lconv} char n_sign_posn +element {struct lconv} {char*} positive_sign +element {struct lconv} char p_cs_precedes +element {struct lconv} char p_sep_by_space +element {struct lconv} char p_sign_posn +element {struct lconv} {char*} thousands_sep +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +element {struct lconv} char int_n_cs_precedes +element {struct lconv} char int_n_sep_by_space +element {struct lconv} char int_n_sign_posn +element {struct lconv} char int_p_cs_precedes +element {struct lconv} char int_p_sep_by_space +element {struct lconv} char int_p_sign_posn +#endif + +macro-constant NULL == 0 + +macro-int-constant LC_ALL +macro-int-constant LC_COLLATE +macro-int-constant LC_CTYPE +#if !defined ISO && !defined ISO99 && !defined ISO11 +macro-int-constant LC_MESSAGES +#endif +macro-int-constant LC_MONETARY +macro-int-constant LC_NUMERIC +macro-int-constant LC_TIME + +#if defined XOPEN2K8 || defined POSIX2008 +constant LC_GLOBAL_LOCALE + +macro LC_COLLATE_MASK +macro LC_CTYPE_MASK +macro LC_MESSAGES_MASK +macro LC_MONETARY_MASK +macro LC_NUMERIC_MASK +macro LC_TIME_MASK +macro LC_ALL_MASK + +type locale_t +#endif + +function {struct lconv*} localeconv (void) +function {char*} setlocale (int, const char*) +#if defined XOPEN2K8 || defined POSIX2008 +function locale_t duplocale (locale_t) +function void freelocale (locale_t) +function locale_t newlocale (int, const char*, locale_t) +function locale_t uselocale (locale_t) +#endif + +allow LC_[ABCDEFGHIJKLMNOPQRSTUVWXYZ]* +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif +#if defined XOPEN2K8 || defined POSIX2008 +allow LC_*_MASK +#endif diff --git a/REORG.TODO/conform/data/math.h-data b/REORG.TODO/conform/data/math.h-data new file mode 100644 index 0000000000..0c50755792 --- /dev/null +++ b/REORG.TODO/conform/data/math.h-data @@ -0,0 +1,335 @@ +macro-constant HUGE_VAL {double} + +#if !defined ISO && !defined POSIX +# if !defined XPG4 && !defined XPG42 && !defined UNIX98 +macro fpclassify +macro isfinite +macro isinf +macro isnan +macro isnormal +macro signbit +macro isgreater +macro isgreaterequal +macro isless +macro islessequal +macro islessgreater +macro isunordered +type float_t +type double_t +# endif +# if defined XPG4 || defined XPG42 || defined UNIX98 +function int isnan (double) +# endif + +# if !defined ISO99 && !defined ISO11 && !defined POSIX2008 +constant M_E +constant M_LOG2E +constant M_LOG10E +constant M_LN2 +constant M_LN10 +constant M_PI +constant M_PI_2 +constant M_PI_4 +constant M_1_PI +constant M_2_PI +constant M_2_SQRTPI +constant M_SQRT2 +constant M_SQRT1_2 + +constant MAXFLOAT +# endif +# if !defined XPG4 && !defined XPG42 && !defined UNIX98 +macro-constant HUGE_VALF {float} +macro-constant HUGE_VALL {long double} +macro-constant INFINITY {float} +macro-constant NAN {float} + +macro-int-constant FP_INFINITE +macro-int-constant FP_NAN +macro-int-constant FP_NORMAL +macro-int-constant FP_SUBNORMAL +macro-int-constant FP_ZERO + +optional-macro-int-constant FP_FAST_FMA {int} == 1 +optional-macro-int-constant FP_FAST_FMAF {int} == 1 +optional-macro-int-constant FP_FAST_FMAL {int} == 1 + +macro-int-constant FP_ILOGB0 +macro-int-constant FP_ILOGBNAN + +macro-int-constant MATH_ERRNO {int} == 1 +macro-int-constant MATH_ERREXCEPT {int} == 2 + +macro math_errhandling {int} +# endif +#endif + +function double acos (double) +function double asin (double) +function double atan (double) +function double atan2 (double, double) +function double ceil (double) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function double copysign (double, double) +#endif +function double cos (double) +function double cosh (double) +function double exp (double) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function double exp2 (double) +#endif +function double fabs (double) +function double floor (double) +function double fmod (double, double) +function double frexp (double, int*) +function double ldexp (double, int) +function double log (double) +function double log10 (double) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function double log2 (double) +#endif +function double modf (double, double*) +function double pow (double, double) +function double sin (double) +function double sinh (double) +function double sqrt (double) +function double tan (double) +function double tanh (double) +#if !defined ISO && !defined POSIX +function double erf (double) +function double erfc (double) +#endif +#if defined XPG4 || defined XPG42 || defined UNIX98 +function double gamma (double) +#endif +#if !defined ISO && !defined POSIX +function double hypot (double, double) +# if !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function double j0 (double) +function double j1 (double) +function double jn (int, double) +# endif +function double lgamma (double) +# if !defined XPG4 && !defined XPG42 && !defined UNIX98 +function double tgamma (double) +# endif +# if !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function double y0 (double) +function double y1 (double) +function double yn (int, double) +# endif +# if !defined XPG4 +function double acosh (double) +function double asinh (double) +function double atanh (double) +function double cbrt (double) +function double expm1 (double) +function int ilogb (double) +function double log1p (double) +function double logb (double) +function double nextafter (double, double) +# if !defined XPG42 && !defined UNIX98 +function double nexttoward (double, long double) +function double nearbyint (double) +# endif +function double remainder (double, double) +function double rint (double) +# if !defined XPG42 && !defined UNIX98 +function double round (double) +function double trunc (double) +function long lrint (double) +function {long long} llrint (double) +function long lround (double) +function {long long} llround (double) +function double remquo (double, double, int*) +# endif +# if defined XPG42 || defined UNIX98 || defined XOPEN2K +function double scalb (double, double) +# endif +# if !defined XPG42 && !defined UNIX98 +function double scalbn (double, int) +function double scalbln (double, long) +function double fdim (double, double) +function double fmax (double, double) +function double fmin (double, double) +function double fma (double, double, double) +function double nan (const char*) +# endif +# endif + +# if !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +// variable signgam +allow signgam +# endif +#endif + +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function float acosf (float) +function float asinf (float) +function float atanf (float) +function float atan2f (float, float) +function float ceilf (float) +function float copysignf (float, float) +function float cosf (float) +function float coshf (float) +function float expf (float) +function float exp2f (float) +function float fabsf (float) +function float floorf (float) +function float fmodf (float, float) +function float frexpf (float, int*) +function float ldexpf (float, int) +function float logf (float) +function float log10f (float) +function float log2f (float) +function float modff (float, float*) +function float powf (float, float) +function float sinf (float) +function float sinhf (float) +function float sqrtf (float) +function float tanf (float) +function float tanhf (float) +function float erff (float) +function float erfcf (float) +function float hypotf (float, float) +function float lgammaf (float) +function float tgammaf (float) +function float acoshf (float) +function float asinhf (float) +function float atanhf (float) +function float cbrtf (float) +function float expm1f (float) +function int ilogbf (float) +function float log1pf (float) +function float logbf (float) +function float nextafterf (float, float) +function float nexttowardf (float, long double) +function float nearbyintf (float) +function float remainderf (float, float) +function float rintf (float) +function float roundf (float) +function float truncf (float) +function long lrintf (float) +function {long long} llrintf (float) +function long lroundf (float) +function {long long} llroundf (float) +function float remquof (float, float, int*) +function float scalbnf (float, int) +function float scalblnf (float, long) +function float fdimf (float, float) +function float fmaxf (float, float) +function float fminf (float, float) +function float fmaf (float, float, float) +function float nanf (const char*) + +function {long double} acosl (long double) +function {long double} asinl (long double) +function {long double} atanl (long double) +function {long double} atan2l (long double, long double) +function {long double} ceill (long double) +function {long double} copysignl (long double, long double) +function {long double} cosl (long double) +function {long double} coshl (long double) +function {long double} expl (long double) +function {long double} exp2l (long double) +function {long double} fabsl (long double) +function {long double} floorl (long double) +function {long double} fmodl (long double, long double) +function {long double} frexpl (long double, int*) +function {long double} ldexpl (long double, int) +function {long double} logl (long double) +function {long double} log10l (long double) +function {long double} log2l (long double) +function {long double} modfl (long double, long double*) +function {long double} powl (long double, long double) +function {long double} sinl (long double) +function {long double} sinhl (long double) +function {long double} sqrtl (long double) +function {long double} tanl (long double) +function {long double} tanhl (long double) +function {long double} erfl (long double) +function {long double} erfcl (long double) +function {long double} hypotl (long double, long double) +function {long double} lgammal (long double) +function {long double} tgammal (long double) +function {long double} acoshl (long double) +function {long double} asinhl (long double) +function {long double} atanhl (long double) +function {long double} cbrtl (long double) +function {long double} expm1l (long double) +function int ilogbl (long double) +function {long double} log1pl (long double) +function {long double} logbl (long double) +function {long double} nextafterl (long double, long double) +function {long double} nexttowardl (long double, long double) +function {long double} nearbyintl (long double) +function {long double} remainderl (long double, long double) +function {long double} rintl (long double) +function {long double} roundl (long double) +function {long double} truncl (long double) +function long lrintl (long double) +function {long long} llrintl (long double) +function long lroundl (long double) +function {long long} llroundl (long double) +function {long double} remquol (long double, long double, int*) +function {long double} scalbnl (long double, int) +function {long double} scalblnl (long double, long) +function {long double} fdiml (long double, long double) +function {long double} fmaxl (long double, long double) +function {long double} fminl (long double, long double) +function {long double} fmal (long double, long double, long double) +function {long double} nanl (const char*) +#else +allow acosf +allow asinf +allow atanf +allow atan2f +allow ceilf +allow cosf +allow coshf +allow expf +allow fabsf +allow floorf +allow fmodf +allow frexpf +allow ldexpf +allow logf +allow log10f +allow modff +allow powf +allow sinf +allow sinhf +allow sqrtf +allow tanf +allow tanhf + +allow acosl +allow asinl +allow atanl +allow atan2l +allow ceill +allow cosl +allow coshl +allow expl +allow fabsl +allow floorl +allow fmodl +allow frexpl +allow ldexpl +allow logl +allow log10l +allow modfl +allow powl +allow sinl +allow sinhl +allow sqrtl +allow tanl +allow tanhl +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +allow FP_[ABCDEFGHIJKLMNOPQRSTUVWXYZ]* +#endif diff --git a/REORG.TODO/conform/data/monetary.h-data b/REORG.TODO/conform/data/monetary.h-data new file mode 100644 index 0000000000..4f0cb9b681 --- /dev/null +++ b/REORG.TODO/conform/data/monetary.h-data @@ -0,0 +1,14 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +type size_t +type ssize_t +# if defined XOPEN2K8 || defined POSIX2008 +type locale_t +# endif + +function ssize_t strfmon (char*, size_t, const char*, ...) +# if defined XOPEN2K8 || defined POSIX2008 +function ssize_t strfmon_l (char*, size_t, locale_t, const char*, ...) +# endif + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/mqueue.h-data b/REORG.TODO/conform/data/mqueue.h-data new file mode 100644 index 0000000000..42ccd8551e --- /dev/null +++ b/REORG.TODO/conform/data/mqueue.h-data @@ -0,0 +1,47 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined XPG42 +// should test for not an array type. +type mqd_t + +type {struct sigevent} +element {struct sigevent} int sigev_notify +element {struct sigevent} int sigev_signo +element {struct sigevent} {union sigval} sigev_value +element {struct sigevent} {void(*} sigev_notify_function )(union sigval) +element {struct sigevent} {pthread_attr_t*} sigev_notify_attributes + +type {struct mq_attr} +// Bug 21279: mq_attr elements have wrong type. +xfail[x86_64-x32-linux]-element {struct mq_attr} long mq_flags +xfail[x86_64-x32-linux]-element {struct mq_attr} long mq_maxmsg +xfail[x86_64-x32-linux]-element {struct mq_attr} long mq_msgsize +xfail[x86_64-x32-linux]-element {struct mq_attr} long mq_curmsgs + +function int mq_close (mqd_t) +function int mq_getattr (mqd_t, struct mq_attr*) +function int mq_notify (mqd_t, const struct sigevent*) +function mqd_t mq_open (const char*, int, ...) +function ssize_t mq_receive (mqd_t, char*, size_t, unsigned int*) +function int mq_send (mqd_t, const char*, size_t, unsigned int) +function int mq_setattr (mqd_t, const struct mq_attr*, struct mq_attr*) +function int mq_unlink (const char*) +#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +optional-function ssize_t mq_timedreceive (mqd_t, char*, size_t, unsigned int*, const struct timespec*) +optional-function int mq_timedsend (mqd_t, const char*, size_t, unsigned int, const struct timespec*) +#endif + +#if defined XOPEN2K8 || defined POSIX2008 +type pthread_attr_t +type size_t +type ssize_t +type {struct timespec} +#endif + +allow-header fcntl.h +allow-header signal.h +allow-header sys/types.h +allow-header time.h + +allow mq_* +allow MQ_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/ndbm.h-data b/REORG.TODO/conform/data/ndbm.h-data new file mode 100644 index 0000000000..2ee7a59253 --- /dev/null +++ b/REORG.TODO/conform/data/ndbm.h-data @@ -0,0 +1,28 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 && !defined XPG4 +type datum +element datum {void*} dptr +element datum size_t dsize + +type size_t + +type DBM + +type mode_t + +constant DBM_INSERT +constant DBM_REPLACE + +function int dbm_clearerr (DBM*) +function void dbm_close (DBM*) +function int dbm_delete (DBM*, datum) +function int dbm_error (DBM*) +function datum dbm_fetch (DBM*, datum) +function datum dbm_firstkey (DBM*) +function datum dbm_nextkey (DBM*) +function {DBM*} dbm_open (const char*, int, mode_t) +function int dbm_store (DBM*, datum, datum, int) + +allow dbm_* +allow DBM_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/net/if.h-data b/REORG.TODO/conform/data/net/if.h-data new file mode 100644 index 0000000000..8a4d89c067 --- /dev/null +++ b/REORG.TODO/conform/data/net/if.h-data @@ -0,0 +1,16 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +type {struct if_nameindex} + +element {struct if_nameindex} {unsigned int} if_index +element {struct if_nameindex} {char*} if_name + +macro IF_NAMESIZE + +function {unsigned int} if_nametoindex (const char*) +function {char*} if_indextoname (unsigned int, char*) +function {struct if_nameindex*} if_nameindex (void) +function void if_freenameindex (struct if_nameindex*) + +allow *_t +allow IF_* +#endif diff --git a/REORG.TODO/conform/data/netdb.h-data b/REORG.TODO/conform/data/netdb.h-data new file mode 100644 index 0000000000..c6d8b70a0d --- /dev/null +++ b/REORG.TODO/conform/data/netdb.h-data @@ -0,0 +1,118 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +optional-type in_port_t +optional-type in_addr_t + +type {struct hostent} + +element {struct hostent} {char*} h_name +element {struct hostent} {char**} h_aliases +element {struct hostent} int h_addrtype +element {struct hostent} int h_length +element {struct hostent} {char**} h_addr_list + +type {struct netent} + +element {struct netent} {char*} n_name +element {struct netent} {char**} n_aliases +element {struct netent} int n_addrtype +// Bug 21260: n_net has wrong type. +xfail[alpha-linux]-element {struct netent} uint32_t n_net + +type uint32_t + +type {struct protoent} + +element {struct protoent} {char*} p_name +element {struct protoent} {char**} p_aliases +element {struct protoent} int p_proto + +type {struct servent} + +element {struct servent} {char*} s_name +element {struct servent} {char**} s_aliases +element {struct servent} int s_port +element {struct servent} {char*} s_proto + +macro IPPORT_RESERVED + +#if !defined XOPEN2K8 && !defined POSIX2008 +// variable int h_errno +allow h_errno + +macro HOST_NOT_FOUND +macro NO_DATA +macro NO_RECOVERY +macro TRY_AGAIN +#endif + +#if !defined XPG42 && !defined UNIX98 +type {struct addrinfo} +element {struct addrinfo} int ai_flags +element {struct addrinfo} int ai_family +element {struct addrinfo} int ai_socktype +element {struct addrinfo} int ai_protocol +element {struct addrinfo} socklen_t ai_addrlen +element {struct addrinfo} {struct sockaddr*} ai_addr +element {struct addrinfo} {char*} ai_canonname +element {struct addrinfo} {struct addrinfo*} ai_next + +macro AI_PASSIVE +macro AI_CANONNAME +macro AI_NUMERICHOST +macro AI_V4MAPPED +macro AI_ALL +macro AI_ADDRCONFIG +macro AI_NUMERICSERV + +macro NI_NOFQDN +macro NI_NUMERICHOST +macro NI_NAMEREQD +macro NI_NUMERICSERV +macro NI_DGRAM + +macro EAI_AGAIN +macro EAI_BADFLAGS +macro EAI_FAIL +macro EAI_FAMILY +macro EAI_MEMORY +macro EAI_NONAME +macro EAI_SERVICE +macro EAI_SOCKTYPE +macro EAI_SYSTEM +macro EAI_OVERFLOW +#endif + +function void endhostent (void) +function void endnetent (void) +function void endprotoent (void) +function void endservent (void) +#if !defined XPG42 && !defined UNIX98 +function void freeaddrinfo (struct addrinfo*) +function {const char*} gai_strerror (int) +function int getaddrinfo (const char*, const char*, const struct addrinfo*, struct addrinfo**) +#endif +function {struct hostent*} gethostbyaddr (const void*, socklen_t, int) +function {struct hostent*} gethostbyname (const char*) +function {struct hostent*} gethostent (void) +#if !defined XPG42 && !defined UNIX98 +function int getnameinfo (const struct sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, int) +#endif +function {struct netent*} getnetbyaddr (uint32_t, int) +function {struct netent*} getnetbyname (const char*) +function {struct netent*} getnetent (void) +function {struct protoent*} getprotobyname (const char *) +function {struct protoent*} getprotobynumber (int) +function {struct protoent*} getprotoent (void) +function {struct servent*} getservbyname (const char*, const char*) +function {struct servent*} getservbyport (int, const char*) +function {struct servent*} getservent (void) +function void sethostent (int) +function void setnetent (int) +function void setprotoent (int) +function void setservent (int) + +type socklen_t + +allow-header netinet/in.h +allow-header inttypes.h +#endif diff --git a/REORG.TODO/conform/data/netinet/in.h-data b/REORG.TODO/conform/data/netinet/in.h-data new file mode 100644 index 0000000000..ac26a74e9e --- /dev/null +++ b/REORG.TODO/conform/data/netinet/in.h-data @@ -0,0 +1,95 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +type in_port_t +type in_addr_t + +type sa_family_t + +type {struct in_addr} + +element {struct in_addr} in_addr_t s_addr + +type {struct sockaddr_in} + +element {struct sockaddr_in} sa_family_t sin_family +element {struct sockaddr_in} in_port_t sin_port +element {struct sockaddr_in} {struct in_addr} sin_addr +element {struct sockaddr_in} {unsigned char} sin_zero [8] + +type {struct in6_addr} + +element {struct in6_addr} uint8_t s6_addr [16] + +type {struct sockaddr_in6} + +element {struct sockaddr_in6} sa_family_t sin6_family +element {struct sockaddr_in6} in_port_t sin6_port +element {struct sockaddr_in6} uint32_t sin6_flowinfo +element {struct sockaddr_in6} {struct in6_addr} sin6_addr +element {struct sockaddr_in6} uint32_t sin6_scope_id + +variable {const struct in6_addr} in6addr_any + +// constant IN6ADDR_ANY_INIT +macro IN6ADDR_ANY_INIT + +variable {const struct in6_addr} in6addr_loopback + +// constant IN6ADDR_LOOPBACK_INIT +macro IN6ADDR_LOOPBACK_INIT + +type {struct ipv6_mreq} + +element {struct ipv6_mreq} {struct in6_addr} ipv6mr_multiaddr +element {struct ipv6_mreq} {unsigned int} ipv6mr_interface + +macro IPPROTO_IP +macro IPPROTO_IPV6 +macro IPPROTO_ICMP +macro IPPROTO_TCP +macro IPPROTO_UDP + +macro INADDR_ANY +macro INADDR_BROADCAST + +constant INET_ADDRSTRLEN == 16 + +function uint32_t htonl (uint32_t) +function uint16_t htons (uint16_t) +function uint32_t ntohl (uint32_t) +function uint16_t ntohs (uint16_t) + +allow-header inttypes.h +allow-header sys/socket.h + +constant INET6_ADDRSTRLEN == 46 + +macro IPV6_JOIN_GROUP +macro IPV6_LEAVE_GROUP +macro IPV6_MULTICAST_HOPS +macro IPV6_MULTICAST_IF +macro IPV6_MULTICAST_LOOP +macro IPV6_UNICAST_HOPS + +macro IN6_IS_ADDR_UNSPECIFIED +macro IN6_IS_ADDR_LOOPBACK +macro IN6_IS_ADDR_MULTICAST +macro IN6_IS_ADDR_LINKLOCAL +macro IN6_IS_ADDR_SITELOCAL +macro IN6_IS_ADDR_V4MAPPED +macro IN6_IS_ADDR_V4COMPAT +macro IN6_IS_ADDR_MC_NODELOCAL +macro IN6_IS_ADDR_MC_LINKLOCAL +macro IN6_IS_ADDR_MC_SITELOCAL +macro IN6_IS_ADDR_MC_ORGLOCAL +macro IN6_IS_ADDR_MC_GLOBAL + +allow IMPLINK_* +allow IN_* +allow IN6_* +allow INADDR_* +allow IP_* +allow IPV6_* +allow IPPORT_* +allow IPPROTO_* +allow SOCK_* +#endif diff --git a/REORG.TODO/conform/data/netinet/tcp.h-data b/REORG.TODO/conform/data/netinet/tcp.h-data new file mode 100644 index 0000000000..298808780d --- /dev/null +++ b/REORG.TODO/conform/data/netinet/tcp.h-data @@ -0,0 +1,5 @@ +#if defined XOPEN2K || defined POSIX2008 || defined XOPEN2K8 +macro TCP_NODELAY + +allow TCP_* +#endif diff --git a/REORG.TODO/conform/data/nl_types.h-data b/REORG.TODO/conform/data/nl_types.h-data new file mode 100644 index 0000000000..67a0d7a198 --- /dev/null +++ b/REORG.TODO/conform/data/nl_types.h-data @@ -0,0 +1,14 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +type nl_catd +type nl_item + +constant NL_SETD +constant NL_CAT_LOCALE + +function int catclose (nl_catd) +function {char*} catgets (nl_catd, int, int, const char*) +function nl_catd catopen (const char*, int) + +allow NL_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/poll.h-data b/REORG.TODO/conform/data/poll.h-data new file mode 100644 index 0000000000..f7ebb91715 --- /dev/null +++ b/REORG.TODO/conform/data/poll.h-data @@ -0,0 +1,27 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +type {struct pollfd} +element {struct pollfd} int fd +element {struct pollfd} {short int} events +element {struct pollfd} {short int} revents + +type nfds_t + +constant POLLIN +constant POLLRDNORM +constant POLLRDBAND +constant POLLPRI +constant POLLOUT +constant POLLWRNORM +constant POLLWRBAND +constant POLLERR +constant POLLHUP +constant POLLNVAL + +function int poll (struct pollfd[], nfds_t, int) + +allow pd_* +allow ph_* +allow ps_* +allow POLL* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/pthread.h-data b/REORG.TODO/conform/data/pthread.h-data new file mode 100644 index 0000000000..6b10499458 --- /dev/null +++ b/REORG.TODO/conform/data/pthread.h-data @@ -0,0 +1,195 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined XPG42 +constant PTHREAD_CANCEL_ASYNCHRONOUS +constant PTHREAD_CANCEL_ENABLE +constant PTHREAD_CANCEL_DEFERRED +constant PTHREAD_CANCEL_DISABLE +constant PTHREAD_CANCELED +macro PTHREAD_COND_INITIALIZER +constant PTHREAD_CREATE_DETACHED +constant PTHREAD_CREATE_JOINABLE +constant PTHREAD_EXPLICIT_SCHED +constant PTHREAD_INHERIT_SCHED +constant PTHREAD_ONCE_INIT +optional-constant PTHREAD_PRIO_INHERIT +optional-constant PTHREAD_PRIO_NONE +optional-constant PTHREAD_PRIO_PROTECT +constant PTHREAD_PROCESS_SHARED +constant PTHREAD_PROCESS_PRIVATE +constant PTHREAD_SCOPE_PROCESS +constant PTHREAD_SCOPE_SYSTEM +macro PTHREAD_MUTEX_INITIALIZER +# ifndef POSIX +constant PTHREAD_MUTEX_DEFAULT +constant PTHREAD_MUTEX_ERRORCHECK +constant PTHREAD_MUTEX_NORMAL +constant PTHREAD_MUTEX_RECURSIVE +macro PTHREAD_RWLOCK_INITIALIZER +# endif +# if defined XOPEN2K8 || defined POSIX2008 +constant PTHREAD_MUTEX_ROBUST +constant PTHREAD_MUTEX_STALLED +# endif + +# ifndef POSIX +type pthread_attr_t +# ifndef UNIX98 +type pthread_barrier_t +type pthread_barrierattr_t +# endif +type pthread_cond_t +type pthread_condattr_t +type pthread_key_t +type pthread_mutex_t +type pthread_mutexattr_t +type pthread_once_t +type pthread_rwlock_t +type pthread_rwlockattr_t +# ifndef UNIX98 +type pthread_spinlock_t +# endif +type pthread_t +# endif + +function int pthread_atfork (void (*) (void), void (*) (void), void (*) (void)) +function int pthread_attr_destroy (pthread_attr_t*) +function int pthread_attr_getdetachstate (const pthread_attr_t*, int*) +# ifndef POSIX +function int pthread_attr_getguardsize (const pthread_attr_t*, size_t*) +# endif +function int pthread_attr_getinheritsched (const pthread_attr_t*, int*) +function int pthread_attr_getschedparam (const pthread_attr_t*, struct sched_param*) +function int pthread_attr_getschedpolicy (const pthread_attr_t*, int*) +function int pthread_attr_getscope (const pthread_attr_t*, int*) +function int pthread_attr_getstackaddr (const pthread_attr_t*, void**) +function int pthread_attr_getstacksize (const pthread_attr_t*, size_t*) +function int pthread_attr_init (pthread_attr_t*) +function int pthread_attr_setdetachstate (pthread_attr_t*, int) +# ifndef POSIX +function int pthread_attr_setguardsize (pthread_attr_t*, size_t) +# endif +function int pthread_attr_setinheritsched (pthread_attr_t*, int) +function int pthread_attr_setschedparam (pthread_attr_t*, const struct sched_param*) +function int pthread_attr_setschedpolicy (pthread_attr_t*, int) +function int pthread_attr_setscope (pthread_attr_t*, int) +function int pthread_attr_setstackaddr (pthread_attr_t*, void*) +function int pthread_attr_setstacksize (pthread_attr_t*, size_t) +# if !defined POSIX && !defined UNIX98 +function int pthread_barrier_destroy (pthread_barrier_t*) +function int pthread_barrier_init (pthread_barrier_t*, const pthread_barrierattr_t*, unsigned int) +function int pthread_barrier_wait (pthread_barrier_t*) +function int pthread_barrierattr_destroy (pthread_barrierattr_t*) +function int pthread_barrierattr_getpshared (const pthread_barrierattr_t*, int*) +function int pthread_barrierattr_init (pthread_barrierattr_t*) +function int pthread_barrierattr_setpshared (pthread_barrierattr_t*, int) +# endif +function int pthread_cancel (pthread_t) +// function int pthread_cleanup_push (void (*) (void*), void*) +macro pthread_cleanup_push +// function int pthread_cleanup_pop (int) +macro pthread_cleanup_pop +function int pthread_cond_broadcast (pthread_cond_t*) +function int pthread_cond_destroy (pthread_cond_t*) +function int pthread_cond_init (pthread_cond_t*, const pthread_condattr_t*) +function int pthread_cond_signal (pthread_cond_t*) +function int pthread_cond_timedwait (pthread_cond_t*, pthread_mutex_t*, const struct timespec*) +function int pthread_cond_wait (pthread_cond_t*, pthread_mutex_t*) +function int pthread_condattr_destroy (pthread_condattr_t*) +#if !defined POSIX && !defined UNIX98 && !defined XOPEN2K +optional-function int pthread_condattr_getclock (const pthread_condattr_t*, clockid_t*) +#endif +function int pthread_condattr_getpshared (const pthread_condattr_t*, int*) +function int pthread_condattr_init (pthread_condattr_t*) +#if !defined POSIX && !defined UNIX98 && !defined XOPEN2K +optional-function int pthread_condattr_setclock (pthread_condattr_t*, clockid_t) +#endif +function int pthread_condattr_setpshared (pthread_condattr_t*, int) +function int pthread_create (pthread_t*, const pthread_attr_t*, void *(*) (void*), void*) +function int pthread_detach (pthread_t) +function int pthread_equal (pthread_t, pthread_t) +function void pthread_exit (void*) +# if !defined POSIX && !defined POSIX2008 +function int pthread_getconcurrency (void) +# endif +# if !defined POSIX && !defined UNIX98 +function int pthread_getcpuclockid (pthread_t, clockid_t*) +# endif +function int pthread_getschedparam (pthread_t, int*, struct sched_param*) +function {void*} pthread_getspecific (pthread_key_t) +function int pthread_join (pthread_t, void**) +function int pthread_key_create (pthread_key_t*, void (*)(void*)) +function int pthread_key_delete (pthread_key_t) +function int pthread_mutex_destroy (pthread_mutex_t*) +optional-function int pthread_mutex_getprioceiling (const pthread_mutex_t*, int*) +function int pthread_mutex_init (pthread_mutex_t*, const pthread_mutexattr_t*) +function int pthread_mutex_lock (pthread_mutex_t*) +optional-function int pthread_mutex_setprioceiling (pthread_mutex_t*, int, int*) +# if !defined POSIX && !defined UNIX98 +function int pthread_mutex_timedlock (pthread_mutex_t*, const struct timespec*) +# endif +function int pthread_mutex_trylock (pthread_mutex_t*) +function int pthread_mutex_unlock (pthread_mutex_t*) +function int pthread_mutexattr_destroy (pthread_mutexattr_t*) +optional-function int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t*, int*) +optional-function int pthread_mutexattr_getprotocol (const pthread_mutexattr_t*, int*) +function int pthread_mutexattr_getpshared (const pthread_mutexattr_t*, int*) +# if !defined POSIX +function int pthread_mutexattr_gettype (const pthread_mutexattr_t*, int*) +# endif +function int pthread_mutexattr_init (pthread_mutexattr_t*) +optional-function int pthread_mutexattr_setprioceiling (pthread_mutexattr_t*, int) +optional-function int pthread_mutexattr_setprotocol (pthread_mutexattr_t*, int) +function int pthread_mutexattr_setpshared (pthread_mutexattr_t*, int) +# if !defined POSIX +function int pthread_mutexattr_settype (pthread_mutexattr_t*, int) +# endif +function int pthread_once (pthread_once_t*, void (*) (void)) +# if !defined POSIX +function int pthread_rwlock_init (pthread_rwlock_t*, const pthread_rwlockattr_t*) +function int pthread_rwlock_rdlock (pthread_rwlock_t*) +# endif +# if !defined POSIX && !defined UNIX98 +function int pthread_rwlock_timedrdlock (pthread_rwlock_t*, const struct timespec*) +function int pthread_rwlock_timedwrlock (pthread_rwlock_t*, const struct timespec*) +# endif +# if !defined POSIX +function int pthread_rwlock_tryrdlock (pthread_rwlock_t*) +function int pthread_rwlock_trywrlock (pthread_rwlock_t*) +function int pthread_rwlock_unlock (pthread_rwlock_t*) +function int pthread_rwlock_wrlock (pthread_rwlock_t*) +function int pthread_rwlockattr_destroy (pthread_rwlockattr_t*) +function int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t*, int*) +function int pthread_rwlockattr_init (pthread_rwlockattr_t*) +function int pthread_rwlockattr_setpshared (pthread_rwlockattr_t*, int) +# endif +function pthread_t pthread_self (void) +function int pthread_setcancelstate (int, int*) +function int pthread_setcanceltype (int, int*) +# if !defined POSIX && !defined POSIX2008 +function int pthread_setconcurrency (int) +# endif +function int pthread_setschedparam (pthread_t, int, const struct sched_param*) +function int pthread_setspecific (pthread_key_t, const void*) +# if !defined POSIX && !defined UNIX98 && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 +function int pthread_sigmask (int, const sigset_t*, sigset_t*) +# endif +# if !defined POSIX && !defined UNIX98 +function int pthread_spin_destroy (pthread_spinlock_t*) +function int pthread_spin_init (pthread_spinlock_t*, int) +function int pthread_spin_lock (pthread_spinlock_t*) +function int pthread_spin_trylock (pthread_spinlock_t*) +function int pthread_spin_unlock (pthread_spinlock_t*) +# endif +function void pthread_testcancel (void) +# if defined XOPEN2K8 || defined POSIX2008 +function int pthread_mutex_consistent (pthread_mutex_t *) +function int pthread_mutexattr_getrobust (const pthread_mutexattr_t*, int*) +function int pthread_mutexattr_setrobust (pthread_mutexattr_t*, int) +# endif + +allow-header sched.h +allow-header time.h + +allow PTHREAD_* +allow pthread_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/pwd.h-data b/REORG.TODO/conform/data/pwd.h-data new file mode 100644 index 0000000000..e86433d6a7 --- /dev/null +++ b/REORG.TODO/conform/data/pwd.h-data @@ -0,0 +1,34 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +#ifdef POSIX +# define uid_t __uid_t +# define gid_t __gid_t +#endif + +type {struct passwd} +element {struct passwd} {char*} pw_name +element {struct passwd} uid_t pw_uid +element {struct passwd} gid_t pw_gid +element {struct passwd} {char*} pw_dir +element {struct passwd} {char*} pw_shell + +# ifndef POSIX +type uid_t +type gid_t +# if defined XOPEN2K8 || defined POSIX2008 +type size_t +# endif +# endif + +function {struct passwd*} getpwnam (const char*) +function {struct passwd*} getpwuid (uid_t) +function int getpwnam_r (const char*, struct passwd*, char*, size_t, struct passwd**) +function int getpwuid_r (uid_t, struct passwd*, char*, size_t, struct passwd**) +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function void endpwent (void) +function {struct passwd*} getpwent (void) +function void setpwent (void) +# endif + +allow pw_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/regex.h-data b/REORG.TODO/conform/data/regex.h-data new file mode 100644 index 0000000000..04f9034f81 --- /dev/null +++ b/REORG.TODO/conform/data/regex.h-data @@ -0,0 +1,45 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +type regex_t +element regex_t size_t re_nsub + +type regoff_t + +type regmatch_t +element regmatch_t regoff_t rm_so +element regmatch_t regoff_t rm_eo + +constant REG_EXTENDED +constant REG_ICASE +constant REG_NOSUB +constant REG_NEWLINE + +constant REG_NOTBOL +constant REG_NOTEOL + +constant REG_NOMATCH +constant REG_BADPAT +constant REG_ECOLLATE +constant REG_ECTYPE +constant REG_EESCAPE +constant REG_ESUBREG +constant REG_EBRACK +constant REG_EPAREN +constant REG_EBRACE +constant REG_BADBR +constant REG_ERANGE +constant REG_ESPACE +constant REG_BADRPT +# if !defined POSIX && !defined XOPEN2K8 && !defined POSIX2008 +constant REG_ENOSYS +# endif + +function int regcomp (regex_t*, const char*, int) +function int regexec (const regex_t*, const char*, size_t, regmatch_t[], int) +function size_t regerror (int, const regex_t*, char*, size_t) +function void regfree (regex_t*) + +allow REG_* +allow re_* +allow rm_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sched.h-data b/REORG.TODO/conform/data/sched.h-data new file mode 100644 index 0000000000..63e5eb2567 --- /dev/null +++ b/REORG.TODO/conform/data/sched.h-data @@ -0,0 +1,42 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined XPG42 +# if defined POSIX || defined UNIX98 +# include "time.h-data" +# else +allow-header time.h +# endif + +type {struct sched_param} +element {struct sched_param} int sched_priority +# if !defined POSIX && !defined UNIX98 +optional-element {struct sched_param} int sched_ss_low_priority +optional-element {struct sched_param} {struct timespec} sched_ss_repl_period +optional-element {struct sched_param} {struct timespec} sched_ss_init_budget +optional-element {struct sched_param} int sched_ss_max_repl +# endif + +# if defined XOPEN2K8 || defined POSIX2008 +type pid_t +type time_t +type {struct timespec} +# endif + +constant SCHED_FIFO +constant SCHED_RR +# if !defined POSIX && !defined UNIX98 +optional-constant SCHED_SPORADIC +# endif +constant SCHED_OTHER + +function int sched_get_priority_max (int) +function int sched_get_priority_min (int) +function int sched_getparam (pid_t, struct sched_param*) +function int sched_getscheduler (pid_t) +function int sched_rr_get_interval (pid_t, struct timespec*) +function int sched_setparam (pid_t, const struct sched_param*) +function int sched_setscheduler (pid_t, int, const struct sched_param*) +function int sched_yield (void) + +allow sched_* +allow SCHED_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/search.h-data b/REORG.TODO/conform/data/search.h-data new file mode 100644 index 0000000000..e99f7e6c1d --- /dev/null +++ b/REORG.TODO/conform/data/search.h-data @@ -0,0 +1,34 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +type ENTRY +type {struct entry} +element {struct entry} {char*} key +element {struct entry} {void*} data + +type ACTION +constant FIND +constant ENTER + +type VISIT +constant preorder +constant postorder +constant endorder +constant leaf + +function int hcreate (size_t) +function void hdestroy (void) +function {ENTRY*} hsearch (ENTRY, ACTION) +#ifndef XPG4 +function void insque (void*, void*) +#endif +function {void*} lfind (const void*, const void*, size_t*, size_t, int (*)(const void*, const void*)) +function {void*} lsearch (const void*, void*, size_t*, size_t, int (*)(const void*, const void*)) +#ifndef XPG4 +function void remque (void*) +#endif +function {void*} tdelete (const void*, void**, int(*)(const void*, const void*)) +function {void*} tfind (const void*, void*const*, int(*)(const void*, const void*)) +function {void*} tsearch (const void*, void**, int(*)(const void*, const void*)) +function void twalk (const void*, void (*) (const void*, VISIT, int)) + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/semaphore.h-data b/REORG.TODO/conform/data/semaphore.h-data new file mode 100644 index 0000000000..066c2f721b --- /dev/null +++ b/REORG.TODO/conform/data/semaphore.h-data @@ -0,0 +1,32 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined XPG42 +type sem_t + +constant SEM_FAILED + +function int sem_close (sem_t*) +function int sem_destroy (sem_t*) +function int sem_getvalue (sem_t*, int*) +function int sem_init (sem_t*, int, unsigned int) +function {sem_t*} sem_open (const char*, int, ...) +function int sem_post (sem_t*) +# if !defined POSIX && !defined UNIX98 +function int sem_timedwait (sem_t*, const struct timespec*) +# endif +function int sem_trywait (sem_t*) +function int sem_unlink (const char*) +function int sem_wait (sem_t*) + +allow-header fcntl.h +# if !defined POSIX2008 && !defined XOPEN2K8 +allow-header sys/types.h +# endif +// Consider addition of this permission in POSIX.1:2008 as a bug fix, +// so allow for POSIX.1:2001 as well since that includes sem_timedwait. +# if !defined POSIX && !defined UNIX98 +allow-header time.h +# endif + +allow sem_* +allow SEM_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/setjmp.h-data b/REORG.TODO/conform/data/setjmp.h-data new file mode 100644 index 0000000000..af28ddb59a --- /dev/null +++ b/REORG.TODO/conform/data/setjmp.h-data @@ -0,0 +1,24 @@ +type jmp_buf +#if !defined ISO && !defined ISO99 && !defined ISO11 +type sigjmp_buf +#endif + +function void longjmp (jmp_buf, int) +#if !defined ISO && !defined ISO99 && !defined ISO11 +function void siglongjmp (sigjmp_buf, int) +# if !defined POSIX && !defined POSIX2008 +function void _longjmp (jmp_buf, int) +# endif +#endif + +macro-function int setjmp (jmp_buf) +#if !defined ISO && !defined ISO99 && !defined ISO11 +macro-function int sigsetjmp (sigjmp_buf, int) +# if !defined POSIX && !defined POSIX2008 +macro-function int _setjmp (jmp_buf) +# endif +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif diff --git a/REORG.TODO/conform/data/signal.h-data b/REORG.TODO/conform/data/signal.h-data new file mode 100644 index 0000000000..571816484f --- /dev/null +++ b/REORG.TODO/conform/data/signal.h-data @@ -0,0 +1,313 @@ +macro-constant SIG_DFL {void(*)(int)} +macro-constant SIG_ERR {void(*)(int)} +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +macro-constant SIG_HOLD {void(*)(int)} +#endif +macro-constant SIG_IGN {void(*)(int)} + +type sig_atomic_t +#if !defined ISO && !defined ISO99 && !defined ISO11 +type sigset_t +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +type pid_t +#elif defined POSIX +# define pid_t __pid_t +# define uid_t __uid_t +#endif +#if defined XOPEN2K8 || defined POSIX2008 +type size_t +type pthread_t +type uid_t + +type mcontext_t + +type ucontext_t +element ucontext_t {ucontext_t*} uc_link +element ucontext_t sigset_t uc_sigmask +element ucontext_t stack_t uc_stack +element ucontext_t mcontext_t uc_mcontext + +type {struct timespec} +element {struct timespec} __time_t tv_sec +// Bug 16437: tv_nsec has wrong type. +xfail[x86_64-x32-linux]-element {struct timespec} long tv_nsec +#endif + +#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +element {union sigval} int sival_int +element {union sigval} {void*} sival_ptr + +type {struct sigevent} + +// Test the elements of the sigevent_t structure. +element {struct sigevent} int sigev_notify +element {struct sigevent} int sigev_signo +element {struct sigevent} {union sigval} sigev_value +element {struct sigevent} {void(*} sigev_notify_function )(union sigval) +element {struct sigevent} {pthread_attr_t*} sigev_notify_attributes + +constant SIGEV_NONE +constant SIGEV_SIGNAL +constant SIGEV_THREAD + +type {union sigval} + +macro SIGRTMIN +macro SIGRTMAX +#endif + +macro-int-constant SIGABRT {int} > 0 +macro-int-constant SIGFPE {int} > 0 +macro-int-constant SIGILL {int} > 0 +macro-int-constant SIGINT {int} > 0 +macro-int-constant SIGSEGV {int} > 0 +macro-int-constant SIGTERM {int} > 0 + +function void (*signal (int, void(*)(int)))(int) +function int raise (int) + +#if !defined ISO && !defined ISO99 && !defined ISO11 +macro-int-constant SIGALRM {int} > 0 +macro-int-constant SIGHUP {int} > 0 +macro-int-constant SIGKILL {int} > 0 +macro-int-constant SIGPIPE {int} > 0 +macro-int-constant SIGQUIT {int} > 0 +macro-int-constant SIGUSR1 {int} > 0 +macro-int-constant SIGUSR2 {int} > 0 +macro-int-constant SIGCHLD {int} > 0 +macro-int-constant SIGCONT {int} > 0 +macro-int-constant SIGSTOP {int} > 0 +macro-int-constant SIGTSTP {int} > 0 +macro-int-constant SIGTTIN {int} > 0 +macro-int-constant SIGTTOU {int} > 0 +# ifndef XPG4 +macro-int-constant SIGBUS {int} > 0 +# endif +# if !defined POSIX && !defined XPG4 +macro-int-constant SIGPOLL {int} > 0 +macro-int-constant SIGPROF {int} > 0 +macro-int-constant SIGSYS {int} > 0 +# endif +# if !defined POSIX && !defined XPG4 && !defined POSIX2008 +macro-int-constant SIGTRAP {int} > 0 +# endif +# if !defined POSIX && !defined XPG4 +macro-int-constant SIGURG {int} > 0 +macro-int-constant SIGVTALRM {int} > 0 +macro-int-constant SIGXCPU {int} > 0 +macro-int-constant SIGXFSZ {int} > 0 +# endif + +type {struct sigaction} + +element {struct sigaction} {void(*} sa_handler )(int) +element {struct sigaction} sigset_t sa_mask +element {struct sigaction} int sa_flags +# ifndef XPG4 +element {struct sigaction} {void(*} sa_sigaction )(int, siginfo_t*, void*) +# endif + +constant SA_NOCLDSTOP +# ifndef XPG4 +constant SA_SIGINFO +# endif +constant SIG_BLOCK +constant SIG_UNBLOCK +constant SIG_SETMASK +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +constant SA_ONSTACK +# endif +# if !defined XPG4 && !defined POSIX +constant SA_RESETHAND +constant SA_RESTART +constant SA_NOCLDWAIT +constant SA_NODEFER +# endif +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +constant SS_ONSTACK +constant SS_DISABLE +constant MINSIGSTKSZ +constant SIGSTKSZ +# endif + +# if !defined XPG4 && !defined POSIX +type ucontext_t + +element ucontext_t {ucontext_t*} uc_link +element ucontext_t sigset_t uc_sigmask +element ucontext_t stack_t uc_stack +element ucontext_t mcontext_t uc_mcontext + +type stack_t + +element stack_t {void*} ss_sp +element stack_t size_t ss_size +element stack_t int ss_flags + +# if !defined XOPEN2K8 && !defined POSIX2008 +type {struct sigstack} + +element {struct sigstack} int ss_onstack +element {struct sigstack} {void*} ss_sp +# endif +# endif + +# ifndef XPG4 +type siginfo_t + +element siginfo_t int si_signo +# if !defined POSIX && !defined POSIX2008 +element siginfo_t int si_errno +# endif +element siginfo_t int si_code +# ifndef POSIX +element siginfo_t pid_t si_pid +element siginfo_t uid_t si_uid +element siginfo_t {void*} si_addr +element siginfo_t int si_status +element siginfo_t long si_band +# endif +# ifndef XPG42 +element siginfo_t {union sigval} si_value +# endif +# endif + +# if !defined POSIX && !defined XPG4 +constant ILL_ILLOPC +constant ILL_ILLOPN +constant ILL_ILLADR +constant ILL_ILLTRP +constant ILL_PRVOPC +constant ILL_PRVREG +constant ILL_COPROC +constant ILL_BADSTK +constant FPE_INTDIV +constant FPE_INTOVF +constant FPE_FLTDIV +constant FPE_FLTOVF +constant FPE_FLTUND +constant FPE_FLTRES +constant FPE_FLTINV +constant FPE_FLTSUB +constant SEGV_MAPERR +constant SEGV_ACCERR +constant BUS_ADRALN +constant BUS_ADRERR +constant BUS_OBJERR +constant CLD_EXITED +constant CLD_KILLED +constant CLD_DUMPED +constant CLD_TRAPPED +constant CLD_STOPPED +constant CLD_CONTINUED +constant POLL_IN +constant POLL_OUT +constant POLL_MSG +constant POLL_ERR +constant POLL_PRI +constant POLL_HUP +# endif +# if !defined POSIX && !defined XPG4 && !defined POSIX2008 +constant TRAP_BRKPT +constant TRAP_TRACE +# endif +# if !defined XPG4 && !defined XPG42 +constant SI_USER +constant SI_QUEUE +constant SI_TIMER +constant SI_ASYNCIO +constant SI_MESGQ +# endif + +# if !defined XPG4 && !defined XOPEN2K8 && !defined POSIX && !defined POSIX2008 +function void (*bsd_signal (int, void(*)(int)))(int) +# endif +function int kill (pid_t, int) +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int killpg (pid_t, int) +# endif +# if !defined XPG4 && !defined XPG42 +function int pthread_kill (pthread_t, int) +function int pthread_sigmask (int, const sigset_t*, sigset_t*) +# endif +function int sigaction (int, const struct sigaction*, struct sigaction*) +function int sigaddset (sigset_t*, int) +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int sigaltstack (const stack_t*, stack_t*) +# endif +function int sigdelset (sigset_t*, int) +function int sigemptyset (sigset_t*) +function int sigfillset (sigset_t*) +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int sighold (int) +function int sigignore (int) +function int siginterrupt (int, int) +# endif +function int sigismember (const sigset_t*, int) +#if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int sigpause (int) +# endif +function int sigpending (sigset_t*) +function int sigprocmask (int, const sigset_t*, sigset_t*) +# if !defined XPG4 && !defined XPG42 +function int sigqueue (pid_t, int, const union sigval) +# endif +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int sigrelse (int) +function void (*sigset (int, void(*)(int)))(int) +# endif +# if defined XPG42 || defined UNIX98 +function int sigstack (struct sigstack*, struct sigstack*) +# endif +function int sigsuspend (const sigset_t*) +# if !defined XPG4 && !defined XPG42 +function int sigtimedwait (const sigset_t*, siginfo_t*, const struct timespec*) +# endif +# if !defined XPG4 && !defined XPG42 +function int sigwait (const sigset_t*, int*) +function int sigwaitinfo (const sigset_t*, siginfo_t*) +# endif +# if defined XOPEN2K8 || defined POSIX2008 +function void psiginfo (const siginfo_t*, const char*) +function void psignal (int, const char*) +# endif + +// The following expressions are not entirely correct but the current +// poorfnmatch implementation doesn't grok the right form. +allow sa_* +allow SA_* +# ifndef XPG4 +allow si_* +allow SI_* +# endif +# if !defined XPG4 && !defined XPG42 +allow sigev_* +allow SIGEV_* +allow sival_* +# endif +# if !defined POSIX && !defined XPG4 && !defined XPG42 +allow uc_* +# endif +# if !defined POSIX && !defined XPG4 +allow BUS_* +allow CLD_* +allow FPE_* +allow ILL_* +allow POLL_* +allow SEGV_* +# endif +# if !defined POSIX && !defined XPG4 && !defined POSIX2008 +allow SS_* +allow SV_* +allow TRAP_* +allow ss_* +allow sv_* +# endif +allow *_t + +allow-header time.h +#endif + +allow SIG[ABCDEFGHIJKLMNOPQRSTUVWXYZ]* +allow SIG_* diff --git a/REORG.TODO/conform/data/spawn.h-data b/REORG.TODO/conform/data/spawn.h-data new file mode 100644 index 0000000000..de4aaa7fe2 --- /dev/null +++ b/REORG.TODO/conform/data/spawn.h-data @@ -0,0 +1,43 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +type posix_spawnattr_t +type posix_spawn_file_actions_t +# if defined XOPEN2K8 || defined POSIX2008 +type mode_t +type pid_t +type sigset_t +type {struct sched_param} +# endif + +constant POSIX_SPAWN_RESETIDS +constant POSIX_SPAWN_SETPGROUP +constant POSIX_SPAWN_SETSCHEDPARAM +constant POSIX_SPAWN_SETSCHEDULER +constant POSIX_SPAWN_SETSIGDEF +constant POSIX_SPAWN_SETSIGMASK + +function int posix_spawnattr_destroy (posix_spawnattr_t*) +function int posix_spawnattr_getsigdefault (const posix_spawnattr_t*, sigset_t*) +function int posix_spawnattr_getflags (const posix_spawnattr_t*, short*) +function int posix_spawnattr_getpgroup (const posix_spawnattr_t*, pid_t*) +function int posix_spawnattr_getschedparam (const posix_spawnattr_t*, struct sched_param*) +function int posix_spawnattr_getschedpolicy (const posix_spawnattr_t*, int*) +function int posix_spawnattr_getsigmask (const posix_spawnattr_t*, sigset_t*) +function int posix_spawnattr_init (posix_spawnattr_t*) +function int posix_spawnattr_setsigdefault (posix_spawnattr_t*, const sigset_t*) +function int posix_spawnattr_setflags (posix_spawnattr_t*, short) +function int posix_spawnattr_setpgroup (posix_spawnattr_t*, pid_t) +function int posix_spawnattr_setschedparam (posix_spawnattr_t*, const struct sched_param*) +function int posix_spawnattr_setschedpolicy (posix_spawnattr_t*, int) +function int posix_spawnattr_setsigmask (posix_spawnattr_t*, const sigset_t*) +function int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t*, int) +function int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t*, int, int) +function int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t*, int, const char *, int, mode_t) +function int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t*) +function int posix_spawn_file_actions_init (posix_spawn_file_actions_t*) +function int posix_spawn (pid_t*, const char*, const posix_spawn_file_actions_t*, const posix_spawnattr_t*, char *const[], char *const[]); +function int posix_spawnp (pid_t*, const char*, const posix_spawn_file_actions_t*, const posix_spawnattr_t*, char *const[], char *const[]); + +allow-header sched.h +allow-header signal.h +allow-header sys/types.h +#endif diff --git a/REORG.TODO/conform/data/stdalign.h-data b/REORG.TODO/conform/data/stdalign.h-data new file mode 100644 index 0000000000..edc2310e98 --- /dev/null +++ b/REORG.TODO/conform/data/stdalign.h-data @@ -0,0 +1,6 @@ +#if defined ISO11 +macro alignas +macro alignof +macro-int-constant __alignas_is_defined {int} == 1 +macro-int-constant __alignof_is_defined {int} == 1 +#endif diff --git a/REORG.TODO/conform/data/stdarg.h-data b/REORG.TODO/conform/data/stdarg.h-data new file mode 100644 index 0000000000..53addb91fa --- /dev/null +++ b/REORG.TODO/conform/data/stdarg.h-data @@ -0,0 +1,14 @@ +type va_list + +// XXX We didn't check the parameters. +macro va_start +macro va_arg +macro va_end + +#if defined ISO99 || defined ISO11 || defined XOPEN2K || defined POSIX2008 || defined XOPEN2K8 +macro va_copy +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif diff --git a/REORG.TODO/conform/data/stdbool.h-data b/REORG.TODO/conform/data/stdbool.h-data new file mode 100644 index 0000000000..a030e9cffe --- /dev/null +++ b/REORG.TODO/conform/data/stdbool.h-data @@ -0,0 +1,10 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +macro bool +macro-int-constant true {int} == 1 +macro-int-constant false {int} == 0 +macro-int-constant __bool_true_false_are_defined {int} == 1 + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif +#endif diff --git a/REORG.TODO/conform/data/stddef.h-data b/REORG.TODO/conform/data/stddef.h-data new file mode 100644 index 0000000000..9ded4f1ca0 --- /dev/null +++ b/REORG.TODO/conform/data/stddef.h-data @@ -0,0 +1,15 @@ +macro-constant NULL == 0 + +macro offsetof + +type ptrdiff_t +type wchar_t +type size_t + +#if defined ISO11 +type max_align_t +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif diff --git a/REORG.TODO/conform/data/stdint.h-data b/REORG.TODO/conform/data/stdint.h-data new file mode 100644 index 0000000000..4e84e17fb8 --- /dev/null +++ b/REORG.TODO/conform/data/stdint.h-data @@ -0,0 +1,119 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +// The requirements for some types and corresponding macros are from POSIX. +type int8_t +type int16_t +type int32_t +type int64_t +type uint8_t +type uint16_t +type uint32_t +type uint64_t + +type int_least8_t +type int_least16_t +type int_least32_t +type int_least64_t +type uint_least8_t +type uint_least16_t +type uint_least32_t +type uint_least64_t + +type int_fast8_t +type int_fast16_t +type int_fast32_t +type int_fast64_t +type uint_fast8_t +type uint_fast16_t +type uint_fast32_t +type uint_fast64_t + +type intptr_t +type uintptr_t + +type intmax_t +type uintmax_t + +macro-int-constant INT8_MIN {promoted:int8_t} == -128 +macro-int-constant INT8_MAX {promoted:int8_t} == 127 +macro-int-constant INT16_MIN {promoted:int16_t} == -32768 +macro-int-constant INT16_MAX {promoted:int16_t} == 32767 +macro-int-constant INT32_MIN {promoted:int32_t} == -2147483647-1 +macro-int-constant INT32_MAX {promoted:int32_t} == 2147483647 +macro-int-constant INT64_MIN {promoted:int64_t} == -9223372036854775807LL-1 +macro-int-constant INT64_MAX {promoted:int64_t} == 9223372036854775807LL + +macro-int-constant UINT8_MAX {promoted:uint8_t} == 255 +macro-int-constant UINT16_MAX {promoted:uint16_t} == 65535 +macro-int-constant UINT32_MAX {promoted:uint32_t} == 4294967295U +macro-int-constant UINT64_MAX {promoted:uint64_t} == 18446744073709551615ULL + +macro-int-constant INT_LEAST8_MIN {promoted:int_least8_t} <= -128 +macro-int-constant INT_LEAST8_MAX {promoted:int_least8_t} >= 127 +macro-int-constant INT_LEAST16_MIN {promoted:int_least16_t} <= -32768 +macro-int-constant INT_LEAST16_MAX {promoted:int_least16_t} >= 32767 +macro-int-constant INT_LEAST32_MIN {promoted:int_least32_t} <= -2147483647-1 +macro-int-constant INT_LEAST32_MAX {promoted:int_least32_t} >= 2147483647 +macro-int-constant INT_LEAST64_MIN {promoted:int_least64_t} <= -9223372036854775807LL-1 +macro-int-constant INT_LEAST64_MAX {promoted:int_least64_t} >= 9223372036854775807LL + +macro-int-constant UINT_LEAST8_MAX {promoted:uint_least8_t} >= 255 +macro-int-constant UINT_LEAST16_MAX {promoted:uint_least16_t} >= 65535 +macro-int-constant UINT_LEAST32_MAX {promoted:uint_least32_t} >= 4294967295U +macro-int-constant UINT_LEAST64_MAX {promoted:uint_least64_t} >= 18446744073709551615ULL + +macro-int-constant INT_FAST8_MIN {promoted:int_fast8_t} <= -128 +macro-int-constant INT_FAST8_MAX {promoted:int_fast8_t} >= 127 +macro-int-constant INT_FAST16_MIN {promoted:int_fast16_t} <= -32768 +macro-int-constant INT_FAST16_MAX {promoted:int_fast16_t} >= 32767 +macro-int-constant INT_FAST32_MIN {promoted:int_fast32_t} <= -2147483647-1 +macro-int-constant INT_FAST32_MAX {promoted:int_fast32_t} >= 2147483647 +macro-int-constant INT_FAST64_MIN {promoted:int_fast64_t} <= -9223372036854775807LL-1 +macro-int-constant INT_FAST64_MAX {promoted:int_fast64_t} >= 9223372036854775807LL + +macro-int-constant UINT_FAST8_MAX {promoted:uint_fast8_t} >= 255 +macro-int-constant UINT_FAST16_MAX {promoted:uint_fast16_t} >= 65535 +macro-int-constant UINT_FAST32_MAX {promoted:uint_fast32_t} >= 4294967295U +macro-int-constant UINT_FAST64_MAX {promoted:uint_fast64_t} >= 18446744073709551615ULL + +macro-int-constant INTPTR_MIN {promoted:intptr_t} <= -32768 +macro-int-constant INTPTR_MAX {promoted:intptr_t} >= 32767 + +macro-int-constant UINTPTR_MAX {promoted:uintptr_t} >= 65535 + +macro-int-constant INTMAX_MIN {promoted:intmax_t} <= -9223372036854775807LL-1 +macro-int-constant INTMAX_MAX {promoted:intmax_t} >= 9223372036854775807LL + +macro-int-constant UINTMAX_MAX {promoted:uintmax_t} >= 18446744073709551615ULL + +macro-int-constant PTRDIFF_MIN {promoted:__PTRDIFF_TYPE__} <= -65535 +macro-int-constant PTRDIFF_MAX {promoted:__PTRDIFF_TYPE__} >= 65535 + +macro-int-constant SIG_ATOMIC_MIN {promoted:__SIG_ATOMIC_TYPE__} +macro-int-constant SIG_ATOMIC_MAX {promoted:__SIG_ATOMIC_TYPE__} >= 127 + +macro-int-constant SIZE_MAX {promoted:__SIZE_TYPE__} >= 65535 + +macro-int-constant WCHAR_MIN {promoted:__WCHAR_TYPE__} +macro-int-constant WCHAR_MAX {promoted:__WCHAR_TYPE__} >= 127 + +macro-int-constant WINT_MIN {promoted:__WINT_TYPE__} +macro-int-constant WINT_MAX {promoted:__WINT_TYPE__} >= 127 + +macro INT8_C +macro INT16_C +macro INT32_C +macro INT64_C +macro UINT8_C +macro UINT16_C +macro UINT32_C +macro UINT64_C +macro INTMAX_C +macro UINTMAX_C + +// The following expressions are not entirely correct but the current +// poorfnmatch implementation doesn't grok the right forms (INT*_MAX, +// INT*_MIN, INT*_C, UINT*_MAX, UINT*_MIN, UINT*_C, int*_t, uint*_t). +allow INT* +allow UINT* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/stdio.h-data b/REORG.TODO/conform/data/stdio.h-data new file mode 100644 index 0000000000..f69802cc70 --- /dev/null +++ b/REORG.TODO/conform/data/stdio.h-data @@ -0,0 +1,194 @@ +macro-int-constant BUFSIZ >= 256 +macro-int-constant FILENAME_MAX +macro-int-constant FOPEN_MAX >= 8 + +macro-int-constant _IOFBF +macro-int-constant _IOLBF +macro-int-constant _IONBF + +#if !defined ISO && !defined ISO99 && !defined ISO11 +constant L_ctermid +# if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 +# ifdef POSIX +optional-constant L_cuserid +# else +constant L_cuserid +# endif +# endif +#endif +macro-int-constant L_tmpnam + +macro-int-constant SEEK_CUR +macro-int-constant SEEK_END +macro-int-constant SEEK_SET + +macro-int-constant TMP_MAX >= 10000 + +macro-int-constant EOF < 0 + +macro-constant NULL == 0 + +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +constant P_tmpdir +#endif + +macro stdin {FILE *} +macro stdout {FILE *} +macro stderr {FILE *} + +type FILE +type fpos_t +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +type va_list +#else +#define va_list _G_va_list +#endif +type size_t +#if defined XOPEN2K8 || defined POSIX2008 +type off_t +type ssize_t +#endif + +function void clearerr (FILE*) +#if !defined ISO && !defined ISO99 && !defined ISO11 +function {char*} ctermid (char*) +# if defined XPG4 || defined XPG42 || defined UNIX98 +function {char*} cuserid (char*) +# endif +#endif +#if defined XOPEN2K8 || defined POSIX2008 +function int dprintf (int, const char*, ...) +#endif +function int fclose (FILE*) +#if !defined ISO && !defined ISO99 && !defined ISO11 +function {FILE*} fdopen (int, const char*) +#endif +function int feof (FILE*) +function int ferror (FILE*) +function int fflush (FILE*) +function int fgetc (FILE*) +function int fgetpos (FILE*, fpos_t*) +function {char*} fgets (char*, int, FILE*) +#if !defined ISO && !defined ISO99 && !defined ISO11 +function int fileno (FILE*) +#endif +#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function void flockfile (FILE*) +#endif +#if defined XOPEN2K8 || defined POSIX2008 +function {FILE*} fmemopen (void*, size_t, const char*) +#endif +function {FILE*} fopen (const char*, const char*) +function int fprintf (FILE*, const char*, ...) +function int fputc (int, FILE*) +function int fputs (const char*, FILE*) +function size_t fread (void*, size_t, size_t, FILE*) +function {FILE*} freopen (const char*, const char*, FILE*) +function int fscanf (FILE*, const char*, ...) +function int fseek (FILE*, long int, int) +#if defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function int fseeko (FILE*, off_t, int) +#endif +function int fsetpos (FILE*, const fpos_t*) +function {long int} ftell (FILE*) +#if defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function off_t ftello (FILE*) +#endif +#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function int ftrylockfile (FILE*) +function void funlockfile (FILE*) +#endif +function size_t fwrite (const void*, size_t, size_t, FILE*) +function int getc (FILE*) +function int getchar (void) +#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function int getc_unlocked (FILE*) +function int getchar_unlocked (void) +#endif +#if defined XOPEN2K8 || defined POSIX2008 +function ssize_t getdelim (char**, size_t*, int, FILE*) +function ssize_t getline (char**, size_t*, FILE*) +#endif +#if defined XPG4 || defined XPG42 || defined UNIX98 +function int getopt (int, char *const[], const char *) +#endif +#if !defined ISO11 +function {char*} gets (char*) +#endif +#if defined XPG4 || defined XPG42 || defined UNIX98 +function int getw (FILE*) +#endif +#if defined XOPEN2K8 || defined POSIX2008 +function {FILE*} open_memstream (char**, size_t*) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 +function int pclose (FILE*) +#endif +function void perror (const char*) +#if !defined ISO && !defined ISO99 && !defined ISO11 +function {FILE*} popen (const char*, const char*) +#endif +function int printf (const char*, ...) +function int putc (int, FILE*) +function int putchar (int) +#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function int putc_unlocked (int, FILE*) +function int putchar_unlocked (int) +#endif +function int puts (const char*) +#if defined XPG4 || defined XPG42 || defined UNIX98 +function int putw (int, FILE*) +#endif +function int remove (const char*) +function int rename (const char*, const char*) +#if defined XOPEN2K8 || defined POSIX2008 +function int renameat (int, const char*, int, const char*) +#endif +function void rewind (FILE*) +function int scanf (const char*, ...) +function void setbuf (FILE*, char*) +function int setvbuf (FILE*, char*, int, size_t) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 +function int snprintf (char*, size_t, const char*, ...) +#endif +function int sprintf (char *, const char *, ...) +function int sscanf (const char*, const char*, ...) +#if defined XPG4 || defined XPG42 || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 +function {char*} tempnam (const char*, const char*) +#endif +function {FILE*} tmpfile (void) +function {char*} tmpnam (char*) +function int ungetc (int, FILE*) +#if defined XOPEN2K8 || defined POSIX2008 +function int vdprintf (int, const char*, va_list) +#endif +function int vfprintf (FILE*, const char*, va_list) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int vfscanf (FILE*, const char*, va_list) +#endif +function int vprintf (const char*, va_list) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int vscanf (const char*, va_list) +#endif +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 +function int vsnprintf (char*, size_t, const char*, va_list) +#endif +function int vsprintf (char*, const char*, va_list) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int vsscanf (const char*, const char*, va_list) +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +#if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 +variable {char*} optarg +variable int opterr +variable int optind +variable int optopt +#endif + +#if !defined POSIX +allow-header stddef.h +#endif + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/stdlib.h-data b/REORG.TODO/conform/data/stdlib.h-data new file mode 100644 index 0000000000..d8fcccc2fb --- /dev/null +++ b/REORG.TODO/conform/data/stdlib.h-data @@ -0,0 +1,202 @@ +type div_t +element div_t int quot +element div_t int rem +type ldiv_t +element ldiv_t long quot +element ldiv_t long rem + +macro-int-constant EXIT_FAILURE +macro-int-constant EXIT_SUCCESS == 0 + +macro-constant NULL == 0 +macro-int-constant RAND_MAX >= 32767 +macro MB_CUR_MAX + +#if defined ISO99 || defined ISO11 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +type lldiv_t +element lldiv_t {long long} quot +element lldiv_t {long long} rem +#endif +type size_t +type wchar_t + +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +constant WNOHANG +constant WUNTRACED + +macro WEXITSTATUS +macro WIFEXITED +macro WIFSIGNALED +macro WIFSTOPPED +macro WSTOPSIG +macro WTERMSIG +#endif + +#if !defined ISO && !defined XPG4 && !defined XPG42 && !defined UNIX98 && !defined POSIX +function void _Exit (int) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function long a64l (const char*) +#endif +function void abort (void) +function int abs (int) +#if defined ISO11 +function {void *} aligned_alloc (size_t, size_t) +#endif +function int atexit (void(*)(void)) +#if defined ISO11 +function int at_quick_exit (void (*) (void)) +#endif +function double atof (const char*) +function int atoi (const char*) +function {long int} atol (const char*) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function {long long} atoll (const char*) +#endif +function {void*} bsearch (const void*, const void*, size_t, size_t, int(*)(const void*, const void*)) +function {void*} calloc (size_t, size_t) +function div_t div (int, int) +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function double drand48 (void) +#endif +#if defined XPG42 || defined UNIX98 || defined XOPEN2K +function {char*} ecvt (double, int, int*, int*) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function double erand48 (unsigned short int[3]) +#endif +function void exit (int) +#if defined XPG42 || defined UNIX98 || defined XOPEN2K +function {char*} fcvt (double, int, int*, int*) +#endif +function void free (void*) +#if defined XPG42 || defined UNIX98 || defined XOPEN2K +function {char*} gcvt (double, int, char*) +#endif +function {char*} getenv (const char*) +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX +function int getsubopt (char**, char *const*, char**) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int grantpt (int) +function {char*} initstate (unsigned int, char*, size_t) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function {long int} jrand48 (unsigned short int[3]) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function {char*} l64a (long) +#endif +function {long int} labs (long int) +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function void lcong48 (unsigned short int[7]) +#endif +function ldiv_t ldiv (long int, long int) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function {long long} llabs (long long) +function lldiv_t lldiv (long long, long long) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function {long int} lrand48 (void) +#endif +function {void*} malloc (size_t) +function int mblen (const char*, size_t) +function size_t mbstowcs (wchar_t*, const char*, size_t) +function int mbtowc (wchar_t*, const char*, size_t) +#if defined XOPEN2K8 || defined POSIX2008 +function {char*} mkdtemp (char*) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined XOPEN2K8 && !defined POSIX2008 +function {char*} mktemp (char*) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX +function int mkstemp (char*) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function {long int} mrand48 (void) +function {long int} nrand48 (unsigned short int[3]) +#endif +#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function int posix_memalign (void**, size_t, size_t) +#endif +#if defined XOPEN2K || defined XOPEN2K8 +function int posix_openpt (int) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function {char*} ptsname (int) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function int putenv (char*) +#endif +function void qsort (void*, size_t, size_t, int(*)(const void*, const void*)) +#if defined ISO11 +function void quick_exit (int) +#endif +function int rand (void) +#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function int rand_r (unsigned int*) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function long random (void) +#endif +function {void*} realloc (void*, size_t) +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function {char*} realpath (const char*, char*) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function {unsigned short int*} seed48 (unsigned short int[3]) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int setenv (const char*, const char*, int) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function void setkey (const char*) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function {char*} setstate (char*) +#endif +function void srand (unsigned int) +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function void srand48 (long int) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function void srandom (unsigned) +#endif +function double strtod (const char*, char**) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function float strtof (const char*, char**) +function {long double} strtold (const char*, char**) +#endif +function {long int} strtol (const char*, char**, int) +function {unsigned long int} strtoul (const char*, char**, int) +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function {long long int} strtoll (const char*, char**, int) +function {unsigned long long int} strtoull (const char*, char**, int) +#endif +function int system (const char*) +#if defined XPG42 || defined UNIX98 +function int ttyslot (void) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int unlockpt (int) +#endif +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int unsetenv (const char*) +#endif +#if defined XPG42 || defined UNIX98 +function {void*} valloc (size_t) +#endif +function size_t wcstombs (char*, const wchar_t*, size_t) +function int wctomb (char*, wchar_t) + +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +allow-header stddef.h +allow-header limits.h +allow-header math.h +allow-header sys/wait.h +#endif + +allow str[abcdefghijklmnopqrstuvwxyz]* +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif diff --git a/REORG.TODO/conform/data/stdnoreturn.h-data b/REORG.TODO/conform/data/stdnoreturn.h-data new file mode 100644 index 0000000000..77b9a589d8 --- /dev/null +++ b/REORG.TODO/conform/data/stdnoreturn.h-data @@ -0,0 +1,3 @@ +#if defined ISO11 +macro noreturn +#endif diff --git a/REORG.TODO/conform/data/string.h-data b/REORG.TODO/conform/data/string.h-data new file mode 100644 index 0000000000..e06f941498 --- /dev/null +++ b/REORG.TODO/conform/data/string.h-data @@ -0,0 +1,73 @@ +macro-constant NULL == 0 + +type size_t +#if defined XOPEN2K8 || defined POSIX2008 +type locale_t +#endif + +#if !defined ISO && !defined ISO99 & !defined ISO11 && !defined POSIX && !defined POSIX2008 +function {void*} memccpy (void*, const void*, int, size_t) +#endif +function {void*} memchr (const void*, int, size_t) +function int memcmp (const void*, const void*, size_t) +function {void*} memcpy (void*, const void*, size_t) +function {void*} memmove (void*, const void*, size_t) +function {void*} memset (void*, int, size_t) +#if defined XOPEN2K8 || defined POSIX2008 +function {char*} stpcpy (char*, const char*) +function {char*} stpncpy (char*, const char*, size_t) + +#endif +function {char*} strcat (char*, const char*) +function {char*} strchr (const char*, int) +function int strcmp (const char*, const char*) +function int strcoll (const char*, const char*) +#if defined XOPEN2K8 || defined POSIX2008 +function int strcoll_l (const char*, const char*, locale_t) +#endif +function {char*} strcpy (char*, const char*) +function size_t strcspn (const char*, const char*) +#if !defined ISO && !defined ISO99 & !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function {char*} strdup (const char*) +#endif +function {char*} strerror (int) +#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function int strerror_r (int, char*, size_t) +#endif +#if defined XOPEN2K8 || defined POSIX2008 +function {char*} strerror_l (int, locale_t) +#endif +function size_t strlen (const char*) +function {char*} strncat (char*, const char*, size_t) +function int strncmp (const char*, const char*, size_t) +function {char*} strncpy (char*, const char*, size_t) +#if defined XOPEN2K8 || defined POSIX2008 +function {char*} strndup (const char*, size_t) +function size_t strnlen (const char*, size_t) +#endif +function {char*} strpbrk (const char*, const char*) +function {char*} strrchr (const char*, int) +#if defined XOPEN2K8 || defined POSIX2008 +function {char*} strsignal (int) +#endif +function size_t strspn (const char*, const char*) +function {char*} strstr (const char*, const char*) +function {char*} strtok (char*, const char*) +#if defined POSIX || defined UNIX98 || defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008 +function {char*} strtok_r (char*, const char*, char**) +#endif +function size_t strxfrm (char*, const char*, size_t) +#if defined XOPEN2K8 || defined POSIX2008 +function size_t strxfrm_l (char*, const char*, size_t, locale_t) +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +allow-header stddef.h +#endif + +allow str[abcdefghijklmnopqrstuvwxyz]* +allow mem[abcdefghijklmnopqrstuvwxyz]* +allow wcs[abcdefghijklmnopqrstuvwxyz]* +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif diff --git a/REORG.TODO/conform/data/strings.h-data b/REORG.TODO/conform/data/strings.h-data new file mode 100644 index 0000000000..13827ebed9 --- /dev/null +++ b/REORG.TODO/conform/data/strings.h-data @@ -0,0 +1,25 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +# if !defined XOPEN2K8 && !defined POSIX2008 +function int bcmp (const void*, const void*, size_t) +function void bcopy (const void*, void*, size_t) +function void bzero (void*, size_t) +function {char*} index (const char*, int) +function {char*} rindex (const char*, int) +# endif +# if !defined POSIX2008 +function int ffs (int) +# endif +function int strcasecmp (const char*, const char*) +function int strncasecmp (const char*, const char*, size_t) +# if defined XOPEN2K8 || defined POSIX2008 +function int strcasecmp_l (const char*, const char*, locale_t) +function int strncasecmp_l (const char*, const char*, size_t, locale_t) +# endif + +type size_t +# if defined XOPEN2K8 || defined POSIX2008 +type locale_t +# endif + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/stropts.h-data b/REORG.TODO/conform/data/stropts.h-data new file mode 100644 index 0000000000..c4b1343411 --- /dev/null +++ b/REORG.TODO/conform/data/stropts.h-data @@ -0,0 +1,140 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +type {struct bandinfo} + +element {struct bandinfo} {unsigned char} bi_pri +element {struct bandinfo} int bi_flag + +type {struct strpeek} + +element {struct strpeek} {struct strbuf} ctlbuf +element {struct strpeek} {struct strbuf} databuf +element {struct strpeek} t_uscalar_t flags + +type {struct strbuf} + +element {struct strbuf} int maxlen +element {struct strbuf} int len +element {struct strbuf} {char*} buf + +type {struct strfdinsert} + +element {struct strfdinsert} {struct strbuf} ctlbuf +element {struct strfdinsert} {struct strbuf} databuf +element {struct strfdinsert} t_uscalar_t flags +element {struct strfdinsert} int fildes +element {struct strfdinsert} int offset + +type {struct strioctl} + +element {struct strioctl} int ic_cmd +element {struct strioctl} int ic_timout +element {struct strioctl} int ic_len +element {struct strioctl} {char*} ic_dp + +type {struct strrecvfd} + +element {struct strrecvfd} int fd +element {struct strrecvfd} uid_t uid +element {struct strrecvfd} gid_t gid + +type uid_t +type gid_t + +type t_uscalar_t + +type {struct str_list} + +element {struct str_list} int sl_nmods +element {struct str_list} {struct str_mlist*} sl_modlist + +type {struct str_mlist} + +element {struct str_mlist} char l_name [FMNAMESZ+1] + +macro I_PUSH +macro I_POP +macro I_LOOK +macro FMNAMESZ +macro I_FLUSH +macro FLUSHR +macro FLUSHW +macro FLUSHRW +macro I_FLUSHBAND +macro I_SETSIG +macro S_RDNORM +macro S_RDBAND +macro S_INPUT +macro S_HIPRI +macro S_OUTPUT +macro S_WRNORM +macro S_WRBAND +macro S_MSG +macro S_ERROR +macro S_HANGUP +macro S_BANDURG +macro I_GETSIG +macro I_FIND +macro I_PEEK +macro RS_HIPRI +macro I_SRDOPT +macro RNORM +macro RMSGD +macro RMSGN +macro RPROTNORM +macro RPROTDAT +macro RPROTDIS +macro I_GRDOPT +macro I_NREAD +macro I_FDINSERT +macro I_STR +macro I_SWROPT +macro SNDZERO +macro I_GWROPT +macro I_SENDFD +macro I_RECVFD +macro I_LIST +macro I_ATMARK +macro ANYMARK +macro LASTMARK +macro I_CKBAND +macro I_GETBAND +macro I_CANPUT +macro I_SETCLTIME +macro I_GETCLTIME +macro I_LINK +macro I_UNLINK +macro I_PLINK +macro I_PUNLINK + +macro MSG_ANY +macro MSG_BAND +macro MSG_HIPRI +macro MORECTL +macro MOREDATA + +function int isastream (int) +function int getmsg (int, struct strbuf*, struct strbuf*, int*) +function int getpmsg (int, struct strbuf*, struct strbuf*, int*, int*) +// Bug 14362: wrong type for ioctl. +xfail-function int ioctl (int, int, ...) +function int putmsg (int, const struct strbuf*, const struct strbuf*, int) +function int putpmsg (int, const struct strbuf*, const struct strbuf*, int, int) +function int fattach (int, const char*) +function int fdetach (const char*) + +allow-header unistd.h + +allow bi_* +allow ic_* +allow l_* +allow sl_* +allow str_* +allow FLUSH* +allow I_* +allow M_* +allow MUXID_R* +allow S_* +allow SND* +allow STR* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/ipc.h-data b/REORG.TODO/conform/data/sys/ipc.h-data new file mode 100644 index 0000000000..70dc3f6fe6 --- /dev/null +++ b/REORG.TODO/conform/data/sys/ipc.h-data @@ -0,0 +1,31 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +type {struct ipc_perm} + +element {struct ipc_perm} uid_t uid +element {struct ipc_perm} gid_t gid +element {struct ipc_perm} uid_t cuid +element {struct ipc_perm} gid_t cgid +// Bug 18231: wrong type for mode member. +xfail-element {struct ipc_perm} mode_t mode + +type uid_t +type gid_t +type mode_t +type key_t + +constant IPC_CREAT +constant IPC_EXCL +constant IPC_NOWAIT + +constant IPC_PRIVATE + +constant IPC_RMID +constant IPC_SET +constant IPC_STAT + +function key_t ftok (const char*, int) + +allow ipc_* +allow IPC_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/mman.h-data b/REORG.TODO/conform/data/sys/mman.h-data new file mode 100644 index 0000000000..a74388338e --- /dev/null +++ b/REORG.TODO/conform/data/sys/mman.h-data @@ -0,0 +1,64 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 +constant PROT_READ +constant PROT_WRITE +constant PROT_EXEC +constant PROT_NONE + +constant MAP_SHARED +constant MAP_PRIVATE +constant MAP_FIXED + +constant MS_ASYNC +constant MS_SYNC +constant MS_INVALIDATE + +constant MCL_CURRENT +constant MCL_FUTURE + +constant MAP_FAILED + +# if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +constant POSIX_MADV_NORMAL +constant POSIX_MADV_SEQUENTIAL +constant POSIX_MADV_RANDOM +constant POSIX_MADV_WILLNEED +constant POSIX_MADV_DONTNEED + +optional-constant POSIX_TYPED_MEM_ALLOCATE +optional-constant POSIX_TYPED_MEM_ALLOCATE_CONTIG +optional-constant POSIX_TYPED_MEM_MAP_ALLOCATABLE + +type mode_t + +optional-type {struct posix_typedmem_info} +optional-element {struct posix_typedmem_info} size_t posix_tmi_length + +function int posix_madvise (void*, size_t, int) +optional-function int posix_mem_offset (const void*, size_t, off_t*, size_t*, int*) +optional-function int posix_typed_mem_get_info (int, struct posix_typed_mem_info*) +optional-function int posix_typed_mem_open (const char*, int, int) +# endif + +# ifndef POSIX +type size_t +type off_t +# endif + +function int mlock (const void*, size_t) +function int mlockall (int) +function {void*} mmap (void*, size_t, int, int, int, off_t) +function int mprotect (void*, size_t, int) +function int msync (void*, size_t, int) +function int munlock (const void*, size_t) +function int munlockall (void) +function int munmap (void*, size_t) +function int shm_open (const char*, int, mode_t) +function int shm_unlink (const char*) + +allow shm_* +allow MAP_* +allow MCL_* +allow MS_* +allow PROT_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/msg.h-data b/REORG.TODO/conform/data/sys/msg.h-data new file mode 100644 index 0000000000..a8290cab52 --- /dev/null +++ b/REORG.TODO/conform/data/sys/msg.h-data @@ -0,0 +1,34 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +type {struct msqid_ds} + +type msgqnum_t +type msglen_t + +constant MSG_NOERROR + +element {struct msqid_ds} {struct ipc_perm} msg_perm +element {struct msqid_ds} msgqnum_t msg_qnum +element {struct msqid_ds} msglen_t msg_qbytes +element {struct msqid_ds} pid_t msg_lspid +element {struct msqid_ds} pid_t msg_lrpid +element {struct msqid_ds} time_t msg_stime +element {struct msqid_ds} time_t msg_rtime +element {struct msqid_ds} time_t msg_ctime + +type pid_t +type time_t +type key_t +type size_t +type ssize_t + +function int msgctl (int, int, struct msqid_ds*) +function int msgget (key_t, int) +function ssize_t msgrcv (int, void*, size_t, long int, int) +function int msgsnd (int, const void*, size_t, int) + +allow-header sys/ipc.h + +allow msg* +allow MSG* +allow *_h +#endif diff --git a/REORG.TODO/conform/data/sys/resource.h-data b/REORG.TODO/conform/data/sys/resource.h-data new file mode 100644 index 0000000000..cedbee1a40 --- /dev/null +++ b/REORG.TODO/conform/data/sys/resource.h-data @@ -0,0 +1,52 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 && !defined XPG4 +constant PRIO_PROCESS +constant PRIO_PGRP +constant PRIO_USER + +type rlim_t + +constant RLIM_INFINITY +constant RLIM_SAVED_MAX +constant RLIM_SAVED_CUR + +constant RUSAGE_SELF +constant RUSAGE_CHILDREN + +type {struct rlimit} + +element {struct rlimit} rlim_t rlim_cur +element {struct rlimit} rlim_t rlim_max + +type {struct rusage} + +element {struct rusage} {struct timeval} ru_utime +element {struct rusage} {struct timeval} ru_stime + +type {struct timeval} + +constant RLIMIT_CORE +constant RLIMIT_CPU +constant RLIMIT_DATA +constant RLIMIT_FSIZE +constant RLIMIT_NOFILE +constant RLIMIT_STACK +constant RLIMIT_AS + +function int getpriority (int, id_t) +function int getrlimit (int, struct rlimit*) +function int getrusage (int, struct rusage*) +function int setpriority (int, id_t, int) +function int setrlimit (int, const struct rlimit*) + +type id_t + +allow-header sys/time.h + +allow rlim_* +allow ru_* +allow PRIO_* +allow RLIM_* +allow RLIMIT_* +allow RUSAGE_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/select.h-data b/REORG.TODO/conform/data/sys/select.h-data new file mode 100644 index 0000000000..44d63ebd2d --- /dev/null +++ b/REORG.TODO/conform/data/sys/select.h-data @@ -0,0 +1,36 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +type time_t +type suseconds_t + +type {struct timeval} +element {struct timeval} time_t tv_sec +element {struct timeval} suseconds_t tv_usec + +type sigset_t + +type {struct timespec} +element {struct timespec} time_t tv_sec +// Bug 16437: tv_nsec has wrong type. +xfail[x86_64-x32-linux]-element {struct timespec} long tv_nsec + +type fd_set +#if defined XPG4 || defined XPG42 || defined UNIX98 +element fd_set long fds_bits [] +#endif + +macro FD_CLR +macro FD_ISSET +macro FD_SET +macro FD_ZERO + +macro FD_SETSIZE + +#if defined XOPEN2K || defined POSIX2008 || defined XOPEN2K8 +function int pselect (int, fd_set*, fd_set*, fd_set*, const struct timespec*, const sigset_t*) +#endif +function int select (int, fd_set*, fd_set*, fd_set*, struct timeval*) + +allow-header signal.h +allow-header sys/time.h +allow-header time.h +#endif diff --git a/REORG.TODO/conform/data/sys/sem.h-data b/REORG.TODO/conform/data/sys/sem.h-data new file mode 100644 index 0000000000..a36ab1bd91 --- /dev/null +++ b/REORG.TODO/conform/data/sys/sem.h-data @@ -0,0 +1,40 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +constant SEM_UNDO + +constant GETNCNT +constant GETPID +constant GETVAL +constant GETALL +constant GETZCNT +constant SETVAL +constant SETALL + +type {struct semid_ds} + +element {struct semid_ds} {struct ipc_perm} sem_perm +// Bug 18232: wrong type for sem_nsems member. +xfail-element {struct semid_ds} {unsigned short int} sem_nsems +element {struct semid_ds} time_t sem_otime +element {struct semid_ds} time_t sem_ctime + +type pid_t +type time_t +type key_t +type size_t + +type {struct sembuf} + +element {struct sembuf} {unsigned short int} sem_num +element {struct sembuf} {short int} sem_op +element {struct sembuf} {short int} sem_flg + +function int semctl (int, int, int, ...) +function int semget (key_t, int, int) +function int semop (int, struct sembuf*, size_t) + +allow-header sys/ipc.h + +allow sem* +allow SEM_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/shm.h-data b/REORG.TODO/conform/data/sys/shm.h-data new file mode 100644 index 0000000000..a006cdbb92 --- /dev/null +++ b/REORG.TODO/conform/data/sys/shm.h-data @@ -0,0 +1,34 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +constant SHM_RDONLY +symbol SHMLBA +constant SHM_RND + +type shmatt_t + +type {struct shmid_ds} + +element {struct shmid_ds} {struct ipc_perm} shm_perm +element {struct shmid_ds} size_t shm_segsz +element {struct shmid_ds} pid_t shm_lpid +element {struct shmid_ds} pid_t shm_cpid +element {struct shmid_ds} shmatt_t shm_nattch +element {struct shmid_ds} time_t shm_atime +element {struct shmid_ds} time_t shm_dtime +element {struct shmid_ds} time_t shm_ctime + +type pid_t +type time_t +type key_t +type size_t + +function {void*} shmat (int, const void*, int) +function int shmctl (int, int, struct shmid_ds*) +function int shmdt (const void*) +function int shmget (key_t, size_t, int) + +allow-header sys/ipc.h + +allow shm* +allow SHM* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/socket.h-data b/REORG.TODO/conform/data/sys/socket.h-data new file mode 100644 index 0000000000..8796c57570 --- /dev/null +++ b/REORG.TODO/conform/data/sys/socket.h-data @@ -0,0 +1,140 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +type socklen_t + +type sa_family_t + +# if defined XOPEN2K8 || defined POSIX2008 +type size_t +type ssize_t +# endif + +type {struct sockaddr} + +element {struct sockaddr} sa_family_t sa_family +element {struct sockaddr} char sa_data [] + +type {struct sockaddr_storage} + +element {struct sockaddr_storage} sa_family_t ss_family + +type {struct msghdr} + +element {struct msghdr} {void*} msg_name +element {struct msghdr} socklen_t msg_namelen +element {struct msghdr} {struct iovec*} msg_iov +// Bug 16919: wrong type for msg_iovlen and msg_controllen members. +xfail-element {struct msghdr} int msg_iovlen +element {struct msghdr} {void*} msg_control +xfail-element {struct msghdr} socklen_t msg_controllen +element {struct msghdr} int msg_flags + +type {struct iovec} + +element {struct iovec} {void*} iov_base +element {struct iovec} size_t iov_len + +type {struct cmsghdr} + +// Bug 16919: wrong type for cmsg_len member. +xfail-element {struct cmsghdr} socklen_t cmsg_len +element {struct cmsghdr} int cmsg_level +element {struct cmsghdr} int cmsg_type + +macro SCM_RIGHTS + +macro CMSG_DATA +macro CMSG_NXTHDR +macro CMSG_FIRSTHDR + +type {struct linger} + +element {struct linger} int l_onoff +element {struct linger} int l_linger + +macro SOCK_DGRAM +macro SOCK_STREAM +macro SOCK_SEQPACKET + +macro SOL_SOCKET + +macro SO_ACCEPTCONN +macro SO_BROADCAST +macro SO_DEBUG +macro SO_DONTROUTE +macro SO_ERROR +macro SO_KEEPALIVE +macro SO_LINGER +macro SO_OOBINLINE +macro SO_RCVBUF +macro SO_RCVLOWAT +macro SO_RCVTIMEO +macro SO_REUSEADDR +macro SO_SNDBUF +macro SO_SNDLOWAT +macro SO_SNDTIMEO +macro SO_TYPE + +macro SOMAXCONN + +macro MSG_CTRUNC +macro MSG_DONTROUTE +macro MSG_EOR +macro MSG_OOB +macro MSG_PEEK +macro MSG_TRUNC +macro MSG_WAITALL +# if defined XOPEN2K8 || defined POSIX2008 +constant MSG_NOSIGNAL +# endif + +macro AF_UNIX +macro AF_UNSPEC +macro AF_INET +macro AF_INET6 + +macro SHUT_RD +macro SHUT_WR +macro SHUT_RDWR + +function int accept (int, struct sockaddr*, socklen_t*) +function int bind (int, const struct sockaddr*, socklen_t) +function int connect (int, const struct sockaddr*, socklen_t) +function int getpeername (int, struct sockaddr*, socklen_t*) +function int getsockname (int, struct sockaddr*, socklen_t*) +function int getsockopt (int, int, int, void*, socklen_t*) +function int listen (int, int) +function ssize_t recv (int, void*, size_t, int) +function ssize_t recvfrom (int, void*, size_t, int, struct sockaddr*, socklen_t*) +function ssize_t recvmsg (int, struct msghdr*, int) +function ssize_t send (int, const void*, size_t, int) +function ssize_t sendmsg (int, const struct msghdr*, int) +function ssize_t sendto (int, const void*, size_t, int, const struct sockaddr*, socklen_t) +function int setsockopt (int, int, int, const void*, socklen_t) +function int shutdown (int, int) +function int socket (int, int, int) +function int socketpair (int, int, int, int[2]) +#if !defined XPG42 && !defined UNIX98 +function int sockatmark (int) +#endif + +allow-header sys/uio.h + +allow ss_* +allow sa_* +allow if_* +allow ifc_* +allow ifru_* +allow infu_* +allow ifra_* +allow msg_* +allow cmsg_* +allow l_* +allow SO* +allow AF_* +allow CMSG_* +allow MSG_* +allow PF_* +allow SCM_* +allow SHUT_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/stat.h-data b/REORG.TODO/conform/data/sys/stat.h-data new file mode 100644 index 0000000000..84452aef78 --- /dev/null +++ b/REORG.TODO/conform/data/sys/stat.h-data @@ -0,0 +1,161 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 + +#if !defined POSIX && !defined POSIX2008 && !defined XPG4 && !defined XPG42 +type blkcnt_t +type blksize_t +#endif +#ifndef POSIX +type dev_t +type ino_t +type mode_t +type nlink_t +type uid_t +type gid_t +type off_t +type time_t +#else +# define dev_t __dev_t +# define ino_t __ino_t +# define mode_t __mode_t +# define nlink_t __nlink_t +# define uid_t __uid_t +# define gid_t __gid_t +# define off_t __off_t +# define time_t __time_t +#endif + +type {struct stat} + +// Bug 17786: st_dev has wrong type. +xfail[mips-o32-linux]-element {struct stat} dev_t st_dev +element {struct stat} ino_t st_ino +element {struct stat} mode_t st_mode +element {struct stat} nlink_t st_nlink +element {struct stat} uid_t st_uid +element {struct stat} gid_t st_gid +#if !defined POSIX && !defined POSIX2008 +// Bug 21278: st_rdev has wrong type. +xfail[mips-o32-linux]-element {struct stat} dev_t st_rdev +#endif +element {struct stat} off_t st_size +element {struct stat} time_t st_atime +element {struct stat} time_t st_mtime +element {struct stat} time_t st_ctime +#if defined XOPEN2K8 || defined POSIX2008 +element {struct stat} {struct timespec} st_atim +element {struct stat} {struct timespec} st_mtim +element {struct stat} {struct timespec} st_ctim +#endif +#if !defined XPG4 && !defined POSIX && !defined POSIX2008 +# ifdef XPG42 +// The XPG42 use of "long" for these fields is not compatible with the +// use of typedefs in future standards to support values outside the +// range of "long". +xfail-element {struct stat} long st_blksize +xfail-element {struct stat} long st_blocks +# else +element {struct stat} blksize_t st_blksize +element {struct stat} blkcnt_t st_blocks +# endif +#endif + +# if defined XOPEN2K8 || defined POSIX2008 +type {struct timespec} +element {struct timespec} time_t tv_sec +// Bug 16437: tv_nsec has wrong type. +xfail[x86_64-x32-linux]-element {struct timespec} long tv_nsec +# endif + +#if !defined POSIX && !defined POSIX2008 +constant S_IFMT +constant S_IFBLK +constant S_IFCHR +constant S_IFIFO +constant S_IFREG +constant S_IFDIR +# ifndef XPG4 +constant S_IFLNK +constant S_IFSOCK +# endif +#endif + +constant S_IRWXU +constant S_IRUSR +constant S_IWUSR +constant S_IXUSR +constant S_IRWXG +constant S_IRGRP +constant S_IWGRP +constant S_IXGRP +constant S_IRWXO +constant S_IROTH +constant S_IWOTH +constant S_IXOTH +constant S_ISUID +constant S_ISGID +#if !defined XPG4 && !defined POSIX && !defined POSIX2008 +constant S_ISVTX +#endif + +macro S_ISBLK +macro S_ISCHR +macro S_ISDIR +macro S_ISFIFO +macro S_ISREG +#if !defined XPG4 && !defined POSIX +macro S_ISLNK +macro S_ISSOCK +#endif + +// How to represent optional tests? +optional-macro S_TYPEISMQ +optional-macro S_TYPEISSEM +optional-macro S_TYPEISSHM +# if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +optional-macro S_TYPEISTMO +# endif + +# if defined XOPEN2K8 || defined POSIX2008 +constant UTIME_NOW +constant UTIME_OMIT +# endif + +function int chmod (const char*, mode_t) +# ifndef XPG4 +function int fchmod (int, mode_t) +# endif +# if defined XOPEN2K8 || defined POSIX2008 +function int fchmodat (int, const char*, mode_t, int) +# endif +function int fstat (int, struct stat*) +# if defined XOPEN2K8 || defined POSIX2008 +function int fstatat (int, const char*, struct stat*, int) +function int futimens (int, const struct timespec[2]) +# endif +#if !defined XPG4 && !defined POSIX +function int lstat (const char*, struct stat*) +#endif +function int mkdir (const char*, mode_t) +# if defined XOPEN2K8 || defined POSIX2008 +function int mkdirat (int, const char*, mode_t) +# endif +function int mkfifo (const char*, mode_t) +# if defined XOPEN2K8 || defined POSIX2008 +function int mkfifoat (int, const char*, mode_t) +# endif +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int mknod (const char*, mode_t, dev_t) +# endif +# ifdef XOPEN2K8 +function int mknodat (int, const char*, mode_t, dev_t) +# endif +function int stat (const char*, struct stat*) +function mode_t umask (mode_t) +# if defined XOPEN2K8 || defined POSIX2008 +function int utimensat (int, const char*, const struct timespec[2], int) +# endif + +allow st_* +allow S_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/statvfs.h-data b/REORG.TODO/conform/data/sys/statvfs.h-data new file mode 100644 index 0000000000..efdbff012d --- /dev/null +++ b/REORG.TODO/conform/data/sys/statvfs.h-data @@ -0,0 +1,28 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +type {struct statvfs} + +element {struct statvfs} {unsigned long} f_bsize +element {struct statvfs} {unsigned long} f_frsize +element {struct statvfs} fsblkcnt_t f_blocks +element {struct statvfs} fsblkcnt_t f_bfree +element {struct statvfs} fsblkcnt_t f_bavail +element {struct statvfs} fsfilcnt_t f_files +element {struct statvfs} fsfilcnt_t f_ffree +element {struct statvfs} fsfilcnt_t f_favail +element {struct statvfs} {unsigned long} f_fsid +element {struct statvfs} {unsigned long} f_flag +element {struct statvfs} {unsigned long} f_namemax + +type fsblkcnt_t +type fsfilcnt_t + +constant ST_RDONLY +constant ST_NOSUID + +function int statvfs (const char*, struct statvfs*) +function int fstatvfs (int, struct statvfs*) + +allow f_* +allow ST_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/time.h-data b/REORG.TODO/conform/data/sys/time.h-data new file mode 100644 index 0000000000..30523e1af4 --- /dev/null +++ b/REORG.TODO/conform/data/sys/time.h-data @@ -0,0 +1,43 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 && !defined XPG4 +type {struct timeval} + +element {struct timeval} time_t tv_sec +element {struct timeval} suseconds_t tv_usec + +type {struct itimerval} + +element {struct itimerval} {struct timeval} it_interval +element {struct itimerval} {struct timeval} it_value + +type time_t +type suseconds_t + +type fd_set +element fd_set long fds_bits [] + +constant ITIMER_REAL +constant ITIMER_VIRTUAL +constant ITIMER_PROF + +macro FD_CLR +macro FD_ISSET +macro FD_SET +macro FD_ZERO + +constant FD_SETSIZE + +function int getitimer (int, struct itimerval*) +function int setitimer (int, const struct itimerval*, struct itimerval*) +function int gettimeofday (struct timeval*, void*) +function int select (int, fd_set*, fd_set*, fd_set*, struct timeval*) +function int utimes (const char*, const struct timeval [2]) + +allow fds_* +allow it_* +allow tv_* +allow FD_* +allow ITIMER_* +allow *_t + +allow-header sys/select.h +#endif diff --git a/REORG.TODO/conform/data/sys/timeb.h-data b/REORG.TODO/conform/data/sys/timeb.h-data new file mode 100644 index 0000000000..9638f73c8f --- /dev/null +++ b/REORG.TODO/conform/data/sys/timeb.h-data @@ -0,0 +1,14 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined POSIX2008 && !defined XOPEN2K8 +type {struct timeb} + +element {struct timeb} time_t time +element {struct timeb} {unsigned short} millitm +element {struct timeb} short timezone +element {struct timeb} short dstflag + +type time_t + +function int ftime (struct timeb*) + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/times.h-data b/REORG.TODO/conform/data/sys/times.h-data new file mode 100644 index 0000000000..c93357b793 --- /dev/null +++ b/REORG.TODO/conform/data/sys/times.h-data @@ -0,0 +1,15 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +type {struct tms} + +element {struct tms} clock_t tms_utime +element {struct tms} clock_t tms_stime +element {struct tms} clock_t tms_cutime +element {struct tms} clock_t tms_cstime + +type clock_t + +function clock_t times (struct tms*) + +allow tms_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/types.h-data b/REORG.TODO/conform/data/sys/types.h-data new file mode 100644 index 0000000000..cc28eb76d4 --- /dev/null +++ b/REORG.TODO/conform/data/sys/types.h-data @@ -0,0 +1,62 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +#if !defined POSIX +# if !defined XPG4 && !defined XPG42 +type blkcnt_t +type blksize_t +# endif +type clock_t +# if !defined XPG4 && !defined XPG42 +type clockid_t +# endif +#endif +type dev_t +# if !defined POSIX +type fsblkcnt_t +type fsfilcnt_t +# endif +type gid_t +#if !defined POSIX +type id_t +#endif +type ino_t +# if !defined POSIX && !defined POSIX2008 +type key_t +# endif +type mode_t +type nlink_t +type off_t +type pid_t +#if !defined XPG4 && !defined XPG42 +type pthread_attr_t +#if !defined POSIX && !defined UNIX98 +type pthread_barrier_t +type pthread_barrierattr_t +#endif +type pthread_cond_t +type pthread_condattr_t +type pthread_key_t +type pthread_mutex_t +type pthread_mutexattr_t +type pthread_once_t +#if !defined POSIX +type pthread_rwlock_t +type pthread_rwlockattr_t +#endif +#if !defined POSIX && !defined UNIX98 +type pthread_spinlock_t +#endif +type pthread_t +#endif +type size_t +type ssize_t +# if !defined POSIX && !defined POSIX2008 +type suseconds_t +# endif +# ifndef POSIX +type time_t +type timer_t +# endif +type uid_t + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/uio.h-data b/REORG.TODO/conform/data/sys/uio.h-data new file mode 100644 index 0000000000..b9fc66177c --- /dev/null +++ b/REORG.TODO/conform/data/sys/uio.h-data @@ -0,0 +1,14 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined POSIX2008 +type {struct iovec} + +element {struct iovec} {void*} iov_base +element {struct iovec} size_t iov_len + +function ssize_t readv (int, const struct iovec*, int) +function ssize_t writev (int, const struct iovec*, int) + +allow iov_* +allow IOV_* +allow *_t +allow UIO_MAXIOV +#endif diff --git a/REORG.TODO/conform/data/sys/un.h-data b/REORG.TODO/conform/data/sys/un.h-data new file mode 100644 index 0000000000..1068440042 --- /dev/null +++ b/REORG.TODO/conform/data/sys/un.h-data @@ -0,0 +1,8 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 +type {struct sockaddr_un} + +element {struct sockaddr_un} sa_family_t sun_family +element {struct sockaddr_un} char sun_path [] + +type sa_family_t +#endif diff --git a/REORG.TODO/conform/data/sys/utsname.h-data b/REORG.TODO/conform/data/sys/utsname.h-data new file mode 100644 index 0000000000..82f7f397ca --- /dev/null +++ b/REORG.TODO/conform/data/sys/utsname.h-data @@ -0,0 +1,12 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +type {struct utsname} + +element {struct utsname} char sysname [] +element {struct utsname} char nodename [] +element {struct utsname} char release [] +element {struct utsname} char version [] +element {struct utsname} char machine [] + +function int uname (struct utsname *) +allow *_t +#endif diff --git a/REORG.TODO/conform/data/sys/wait.h-data b/REORG.TODO/conform/data/sys/wait.h-data new file mode 100644 index 0000000000..74a062e90c --- /dev/null +++ b/REORG.TODO/conform/data/sys/wait.h-data @@ -0,0 +1,88 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +#ifdef POSIX +# define pid_t __pid_t +#endif + +constant WNOHANG +constant WUNTRACED + +macro WEXITSTATUS +# if !defined POSIX && !defined POSIX2008 +macro WIFCONTINUED +# endif +macro WIFEXITED +macro WIFSIGNALED +macro WIFSTOPPED +macro WSTOPSIG +macro WTERMSIG + +# ifndef POSIX +constant WEXITED +constant WSTOPPED +# ifndef POSIX2008 +constant WCONTINUED +# endif +constant WNOHANG +constant WNOWAIT +# endif + +#if !defined POSIX +type idtype_t + +constant P_ALL +constant P_PID +constant P_PGID + +type id_t + +type siginfo_t + +element siginfo_t int si_signo +element siginfo_t int si_errno +element siginfo_t int si_code +element siginfo_t pid_t si_pid +element siginfo_t uid_t si_uid +element siginfo_t {void*} si_addr +element siginfo_t int si_status +element siginfo_t long si_band +element siginfo_t {union sigval} si_value +#endif + +#if !defined POSIX && !defined XPG4 && !defined XOPEN2K8 && !defined POSIX2008 +type {struct rusage} + +element {struct rusage} {struct timeval} ru_utime +element {struct rusage} {struct timeval} ru_stime +#endif + +#if !defined POSIX +type pid_t +#endif + +function pid_t wait (int*) +#if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 +function pid_t wait3 (int*, int, struct rusage*) +#endif +#if !defined POSIX +function int waitid (idtype_t, id_t, siginfo_t*, int) +#endif +function pid_t waitpid (pid_t, int*, int) + +#if !defined POSIX +allow-header signal.h +allow-header sys/resource.h + +allow si_* +allow W* +allow P_* +allow BUS_ +allow CLD_ +allow FPE_ +allow ILL_ +allow POLL_ +allow SEGV_ +allow SI_ +allow TRAP_ +#endif +allow *_t +#endif diff --git a/REORG.TODO/conform/data/syslog.h-data b/REORG.TODO/conform/data/syslog.h-data new file mode 100644 index 0000000000..6604d76d3e --- /dev/null +++ b/REORG.TODO/conform/data/syslog.h-data @@ -0,0 +1,44 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 && !defined XPG4 +constant LOG_PID +constant LOG_CONS +constant LOG_NDELAY +constant LOG_ODELAY +constant LOG_NOWAIT + +constant LOG_KERN +constant LOG_USER +constant LOG_MAIL +constant LOG_NEWS +constant LOG_UUCP +constant LOG_DAEMON +constant LOG_AUTH +constant LOG_CRON +constant LOG_LPR +constant LOG_LOCAL0 +constant LOG_LOCAL1 +constant LOG_LOCAL2 +constant LOG_LOCAL3 +constant LOG_LOCAL4 +constant LOG_LOCAL5 +constant LOG_LOCAL6 +constant LOG_LOCAL7 + +macro LOG_MASK + +constant LOG_EMERG +constant LOG_ALERT +constant LOG_CRIT +constant LOG_ERR +constant LOG_WARNING +constant LOG_NOTICE +constant LOG_INFO +constant LOG_DEBUG + +function void closelog (void) +function void openlog (const char*, int, int) +function int setlogmask (int) +function void syslog (int, const char*, ...) + +allow LOG_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/tar.h-data b/REORG.TODO/conform/data/tar.h-data new file mode 100644 index 0000000000..8477860e57 --- /dev/null +++ b/REORG.TODO/conform/data/tar.h-data @@ -0,0 +1,33 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +macro-str TMAGIC "ustar" +macro-int-constant TMAGLEN {int} == 6 +macro-str TVERSION "00" +macro-int-constant TVERSLEN {int} == 2 + +macro-int-constant REGTYPE {int} == '0' +macro-int-constant AREGTYPE {int} == '\0' +macro-int-constant LNKTYPE {int} == '1' +macro-int-constant SYMTYPE {int} == '2' +macro-int-constant CHRTYPE {int} == '3' +macro-int-constant BLKTYPE {int} == '4' +macro-int-constant DIRTYPE {int} == '5' +macro-int-constant FIFOTYPE {int} == '6' +macro-int-constant CONTTYPE {int} == '7' + +macro-int-constant TSUID {int} == 04000 +macro-int-constant TSGID {int} == 02000 +# if !defined POSIX2008 +macro-int-constant TSVTX {int} == 01000 +# endif +macro-int-constant TUREAD {int} == 00400 +macro-int-constant TUWRITE {int} == 00200 +macro-int-constant TUEXEC {int} == 00100 +macro-int-constant TGREAD {int} == 00040 +macro-int-constant TGWRITE {int} == 00020 +macro-int-constant TGEXEC {int} == 00010 +macro-int-constant TOREAD {int} == 00004 +macro-int-constant TOWRITE {int} == 00002 +macro-int-constant TOEXEC {int} == 00001 + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/termios.h-data b/REORG.TODO/conform/data/termios.h-data new file mode 100644 index 0000000000..9aec2f5a17 --- /dev/null +++ b/REORG.TODO/conform/data/termios.h-data @@ -0,0 +1,180 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +type cc_t +type speed_t +type tcflag_t + +type {struct termios} + +#if defined XOPEN2K8 || defined POSIX2008 +type pid_t +#endif + +element {struct termios} tcflag_t c_iflag +element {struct termios} tcflag_t c_oflag +element {struct termios} tcflag_t c_cflag +element {struct termios} tcflag_t c_lflag +element {struct termios} cc_t c_cc[NCCS] + +constant NCCS + +constant VEOF +constant VEOL +constant VERASE +constant VINTR +constant VKILL +constant VMIN +constant VQUIT +constant VSTART +constant VSTOP +constant VSUSP +constant VTIME + +constant BRKINT +constant ICRNL +constant IGNBRK +constant IGNCR +constant IGNPAR +constant INLCR +constant INPCK +constant ISTRIP +# if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 +constant IUCLC +# endif +# ifndef POSIX +constant IXANY +# endif +constant IXOFF +constant IXON +constant PARMRK + +constant OPOST +# if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 +constant OLCUC +# endif +# if !defined POSIX && !defined POSIX2008 +constant ONLCR +constant OCRNL +constant ONOCR +constant ONLRET +constant OFDEL +constant OFILL +constant NLDLY +constant NL0 +constant NL1 +constant CRDLY +constant CR0 +constant CR1 +constant CR2 +constant CR3 +constant TABDLY +constant TAB0 +constant TAB1 +constant TAB2 +constant TAB3 +constant BSDLY +constant BS0 +constant BS1 +constant VTDLY +constant VT0 +constant VT1 +constant FFDLY +constant FF0 +constant FF1 +# endif + +constant B0 +constant B50 +constant B75 +constant B110 +constant B134 +constant B150 +constant B200 +constant B300 +constant B600 +constant B1200 +constant B1800 +constant B2400 +constant B4800 +constant B9600 +constant B19200 +constant B38400 + +constant CSIZE +constant CS5 +constant CS6 +constant CS7 +constant CS8 +constant CSTOPB +constant CREAD +constant PARENB +constant PARODD +constant HUPCL +constant CLOCAL + +constant ECHO +constant ECHOE +constant ECHOK +constant ECHONL +constant ICANON +constant IEXTEN +constant ISIG +constant NOFLSH +constant TOSTOP +# if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 +constant XCASE +# endif + +constant TCSANOW +constant TCSADRAIN +constant TCSAFLUSH + +constant TCIFLUSH +constant TCIOFLUSH + +constant TCIOFF +constant TCION +constant TCOOFF +constant TCOON + +function speed_t cfgetispeed (const struct termios*) +function speed_t cfgetospeed (const struct termios*) +function int cfsetispeed (struct termios*, speed_t) +function int cfsetospeed (struct termios*, speed_t) +function int tcdrain (int) +function int tcflow (int, int) +function int tcflush (int, int) +function int tcgetattr (int, struct termios*) +#if !defined POSIX && !defined XPG4 +function pid_t tcgetsid (int) +#endif +function int tcsendbreak (int, int) +function int tcsetattr (int, int, const struct termios*) + +#if !defined POSIX && !defined POSIX2008 +allow CBAUD +allow DEFECHO +allow ECHOCTL +allow ECHOKE +allow ECHOPRT +allow EXTA +allow EXTB +allow FLUSHO +allow LOBLK +allow PENDIN +allow SWTCH +allow VDISCARD +allow VDSUSP +allow VLNEXT +allow VREPRINT +allow VSTATUS +allow VWERASE +#endif + +allow c_* +allow V* +allow I* +allow O* +allow TC* +allow B[0123456789]* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/tgmath.h-data b/REORG.TODO/conform/data/tgmath.h-data new file mode 100644 index 0000000000..d852adc3e4 --- /dev/null +++ b/REORG.TODO/conform/data/tgmath.h-data @@ -0,0 +1,66 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +#include "math.h-data" +#include "complex.h-data" + +macro acos +macro asin +macro atan +macro acosh +macro asinh +macro atanh +macro cos +macro sin +macro tan +macro cosh +macro sinh +macro tanh +macro exp +macro pow +macro sqrt +macro fabs + +macro atan2 +macro cbrt +macro ceil +macro copysign +macro erf +macro erfc +macro exp2 +macro expm1 +macro fdim +macro floor +macro fma +macro fmax +macro fmin +macro fmod +macro frexp +macro hypot +macro ilogb +macro ldexp +macro lgamma +macro llrint +macro llround +macro log10 +macro log1p +macro log2 +macro logb +macro lrint +macro lround +macro nearbyint +macro nextafter +macro nexttoward +macro remainder +macro remquo +macro rint +macro round +macro scalbn +macro scalbln +macro tgamma +macro trunc + +macro carg +macro cimag +macro conj +macro cproj +macro creal +#endif diff --git a/REORG.TODO/conform/data/time.h-data b/REORG.TODO/conform/data/time.h-data new file mode 100644 index 0000000000..9c1c19596e --- /dev/null +++ b/REORG.TODO/conform/data/time.h-data @@ -0,0 +1,135 @@ +macro-constant NULL == 0 +macro CLOCKS_PER_SEC {clock_t} + +#ifdef ISO11 +macro-int-constant TIME_UTC > 0 +#endif + +#if !defined ISO && !defined ISO99 && !defined XPG4 && !defined XPG42 +type {struct timespec} + +element {struct timespec} time_t tv_sec +// Bug 16437: tv_nsec has wrong type. +xfail[x86_64-x32-linux]-element {struct timespec} long tv_nsec +#endif + +type size_t +type clock_t +type time_t + +type {struct tm} + +element {struct tm} int tm_sec +element {struct tm} int tm_min +element {struct tm} int tm_hour +element {struct tm} int tm_mday +element {struct tm} int tm_mon +element {struct tm} int tm_year +element {struct tm} int tm_wday +element {struct tm} int tm_yday +element {struct tm} int tm_isdst + +function clock_t clock (void) +function double difftime (time_t, time_t) +function time_t mktime (struct tm*) +function time_t time (time_t*) +function {char*} asctime (const struct tm*) +function {char*} ctime (const time_t*) +function {struct tm*} gmtime (const time_t*) +function {struct tm*} localtime (const time_t*) +function size_t strftime (char*, size_t, const char*, const struct tm*) +#if defined ISO11 +function int timespec_get (struct timespec *, int) +#endif + +#if !defined ISO && !defined ISO99 && !defined ISO11 +# if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 +symbol CLK_TCK +# endif +# if !defined XPG4 && !defined XPG42 +# if !defined POSIX && !defined UNIX98 +constant CLOCK_PROCESS_CPUTIME_ID +constant CLOCK_THREAD_CPUTIME_ID +# endif + +type {struct itimerspec} + +element {struct itimerspec} {struct timespec} it_interval +element {struct itimerspec} {struct timespec} it_value + +constant CLOCK_REALTIME +constant TIMER_ABSTIME +# if !defined POSIX && !defined UNIX98 +constant CLOCK_MONOTONIC +# endif + +type clockid_t +type timer_t +# endif + +# if defined XOPEN2K8 || defined POSIX2008 +type pid_t +type locale_t +tag {struct sigevent} +# endif + +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +variable int getdate_err +# endif + +function {char*} asctime_r (const struct tm*, char*) +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int clock_getcpuclockid (pid_t, clockid_t*) +#endif +#if !defined XPG4 && !defined XPG42 +function int clock_getres (clockid_t, struct timespec*) +function int clock_gettime (clockid_t, struct timespec*) +#endif +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int clock_nanosleep (clockid_t, int, const struct timespec*, struct timespec*) +#endif +#if !defined XPG4 && !defined XPG42 +function int clock_settime (clockid_t, const struct timespec*) +#endif +function {char*} ctime_r (const time_t*, char*) +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function {struct tm*} getdate (const char*) +# endif +function {struct tm*} gmtime_r (const time_t*, struct tm*) +function {struct tm*} localtime_r (const time_t*, struct tm*) +# if !defined XPG4 && !defined XPG42 +function int nanosleep (const struct timespec*, struct timespec*) +# endif +# if defined XOPEN2K8 || defined POSIX2008 +function size_t strftime_l (char*, size_t, const char*, const struct tm*, locale_t) +# endif +# if !defined POSIX && !defined POSIX2008 +function {char*} strptime (const char*, const char*, struct tm*) +# endif +# if !defined XPG4 && !defined XPG42 +function int timer_create (clockid_t, struct sigevent*, timer_t*) +function int timer_delete (timer_t) +function int timer_gettime (timer_t, struct itimerspec*) +function int timer_getoverrun (timer_t) +function int timer_settime (timer_t, int, const struct itimerspec*, struct itimerspec*) +# endif +function void tzset (void) + +# if !defined POSIX && !defined POSIX2008 +variable int daylight +variable {long int} timezone +# endif +variable {char*} tzname [2] + +# ifndef POSIX +allow tm_* +# endif +allow clock_* +allow timer_* +allow it_* +allow tv_* +allow CLOCK_* +allow TIMER_* +allow *_t +allow sigevent +#endif diff --git a/REORG.TODO/conform/data/uchar.h-data b/REORG.TODO/conform/data/uchar.h-data new file mode 100644 index 0000000000..ef27617bc4 --- /dev/null +++ b/REORG.TODO/conform/data/uchar.h-data @@ -0,0 +1,12 @@ +#if defined ISO11 +type mbstate_t +type size_t +type char16_t +type char32_t + +function size_t mbrtoc16 (char16_t *, const char *, size_t, mbstate_t *) +function size_t c16rtomb (char *, char16_t, mbstate_t *) +function size_t mbrtoc32 (char32_t *, const char *, size_t, mbstate_t *) +function size_t c32rtomb (char *, char32_t, mbstate_t *) + +#endif diff --git a/REORG.TODO/conform/data/ucontext.h-data b/REORG.TODO/conform/data/ucontext.h-data new file mode 100644 index 0000000000..c1ddf19d94 --- /dev/null +++ b/REORG.TODO/conform/data/ucontext.h-data @@ -0,0 +1,22 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined POSIX2008 && !defined XOPEN2K8 +type mcontext_t + +type ucontext_t + +element ucontext_t {ucontext_t*} uc_link +element ucontext_t sigset_t uc_sigmask +element ucontext_t stack_t uc_stack +element ucontext_t mcontext_t uc_mcontext + +type sigset_t +type stack_t + +function int getcontext (ucontext_t*) +function int setcontext (const ucontext_t*) +function void makecontext (ucontext_t*, void(*)(void), int, ...) +function int swapcontext (ucontext_t*, const ucontext_t*) + +allow uc_* +allow ss_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/ulimit.h-data b/REORG.TODO/conform/data/ulimit.h-data new file mode 100644 index 0000000000..1e5e5b471d --- /dev/null +++ b/REORG.TODO/conform/data/ulimit.h-data @@ -0,0 +1,9 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +constant UL_GETFSIZE +constant UL_SETFSIZE + +function {long int} ulimit (int, ...) + +allow UL_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/unistd.h-data b/REORG.TODO/conform/data/unistd.h-data new file mode 100644 index 0000000000..ddf4f25132 --- /dev/null +++ b/REORG.TODO/conform/data/unistd.h-data @@ -0,0 +1,615 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +#ifdef POSIX +# define uid_t __uid_t +# define gid_t __gid_t +# define off_t __off_t +# define pid_t __pid_t +#endif + +constant _POSIX_VERSION +#if defined POSIX || defined XPG4 || defined XPG42 || defined UNIX98 +constant _POSIX2_C_VERSION +#endif +#ifndef POSIX +optional-constant _XOPEN_VERSION +optional-constant _XOPEN_XCU_VERSION +#endif + +#ifndef POSIX +optional-constant _POSIX2_C_BIND +#endif +optional-constant _POSIX2_CHAR_TERM +optional-constant _POSIX2_LOCALEDEF +optional-constant _POSIX2_UPE +#ifndef POSIX +optional-constant _POSIX2_VERSION +#endif + +#ifndef POSIX +optional-constant _XOPEN_XPG2 +optional-constant _XOPEN_XPG3 +optional-constant _XOPEN_XPG4 +optional-constant _XOPEN_UNIX +#endif + +#ifndef POSIX +optional-constant _POSIX_ADVISORY_INFO +#endif +optional-constant _POSIX_ASYNCHRONOUS_IO +#ifndef POSIX +optional-constant _POSIX_BARRIERS +#endif +optional-constant _POSIX_CHOWN_RESTRICTED +#ifndef POSIX +optional-constant _POSIX_CLOCK_SELECTION +optional-constant _POSIX_CPUTIME +#endif +optional-constant _POSIX_NO_TRUNC +optional-constant _POSIX_VDISABLE +optional-constant _POSIX_SAVED_IDS +optional-constant _POSIX_JOB_CONTROL +#ifndef POSIX +optional-constant _POSIX_MONOTONIC_CLOCK +optional-constant _POSIX_READER_WRITER_LOCKS +optional-constant _POSIX_SHELL +optional-constant _POSIX_SPAWN +optional-constant _POSIX_SPIN_LOCKS +optional-constant _POSIX_SPORADIC_SERVER +optional-constant _POSIX_THREAD_CPUTIME +optional-constant _POSIX_TYPED_MEMORY_OBJECTS +#endif + +optional-constant _POSIX_THREADS +optional-constant _POSIX_THREAD_ATTR_STACKADDR +optional-constant _POSIX_THREAD_ATTR_STACKSIZE +optional-constant _POSIX_THREAD_PROCESS_SHARED +optional-constant _POSIX_THREAD_SAFE_FUNCTIONS +#ifndef POSIX +optional-constant _POSIX_THREAD_SPORADIC_SERVER +#endif + +# ifdef XOPEN2K +optional-constant _POSIX_V6_ILP32_OFF32 +optional-constant _POSIX_V6_ILP32_OFFBIG +optional-constant _POSIX_V6_LP64_OFF64 +optional-constant _POSIX_V6_LPBIG_OFFBIG +# endif +# if defined XOPEN2K8 || defined POSIX2008 +optional-constant _POSIX_V7_ILP32_OFF32 +optional-constant _POSIX_V7_ILP32_OFFBIG +optional-constant _POSIX_V7_LP64_OFF64 +optional-constant _POSIX_V7_LPBIG_OFFBIG +# endif + +optional-constant _POSIX2_C_DEV +optional-constant _POSIX2_FORT_DEV +optional-constant _POSIX2_FORT_RUN +optional-constant _POSIX2_SW_DEV +# if !defined POSIX && !defined POSIX2008 +optional-constant _XOPEN_CRYPT +optional-constant _XOPEN_ENH_I18N +optional-constant _XOPEN_LEGACY +optional-constant _XOPEN_REALTIME +optional-constant _XOPEN_REALTIME_THREADS +optional-constant _XOPEN_SHM +optional-constant _XOPEN_STREAMS +# endif +# ifndef POSIX +allow _XBS5_ILP32_OFF32 +allow _XBS5_ILP32_OFBIG +allow _XBS5_LP64_OFF64 +allow _XBS5_LPBIG_OFFBIG +#endif +optional-constant _POSIX_MEMLOCK +optional-constant _POSIX_MEMLOCK_RANGE +optional-constant _POSIX_MESSAGE_PASSING +optional-constant _POSIX_PRIORITY_SCHEDULING +optional-constant _POSIX_REALTIME_SIGNALS +optional-constant _POSIX_SEMAPHORES +optional-constant _POSIX_SHARED_MEMORY_OBJECTS +optional-constant _POSIX_SYNCHRONIZED_IO +optional-constant _POSIX_TIMERS +#ifndef POSIX +optional-constant _POSIX_TIMEOUTS +#endif + +optional-constant _POSIX_FSYNC +optional-constant _POSIX_MAPPED_FILES +optional-constant _POSIX_MEMORY_PROTECTION + +optional-constant _POSIX_PRIORITIZED_IO + +optional-constant _POSIX_THREAD_PRIORITY_SCHEDULING +optional-constant _POSIX_THREAD_PRIO_INHERIT +optional-constant _POSIX_THREAD_PRIO_PROTECT + +optional-constant _POSIX_ASYNC_IO +optional-constant _POSIX_PRIO_IO +optional-constant _POSIX_SYNC_IO + +#ifndef POSIX +optional-constant _POSIX2_PBS +optional-constant _POSIX2_PBS_ACCOUNTING +optional-constant _POSIX2_PBS_CHECKPOINT +optional-constant _POSIX2_PBS_LOCATE +optional-constant _POSIX2_PBS_MESSAGE +optional-constant _POSIX2_PBS_TRACK +#endif + +#ifndef POSIX +optional-constant _POSIX_TIMESTAMP_RESOLUTION +#endif + +constant NULL + +constant R_OK +constant W_OK +constant X_OK +constant F_OK + +constant _CS_PATH +#ifndef POSIX +constant _CS_XBS5_ILP32_OFF32_CFLAGS +constant _CS_XBS5_ILP32_OFF32_LDFLAGS +constant _CS_XBS5_ILP32_OFF32_LIBS +constant _CS_XBS5_ILP32_OFF32_LINTFLAGS +constant _CS_XBS5_ILP32_OFFBIG_CFLAGS +constant _CS_XBS5_ILP32_OFFBIG_LDFLAGS +constant _CS_XBS5_ILP32_OFFBIG_LIBS +constant _CS_XBS5_ILP32_OFFBIG_LINTFLAGS +constant _CS_XBS5_LP64_OFF64_CFLAGS +constant _CS_XBS5_LP64_OFF64_LDFLAGS +constant _CS_XBS5_LP64_OFF64_LIBS +constant _CS_XBS5_LP64_OFF64_LINTFLAGS +constant _CS_XBS5_LPBIG_OFFBIG_CFLAGS +constant _CS_XBS5_LPBIG_OFFBIG_LDFLAGS +constant _CS_XBS5_LPBIG_OFFBIG_LIBS +constant _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS +#endif + +constant SEEK_SET +constant SEEK_CUR +constant SEEK_END + +#ifndef POSIX +constant _SC_2_C_BIND +#endif +constant _SC_2_C_DEV +#ifndef POSIX +constant _SC_2_C_VERSION +#endif +constant _SC_2_CHAR_TERM +constant _SC_2_FORT_DEV +constant _SC_2_FORT_RUN +constant _SC_2_LOCALEDEF +#ifndef POSIX +constant _SC_2_PBS +constant _SC_2_PBS_ACCOUNTING +constant _SC_2_PBS_CHECKPOINT +constant _SC_2_PBS_LOCATE +constant _SC_2_PBS_MESSAGE +constant _SC_2_PBS_TRACK +#endif +constant _SC_2_SW_DEV +constant _SC_2_UPE +constant _SC_2_VERSION +constant _SC_ARG_MAX +constant _SC_AIO_LISTIO_MAX +constant _SC_AIO_MAX +constant _SC_AIO_PRIO_DELTA_MAX +constant _SC_ASYNCHRONOUS_IO +#ifndef POSIX +constant _SC_ATEXIT_MAX +constant _SC_BARRIERS +constant _SC_BASE +#endif +constant _SC_BC_BASE_MAX +constant _SC_BC_DIM_MAX +constant _SC_BC_SCALE_MAX +constant _SC_BC_STRING_MAX +constant _SC_CHILD_MAX +constant _SC_CLK_TCK +#ifndef POSIX +constant _SC_CLOCK_SELECTION +#endif +constant _SC_COLL_WEIGHTS_MAX +constant _SC_DELAYTIMER_MAX +#ifndef POSIX +constant _SC_DEVICE_IO +constant _SC_DEVICE_SPECIFIC +constant _SC_DEVICE_SPECIFIC_R +#endif +constant _SC_EXPR_NEST_MAX +#ifndef POSIX +constant _SC_FD_MGMT +constant _SC_FIFO +constant _SC_FILE_ATTRIBUTES +constant _SC_FILE_LOCKING +constant _SC_FILE_SYSTEM +#endif +constant _SC_FSYNC +constant _SC_GETGR_R_SIZE_MAX +constant _SC_GETPW_R_SIZE_MAX +#ifndef POSIX +constant _SC_IOV_MAX +#endif +constant _SC_JOB_CONTROL +constant _SC_LINE_MAX +constant _SC_LOGIN_NAME_MAX +constant _SC_MAPPED_FILES +constant _SC_MEMLOCK +constant _SC_MEMLOCK_RANGE +constant _SC_MEMORY_PROTECTION +constant _SC_MESSAGE_PASSING +#ifndef POSIX +constant _SC_MONOTONIC_CLOCK +#endif +constant _SC_MQ_OPEN_MAX +constant _SC_MQ_PRIO_MAX +#ifndef POSIX +constant _SC_NETWORKING +#endif +constant _SC_NGROUPS_MAX +constant _SC_OPEN_MAX +constant _SC_PAGESIZE +#ifndef POSIX +constant _SC_PAGE_SIZE +constant _SC_PASS_MAX +constant _SC_PIPE +#endif +constant _SC_PRIORITIZED_IO +constant _SC_PRIORITY_SCHEDULING +constant _SC_RE_DUP_MAX +#ifndef POSIX +constant _SC_READER_WRITER_LOCKS +#endif +constant _SC_REALTIME_SIGNALS +#ifndef POSIX +constant _SC_REGEXP +#endif +constant _SC_RTSIG_MAX +constant _SC_SAVED_IDS +constant _SC_SEMAPHORES +constant _SC_SEM_NSEMS_MAX +constant _SC_SEM_VALUE_MAX +constant _SC_SHARED_MEMORY_OBJECTS +#ifndef POSIX +constant _SC_SHELL +constant _SC_SIGNALS +#endif +constant _SC_SIGQUEUE_MAX +#ifndef POSIX +constant _SC_SINGLE_PROCESS +constant _SC_SPIN_LOCKS +#endif +constant _SC_STREAM_MAX +constant _SC_SYNCHRONIZED_IO +constant _SC_THREADS +constant _SC_THREAD_ATTR_STACKADDR +constant _SC_THREAD_ATTR_STACKSIZE +constant _SC_THREAD_DESTRUCTOR_ITERATIONS +constant _SC_THREAD_KEYS_MAX +constant _SC_THREAD_PRIORITY_SCHEDULING +constant _SC_THREAD_PRIO_INHERIT +constant _SC_THREAD_PRIO_PROTECT +constant _SC_THREAD_PROCESS_SHARED +constant _SC_THREAD_SAFE_FUNCTIONS +constant _SC_THREAD_STACK_MIN +constant _SC_THREAD_THREADS_MAX +constant _SC_TIMERS +constant _SC_TIMER_MAX +constant _SC_TTY_NAME_MAX +#ifndef POSIX +constant _SC_TYPED_MEMORY_OBJECTS +#endif +constant _SC_TZNAME_MAX +#ifndef POSIX +constant _SC_USER_GROUPS +constant _SC_USER_GROUPS_R +#endif +# ifdef XOPEN2K +constant _SC_V6_ILP32_OFF32 +constant _SC_V6_ILP32_OFFBIG +constant _SC_V6_LP64_OFF64 +constant _SC_V6_LPBIG_OFFBIG +# endif +# if defined XOPEN2K8 || defined POSIX2008 +constant _SC_V7_ILP32_OFF32 +constant _SC_V7_ILP32_OFFBIG +constant _SC_V7_LP64_OFF64 +constant _SC_V7_LPBIG_OFFBIG +# endif +constant _SC_VERSION +# if !defined POSIX && !defined POSIX2008 +constant _SC_XOPEN_VERSION +constant _SC_XOPEN_CRYPT +constant _SC_XOPEN_ENH_I18N +constant _SC_XOPEN_SHM +constant _SC_XOPEN_UNIX +constant _SC_XOPEN_XCU_VERSION +constant _SC_XOPEN_LEGACY +constant _SC_XOPEN_REALTIME +constant _SC_XOPEN_REALTIME_THREADS +# endif +# ifndef POSIX +constant _SC_STREAMS +constant _SC_XBS5_ILP32_OFF32 +constant _SC_XBS5_ILP32_OFFBIG +constant _SC_XBS5_LP64_OFF64 +constant _SC_XBS5_LPBIG_OFFBIG +# endif +# ifdef XOPEN2K +constant _CS_POSIX_V6_ILP32_OFF32_CFLAGS +constant _CS_POSIX_V6_ILP32_OFF32_LDFLAGS +constant _CS_POSIX_V6_ILP32_OFF32_LIBS +constant _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS +constant _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS +constant _CS_POSIX_V6_ILP32_OFFBIG_LIBS +constant _CS_POSIX_V6_LP64_OFF64_CFLAGS +constant _CS_POSIX_V6_LP64_OFF64_LDFLAGS +constant _CS_POSIX_V6_LP64_OFF64_LIBS +constant _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS +constant _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS +constant _CS_POSIX_V6_LPBIG_OFFBIG_LIBS +constant _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS +constant _CS_V6_ENV +# endif +# if defined XOPEN2K8 || defined POSIX2008 +constant _CS_POSIX_V7_ILP32_OFF32_CFLAGS +constant _CS_POSIX_V7_ILP32_OFF32_LDFLAGS +constant _CS_POSIX_V7_ILP32_OFF32_LIBS +constant _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS +constant _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS +constant _CS_POSIX_V7_ILP32_OFFBIG_LIBS +constant _CS_POSIX_V7_LP64_OFF64_CFLAGS +constant _CS_POSIX_V7_LP64_OFF64_LDFLAGS +constant _CS_POSIX_V7_LP64_OFF64_LIBS +constant _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS +constant _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS +constant _CS_POSIX_V7_LPBIG_OFFBIG_LIBS +constant _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS +constant _CS_V7_ENV +# endif +# ifndef POSIX +constant _SC_THREAD_ROBUST_PRIO_INHERIT +constant _SC_THREAD_ROBUST_PRIO_PROTECT +#endif + +#if !defined XPG4 && !defined POSIX && !defined POSIX2008 +constant F_LOCK +constant F_ULOCK +constant F_TEST +constant F_TLOCK +#endif + +constant _PC_ASYNC_IO +constant _PC_CHOWN_RESTRICTED +#ifndef POSIX +constant _PC_FILESIZEBITS +#endif +constant _PC_LINK_MAX +constant _PC_MAX_CANON +constant _PC_MAX_INPUT +constant _PC_NAME_MAX +constant _PC_NO_TRUNC +constant _PC_PATH_MAX +constant _PC_PIPE_BUF +constant _PC_PRIO_IO +#ifndef POSIX +constant _PC_REC_INCR_XFER_SIZE +constant _PC_REC_MAX_XFER_SIZE +constant _PC_REC_MIN_XFER_SIZE +constant _PC_REC_XFER_ALIGN +#endif +constant _PC_SYNC_IO +constant _PC_VDISABLE + +constant STDIN_FILENO +constant STDOUT_FILENO +constant STDERR_FILENO + +type size_t +type ssize_t +#ifndef POSIX +type uid_t +type gid_t +type off_t +type pid_t +#endif + +#if !defined POSIX && !defined XPG4 +type useconds_t + +# ifndef XPG42 +type intptr_t +# endif +#endif + +function int access (const char*, int) +function {unsigned int} alarm (unsigned int) +#if !defined XOPEN2K && !defined XOPEN2K8 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int brk (void*) +#endif +function int chdir (const char*) +#if defined XPG4 || defined XPG42 || defined UNIX98 +function int chroot (const char*) +#endif +function int chown (const char*, uid_t, gid_t) +function int close (int) +function size_t confstr (int, char*, size_t) +#if !defined POSIX && !defined POSIX2008 +function {char*} crypt (const char*, const char*) +#endif +#if defined XPG4 || defined XPG42 || defined UNIX98 +function {char*} ctermid (char*) +function {char*} cuserid (char*) +#endif +#ifdef POSIX +allow cuserid +#endif +function int dup (int) +function int dup2 (int, int) +#if !defined POSIX && !defined POSIX2008 +function void encrypt (char[64], int) +#endif +function int execl (const char*, const char*, ...) +function int execle (const char*, const char*, ...) +function int execlp (const char*, const char*, ...) +function int execv (const char*, char *const[]) +function int execve (const char*, char *const[], char *const[]) +function int execvp (const char*, char *const[]) +function void _exit (int) +# if defined XOPEN2K8 || defined POSIX2008 +function int faccessat (int, const char*, int, int) +# endif +#if !defined XPG4 && !defined POSIX +function int fchown (int, uid_t, gid_t) +#endif +# if defined XOPEN2K8 || defined POSIX2008 +function int fchownat (int, const char*, uid_t, gid_t, int) +# endif +#if !defined XPG4 && !defined POSIX +function int fchdir (int) +#endif +#if !defined XPG4 && !defined XPG42 +function int fdatasync (int) +#endif +# if defined XOPEN2K8 || defined POSIX2008 +function int fexecve (int, char *const[], char *const[]) +# endif +function pid_t fork (void) +function {long int} fpathconf (int, int) +function int fsync (int) +#ifndef XPG4 +function int ftruncate (int, off_t) +#endif +function {char*} getcwd (char*, size_t) +#if !defined XOPEN2K && !defined XOPEN2K8 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int getdtablesize (void) +#endif +function gid_t getegid (void) +function uid_t geteuid (void) +function gid_t getgid (void) +function int getgroups (int, gid_t[]) +#if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function long gethostid (void) +#endif +#if !defined POSIX && !defined XPG4 +function int gethostname (char*, size_t) +#endif +function {char*} getlogin (void) +#if !defined XPG4 && !defined XPG42 +function int getlogin_r (char*, size_t) +#endif +function int getopt (int, char*const[], const char*) +#if defined XPG42 || defined UNIX98 +function int getpagesize (void) +#endif +#if defined XPG4 || defined XPG42 || defined UNIX98 +function {char*} getpass (const char*) +#endif +#if !defined XPG4 && !defined POSIX +function pid_t getpgid (pid_t) +#endif +function pid_t getpgrp (void) +function pid_t getpid (void) +function pid_t getppid (void) +#if !defined XPG4 && !defined POSIX +function pid_t getsid (pid_t) +#endif +function uid_t getuid (void) +#if defined XPG42 || defined UNIX98 || defined XOPEN2K +function {char*} getwd (char*) +#endif +function int isatty (int) +#if !defined XPG4 && !defined POSIX +function int lchown (const char*, uid_t, gid_t) +#endif +function int link (const char*, const char*) +# if defined XOPEN2K8 || defined POSIX2008 +function int linkat (int, const char*, int, const char*, int) +# endif +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function int lockf (int, int, off_t) +# endif +function off_t lseek (int, off_t, int) +# if !defined POSIX && !defined POSIX2008 +function int nice (int) +# endif +function {long int} pathconf (const char*, int) +function int pause (void) +function int pipe (int[2]) +#if !defined POSIX && !defined XPG4 && !defined XPG42 +function ssize_t pread (int, void*, size_t, off_t) +#endif +#if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008 && !defined XPG4 && !defined XPG42 +function int pthread_atfork (void(*)(void), void(*)(void), void(*)(void)) +#endif +#if !defined POSIX && !defined XPG4 && !defined XPG42 +function ssize_t pwrite (int, const void*, size_t, off_t) +#endif +function ssize_t read (int, void*, size_t) +#if !defined XPG4 && !defined POSIX +function ssize_t readlink (const char*, char*, size_t) +#endif +# if defined XOPEN2K8 || defined POSIX2008 +function ssize_t readlinkat (int, const char*, char*, size_t) +# endif +function int rmdir (const char*) +#if !defined XOPEN2K && !defined XOPEN2K8 && !defined XPG4 && !defined POSIX && !defined POSIX2008 +function {void*} sbrk (intptr_t) +#endif +#if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 +function int setegid (gid_t) +function int seteuid (uid_t) +#endif +function int setgid (gid_t) +function int setpgid (pid_t, pid_t) +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function pid_t setpgrp (void) +function int setregid (gid_t, gid_t) +function int setreuid (uid_t, uid_t) +# endif +function pid_t setsid (void) +function int setuid (uid_t) +function {unsigned int} sleep (unsigned int) +# if !defined POSIX && !defined POSIX2008 +function void swab (const void*, void*, ssize_t) +# endif +#if !defined XPG4 && !defined POSIX +function int symlink (const char*, const char*) +# endif +# if defined XOPEN2K8 || defined POSIX2008 +function int symlinkat (const char*, int, const char*) +# endif +# if !defined XPG4 && !defined POSIX && !defined POSIX2008 +function void sync (void) +# endif +function {long int} sysconf (int) +function pid_t tcgetpgrp (int) +function int tcsetpgrp (int, pid_t) +#if !defined XPG4 && !defined POSIX +function int truncate (const char*, off_t) +#endif +function {char*} ttyname (int) +function int ttyname_r (int, char*, size_t) +#if defined XPG42 || defined UNIX98 || defined XOPEN2K +function useconds_t ualarm (useconds_t, useconds_t) +#endif +function int unlink (const char*) +# if defined XOPEN2K8 || defined POSIX2008 +function int unlinkat (int, const char*, int) +# endif +#if defined XPG42 || defined UNIX98 || defined XOPEN2K +function int usleep (useconds_t) +function pid_t vfork (void) +#endif +function ssize_t write (int, const void*, size_t) + +variable {char*} optarg +variable int optind +variable int opterr +variable int optopt + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/utime.h-data b/REORG.TODO/conform/data/utime.h-data new file mode 100644 index 0000000000..e3201651c1 --- /dev/null +++ b/REORG.TODO/conform/data/utime.h-data @@ -0,0 +1,17 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +#ifdef POSIX +# define time_t __time_t +#endif + +type {struct utimbuf} + +element {struct utimbuf} time_t actime +element {struct utimbuf} time_t modtime + +type time_t + +function int utime (const char*, const struct utimbuf*) + +allow utim_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/utmpx.h-data b/REORG.TODO/conform/data/utmpx.h-data new file mode 100644 index 0000000000..cfe2a08634 --- /dev/null +++ b/REORG.TODO/conform/data/utmpx.h-data @@ -0,0 +1,41 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 && !defined XPG4 +type {struct utmpx} + +element {struct utmpx} char ut_user [] +element {struct utmpx} char ut_id [] +element {struct utmpx} char ut_line [] +element {struct utmpx} pid_t ut_pid +element {struct utmpx} {short int} ut_type +// Layout chosen to be compatible on 32-bit and 64-bit bi-arch +// systems, which is incompatible with the standard type (see bug +// 18235). +xfail-element {struct utmpx} {struct timeval} ut_tv + +type pid_t + +type {struct timeval} + +element {struct timeval} time_t tv_sec +element {struct timeval} suseconds_t tv_usec + +constant EMPTY +constant BOOT_TIME +constant OLD_TIME +constant NEW_TIME +constant USER_PROCESS +constant INIT_PROCESS +constant LOGIN_PROCESS +constant DEAD_PROCESS + +function void endutxent (void) +function {struct utmpx*} getutxent (void) +function {struct utmpx*} getutxid (const struct utmpx*) +function {struct utmpx*} getutxline (const struct utmpx*) +function {struct utmpx*} pututxline (const struct utmpx*) +function void setutxent (void) + +allow-header sys/time.h + +allow ut_* +allow *_t +#endif diff --git a/REORG.TODO/conform/data/varargs.h-data b/REORG.TODO/conform/data/varargs.h-data new file mode 100644 index 0000000000..2366edb1fa --- /dev/null +++ b/REORG.TODO/conform/data/varargs.h-data @@ -0,0 +1,10 @@ +#if defined XPG4 || defined XPG42 || defined UNIX98 +macro va_alist +macro va_dcl +type va_list +macro va_start +macro va_arg +macro va_end + +allow *_t +#endif diff --git a/REORG.TODO/conform/data/wchar.h-data b/REORG.TODO/conform/data/wchar.h-data new file mode 100644 index 0000000000..0beae8957d --- /dev/null +++ b/REORG.TODO/conform/data/wchar.h-data @@ -0,0 +1,169 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 +type wchar_t +type wint_t +# if !defined ISO99 && !defined ISO11 && !defined POSIX2008 +type wctype_t +# endif +type mbstate_t +# if !defined ISO99 && !defined ISO11 +type FILE +# else +# define FILE __FILE +# endif +type size_t +# if defined XOPEN2K8 || defined POSIX2008 +type locale_t +# endif +tag {struct tm} + +function wint_t btowc (int) +function int fwprintf (FILE*, const wchar_t*, ...) +function int fwscanf (FILE*, const wchar_t*, ...) +# if !defined ISO99 && !defined ISO11 && !defined POSIX2008 +function int iswalnum (wint_t) +function int iswalpha (wint_t) +function int iswcntrl (wint_t) +function int iswdigit (wint_t) +function int iswgraph (wint_t) +function int iswlower (wint_t) +function int iswprint (wint_t) +function int iswpunct (wint_t) +function int iswspace (wint_t) +function int iswupper (wint_t) +function int iswxdigit (wint_t) +function int iswctype (wint_t, wctype_t) +# endif +function wint_t fgetwc (FILE*) +function {wchar_t*} fgetws (wchar_t*, int, FILE*) +function wint_t fputwc (wchar_t, FILE*) +function int fputws (const wchar_t*, FILE*) +function int fwide (FILE*, int) +function wint_t getwc (FILE*) +function wint_t getwchar (void) +function int mbsinit (const mbstate_t*) +function size_t mbrlen (const char*, size_t, mbstate_t*) +function size_t mbrtowc (wchar_t*, const char*, size_t, mbstate_t*) +# if defined XOPEN2K8 || defined POSIX2008 +function size_t mbsnrtowcs (wchar_t*, const char**, size_t, size_t, mbstate_t*) +# endif +function size_t mbsrtowcs (wchar_t*, const char**, size_t, mbstate_t*) +# if defined XOPEN2K8 || defined POSIX2008 +function {FILE*} open_wmemstream (wchar_t**, size_t*) +# endif +function wint_t putwc (wchar_t, FILE*) +function wint_t putwchar (wchar_t) +function int swprintf (wchar_t*, size_t, const wchar_t*, ...) +function int swscanf (const wchar_t*, const wchar_t*, ...) +# if !defined ISO99 && !defined ISO11 && !defined POSIX2008 +function wint_t towlower (wint_t) +function wint_t towupper (wint_t) +# endif +function wint_t ungetwc (wint_t, FILE*) +function int vfwprintf (FILE*, const wchar_t*, __gnuc_va_list) +# ifndef UNIX98 +function int vfwscanf (FILE*, const wchar_t*, __gnuc_va_list) +# endif +function int vwprintf (const wchar_t*, __gnuc_va_list) +# ifndef UNIX98 +function int vwscanf (const wchar_t*, __gnuc_va_list) +# endif +function int vswprintf (wchar_t*, size_t, const wchar_t*, __gnuc_va_list) +# ifndef UNIX98 +function int vswscanf (const wchar_t*, const wchar_t*, __gnuc_va_list) +# endif +# if defined XOPEN2K8 || defined POSIX2008 +function {wchar_t*} wcpcpy (wchar_t*, const wchar_t*) +function {wchar_t*} wcpncpy (wchar_t*, const wchar_t*, size_t) +# endif +function size_t wcrtomb (char*, wchar_t, mbstate_t*) +# if defined XOPEN2K8 || defined POSIX2008 +function int wcscasecmp(const wchar_t*, const wchar_t*) +function int wcscasecmp_l(const wchar_t*, const wchar_t*, locale_t) +# endif +function {wchar_t*} wcscat (wchar_t*, const wchar_t*) +function {wchar_t*} wcschr (const wchar_t*, wchar_t) +function int wcscmp (const wchar_t*, const wchar_t*) +function int wcscoll (const wchar_t*, const wchar_t*) +# if defined XOPEN2K8 || defined POSIX2008 +function int wcscoll_l (const wchar_t*, const wchar_t*, locale_t) +# endif +function {wchar_t*} wcscpy (wchar_t*, const wchar_t*) +function size_t wcscspn (const wchar_t*, const wchar_t*) +# if defined XOPEN2K8 || defined POSIX2008 +function {wchar_t*} wcsdup (const wchar_t*) +# endif +function size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*) +function size_t wcslen (const wchar_t*) +# if defined XOPEN2K8 || defined POSIX2008 +function int wcsncasecmp (const wchar_t*, const wchar_t*, size_t) +function int wcsncasecmp_l (const wchar_t*, const wchar_t*, size_t, locale_t) +# endif +function {wchar_t*} wcsncat (wchar_t*, const wchar_t*, size_t) +function int wcsncmp (const wchar_t*, const wchar_t*, size_t) +function {wchar_t*} wcsncpy (wchar_t*, const wchar_t*, size_t) +# if defined XOPEN2K8 || defined POSIX2008 +function size_t wcsnlen (const wchar_t*, size_t) +function size_t wcsnrtombs (char*, const wchar_t**, size_t, size_t, mbstate_t*) +# endif +function {wchar_t*} wcspbrk (const wchar_t*, const wchar_t*) +function {wchar_t*} wcsrchr (const wchar_t*, wchar_t) +function size_t wcsrtombs (char*, const wchar_t**, size_t, mbstate_t*) +function size_t wcsspn (const wchar_t*, const wchar_t*) +function {wchar_t*} wcsstr (const wchar_t*, const wchar_t*) +function double wcstod (const wchar_t*, wchar_t**) +# ifndef UNIX98 +function float wcstof (const wchar_t*, wchar_t**) +function {long double} wcstold (const wchar_t*, wchar_t**) +# endif +function {wchar_t*} wcstok (wchar_t*, const wchar_t*, wchar_t**) +function {long int} wcstol (const wchar_t*, wchar_t**, int) +# ifndef UNIX98 +function {long long int} wcstoll (const wchar_t*, wchar_t**, int) +# endif +function {unsigned long int} wcstoul (const wchar_t*, wchar_t**, int) +# ifndef UNIX98 +function {unsigned long long int} wcstoull (const wchar_t*, wchar_t**, int) +# endif +# if defined UNIX98 || defined XOPEN2K +function {wchar_t*} wcswcs (const wchar_t*, const wchar_t*) +# endif +# if !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 +function int wcswidth (const wchar_t*, size_t) +# endif +function size_t wcsxfrm (wchar_t*, const wchar_t*, size_t) +# if defined XOPEN2K8 || defined POSIX2008 +function size_t wcsxfrm_l (wchar_t*, const wchar_t*, size_t, locale_t) +# endif +function int wctob (wint_t) +# if !defined ISO99 && !defined ISO11 && !defined POSIX2008 +function wctype_t wctype (const char*) +function int wcwidth (wchar_t) +# endif +function {wchar_t*} wmemchr (const wchar_t*, wchar_t, size_t) +function int wmemcmp (const wchar_t*, const wchar_t*, size_t) +function {wchar_t*} wmemcpy (wchar_t*, const wchar_t*, size_t) +function {wchar_t*} wmemmove (wchar_t*, const wchar_t*, size_t) +function {wchar_t*} wmemset (wchar_t*, wchar_t, size_t) +function int wprintf (const wchar_t*, ...) +function int wscanf (const wchar_t*, ...) + +macro-int-constant WCHAR_MIN {promoted:wchar_t} +macro-int-constant WCHAR_MAX {promoted:wchar_t} >= 127 +macro-constant WEOF {wint_t} +macro-constant NULL == 0 + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow-header ctype.h +allow-header stdio.h +allow-header stdarg.h +allow-header stdlib.h +allow-header string.h +allow-header stddef.h +allow-header time.h +#endif + +allow wcs[abcdefghijklmnopqrstuvwxyz]* +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif +#endif diff --git a/REORG.TODO/conform/data/wctype.h-data b/REORG.TODO/conform/data/wctype.h-data new file mode 100644 index 0000000000..944fe6efab --- /dev/null +++ b/REORG.TODO/conform/data/wctype.h-data @@ -0,0 +1,68 @@ +#if !defined ISO && !defined POSIX && !defined XPG4 && !defined XPG42 +type wint_t +type wctrans_t +type wctype_t +# if defined XOPEN2K8 || defined POSIX2008 +type locale_t +# endif + +function int iswalnum (wint_t) +function int iswalpha (wint_t) +# ifndef UNIX98 +function int iswblank (wint_t) +# endif +function int iswcntrl (wint_t) +function int iswdigit (wint_t) +function int iswgraph (wint_t) +function int iswlower (wint_t) +function int iswprint (wint_t) +function int iswpunct (wint_t) +function int iswspace (wint_t) +function int iswupper (wint_t) +function int iswxdigit (wint_t) +function int iswctype (wint_t, wctype_t) +function wint_t towctrans (wint_t, wctrans_t) +function wint_t towlower (wint_t) +function wint_t towupper (wint_t) +function wctrans_t wctrans (const char*) +function wctype_t wctype (const char*) +# if defined XOPEN2K8 || defined POSIX2008 +function int iswalnum_l (wint_t, locale_t) +function int iswalpha_l (wint_t, locale_t) +function int iswblank_l (wint_t, locale_t) +function int iswcntrl_l (wint_t, locale_t) +function int iswdigit_l (wint_t, locale_t) +function int iswgraph_l (wint_t, locale_t) +function int iswlower_l (wint_t, locale_t) +function int iswprint_l (wint_t, locale_t) +function int iswpunct_l (wint_t, locale_t) +function int iswspace_l (wint_t, locale_t) +function int iswupper_l (wint_t, locale_t) +function int iswxdigit_l (wint_t, locale_t) +function int iswctype_l (wint_t, wctype_t, locale_t) +function wint_t towctrans_l (wint_t, wctrans_t, locale_t) +function wint_t towlower_l (wint_t, locale_t) +function wint_t towupper_l (wint_t, locale_t) +function wctrans_t wctrans_l (const char*, locale_t) +function wctype_t wctype_l (const char*, locale_t) +# endif + +macro-constant WEOF {wint_t} + +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow-header ctype.h +allow-header stdio.h +allow-header stdarg.h +allow-header stdlib.h +allow-header string.h +allow-header stddef.h +allow-header time.h +allow-header wchar.h +#endif + +allow is[abcdefghijklmnopqrstuvwxyz]* +allow to[abcdefghijklmnopqrstuvwxyz]* +#if !defined ISO && !defined ISO99 && !defined ISO11 +allow *_t +#endif +#endif diff --git a/REORG.TODO/conform/data/wordexp.h-data b/REORG.TODO/conform/data/wordexp.h-data new file mode 100644 index 0000000000..0d96d68edc --- /dev/null +++ b/REORG.TODO/conform/data/wordexp.h-data @@ -0,0 +1,30 @@ +#if !defined ISO && !defined ISO99 && !defined ISO11 +type wordexp_t + +element wordexp_t size_t we_wordc +element wordexp_t {char**} we_wordv +element wordexp_t size_t we_offs + +constant WRDE_APPEND +constant WRDE_DOOFFS +constant WRDE_NOCMD +constant WRDE_REUSE +constant WRDE_SHOWERR +constant WRDE_UNDEF + +constant WRDE_BADCHAR +constant WRDE_BADVAL +constant WRDE_CMDSUB +constant WRDE_NOSPACE +# if !defined POSIX && !defined XOPEN2K8 && !defined POSIX2008 +constant WRDE_NOSYS +# endif +constant WRDE_SYNTAX + +function int wordexp (const char*, wordexp_t*, int) +function void wordfree (wordexp_t*) + +allow WRDE_* +allow we_* +allow *_t +#endif diff --git a/REORG.TODO/conform/linknamespace.pl b/REORG.TODO/conform/linknamespace.pl new file mode 100644 index 0000000000..35257304b9 --- /dev/null +++ b/REORG.TODO/conform/linknamespace.pl @@ -0,0 +1,237 @@ +#!/usr/bin/perl + +# Check that use of symbols declared in a given header does not result +# in any symbols being brought in that are not reserved with external +# linkage for the given standard. + +# Copyright (C) 2014-2017 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 +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# <http://www.gnu.org/licenses/>. + +use GlibcConform; +use Getopt::Long; + +GetOptions ('header=s' => \$header, 'standard=s' => \$standard, + 'flags=s' => \$flags, 'cc=s' => \$CC, 'tmpdir=s' => \$tmpdir, + 'stdsyms=s' => \$stdsyms_file, 'libsyms=s' => \$libsyms_file, + 'readelf=s' => \$READELF); + +# Load the list of symbols that are OK. +%stdsyms = (); +open (STDSYMS, "<$stdsyms_file") || die ("open $stdsyms_file: $!\n"); +while (<STDSYMS>) { + chomp; + $stdsyms{$_} = 1; +} +close (STDSYMS) || die ("close $stdsyms_file: $!\n"); + +# The following whitelisted symbols are also allowed for now. +# +# * Bug 17576: stdin, stdout, stderr only reserved with external +# linkage when stdio.h included (and possibly not then), not +# generally. +# +# * Bug 18442: re_syntax_options wrongly brought in by regcomp and +# used by re_comp. +# +# * False positive: matherr only used conditionally. matherrf/matherrl are used +# by IA64 too for the same reason. +# +@whitelist = qw(stdin stdout stderr re_syntax_options matherr matherrf + matherrl); +foreach my $sym (@whitelist) { + $stdsyms{$sym} = 1; +} + +# Return information about GLOBAL and WEAK symbols listed in readelf +# -s output. +sub list_syms { + my ($syms_file) = @_; + open (SYMS, "<$syms_file") || die ("open $syms_file: $!\n"); + my ($file) = $syms_file; + my (@ret) = (); + while (<SYMS>) { + chomp; + if (/^File: (.*)/) { + $file = $1; + $file =~ s|^.*/||; + next; + } + s/^\s*//; + # Architecture-specific st_other bits appear inside [] and disrupt + # the format of readelf output. + s/\[.*?\]//; + my (@fields) = split (/\s+/, $_); + if (@fields < 8) { + next; + } + my ($bind) = $fields[4]; + my ($ndx) = $fields[6]; + my ($sym) = $fields[7]; + if ($bind ne "GLOBAL" && $bind ne "WEAK") { + next; + } + if ($sym !~ /^\w+$/) { + next; + } + push (@ret, [$file, $sym, $bind, $ndx ne "UND"]); + } + close (SYMS) || die ("close $syms_file: $!\n"); + return @ret; +} + +# Load information about GLOBAL and WEAK symbols defined or used in +# the standard libraries. +# Symbols from a given object, except for weak defined symbols. +%seen_syms = (); +# Strong undefined symbols from a given object. +%strong_undef_syms = (); +# Objects defining a given symbol (strongly or weakly). +%sym_objs = (); +@sym_data = list_syms ($libsyms_file); +foreach my $sym (@sym_data) { + my ($file, $name, $bind, $defined) = @$sym; + if ($defined) { + if (!defined ($sym_objs{$name})) { + $sym_objs{$name} = []; + } + push (@{$sym_objs{$name}}, $file); + } + if ($bind eq "GLOBAL" || !$defined) { + if (!defined ($seen_syms{$file})) { + $seen_syms{$file} = []; + } + push (@{$seen_syms{$file}}, $name); + } + if ($bind eq "GLOBAL" && !$defined) { + if (!defined ($strong_undef_syms{$file})) { + $strong_undef_syms{$file} = []; + } + push (@{$strong_undef_syms{$file}}, $name); + } +} + +# Determine what ELF-level symbols are brought in by use of C-level +# symbols declared in the given header. +# +# The rules followed are heuristic and so may produce false positives +# and false negatives. +# +# * All undefined symbols are considered of signficance, but it is +# possible that (a) any standard library definition is weak, so can be +# overridden by the user's definition, and (b) the symbol is only used +# conditionally and not if the program is limited to standard +# functionality. (matherr is an example of such a false positive.) +# +# * If a symbol reference is only brought in by the user using a data +# symbol rather than a function from the standard library, this will +# not be detected. +# +# * If a symbol reference is only brought in by crt*.o or libgcc, this +# will not be detected. +# +# * If a symbol reference is only brought in through __builtin_foo in +# a standard macro being compiled to call foo, this will not be +# detected. +# +# * Header inclusions should be compiled several times with different +# options such as -O2, -D_FORTIFY_SOURCE and -D_FILE_OFFSET_BITS=64 to +# find out what symbols are undefined from such a compilation; this is +# not yet implemented. +# +# * This script finds symbols referenced through use of macros on the +# basis that if a macro calls an internal function, that function must +# also be declared in the header. However, the header might also +# declare implementation-namespace functions that are not called by +# any standard macro in the header, resulting in false positives for +# any symbols brought in only through use of those +# implementation-namespace functions. +# +# * Namespace issues can apply for dynamic linking as well as static +# linking, when a call is from one shared library to another or uses a +# PLT entry for a call within a shared library; such issues are only +# detected by this script if the same namespace issue applies for +# static linking. + +@c_syms = list_exported_functions ("$CC $flags", $standard, $header, $tmpdir); +$cincfile = "$tmpdir/undef-$$.c"; +$cincfile_o = "$tmpdir/undef-$$.o"; +$cincfile_sym = "$tmpdir/undef-$$.sym"; +open (CINCFILE, ">$cincfile") || die ("open $cincfile: $!\n"); +print CINCFILE "#include <$header>\n"; +foreach my $sym (sort @c_syms) { + print CINCFILE "void *__glibc_test_$sym = (void *) &$sym;\n"; +} +close CINCFILE || die ("close $cincfile: $!\n"); +system ("$CC $flags -D_ISOMAC $CFLAGS{$standard} -c $cincfile -o $cincfile_o") + && die ("compiling failed\n"); +system ("LC_ALL=C $READELF -W -s $cincfile_o > $cincfile_sym") + && die ("readelf failed\n"); +@elf_syms = list_syms ($cincfile_sym); +unlink ($cincfile) || die ("unlink $cincfile: $!\n"); +unlink ($cincfile_o) || die ("unlink $cincfile_o: $!\n"); +unlink ($cincfile_sym) || die ("unlink $cincfile_sym: $!\n"); + +%seen_where = (); +%files_seen = (); +%all_undef = (); +%current_undef = (); +foreach my $sym (@elf_syms) { + my ($file, $name, $bind, $defined) = @$sym; + if ($bind eq "GLOBAL" && !$defined) { + $seen_where{$name} = "[initial] $name"; + $all_undef{$name} = "[initial] $name"; + $current_undef{$name} = "[initial] $name"; + } +} + +while (%current_undef) { + %new_undef = (); + foreach my $sym (sort keys %current_undef) { + foreach my $file (@{$sym_objs{$sym}}) { + if (defined ($files_seen{$file})) { + next; + } + $files_seen{$file} = 1; + foreach my $ssym (@{$seen_syms{$file}}) { + if (!defined ($seen_where{$ssym})) { + $seen_where{$ssym} = "$current_undef{$sym} -> [$file] $ssym"; + } + } + foreach my $usym (@{$strong_undef_syms{$file}}) { + if (!defined ($all_undef{$usym})) { + $all_undef{$usym} = "$current_undef{$sym} -> [$file] $usym"; + $new_undef{$usym} = "$current_undef{$sym} -> [$file] $usym"; + } + } + } + } + %current_undef = %new_undef; +} + +$ret = 0; +foreach my $sym (sort keys %seen_where) { + if ($sym =~ /^_/) { + next; + } + if (defined ($stdsyms{$sym})) { + next; + } + print "$seen_where{$sym}\n"; + $ret = 1; +} + +exit $ret; diff --git a/REORG.TODO/conform/list-header-symbols.pl b/REORG.TODO/conform/list-header-symbols.pl new file mode 100644 index 0000000000..757fffebd7 --- /dev/null +++ b/REORG.TODO/conform/list-header-symbols.pl @@ -0,0 +1,83 @@ +#!/usr/bin/perl + +# Print a list of symbols exported by some headers that would +# otherwise be in the user's namespace. + +# Copyright (C) 2014-2017 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 +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# <http://www.gnu.org/licenses/>. + +use GlibcConform; +use Getopt::Long; + +GetOptions ('headers=s' => \$headers, 'standard=s' => \$standard, + 'flags=s' => \$flags, 'cc=s' => \$CC, 'tmpdir=s' => \$tmpdir); +@headers = split (/\s+/, $headers); + +# Extra symbols possibly not found through -aux-info but still +# reserved by the standard: either data symbols, or symbols where the +# standard leaves unspecified whether the identifier is a macro or +# defined with external linkage. +$extra_syms{"ISO"} = ["errno", "setjmp", "va_end"]; +$extra_syms{"ISO99"} = ["errno", "math_errhandling", "setjmp", "va_end"]; +# stdatomic.h not yet covered by conformance tests; as per DR#419, all +# the generic functions there or may not be defined with external +# linkage (but are reserved in any case). +$extra_syms{"ISO11"} = ["errno", "math_errhandling", "setjmp", "va_end"]; +# The following lists may not be exhaustive. +$extra_syms{"POSIX"} = ["errno", "setjmp", "va_end", "environ", "sigsetjmp", + "optarg", "optind", "opterr", "optopt", "tzname"]; +$extra_syms{"XPG4"} = ["errno", "setjmp", "va_end", "environ", "signgam", + "loc1", "loc2", "locs", "sigsetjmp", "optarg", + "optind", "opterr", "optopt", "daylight", "timezone", + "tzname"]; +$extra_syms{"XPG42"} = ["errno", "setjmp", "va_end", "environ", "signgam", + "loc1", "loc2", "locs", "sigsetjmp", "optarg", + "optind", "opterr", "optopt", "daylight", "timezone", + "tzname", "getdate_err", "h_errno"]; +$extra_syms{"UNIX98"} = ["errno", "setjmp", "va_end", "environ", "signgam", + "loc1", "loc2", "locs", "sigsetjmp", "optarg", + "optind", "opterr", "optopt", "daylight", "timezone", + "tzname", "getdate_err", "h_errno"]; +$extra_syms{"XOPEN2K"} = ["errno", "setjmp", "va_end", "environ", "signgam", + "sigsetjmp", "optarg", "optind", "opterr", "optopt", + "daylight", "timezone", "tzname", "getdate_err", + "h_errno", "in6addr_any", "in6addr_loopback"]; +$extra_syms{"XOPEN2K8"} = ["errno", "setjmp", "va_end", "environ", "signgam", + "sigsetjmp", "optarg", "optind", "opterr", "optopt", + "daylight", "timezone", "tzname", "getdate_err", + "in6addr_any", "in6addr_loopback"]; +$extra_syms{"POSIX2008"} = ["errno", "setjmp", "va_end", "environ", + "sigsetjmp", "optarg", "optind", "opterr", "optopt", + "tzname", "in6addr_any", "in6addr_loopback"]; + +%user_syms = (); + +foreach my $header (@headers) { + @syms = list_exported_functions ("$CC $flags", $standard, $header, $tmpdir); + foreach my $sym (@syms) { + if ($sym !~ /^_/) { + $user_syms{$sym} = 1; + } + } +} +foreach my $sym (@{$extra_syms{$standard}}) { + $user_syms{$sym} = 1; +} + +foreach my $sym (sort keys %user_syms) { + print "$sym\n"; +} |