Lines Matching refs:cmsg
84 struct cmsghdr* cmsg; in SendMsg() local
87 cmsg = CMSG_FIRSTHDR(&msg); in SendMsg()
88 cmsg->cmsg_level = SOL_SOCKET; in SendMsg()
89 cmsg->cmsg_type = SCM_RIGHTS; in SendMsg()
90 cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fds.size()); in SendMsg()
91 memcpy(CMSG_DATA(cmsg), &fds[0], sizeof(int) * fds.size()); in SendMsg()
92 msg.msg_controllen = cmsg->cmsg_len; in SendMsg()
169 struct cmsghdr* cmsg; in RecvMsgWithFlags() local
170 for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { in RecvMsgWithFlags()
171 const unsigned payload_len = cmsg->cmsg_len - CMSG_LEN(0); in RecvMsgWithFlags()
172 if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { in RecvMsgWithFlags()
175 wire_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg)); in RecvMsgWithFlags()
181 if (cmsg->cmsg_level == SOL_SOCKET && in RecvMsgWithFlags()
182 cmsg->cmsg_type == SCM_CREDENTIALS) { in RecvMsgWithFlags()
185 pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid; in RecvMsgWithFlags()