From b6f72e54c46f2c5404b5c0ee79f9d4751e716dbe Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 12 Feb 2013 16:18:33 +0100 Subject: [PATCH] linux: fix O_CLOEXEC/O_NONBLOCK defines --- src/unix/linux-syscalls.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/unix/linux-syscalls.h b/src/unix/linux-syscalls.h index 195a981d..ba44974a 100644 --- a/src/unix/linux-syscalls.h +++ b/src/unix/linux-syscalls.h @@ -30,8 +30,27 @@ #include #include -#define UV__O_NONBLOCK 0x800 -#define UV__O_CLOEXEC 0x80000 +#if defined(__alpha__) +# define UV__O_CLOEXEC 0x200000 +#elif defined(__hppa__) +# define UV__O_CLOEXEC 0x200000 +#elif defined(__sparc__) +# define UV__O_CLOEXEC 0x400000 +#else +# define UV__O_CLOEXEC 0x80000 +#endif + +#if defined(__alpha__) +# define UV__O_NONBLOCK 0x4 +#elif defined(__hppa__) +# define UV__O_NONBLOCK 0x10004 +#elif defined(__mips__) +# define UV__O_NONBLOCK 0x80 +#elif defined(__sparc__) +# define UV__O_NONBLOCK 0x4000 +#else +# define UV__O_NONBLOCK 0x800 +#endif #define UV__EFD_CLOEXEC UV__O_CLOEXEC #define UV__EFD_NONBLOCK UV__O_NONBLOCK