Initial import

This commit is contained in:
Justine Tunney 2020-06-15 07:18:57 -07:00
commit c91b3c5006
14915 changed files with 590219 additions and 0 deletions

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

@ -0,0 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_ALLOCA_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_ALLOCA_H_
#include "libc/mem/alloca.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_ALLOCA_H_ */

4
libc/isystem/arpa/inet.h Normal file
View file

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_ARPA_INET_H_
#define LIBC_ISYSTEM_ARPA_INET_H_
#include "libc/sock/sock.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_ASSERT_H_
#define LIBC_ISYSTEM_ASSERT_H_
#include "libc/assert.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_COMPLEX_H_
#define LIBC_ISYSTEM_COMPLEX_H_
#include "libc/math.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_CTYPE_H_
#define LIBC_ISYSTEM_CTYPE_H_
#include "libc/str/str.h"
#endif

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

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

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_SYS_DLFCN_H_
#define LIBC_ISYSTEM_SYS_DLFCN_H_
#include "libc/calls/calls.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_ELF_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_ELF_H_
#include "libc/elf.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_ENDIAN_H_
#define LIBC_ISYSTEM_ENDIAN_H_
#include "libc/conv/conv.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_ERR_H_
#define LIBC_ISYSTEM_ERR_H_
#include "libc/log/log.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_ERRNO_H_
#define LIBC_ISYSTEM_ERRNO_H_
#include "libc/errno.h"
#endif

6
libc/isystem/fcntl.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef LIBC_ISYSTEM_SYS_FCNTL_H_
#define LIBC_ISYSTEM_SYS_FCNTL_H_
#include "libc/calls/calls.h"
#include "libc/sysv/consts/at.h"
#include "libc/sysv/consts/f.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_FLOAT_H_
#define LIBC_ISYSTEM_FLOAT_H_
#include "libc/math.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_GETOPT_H_
#define LIBC_ISYSTEM_GETOPT_H_
#include "third_party/getopt/getopt.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_GRP_H_
#define LIBC_ISYSTEM_GRP_H_
#include "libc/passwd.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_INTTYPES_H_
#define LIBC_ISYSTEM_INTTYPES_H_
#include "libc/inttypes.h"
#endif /* LIBC_ISYSTEM_INTTYPES_H_ */

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_LIMITS_H_
#define LIBC_ISYSTEM_LIMITS_H_
#include "libc/limits.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_MALLOC_H_
#define LIBC_ISYSTEM_MALLOC_H_
#include "libc/mem/mem.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_MATH_H_
#define LIBC_ISYSTEM_MATH_H_
#include "libc/math.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_PATHS_H_
#define LIBC_ISYSTEM_PATHS_H_
#include "libc/paths.h"
#endif

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

@ -0,0 +1,5 @@
#ifndef LIBC_ISYSTEM_POLL_H_
#define LIBC_ISYSTEM_POLL_H_
#include "libc/sock/sock.h"
#include "libc/sysv/consts/poll.h"
#endif

100
libc/isystem/pthread.h Normal file
View file

