Add more missing libc functionality

This commit is contained in:
Justine Tunney 2022-08-06 09:56:17 -07:00
parent cf93ecbbb2
commit a8cf0f7e89
74 changed files with 6981 additions and 105 deletions

View file

@ -1,5 +1,6 @@
#ifndef LIBC_ISYSTEM_DIRENT_H_
#define LIBC_ISYSTEM_DIRENT_H_
#include "libc/calls/calls.h"
#include "libc/calls/struct/dirent.h"
#include "libc/sysv/consts/dt.h"
#endif

View file

@ -1,10 +1,5 @@
#ifndef LIBC_ISYSTEM_ENDIAN_H_
#define LIBC_ISYSTEM_ENDIAN_H_
#define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
#define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
#define __PDP_ENDIAN __ORDER_PDP_ENDIAN__
#define __BYTE_ORDER __BYTE_ORDER__
#include "libc/bits/newbie.h"
#include "libc/sysv/consts/endian.h"
#endif /* LIBC_ISYSTEM_ENDIAN_H_ */

View file

@ -3,4 +3,6 @@
#include "libc/calls/calls.h"
#include "libc/sysv/consts/at.h"
#include "libc/sysv/consts/f.h"
#include "libc/sysv/consts/fd.h"
#include "libc/sysv/consts/o.h"
#endif

4
libc/isystem/fnmatch.h Normal file
View file

@ -0,0 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_FNMATCH_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_FNMATCH_H_
#include "third_party/musl/fnmatch.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_FNMATCH_H_ */

4
libc/isystem/iconv.h Normal file
View file

@ -0,0 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_ICONV_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_ICONV_H_
#include "libc/stdio/iconv.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_ICONV_H_ */

5
libc/isystem/memory.h Normal file
View file

@ -0,0 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_MEMORY_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_MEMORY_H_
#include "libc/alg/alg.h"
#include "libc/str/str.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_MEMORY_H_ */

5
libc/isystem/netdb.h Normal file
View file

@ -0,0 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_NETDB_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_NETDB_H_
#include "libc/dns/dns.h"
#include "libc/dns/ent.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_NETDB_H_ */

15
libc/isystem/netinet/in.h Normal file
View file

@ -0,0 +1,15 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_NETINET_IN_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_NETINET_IN_H_
#include "libc/sock/sock.h"
#include "libc/sock/struct/ip_mreq.h"
#include "libc/sock/struct/sockaddr.h"
#include "libc/sock/struct/sockaddr6.h"
#include "libc/sysv/consts/inaddr.h"
#include "libc/sysv/consts/ip.h"
#include "libc/sysv/consts/ipport.h"
#include "libc/sysv/consts/ipproto.h"
#include "libc/sysv/consts/ipv6.h"
#include "libc/sysv/consts/mcast.h"
#include "libc/sysv/consts/pf.h"
#include "libc/sysv/consts/sock.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_NETINET_IN_H_ */

4
libc/isystem/stdio_ext.h Normal file
View file

@ -0,0 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_STDIO_EXT_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_STDIO_EXT_H_
#include "libc/stdio/stdio_ext.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_STDIO_EXT_H_ */

View file

@ -1,5 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_DIR_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_DIR_H_
#include "libc/isystem/dirent.h"
#include "libc/calls/calls.h"
#include "libc/sysv/consts/dt.h"
#define direct dirent
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_DIR_H_ */

View file

@ -1,4 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_ERRNO_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_ERRNO_H_
#include "libc/isystem/errno.h"
#include "libc/errno.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_ERRNO_H_ */

View file

@ -1,4 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_FCNTL_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_FCNTL_H_
#include "libc/isystem/fcntl.h"
#include "libc/calls/calls.h"
#include "libc/sysv/consts/at.h"
#include "libc/sysv/consts/f.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_FCNTL_H_ */

View file

@ -3,9 +3,10 @@
#include "libc/calls/calls.h"
#include "libc/calls/ioctl.h"
#include "libc/calls/struct/winsize.h"
#include "libc/sysv/consts/blk.h"
#include "libc/sysv/consts/fd.h"
#include "libc/sysv/consts/n.h"
#include "libc/sysv/consts/fio.h"
#include "libc/sysv/consts/modem.h"
#include "libc/sysv/consts/pty.h"
#include "libc/sysv/consts/sio.h"
#include "libc/sysv/consts/termios.h"
#endif

