aboutsummaryrefslogtreecommitdiff
path: root/lib/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net.c')
-rw-r--r--lib/net.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/net.c b/lib/net.c
new file mode 100644
index 00000000..f4b26439
--- /dev/null
+++ b/lib/net.c
@@ -0,0 +1,10 @@
+#include "toys.h"
+#include "toynet.h"
+
+int xsocket(int domain, int type, int protocol)
+{
+ int fd = socket(domain, type, protocol);
+
+ if (fd < 0) perror_exit("socket %x %x", type, protocol);
+ return fd;
+}