view lib/net.c @ 883:aca8323e2690

Add posix headers to toynet.h, move xioctl() to lib.c, introduce lib/net.c and move xsocket() to it.
author Rob Landley <rob@landley.net>
date Fri, 26 Apr 2013 02:41:05 -0500
parents
children e11684e3bbc5
line wrap: on
line source
#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;
}