blob: de92468019ecc14d72349f82949552c10b5f4389 [file] [log] [blame]
sewardj3b13f0e2002-04-25 20:17:29 +00001
sewardj439d45e2002-05-03 20:43:10 +00002/*--------------------------------------------------------------------*/
3/*--- Give dummy bindings for everything the real libpthread.so ---*/
4/*--- binds. vg_libpthread_unimp.c ---*/
5/*--------------------------------------------------------------------*/
6
7/*
8 This file is part of Valgrind, an x86 protected-mode emulator
9 designed for debugging and profiling binaries on x86-Unixes.
10
11 Copyright (C) 2000-2002 Julian Seward
12 jseward@acm.org
13
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License as
16 published by the Free Software Foundation; either version 2 of the
17 License, or (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 02111-1307, USA.
28
29 The GNU General Public License is contained in the file LICENSE.
30*/
31
sewardj3b13f0e2002-04-25 20:17:29 +000032/* ---------------------------------------------------------------------
sewardj439d45e2002-05-03 20:43:10 +000033 ALL THIS CODE RUNS ON THE SIMULATED CPU.
sewardj3b13f0e2002-04-25 20:17:29 +000034 Give a binding for everything the real libpthread.so binds.
35 ------------------------------------------------------------------ */
36
37extern void vgPlain_unimp ( char* );
38#define unimp(str) vgPlain_unimp(str)
39
40//void _IO_flockfile ( void ) { unimp("_IO_flockfile"); }
41void _IO_ftrylockfile ( void ) { unimp("_IO_ftrylockfile"); }
42//void _IO_funlockfile ( void ) { unimp("_IO_funlockfile"); }
43//void __close ( void ) { unimp("__close"); }
44//void __connect ( void ) { unimp("__connect"); }
45//void __errno_location ( void ) { unimp("__errno_location"); }
46//void __fcntl ( void ) { unimp("__fcntl"); }
sewardj853f55d2002-04-26 00:27:53 +000047//void __fork ( void ) { unimp("__fork"); }
sewardj3b13f0e2002-04-25 20:17:29 +000048//void __h_errno_location ( void ) { unimp("__h_errno_location"); }
49void __libc_allocate_rtsig ( void ) { unimp("__libc_allocate_rtsig"); }
50void __libc_current_sigrtmax ( void ) { unimp("__libc_current_sigrtmax"); }
51void __libc_current_sigrtmin ( void ) { unimp("__libc_current_sigrtmin"); }
sewardj5905fae2002-04-26 13:25:00 +000052//void __lseek ( void ) { unimp("__lseek"); }
sewardj3b13f0e2002-04-25 20:17:29 +000053//void __open ( void ) { unimp("__open"); }
54//void __open64 ( void ) { unimp("__open64"); }
sewardj726c4122002-05-16 23:39:10 +000055//void __pread64 ( void ) { unimp("__pread64"); }
sewardj853f55d2002-04-26 00:27:53 +000056//void __pthread_atfork ( void ) { unimp("__pthread_atfork"); }
sewardj3b13f0e2002-04-25 20:17:29 +000057//void __pthread_getspecific ( void ) { unimp("__pthread_getspecific"); }
58//void __pthread_key_create ( void ) { unimp("__pthread_key_create"); }
sewardj853f55d2002-04-26 00:27:53 +000059//void __pthread_kill_other_threads_np ( void ) { unimp("__pthread_kill_other_threads_np"); }
sewardj3b13f0e2002-04-25 20:17:29 +000060//void __pthread_mutex_destroy ( void ) { unimp("__pthread_mutex_destroy"); }
61//void __pthread_mutex_init ( void ) { unimp("__pthread_mutex_init"); }
62//void __pthread_mutex_lock ( void ) { unimp("__pthread_mutex_lock"); }
sewardj853f55d2002-04-26 00:27:53 +000063//void __pthread_mutex_trylock ( void ) { unimp("__pthread_mutex_trylock"); }
sewardj3b13f0e2002-04-25 20:17:29 +000064//void __pthread_mutex_unlock ( void ) { unimp("__pthread_mutex_unlock"); }
65//void __pthread_mutexattr_destroy ( void ) { unimp("__pthread_mutexattr_destroy"); }
66//void __pthread_mutexattr_init ( void ) { unimp("__pthread_mutexattr_init"); }
67//void __pthread_mutexattr_settype ( void ) { unimp("__pthread_mutexattr_settype"); }
68//void __pthread_once ( void ) { unimp("__pthread_once"); }
69//void __pthread_setspecific ( void ) { unimp("__pthread_setspecific"); }
sewardja18e2102002-05-18 10:43:22 +000070//void __pwrite64 ( void ) { unimp("__pwrite64"); }
sewardj3b13f0e2002-04-25 20:17:29 +000071//void __read ( void ) { unimp("__read"); }
72//void __res_state ( void ) { unimp("__res_state"); }
sewardj5905fae2002-04-26 13:25:00 +000073//void __send ( void ) { unimp("__send"); }
sewardj3b13f0e2002-04-25 20:17:29 +000074//void __sigaction ( void ) { unimp("__sigaction"); }
sewardj7f6456d2002-05-21 00:51:21 +000075//--//void __vfork ( void ) { unimp("__vfork"); }
sewardj5905fae2002-04-26 13:25:00 +000076//void __wait ( void ) { unimp("__wait"); }
sewardj3b13f0e2002-04-25 20:17:29 +000077//void __write ( void ) { unimp("__write"); }
sewardj60e38422002-05-08 14:08:22 +000078//void _pthread_cleanup_pop ( void ) { unimp("_pthread_cleanup_pop"); }
sewardj3b13f0e2002-04-25 20:17:29 +000079//void _pthread_cleanup_pop_restore ( void ) { unimp("_pthread_cleanup_pop_restore"); }
sewardj60e38422002-05-08 14:08:22 +000080//void _pthread_cleanup_push ( void ) { unimp("_pthread_cleanup_push"); }
sewardj3b13f0e2002-04-25 20:17:29 +000081//void _pthread_cleanup_push_defer ( void ) { unimp("_pthread_cleanup_push_defer"); }
82//void longjmp ( void ) { unimp("longjmp"); }
sewardj853f55d2002-04-26 00:27:53 +000083//void pthread_atfork ( void ) { unimp("pthread_atfork"); }
sewardj3b13f0e2002-04-25 20:17:29 +000084//void pthread_attr_destroy ( void ) { unimp("pthread_attr_destroy"); }
85void pthread_attr_getdetachstate ( void ) { unimp("pthread_attr_getdetachstate"); }
86void pthread_attr_getinheritsched ( void ) { unimp("pthread_attr_getinheritsched"); }
87//void pthread_attr_getschedparam ( void ) { unimp("pthread_attr_getschedparam"); }
88void pthread_attr_getschedpolicy ( void ) { unimp("pthread_attr_getschedpolicy"); }
89void pthread_attr_getscope ( void ) { unimp("pthread_attr_getscope"); }
90
91//void pthread_attr_setdetachstate ( void ) { unimp("pthread_attr_setdetachstate"); }
92//void pthread_attr_setinheritsched ( void ) { unimp("pthread_attr_setinheritsched"); }
93//void pthread_attr_setschedparam ( void ) { unimp("pthread_attr_setschedparam"); }
94void pthread_attr_setschedpolicy ( void ) { unimp("pthread_attr_setschedpolicy"); }
95void pthread_attr_setscope ( void ) { unimp("pthread_attr_setscope"); }
96void pthread_barrier_destroy ( void ) { unimp("pthread_barrier_destroy"); }
97void pthread_barrier_init ( void ) { unimp("pthread_barrier_init"); }
98void pthread_barrier_wait ( void ) { unimp("pthread_barrier_wait"); }
99void pthread_barrierattr_destroy ( void ) { unimp("pthread_barrierattr_destroy"); }
100void pthread_barrierattr_init ( void ) { unimp("pthread_barrierattr_init"); }
101void pthread_barrierattr_setpshared ( void ) { unimp("pthread_barrierattr_setpshared"); }
102//void pthread_cancel ( void ) { unimp("pthread_cancel"); }
103//void pthread_cond_broadcast ( void ) { unimp("pthread_cond_broadcast"); }
104//void pthread_cond_destroy ( void ) { unimp("pthread_cond_destroy"); }
105//void pthread_cond_init ( void ) { unimp("pthread_cond_init"); }
106//void pthread_cond_signal ( void ) { unimp("pthread_cond_signal"); }
107//void pthread_cond_timedwait ( void ) { unimp("pthread_cond_timedwait"); }
108//void pthread_cond_wait ( void ) { unimp("pthread_cond_wait"); }
109//void pthread_condattr_destroy ( void ) { unimp("pthread_condattr_destroy"); }
110void pthread_condattr_getpshared ( void ) { unimp("pthread_condattr_getpshared"); }
111//void pthread_condattr_init ( void ) { unimp("pthread_condattr_init"); }
112void pthread_condattr_setpshared ( void ) { unimp("pthread_condattr_setpshared"); }
sewardj853f55d2002-04-26 00:27:53 +0000113//void pthread_detach ( void ) { unimp("pthread_detach"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000114//void pthread_equal ( void ) { unimp("pthread_equal"); }
115//void pthread_exit ( void ) { unimp("pthread_exit"); }
116void pthread_getattr_np ( void ) { unimp("pthread_getattr_np"); }
117void pthread_getcpuclockid ( void ) { unimp("pthread_getcpuclockid"); }
118//void pthread_getschedparam ( void ) { unimp("pthread_getschedparam"); }
119//void pthread_getspecific ( void ) { unimp("pthread_getspecific"); }
120//void pthread_join ( void ) { unimp("pthread_join"); }
121//void pthread_key_create ( void ) { unimp("pthread_key_create"); }
122//void pthread_key_delete ( void ) { unimp("pthread_key_delete"); }
sewardj018f7622002-05-15 21:13:39 +0000123//void pthread_kill ( void ) { unimp("pthread_kill"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000124//void pthread_mutex_destroy ( void ) { unimp("pthread_mutex_destroy"); }
125//void pthread_mutex_init ( void ) { unimp("pthread_mutex_init"); }
126//void pthread_mutex_lock ( void ) { unimp("pthread_mutex_lock"); }
127void pthread_mutex_timedlock ( void ) { unimp("pthread_mutex_timedlock"); }
128//void pthread_mutex_trylock ( void ) { unimp("pthread_mutex_trylock"); }
129//void pthread_mutex_unlock ( void ) { unimp("pthread_mutex_unlock"); }
130//void pthread_mutexattr_destroy ( void ) { unimp("pthread_mutexattr_destroy"); }
131//void pthread_mutexattr_init ( void ) { unimp("pthread_mutexattr_init"); }
132//void pthread_once ( void ) { unimp("pthread_once"); }
sewardja1ac5cb2002-05-27 13:00:05 +0000133//void pthread_rwlock_destroy ( void ) { unimp("pthread_rwlock_destroy"); }
134//void pthread_rwlock_init ( void ) { unimp("pthread_rwlock_init"); }
sewardj5716dbb2002-04-26 03:28:18 +0000135//void pthread_rwlock_rdlock ( void ) { unimp("pthread_rwlock_rdlock"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000136void pthread_rwlock_timedrdlock ( void ) { unimp("pthread_rwlock_timedrdlock"); }
137void pthread_rwlock_timedwrlock ( void ) { unimp("pthread_rwlock_timedwrlock"); }
sewardja1ac5cb2002-05-27 13:00:05 +0000138//void pthread_rwlock_tryrdlock ( void ) { unimp("pthread_rwlock_tryrdlock"); }
139//void pthread_rwlock_trywrlock ( void ) { unimp("pthread_rwlock_trywrlock"); }
sewardj5716dbb2002-04-26 03:28:18 +0000140//void pthread_rwlock_unlock ( void ) { unimp("pthread_rwlock_unlock"); }
sewardj060b04f2002-04-26 21:01:13 +0000141//void pthread_rwlock_wrlock ( void ) { unimp("pthread_rwlock_wrlock"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000142void pthread_rwlockattr_destroy ( void ) { unimp("pthread_rwlockattr_destroy"); }
143void pthread_rwlockattr_getkind_np ( void ) { unimp("pthread_rwlockattr_getkind_np"); }
144void pthread_rwlockattr_getpshared ( void ) { unimp("pthread_rwlockattr_getpshared"); }
145void pthread_rwlockattr_init ( void ) { unimp("pthread_rwlockattr_init"); }
146void pthread_rwlockattr_setkind_np ( void ) { unimp("pthread_rwlockattr_setkind_np"); }
147void pthread_rwlockattr_setpshared ( void ) { unimp("pthread_rwlockattr_setpshared"); }
148//void pthread_self ( void ) { unimp("pthread_self"); }
sewardj853f55d2002-04-26 00:27:53 +0000149//void pthread_setcancelstate ( void ) { unimp("pthread_setcancelstate"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000150//void pthread_setcanceltype ( void ) { unimp("pthread_setcanceltype"); }
151//void pthread_setschedparam ( void ) { unimp("pthread_setschedparam"); }
152//void pthread_setspecific ( void ) { unimp("pthread_setspecific"); }
sewardjb48e5002002-05-13 00:16:03 +0000153//void pthread_sigmask ( void ) { unimp("pthread_sigmask"); }
sewardj853f55d2002-04-26 00:27:53 +0000154//void pthread_testcancel ( void ) { unimp("pthread_testcancel"); }
sewardj3665ded2002-05-16 16:57:25 +0000155//void raise ( void ) { unimp("raise"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000156void sem_close ( void ) { unimp("sem_close"); }
157void sem_open ( void ) { unimp("sem_open"); }
158void sem_timedwait ( void ) { unimp("sem_timedwait"); }
159void sem_unlink ( void ) { unimp("sem_unlink"); }
160//void sigaction ( void ) { unimp("sigaction"); }
161void siglongjmp ( void ) { unimp("siglongjmp"); }
sewardjb48e5002002-05-13 00:16:03 +0000162//void sigwait ( void ) { unimp("sigwait"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000163
164#if 0
165void pthread_create@@GLIBC_2.1 ( void ) { unimp("pthread_create@@GLIBC_2.1"); }
166void pthread_create@GLIBC_2.0 ( void ) { unimp("pthread_create@GLIBC_2.0"); }
167
168void sem_wait@@GLIBC_2.1 ( void ) { unimp("sem_wait@@GLIBC_2.1"); }
169void sem_wait@GLIBC_2.0 ( void ) { unimp("sem_wait@GLIBC_2.0"); }
170
171void sem_trywait@@GLIBC_2.1 ( void ) { unimp("sem_trywait@@GLIBC_2.1"); }
172void sem_trywait@GLIBC_2.0 ( void ) { unimp("sem_trywait@GLIBC_2.0"); }
173
174void sem_post@@GLIBC_2.1 ( void ) { unimp("sem_post@@GLIBC_2.1"); }
175void sem_post@GLIBC_2.0 ( void ) { unimp("sem_post@GLIBC_2.0"); }
176
177void sem_destroy@@GLIBC_2.1 ( void ) { unimp("sem_destroy@@GLIBC_2.1"); }
178void sem_destroy@GLIBC_2.0 ( void ) { unimp("sem_destroy@GLIBC_2.0"); }
179void sem_getvalue@@GLIBC_2.1 ( void ) { unimp("sem_getvalue@@GLIBC_2.1"); }
180void sem_getvalue@GLIBC_2.0 ( void ) { unimp("sem_getvalue@GLIBC_2.0"); }
181void sem_init@@GLIBC_2.1 ( void ) { unimp("sem_init@@GLIBC_2.1"); }
182void sem_init@GLIBC_2.0 ( void ) { unimp("sem_init@GLIBC_2.0"); }
183
184void pthread_attr_init@@GLIBC_2.1 ( void ) { unimp("pthread_attr_init@@GLIBC_2.1"); }
185void pthread_attr_init@GLIBC_2.0 ( void ) { unimp("pthread_attr_init@GLIBC_2.0"); }
186#endif
sewardj5716dbb2002-04-26 03:28:18 +0000187
sewardj5905fae2002-04-26 13:25:00 +0000188
189
190# define strong_alias(name, aliasname) \
191 extern __typeof (name) aliasname __attribute__ ((alias (#name)));
192
193# define weak_alias(name, aliasname) \
194 extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
195
sewardja1ac5cb2002-05-27 13:00:05 +0000196//weak_alias(pthread_rwlock_destroy, __pthread_rwlock_destroy)
197//weak_alias(pthread_rwlock_init, __pthread_rwlock_init)
198//weak_alias(pthread_rwlock_tryrdlock, __pthread_rwlock_tryrdlock)
199//weak_alias(pthread_rwlock_trywrlock, __pthread_rwlock_trywrlock)
sewardj060b04f2002-04-26 21:01:13 +0000200//weak_alias(pthread_rwlock_wrlock, __pthread_rwlock_wrlock)
sewardj5905fae2002-04-26 13:25:00 +0000201weak_alias(_IO_ftrylockfile, ftrylockfile)
202
sewardj39b93b12002-05-18 10:56:27 +0000203//__attribute__((weak)) void pread ( void ) { vgPlain_unimp("pread"); }
204//__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); }
sewardj67f1d582002-05-24 02:11:32 +0000205//__attribute__((weak)) void msync ( void ) { vgPlain_unimp("msync"); }
sewardj5905fae2002-04-26 13:25:00 +0000206__attribute__((weak)) void pause ( void ) { vgPlain_unimp("pause"); }
207__attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); }
208__attribute__((weak)) void recvmsg ( void ) { vgPlain_unimp("recvmsg"); }
sewardj3665ded2002-05-16 16:57:25 +0000209//__attribute__((weak)) void sendmsg ( void ) { vgPlain_unimp("sendmsg"); }
sewardj5905fae2002-04-26 13:25:00 +0000210__attribute__((weak)) void tcdrain ( void ) { vgPlain_unimp("tcdrain"); }
sewardj7f6456d2002-05-21 00:51:21 +0000211//--//__attribute__((weak)) void vfork ( void ) { vgPlain_unimp("vfork"); }
sewardj436e0582002-04-26 14:31:40 +0000212
213__attribute__((weak)) void pthread_attr_getguardsize ( void )
214 { vgPlain_unimp("pthread_attr_getguardsize"); }
215__attribute__((weak)) void pthread_attr_getstack ( void )
216 { vgPlain_unimp("pthread_attr_getstack"); }
217__attribute__((weak)) void pthread_attr_getstackaddr ( void )
218 { vgPlain_unimp("pthread_attr_getstackaddr"); }
219__attribute__((weak)) void pthread_attr_getstacksize ( void )
220 { vgPlain_unimp("pthread_attr_getstacksize"); }
221__attribute__((weak)) void pthread_attr_setguardsize ( void )
222 { vgPlain_unimp("pthread_attr_setguardsize"); }
223__attribute__((weak)) void pthread_attr_setstack ( void )
224 { vgPlain_unimp("pthread_attr_setstack"); }
225__attribute__((weak)) void pthread_attr_setstackaddr ( void )
226 { vgPlain_unimp("pthread_attr_setstackaddr"); }
sewardj0286dd52002-05-16 20:51:15 +0000227//__attribute__((weak)) void pthread_attr_setstacksize ( void )
228// { vgPlain_unimp("pthread_attr_setstacksize"); }
sewardj436e0582002-04-26 14:31:40 +0000229__attribute__((weak)) void pthread_getconcurrency ( void )
230 { vgPlain_unimp("pthread_getconcurrency"); }
231__attribute__((weak)) void pthread_kill_other_threads_np ( void )
232 { vgPlain_unimp("pthread_kill_other_threads_np"); }
233__attribute__((weak)) void pthread_mutexattr_getkind_np ( void )
234 { vgPlain_unimp("pthread_mutexattr_getkind_np"); }
235__attribute__((weak)) void pthread_mutexattr_getpshared ( void )
236 { vgPlain_unimp("pthread_mutexattr_getpshared"); }
237__attribute__((weak)) void pthread_mutexattr_gettype ( void )
238 { vgPlain_unimp("pthread_mutexattr_gettype"); }
239__attribute__((weak)) void pthread_mutexattr_setkind_np ( void )
240 { vgPlain_unimp("pthread_mutexattr_setkind_np"); }
241__attribute__((weak)) void pthread_mutexattr_setpshared ( void )
242 { vgPlain_unimp("pthread_mutexattr_setpshared"); }
243__attribute__((weak)) void pthread_setconcurrency ( void )
244 { vgPlain_unimp("pthread_setconcurrency"); }
245__attribute__((weak)) void pthread_spin_destroy ( void )
246 { vgPlain_unimp("pthread_spin_destroy"); }
247__attribute__((weak)) void pthread_spin_init ( void )
248 { vgPlain_unimp("pthread_spin_init"); }
249__attribute__((weak)) void pthread_spin_lock ( void )
250 { vgPlain_unimp("pthread_spin_lock"); }
251__attribute__((weak)) void pthread_spin_trylock ( void )
252 { vgPlain_unimp("pthread_spin_trylock"); }
253__attribute__((weak)) void pthread_spin_unlock ( void )
254 { vgPlain_unimp("pthread_spin_unlock"); }
sewardj436e0582002-04-26 14:31:40 +0000255
sewardj439d45e2002-05-03 20:43:10 +0000256
257/*--------------------------------------------------------------------*/
258/*--- end vg_libpthread_unimp.c ---*/
259/*--------------------------------------------------------------------*/