diff options
Diffstat (limited to 'src/sysdeps')
-rw-r--r-- | src/sysdeps/trymsgdontwait.c | 17 | ||||
-rw-r--r-- | src/sysdeps/trynbwaitall.c (renamed from src/sysdeps/tryokwaitall.c) | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/sysdeps/trymsgdontwait.c b/src/sysdeps/trymsgdontwait.c new file mode 100644 index 0000000..0c8ad15 --- /dev/null +++ b/src/sysdeps/trymsgdontwait.c @@ -0,0 +1,17 @@ +/* ISC license. */ + +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE + +#ifndef _XPG4_2 +# define _XPG4_2 +#endif + +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif + +#include <sys/types.h> +#include <sys/socket.h> + +int value = MSG_DONTWAIT ; diff --git a/src/sysdeps/tryokwaitall.c b/src/sysdeps/trynbwaitall.c index 15721b5..0f55080 100644 --- a/src/sysdeps/tryokwaitall.c +++ b/src/sysdeps/trynbwaitall.c @@ -53,8 +53,8 @@ static int child (int p, int fd) if (write(p, "", 1) < 1) return 111 ; /* sync with the parent */ if (select(fd+1, &rfds, 0, 0, 0) < 1) return 111 ; - /* On buggy systems, the following recvmsg will block, despite - setting the fd non-blocking */ + /* The following recvmsg may block, despite setting the fd + non-blocking. That is what we're testing. */ if (recvmsg(fd, &msg, MSG_WAITALL) < 1) return 111 ; if (write(p, "", 1) < 1) return 111 ; |