Lines Matching refs:cmsg
54 struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg); in SendFileDescriptorVector() local
55 cmsg->cmsg_level = SOL_SOCKET; in SendFileDescriptorVector()
56 cmsg->cmsg_type = SCM_RIGHTS; in SendFileDescriptorVector()
57 cmsg->cmsg_len = cmsg_len; in SendFileDescriptorVector()
59 int* cmsg_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg)); in SendFileDescriptorVector()
117 struct cmsghdr* cmsg; in ReceiveFileDescriptorVector() local
118 for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != nullptr; cmsg = CMSG_NXTHDR(&msg, cmsg)) { in ReceiveFileDescriptorVector()
119 if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) { in ReceiveFileDescriptorVector()
120 LOG(ERROR) << "received unexpected cmsg: [" << cmsg->cmsg_level << ", " << cmsg->cmsg_type in ReceiveFileDescriptorVector()
139 if (cmsg->cmsg_len % sizeof(int) != 0) { in ReceiveFileDescriptorVector()
140 LOG(FATAL) << "cmsg_len(" << cmsg->cmsg_len << ") not aligned to sizeof(int)"; in ReceiveFileDescriptorVector()
141 } else if (cmsg->cmsg_len <= CMSG_LEN(0)) { in ReceiveFileDescriptorVector()
142 LOG(FATAL) << "cmsg_len(" << cmsg->cmsg_len << ") not long enough to hold any data"; in ReceiveFileDescriptorVector()
145 int* cmsg_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg)); in ReceiveFileDescriptorVector()
146 size_t cmsg_fdcount = static_cast<size_t>(cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); in ReceiveFileDescriptorVector()