#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "base/posix/unix_domain_socket.h"
#include <errno.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <unistd.h>
#include <vector>
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/pickle.h"
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
namespace base {
const size_t UnixDomainSocket::kMaxFileDescriptors = …;
bool CreateSocketPair(ScopedFD* one, ScopedFD* two) { … }
bool UnixDomainSocket::EnableReceiveProcessId(int fd) { … }
bool UnixDomainSocket::SendMsg(int fd,
const void* buf,
size_t length,
const std::vector<int>& fds) { … }
ssize_t UnixDomainSocket::RecvMsg(int fd,
void* buf,
size_t length,
std::vector<ScopedFD>* fds) { … }
ssize_t UnixDomainSocket::RecvMsgWithPid(int fd,
void* buf,
size_t length,
std::vector<ScopedFD>* fds,
ProcessId* pid) { … }
ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
void* buf,
size_t length,
int flags,
std::vector<ScopedFD>* fds,
ProcessId* out_pid) { … }
ssize_t UnixDomainSocket::SendRecvMsg(int fd,
uint8_t* reply,
unsigned max_reply_len,
int* result_fd,
const Pickle& request) { … }
ssize_t UnixDomainSocket::SendRecvMsgWithFlags(int fd,
uint8_t* reply,
unsigned max_reply_len,
int recvmsg_flags,
int* result_fd,
const Pickle& request) { … }
}