mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Add epoll and do more release readiness changes
This change also pays off some of the remaining technical debt with stdio, file descriptors, and memory managemnt polyfills.
This commit is contained in:
parent
a9ea949df8
commit
3e4fd4b0ad
271 changed files with 5706 additions and 1365 deletions
|
@ -18,7 +18,8 @@ typedef struct FILE {
|
|||
uint32_t beg; // 0x10
|
||||
uint32_t end; // 0x14
|
||||
uint8_t *buf; // 0x18
|
||||
size_t size; // 0x20
|
||||
uint32_t size; // 0x20
|
||||
uint32_t nofree; // 0x24
|
||||
int (*reader)(struct FILE *); // 0x28
|
||||
int (*writer)(struct FILE *); // 0x30
|
||||
} FILE;
|
||||
|
@ -99,10 +100,8 @@ int vfscanf(FILE *, const char *, va_list);
|
|||
│ cosmopolitan § standard i/o » optimizations ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
int __getc_moar(FILE *);
|
||||
|
||||
#define putc(c, f) fputc(c, f)
|
||||
#define getc(f) (f->beg + 1 < f->end ? f->buf[f->beg++] : __getc_moar(f))
|
||||
#define getc(f) (f->beg < f->end ? f->buf[f->beg++] : fgetc(f))
|
||||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
#define printf(FMT, ...) (printf)(PFLINK(FMT), ##__VA_ARGS__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue