diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-15 21:39:31 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 15:53:35 -0400 |
| commit | 01e97e6517053d7c0b9af5248e944a9209909cf5 (patch) | |
| tree | 30f57eededa62a390543b3a596d81006deb22384 /include/linux/socket.h | |
| parent | a2dd3793a1c3ac709f1d7b48ad7751563f4c654f (diff) | |
new helper: msg_data_left()
convert open-coded instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/socket.h')
| -rw-r--r-- | include/linux/socket.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h index c9852ef7e317..5bf59c8493b7 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -139,6 +139,11 @@ static inline struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr | |||
| 139 | return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg); | 139 | return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | static inline size_t msg_data_left(struct msghdr *msg) | ||
| 143 | { | ||
| 144 | return iov_iter_count(&msg->msg_iter); | ||
| 145 | } | ||
| 146 | |||
| 142 | /* "Socket"-level control message types: */ | 147 | /* "Socket"-level control message types: */ |
| 143 | 148 | ||
| 144 | #define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ | 149 | #define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ |
