• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef LIBC_H
2 #define LIBC_H
3 
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <limits.h>
7 #include <link.h>
8 #include <locale.h>
9 
10 struct __locale_map;
11 
12 struct __locale_struct {
13 	const struct __locale_map *cat[LC_ALL];
14 };
15 
16 struct tls_module {
17 	struct tls_module *next;
18 	void *image;
19 	size_t len, size, align, offset;
20 };
21 
22 struct __libc {
23 	char can_do_threads;
24 	char threaded;
25 	char secure;
26 	volatile signed char need_locks;
27 	int threads_minus_1;
28 	size_t *auxv;
29 	struct tls_module *tls_head;
30 	size_t tls_size, tls_align, tls_cnt;
31 	size_t page_size;
32 	struct __locale_struct global_locale;
33 #ifdef ENABLE_HWASAN
34 	void (*load_hook)(unsigned long int base, const Elf64_Phdr* phdr, int phnum);
35 	void (*unload_hook)(unsigned long int base, const Elf64_Phdr* phdr, int phnum);
36 #endif
37 #ifdef __LITEOS_A__
38 	int exit;
39 #endif
40 };
41 
42 #ifndef PAGE_SIZE
43 #define PAGE_SIZE libc.page_size
44 #endif
45 
46 extern hidden struct __libc __libc;
47 #define libc __libc
48 
49 hidden void __init_libc(char **, char *);
50 hidden void __init_tls(size_t *);
51 hidden void __init_ssp(void *);
52 hidden void __libc_start_init(void);
53 hidden void __funcs_on_exit(void);
54 hidden void __funcs_on_quick_exit(void);
55 hidden void __libc_exit_fini(void);
56 hidden void __fork_handler(int);
57 #ifdef __LITEOS_A__
58 hidden void __sig_init(void);
59 hidden void arm_do_signal(int);
60 #endif
61 
62 extern hidden size_t __hwcap;
63 extern hidden size_t __sysinfo;
64 extern char *__progname, *__progname_full;
65 
66 extern hidden const char __libc_version[];
67 
68 hidden void __synccall(void (*)(void *), void *);
69 hidden int __setxid(int, int, int, int);
70 
71 #endif
72