From f01534401412812bc1d904812dfb4b0a31ee8fff Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 26 Apr 2013 02:41:05 -0500 Subject: Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it. --- lib/net.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/net.c (limited to 'lib/net.c') 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; +} -- cgit v1.2.3