After some discussion in libc-alpha about this POSIX compliance fix, I see
that GLIBC should indeed revert back to previous definition of msghdr and
cmsghdr and implementation of sendmsg, recvmsg, sendmmsg, recvmmsg due some
reasons:
* The possible issue where the syscalls wrapper add the compatibility
layer is quite limited in scope and range. And kernel current
also add some limits to the values on the internal msghdr and
cmsghdr fields:
- msghdr::msg_iovlen larger than UIO_MAXIOV (1024) returns
EMSGSIZE.
- msghdr::msg_controllen larger than INT_MAX returns ENOBUFS.
* There is a small performance hit for recvmsg/sendmsg/recmmsg which
is neglectable, but it is a big hit for sendmmsg since now instead
of calling the syscall for the packed structure, GLIBC is calling
multiple sendmsg. This defeat the very existence of the syscall.
* It currently breaks libsanitizer build on GCC [1] (I fixed on compiler-rt).
However the fix is incomplete because it does add any runtime check
since libsanitizer currently does not have any facility to intercept
symbols with multiple version [2].
This, along with incorret dlsym/dlvsym return for versioned symbol due
another bug [3], makes hard to interpose versioned symbols.
Also, current approach of fixing GCC PR#71445 leads to half-baked
solutions without versioned symbol interposing.
This patch basically reverts commits 2f0dc39029, 222c2d7f43,
af7f7c7ec8. I decided to not revert abf29edd4a (Adjust
kernel-features.h defaults for recvmsg and sendmsg) mainly because it
does not really address the POSIX compliance original issue and also
adds some cleanups.
Tested on x86, i386, s390, s390x, aarch64, and powerpc64le.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71445
[2] https://github.com/google/sanitizers/issues/628
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=14932
* conform/data/sys/socket.h-data (msghdr.msg_iovlen): Add xfail-.
(msghdr.msg_controllen): Likewise.
(cmsghdr.cmsg_len): Likewise.
* nptl/Makefile (libpthread-routines): Remove ptw-oldrecvmsg and
ptw-oldsendmsg.
(CFLAGS-oldrecvmsg.c): Remove rule.
(CFLAGS-oldsendmsg.c): Likewise.
(CFLAGS-recvmsg.c): Add rule.
(CFLAGS-sendmsg.c): Likewise.
* sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
oldrecvmsg, oldsendmsg, oldrecvmmsg, oldsendmmsg.
(CFLAGS-recvmsg.c): Remove rule.
(CFLAGS-sendmsg.c): Likewise.
(CFLAGS-oldrecvmsg.c): Likewise.
(CFLAGS-oldsendmsg.c): Likewise.
(CFLAGS-recvmmsg.c): Likewise.
* sysdeps/unix/sysv/linux/bits/socket.h (msghdr.msg_iovlen): Revert
to kernel defined interfaces.
(msghdr.msg_controllen): Likewise.
(cmsghdr.cmsg_len): Likewise.
(msghdr.__glibc_reserved1): Remove member.
(msghdr.__glibc_reserved2): Likewise.
(cmsghdr.__glibc_reserved1): Likewise.
* sysdeps/unix/sysv/linux/oldrecvmmsg.c: Remove file.
* sysdeps/unix/sysv/linux/oldrecvmsg.c: Likewise.
* sysdeps/unix/sysv/linux/oldsendmmsg.c: Likewise.
* sysdeps/unix/sysv/linux/oldsendmsg.c: Likewise.
* sysdeps/unix/sysv/linux/recvmmsg.c: Revert back to previous
version.
* sysdeps/unix/sysv/linux/recvmsg.c: Likewise.
* sysdeps/unix/sysv/linux/sendmmsg.c: Likewise.
* sysdeps/unix/sysv/linux/sendmsg.c: Likewise.
* sysdeps/unix/sysv/linux/aarch64/Versions [libc] (GLIBC_2.24):
Remove recvmsg and sendmsg.
* sysdeps/unix/sysv/linux/alpha/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/hppa/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/i386/Versions [libc] (GLIBC_2.24): Likewise.
* sysdeps/unix/sysv/linux/m68k/Versions [libc] (GLIBC_2.24): Likewise.
* sysdeps/unix/sysv/linux/microblaze/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/Versions
[libc] (GLIBC_2.24): Likewise.
* sysdeps/unix/sysv/linux/nios2/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions
[libc] (GLIBC_2.24): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/sh/Versions [libc] (GLIBC_2.24): Likewise.
* sysdeps/unix/sysv/linux/sparc/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/tile/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/Versions [libc] (GLIBC_2.24):
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/Versions: Remove file
* sysdeps/unix/sysv/linux/x86_64/64/Versions: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/Versions: Likewise.
* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Remove new 2.24
version for {recv,send,recm,sendm}msg.
* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
The conform/ test of limits.h namespace for XPG3 was failing because
of NL_* and NZERO defines. Those symbols are EX-shaded, not
UX-shaded, so it's correct for them to be defined for XPG3; this patch
corrects the expectations accordingly. (Actually it looks like they
should not be listed as optional for these standards, but that's
another matter.)
Tested for x86_64 and x86.
* conform/data/limits.h-data (CHARCLASS_NAME_MAX): Also expect for
[XPG3 || XPG4].
(NL_ARGMAX): Also expect for [XPG3].
(NL_LANGMAX): Likewise.
(NL_MSGMAX): Likewise.
(NL_NMAX): Likewise.
(NL_SETMAX): Likewise.
(NL_TEXTMAX): Likewise.
(NZERO): Likewise.
(TMP_MAX): Likewise.
* conform/Makefile (test-xfail-XPG3/limits.h/conform): Remove
variable.
This patch corrects various conformtest expectations in ftw.h for XPG3
and XPG4.
Tested for x86_64 and x86.
* conform/data/ftw.h-data (struct FTW): Do not expect for [XPG3].
(FTW_DP): Do not expect for [XPG3 || XPG4].
(FTW_SL): Do not expect for [XPG3].
(FTW_SLN): Likewise.
(FTW_PHYS): Likewise.
(FTW_MOUNT): Likewise.
(FTW_DEPTH): Likewise.
(FTW_CHDIR): Likewise.
(nftw): Likewise.
* conform/Makefile (test-xfail-XPG3/ftw.h/conform): Remove
variable.
This patch corrects some conformtest expectations for pwd.h for XPG4.
Tested for x86_64 and x86.
* conform/data/pwd.h-data (endpwent): Do not expect for [XPG3].
(getpwent): Likewise.
(setpwent): Likewise.
* conform/Makefile (test-xfail-XPG3/pwd.h/conform): Remove
variable.
This patch corrects some conformtest expectations for search.h for
XPG3.
Tested for x86_64 and x86.
* conform/data/search.h-data (insque): Do not expect for [XPG3].
(remque): Likewise.
* conform/Makefile (test-xfail-XPG3/search.h/conform): Remove
variable.
This patch corrects some spurious conformtest stdlib.h expectations
for XPG3 (not based on a full review of the expectations for that
standard, so other issues may remain).
Tested for x86_64 and x86.
* conform/data/stdlib.h-data (a64l): Do not expect for [XPG3].
(ecvt): Likewise.
(fcvt): Likewise.
(gcvt): Likewise.
(getsubopt): Likewise.
(grantpt): Likewise.
(initstate): Likewise.
(l64a): Likewise.
(mktemp): Likewise.
(mkstemp): Likewise.
(ptsname): Likewise.
(random): Likewise.
(realpath): Likewise.
(setstate): Likewise.
(srandom): Likewise.
(ttyslot): Likewise.
(unlockpt): Likewise.
(valloc): Likewise.
This patch corrects a spurious conformtest expectation of strdup in
string.h for XPG3.
Tested for x86_64 and x86.
* conform/data/string.h-data (strdup): Do not expect for [XPG3].
* conform/Makefile (test-xfail-XPG3/string.h/conform): Remove
variable.
This patch corrects spurious conformtest expectations of getdate and
getdate_err for XPG3. (This is not based on a full review of the
expectations, so there may be other issues where the header and tests
agree but are both incorrect.)
Tested for x86_64 and x86.
* conform/data/time.h-data (getdate_err): Do not expect for
[XPG3].
(getdate): Likewise.
* conform/Makefile (test-xfail-XPG3/time.h/conform): Remove
variable.
The conformtest tests of unistd.h fail for XPG3 because of various
expectations that are incorrect for XPG3. This patch corrects those
bogus expectations, and one bogus expectation for XPG4. (This is not
based on a full review of the standards so there may well still be
other bugs in the expectations for this header.)
Tested for x86_64 and x86.
* conform/data/unistd.h-data (F_LOCK): Do not expect for [XPG3].
(F_ULOCK): Likewise.
(F_TEST): Likewise.
(F_TLOCK): Likewise.
(useconds_t): Likewise.
(intptr_t): Do not expect for [XPG3] or [XPG4].
(brk): Do not expect for [XPG3]
(fchown): Likewise.
(fchdir): Likewise.
(ftruncate): Likewise.
(getdtablesize): Likewise.
(gethostid): Likewise.
(getpagesize): Likewise.
(getpgid): Likewise.
(getsid): Likewise.
(getwd): Likewise.
(lchown): Likewise.
(lockf): Likewise.
(readlink): Likewise.
(sbrk): Likewise.
(setpgrp): Likewise.
(setregid): Likewise.
(setreuid): Likewise.
(symlink): Likewise.
(sync): Likewise.
(truncate): Likewise.
(ualarm): Likewise.
(usleep): Likewise.
(vfork): Likewise.
* conform/Makefile (test-xfail-XPG3/unistd.h/conform): Remove
variable.
unistd.h declares gethostname for __USE_UNIX98 || __USE_XOPEN2K. But
it's also in XPG4 (XNS volume - C438 - not the main definitions of
system interfaces and headers in C435). This patch corrects the
condition.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20054]
* posix/unistd.h (gethostname): Declare if [__USE_XOPEN_EXTENDED],
not [__USE_UNIX98].
* conform/data/unistd.h-data (gethostname): Do not expect for
[XPG3].
The conform/ tests for fcntl.h are failing for XPG3 and XPG4 because
of missing S_IFSOCK.
This is a case of a bogus test. The relevant wording requiring such
constants is, in current POSIX (and this requirement dates back as far
as XPG4), "The <fcntl.h> header shall define the symbolic constants
for file modes for use as values of mode_t as described in
<sys/stat.h>.". Note that this is *file modes* not *file types*.
That makes sense, since the point is presumably for use with functions
such as open that are declared in fcntl.h, where file modes are
relevant but file types aren't. So this patch removes all those
spurious S_IF* expectations for fcntl.h (the macros are generally
still *allowed* through the permission to make everything from
sys/stat.h visible).
Tested for x86_64 and x86.
* conform/data/fcntl.h-data [!POSIX] (S_IFMT): Do not expect.
[!POSIX] (S_IFBLK): Likewise.
[!POSIX] (S_IFCHR): Likewise.
[!POSIX] (S_IFIFO): Likewise.
[!POSIX] (S_IFREG): Likewise.
[!POSIX] (S_IFDIR): Likewise.
[!POSIX] (S_IFLNK): Likewise.
[!POSIX] (S_IFSOCK): Likewise.
* conform/Makefile (test-xfail-XPG3/fcntl.h/conform): Remove
variable.
(test-xfail-XPG4/fcntl.h/conform): Likewise.
termios.h should declare tcgetsid for XPG4, but only does so for
__USE_UNIX98 || __USE_XOPEN2K8 at present. This patch fixes the
declaration conditions. A spurious conformtest expectation of this
declaration for XPG3 is removed, and two XFAILs that are fixed by
these changes are also removed.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20055]
* termios/termios.h (pid_t): Define for [__USE_XOPEN_EXTENDED]
instead of [__USE_UNIX98].
(tcgetsid): Declare for [__USE_XOPEN_EXTENDED] instead of
[__USE_UNIX98].
* conform/data/termios.h-data (tcgetsid): Do not expect for
[XPG3].
* conform/Makefile (test-xfail-XPG3/termios.h/conform): Remove
variable.
(test-xfail-XPG4/termios.h/conform): Likewise.
This patch fixes various conformtest sys/stat.h expectations that were
incorrect for XPG3 (not based on a full review, so not necessarily an
exhaustive set of such corrections). Most of these corrections fix
spurious failures shown in testing (but that for fchmod introduces a
correct failure, as that function is wrongly declared for XPG3, so
this doesn't eliminate any XFAILs).
Tested for x86_64 and x86.
* conform/data/sys/stat.h-data [XPG3] (S_IFLNK): Do not expect.
[XPG3] (S_IFSOCK): Likewise.
[XPG3] (S_ISVTX): Likewise.
[XPG3] (S_ISLNK): Likewise.
[XPG3] (S_ISSOCK): Likewise.
[XPG3] (fchmod): Likewise.
[XPG3] (lstat): Likewise.
[XPG3] (mknod): Likewise.
The conformtest expectations expect the struct stat fields st_blksize
and st_blocks to be of types blksize_t and blkcnt_t. But XPG4 does
not have those types, using long instead, and XPG3 does not have these
fields at all. This patch adjusts the expectations for those
standards, XFAILing them for XPG4 to allow for systems where the
typedefs don't correspond to long.
Tested for x86_64 and x86.
* conform/data/sys/stat.h-data (st_blksize): Do not expect for
[XPG3]. Expect type long and XFAIL for [XPG4].
(st_blocks): Likewise.
The conformtest tests for sys/types.h for XPG3 and XPG4 fail because
of missing blksize_t. This is a bug in the expectations; that type is
not part of those standards. This patch stops the tests from
expecting it, and some other types that also are not part of XPG3 and
XPG4.
Tested for x86_64 and x86.
* conform/data/sys/types.h-data (blkcnt_t): Do not expect for
[XPG3 || XPG4].
(blksize_t): Likewise.
(clockid_t): Likewise.
* conform/Makefile (test-xfail-XPG3/sys/types.h/conform): Remove
variable.
(test-xfail-XPG4/sys/types.h/conform): Likewise.
The conformtest expectations for langinfo.h fail to include the YESSTR
and NOSTR constants that were present in UNIX98 and earlier XPG
standards. This patch adds those expectations, so fixing three
XFAILs.
Tested for x86_64 and x86.
* conform/data/langinfo.h-data [XPG3 || XPG4 || UNIX98] (YESSTR):
Expect constant.
[XPG3 || XPG4 || UNIX98] (NOSTR): Likewise.
* conform/Makefile (test-xfail-XPG3/langinfo.h/conform): Remove
variable.
(test-xfail-XPG4/langinfo.h/conform): Likewise.
(test-xfail-UNIX98/langinfo.h/conform): Likewise.
The conform/ test of stdio.h wrongly does not expect fdopen for XPG3
and XPG4. fdopen is in those standards; this patch corrects the
expectations.
Tested for x86_64 and x86.
* conform/data/stdio.h-data (fdopen): Expect also for
[XPG3 || XPG4].
The conform/ test of stdio.h for UNIX98 fails with surious namespace
errors for functions that are correctly declared for that standard.
This patch fixes the expectations to expect those functions also for
UNIX98. (This does not by itself fix the XFAIL of that test, and is
not based a full review of the header expectations so there could
still be other bugs in the expectations for this header for UNIX98.)
Tested for x86_64 and x86.
* conform/data/stdio.h-data (flockfile): Also expect for [UNIX98].
(fseeko): Likewise.
(ftello): Likewise.
(ftrylockfile): Likewise.
(funlockfile): Likewise.
(getc_unlocked): Likewise.
(getchar_unlocked): Likewise.
(putc_unlocked): Likewise.
(putchar_unlocked): Likewise.
The conformtest expectations for signal.h have various declarations
that are expected for POSIX (1996) and all later standards, except,
wrongly, for XOPEN2K. This shows up as failures of tests for two
other headers, which are allowed to make visible symbols from
signal.h, because of an incorrect namespace failure for sigval
(required in signal.h in XOPEN2K, so should be allowed for those other
headers); signal.h tests for various standards fail anyway because of
other problems in the header. This patch fixes the incorrect
expectations and removes the two XFAILs that this fixes.
Tested for x86_64 and x86.
* conform/data/signal.h-data (union sigval): Expect also if
[XOPEN2K].
(struct sigevent): Likewise.
(SIGEV_NONE): Likewise.
(SIGEV_SIGNAL): Likewise.
(SIGEV_THREAD): Likewise.
(SIGRTMIN): Likewise.
(SIGRTMAX): Likewise.
* conform/Makefile (test-xfail-XOPEN2K/aio.h/conform): Remove
variable.
(test-xfail-XOPEN2K/mqueue.h/conform): Likewise.
The conform/ test expectations for stdarg.h were wrongly missing an
expectation of va_copy for XOPEN2K (based on C99, so including that
macro). This patch fixes this.
Tested for x86_64 and x86.
* conform/data/stdarg.h-data [XOPEN2K] (va_copy): Require macro.
* conform/Makefile (test-xfail-XOPEN2K/stdarg.h/conform): Remove
variable.
conformtest expected pselect for XOPEN2K and POSIX2008 (correctly),
but not for XOPEN2K8 (wrongly). This patch fixes the data to expect
it for XOPEN2K8 as well.
(As for all such fixes based on failures seen from the tests, there is
no guarantee that the data is fully correct for a particular standard
after the fix; headers and data may well have matching bugs. So far
I've only reviewed ISO, ISO99, ISO11 and POSIX data in detail, though
I hope eventually to review the others.)
Tested for x86_64 and x86.
* conform/data/sys/select.h-data [XOPEN2K8] (pselect): Expect.
* conform/Makefile (test-xfail-XOPEN2K8/sys/select.h/conform):
Remove variable.
(test-xfail-XOPEN2K8/sys/time.h/conform): Likewise.
(test-xfail-XOPEN2K8/utmpx.h/conform).
Various conformtest tests fail because of known issues, filed in
Bugzilla, that are hard to fix (requiring new features, kernel
cooperation or involving changing types in ways that may involve care
around padding when interfacing to the kernel). Such an issue has the
effect of making the whole test for the (standard, header) pair fail,
so hiding any other issues with that header for that standard
(possibly regressions or architecture-specific issues).
This patch adds a mechanism for individual conformtest test
expectations to start with xfail-, meaning that a failure of that
particular assertion does not cause the whole test to fail at the
makefile level and so failure at the makefile level can be used to
detect other issues that are likely to be easier to fix. This is
similar to the whitelisted symbols in the linknamespace tests, or the
marking of particular libm tests as allowing spurious or missing
exceptions, for example. The bugs filed in Bugzilla should still be
fixed, and the xfail- markers removed at that point, but xfail-
renders the tests more useful until that happens.
Note that there is no way to add such a marker for the assertion that
a header uses only symbols in the namespace of symbols it's meant to
use. I don't think there's any need for a way to xfail those
namespace tests other than xfailing the whole (standard, header) pair
at the makefile level, since they are generally straightforward to fix
(add appropriate conditionals on the problem definitions).
The xfails in this patch do not necessarily cover all cases of
hard-to-fix header bugs filed in Bugzilla that currently show up in
conformtest failures; there may be more yet to add for existing open
bugs.
Tested for x86_64 and x86.
* conform/conformtest.pl ($xerrors): New variable.
(note_error): New function.
(compiletest): New argument $xfail. Use not_error.
(runtest): Likewise.
(top level): Handle xfail- lines. Update calls to compiletest and
runtest. Handle xfail- and optional- in headers listed with
allow-header.
* conform/data/fcntl.h-data (O_TTY_INIT): Use xfail-.
(O_EXEC): Likewise.
(O_SEARCH): Likewise.
* conform/data/stropts.h-data (ioctl): Likewise.
* conform/data/sys/ipc.h-data (ipc_perm.mode): Likewise.
* conform/data/sys/sem.h-data (semid_ds.sem_nsems): Likewise.
* conform/data/sys/socket.h-data (msghdr.msg_iovlen): Likewise.
(msghdr.msg_controllen): Likewise.
(cmsghdr.cmsg_len): Likewise.
* conform/data/utmpx.h-data (utmpx.ut_tv): Likewise.
* conform/Makefile (test-xfail-XPG3/sys/ipc.h/conform): Remove
variable.
(test-xfail-XPG3/sys/sem.h/conform): Likewise.
(test-xfail-XPG4/stropts.h/conform): Likewise.
(test-xfail-XPG4/sys/ipc.h/conform): Likewise.
(test-xfail-XPG4/sys/sem.h/conform): Likewise.
(test-xfail-XPG4/sys/socket.h/conform): Likewise.
(test-xfail-UNIX98/stropts.h/conform): Likewise.
(test-xfail-UNIX98/sys/ipc.h/conform): Likewise.
(test-xfail-UNIX98/sys/sem.h/conform): Likewise.
(test-xfail-UNIX98/sys/socket.h/conform): Likewise.
(test-xfail-XOPEN2K/stropts.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/ipc.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/sem.h/conform): Likewise.
(test-xfail-XOPEN2K/sys/socket.h/conform): Likewise.
(test-xfail-XOPEN2K/utmpx.h/conform): Likewise.
(test-xfail-POSIX2008/fcntl.h/conform): Likewise.
(test-xfail-POSIX2008/stropts.h/conform): Likewise.
(test-xfail-XOPEN2K8/fcntl.h/conform): Likewise.
(test-xfail-XOPEN2K8/stropts.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/ipc.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/sem.h/conform): Likewise.
(test-xfail-XOPEN2K8/sys/socket.h/conform): Likewise.
netdb.h declares interfaces such as getaddrinfo if __USE_POSIX,
i.e. POSIX.1:1990 or later. However, these interfaces were new in the
2001 edition of POSIX, although the header was in XPG4 and UNIX98, so
they should not be declared for XPG4 or UNIX98. (This produces
spurious linknamespace test failures, although there are other
failures for this header as well for the same standards so this patch
doesn't remove any XFAILs.) This patch corrects the condition, and
the conform/ test expectations which were similarly wrong.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #18529]
* resolv/netdb.h [__USE_POSIX]: Change condition to
[__USE_XOPEN2K].
* conform/data/netdb.h-data [XPG4 || UNIX98] (struct addrinfo): Do
not expect.
[XPG4 || UNIX98] (AI_PASSIVE): Likewise.
[XPG4 || UNIX98] (AI_CANONNAME): Likewise.
[XPG4 || UNIX98] (AI_NUMERICHOST): Likewise.
[XPG4 || UNIX98] (AI_V4MAPPED): Likewise.
[XPG4 || UNIX98] (AI_ALL): Likewise.
[XPG4 || UNIX98] (AI_ADDRCONFIG): Likewise.
[XPG4 || UNIX98] (AI_NUMERICSERV): Likewise.
[XPG4 || UNIX98] (NI_NOFQDN): Likewise.
[XPG4 || UNIX98] (NI_NUMERICHOST): Likewise.
[XPG4 || UNIX98] (NI_NAMEREQD): Likewise.
[XPG4 || UNIX98] (NI_NUMERICSERV): Likewise.
[XPG4 || UNIX98] (NI_DGRAM): Likewise.
[XPG4 || UNIX98] (EAI_AGAIN): Likewise.
[XPG4 || UNIX98] (EAI_BADFLAGS): Likewise.
[XPG4 || UNIX98] (EAI_FAIL): Likewise.
[XPG4 || UNIX98] (EAI_FAMILY): Likewise.
[XPG4 || UNIX98] (EAI_MEMORY): Likewise.
[XPG4 || UNIX98] (EAI_NONAME): Likewise.
[XPG4 || UNIX98] (EAI_SERVICE): Likewise.
[XPG4 || UNIX98] (EAI_SOCKTYPE): Likewise.
[XPG4 || UNIX98] (EAI_SYSTEM): Likewise.
[XPG4 || UNIX98] (EAI_SYSTEM): Likewise.
[XPG4 || UNIX98] (freeaddrinfo): Likewise.
[XPG4 || UNIX98] (gai_strerror): Likewise.
[XPG4 || UNIX98] (getaddrinfo): Likewise.
[XPG4 || UNIX98] (getnameinfo): Likewise.
grp.h declares endgrent and getgrent if __USE_XOPEN2K8 (i.e. 2008
edition of POSIX, non-XSI). However, the 2013 Technical Corrigendum
corrected the grp.h specification to XSI-shade these functions as in
previous editions (see <http://austingroupbugs.net/view.php?id=24>),
so they should not be declared for non-XSI POSIX. This patch corrects
the conditions - using __USE_MISC || __USE_XOPEN_EXTENDED to match
setgrent - and the conform/ test expectations for this header, thereby
fixing the conform tests for this header for XPG3 (where the
expectations were wrong) and the linknamespace tests for it for
POSIX2008 (where the header bug meant it was wrongly considered a
problem for endgrent to bring in a reference to setgrent).
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #18528]
* grp/grp.h (endgrent): Condition on [__USE_MISC ||
__USE_XOPEN_EXTENDED], not [__USE_XOPEN_EXTENDED ||
__USE_XOPEN2K8].
(getgrent): Likewise.
* conform/data/grp.h-data [XPG3 || POSIX2008] (getgrent): Do not
expect.
[XPG3 || POSIX2008] (endgrent): Likewise.
[XPG3] (setgrent): Likewise.
* conform/Makefile (test-xfail-XPG3/grp.h/conform): Remove
variable.
(test-xfail-POSIX2008/grp.h/linknamespace): Likewise.
On 21/05/15 05:29, Siddhesh Poyarekar wrote:
> On Wed, May 20, 2015 at 06:55:02PM +0100, Szabolcs Nagy wrote:
>> i guess it's ok for consistency if i fix struct stat64
>> too to use __USE_XOPEN2K8.
>>
>> i will run some tests and come back with a patch
>
> I also think it would be appropriate to change this code in other
> architectures (microblaze and nacl IIRC) to make all of them
> consistent. It is a mechanical enough change IMO that all arch
> maintainer acks is not necessary.
>
here is the patch with consistent __USE_XOPEN2K8
ok to commit?
2015-05-21 Szabolcs Nagy <szabolcs.nagy@arm.com>
[BZ #18234]
* conform/data/sys/stat.h-data (struct stat): Add tests for st_atim,
st_mtim and st_ctim members.
* sysdeps/nacl/bits/stat.h (struct stat, struct stat64): Make
st_atim, st_ctim, st_mtim visible under __USE_XOPEN2K8 only.
* sysdeps/unix/sysv/linux/generic/bits/stat.h (struct stat,):
(struct stat64): Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/stat.h (struct stat,):
(struct stat64): Likewise.
* sysdeps/unix/sysv/linux/microblaze/bits/stat.h (struct stat,):
(struct stat64): Likewise.
When cleaning up conformtest expectations for POSIX for locale.h in
<https://sourceware.org/ml/libc-alpha/2012-11/msg00382.html>, I missed
that locale.h had contents defined in POSIX.2:1993 as well as
POSIX.1:1995/6. Thus, LC_MESSAGES *should* in fact be required for
POSIX, because POSIX.2 says so; this patch adds that expectation
back. Tested for x86_64.
* conform/data/locale.h-data [POSIX] (LC_MESSAGES): Require.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/utsname.h and
sys/wait.h. Tested x86_64; a new XFAIL for sys/wait.h is added.
* conform/data/sys/utsname.h-data (*_t): Allow.
* conform/data/sys/wait.h-data [POSIX] (uid_t): Do not define.
[POSIX] (WEXITED): Do not expect constant.
[POSIX] (WSTOPPED): Likewise.
[POSIX] (WNOHANG): Likewise.
[POSIX] (WNOWAIT): Likewise.
[POSIX] (siginfo_t): Do not expect type or elements.
[POSIX] (pid_t): Do not expect type.
[POSIX] (signal.h): Do not allow header.
[POSIX] (sys/resource.h): Likewise.
[POSIX] (si_*): Do not allow pattern.
[POSIX] (W*): Likewise.
[POSIX] (P_*): Likewise.
[POSIX] (BUS_*): Likewise.
[POSIX] (CLD_*): Likewise.
[POSIX] (FPE_*): Likewise.
[POSIX] (ILL_*): Likewise.
[POSIX] (POLL_*): Likewise.
[POSIX] (SEGV_*): Likewise.
[POSIX] (SI_*): Likewise.
[POSIX] (TRAP_*): Likewise.
* conform/Makefile (test-xfail-POSIX/sys/wait.h/conform): New
variable.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for sys/mman.h, sys/stat.h
and sys/types.h. Tested x86_64; no new XFAILs needed.
* conform/data/sys/mman.h-data [POSIX] (size_t): Do not require
type.
[POSIX] (off_t): Likewise.
* conform/data/sys/stat.h-data (S_IRGRP): Require constant.
[POSIX] (S_ISBLK): Require macro.
[POSIX] (S_ISCHR): Likewise.
[POSIX] (S_ISDIR): Likewise.
[POSIX] (S_ISFIFO): Likewise.
[POSIX] (S_ISREG): Likewise.
[POSIX || XPG3 || XPG4 || UNIX98] (S_TYPEISTMO): Do not list
optional-macro.
* conform/data/sys/types.h-data [POSIX] (blkcnt_t): Do not require
type.
[POSIX] (time_t): Likewise.
[POSIX] (timer_t): Likewise.
Continuing the series of patches to clean up conformtest expectations
for "POSIX" (1995/6) based on review of the expectations against the
standard, this patch cleans up expectations for stdlib.h and
string.h. Tested x86_64; no new XFAILs needed.
* conform/data/stdlib.h-data [POSIX] (stddef.h): Do not allow
header inclusion.
[POSIX] (limits.h): Likewise.
[POSIX] (math.h): Likewise.
[POSIX] (sys/wait.h): Likewise.
* conform/data/string.h-data [POSIX || UNIX98] (strtok_r): Require
function.
[POSIX] (stddef.h): Do not allow header inclusion.
Continuing the corrections to which headers conformtest tests for
which standards, this patch corrects conformtest mistakes regarding
which headers to test for the remaining standards (XOPEN2K POSIX2008
XOPEN2K8). Tested x86_64.
2014-03-05 Joseph Myers <joseph@codesourcery.com>
* conform/data/netinet/tcp.h-data [POSIX2008 || XOPEN2K8]: Enable
whole file.
* conform/data/sys/timeb.h-data [POSIX2008 || XOPEN2K8]: Disable
whole file.
* conform/data/sys/uio.h-data [POSIX2008]: Likewise.
* conform/data/ucontext.h-data [POSIX2008 || XOPEN2K8]: Likewise.