diff options
| author | Roy Marples <roy@marples.name> | 2016-03-11 13:44:42 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-03-11 13:44:42 +0000 |
| commit | 9843976ae092495eb37e397a6f36432411010d00 (patch) | |
| tree | 00d8f2d78a39057a42d2d9666c2f3e9d82639b5c /if.h | |
| parent | b48c14b7363ef246351f18458eb9a1657871f69a (diff) | |
| download | dhcpcd-9843976ae092495eb37e397a6f36432411010d00.tar.xz | |
Fix compile on older platforms which lack O_CLOEXEC.
Thanks to OBATA Akio.
Diffstat (limited to 'if.h')
| -rw-r--r-- | if.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -114,6 +114,19 @@ int if_managelink(struct dhcpcd_ctx *); #define RTM_GET 0x4 /* Report Metrics */ #endif +/* Define SOCK_CLOEXEC and SOCK_NONBLOCK for systems that lack it. + * xsocket() in if.c will map them to fctnl FD_CLOEXEC and O_NONBLOCK. */ +#ifdef SOCK_CLOEXEC +# define HAVE_SOCK_CLOEXEC +#else +# define SOCK_CLOEXEC 0x10000000 +#endif +#ifdef SOCK_NONBLOCK +# define HAVE_SOCK_NONBLOCK +#else +# define SOCK_NONBLOCK 0x20000000 +#endif + #ifdef INET extern const char *if_pfname; int if_openrawsocket(struct interface *, uint16_t); |
