From cc31550d01415181e70150ad3e9043d049b07a09 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 20 Nov 2020 15:22:48 +0000 Subject: Add fd_shutdown() --- src/libstddjb/fd_shutdown.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/libstddjb/fd_shutdown.c (limited to 'src/libstddjb/fd_shutdown.c') diff --git a/src/libstddjb/fd_shutdown.c b/src/libstddjb/fd_shutdown.c new file mode 100644 index 0000000..52e00c7 --- /dev/null +++ b/src/libstddjb/fd_shutdown.c @@ -0,0 +1,14 @@ +/* ISC license. */ + +#include +#include +#include + +#include + +void fd_shutdown (int fd, int h) +{ + int e = errno ; + shutdown(fd, h ? SHUT_WR : SHUT_RD) ; + errno = e ; +} -- cgit v1.2.3