@ -0,0 +1,100 @@
#ifndef LIBC_ISYSTEM_PTHREAD_H_
#define LIBC_ISYSTEM_PTHREAD_H_
#include "libc/calls/calls.h"
#define PTHREAD_ONCE_INIT 0
#define PTHREAD_MUTEX_NORMAL 0
#define PTHREAD_MUTEX_DEFAULT 0
#define PTHREAD_MUTEX_RECURSIVE 1
#define PTHREAD_MUTEX_ERRORCHECK 2
#define PTHREAD_MUTEX_STALLED 0
#define PTHREAD_MUTEX_ROBUST 1
/* clang-format off */
#define PTHREAD_MUTEX_INITIALIZER {{{0}}}
#define PTHREAD_RWLOCK_INITIALIZER {{{0}}}
#define PTHREAD_COND_INITIALIZER {{{0}}}
/* clang-format on */
typedef unsigned long *pthread_t;
typedef int pthread_once_t;
typedef struct {
unsigned __attr;
} pthread_mutexattr_t;
typedef struct {
unsigned __attr;
} pthread_condattr_t;
typedef struct {
unsigned __attr[2];
} pthread_rwlockattr_t;
typedef struct {
union {
int __i[6];
volatile int __vi[6];
volatile void *volatile __p[6];
} __u;
} pthread_mutex_t;
typedef struct {
union {
int __i[9];
volatile int __vi[9];
unsigned __s[9];
} __u;
} pthread_attr_t;
typedef struct {
union {
int __i[12];
volatile int __vi[12];
void *__p[12];
} __u;
} pthread_cond_t;
typedef struct {
union {
int __i[8];
volatile int __vi[8];
void *__p[8];
} __u;
} pthread_rwlock_t;
noreturn void pthread_exit(void *);
pureconst pthread_t pthread_self(void);
int pthread_create(pthread_t *, const pthread_attr_t *, void *(*)(void *),
void *);
int pthread_detach(pthread_t);
int pthread_join(pthread_t, void **);
int pthread_equal(pthread_t, pthread_t);
int pthread_once(pthread_once_t *, void (*)(void));
int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *);
int pthread_mutex_lock(pthread_mutex_t *);
int pthread_mutex_unlock(pthread_mutex_t *);
int pthread_mutex_trylock(pthread_mutex_t *);
int pthread_mutex_timedlock(pthread_mutex_t *, const struct timespec *);
int pthread_mutex_destroy(pthread_mutex_t *);
int pthread_mutex_consistent(pthread_mutex_t *);
int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *);
int pthread_cond_destroy(pthread_cond_t *);
int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *);
int pthread_cond_timedwait(pthread_cond_t *, pthread_mutex_t *,
const struct timespec *);
int pthread_cond_broadcast(pthread_cond_t *);
int pthread_cond_signal(pthread_cond_t *);
int pthread_rwlock_init(pthread_rwlock_t *, const pthread_rwlockattr_t *);
int pthread_rwlock_destroy(pthread_rwlock_t *);
int pthread_rwlock_rdlock(pthread_rwlock_t *);
int pthread_rwlock_tryrdlock(pthread_rwlock_t *);
int pthread_rwlock_timedrdlock(pthread_rwlock_t *, const struct timespec *);
int pthread_rwlock_wrlock(pthread_rwlock_t *);
int pthread_rwlock_trywrlock(pthread_rwlock_t *);
int pthread_rwlock_timedwrlock(pthread_rwlock_t *, const struct timespec *);
int pthread_rwlock_unlock(pthread_rwlock_t *);
#endif /* LIBC_ISYSTEM_PTHREAD_H_ */

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_PWD_H_
#define LIBC_ISYSTEM_PWD_H_
#include "libc/passwd.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_REGEX_H_
#define LIBC_ISYSTEM_REGEX_H_
#include "third_party/regex/regex.h"
#endif

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

@ -0,0 +1,5 @@
#ifndef LIBC_ISYSTEM_SCHED_H_
#define LIBC_ISYSTEM_SCHED_H_
#include "libc/calls/calls.h"
#include "libc/sysv/consts/sched.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_SETJMP_H_
#define LIBC_ISYSTEM_SETJMP_H_
#include "libc/runtime/runtime.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_SIGNAL_H_
#define LIBC_ISYSTEM_SIGNAL_H_
#include "libc/calls/calls.h"
#endif

3
libc/isystem/stdarg.h Normal file
View file

@ -0,0 +1,3 @@
#ifndef LIBC_ISYSTEM_STDARG_H_
#define LIBC_ISYSTEM_STDARG_H_
#endif

3
libc/isystem/stdbool.h Normal file
View file

@ -0,0 +1,3 @@
#ifndef LIBC_ISYSTEM_STDBOOL_H_
#define LIBC_ISYSTEM_STDBOOL_H_
#endif

View file

3
libc/isystem/stddef.h Normal file
View file

@ -0,0 +1,3 @@
#ifndef LIBC_ISYSTEM_STDDEF_H_
#define LIBC_ISYSTEM_STDDEF_H_
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_STDINT_H_
#define LIBC_ISYSTEM_STDINT_H_
#include "libc/literal.h"
#endif

6
libc/isystem/stdio.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef LIBC_ISYSTEM_STDIO_H_
#define LIBC_ISYSTEM_STDIO_H_
#include "libc/fmt/fmt.h"
#include "libc/log/log.h"
#include "libc/stdio/stdio.h"
#endif

9
libc/isystem/stdlib.h Normal file
View file

@ -0,0 +1,9 @@
#ifndef LIBC_ISYSTEM_STDLIB_H_
#define LIBC_ISYSTEM_STDLIB_H_
#include "libc/conv/conv.h"
#include "libc/mem/mem.h"
#include "libc/rand/rand.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/temp.h"
#include "libc/sysv/consts/exit.h"
#endif

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

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

5
libc/isystem/sys/auxv.h Normal file
View file

@ -0,0 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_AUXV_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_AUXV_H_
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/auxv.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_AUXV_H_ */

