libc.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 __init_ssp(void *);
  34. hidden void __libc_start_init(void);
  35. hidden void __funcs_on_exit(void);
  36. hidden void __funcs_on_quick_exit(void);
  37. hidden void __libc_exit_fini(void);
  38. extern hidden size_t __hwcap;
  39. extern hidden size_t __sysinfo;
  40. extern char *__progname, *__progname_full;
  41. extern hidden const char __libc_version[];
  42. /* Designed to avoid any overhead in non-threaded processes */
  43. hidden void __lock(volatile int *);
  44. hidden void __unlock(volatile int *);
  45. hidden int __lockfile(FILE *);
  46. hidden void __unlockfile(FILE *);
  47. #define LOCK(x) __lock(x)
  48. #define UNLOCK(x) __unlock(x)
  49. hidden void __synccall(void (*)(void *), void *);
  50. hidden int __setxid(int, int, int, int);
  51. #undef LFS64_2
  52. #define LFS64_2(x, y) weak_alias(x, y)
  53. #undef LFS64
  54. #define LFS64(x) LFS64_2(x, x##64)
  55. #endif