weaks.c 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* The weak pthread functions for Linux.
  2. Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with the GNU C Library; see the file COPYING.LIB. If not,
  14. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA. */
  16. #include <errno.h>
  17. #include <limits.h>
  18. #include <stdlib.h>
  19. extern int __pthread_return_0 __P ((void));
  20. extern int __pthread_return_1 __P ((void));
  21. extern void __pthread_return_void __P ((void));
  22. /* NOTE: these require a strong alias in attr.c. I don't think we need this
  23. * versioning stuff with uClibc. -StS
  24. */
  25. /* Those are pthread functions which return 0 if successful. */
  26. //#if defined __HAVE_ELF__ && defined PIC && defined DO_VERSIONING
  27. //weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_0)
  28. //symbol_version (__libc_pthread_attr_init_2_0, pthread_attr_init, GLIBC_2.0);
  29. //weak_alias (__pthread_return_0, __libc_pthread_attr_init_2_1)
  30. //default_symbol_version (__libc_pthread_attr_init_2_1, pthread_attr_init,
  31. // GLIBC_2.1);
  32. //#else
  33. weak_alias (__pthread_return_0, pthread_attr_init)
  34. //#endif
  35. weak_alias (__pthread_return_0, pthread_attr_destroy)
  36. weak_alias (__pthread_return_0, pthread_attr_setdetachstate)
  37. weak_alias (__pthread_return_0, pthread_attr_getdetachstate)
  38. weak_alias (__pthread_return_0, pthread_attr_setschedparam)
  39. weak_alias (__pthread_return_0, pthread_attr_getschedparam)
  40. weak_alias (__pthread_return_0, pthread_attr_setschedpolicy)
  41. weak_alias (__pthread_return_0, pthread_attr_getschedpolicy)
  42. weak_alias (__pthread_return_0, pthread_attr_setinheritsched)
  43. weak_alias (__pthread_return_0, pthread_attr_getinheritsched)
  44. weak_alias (__pthread_return_0, pthread_attr_setscope)
  45. weak_alias (__pthread_return_0, pthread_attr_getscope)
  46. weak_alias (__pthread_return_0, pthread_attr_setstackaddr)
  47. weak_alias (__pthread_return_0, pthread_attr_getstackaddr)
  48. weak_alias (__pthread_return_0, pthread_attr_setstacksize)
  49. weak_alias (__pthread_return_0, pthread_attr_getstacksize)
  50. weak_alias (__pthread_return_0, pthread_mutex_init)
  51. weak_alias (__pthread_return_0, pthread_mutex_destroy)
  52. weak_alias (__pthread_return_0, pthread_mutex_lock)
  53. weak_alias (__pthread_return_0, pthread_mutex_trylock)
  54. weak_alias (__pthread_return_0, pthread_mutex_unlock)
  55. weak_alias (__pthread_return_0, pthread_mutexattr_init)
  56. weak_alias (__pthread_return_0, pthread_mutexattr_destroy)
  57. weak_alias (__pthread_return_0, pthread_mutexattr_settype)
  58. weak_alias (__pthread_return_0, pthread_mutexattr_gettype)
  59. weak_alias (__pthread_return_0, pthread_condattr_init)
  60. weak_alias (__pthread_return_0, pthread_condattr_destroy)
  61. weak_alias (__pthread_return_0, pthread_setschedparam)
  62. weak_alias (__pthread_return_0, pthread_getschedparam)
  63. weak_alias (__pthread_return_0, pthread_getcancelstate)
  64. weak_alias (__pthread_return_0, pthread_setcancelstate)
  65. weak_alias (__pthread_return_0, pthread_setcanceltype)
  66. weak_alias (__pthread_return_0, pthread_setconcurrency)
  67. weak_alias (__pthread_return_0, pthread_getconcurrency)
  68. weak_alias (__pthread_return_0, pthread_self)
  69. weak_alias (__pthread_return_0, pthread_cond_init)
  70. weak_alias (__pthread_return_0, pthread_cond_destroy)
  71. weak_alias (__pthread_return_0, pthread_cond_wait)
  72. weak_alias (__pthread_return_0, pthread_cond_timedwait)
  73. weak_alias (__pthread_return_0, pthread_cond_signal)
  74. weak_alias (__pthread_return_0, pthread_cond_broadcast)
  75. weak_alias (__pthread_return_0, pthread_rwlock_init)
  76. weak_alias (__pthread_return_0, pthread_rwlock_destroy)
  77. weak_alias (__pthread_return_0, pthread_rwlock_rdlock)
  78. weak_alias (__pthread_return_0, pthread_rwlock_wrlock)
  79. weak_alias (__pthread_return_0, pthread_rwlock_tryrdlock)
  80. weak_alias (__pthread_return_0, pthread_rwlock_trywrlock)
  81. weak_alias (__pthread_return_0, pthread_rwlock_unlock)
  82. weak_alias (__pthread_return_0, pthread_rwlockattr_init)
  83. weak_alias (__pthread_return_0, pthread_rwlockattr_destroy)
  84. weak_alias (__pthread_return_0, pthread_rwlockattr_setpshared)
  85. weak_alias (__pthread_return_0, pthread_rwlockattr_getpshared)
  86. /* Those are pthread functions which return 1 if successful. */
  87. weak_alias (__pthread_return_1, pthread_equal)
  88. /* pthread_exit () is a special case. */
  89. void weak_function
  90. pthread_exit (void *retval)
  91. {
  92. exit (EXIT_SUCCESS);
  93. }
  94. int
  95. __pthread_return_0 (void)
  96. {
  97. return 0;
  98. }
  99. int
  100. __pthread_return_1 (void)
  101. {
  102. return 1;
  103. }
  104. void
  105. __pthread_return_void (void)
  106. {
  107. }