* tests/test-accept4.c (main): Pass only SOCK_* flags to accept4(),
as they are the only documented ones, and passing others may trigger
EINVAL (seen on FreeBSD 10.1-RELEASE).
* doc/glibc-functions/accept4.texi: Mention that we don't provide
the SOCK_CLOEXEC or SOCK_NONBLOCK defines.
+2015-10-12 Pino Toscano <ptoscano@redhat.com>
+
+ accept4-tests: fix to avoid non portable flags
+ * tests/test-accept4.c (main): Pass only SOCK_* flags to accept4(),
+ as they are the only documented ones, and passing others may trigger
+ EINVAL (seen on FreeBSD 10.1-RELEASE).
+ * doc/glibc-functions/accept4.texi: Mention that we don't provide
+ the SOCK_CLOEXEC or SOCK_NONBLOCK defines.
+
2015-10-06 Pavel Raiskup <praiskup@redhat.com>
gnulib-tool: fix tests of 'extensions' module
Portability problems not fixed by Gnulib:
@itemize
+@item
+SOCK_CLOEXEC and SOCK_NONBLOCK may not be defined
+as they're also significant to the socket() function.
@end itemize
#include "macros.h"
+#ifndef SOCK_CLOEXEC
+# define SOCK_CLOEXEC 0
+#endif
+
int
main (void)
{
errno = 0;
ASSERT (accept4 (-1, (struct sockaddr *) &addr, &addrlen,
- O_CLOEXEC | O_BINARY)
+ SOCK_CLOEXEC)
== -1);
ASSERT (errno == EBADF);
}
close (99);
errno = 0;
ASSERT (accept4 (99, (struct sockaddr *) &addr, &addrlen,
- O_CLOEXEC | O_BINARY)
+ SOCK_CLOEXEC)
== -1);
ASSERT (errno == EBADF);
}