internals.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. /* Linuxthreads - a simple clone()-based implementation of Posix */
  2. /* threads for Linux. */
  3. /* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */
  4. /* */
  5. /* This program is free software; you can redistribute it and/or */
  6. /* modify it under the terms of the GNU Library General Public License */
  7. /* as published by the Free Software Foundation; either version 2 */
  8. /* of the License, or (at your option) any later version. */
  9. /* */
  10. /* This program is distributed in the hope that it will be useful, */
  11. /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
  12. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
  13. /* GNU Library General Public License for more details. */
  14. #ifndef _INTERNALS_H
  15. #define _INTERNALS_H 1
  16. /* Internal data structures */
  17. /* Includes */
  18. #include <bits/libc-tsd.h> /* for _LIBC_TSD_KEY_N */
  19. #include <limits.h>
  20. #include <setjmp.h>
  21. #include <signal.h>
  22. #include <unistd.h>
  23. #include <sys/types.h>
  24. #include <sys/wait.h>
  25. #include "pt-machine.h"
  26. #include "semaphore.h"
  27. #include "../linuxthreads.old_db/thread_dbP.h"
  28. #ifdef __UCLIBC_HAS_XLOCALE__
  29. #include <bits/uClibc_locale.h>
  30. #endif /* __UCLIBC_HAS_XLOCALE__ */
  31. /* Use a funky version in a probably vein attempt at preventing gdb
  32. * from dlopen()'ing glibc's libthread_db library... */
  33. #define STRINGIFY(s) STRINGIFY2 (s)
  34. #define STRINGIFY2(s) #s
  35. #define VERSION STRINGIFY(__UCLIBC_MAJOR__) "." STRINGIFY(__UCLIBC_MINOR__) "." STRINGIFY(__UCLIBC_SUBLEVEL__)
  36. #ifndef THREAD_GETMEM
  37. # define THREAD_GETMEM(descr, member) descr->member
  38. #endif
  39. #ifndef THREAD_GETMEM_NC
  40. # define THREAD_GETMEM_NC(descr, member) descr->member
  41. #endif
  42. #ifndef THREAD_SETMEM
  43. # define THREAD_SETMEM(descr, member, value) descr->member = (value)
  44. #endif
  45. #ifndef THREAD_SETMEM_NC
  46. # define THREAD_SETMEM_NC(descr, member, value) descr->member = (value)
  47. #endif
  48. /* Arguments passed to thread creation routine */
  49. struct pthread_start_args {
  50. void * (*start_routine)(void *); /* function to run */
  51. void * arg; /* its argument */
  52. sigset_t mask; /* initial signal mask for thread */
  53. int schedpolicy; /* initial scheduling policy (if any) */
  54. struct sched_param schedparam; /* initial scheduling parameters (if any) */
  55. };
  56. /* We keep thread specific data in a special data structure, a two-level
  57. array. The top-level array contains pointers to dynamically allocated
  58. arrays of a certain number of data pointers. So we can implement a
  59. sparse array. Each dynamic second-level array has
  60. PTHREAD_KEY_2NDLEVEL_SIZE
  61. entries. This value shouldn't be too large. */
  62. #define PTHREAD_KEY_2NDLEVEL_SIZE 32
  63. /* We need to address PTHREAD_KEYS_MAX key with PTHREAD_KEY_2NDLEVEL_SIZE
  64. keys in each subarray. */
  65. #define PTHREAD_KEY_1STLEVEL_SIZE \
  66. ((PTHREAD_KEYS_MAX + PTHREAD_KEY_2NDLEVEL_SIZE - 1) \
  67. / PTHREAD_KEY_2NDLEVEL_SIZE)
  68. typedef void (*destr_function)(void *);
  69. struct pthread_key_struct {
  70. int in_use; /* already allocated? */
  71. destr_function destr; /* destruction routine */
  72. };
  73. #define PTHREAD_START_ARGS_INITIALIZER { NULL, NULL, {{0, }}, 0, { 0 } }
  74. /* The type of thread descriptors */
  75. typedef struct _pthread_descr_struct * pthread_descr;
  76. /* Callback interface for removing the thread from waiting on an
  77. object if it is cancelled while waiting or about to wait.
  78. This hold a pointer to the object, and a pointer to a function
  79. which ``extricates'' the thread from its enqueued state.
  80. The function takes two arguments: pointer to the wait object,
  81. and a pointer to the thread. It returns 1 if an extrication
  82. actually occured, and hence the thread must also be signalled.
  83. It returns 0 if the thread had already been extricated. */
  84. typedef struct _pthread_extricate_struct {
  85. void *pu_object;
  86. int (*pu_extricate_func)(void *, pthread_descr);
  87. } pthread_extricate_if;
  88. /* Atomic counter made possible by compare_and_swap */
  89. struct pthread_atomic {
  90. long p_count;
  91. int p_spinlock;
  92. };
  93. /* Context info for read write locks. The pthread_rwlock_info structure
  94. is information about a lock that has been read-locked by the thread
  95. in whose list this structure appears. The pthread_rwlock_context
  96. is embedded in the thread context and contains a pointer to the
  97. head of the list of lock info structures, as well as a count of
  98. read locks that are untracked, because no info structure could be
  99. allocated for them. */
  100. struct _pthread_rwlock_t;
  101. typedef struct _pthread_rwlock_info {
  102. struct _pthread_rwlock_info *pr_next;
  103. struct _pthread_rwlock_t *pr_lock;
  104. int pr_lock_count;
  105. } pthread_readlock_info;
  106. struct _pthread_descr_struct {
  107. pthread_descr p_nextlive, p_prevlive;
  108. /* Double chaining of active threads */
  109. pthread_descr p_nextwaiting; /* Next element in the queue holding the thr */
  110. pthread_descr p_nextlock; /* can be on a queue and waiting on a lock */
  111. pthread_t p_tid; /* Thread identifier */
  112. int p_pid; /* PID of Unix process */
  113. int p_priority; /* Thread priority (== 0 if not realtime) */
  114. struct _pthread_fastlock * p_lock; /* Spinlock for synchronized accesses */
  115. int p_signal; /* last signal received */
  116. sigjmp_buf * p_signal_jmp; /* where to siglongjmp on a signal or NULL */
  117. sigjmp_buf * p_cancel_jmp; /* where to siglongjmp on a cancel or NULL */
  118. char p_terminated; /* true if terminated e.g. by pthread_exit */
  119. char p_detached; /* true if detached */
  120. char p_exited; /* true if the assoc. process terminated */
  121. void * p_retval; /* placeholder for return value */
  122. int p_retcode; /* placeholder for return code */
  123. pthread_descr p_joining; /* thread joining on that thread or NULL */
  124. struct _pthread_cleanup_buffer * p_cleanup; /* cleanup functions */
  125. char p_cancelstate; /* cancellation state */
  126. char p_canceltype; /* cancellation type (deferred/async) */
  127. char p_canceled; /* cancellation request pending */
  128. int * p_errnop; /* pointer to used errno variable */
  129. int p_errno; /* error returned by last system call */
  130. int * p_h_errnop; /* pointer to used h_errno variable */
  131. int p_h_errno; /* error returned by last netdb function */
  132. char * p_in_sighandler; /* stack address of sighandler, or NULL */
  133. char p_sigwaiting; /* true if a sigwait() is in progress */
  134. struct pthread_start_args p_start_args; /* arguments for thread creation */
  135. void ** p_specific[PTHREAD_KEY_1STLEVEL_SIZE]; /* thread-specific data */
  136. void * p_libc_specific[_LIBC_TSD_KEY_N]; /* thread-specific data for libc */
  137. int p_userstack; /* nonzero if the user provided the stack */
  138. void *p_guardaddr; /* address of guard area or NULL */
  139. size_t p_guardsize; /* size of guard area */
  140. pthread_descr p_self; /* Pointer to this structure */
  141. int p_nr; /* Index of descriptor in __pthread_handles */
  142. int p_report_events; /* Nonzero if events must be reported. */
  143. td_eventbuf_t p_eventbuf; /* Data for event. */
  144. struct pthread_atomic p_resume_count; /* number of times restart() was
  145. called on thread */
  146. char p_woken_by_cancel; /* cancellation performed wakeup */
  147. char p_condvar_avail; /* flag if conditional variable became avail */
  148. char p_sem_avail; /* flag if semaphore became available */
  149. pthread_extricate_if *p_extricate; /* See above */
  150. pthread_readlock_info *p_readlock_list; /* List of readlock info structs */
  151. pthread_readlock_info *p_readlock_free; /* Free list of structs */
  152. int p_untracked_readlock_count; /* Readlocks not tracked by list */
  153. /* New elements must be added at the end. */
  154. #ifdef __UCLIBC_HAS_XLOCALE__
  155. __locale_t locale; /* thread-specific locale from uselocale() only! */
  156. #endif /* __UCLIBC_HAS_XLOCALE__ */
  157. } __attribute__ ((aligned(32))); /* We need to align the structure so that
  158. doubles are aligned properly. This is 8
  159. bytes on MIPS and 16 bytes on MIPS64.
  160. 32 bytes might give better cache
  161. utilization. */
  162. /* The type of thread handles. */
  163. typedef struct pthread_handle_struct * pthread_handle;
  164. struct pthread_handle_struct {
  165. struct _pthread_fastlock h_lock; /* Fast lock for sychronized access */
  166. pthread_descr h_descr; /* Thread descriptor or NULL if invalid */
  167. char * h_bottom; /* Lowest address in the stack thread */
  168. };
  169. /* The type of messages sent to the thread manager thread */
  170. struct pthread_request {
  171. pthread_descr req_thread; /* Thread doing the request */
  172. enum { /* Request kind */
  173. REQ_CREATE, REQ_FREE, REQ_PROCESS_EXIT, REQ_MAIN_THREAD_EXIT,
  174. REQ_POST, REQ_DEBUG, REQ_KICK
  175. } req_kind;
  176. union { /* Arguments for request */
  177. struct { /* For REQ_CREATE: */
  178. const pthread_attr_t * attr; /* thread attributes */
  179. void * (*fn)(void *); /* start function */
  180. void * arg; /* argument to start function */
  181. sigset_t mask; /* signal mask */
  182. } create;
  183. struct { /* For REQ_FREE: */
  184. pthread_t thread_id; /* identifier of thread to free */
  185. } free;
  186. struct { /* For REQ_PROCESS_EXIT: */
  187. int code; /* exit status */
  188. } exit;
  189. void * post; /* For REQ_POST: the semaphore */
  190. } req_args;
  191. };
  192. /* Signals used for suspend/restart and for cancellation notification. */
  193. extern int __pthread_sig_restart;
  194. extern int __pthread_sig_cancel;
  195. /* Signal used for interfacing with gdb */
  196. extern int __pthread_sig_debug;
  197. /* Global array of thread handles, used for validating a thread id
  198. and retrieving the corresponding thread descriptor. Also used for
  199. mapping the available stack segments. */
  200. extern struct pthread_handle_struct __pthread_handles[PTHREAD_THREADS_MAX];
  201. /* Descriptor of the initial thread */
  202. extern struct _pthread_descr_struct __pthread_initial_thread;
  203. /* Descriptor of the manager thread */
  204. extern struct _pthread_descr_struct __pthread_manager_thread;
  205. /* Descriptor of the main thread */
  206. extern pthread_descr __pthread_main_thread;
  207. /* Limit between the stack of the initial thread (above) and the
  208. stacks of other threads (below). Aligned on a STACK_SIZE boundary.
  209. Initially 0, meaning that the current thread is (by definition)
  210. the initial thread. */
  211. /* For non-MMU systems also remember to stack top of the initial thread.
  212. * This is adapted when other stacks are malloc'ed since we don't know
  213. * the bounds a-priori. -StS */
  214. extern char *__pthread_initial_thread_bos;
  215. #ifndef __ARCH_HAS_MMU__
  216. extern char *__pthread_initial_thread_tos;
  217. #define NOMMU_INITIAL_THREAD_BOUNDS(tos,bos) \
  218. if ((tos)>=__pthread_initial_thread_bos \
  219. && (bos)<__pthread_initial_thread_tos) \
  220. __pthread_initial_thread_bos = (tos)+1
  221. #else
  222. #define NOMMU_INITIAL_THREAD_BOUNDS(tos,bos) /* empty */
  223. #endif /* __ARCH_HAS_MMU__ */
  224. /* Indicate whether at least one thread has a user-defined stack (if 1),
  225. or all threads have stacks supplied by LinuxThreads (if 0). */
  226. extern int __pthread_nonstandard_stacks;
  227. /* File descriptor for sending requests to the thread manager.
  228. Initially -1, meaning that __pthread_initialize_manager must be called. */
  229. extern int __pthread_manager_request;
  230. /* Other end of the pipe for sending requests to the thread manager. */
  231. extern int __pthread_manager_reader;
  232. /* Limits of the thread manager stack. */
  233. extern char *__pthread_manager_thread_bos;
  234. extern char *__pthread_manager_thread_tos;
  235. /* Pending request for a process-wide exit */
  236. extern int __pthread_exit_requested, __pthread_exit_code;
  237. /* Set to 1 by gdb if we're debugging */
  238. extern volatile int __pthread_threads_debug;
  239. /* Globally enabled events. */
  240. extern volatile td_thr_events_t __pthread_threads_events;
  241. /* Pointer to descriptor of thread with last event. */
  242. extern volatile pthread_descr __pthread_last_event;
  243. /* Return the handle corresponding to a thread id */
  244. static inline pthread_handle thread_handle(pthread_t id)
  245. {
  246. return &__pthread_handles[id % PTHREAD_THREADS_MAX];
  247. }
  248. /* Validate a thread handle. Must have acquired h->h_spinlock before. */
  249. static inline int invalid_handle(pthread_handle h, pthread_t id)
  250. {
  251. return h->h_descr == NULL || h->h_descr->p_tid != id;
  252. }
  253. /* Fill in defaults left unspecified by pt-machine.h. */
  254. /* The page size we can get from the system. This should likely not be
  255. changed by the machine file but, you never know. */
  256. extern size_t __pagesize;
  257. #include <bits/uClibc_page.h>
  258. #ifndef PAGE_SIZE
  259. #define PAGE_SIZE (sysconf (_SC_PAGESIZE))
  260. #endif
  261. /* The max size of the thread stack segments. If the default
  262. THREAD_SELF implementation is used, this must be a power of two and
  263. a multiple of PAGE_SIZE. */
  264. #ifndef STACK_SIZE
  265. #ifdef __ARCH_HAS_MMU__
  266. #define STACK_SIZE (2 * 1024 * 1024)
  267. #else
  268. #define STACK_SIZE (4 * __pagesize)
  269. #endif
  270. #endif
  271. /* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */
  272. #ifndef INITIAL_STACK_SIZE
  273. #define INITIAL_STACK_SIZE (4 * __pagesize)
  274. #endif
  275. /* Size of the thread manager stack. The "- 32" avoids wasting space
  276. with some malloc() implementations. */
  277. #ifndef THREAD_MANAGER_STACK_SIZE
  278. #define THREAD_MANAGER_STACK_SIZE (2 * __pagesize - 32)
  279. #endif
  280. /* The base of the "array" of thread stacks. The array will grow down from
  281. here. Defaults to the calculated bottom of the initial application
  282. stack. */
  283. #ifndef THREAD_STACK_START_ADDRESS
  284. #define THREAD_STACK_START_ADDRESS __pthread_initial_thread_bos
  285. #endif
  286. /* Get some notion of the current stack. Need not be exactly the top
  287. of the stack, just something somewhere in the current frame. */
  288. #ifndef CURRENT_STACK_FRAME
  289. #define CURRENT_STACK_FRAME ({ char __csf; &__csf; })
  290. #endif
  291. /* If MEMORY_BARRIER isn't defined in pt-machine.h, assume the
  292. architecture doesn't need a memory barrier instruction (e.g. Intel
  293. x86). Still we need the compiler to respect the barrier and emit
  294. all outstanding operations which modify memory. Some architectures
  295. distinguish between full, read and write barriers. */
  296. #ifndef MEMORY_BARRIER
  297. #define MEMORY_BARRIER() __asm__ ("" : : : "memory")
  298. #endif
  299. #ifndef READ_MEMORY_BARRIER
  300. #define READ_MEMORY_BARRIER() MEMORY_BARRIER()
  301. #endif
  302. #ifndef WRITE_MEMORY_BARRIER
  303. #define WRITE_MEMORY_BARRIER() MEMORY_BARRIER()
  304. #endif
  305. /* Recover thread descriptor for the current thread */
  306. extern pthread_descr __pthread_find_self (void) __attribute__ ((const));
  307. static inline pthread_descr thread_self (void) __attribute__ ((const));
  308. static inline pthread_descr thread_self (void)
  309. {
  310. #ifdef THREAD_SELF
  311. return THREAD_SELF;
  312. #else
  313. char *sp = CURRENT_STACK_FRAME;
  314. #ifdef __ARCH_HAS_MMU__
  315. if (sp >= __pthread_initial_thread_bos)
  316. return &__pthread_initial_thread;
  317. else if (sp >= __pthread_manager_thread_bos
  318. && sp < __pthread_manager_thread_tos)
  319. return &__pthread_manager_thread;
  320. else if (__pthread_nonstandard_stacks)
  321. return __pthread_find_self();
  322. else
  323. return (pthread_descr)(((unsigned long)sp | (STACK_SIZE-1))+1) - 1;
  324. #else
  325. /* For non-MMU we need to be more careful about the initial thread stack.
  326. * We refine the initial thread stack bounds dynamically as we allocate
  327. * the other stack frame such that it doesn't overlap with them. Then
  328. * we can be sure to pick the right thread according to the current SP */
  329. /* Since we allow other stack frames to be above or below, we need to
  330. * treat this case special. When pthread_initialize() wasn't called yet,
  331. * only the initial thread is there. */
  332. if (__pthread_initial_thread_bos == NULL) {
  333. return &__pthread_initial_thread;
  334. }
  335. else if (sp >= __pthread_initial_thread_bos
  336. && sp < __pthread_initial_thread_tos) {
  337. return &__pthread_initial_thread;
  338. }
  339. else if (sp >= __pthread_manager_thread_bos
  340. && sp < __pthread_manager_thread_tos) {
  341. return &__pthread_manager_thread;
  342. }
  343. else {
  344. return __pthread_find_self();
  345. }
  346. #endif /* __ARCH_HAS_MMU__ */
  347. #endif
  348. }
  349. /* Max number of times we must spin on a spinlock calling sched_yield().
  350. After MAX_SPIN_COUNT iterations, we put the calling thread to sleep. */
  351. #ifndef MAX_SPIN_COUNT
  352. #define MAX_SPIN_COUNT 50
  353. #endif
  354. /* Duration of sleep (in nanoseconds) when we can't acquire a spinlock
  355. after MAX_SPIN_COUNT iterations of sched_yield().
  356. With the 2.0 and 2.1 kernels, this MUST BE > 2ms.
  357. (Otherwise the kernel does busy-waiting for realtime threads,
  358. giving other threads no chance to run.) */
  359. #ifndef SPIN_SLEEP_DURATION
  360. #define SPIN_SLEEP_DURATION 2000001
  361. #endif
  362. /* Defined and used in libc.so. */
  363. extern int __libc_multiple_threads attribute_hidden;
  364. extern int __librt_multiple_threads;
  365. /* Debugging */
  366. #ifdef DEBUG
  367. #include <assert.h>
  368. #define ASSERT assert
  369. #define MSG __pthread_message
  370. #else
  371. #define ASSERT(x)
  372. #define MSG(msg,arg...)
  373. #endif
  374. /* Internal global functions */
  375. void __pthread_destroy_specifics(void);
  376. void __pthread_perform_cleanup(void);
  377. int __pthread_initialize_manager(void);
  378. void __pthread_message(char * fmt, ...);
  379. int __pthread_manager(void *reqfd);
  380. int __pthread_manager_event(void *reqfd);
  381. void __pthread_manager_sighandler(int sig);
  382. void __pthread_reset_main_thread(void);
  383. void __fresetlockfiles(void);
  384. void __pthread_manager_adjust_prio(int thread_prio);
  385. void __pthread_initialize_minimal (void);
  386. extern void __pthread_exit (void *retval)
  387. #if defined NOT_IN_libc && defined IS_IN_libpthread
  388. attribute_noreturn
  389. #endif
  390. ;
  391. extern int __pthread_attr_setguardsize __P ((pthread_attr_t *__attr,
  392. size_t __guardsize));
  393. extern int __pthread_attr_getguardsize __P ((__const pthread_attr_t *__attr,
  394. size_t *__guardsize));
  395. extern int __pthread_attr_setstackaddr __P ((pthread_attr_t *__attr,
  396. void *__stackaddr));
  397. extern int __pthread_attr_getstackaddr __P ((__const pthread_attr_t *__attr,
  398. void **__stackaddr));
  399. extern int __pthread_attr_setstacksize __P ((pthread_attr_t *__attr,
  400. size_t __stacksize));
  401. extern int __pthread_attr_getstacksize __P ((__const pthread_attr_t *__attr,
  402. size_t *__stacksize));
  403. extern int __pthread_getconcurrency __P ((void));
  404. extern int __pthread_setconcurrency __P ((int __level));
  405. extern void __pthread_kill_other_threads_np __P ((void));
  406. extern void __pthread_restart_old(pthread_descr th);
  407. extern void __pthread_suspend_old(pthread_descr self);
  408. extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime);
  409. extern void __pthread_restart_new(pthread_descr th);
  410. extern void __pthread_suspend_new(pthread_descr self);
  411. extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abstime);
  412. extern void __pthread_wait_for_restart_signal(pthread_descr self);
  413. /* Global pointers to old or new suspend functions */
  414. extern void (*__pthread_restart)(pthread_descr);
  415. extern void (*__pthread_suspend)(pthread_descr);
  416. /* Prototypes for the function without cancelation support when the
  417. normal version has it. */
  418. extern __typeof(close) __libc_close;
  419. extern __typeof(nanosleep) __libc_nanosleep;
  420. extern __typeof(read) __libc_read;
  421. extern __typeof(waitpid) __libc_waitpid;
  422. extern __typeof(write) __libc_write;
  423. extern __typeof(pthread_mutex_init) __pthread_mutex_init attribute_hidden;
  424. extern __typeof(pthread_mutex_destroy) __pthread_mutex_destroy attribute_hidden;
  425. extern __typeof(pthread_mutex_lock) __pthread_mutex_lock attribute_hidden;
  426. extern __typeof(pthread_mutex_trylock) __pthread_mutex_trylock attribute_hidden;
  427. extern __typeof(pthread_mutex_unlock) __pthread_mutex_attribute_hidden;
  428. /* Prototypes for some of the new semaphore functions. */
  429. extern int __new_sem_post (sem_t * sem);
  430. /* TSD. */
  431. extern int __pthread_internal_tsd_set (int key, const void * pointer);
  432. extern void * __pthread_internal_tsd_get (int key);
  433. extern void ** __attribute__ ((__const__))
  434. __pthread_internal_tsd_address (int key);
  435. /* The functions called the signal events. */
  436. extern void __linuxthreads_create_event (void);
  437. extern void __linuxthreads_death_event (void);
  438. extern void __linuxthreads_reap_event (void);
  439. #include <pthread-functions.h>
  440. extern int * __libc_pthread_init (const struct pthread_functions *functions);
  441. #endif /* internals.h */