--- helgrind/hg_intercepts.c.orig +++ helgrind/hg_intercepts.c @@ -109,7 +109,7 @@ # error "Unknown platform/thread wrapping" #endif -#if defined(VGO_freebsd) +#if defined(VGO_freebsd) || defined(VGO_openbsd) #define LIBC_FUNC(ret_ty, f, args...) \ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args); \ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args) @@ -256,7 +256,7 @@ case EDEADLK: return "EDEADLK: Resource deadlock would occur"; case EOPNOTSUPP: return "EOPNOTSUPP: Operation not supported on " "transport endpoint"; /* honest, guv */ -#if !defined(VGO_freebsd) +#if !defined(VGO_freebsd) && !defined(VGO_openbsd) case ETIME: return "ETIME: Timer expired"; #endif default: return "hg_intercepts.c: lame_strerror(): " @@ -477,7 +477,7 @@ void *(*start) (void *), void *arg) { return pthread_create_WRK(thread, attr, start, arg); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZucreate, // pthread_create pthread_t *thread, const pthread_attr_t *attr, void *(*start) (void *), void *arg) { @@ -596,7 +596,7 @@ pthread_t thread, void** value_pointer) { return pthread_join_WRK(thread, value_pointer); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZujoin, // pthread_join pthread_t thread, void** value_pointer) { return pthread_join_WRK(thread, value_pointer); @@ -901,7 +901,7 @@ return ret; } -#if defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) +#if defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZumutexZudestroy, // pthread_mutex_destroy pthread_mutex_t *mutex) { return mutex_destroy_WRK(mutex); @@ -954,7 +954,7 @@ return ret; } -#if defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) +#if defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZumutexZulock, // pthread_mutex_lock pthread_mutex_t *mutex) { return mutex_lock_WRK(mutex); @@ -1041,7 +1041,7 @@ return ret; } -#if defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) +#if defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZumutexZutrylock, // pthread_mutex_trylock pthread_mutex_t *mutex) { return mutex_trylock_WRK(mutex); @@ -1196,7 +1196,7 @@ return ret; } -#if defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) +#if defined(VGO_linux) || defined(VGO_darwin) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZumutexZuunlock, // pthread_mutex_unlock pthread_mutex_t *mutex) { return mutex_unlock_WRK(mutex); @@ -1317,7 +1317,7 @@ pthread_cond_t* cond, pthread_mutex_t* mutex) { return pthread_cond_wait_WRK(cond, mutex); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZucondZuwait, // pthread_cond_wait pthread_cond_t* cond, pthread_mutex_t* mutex) { return pthread_cond_wait_WRK(cond, mutex); @@ -1423,7 +1423,7 @@ struct timespec* abstime) { return pthread_cond_timedwait_WRK(cond, mutex, abstime, ETIMEDOUT); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZucondZutimedwait, // pthread_cond_timedwait pthread_cond_t* cond, pthread_mutex_t* mutex, struct timespec* abstime) { @@ -1587,7 +1587,7 @@ pthread_cond_t* cond) { return pthread_cond_signal_WRK(cond); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZucondZusignal, // pthread_cond_signal pthread_cond_t* cond) { return pthread_cond_signal_WRK(cond); @@ -1654,7 +1654,7 @@ pthread_cond_t* cond) { return pthread_cond_broadcast_WRK(cond); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZucondZubroadcast, // pthread_cond_broadcast pthread_cond_t* cond) { return pthread_cond_broadcast_WRK(cond); @@ -1716,7 +1716,7 @@ pthread_cond_t* cond, pthread_condattr_t* cond_attr) { return pthread_cond_init_WRK(cond, cond_attr); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZucondZuinit, // pthread_cond_init@* pthread_cond_t* cond, pthread_condattr_t* cond_attr) { return pthread_cond_init_WRK(cond, cond_attr); @@ -1814,7 +1814,7 @@ pthread_cond_t* cond) { return pthread_cond_destroy_WRK(cond); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZucondZudestroy, // pthread_cond_destroy@* pthread_cond_t* cond) { return pthread_cond_destroy_WRK(cond); @@ -2030,7 +2030,7 @@ /* this is never actually called */ return pthread_spin_init_or_unlock_WRK(lock, 0/*pshared*/); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZuspinZuinit, // pthread_spin_init pthread_spinlock_t* lock, int pshared) { return pthread_spin_init_or_unlock_WRK(lock, pshared); @@ -2085,7 +2085,7 @@ } return ret; } -#if defined(VGO_linux) || defined(VGO_freebsd) +#if defined(VGO_linux) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZuspinZudestroy, // pthread_spin_destroy pthread_spinlock_t *lock) { return pthread_spin_destroy_WRK(lock); @@ -2139,7 +2139,7 @@ } return ret; } -#if defined(VGO_linux) || defined(VGO_freebsd) +#if defined(VGO_linux) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZuspinZulock, // pthread_spin_lock pthread_spinlock_t *lock) { return pthread_spin_lock_WRK(lock); @@ -2194,7 +2194,7 @@ } return ret; } -#if defined(VGO_linux) || defined(VGO_freebsd) +#if defined(VGO_linux) || defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZuspinZutrylock, // pthread_spin_trylock pthread_spinlock_t *lock) { return pthread_spin_trylock_WRK(lock); @@ -2265,7 +2265,7 @@ pthread_rwlockattr_t* attr) { return pthread_rwlock_init_WRK(rwl, attr); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZuinit, // pthread_rwlock_init pthread_rwlock_t *rwl, pthread_rwlockattr_t* attr) { @@ -2351,7 +2351,7 @@ pthread_rwlock_t *rwl) { return pthread_rwlock_destroy_WRK(rwl); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZudestroy, // pthread_rwlock_destroy pthread_rwlock_t *rwl) { return pthread_rwlock_destroy_WRK(rwl); @@ -2411,7 +2411,7 @@ pthread_rwlock_t* rwlock) { return pthread_rwlock_wrlock_WRK(rwlock); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZuwrlock, // pthread_rwlock_wrlock pthread_rwlock_t* rwlock) { return pthread_rwlock_wrlock_WRK(rwlock); @@ -2497,7 +2497,7 @@ pthread_rwlock_t* rwlock) { return pthread_rwlock_rdlock_WRK(rwlock); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZurdlock, // pthread_rwlock_rdlock pthread_rwlock_t* rwlock) { return pthread_rwlock_rdlock_WRK(rwlock); @@ -2589,7 +2589,7 @@ pthread_rwlock_t* rwlock) { return pthread_rwlock_trywrlock_WRK(rwlock); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZutrywrlock, // pthread_rwlock_trywrlock pthread_rwlock_t* rwlock) { return pthread_rwlock_trywrlock_WRK(rwlock); @@ -2656,7 +2656,7 @@ pthread_rwlock_t* rwlock) { return pthread_rwlock_tryrdlock_WRK(rwlock); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZutryrdlock, // pthread_rwlock_tryrdlock pthread_rwlock_t* rwlock) { return pthread_rwlock_tryrdlock_WRK(rwlock); @@ -2719,7 +2719,7 @@ return pthread_rwlock_timedrdlock_WRK(rwlock, timeout); } #elif defined(VGO_darwin) -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZutimedrdlock, // pthread_rwlock_timedrdlock pthread_rwlock_t *rwlock, const struct timespec *timeout) { @@ -2826,7 +2826,7 @@ return pthread_rwlock_timedwrlock_WRK(rwlock, timeout); } #elif defined(VGO_darwin) -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZutimedwrlock, // pthread_rwlock_timedwrlock pthread_rwlock_t *rwlock, const struct timespec *timeout) { @@ -2928,7 +2928,7 @@ pthread_rwlock_t* rwlock) { return pthread_rwlock_unlock_WRK(rwlock); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) PTH_FUNC(int, pthreadZurwlockZuunlock, // pthread_rwlock_unlock pthread_rwlock_t* rwlock) { return pthread_rwlock_unlock_WRK(rwlock); @@ -3022,7 +3022,7 @@ sem_t* sem, int pshared, unsigned long value) { return sem_init_WRK(sem, pshared, value); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) LIBC_FUNC(int, semZuinit, // sem_init sem_t* sem, int pshared, unsigned long value) { return sem_init_WRK(sem, pshared, value); @@ -3110,7 +3110,7 @@ sem_t* sem) { return sem_destroy_WRK(sem); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) LIBC_FUNC(int, semZudestroy, // sem_destroy sem_t* sem) { return sem_destroy_WRK(sem); @@ -3180,7 +3180,7 @@ PTH_FUNC(int, semZuwaitZDZa, sem_t* sem) { /* sem_wait$* */ return sem_wait_WRK(sem); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) LIBC_FUNC(int, semZuwait, sem_t* sem) { /* sem_wait */ return sem_wait_WRK(sem); } @@ -3243,7 +3243,7 @@ PTH_FUNC(int, semZupost, sem_t* sem) { /* sem_post */ return sem_post_WRK(sem); } -#elif defined(VGO_freebsd) +#elif defined(VGO_freebsd) || defined(VGO_openbsd) LIBC_FUNC(int, semZupost, sem_t* sem) { /* sem_post */ return sem_post_WRK(sem); }