mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16: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
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_ */
|
Loading…
Add table
Add a link
Reference in a new issue