Lines Matching refs:cmsg
140 struct cmsghdr *cmsg; in send_fd() local
156 cmsg = CMSG_FIRSTHDR(&msg); in send_fd()
157 cmsg->cmsg_len = CMSG_LEN(sizeof(int)); in send_fd()
158 cmsg->cmsg_level = SOL_SOCKET; in send_fd()
159 cmsg->cmsg_type = SCM_RIGHTS; in send_fd()
160 *(int *)CMSG_DATA(cmsg) = fd; in send_fd()
193 struct cmsghdr *cmsg; in receive_fd() local
220 cmsg = CMSG_FIRSTHDR(&msg); in receive_fd()
221 if (cmsg == NULL) { in receive_fd()
225 if (cmsg->cmsg_type != SCM_RIGHTS) in receive_fd()
227 SCM_RIGHTS, cmsg->cmsg_type); in receive_fd()
229 fd = (*(int *)CMSG_DATA(cmsg)); in receive_fd()
257 } cmsg; in send_msg_with_cred() local
259 memset(&cmsg, 0, sizeof(cmsg)); in send_msg_with_cred()
260 cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(struct cmsgcred)); in send_msg_with_cred()
261 cmsg.hdr.cmsg_level = SOL_SOCKET; in send_msg_with_cred()
262 cmsg.hdr.cmsg_type = SCM_CREDS; in send_msg_with_cred()
267 msg.msg_control = (caddr_t)&cmsg; in send_msg_with_cred()
294 } cmsg; in receive_msg_with_cred() local
302 msg.msg_control = &cmsg; in receive_msg_with_cred()
303 msg.msg_controllen = sizeof(cmsg); in receive_msg_with_cred()