6
libc/isystem/sys/ioctl.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef LIBC_ISYSTEM_SYS_IOCTL_H_
#define LIBC_ISYSTEM_SYS_IOCTL_H_
#include "libc/calls/calls.h"
#include "libc/sysv/consts/blk.h"
#include "libc/sysv/consts/fd.h"
#endif

6
libc/isystem/sys/mman.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef LIBC_ISYSTEM_SYS_MMAN_H_
#define LIBC_ISYSTEM_SYS_MMAN_H_
#include "libc/calls/calls.h"
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/mremap.h"
#endif

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

View file

@ -0,0 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_RANDOM_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_RANDOM_H_
#include "libc/rand/rand.h"
#include "libc/sysv/consts/grnd.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_RANDOM_H_ */

View file

@ -0,0 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_RESOURCE_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_RESOURCE_H_
#include "libc/calls/calls.h"
#endif

View file

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_SYS_SOCKET_H_
#define LIBC_ISYSTEM_SYS_SOCKET_H_
#include "libc/sock/sock.h"
#endif

5
libc/isystem/sys/stat.h Normal file
View file

@ -0,0 +1,5 @@
#ifndef LIBC_ISYSTEM_SYS_STAT_H_
#define LIBC_ISYSTEM_SYS_STAT_H_
#include "libc/calls/calls.h"
#include "libc/sysv/consts/s.h"
#endif

View file

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_SYS_SYSINFO_H_
#define LIBC_ISYSTEM_SYS_SYSINFO_H_
#include "libc/calls/calls.h"
#endif

6
libc/isystem/sys/time.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef LIBC_ISYSTEM_SYS_TIME_H_
#define LIBC_ISYSTEM_SYS_TIME_H_
#include "libc/sysv/consts/clock.h"
#include "libc/sysv/consts/itimer.h"
#include "libc/time/time.h"
#endif

4
libc/isystem/sys/types.h Normal file
View file

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_SYS_TYPES_H_
#define LIBC_ISYSTEM_SYS_TYPES_H_
#include "libc/calls/weirdtypes.h"
#endif

4
libc/isystem/sys/uio.h Normal file
View file

@ -0,0 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_SYS_UIO_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_SYS_UIO_H_
#include "libc/calls/calls.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_SYS_UIO_H_ */

View file

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_SYS_UTSNAME_H_
#define LIBC_ISYSTEM_SYS_UTSNAME_H_
#include "libc/calls/calls.h"
#endif

5
libc/isystem/sys/wait.h Normal file
View file

@ -0,0 +1,5 @@
#ifndef LIBC_ISYSTEM_SYS_WAIT_H_
#define LIBC_ISYSTEM_SYS_WAIT_H_
#include "libc/calls/calls.h"
#include "libc/sysv/consts/w.h"
#endif

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

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

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_TGMATH_H_
#define LIBC_ISYSTEM_TGMATH_H_
#include "libc/math/tgmath.h"
#endif

0
libc/isystem/thread.h Normal file
View file

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

@ -0,0 +1,5 @@
#ifndef LIBC_ISYSTEM_TIME_H_
#define LIBC_ISYSTEM_TIME_H_
#include "libc/sysv/consts/sched.h"
#include "libc/time/time.h"
#endif

8
libc/isystem/unistd.h Normal file
View file

@ -0,0 +1,8 @@
#ifndef LIBC_ISYSTEM_UNISTD_H_
#define LIBC_ISYSTEM_UNISTD_H_
#include "libc/calls/openbsd.h"
#include "libc/calls/calls.h"
#include "libc/calls/weirdtypes.h"
#include "libc/sysv/consts/fileno.h"
#include "libc/sysv/consts/o.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_UTIME_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_UTIME_H_
#include "libc/time/utime.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_UTIME_H_ */

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_WCHAR_H_
#define LIBC_ISYSTEM_WCHAR_H_
#include "libc/str/str.h"
#endif

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

@ -0,0 +1,4 @@
#ifndef LIBC_ISYSTEM_WCTYPE_H_
#define LIBC_ISYSTEM_WCTYPE_H_
#include "libc/str/str.h"
#endif

1465
libc/isystem/windows.h Normal file

File diff suppressed because it is too large Load diff

10
libc/isystem/winternl.h Normal file
View file

@ -0,0 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_WINTERNL_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_WINTERNL_H_
#include <Windows.h>
#include "libc/nt/struct/ldr.h"
#include "libc/nt/ntdll.h"
#include "libc/nt/struct/peb.h"
#include "libc/nt/struct/teb.h"
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_WINTERNL_H_ */