Lines Matching refs:cmsg
61 struct cmsghdr *cmsg; in mm_send_fd() local
76 cmsg = CMSG_FIRSTHDR(&msg); in mm_send_fd()
77 cmsg->cmsg_len = CMSG_LEN(sizeof(int)); in mm_send_fd()
78 cmsg->cmsg_level = SOL_SOCKET; in mm_send_fd()
79 cmsg->cmsg_type = SCM_RIGHTS; in mm_send_fd()
80 *(int *)CMSG_DATA(cmsg) = fd; in mm_send_fd()
122 struct cmsghdr *cmsg; in mm_receive_fd() local
167 cmsg = CMSG_FIRSTHDR(&msg); in mm_receive_fd()
168 if (cmsg == NULL) { in mm_receive_fd()
174 if (cmsg->cmsg_type != SCM_RIGHTS) { in mm_receive_fd()
176 SCM_RIGHTS, cmsg->cmsg_type); in mm_receive_fd()
180 fd = (*(int *)CMSG_DATA(cmsg)); in mm_receive_fd()