2020-04-12 14:34:56 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <sys/un.h>
|
|
|
|
#include <sys/socket.h>
|
2021-01-12 09:07:48 +01:00
|
|
|
#include <string_view>
|
2020-04-12 14:34:56 +02:00
|
|
|
|
2020-06-19 12:52:25 +02:00
|
|
|
socklen_t setup_sockaddr(sockaddr_un *sun, const char *name);
|
2020-04-12 14:34:56 +02:00
|
|
|
int socket_accept(int sockfd, int timeout);
|
|
|
|
void get_client_cred(int fd, struct ucred *cred);
|
|
|
|
int recv_fd(int sockfd);
|
|
|
|
void send_fd(int sockfd, int fd);
|
|
|
|
int read_int(int fd);
|
|
|
|
int read_int_be(int fd);
|
|
|
|
void write_int(int fd, int val);
|
|
|
|
void write_int_be(int fd, int val);
|
2021-01-12 09:07:48 +01:00
|
|
|
std::string read_string(int fd);
|
|
|
|
void read_string(int fd, std::string &str);
|
|
|
|
void write_string(int fd, std::string_view str);
|