summaryrefslogtreecommitdiff
path: root/socket_udp.c
blob: bda4494a8c3f3e86c91bd9e9f01d35fd05eaaed5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include "ndelay.h"
#include "socket.h"

int socket_udp(void)
{
  int s;

  s = socket(AF_INET,SOCK_DGRAM,0);
  if (s == -1) return -1;
  if (ndelay_on(s) == -1) { close(s); return -1; }
  return s;
}