maximilian attems
2010-Feb-23 14:02 UTC
[PATCH 3/3] [klibc] Add relevant socket.h definitions
linux-2.6 9c501935a3cdcf6b1d35aaee3aa11c7a7051a305 cleaned <linux/socket.h> from allmost any userspace export. thus define the stuff that used to be there in klibc socket.h Signed-off-by: maximilian attems <max at stro.at> --- usr/include/sys/socket.h | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/usr/include/sys/socket.h b/usr/include/sys/socket.h index 7d47087..a6357d1 100644 --- a/usr/include/sys/socket.h +++ b/usr/include/sys/socket.h @@ -9,6 +9,9 @@ #include <klibc/compiler.h> #include <klibc/sysconfig.h> #include <linux/socket.h> +#include <linux/sockios.h> /* the SIOCxxx I/O controls */ +#include <linux/uio.h> /* iovec support */ +#include <asm/socket.h> /* arch-dependent defines */ #if _KLIBC_HAS_ARCHSOCKET_H #include <klibc/archsocket.h> #endif @@ -27,6 +30,40 @@ # define SOCK_PACKET 10 #endif + +typedef unsigned short sa_family_t; + +struct sockaddr { + sa_family_t sa_family; /* address family, AF_xxx */ + char sa_data[14]; /* 14 bytes of protocol address */ +}; + + +/* + * As we do 4.4BSD message passing we use a 4.4BSD message passing + * system, not 4.3. Thus msg_accrights(len) are now missing. They + * belong in an obscure libc emulation or the bin. + */ + +struct msghdr { + void * msg_name; /* Socket name */ + int msg_namelen; /* Length of name */ + struct iovec * msg_iov; /* Data blocks */ + size_t msg_iovlen; /* Number of blocks */ + void * msg_control; /* Per protocol magic (eg BSD file descriptor passing) */ + size_t msg_controllen; /* Length of cmsg list */ + unsigned msg_flags; +}; + + +/* address families */ +#define AF_INET 2 /* Internet IP Protocol */ +#define AF_INET6 10 /* IP version 6 */ +#define AF_PACKET 17 /* Packet family */ + +/* Flags we can use with send/ and recv. */ +#define MSG_PEEK 2 + typedef int socklen_t; __extern int socket(int, int, int); -- 1.6.6.1 --r5Pyd7+fXNt84Ff3--