diff options
Diffstat (limited to 'src/libstddjb/fd_select.c')
-rw-r--r-- | src/libstddjb/fd_select.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstddjb/fd_select.c b/src/libstddjb/fd_select.c new file mode 100644 index 0000000..846485d --- /dev/null +++ b/src/libstddjb/fd_select.c @@ -0,0 +1,14 @@ +/* ISC license. */ + +#include <sys/types.h> +#include <errno.h> +#include <sys/select.h> + +int fd_select (int n, fd_set *rfds, fd_set *wfds, fd_set *xfds, struct timeval *tv) +{ + register int r ; + do + r = select(n, rfds, wfds, xfds, tv) ; + while ((r == -1) && (errno == EINTR)) ; + return r ; +} |