blob: c39a08bed317d35dd34afb7ffd77392cc4b503b6 [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/*
njnc9539842002-10-02 13:26:35 +00008 This file is part of Valgrind, an extensible x86 protected-mode
9 emulator for monitoring program execution on x86-Unixes.
sewardj439d45e2002-05-03 20:43:10 +000010
nethercotebb1c9912004-01-04 16:43:23 +000011 Copyright (C) 2000-2004 Julian Seward
sewardj439d45e2002-05-03 20:43:10 +000012 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
njn25e49d8e72002-09-23 09:36:25 +000029 The GNU General Public License is contained in the file COPYING.
sewardj439d45e2002-05-03 20:43:10 +000030*/
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
thughes8d001962004-08-15 14:11:12 +000037# define strong_alias(name, aliasname) \
38 extern __typeof (name) aliasname __attribute__ ((alias (#name)));
39
40# define weak_alias(name, aliasname) \
41 extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
42
43# define symbol_version(real, name, version) \
44 __asm__(".symver " #real "," #name "@" #version)
45
46# define default_symbol_version(real, name, version) \
47 __asm__(".symver " #real "," #name "@@" #version)
sewardj08c7f012002-10-07 23:56:55 +000048
sewardj3b13f0e2002-04-25 20:17:29 +000049extern void vgPlain_unimp ( char* );
50#define unimp(str) vgPlain_unimp(str)
51
52//void _IO_flockfile ( void ) { unimp("_IO_flockfile"); }
53void _IO_ftrylockfile ( void ) { unimp("_IO_ftrylockfile"); }
54//void _IO_funlockfile ( void ) { unimp("_IO_funlockfile"); }
55//void __close ( void ) { unimp("__close"); }
56//void __connect ( void ) { unimp("__connect"); }
57//void __errno_location ( void ) { unimp("__errno_location"); }
58//void __fcntl ( void ) { unimp("__fcntl"); }
sewardj853f55d2002-04-26 00:27:53 +000059//void __fork ( void ) { unimp("__fork"); }
sewardj3b13f0e2002-04-25 20:17:29 +000060//void __h_errno_location ( void ) { unimp("__h_errno_location"); }
sewardj262b5be2003-04-26 21:19:53 +000061//void __libc_allocate_rtsig ( void ) { unimp("__libc_allocate_rtsig"); }
62//void __libc_current_sigrtmax ( void ) { unimp("__libc_current_sigrtmax"); }
63//void __libc_current_sigrtmin ( void ) { unimp("__libc_current_sigrtmin"); }
sewardj5905fae2002-04-26 13:25:00 +000064//void __lseek ( void ) { unimp("__lseek"); }
sewardj3b13f0e2002-04-25 20:17:29 +000065//void __open ( void ) { unimp("__open"); }
66//void __open64 ( void ) { unimp("__open64"); }
sewardj726c4122002-05-16 23:39:10 +000067//void __pread64 ( void ) { unimp("__pread64"); }
sewardj853f55d2002-04-26 00:27:53 +000068//void __pthread_atfork ( void ) { unimp("__pthread_atfork"); }
sewardj3b13f0e2002-04-25 20:17:29 +000069//void __pthread_getspecific ( void ) { unimp("__pthread_getspecific"); }
70//void __pthread_key_create ( void ) { unimp("__pthread_key_create"); }
sewardj853f55d2002-04-26 00:27:53 +000071//void __pthread_kill_other_threads_np ( void ) { unimp("__pthread_kill_other_threads_np"); }
sewardj3b13f0e2002-04-25 20:17:29 +000072//void __pthread_mutex_destroy ( void ) { unimp("__pthread_mutex_destroy"); }
73//void __pthread_mutex_init ( void ) { unimp("__pthread_mutex_init"); }
74//void __pthread_mutex_lock ( void ) { unimp("__pthread_mutex_lock"); }
sewardj853f55d2002-04-26 00:27:53 +000075//void __pthread_mutex_trylock ( void ) { unimp("__pthread_mutex_trylock"); }
sewardj3b13f0e2002-04-25 20:17:29 +000076//void __pthread_mutex_unlock ( void ) { unimp("__pthread_mutex_unlock"); }
77//void __pthread_mutexattr_destroy ( void ) { unimp("__pthread_mutexattr_destroy"); }
78//void __pthread_mutexattr_init ( void ) { unimp("__pthread_mutexattr_init"); }
79//void __pthread_mutexattr_settype ( void ) { unimp("__pthread_mutexattr_settype"); }
80//void __pthread_once ( void ) { unimp("__pthread_once"); }
81//void __pthread_setspecific ( void ) { unimp("__pthread_setspecific"); }
sewardja18e2102002-05-18 10:43:22 +000082//void __pwrite64 ( void ) { unimp("__pwrite64"); }
sewardj3b13f0e2002-04-25 20:17:29 +000083//void __read ( void ) { unimp("__read"); }
84//void __res_state ( void ) { unimp("__res_state"); }
sewardj5905fae2002-04-26 13:25:00 +000085//void __send ( void ) { unimp("__send"); }
sewardj3b13f0e2002-04-25 20:17:29 +000086//void __sigaction ( void ) { unimp("__sigaction"); }
sewardj7f6456d2002-05-21 00:51:21 +000087//--//void __vfork ( void ) { unimp("__vfork"); }
sewardj5905fae2002-04-26 13:25:00 +000088//void __wait ( void ) { unimp("__wait"); }
sewardj3b13f0e2002-04-25 20:17:29 +000089//void __write ( void ) { unimp("__write"); }
sewardj60e38422002-05-08 14:08:22 +000090//void _pthread_cleanup_pop ( void ) { unimp("_pthread_cleanup_pop"); }
sewardj3b13f0e2002-04-25 20:17:29 +000091//void _pthread_cleanup_pop_restore ( void ) { unimp("_pthread_cleanup_pop_restore"); }
sewardj60e38422002-05-08 14:08:22 +000092//void _pthread_cleanup_push ( void ) { unimp("_pthread_cleanup_push"); }
sewardj3b13f0e2002-04-25 20:17:29 +000093//void _pthread_cleanup_push_defer ( void ) { unimp("_pthread_cleanup_push_defer"); }
94//void longjmp ( void ) { unimp("longjmp"); }
sewardj853f55d2002-04-26 00:27:53 +000095//void pthread_atfork ( void ) { unimp("pthread_atfork"); }
sewardj3b13f0e2002-04-25 20:17:29 +000096//void pthread_attr_destroy ( void ) { unimp("pthread_attr_destroy"); }
njn25e49d8e72002-09-23 09:36:25 +000097//void pthread_attr_getdetachstate ( void ) { unimp("pthread_attr_getdetachstate"); }
thughes47501812004-10-16 14:24:43 +000098//void pthread_attr_getinheritsched ( void ) { unimp("pthread_attr_getinheritsched"); }
sewardj3b13f0e2002-04-25 20:17:29 +000099//void pthread_attr_getschedparam ( void ) { unimp("pthread_attr_getschedparam"); }
sewardja3be12f2002-06-17 12:19:44 +0000100//void pthread_attr_getschedpolicy ( void ) { unimp("pthread_attr_getschedpolicy"); }
sewardj0d844232002-06-02 09:29:31 +0000101//void pthread_attr_getscope ( void ) { unimp("pthread_attr_getscope"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000102
103//void pthread_attr_setdetachstate ( void ) { unimp("pthread_attr_setdetachstate"); }
104//void pthread_attr_setinheritsched ( void ) { unimp("pthread_attr_setinheritsched"); }
105//void pthread_attr_setschedparam ( void ) { unimp("pthread_attr_setschedparam"); }
sewardja3be12f2002-06-17 12:19:44 +0000106//void pthread_attr_setschedpolicy ( void ) { unimp("pthread_attr_setschedpolicy"); }
sewardj0d844232002-06-02 09:29:31 +0000107//void pthread_attr_setscope ( void ) { unimp("pthread_attr_setscope"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000108void pthread_barrier_destroy ( void ) { unimp("pthread_barrier_destroy"); }
109void pthread_barrier_init ( void ) { unimp("pthread_barrier_init"); }
110void pthread_barrier_wait ( void ) { unimp("pthread_barrier_wait"); }
111void pthread_barrierattr_destroy ( void ) { unimp("pthread_barrierattr_destroy"); }
112void pthread_barrierattr_init ( void ) { unimp("pthread_barrierattr_init"); }
113void pthread_barrierattr_setpshared ( void ) { unimp("pthread_barrierattr_setpshared"); }
114//void pthread_cancel ( void ) { unimp("pthread_cancel"); }
115//void pthread_cond_broadcast ( void ) { unimp("pthread_cond_broadcast"); }
116//void pthread_cond_destroy ( void ) { unimp("pthread_cond_destroy"); }
117//void pthread_cond_init ( void ) { unimp("pthread_cond_init"); }
118//void pthread_cond_signal ( void ) { unimp("pthread_cond_signal"); }
119//void pthread_cond_timedwait ( void ) { unimp("pthread_cond_timedwait"); }
120//void pthread_cond_wait ( void ) { unimp("pthread_cond_wait"); }
121//void pthread_condattr_destroy ( void ) { unimp("pthread_condattr_destroy"); }
thughes5d975072004-10-29 18:22:38 +0000122//void pthread_condattr_getpshared ( void ) { unimp("pthread_condattr_getpshared"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000123//void pthread_condattr_init ( void ) { unimp("pthread_condattr_init"); }
thughes5d975072004-10-29 18:22:38 +0000124//void pthread_condattr_setpshared ( void ) { unimp("pthread_condattr_setpshared"); }
sewardj853f55d2002-04-26 00:27:53 +0000125//void pthread_detach ( void ) { unimp("pthread_detach"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000126//void pthread_equal ( void ) { unimp("pthread_equal"); }
127//void pthread_exit ( void ) { unimp("pthread_exit"); }
sewardj64039bb2002-06-03 00:58:18 +0000128//void pthread_getattr_np ( void ) { unimp("pthread_getattr_np"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000129void pthread_getcpuclockid ( void ) { unimp("pthread_getcpuclockid"); }
130//void pthread_getschedparam ( void ) { unimp("pthread_getschedparam"); }
131//void pthread_getspecific ( void ) { unimp("pthread_getspecific"); }
132//void pthread_join ( void ) { unimp("pthread_join"); }
133//void pthread_key_create ( void ) { unimp("pthread_key_create"); }
134//void pthread_key_delete ( void ) { unimp("pthread_key_delete"); }
sewardj018f7622002-05-15 21:13:39 +0000135//void pthread_kill ( void ) { unimp("pthread_kill"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000136//void pthread_mutex_destroy ( void ) { unimp("pthread_mutex_destroy"); }
137//void pthread_mutex_init ( void ) { unimp("pthread_mutex_init"); }
138//void pthread_mutex_lock ( void ) { unimp("pthread_mutex_lock"); }
thughese321d492004-10-17 15:00:20 +0000139//void pthread_mutex_timedlock ( void ) { unimp("pthread_mutex_timedlock"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000140//void pthread_mutex_trylock ( void ) { unimp("pthread_mutex_trylock"); }
141//void pthread_mutex_unlock ( void ) { unimp("pthread_mutex_unlock"); }
142//void pthread_mutexattr_destroy ( void ) { unimp("pthread_mutexattr_destroy"); }
143//void pthread_mutexattr_init ( void ) { unimp("pthread_mutexattr_init"); }
144//void pthread_once ( void ) { unimp("pthread_once"); }
sewardja1ac5cb2002-05-27 13:00:05 +0000145//void pthread_rwlock_destroy ( void ) { unimp("pthread_rwlock_destroy"); }
146//void pthread_rwlock_init ( void ) { unimp("pthread_rwlock_init"); }
sewardj5716dbb2002-04-26 03:28:18 +0000147//void pthread_rwlock_rdlock ( void ) { unimp("pthread_rwlock_rdlock"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000148void pthread_rwlock_timedrdlock ( void ) { unimp("pthread_rwlock_timedrdlock"); }
149void pthread_rwlock_timedwrlock ( void ) { unimp("pthread_rwlock_timedwrlock"); }
sewardja1ac5cb2002-05-27 13:00:05 +0000150//void pthread_rwlock_tryrdlock ( void ) { unimp("pthread_rwlock_tryrdlock"); }
151//void pthread_rwlock_trywrlock ( void ) { unimp("pthread_rwlock_trywrlock"); }
sewardj5716dbb2002-04-26 03:28:18 +0000152//void pthread_rwlock_unlock ( void ) { unimp("pthread_rwlock_unlock"); }
sewardj060b04f2002-04-26 21:01:13 +0000153//void pthread_rwlock_wrlock ( void ) { unimp("pthread_rwlock_wrlock"); }
sewardj5706bfa2002-12-08 23:42:17 +0000154//void pthread_rwlockattr_destroy ( void ) { unimp("pthread_rwlockattr_destroy"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000155void pthread_rwlockattr_getkind_np ( void ) { unimp("pthread_rwlockattr_getkind_np"); }
156void pthread_rwlockattr_getpshared ( void ) { unimp("pthread_rwlockattr_getpshared"); }
sewardj47e4e312002-06-18 09:24:34 +0000157//void pthread_rwlockattr_init ( void ) { unimp("pthread_rwlockattr_init"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000158void pthread_rwlockattr_setkind_np ( void ) { unimp("pthread_rwlockattr_setkind_np"); }
sewardjfe18eb82002-07-13 12:58:44 +0000159//void pthread_rwlockattr_setpshared ( void ) { unimp("pthread_rwlockattr_setpshared"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000160//void pthread_self ( void ) { unimp("pthread_self"); }
sewardj853f55d2002-04-26 00:27:53 +0000161//void pthread_setcancelstate ( void ) { unimp("pthread_setcancelstate"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000162//void pthread_setcanceltype ( void ) { unimp("pthread_setcanceltype"); }
163//void pthread_setschedparam ( void ) { unimp("pthread_setschedparam"); }
164//void pthread_setspecific ( void ) { unimp("pthread_setspecific"); }
sewardjb48e5002002-05-13 00:16:03 +0000165//void pthread_sigmask ( void ) { unimp("pthread_sigmask"); }
sewardj853f55d2002-04-26 00:27:53 +0000166//void pthread_testcancel ( void ) { unimp("pthread_testcancel"); }
sewardj3665ded2002-05-16 16:57:25 +0000167//void raise ( void ) { unimp("raise"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000168void sem_close ( void ) { unimp("sem_close"); }
169void sem_open ( void ) { unimp("sem_open"); }
sewardj9ad92d92002-10-16 19:45:06 +0000170//void sem_timedwait ( void ) { unimp("sem_timedwait"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000171void sem_unlink ( void ) { unimp("sem_unlink"); }
172//void sigaction ( void ) { unimp("sigaction"); }
sewardj436c2db2002-06-18 09:07:54 +0000173//void siglongjmp ( void ) { unimp("siglongjmp"); }
sewardjb48e5002002-05-13 00:16:03 +0000174//void sigwait ( void ) { unimp("sigwait"); }
sewardj3b13f0e2002-04-25 20:17:29 +0000175
thughes8d001962004-08-15 14:11:12 +0000176void __pthread_clock_gettime_private ( void ) { unimp("__pthread_clock_gettime"); }
177void __pthread_clock_settime_private ( void ) { unimp("__pthread_clock_settime"); }
178strong_alias(__pthread_clock_gettime_private, __pthread_clock_gettime_223);
179strong_alias(__pthread_clock_settime_private, __pthread_clock_settime_223);
180symbol_version(__pthread_clock_gettime_223, __pthread_clock_gettime, GLIBC_2.2.3);
181symbol_version(__pthread_clock_settime_223, __pthread_clock_settime, GLIBC_2.2.3);
182default_symbol_version(__pthread_clock_gettime_private, __pthread_clock_gettime, GLIBC_PRIVATE);
183default_symbol_version(__pthread_clock_settime_private, __pthread_clock_settime, GLIBC_PRIVATE);
sewardj08c7f012002-10-07 23:56:55 +0000184
sewardjcbd1b5d2002-06-03 23:12:58 +0000185
sewardj5905fae2002-04-26 13:25:00 +0000186
sewardja1ac5cb2002-05-27 13:00:05 +0000187//weak_alias(pthread_rwlock_destroy, __pthread_rwlock_destroy)
188//weak_alias(pthread_rwlock_init, __pthread_rwlock_init)
189//weak_alias(pthread_rwlock_tryrdlock, __pthread_rwlock_tryrdlock)
190//weak_alias(pthread_rwlock_trywrlock, __pthread_rwlock_trywrlock)
sewardj060b04f2002-04-26 21:01:13 +0000191//weak_alias(pthread_rwlock_wrlock, __pthread_rwlock_wrlock)
sewardj5905fae2002-04-26 13:25:00 +0000192weak_alias(_IO_ftrylockfile, ftrylockfile)
193
sewardj39b93b12002-05-18 10:56:27 +0000194//__attribute__((weak)) void pread ( void ) { vgPlain_unimp("pread"); }
195//__attribute__((weak)) void pwrite ( void ) { vgPlain_unimp("pwrite"); }
sewardj67f1d582002-05-24 02:11:32 +0000196//__attribute__((weak)) void msync ( void ) { vgPlain_unimp("msync"); }
sewardj9a2224b2002-06-19 10:17:40 +0000197//__attribute__((weak)) void pause ( void ) { vgPlain_unimp("pause"); }
sewardj59da27a2002-06-06 08:33:54 +0000198//__attribute__((weak)) void recvfrom ( void ) { vgPlain_unimp("recvfrom"); }
199//__attribute__((weak)) void recvmsg ( void ) { vgPlain_unimp("recvmsg"); }
sewardj3665ded2002-05-16 16:57:25 +0000200//__attribute__((weak)) void sendmsg ( void ) { vgPlain_unimp("sendmsg"); }
thughesd27c7f52004-03-31 15:23:13 +0000201//__attribute__((weak)) void tcdrain ( void ) { vgPlain_unimp("tcdrain"); }
sewardj7f6456d2002-05-21 00:51:21 +0000202//--//__attribute__((weak)) void vfork ( void ) { vgPlain_unimp("vfork"); }
sewardj436e0582002-04-26 14:31:40 +0000203
sewardj111b14c2002-10-20 16:22:57 +0000204//__attribute__((weak)) void pthread_attr_getguardsize ( void )
205// { vgPlain_unimp("pthread_attr_getguardsize"); }
thughesdaa34562004-06-27 12:48:53 +0000206//__attribute__((weak)) void pthread_attr_getstack ( void )
207// { vgPlain_unimp("pthread_attr_getstack"); }
sewardj436e0582002-04-26 14:31:40 +0000208__attribute__((weak)) void pthread_attr_getstackaddr ( void )
209 { vgPlain_unimp("pthread_attr_getstackaddr"); }
210__attribute__((weak)) void pthread_attr_getstacksize ( void )
211 { vgPlain_unimp("pthread_attr_getstacksize"); }
sewardj111b14c2002-10-20 16:22:57 +0000212//__attribute__((weak)) void pthread_attr_setguardsize ( void )
213// { vgPlain_unimp("pthread_attr_setguardsize"); }
sewardj436e0582002-04-26 14:31:40 +0000214__attribute__((weak)) void pthread_attr_setstack ( void )
215 { vgPlain_unimp("pthread_attr_setstack"); }
216__attribute__((weak)) void pthread_attr_setstackaddr ( void )
217 { vgPlain_unimp("pthread_attr_setstackaddr"); }
sewardj0286dd52002-05-16 20:51:15 +0000218//__attribute__((weak)) void pthread_attr_setstacksize ( void )
219// { vgPlain_unimp("pthread_attr_setstacksize"); }
sewardjab2e1232002-12-26 12:16:11 +0000220//__attribute__((weak)) void pthread_getconcurrency ( void )
221// { vgPlain_unimp("pthread_getconcurrency"); }
sewardjf0b06452002-06-04 08:38:04 +0000222//__attribute__((weak)) void pthread_kill_other_threads_np ( void )
223// { vgPlain_unimp("pthread_kill_other_threads_np"); }
sewardj436e0582002-04-26 14:31:40 +0000224__attribute__((weak)) void pthread_mutexattr_getkind_np ( void )
225 { vgPlain_unimp("pthread_mutexattr_getkind_np"); }
226__attribute__((weak)) void pthread_mutexattr_getpshared ( void )
227 { vgPlain_unimp("pthread_mutexattr_getpshared"); }
thughescca97252004-10-13 18:29:54 +0000228//__attribute__((weak)) void pthread_mutexattr_gettype ( void )
229// { vgPlain_unimp("pthread_mutexattr_gettype"); }
sewardj436e0582002-04-26 14:31:40 +0000230__attribute__((weak)) void pthread_mutexattr_setkind_np ( void )
231 { vgPlain_unimp("pthread_mutexattr_setkind_np"); }
sewardj7685cae2003-07-06 01:23:11 +0000232//__attribute__((weak)) void pthread_mutexattr_setpshared ( void )
233// { vgPlain_unimp("pthread_mutexattr_setpshared"); }
sewardjb34e4db2002-12-08 23:51:32 +0000234//__attribute__((weak)) void pthread_setconcurrency ( void )
235// { vgPlain_unimp("pthread_setconcurrency"); }
sewardj5e657c32003-10-12 08:33:30 +0000236//__attribute__((weak)) void pthread_spin_destroy ( void )
237// { vgPlain_unimp("pthread_spin_destroy"); }
238//__attribute__((weak)) void pthread_spin_init ( void )
239// { vgPlain_unimp("pthread_spin_init"); }
240//__attribute__((weak)) void pthread_spin_lock ( void )
241// { vgPlain_unimp("pthread_spin_lock"); }
242//__attribute__((weak)) void pthread_spin_trylock ( void )
243// { vgPlain_unimp("pthread_spin_trylock"); }
244//__attribute__((weak)) void pthread_spin_unlock ( void )
245// { vgPlain_unimp("pthread_spin_unlock"); }
sewardj436e0582002-04-26 14:31:40 +0000246
sewardj439d45e2002-05-03 20:43:10 +0000247
248/*--------------------------------------------------------------------*/
249/*--- end vg_libpthread_unimp.c ---*/
250/*--------------------------------------------------------------------*/