View file

@ -7,6 +7,7 @@
#include "libc/sysv/consts/mlock.h"
#include "libc/sysv/consts/msync.h"
#include "libc/sysv/consts/posix.h"
#include "libc/sysv/consts/prot.h"
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#include "libc/sysv/consts/madv.h"
#endif

15
libc/isystem/sys/param.h Normal file
View file

@ -0,0 +1,15 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_PARAM_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_PARAM_H_
#include "libc/bits/newbie.h"
#include "libc/calls/calls.h"
#include "libc/calls/struct/rlimit.h"
#include "libc/calls/struct/rusage.h"
#include "libc/calls/sysparam.h"
#include "libc/calls/weirdtypes.h"
#include "libc/limits.h"
#include "libc/sysv/consts/endian.h"
#include "libc/sysv/consts/prio.h"
#include "libc/sysv/consts/rlim.h"
#include "libc/sysv/consts/rlimit.h"
#include "libc/sysv/consts/rusage.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_PARAM_H_ */

View file

@ -1,4 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_POLL_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_POLL_H_
#include "libc/isystem/poll.h"
#include "libc/sock/sock.h"
#include "libc/sysv/consts/poll.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_POLL_H_ */

View file

@ -1,4 +1,7 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_SIGNAL_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_SIGNAL_H_
#include "libc/isystem/signal.h"
#include "libc/calls/calls.h"
#include "libc/calls/struct/sigaction.h"
#include "libc/calls/struct/siginfo.h"
#include "libc/sysv/consts/sicode.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_SIGNAL_H_ */

View file

@ -1,4 +1,15 @@
#ifndef LIBC_ISYSTEM_SYS_SOCKET_H_
#define LIBC_ISYSTEM_SYS_SOCKET_H_
#include "libc/sock/sock.h"
#include "libc/sock/struct/linger.h"
#include "libc/sock/struct/msghdr.h"
#include "libc/sock/struct/sockaddr.h"
#include "libc/sysv/consts/af.h"
#include "libc/sysv/consts/msg.h"
#include "libc/sysv/consts/pf.h"
#include "libc/sysv/consts/scm.h"
#include "libc/sysv/consts/shut.h"
#include "libc/sysv/consts/so.h"
#include "libc/sysv/consts/sock.h"
#include "libc/sysv/consts/sol.h"
#endif

View file

@ -1,4 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_TERMIOS_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_TERMIOS_H_
#include "libc/isystem/termios.h"
#include "libc/calls/termios.h"
#include "libc/sysv/consts/termios.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_TERMIOS_H_ */

View file

@ -4,18 +4,11 @@
#include "libc/calls/weirdtypes.h"
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned u_int32_t;
typedef char *caddr_t;
typedef unsigned char u_char;
typedef unsigned short u_short, ushort;
typedef unsigned u_int, uint;
typedef unsigned long u_long, ulong;
typedef long long quad_t;
typedef unsigned long long u_quad_t;
#include "libc/isystem/endian.h"
#include "libc/isystem/sys/select.h"
#include "libc/bits/newbie.h"
#include "libc/calls/typedef/u.h"
#include "libc/calls/weirdtypes.h"
#include "libc/sock/select.h"
#include "libc/sysv/consts/endian.h"
#endif
#endif

5
libc/isystem/syslog.h Normal file
View file

@ -0,0 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYSLOG_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYSLOG_H_
#include "libc/sock/syslog.h"
#include "libc/sysv/consts/log.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYSLOG_H_ */

View file

@ -1,5 +1,6 @@
#ifndef LIBC_ISYSTEM_TIME_H_
#define LIBC_ISYSTEM_TIME_H_
#include "libc/calls/weirdtypes.h"
#include "libc/sysv/consts/sched.h"
#include "libc/time/struct/tm.h"
#include "libc/time/time.h"

View file

@ -4,4 +4,6 @@
#include "libc/calls/weirdtypes.h"
#include "libc/sysv/consts/fileno.h"
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/ok.h"
#include "third_party/getopt/getopt.h"
#endif

View file

@ -1,4 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_WAIT_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_WAIT_H_
#include "libc/isystem/sys/wait.h"
#include "libc/calls/calls.h"
#include "libc/calls/weirdtypes.h"
#include "libc/sysv/consts/w.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_WAIT_H_ */