aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/socket.h')
-rw-r--r--include/linux/socket.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 3b461dffe244..7b3aae2052a6 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage {
16 /* _SS_MAXSIZE value minus size of ss_family */ 16 /* _SS_MAXSIZE value minus size of ss_family */
17} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ 17} __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
18 18
19#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) 19#ifdef __KERNEL__
20 20
21#include <asm/socket.h> /* arch-dependent defines */ 21#include <asm/socket.h> /* arch-dependent defines */
22#include <linux/sockios.h> /* the SIOCxxx I/O controls */ 22#include <linux/sockios.h> /* the SIOCxxx I/O controls */
@@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage {
24#include <linux/types.h> /* pid_t */ 24#include <linux/types.h> /* pid_t */
25#include <linux/compiler.h> /* __user */ 25#include <linux/compiler.h> /* __user */
26 26
27#define __sockaddr_check_size(size) \
28 BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
29
27#ifdef __KERNEL__ 30#ifdef __KERNEL__
28# ifdef CONFIG_PROC_FS 31# ifdef CONFIG_PROC_FS
29struct seq_file; 32struct seq_file;
@@ -65,6 +68,12 @@ struct msghdr {
65 unsigned msg_flags; 68 unsigned msg_flags;
66}; 69};
67 70
71/* For recvmmsg/sendmmsg */
72struct mmsghdr {
73 struct msghdr msg_hdr;
74 unsigned msg_len;
75};
76
68/* 77/*
69 * POSIX 1003.1g - ancillary data object information 78 * POSIX 1003.1g - ancillary data object information
70 * Ancillary data consits of a sequence of pairs of 79 * Ancillary data consits of a sequence of pairs of
@@ -101,21 +110,6 @@ struct cmsghdr {
101 ((char *)(cmsg) - (char *)(mhdr)->msg_control))) 110 ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
102 111
103/* 112/*
104 * This mess will go away with glibc
105 */
106
107#ifdef __KERNEL__
108#define __KINLINE static inline
109#elif defined(__GNUC__)
110#define __KINLINE static __inline__
111#elif defined(__cplusplus)
112#define __KINLINE static inline
113#else
114#define __KINLINE static
115#endif
116
117
118/*
119 * Get the next cmsg header 113 * Get the next cmsg header
120 * 114 *
121 * PLEASE, do not touch this function. If you think, that it is 115 * PLEASE, do not touch this function. If you think, that it is
@@ -128,7 +122,7 @@ struct cmsghdr {
128 * ancillary object DATA. --ANK (980731) 122 * ancillary object DATA. --ANK (980731)
129 */ 123 */
130 124
131__KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size, 125static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
132 struct cmsghdr *__cmsg) 126 struct cmsghdr *__cmsg)
133{ 127{
134 struct cmsghdr * __ptr; 128 struct cmsghdr * __ptr;
@@ -140,7 +134,7 @@ __KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
140 return __ptr; 134 return __ptr;
141} 135}
142 136
143__KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg) 137static inline struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
144{ 138{
145 return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg); 139 return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
146} 140}
@@ -327,6 +321,10 @@ extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uadd
327extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); 321extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr);
328extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); 322extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
329 323
324struct timespec;
325
326extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
327 unsigned int flags, struct timespec *timeout);
330#endif 328#endif
331#endif /* not kernel and not glibc */ 329#endif /* not kernel and not glibc */
332#endif /* _LINUX_SOCKET_H */ 330#endif /* _LINUX_SOCKET_H */