aboutsummaryrefslogtreecommitdiff
path: root/lib/net.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-04-26 02:41:05 -0500
committerRob Landley <rob@landley.net>2013-04-26 02:41:05 -0500
commitf01534401412812bc1d904812dfb4b0a31ee8fff (patch)
treedb23ecd59e456f54cfd071eeca8806328e29b8d9 /lib/net.c
parenta4a6dfb584a3de8c947d2ccf159b53bf56daebb7 (diff)
downloadtoybox-f01534401412812bc1d904812dfb4b0a31ee8fff.tar.gz
Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
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;
+}