pslstubs.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. /*
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. %
  4. % File: pslstubs.c
  5. % Description: Code to help with portability across operating systems
  6. % Author: Arthur Norman
  7. % Created: February 2018
  8. % Mode: Text
  9. % Status: Open Source: BSD License
  10. %
  11. % (c) Copyright 2018 A C Norman.
  12. %
  13. % Redistribution and use in source and binary forms, with or without
  14. % modification, are permitted provided that the following conditions are met:
  15. %
  16. % * Redistributions of source code must retain the relevant copyright
  17. % notice, this list of conditions and the following disclaimer.
  18. % * Redistributions in binary form must reproduce the above copyright
  19. % notice, this list of conditions and the following disclaimer in the
  20. % documentation and/or other materials provided with the distribution.
  21. %
  22. % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  24. % THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  25. % PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR
  26. % CONTRIBUTORS
  27. % BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  30. % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  31. % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  32. % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. % POSSIBILITY OF SUCH DAMAGE.
  34. %
  35. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  36. */
  37. #include "psl.h"
  38. #ifdef __CYGWIN__
  39. #include <windows.h>
  40. /* This is expected to be rather similar to the Linux case.
  41. */
  42. int _get_registry_value(const char *a, const char *b, const char *c, char *d)
  43. { TR1("getregistryvalue");
  44. return 1;
  45. // return getregistryvalue(a, b, c, d);
  46. }
  47. int profil()
  48. { TR1("profil");
  49. return 0;
  50. }
  51. int sigrelse(int s)
  52. { TR1("sigrelse");
  53. return 0;
  54. }
  55. int pthread_getconcurrency()
  56. { TR1("pthread_getconcurrency");
  57. return 0;
  58. }
  59. int pthread_yield()
  60. { TR1("pthread_yield");
  61. return 0;
  62. }
  63. typedef void *cpu_set_t;
  64. int pthread_setaffinity_np()
  65. { TR1("pthread_setaffinity");
  66. return 0;
  67. }
  68. int pthread_getaffinity_np()
  69. { TR1("pthread_getaffinity");
  70. return 0;
  71. }
  72. int pthread_rwlockattr_getkind_np()
  73. { TR1("pthread_rwlockattr_getkind");
  74. return 0;
  75. }
  76. int pthread_rwlockattr_setkind_np()
  77. { TR1("pthread_rwlockatr_setkind");
  78. return 0;
  79. }
  80. /*
  81. * And now pretend to be Linux!
  82. */
  83. #define __linux__
  84. #endif // __CYGWIN__
  85. #ifdef __clang__
  86. /* Foe the Macintosh.
  87. */
  88. int profil()
  89. { TR1("profil");
  90. return 0;
  91. }
  92. int pthread_yield()
  93. { TR1("pthread_yield");
  94. return 0;
  95. }
  96. int pthread_setaffinity_np()
  97. { TR1("pthraed_setaffinity");
  98. return 0;
  99. }
  100. int pthread_getaffinity_np()
  101. { TR1("pthread_getaffinity");
  102. return 0;
  103. }
  104. int pthread_rwlockattr_getkind_np()
  105. { TR1("pthraed_rwlockattr_getkind");
  106. return 0;
  107. }
  108. int pthread_rwlockattr_setkind_np()
  109. { TR1("pthread_rwlockattr_setkind");
  110. return 0;
  111. }
  112. int pthread_setschedprio()
  113. { TR1("pthread_setschedprio");
  114. return 0;
  115. }
  116. #include <stdio.h>
  117. FILE *unixstdin, *unixstdout, *unixstderr, *unixtty;
  118. int64_t unixnull[2], unixeof[2];
  119. #endif // __clang__
  120. #ifdef __linux__
  121. /* You might have expected the Linux support to be the easiest one. However
  122. * in seeking portability of everything I have ended up needing to provide
  123. * stubs here the link from calls to names with underscores on them to
  124. * calls without! This may not end up being essential, but I observe that
  125. * already there are a fair number of system functions that are called
  126. * via trivial interface code of this sort (eg all the elementary functions)
  127. * so this does not breach the spirit of the PSL implementation too
  128. * badly.
  129. *
  130. * Furthermore the little functions here will generally compile into just
  131. * a simple jump instructions:
  132. * _foo: jmp foo@PLT
  133. * and if the target concerned ends up reasonably close that will end up
  134. * as a pc-relative jump - while if it is seriously remote it will be a
  135. * jump via a memory location that contains the long address. This is not
  136. * a severe burden in any case, because the functions that are called will
  137. * do enough that their costs swamp that of the extra jump.
  138. */
  139. #include <stdio.h>
  140. /*
  141. * I have to define the following - at least on some platforms - to get
  142. * functions defined in header files. These are often obsolete or non-standard
  143. * names that are used and it may be a good idea to review the code and
  144. * arrange that mess like this is not required.
  145. */
  146. /* sigrelse seems to need XOPEN_EXTENDED, and the man page says that it is
  147. * only provided for programs that make use of the historical System V signal
  148. * API, and that new applications should use the POSIX versions (ie sigaction
  149. * and friends).
  150. */
  151. #define __USE_XOPEN_EXTENDED 1
  152. #define __USE_UNIX98 1
  153. /* pthread_setaffinity is for GNU */
  154. #define __USE_GNU 1
  155. #include <signal.h>
  156. #include <sys/types.h>
  157. #include <unistd.h>
  158. #include <wait.h>
  159. #include <pthread.h>
  160. #include <time.h>
  161. #include <sys/ipc.h>
  162. #include <sys/shm.h>
  163. #include <sys/sem.h>
  164. #include <dlfcn.h>
  165. /* sigrelse is obsolete - use sigaction etc instead... */
  166. int _sigrelse(int s)
  167. { TR1("sigrelse");
  168. return sigrelse(s);
  169. }
  170. char *_ctime(const time_t *t)
  171. { TR1("ctime");
  172. return ctime(t);
  173. }
  174. FILE *_fopen(const char *name, const char *mode)
  175. { TR1("fopen");
  176. return fopen(name, mode);
  177. }
  178. int _fclose(FILE *s)
  179. { TR1("fclose");
  180. return fclose(s);
  181. }
  182. size_t _fread(void *p, size_t n, size_t m, FILE *s)
  183. { TR1("fread");
  184. fprintf(stderr, "fread(%p, %d, %d, %p)", p, (int)n, (int)m, s);
  185. fflush(stderr);
  186. size_t r = fread(p, n, m, s);
  187. fprintf(stderr, " = %d\n", (int)r);
  188. return r;
  189. }
  190. int _fputc(int c, FILE *s)
  191. { TR1("fputc");
  192. return putc(c, s);
  193. }
  194. int _fgetc(FILE *s)
  195. { TR1("fgetc");
  196. return getc(s);
  197. }
  198. char *_fgets(char *s, int n, FILE *f)
  199. { TR1("fgets");
  200. return fgets(s, n, f);
  201. }
  202. size_t _fwrite(void *p, size_t n, size_t m, FILE *s)
  203. { TR1("fwrite");
  204. return fwrite(p, n, m, s);
  205. }
  206. int _fflush(FILE *f)
  207. { TR1("fflush");
  208. return fflush(f);
  209. }
  210. int _fseek(FILE *s, long o, int w)
  211. { TR1("fseek");
  212. return fseek(s, o, w);
  213. }
  214. void _clearerr(FILE *s)
  215. { TR1("clearerr");
  216. clearerr(s);
  217. }
  218. int _putw(int w, FILE *s)
  219. { TR1("putw");
  220. return putw(w, s);
  221. }
  222. /*
  223. * Sometimes signal is defined using a type sighandler_t, but the
  224. * typedef is given different names on Linux, BSD and Cygwin, so I write
  225. * out the underlying type directly here. The function signal is perhaps now
  226. * obsolete with sighandler now preferred.
  227. */
  228. void (*_signal(int s, void (*h)(int)))(int)
  229. { TR1("signal");
  230. return signal(s, h);
  231. }
  232. unsigned int _sleep(unsigned int n)
  233. { TR1("sleep");
  234. return sleep(n);
  235. }
  236. void _setlinebuf(FILE *s)
  237. { TR1("setlinebuf");
  238. setlinebuf(s);
  239. }
  240. pid_t _getpid()
  241. { TR1("getpid");
  242. return getpid();
  243. }
  244. long _gethostid()
  245. { TR1("gethostid");
  246. return gethostid();
  247. }
  248. pid_t _fork()
  249. { TR1("fork");
  250. return fork();
  251. }
  252. pid_t _wait(int *w)
  253. { TR1("wait");
  254. return wait(w);
  255. }
  256. FILE *_popen(const char *s, const char *t)
  257. { TR1("popen");
  258. return popen(s, t);
  259. }
  260. int _pclose(FILE *s)
  261. { TR1("pclose");
  262. return pclose(s);
  263. }
  264. int _shmctl(int id, int c, struct shmid_ds *d)
  265. { TR1("shmctl");
  266. return shmctl(id, c, d);
  267. }
  268. int _shmget(key_t k, size_t n, int f)
  269. { TR1("shmget");
  270. return shmget(k, n, f);
  271. }
  272. void *_shmat(int id, const void *ad, int f)
  273. { TR1("shmat");
  274. return shmat(id, ad, f);
  275. }
  276. int _shmdt(const void *ad)
  277. { TR1("shmdt");
  278. return shmdt(ad);
  279. }
  280. int _semctl(int id, int num, int cmd, ...)
  281. { TR1("semctl");
  282. return semctl(id, num, cmd); /* Extra arg not supported here yet */
  283. }
  284. int _semget(key_t k, int n, int f)
  285. { TR1("semget");
  286. return semget(k, n, f);
  287. }
  288. int _semop(int id, struct sembuf *b, size_t n)
  289. { TR1("semop");
  290. return semop(id, b, n);
  291. }
  292. void *_dlopen(const char *name, int f)
  293. { TR1("dlopen");
  294. return dlopen(name, f);
  295. }
  296. char *_dlerror()
  297. { TR1("dlerror");
  298. return dlerror();
  299. }
  300. void *_dlsym(void *h, const char *s)
  301. { TR1("dlsym");
  302. return dlsym(h, s);
  303. }
  304. int _dlclose(void *h)
  305. { TR1("dlclose");
  306. return dlclose(h);
  307. }
  308. int _profil(unsigned short *b, size_t n, size_t o, unsigned int s)
  309. { TR1("profil");
  310. return profil(b, n, o, s);
  311. }
  312. int _pthread_create(pthread_t *newthr, pthread_attr_t *attrs,
  313. void *(*startup)(void *), void *arg)
  314. { TR1("pthread_create");
  315. return pthread_create(newthr, attrs, startup, arg);
  316. }
  317. void _pthread_exit(void *retval)
  318. { TR1("pthread_x");
  319. pthread_exit(retval);
  320. }
  321. int _pthread_join(pthread_t thr, void **ret)
  322. { TR1("pthread_x");
  323. return pthread_join(thr, ret);
  324. }
  325. int _pthread_detach(pthread_t thr)
  326. { TR1("pthread_x");
  327. return pthread_detach(thr);
  328. }
  329. pthread_t _pthread_self()
  330. { TR1("pthread_x");
  331. return pthread_self();
  332. }
  333. int _pthread_equal(pthread_t t1, pthread_t t2)
  334. { TR1("pthread_x");
  335. return pthread_equal(t1, t2);
  336. }
  337. int _pthread_attr_init(pthread_attr_t *atts)
  338. { TR1("pthread_x");
  339. return pthread_attr_init(atts);
  340. }
  341. int _pthread_attr_destroy(pthread_attr_t *atts)
  342. { TR1("pthread_x");
  343. return pthread_attr_destroy(atts);
  344. }
  345. int _pthread_attr_setdetachstate(pthread_attr_t *atts, int det)
  346. { TR1("pthread_x");
  347. return pthread_attr_setdetachstate(atts, det);
  348. }
  349. int _pthread_attr_getguardsize(const pthread_attr_t *atts, size_t *gs)
  350. { TR1("pthread_x");
  351. return pthread_attr_getguardsize(atts, gs);
  352. }
  353. int _pthread_attr_setguardsize(pthread_attr_t *atts, size_t gs)
  354. { TR1("pthread_x");
  355. return pthread_attr_setguardsize(atts, gs);
  356. }
  357. int _pthread_attr_getschedparam(const pthread_attr_t *atts, struct sched_param *ss)
  358. { TR1("pthread_x");
  359. return pthread_attr_getschedparam(atts, ss);
  360. }
  361. int _pthread_attr_setschedparam(pthread_attr_t *atts, const struct sched_param *ss)
  362. { TR1("pthread_x");
  363. return pthread_attr_setschedparam(atts, ss);
  364. }
  365. int _pthread_attr_getschedpolicy(const pthread_attr_t *atts, int *rp)
  366. { TR1("pthread_x");
  367. return pthread_attr_getschedpolicy(atts, rp);
  368. }
  369. int _pthread_attr_setschedpolicy(pthread_attr_t *atts, int rp)
  370. { TR1("pthread_x");
  371. return pthread_attr_setschedpolicy(atts, rp);
  372. }
  373. int _pthread_attr_getinheritsched(const pthread_attr_t *atts, int *ri)
  374. { TR1("pthread_x");
  375. return pthread_attr_getinheritsched(atts, ri);
  376. }
  377. int _pthread_attr_setinheritsched(pthread_attr_t *atts, int ri)
  378. { TR1("pthread_x");
  379. return pthread_attr_setinheritsched(atts, ri);
  380. }
  381. int _pthread_attr_getscope(const pthread_attr_t *atts, int *rs)
  382. { TR1("pthread_x");
  383. return pthread_attr_getscope(atts, rs);
  384. }
  385. int _pthread_attr_setscope(pthread_attr_t *atts, int rs)
  386. { TR1("pthread_x");
  387. return pthread_attr_setscope(atts, rs);
  388. }
  389. int _pthread_attr_getstack(pthread_attr_t *attr, void **a, size_t *s)
  390. { TR1("pthread_x");
  391. return pthread_attr_getstack(attr, a, s);
  392. }
  393. int _pthread_attr_setstack(pthread_attr_t *attr, void *a, size_t s)
  394. { TR1("pthread_x");
  395. return pthread_attr_setstack(attr, a, s);
  396. }
  397. int _pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *s)
  398. { TR1("pthread_x");
  399. return pthread_attr_getstacksize(attr, s);
  400. }
  401. int _pthread_attr_setstacksize(pthread_attr_t *attr, size_t s)
  402. { TR1("pthread_x");
  403. return pthread_attr_setstacksize(attr, s);
  404. }
  405. int _pthread_setschedparam(pthread_t t, int pol, const struct sched_param *p)
  406. { TR1("pthread_x");
  407. return pthread_setschedparam(t, pol, p);
  408. }
  409. int _pthread_getschedparam(pthread_t t, int *pol, struct sched_param *p)
  410. { TR1("pthread_x");
  411. return pthread_getschedparam(t, pol, p);
  412. }
  413. int _pthread_setschedprio(pthread_t t, int p)
  414. { TR1("pthread_x");
  415. return pthread_setschedprio(t, p);
  416. }
  417. int _pthread_getconcurrency()
  418. { TR1("pthread_x");
  419. return pthread_getconcurrency();
  420. }
  421. int _pthread_yield()
  422. { TR1("pthread_x");
  423. return pthread_yield();
  424. }
  425. int _pthread_setaffinity_np(pthread_t t, size_t n, const cpu_set_t *c)
  426. { TR1("pthread_x");
  427. return pthread_setaffinity_np(t, n, c);
  428. }
  429. int _pthread_getaffinity_np(pthread_t t, size_t n, cpu_set_t *c)
  430. { TR1("pthread_x");
  431. return pthread_getaffinity_np(t, n, c);
  432. }
  433. int _pthread_once(pthread_once_t *t, void (*i)())
  434. { TR1("pthread_x");
  435. return pthread_once(t, i);
  436. }
  437. int _pthread_setcancelstate(int s, int *o)
  438. { TR1("pthread_x");
  439. return pthread_setcancelstate(s, o);
  440. }
  441. int _pthread_setcanceltype(int t, int *o)
  442. { TR1("pthread_x");
  443. return pthread_setcanceltype(t, o);
  444. }
  445. int _pthread_cancel(pthread_t t)
  446. { TR1("pthread_x");
  447. return pthread_cancel(t);
  448. }
  449. void _pthread_testcancel()
  450. { TR1("pthread_x");
  451. pthread_testcancel();
  452. }
  453. int _pthread_mutex_init(pthread_mutex_t *m, const pthread_mutexattr_t *a)
  454. { TR1("pthread_x");
  455. return pthread_mutex_init(m, a);
  456. }
  457. int _pthread_mutex_destroy(pthread_mutex_t *m)
  458. { TR1("pthread_x");
  459. return pthread_mutex_destroy(m);
  460. }
  461. int _pthread_mutex_trylock(pthread_mutex_t *m)
  462. { TR1("pthread_x");
  463. return pthread_mutex_trylock(m);
  464. }
  465. int _pthread_mutex_lock(pthread_mutex_t *m)
  466. { TR1("pthread_x");
  467. return pthread_mutex_lock(m);
  468. }
  469. int _pthread_mutex_unlock(pthread_mutex_t *m)
  470. { TR1("pthread_x");
  471. return pthread_mutex_unlock(m);
  472. }
  473. int _pthread_mutexattr_init(pthread_mutexattr_t *m)
  474. { TR1("pthread_x");
  475. return pthread_mutexattr_init(m);
  476. }
  477. int _pthread_mutexattr_destroy(pthread_mutexattr_t *a)
  478. { TR1("pthread_x");
  479. return pthread_mutexattr_destroy(a);
  480. }
  481. int _pthread_mutexattr_getpshared(const pthread_mutexattr_t *a, int *p)
  482. { TR1("pthread_x");
  483. return pthread_mutexattr_getpshared(a, p);
  484. }
  485. int _pthread_mutexattr_setpshared(pthread_mutexattr_t *a, int p)
  486. { TR1("pthread_x");
  487. return pthread_mutexattr_setpshared(a, p);
  488. }
  489. int _pthread_rwlock_unlock(pthread_rwlock_t *r)
  490. { TR1("pthread_x");
  491. return pthread_rwlock_unlock(r);
  492. }
  493. int _pthread_rwlockattr_init(pthread_rwlockattr_t *a)
  494. { TR1("pthread_x");
  495. return pthread_rwlockattr_init(a);
  496. }
  497. int _pthread_rwlockattr_destroy(pthread_rwlockattr_t *a)
  498. { TR1("pthread_x");
  499. return pthread_rwlockattr_destroy(a);
  500. }
  501. int _pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *a, int *p)
  502. { TR1("pthread_x");
  503. return pthread_rwlockattr_getpshared(a, p);
  504. }
  505. int _pthread_rwlockattr_setpshared(pthread_rwlockattr_t *a, int p)
  506. { TR1("pthread_x");
  507. return pthread_rwlockattr_setpshared(a, p);
  508. }
  509. int _pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *a, int *p)
  510. { TR1("pthread_x");
  511. return pthread_rwlockattr_getkind_np(a, p);
  512. }
  513. int _pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *a, int p)
  514. { TR1("pthread_x");
  515. return pthread_rwlockattr_setkind_np(a, p);
  516. }
  517. int _pthread_cond_init(pthread_cond_t *c, const pthread_condattr_t *a)
  518. { TR1("pthread_x");
  519. return pthread_cond_init(c, a);
  520. }
  521. int _pthread_cond_destroy(pthread_cond_t *c)
  522. { TR1("pthread_x");
  523. return pthread_cond_destroy(c);
  524. }
  525. int _pthread_cond_signal(pthread_cond_t *c)
  526. { TR1("pthread_x");
  527. return pthread_cond_signal(c);
  528. }
  529. int _pthread_cond_broadcast(pthread_cond_t *c)
  530. { TR1("pthread_x");
  531. return pthread_cond_broadcast(c);
  532. }
  533. int _pthread_cond_wait(pthread_cond_t *c, pthread_mutex_t *m)
  534. { TR1("pthread_x");
  535. return pthread_cond_wait(c, m);
  536. }
  537. int _pthread_cond_timedwait(pthread_cond_t *c, pthread_mutex_t *m, const struct timespec *t)
  538. { TR1("pthread_x");
  539. return pthread_cond_timedwait(c, m, t);
  540. }
  541. int _pthread_condattr_init(pthread_condattr_t *a)
  542. { TR1("pthread_x");
  543. return pthread_condattr_init(a);
  544. }
  545. int _pthread_condattr_destroy(pthread_condattr_t *a)
  546. { TR1("pthread_x");
  547. return pthread_condattr_destroy(a);
  548. }
  549. int _pthread_condattr_getpshared(pthread_condattr_t *a, int *s)
  550. { TR1("pthread_x");
  551. return pthread_condattr_getpshared(a, s);
  552. }
  553. int _pthread_condattr_setpshared(pthread_condattr_t *a, int s)
  554. { TR1("pthread_x");
  555. return pthread_condattr_setpshared(a, s);
  556. }
  557. int _pthread_key_create(pthread_key_t *k, void (*d)(void *))
  558. { TR1("pthread_x");
  559. return pthread_key_create(k, d);
  560. }
  561. int _pthread_key_delete(pthread_key_t k)
  562. { TR1("pthread_x");
  563. return pthread_key_delete(k);
  564. }
  565. void *_pthread_getspecific(pthread_key_t k)
  566. { TR1("pthread_x");
  567. return pthread_getspecific(k);
  568. }
  569. int _pthread_setspecific(pthread_key_t k, const void *p)
  570. { TR1("pthread_x");
  571. return pthread_setspecific(k, p);
  572. }
  573. int _pthread_atfork(void (*prep)(), void (*par)(), void (*chi)())
  574. { TR1("pthread_x");
  575. return pthread_atfork(prep, par, chi);
  576. }
  577. #endif /* __linux__ */
  578. #ifdef __WIN64__
  579. #endif
  580. /* end of pslstubs.c */