summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-15 21:39:31 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-11 15:53:35 -0400
commit01e97e6517053d7c0b9af5248e944a9209909cf5 (patch)
tree30f57eededa62a390543b3a596d81006deb22384 /include
parenta2dd3793a1c3ac709f1d7b48ad7751563f4c654f (diff)
downloadlinux-01e97e6517053d7c0b9af5248e944a9209909cf5.tar.bz2
new helper: msg_data_left()
convert open-coded instances Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/socket.h5
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
return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
}
+static inline size_t msg_data_left(struct msghdr *msg)
+{
+ return iov_iter_count(&msg->msg_iter);
+}
+
/* "Socket"-level control message types: */
#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */