Lines Matching refs:msg

133 int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p)  in __scm_send()  argument
138 for_each_cmsghdr(cmsg, msg) { in __scm_send()
149 if (!CMSG_OK(msg, cmsg)) in __scm_send()
215 int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data) in put_cmsg() argument
218 = (__force struct cmsghdr __user *)msg->msg_control; in put_cmsg()
223 if (MSG_CMSG_COMPAT & msg->msg_flags) in put_cmsg()
224 return put_cmsg_compat(msg, level, type, len, data); in put_cmsg()
226 if (cm==NULL || msg->msg_controllen < sizeof(*cm)) { in put_cmsg()
227 msg->msg_flags |= MSG_CTRUNC; in put_cmsg()
230 if (msg->msg_controllen < cmlen) { in put_cmsg()
231 msg->msg_flags |= MSG_CTRUNC; in put_cmsg()
232 cmlen = msg->msg_controllen; in put_cmsg()
244 if (msg->msg_controllen < cmlen) in put_cmsg()
245 cmlen = msg->msg_controllen; in put_cmsg()
246 msg->msg_control += cmlen; in put_cmsg()
247 msg->msg_controllen -= cmlen; in put_cmsg()
254 void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) in scm_detach_fds() argument
257 = (__force struct cmsghdr __user*)msg->msg_control; in scm_detach_fds()
265 if (MSG_CMSG_COMPAT & msg->msg_flags) { in scm_detach_fds()
266 scm_detach_fds_compat(msg, scm); in scm_detach_fds()
270 if (msg->msg_controllen > sizeof(struct cmsghdr)) in scm_detach_fds()
271 fdmax = ((msg->msg_controllen - sizeof(struct cmsghdr)) in scm_detach_fds()
285 err = get_unused_fd_flags(MSG_CMSG_CLOEXEC & msg->msg_flags in scm_detach_fds()
314 if (msg->msg_controllen < cmlen) in scm_detach_fds()
315 cmlen = msg->msg_controllen; in scm_detach_fds()
316 msg->msg_control += cmlen; in scm_detach_fds()
317 msg->msg_controllen -= cmlen; in scm_detach_fds()
321 msg->msg_flags |= MSG_CTRUNC; in scm_detach_fds()