Skip to content
Snippets Groups Projects
Commit 7f6666b3 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Revert "build: removed unused enum that evaluates to empty on NetBSD."

This reverts commit 5ca5bed0.

The enum as such is not used, but its values are...

Fixes compilation errors on Solaris and other platforms without accept4(2).
parent f35daec9
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,31 @@ ...@@ -11,6 +11,31 @@
#ifdef HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
/* NB: The default values are compatible with Linux,
* but should work on other OSs as well, since
* accept4(2) is emulated by us anyway.
*/
enum pike_sock_flags {
#ifndef SOCK_CLOEXEC
#if !defined(SOCK_NONBLOCK) || (SOCK_NONBLOCK != 0x80000)
SOCK_CLOEXEC = 0x80000,
#else
/* Unlikely, but... */
SOCK_CLOEXEC = 0x40000,
#endif /* !SOCK_NONBLOCK || SOCK_NONBLOCK != 0x80000 */
#define SOCK_CLOEXEC SOCK_CLOEXEC
#endif
#ifndef SOCK_NONBLOCK
#if (SOCK_CLOEXEC != 0x00800)
SOCK_NONBLOCK = 0x00800,
#else
/* Unlikely, but... */
SOCK_NONBLOCK = 0x00400,
#endif
#define SOCK_NONBLOCK SOCK_NONBLOCK
#endif
};
#endif /* !HAVE_ACCEPT4 */ #endif /* !HAVE_ACCEPT4 */
/* Prototypes begin here */ /* Prototypes begin here */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment