diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-16 17:02:05 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-16 17:02:05 +0100 |
| commit | 90dad97fc07f049383903a166631e2c257f9b8c1 (patch) | |
| tree | 096cd247ecfda9e46598215a4f32aecedeedda90 /lib/libc/internal/include/__stdio.h | |
| parent | 0e832a9329cc4d4647e1ce529846073f21e66991 (diff) | |
Add support for TLS in the libc
Diffstat (limited to 'lib/libc/internal/include/__stdio.h')
| -rw-r--r-- | lib/libc/internal/include/__stdio.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/libc/internal/include/__stdio.h b/lib/libc/internal/include/__stdio.h new file mode 100644 index 00000000..487a0382 --- /dev/null +++ b/lib/libc/internal/include/__stdio.h @@ -0,0 +1,38 @@ +#ifndef __LIBC_STDIO_H__ +#define __LIBC_STDIO_H__ + +#include <stdatomic.h> +#include <stddef.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> + +typedef __SIZE_TYPE__ size_t; + +#define _IO_ERR 0x4 +#define _IO_EOF 0x8 +#define _IO_WIDE 0x10 + +struct __FILE { + int fd; + uint32_t flags; + int type; + pid_t pid; + atomic_flag lock; + char *buf; + int eof; + size_t buf_size; + size_t buf_pos; + size_t buf_len; + unsigned char unget_buf[16]; + size_t unget_cnt; + off_t offset; + struct __FILE *next; +}; + +#define __FILE(__stream) ((struct __FILE *)(__stream)) + +void __libc_fadd(struct __FILE *f); + +#endif |
