summaryrefslogtreecommitdiff
path: root/src/network/getsockopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/getsockopt.c')
-rw-r--r--src/network/getsockopt.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/network/getsockopt.c b/src/network/getsockopt.c
new file mode 100644
index 00000000..8c818863
--- /dev/null
+++ b/src/network/getsockopt.c
@@ -0,0 +1,13 @@
+#include <sys/socket.h>
+#include "syscall.h"
+#include "socketcall.h"
+
+int getsockopt(int fd, int level, int optname, void *optval, socklen_t *optlen)
+{
+ unsigned long args[] = {
+ fd, level, optname,
+ (unsigned long)optval,
+ (unsigned long)optlen
+ };
+ return syscall2(__NR_socketcall, SYS_GETSOCKOPT, (long)args);
+}