some coverity fixes.
[minix.git] / lib / libc / sys-minix / listen.c
blobe700b77edbf8f9d34c29cff46b87d102c52d1213
1 #include <sys/cdefs.h>
2 #include "namespace.h"
4 #include <errno.h>
5 #include <stdio.h>
6 #include <string.h>
7 #include <sys/ioctl.h>
8 #include <sys/socket.h>
9 #include <netinet/in.h>
11 #include <net/gen/in.h>
12 #include <net/gen/tcp.h>
13 #include <net/gen/tcp_io.h>
14 #include <net/gen/udp.h>
15 #include <net/gen/udp_io.h>
17 #define DEBUG 0
19 int listen(int sock, int backlog)
21 int r;
23 r= ioctl(sock, NWIOTCPLISTENQ, &backlog);
24 if (r != -1 || errno != EBADIOCTL)
25 return r;
27 r= ioctl(sock, NWIOSUDSBLOG, &backlog);
28 if (r != -1 || errno != EBADIOCTL)
29 return r;
31 #if DEBUG
32 fprintf(stderr, "listen: not implemented for fd %d\n", sock);
33 #endif
34 errno= ENOSYS;
35 return -1;