]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Illumos helgrind: pthread wrapper tweaks
authorPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 2 Apr 2025 19:39:54 +0000 (21:39 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 2 Apr 2025 19:39:54 +0000 (21:39 +0200)
Wrap pthread_cond_timedwait which seems to have supplanted
cond_reltimedwait on Illumos.

pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock both
exist on illumos, so enable those wrappers.

helgrind/hg_intercepts.c
helgrind/tests/filter_stderr_solaris

index 950d71b83cb49cebb234e52ca74b0c3c2a7dc7ee..661ab1a0935c77fa7b2f40ac2bc5d3ed4e3f9c1e 100644 (file)
@@ -1526,6 +1526,11 @@ static int pthread_cond_timedwait_WRK(pthread_cond_t* cond,
                  struct timespec *reltime) {
       return pthread_cond_timedwait_WRK(cond, mutex, reltime, ETIME);
    }
+   PTH_FUNC(int, pthreadZucondZutimedwait, // pthread_cond_timedwait
+                 pthread_cond_t* cond, pthread_mutex_t* mutex,
+                 struct timespec* abstime) {
+      return pthread_cond_timedwait_WRK(cond, mutex, abstime, ETIMEDOUT);
+   }
 #else
 #  error "Unsupported OS"
 #endif
@@ -2810,7 +2815,7 @@ PTH_FUNC(int, pthreadZurwlockZutimedrdlock, // pthread_rwlock_timedrdlock
 #  error "Unsupported OS"
 #endif
 
-#if defined(VGO_linux)
+#if defined(VGO_linux) || defined(VGO_solaris)
 //-----------------------------------------------------------
 // glibc:   pthread_rwlock_clockrdlock
 //
@@ -2917,7 +2922,7 @@ PTH_FUNC(int, pthreadZurwlockZutimedwrlock, // pthread_rwlock_timedwrlock
 #  error "Unsupported OS"
 #endif
 
-#if defined(VGO_linux)
+#if defined(VGO_linux) || defined(VGO_solaris)
 //-----------------------------------------------------------
 // glibc:   pthread_rwlock_clockwrlock
 //
index 41d1f1ef597523c6bbee98ed0a5fa96def4a8ecb..56ecfb3fb0311be988e06e6e28e7880917a46f4c 100755 (executable)
@@ -2,6 +2,8 @@
 
 # Replace pthread_create with pthread_create@* which is expected on Linux
 s/pthread_create \(hg_intercepts.c:/pthread_create@* \(hg_intercepts.c:/g;
+# Illumos uses pthread function names (in some cases?)
+s/pthread_cond_timedwait \(hg_intercepts.c:/pthread_cond_timedwait@* \(hg_intercepts.c:/;
 
 # We need to remove stack frames containing redundant function
 # names from libc, for example