Update recv/send fd function

This commit is contained in:
topjohnwu
2021-08-19 04:36:47 -07:00
parent 6f9c3c4ff3
commit ffe47300a1
2 changed files with 84 additions and 97 deletions
+5 -3
View File
@@ -3,12 +3,14 @@
#include <sys/un.h>
#include <sys/socket.h>
#include <string_view>
#include <vector>
socklen_t setup_sockaddr(sockaddr_un *sun, const char *name);
int socket_accept(int sockfd, int timeout);
void get_client_cred(int fd, struct ucred *cred);
void get_client_cred(int fd, ucred *cred);
std::vector<int> recv_fds(int sockfd);
int recv_fd(int sockfd);
void send_fd(int sockfd, int fd);
int send_fds(int sockfd, const int *fds, int cnt);
int send_fd(int sockfd, int fd);
int read_int(int fd);
int read_int_be(int fd);
void write_int(int fd, int val);