From d3dbdae395fc0c51abbaed33f8aa18c0170435f0 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Tue, 9 Oct 2018 13:58:48 +0200 Subject: [PATCH] libc: add SO_LINGER and TCP_NODELY to socket fs plugin issue #3060 --- repos/libports/src/lib/libc/socket_fs_plugin.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/repos/libports/src/lib/libc/socket_fs_plugin.cc b/repos/libports/src/lib/libc/socket_fs_plugin.cc index 11f92d8ff..ce3eb6c74 100644 --- a/repos/libports/src/lib/libc/socket_fs_plugin.cc +++ b/repos/libports/src/lib/libc/socket_fs_plugin.cc @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -765,8 +766,20 @@ extern "C" int socket_fs_setsockopt(int libc_fd, int level, int optname, case SO_REUSEADDR: /* not yet implemented - always return true */ return 0; + case SO_LINGER: + { + linger *l = (linger *)optval; + if (l->l_onoff == 0) + return 0; + } default: return Errno(ENOPROTOOPT); } + case IPPROTO_TCP: + switch (optname) { + case TCP_NODELAY: + return 0; + default: return Errno(ENOPROTOOPT); + } default: return Errno(EINVAL); }