move misplaced __fork_handler declaration
[musl.git] / src / internal / libc.h
blob0a279184bb05cff52572af218a6ffe0f0de99e10
1 #ifndef LIBC_H
2 #define LIBC_H
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <limits.h>
8 struct __locale_map;
10 struct __locale_struct {
11 const struct __locale_map *volatile cat[6];
14 struct tls_module {
15 struct tls_module *next;
16 void *image;
17 size_t len, size, align, offset;
20 struct __libc {
21 int can_do_threads;
22 int threaded;
23 int secure;
24 volatile int threads_minus_1;
25 size_t *auxv;
26 struct tls_module *tls_head;
27 size_t tls_size, tls_align, tls_cnt;
28 size_t page_size;
29 struct __locale_struct global_locale;
32 #ifndef PAGE_SIZE
33 #define PAGE_SIZE libc.page_size
34 #endif
36 extern hidden struct __libc __libc;
37 #define libc __libc
39 hidden void __init_libc(char **, char *);
40 hidden void __init_tls(size_t *);
41 hidden void __init_ssp(void *);
42 hidden void __libc_start_init(void);
43 hidden void __funcs_on_exit(void);
44 hidden void __funcs_on_quick_exit(void);
45 hidden void __libc_exit_fini(void);
46 hidden void __fork_handler(int);
48 extern hidden size_t __hwcap;
49 extern hidden size_t __sysinfo;
50 extern char *__progname, *__progname_full;
52 extern hidden const char __libc_version[];
54 /* Designed to avoid any overhead in non-threaded processes */
55 hidden void __lock(volatile int *);
56 hidden void __unlock(volatile int *);
57 #define LOCK(x) __lock(x)
58 #define UNLOCK(x) __unlock(x)
60 hidden void __synccall(void (*)(void *), void *);
61 hidden int __setxid(int, int, int, int);
63 #endif