1
0

libc.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef LIBC_H
  2. #define LIBC_H
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <limits.h>
  6. struct __locale_map;
  7. struct __locale_struct {
  8. const struct __locale_map *volatile cat[6];
  9. };
  10. struct tls_module {
  11. struct tls_module *next;
  12. void *image;
  13. size_t len, size, align, offset;
  14. };
  15. struct __libc {
  16. int can_do_threads;
  17. int threaded;
  18. int secure;
  19. volatile int threads_minus_1;
  20. size_t *auxv;
  21. struct tls_module *tls_head;
  22. size_t tls_size, tls_align, tls_cnt;
  23. size_t page_size;
  24. struct __locale_struct global_locale;
  25. };
  26. #ifndef PAGE_SIZE
  27. #define PAGE_SIZE libc.page_size
  28. #endif
  29. extern hidden struct __libc __libc;
  30. #define libc __libc
  31. hidden void __init_libc(char **, char *);
  32. hidden void __init_tls(size_t *);
  33. hidden void __libc_start_init(void);
  34. extern hidden size_t __hwcap;
  35. extern hidden size_t __sysinfo;
  36. extern char *__progname, *__progname_full;
  37. extern hidden const char __libc_version[];
  38. /* Designed to avoid any overhead in non-threaded processes */
  39. hidden void __lock(volatile int *);
  40. hidden void __unlock(volatile int *);
  41. hidden int __lockfile(FILE *);
  42. hidden void __unlockfile(FILE *);
  43. #define LOCK(x) __lock(x)
  44. #define UNLOCK(x) __unlock(x)
  45. hidden void __synccall(void (*)(void *), void *);
  46. hidden int __setxid(int, int, int, int);
  47. #undef LFS64_2
  48. #define LFS64_2(x, y) weak_alias(x, y)
  49. #undef LFS64
  50. #define LFS64(x) LFS64_2(x, x##64)
  51. #endif