aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdeps/tryselectshorttimeout.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2026-05-11 10:42:26 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2026-05-11 10:42:26 +0000
commit648b2e9209d5da04aff5f8a24aed1cd03a110f8d (patch)
tree9f7821fc8a06e4dfec705d79fd8e9a4f4f755103 /src/sysdeps/tryselectshorttimeout.c
parentc5d6bea6d9f98a593890f9694ef1575d744e5a32 (diff)
downloadskalibs-648b2e9209d5da04aff5f8a24aed1cd03a110f8d.tar.gz
Rename sysdep to selectinfinite, find correct test value for timeout
Diffstat (limited to 'src/sysdeps/tryselectshorttimeout.c')
-rw-r--r--src/sysdeps/tryselectshorttimeout.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/sysdeps/tryselectshorttimeout.c b/src/sysdeps/tryselectshorttimeout.c
deleted file mode 100644
index 9049079..0000000
--- a/src/sysdeps/tryselectshorttimeout.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* ISC license. */
-
-#undef _POSIX_C_SOURCE
-#undef _XOPEN_SOURCE
-
-#ifndef _BSD_SOURCE
-#define _BSD_SOURCE
-#endif
-#ifndef _NETBSD_SOURCE
-#define _NETBSD_SOURCE
-#endif
-#ifndef _DARWIN_C_SOURCE
-#define _DARWIN_C_SOURCE
-#endif
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/select.h>
-#include <unistd.h>
-#include <signal.h>
-
-static void alrm_handler (int sig)
-{
- (void)sig ;
- _exit(1) ;
-}
-
-int main (void)
-{
- struct sigaction action = { .sa_handler = &alrm_handler, .sa_flags = SA_NOCLDSTOP | SA_RESTART } ;
- struct timeval tv = { .tv_sec = 100000000, .tv_usec = 0 } ;
- fd_set r, w, x ;
- FD_ZERO(&r) ;
- FD_ZERO(&w) ;
- FD_ZERO(&x) ;
- sigfillset(&action.sa_mask) ;
- if (sigaction(SIGALRM, &action, 0) == -1) _exit(111) ;
- alarm(1) ;
- if (select(1, &r, &w, &x, &tv) == -1) _exit(errno == EINVAL ? 0 : 111) ;
- _exit(1) ;
-}