patch-1.3.16 linux/include/linux/socket.h

Next file: linux/include/linux/uio.h
Previous file: linux/include/linux/scc.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.15/linux/include/linux/socket.h linux/include/linux/socket.h
@@ -3,7 +3,7 @@
 
 #include <asm/socket.h>			/* arch-dependent defines	*/
 #include <linux/sockios.h>		/* the SIOCxxx I/O controls	*/
-
+#include <linux/uio.h>			/* iovec support		*/
 
 struct sockaddr {
   unsigned short	sa_family;	/* address family, AF_xxx	*/
@@ -15,6 +15,16 @@
   int			l_linger;	/* How long to linger for	*/
 };
 
+struct msghdr 
+{
+	void	*	msg_name;	/* Socket name			*/
+	int		msg_namelen;	/* Length of name		*/
+	struct iovec *	msg_iov;	/* Data blocks			*/
+	int 		msg_iovlen;	/* Number of blocks		*/
+	void 	*	msg_accrights;	/* Per protocol magic (eg BSD file descriptor passing) */
+	int		msg_accrightslen;	/* Length of rights list */
+};
+
 /* Socket types. */
 #define SOCK_STREAM	1		/* stream (connection) socket	*/
 #define SOCK_DGRAM	2		/* datagram (conn.less) socket	*/
@@ -103,4 +113,11 @@
 #define SOPRI_NORMAL		1
 #define SOPRI_BACKGROUND	2
 
+#ifdef __KERNEL__
+extern void memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
+extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode);
+extern void memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
+extern int move_addr_to_user(void *kaddr, int klen, void *uaddr, int *ulen);
+extern int move_addr_to_kernel(void *uaddr, int ulen, void *kaddr);
+#endif
 #endif /* _LINUX_SOCKET_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this