mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 19:58:30 +00:00
Reduce build graph by another eight percent
This commit is contained in:
parent
367d06d9e4
commit
0ea0d33a77
249 changed files with 889 additions and 988 deletions
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
|
||||
int sys_accept(int server, void *addr, uint32_t *addrsize) {
|
||||
int client;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
|
||||
int sys_accept4(int server, void *addr, uint32_t *addrsize, int flags) {
|
||||
if (!flags) return sys_accept(server, addr, addrsize);
|
||||
|
|
|
@ -16,12 +16,13 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
|
||||
int sys_bind(int fd, const void *addr, uint32_t addrsize) {
|
||||
union sockaddr_storage_bsd bsd;
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
|
||||
int sys_connect(int fd, const void *addr, uint32_t addrsize) {
|
||||
union sockaddr_storage_bsd bsd;
|
||||
|
|
|
@ -16,13 +16,14 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
|
||||
int sys_getpeername(int fd, void *out_addr, uint32_t *out_addrsize) {
|
||||
int rc;
|
||||
|
|
|
@ -16,12 +16,13 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
|
||||
int sys_getsockname(int fd, void *out_addr, uint32_t *out_addrsize) {
|
||||
int rc;
|
||||
|
|
|
@ -16,12 +16,13 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_INTERNAL_H_
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/nt/struct/overlapped.h"
|
||||
#include "libc/nt/thunk/msabi.h"
|
||||
#include "libc/nt/winsock.h"
|
||||
#include "libc/sock/select.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/msghdr.h"
|
||||
#include "libc/sock/struct/pollfd.h"
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -23,49 +23,6 @@ COSMOPOLITAN_C_START_
|
|||
#define FD_CLOSE (1 << FD_CLOSE_BIT)
|
||||
#define FD_CLOSE_BIT 5
|
||||
|
||||
struct sockaddr_bsd {
|
||||
uint8_t sa_len; /* « different type */
|
||||
uint8_t sa_family; /* « different type */
|
||||
char sa_data[14];
|
||||
};
|
||||
|
||||
struct sockaddr_in_bsd {
|
||||
uint8_t sin_len; /* « different type */
|
||||
uint8_t sin_family; /* « different type */
|
||||
uint16_t sin_port;
|
||||
struct in_addr sin_addr;
|
||||
uint8_t sin_zero[8];
|
||||
};
|
||||
|
||||
struct msghdr_bsd {
|
||||
void *msg_name;
|
||||
uint32_t msg_namelen;
|
||||
struct iovec *msg_iov;
|
||||
uint32_t msg_iovlen; /* « different type */
|
||||
void *msg_control;
|
||||
uint64_t msg_controllen;
|
||||
uint32_t msg_flags; /* « different type */
|
||||
};
|
||||
|
||||
struct sockaddr_un_bsd {
|
||||
uint8_t sun_len; /* sockaddr len including NUL on freebsd but excluding it on
|
||||
openbsd/xnu */
|
||||
uint8_t sun_family;
|
||||
char sun_path[108];
|
||||
};
|
||||
|
||||
union sockaddr_storage_bsd {
|
||||
struct sockaddr_bsd sa;
|
||||
struct sockaddr_in_bsd sin;
|
||||
struct sockaddr_un_bsd sun;
|
||||
};
|
||||
|
||||
union sockaddr_storage_linux {
|
||||
struct sockaddr sa;
|
||||
struct sockaddr_in sin;
|
||||
struct sockaddr_un sun;
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------------------*/
|
||||
|
||||
#define SOCKFD_OVERLAP_BUFSIZ 128
|
||||
|
@ -108,17 +65,12 @@ int32_t sys_getsockopt(int32_t, int32_t, int32_t, void *, uint32_t *) hidden;
|
|||
int32_t sys_listen(int32_t, int32_t) hidden;
|
||||
int32_t sys_getsockname(int32_t, void *, uint32_t *) hidden;
|
||||
int32_t sys_getpeername(int32_t, void *, uint32_t *) hidden;
|
||||
int32_t sys_poll(struct pollfd *, uint64_t, signed) hidden;
|
||||
int32_t sys_shutdown(int32_t, int32_t) hidden;
|
||||
int32_t sys_socket(int32_t, int32_t, int32_t) hidden;
|
||||
int32_t sys_socketpair(int32_t, int32_t, int32_t, int32_t[2]) hidden;
|
||||
int64_t sys_readv(int32_t, const struct iovec *, int32_t) hidden;
|
||||
int64_t sys_writev(int32_t, const struct iovec *, int32_t) hidden;
|
||||
ssize_t sys_recvfrom(int, void *, size_t, int, void *, uint32_t *) hidden;
|
||||
ssize_t sys_sendto(int, const void *, size_t, int, const void *,
|
||||
uint32_t) hidden;
|
||||
ssize_t sys_sendmsg(int, const struct msghdr *, int) hidden;
|
||||
ssize_t sys_recvmsg(int, struct msghdr *, int) hidden;
|
||||
int32_t sys_select(int32_t, fd_set *, fd_set *, fd_set *,
|
||||
struct timeval *) hidden;
|
||||
int sys_pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *,
|
||||
|
@ -127,10 +79,9 @@ int sys_setsockopt(int, int, int, const void *, uint32_t) hidden;
|
|||
int32_t sys_epoll_create(int32_t) hidden;
|
||||
int32_t sys_epoll_ctl(int32_t, int32_t, int32_t, void *) hidden;
|
||||
int32_t sys_epoll_wait(int32_t, void *, int32_t, int32_t) hidden;
|
||||
int sys_poll_metal(struct pollfd *, size_t, unsigned);
|
||||
|
||||
int sys_poll_nt(struct pollfd *, uint64_t, uint64_t *) hidden;
|
||||
int sys_socket_nt(int, int, int) hidden;
|
||||
|
||||
/*
|
||||
int sys_socketpair_nt_stream(int, int, int, int[2]) hidden;
|
||||
int sys_socketpair_nt_dgram(int, int, int, int[2]) hidden;
|
||||
|
@ -138,12 +89,8 @@ int sys_socketpair_nt_dgram(int, int, int, int[2]) hidden;
|
|||
int sys_socketpair_nt(int, int, int, int[2]) hidden;
|
||||
int sys_select_nt(int, fd_set *, fd_set *, fd_set *, struct timeval *) hidden;
|
||||
|
||||
bool __asan_is_valid_msghdr(const struct msghdr *);
|
||||
ssize_t sys_send_nt(int, const struct iovec *, size_t, uint32_t) hidden;
|
||||
size_t __iovec2nt(struct NtIovec[hasatleast 16], const struct iovec *,
|
||||
size_t) hidden;
|
||||
ssize_t sys_sendto_nt(int, const struct iovec *, size_t, uint32_t, void *,
|
||||
uint32_t) hidden;
|
||||
|
||||
void WinSockInit(void) hidden;
|
||||
int64_t __winsockerr(void) nocallback hidden;
|
||||
|
@ -155,11 +102,6 @@ struct SockFd *_dupsockfd(struct SockFd *) hidden;
|
|||
int64_t GetNtBaseSocket(int64_t) hidden;
|
||||
int sys_close_epoll(int) hidden;
|
||||
|
||||
int sockaddr2bsd(const void *, uint32_t, union sockaddr_storage_bsd *,
|
||||
uint32_t *);
|
||||
void sockaddr2linux(const union sockaddr_storage_bsd *, uint32_t,
|
||||
union sockaddr_storage_linux *, uint32_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_INTERNAL_H_ */
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/nt/winsock.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
|
|
|
@ -16,11 +16,12 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/nt/struct/overlapped.h"
|
||||
#include "libc/nt/winsock.h"
|
||||
#include "libc/sock/internal.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/calls/struct/iovec.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/sock/internal.h"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/nt/struct/overlapped.h"
|
||||
|
|
|
@ -16,13 +16,16 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/iovec.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/nt/winsock.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -19,9 +19,12 @@
|
|||
#include "libc/assert.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/iovec.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/msghdr.h"
|
||||
#include "libc/sock/struct/msghdr.internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/select.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/pollfd.h"
|
||||
#include "libc/sock/struct/pollfd.internal.h"
|
||||
#include "libc/sysv/consts/poll.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/iovec.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/sig.internal.h"
|
||||
|
@ -25,6 +24,7 @@
|
|||
#include "libc/calls/syscall_support-nt.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/nt/enum/wait.h"
|
||||
#include "libc/nt/errors.h"
|
||||
#include "libc/nt/files.h"
|
||||
|
|
|
@ -20,12 +20,16 @@
|
|||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/iovec.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/msghdr.h"
|
||||
#include "libc/sock/struct/msghdr.internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -20,11 +20,13 @@
|
|||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/calls/struct/iovec.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/af.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/struct/sockaddr.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/af.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "libc/intrin/describeflags.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
#include "libc/sock/struct/sockaddr6.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/af.h"
|
||||
|
|
22
libc/sock/struct/msghdr.internal.h
Normal file
22
libc/sock/struct/msghdr.internal.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_STRUCT_MSGHDR_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_STRUCT_MSGHDR_INTERNAL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct msghdr_bsd {
|
||||
void *msg_name;
|
||||
uint32_t msg_namelen;
|
||||
struct iovec *msg_iov;
|
||||
uint32_t msg_iovlen; /* « different type */
|
||||
void *msg_control;
|
||||
uint64_t msg_controllen;
|
||||
uint32_t msg_flags; /* « different type */
|
||||
};
|
||||
|
||||
ssize_t sys_sendmsg(int, const struct msghdr *, int) hidden;
|
||||
ssize_t sys_recvmsg(int, struct msghdr *, int) hidden;
|
||||
bool __asan_is_valid_msghdr(const struct msghdr *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_MSGHDR_INTERNAL_H_ */
|
13
libc/sock/struct/pollfd.internal.h
Normal file
13
libc/sock/struct/pollfd.internal.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_STRUCT_POLLFD_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_STRUCT_POLLFD_INTERNAL_H_
|
||||
#include "libc/sock/struct/pollfd.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int32_t sys_poll(struct pollfd *, uint64_t, signed) hidden;
|
||||
int sys_poll_metal(struct pollfd *, size_t, unsigned);
|
||||
int sys_poll_nt(struct pollfd *, uint64_t, uint64_t *) hidden;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_POLLFD_INTERNAL_H_ */
|
51
libc/sock/struct/sockaddr.internal.h
Normal file
51
libc/sock/struct/sockaddr.internal.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_STRUCT_SOCKADDR_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_STRUCT_SOCKADDR_INTERNAL_H_
|
||||
#include "libc/mem/alloca.h"
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct sockaddr_bsd {
|
||||
uint8_t sa_len; /* « different type */
|
||||
uint8_t sa_family; /* « different type */
|
||||
char sa_data[14];
|
||||
};
|
||||
|
||||
struct sockaddr_in_bsd {
|
||||
uint8_t sin_len; /* « different type */
|
||||
uint8_t sin_family; /* « different type */
|
||||
uint16_t sin_port;
|
||||
struct in_addr sin_addr;
|
||||
uint8_t sin_zero[8];
|
||||
};
|
||||
|
||||
struct sockaddr_un_bsd {
|
||||
uint8_t sun_len; /* sockaddr len including NUL on freebsd but excluding it on
|
||||
openbsd/xnu */
|
||||
uint8_t sun_family;
|
||||
char sun_path[108];
|
||||
};
|
||||
|
||||
union sockaddr_storage_bsd {
|
||||
struct sockaddr_bsd sa;
|
||||
struct sockaddr_in_bsd sin;
|
||||
struct sockaddr_un_bsd sun;
|
||||
};
|
||||
|
||||
union sockaddr_storage_linux {
|
||||
struct sockaddr sa;
|
||||
struct sockaddr_in sin;
|
||||
struct sockaddr_un sun;
|
||||
};
|
||||
|
||||
const char *DescribeSockaddr(char[128], const struct sockaddr *, size_t);
|
||||
#define DescribeSockaddr(sa, sz) DescribeSockaddr(alloca(128), sa, sz)
|
||||
|
||||
int sockaddr2bsd(const void *, uint32_t, union sockaddr_storage_bsd *,
|
||||
uint32_t *);
|
||||
void sockaddr2linux(const union sockaddr_storage_bsd *, uint32_t,
|
||||
union sockaddr_storage_linux *, uint32_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_SOCK_STRUCT_SOCKADDR_INTERNAL_H_ */
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SOCK_SYSCALL_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_SOCK_SYSCALL_INTERNAL_H_
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/struct/fd.internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -15,7 +16,6 @@ int sys_listen_nt(struct Fd *, int) hidden;
|
|||
int sys_setsockopt_nt(struct Fd *, int, int, const void *, uint32_t) hidden;
|
||||
int sys_shutdown_nt(struct Fd *, int) hidden;
|
||||
ssize_t sys_recv_nt(struct Fd *, const struct iovec *, size_t, uint32_t) hidden;
|
||||
|
||||
ssize_t sys_recvfrom_nt(struct Fd *, const struct iovec *, size_t, uint32_t,
|
||||
void *, uint32_t *) hidden;
|
||||
|
||||
|
|
|
@ -16,13 +16,14 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/dprintf.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/nt/events.h"
|
||||
|
@ -38,7 +39,6 @@
|
|||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/sock.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
/* Note: log_facility should be initialized with LOG_USER by default,
|
||||
* but since LOG_USER is not a constant value, we cannot initialize it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue