Blame src/api/sys_socket.c

nsz f81126
#include <sys/socket.h>
nsz f81126
#define T(t) (t*)0;
nsz f81126
#define F(t,n) {t *y = &x.;;}
nsz f81126
#define C(n) switch(n){case n:;}
nsz f81126
static void f()
nsz f81126
{
nsz f81126
T(size_t)
nsz f81126
T(ssize_t)
nsz f81126
T(socklen_t)
nsz f81126
T(sa_family_t)
nsz f81126
{
nsz f81126
struct sockaddr x;
nsz f81126
F(sa_family_t,sa_family)
nsz f81126
F(char, sa_data[0])
nsz f81126
}
nsz f81126
{
nsz f81126
struct sockaddr_storage x;
nsz f81126
F(sa_family_t, ss_family)
nsz f81126
}
nsz f81126
{
nsz f81126
struct msghdr x;
nsz f81126
F(void*,msg_name)
nsz f81126
F(socklen_t,msg_namelen)
nsz f81126
F(struct iovec*,msg_iov)
nsz f81126
F(int,msg_iovlen)
nsz f81126
F(void*,msg_control)
nsz f81126
F(socklen_t,msg_controllen)
nsz f81126
F(int,msg_flags)
nsz f81126
}
nsz f81126
{
nsz f81126
struct cmsghdr x;
nsz f81126
F(socklen_t,cmsg_len)
nsz f81126
F(int,cmsg_level)
nsz f81126
F(int,cmsg_type)
nsz f81126
}
nsz f81126
C(SCM_RIGHTS)
nsz f81126
#ifndef CMSG_DATA
nsz f81126
#error no CMSG_DATA
nsz f81126
#endif
nsz f81126
#ifndef CMSG_NXTHDR
nsz f81126
#error no CMSG_NXTHDR
nsz f81126
#endif
nsz f81126
#ifndef CMSG_FIRSTHDR
nsz f81126
#error CMSG_FIRSTTHDR
nsz f81126
#endif
nsz f81126
{
nsz f81126
struct linger x;
nsz f81126
F(int,l_onoff)
nsz f81126
F(int,l_linger)
nsz f81126
}
nsz f81126
C(SOCK_DGRAM)
nsz f81126
C(SOCK_RAW)
nsz f81126
C(SOCK_SEQPACKET)
nsz f81126
C(SOCK_STREAM)
nsz f81126
C(SOL_SOCKET)
nsz f81126
C(SO_ACCEPTCONN)
nsz f81126
C(SO_BROADCAST)
nsz f81126
C(SO_DEBUG)
nsz f81126
C(SO_DONTROUTE)
nsz f81126
C(SO_ERROR)
nsz f81126
C(SO_KEEPALIVE)
nsz f81126
C(SO_LINGER)
nsz f81126
C(SO_OOBINLINE)
nsz f81126
C(SO_RCVBUF)
nsz f81126
C(SO_RCVLOWAT)
nsz f81126
C(SO_RCVTIMEO)
nsz f81126
C(SO_REUSEADDR)
nsz f81126
C(SO_SNDBUF)
nsz f81126
C(SO_SNDLOWAT)
nsz f81126
C(SO_SNDTIMEO)
nsz f81126
C(SO_TYPE)
nsz f81126
C(SOMAXCONN)
nsz f81126
C(MSG_CTRUNC)
nsz f81126
C(MSG_DONTROUTE)
nsz f81126
C(MSG_EOR)
nsz f81126
C(MSG_OOB)
nsz f81126
C(MSG_NOSIGNAL)
nsz f81126
C(MSG_PEEK)
nsz f81126
C(MSG_TRUNC)
nsz f81126
C(MSG_WAITALL)
nsz f81126
C(AF_INET)
nsz f81126
C(AF_INET6)
nsz f81126
C(AF_UNIX)
nsz f81126
C(AF_UNSPEC)
nsz f81126
C(SHUT_RD)
nsz f81126
C(SHUT_RDWR)
nsz f81126
C(SHUT_WR)
nsz f81126
int(*p_accept)(int,struct sockaddr*restrict,socklen_t*restrict) = accept;
nsz f81126
int(*p_bind)(int,const struct sockaddr*,socklen_t) = bind;
nsz f81126
int(*p_connect)(int,const struct sockaddr*,socklen_t) = connect;
nsz f81126
int(*p_getpeername)(int,struct sockaddr*restrict,socklen_t*restrict) = getpeername;
nsz f81126
int(*p_getsockname)(int,struct sockaddr*restrict,socklen_t*restrict) = getsockname;
nsz f81126
int(*p_getsockopt)(int,int,int,void*restrict,socklen_t*restrict) = getsockopt;
nsz f81126
int(*p_listen)(int,int) = listen;
nsz f81126
ssize_t(*p_recv)(int,void*,size_t,int) = recv;
nsz f81126
ssize_t(*p_recvfrom)(int,void*restrict,size_t,int,struct sockaddr*restrict,socklen_t*restrict) = recvfrom;
nsz f81126
ssize_t(*p_recvmsg)(int,struct msghdr*,int) = recvmsg;
nsz f81126
ssize_t(*p_send)(int,const void*,size_t,int) = send;
nsz f81126
ssize_t(*p_sendmsg)(int,const struct msghdr*,int) = sendmsg;
nsz f81126
ssize_t(*p_sendto)(int,const void*,size_t,int,const struct sockaddr*,socklen_t) = sendto;
nsz f81126
int(*p_setsockopt)(int,int,int,const void*,socklen_t) = setsockopt;
nsz f81126
int(*p_shutdown)(int,int) = shutdown;
nsz f81126
int(*p_sockatmark)(int) = sockatmark;
nsz f81126
int(*p_socket)(int,int,int) = socket;
nsz f81126
int(*p_socketpair)(int,int,int,int[]) = socketpair;
nsz f81126
}