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