MCPcopy Create free account
hub / github.com/HexHive/NASS / SendFileDescriptors

Function SendFileDescriptors

binderlib/include/android-base/cmsg.h:67–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65// SendFileDescriptors(sock, "foo", 3, std::move(fd1), std::move(fd2))
66template <typename... Args>
67ssize_t SendFileDescriptors(borrowed_fd sock, const void* data, size_t len, Args&&... sent_fds) {
68 // Do not allow implicit conversion to int: people might try to do something along the lines of:
69 // SendFileDescriptors(..., std::move(a_unique_fd))
70 // and be surprised when the unique_fd isn't closed afterwards.
71 AssertType<int>(std::forward<Args>(sent_fds)...);
72 std::vector<int> fds;
73 Append(fds, std::forward<Args>(sent_fds)...);
74 return SendFileDescriptorVector(sock, data, len, fds);
75}
76
77// Helper for ReceiveFileDescriptorVector that receives an exact number of file descriptors.
78// If more file descriptors are received than requested, -1 is returned with errno set to EMSGSIZE.

Callers

nothing calls this directly

Calls 1

AppendFunction · 0.85

Tested by

no test coverage detected