2020-06-15 14:18:57 +00:00
|
|
|
|
#ifndef COSMOPOLITAN_LIBC_RUNTIME_RUNTIME_H_
|
|
|
|
|
#define COSMOPOLITAN_LIBC_RUNTIME_RUNTIME_H_
|
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
/*───────────────────────────────────────────────────────────────────────────│─╗
|
|
|
|
|
│ cosmopolitan § runtime ─╬─│┼
|
|
|
|
|
╚────────────────────────────────────────────────────────────────────────────│*/
|
|
|
|
|
|
2020-12-05 20:20:41 +00:00
|
|
|
|
typedef long jmp_buf[8] forcealign(CACHELINE);
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
2021-02-24 12:00:38 +00:00
|
|
|
|
extern int __argc; /* CRT */
|
|
|
|
|
extern char **__argv; /* CRT */
|
2020-12-05 20:20:41 +00:00
|
|
|
|
extern char **environ; /* CRT */
|
2021-02-24 12:00:38 +00:00
|
|
|
|
extern unsigned long *__auxv; /* CRT */
|
2020-12-05 20:20:41 +00:00
|
|
|
|
extern char *program_invocation_name; /* RII */
|
|
|
|
|
extern char *program_invocation_short_name; /* RII */
|
|
|
|
|
extern uint64_t g_syscount; /* RII */
|
|
|
|
|
extern const uint64_t kStartTsc; /* RII */
|
|
|
|
|
extern const char kTmpPath[]; /* RII */
|
|
|
|
|
extern const char kNtSystemDirectory[]; /* RII */
|
|
|
|
|
extern const char kNtWindowsDirectory[]; /* RII */
|
|
|
|
|
extern unsigned char _base[] forcealign(PAGESIZE); /* αpε */
|
|
|
|
|
extern unsigned char _ehead[] forcealign(PAGESIZE); /* αpε */
|
|
|
|
|
extern unsigned char _etext[] forcealign(PAGESIZE); /* αpε */
|
|
|
|
|
extern unsigned char _edata[] forcealign(PAGESIZE); /* αpε */
|
2021-01-28 03:34:02 +00:00
|
|
|
|
extern unsigned char _end[] forcealign(FRAMESIZE); /* αpε */
|
2020-12-05 20:20:41 +00:00
|
|
|
|
extern unsigned char _ereal; /* αpε */
|
|
|
|
|
extern unsigned char __privileged_start; /* αpε */
|
|
|
|
|
extern unsigned char __test_start; /* αpε */
|
|
|
|
|
extern unsigned char __ro; /* αpε */
|
|
|
|
|
extern unsigned char *__relo_start[]; /* αpε */
|
|
|
|
|
extern unsigned char *__relo_end[]; /* αpε */
|
|
|
|
|
extern uint8_t __zip_start[]; /* αpε */
|
|
|
|
|
extern uint8_t __zip_end[]; /* αpε */
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
|
|
void mcount(void);
|
|
|
|
|
unsigned long getauxval(unsigned long);
|
|
|
|
|
void *mapanon(size_t) vallocesque attributeallocsize((1));
|
|
|
|
|
int setjmp(jmp_buf) libcesque returnstwice paramsnonnull();
|
2020-12-05 20:20:41 +00:00
|
|
|
|
void longjmp(jmp_buf, int) libcesque wontreturn paramsnonnull();
|
2021-03-02 11:27:55 +00:00
|
|
|
|
int _setjmp(jmp_buf) libcesque returnstwice paramsnonnull();
|
|
|
|
|
void _longjmp(jmp_buf, int) libcesque wontreturn paramsnonnull();
|
2020-12-05 20:20:41 +00:00
|
|
|
|
void exit(int) wontreturn;
|
|
|
|
|
void _exit(int) libcesque wontreturn;
|
|
|
|
|
void _Exit(int) libcesque wontreturn;
|
|
|
|
|
void abort(void) wontreturn noinstrument;
|
2020-06-15 14:18:57 +00:00
|
|
|
|
int __cxa_atexit(void *, void *, void *) libcesque;
|
|
|
|
|
int atfork(void *, void *) libcesque;
|
|
|
|
|
int atexit(void (*)(void)) libcesque;
|
|
|
|
|
char *getenv(const char *) paramsnonnull() nosideeffect libcesque;
|
|
|
|
|
int putenv(char *) paramsnonnull();
|
|
|
|
|
int setenv(const char *, const char *, int) paramsnonnull();
|
|
|
|
|
int unsetenv(const char *);
|
|
|
|
|
int clearenv(void);
|
|
|
|
|
void fpreset(void);
|
|
|
|
|
int issetugid(void);
|
2020-09-03 12:44:37 +00:00
|
|
|
|
void *mmap(void *, uint64_t, int32_t, int32_t, int32_t, int64_t);
|
2021-04-18 18:34:59 +00:00
|
|
|
|
void *mremap(void *, size_t, size_t, int, ...);
|
2020-09-03 12:44:37 +00:00
|
|
|
|
int munmap(void *, uint64_t);
|
|
|
|
|
int mprotect(void *, uint64_t, int) privileged;
|
|
|
|
|
int msync(void *, size_t, int);
|
2021-01-28 03:34:02 +00:00
|
|
|
|
void *sbrk(intptr_t);
|
|
|
|
|
int brk(void *);
|
2021-04-02 02:36:37 +00:00
|
|
|
|
long fpathconf(int, int);
|
|
|
|
|
long pathconf(const char *, int);
|
|
|
|
|
int getgroups(int, uint32_t[]);
|
|
|
|
|
long gethostid(void);
|
|
|
|
|
int sethostid(long);
|
|
|
|
|
char *getlogin(void);
|
|
|
|
|
int getlogin_r(char *, size_t);
|
|
|
|
|
int lchown(const char *, uint32_t, uint32_t);
|
|
|
|
|
int getpagesize(void);
|
|
|
|
|
int syncfs(int);
|
|
|
|
|
int vhangup(void);
|
|
|
|
|
int getdtablesize(void);
|
|
|
|
|
int sethostname(const char *, size_t);
|
|
|
|
|
int acct(const char *);
|
2021-03-08 18:56:09 +00:00
|
|
|
|
|
|
|
|
|
bool _isheap(void *);
|
2021-02-03 14:22:51 +00:00
|
|
|
|
int NtGetVersion(void);
|
2021-03-08 18:56:09 +00:00
|
|
|
|
long missingno();
|
|
|
|
|
void __print(const void *, size_t);
|
|
|
|
|
void __print_string(const char *);
|
|
|
|
|
void _loadxmm(void *);
|
|
|
|
|
void _peekall(void);
|
|
|
|
|
void _savexmm(void *);
|
|
|
|
|
void _weakfree(void *);
|
|
|
|
|
void free_s(void *) paramsnonnull() libcesque;
|
|
|
|
|
int close_s(int *) paramsnonnull() libcesque;
|
2021-04-18 18:34:59 +00:00
|
|
|
|
int OpenExecutable(void);
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_RUNTIME_RUNTIME_H_ */
|