about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-07-12 17:23:02 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-07-12 17:23:02 +0200
commit2a10ddc75ba2bcf2915ff49ac88664ee8e7d1939 (patch)
treef9a056bb679e4dc2e9173e9341003d2a2a7ada1b /src
parent8ed08b3bbc95106320f2ee42bae2d85a336d06ca (diff)
downloadbox64-2a10ddc75ba2bcf2915ff49ac88664ee8e7d1939.tar.gz
box64-2a10ddc75ba2bcf2915ff49ac88664ee8e7d1939.zip
[WRAPPER] Added 1 more wrapped function to libpthreads (for #2808)
Diffstat (limited to 'src')
-rw-r--r--src/libtools/static_threads.h1
-rw-r--r--src/libtools/threads.c14
-rw-r--r--src/wrapped/generated/functions_list.txt1
-rw-r--r--src/wrapped/generated/wrappedlibpthreadtypes.h1
-rw-r--r--src/wrapped/wrappedlibpthread_private.h4
5 files changed, 19 insertions, 2 deletions
diff --git a/src/libtools/static_threads.h b/src/libtools/static_threads.h
index 07907987..f764e6c3 100644
--- a/src/libtools/static_threads.h
+++ b/src/libtools/static_threads.h
@@ -57,6 +57,7 @@ int my_pthread_mutexattr_getrobust(x64emu_t* emu, my_mutexattr_t *attr, void* p)
 int my_pthread_mutexattr_init(x64emu_t* emu, my_mutexattr_t *attr);
 int my___pthread_mutexattr_init(x64emu_t* emu, my_mutexattr_t *attr);
 int my_pthread_mutexattr_setkind_np(x64emu_t* emu, my_mutexattr_t *attr, int k);
+int my_pthread_mutexattr_setprioceiling(x64emu_t* emu, my_mutexattr_t *attr, int p);
 int my_pthread_mutexattr_setprotocol(x64emu_t* emu, my_mutexattr_t *attr, int p);
 int my_pthread_mutexattr_setpshared(x64emu_t* emu, my_mutexattr_t *attr, int p);
 int my_pthread_mutexattr_settype(x64emu_t* emu, my_mutexattr_t *attr, int t);
diff --git a/src/libtools/threads.c b/src/libtools/threads.c
index 3e344e8c..40e7b956 100644
--- a/src/libtools/threads.c
+++ b/src/libtools/threads.c
@@ -930,6 +930,20 @@ EXPORT int my_pthread_mutexattr_setkind_np(x64emu_t* emu, my_mutexattr_t *attr,
 	attr->x86 = mattr.x86;
 	return ret;
 }
+EXPORT int my_pthread_mutexattr_setprioceiling(x64emu_t* emu, my_mutexattr_t *attr, int p)
+{
+#ifndef TERMUX
+	(void)emu;
+	my_mutexattr_t mattr = {0};
+	mattr.x86 = attr->x86;
+	int ret = pthread_mutexattr_setprioceiling(&mattr.nat, p);
+	attr->x86 = mattr.x86;
+	return ret;
+#else
+	(void)emu; (void)attr; (void)p;
+	return 0;
+#endif
+}
 EXPORT int my_pthread_mutexattr_setprotocol(x64emu_t* emu, my_mutexattr_t *attr, int p)
 {
 #ifndef TERMUX
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index 128e86c9..2287f965 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -5250,6 +5250,7 @@ wrappedlibpthread:
   - pthread_kill
   - pthread_kill@GLIBC_2.2.5
   - pthread_mutexattr_setkind_np
+  - pthread_mutexattr_setprioceiling
   - pthread_mutexattr_setprotocol
   - pthread_mutexattr_setpshared
   - pthread_mutexattr_setrobust
diff --git a/src/wrapped/generated/wrappedlibpthreadtypes.h b/src/wrapped/generated/wrappedlibpthreadtypes.h
index 2620f07e..cead4c00 100644
--- a/src/wrapped/generated/wrappedlibpthreadtypes.h
+++ b/src/wrapped/generated/wrappedlibpthreadtypes.h
@@ -64,6 +64,7 @@ typedef int32_t (*iFpppp_t)(void*, void*, void*, void*);
 	GO(pthread_kill, iFpi_t) \
 	GO(pthread_kill@GLIBC_2.2.5, iFpi_t) \
 	GO(pthread_mutexattr_setkind_np, iFpi_t) \
+	GO(pthread_mutexattr_setprioceiling, iFpi_t) \
 	GO(pthread_mutexattr_setprotocol, iFpi_t) \
 	GO(pthread_mutexattr_setpshared, iFpi_t) \
 	GO(pthread_mutexattr_setrobust, iFpi_t) \
diff --git a/src/wrapped/wrappedlibpthread_private.h b/src/wrapped/wrappedlibpthread_private.h
index cdb241c6..d81391b0 100644
--- a/src/wrapped/wrappedlibpthread_private.h
+++ b/src/wrapped/wrappedlibpthread_private.h
@@ -164,7 +164,7 @@ GO(pthread_mutexattr_gettype, iFpp)
 GO(__pthread_mutexattr_init, iFp)
 GO(pthread_mutexattr_init, iFp)
 GO(pthread_mutexattr_setkind_np, iFpi)
-//GO(pthread_mutexattr_setprioceiling, 
+GO(pthread_mutexattr_setprioceiling, iFpi)
 GO(pthread_mutexattr_setprotocol, iFpi)
 GO(pthread_mutexattr_setpshared, iFpi)
 GO(pthread_mutexattr_setrobust, iFpi)
@@ -184,7 +184,7 @@ GOM(pthread_mutexattr_gettype, iFEpp)
 GOM(__pthread_mutexattr_init, iFEp)
 GOM(pthread_mutexattr_init, iFEp)
 GOM(pthread_mutexattr_setkind_np, iFEpi)
-//GO(pthread_mutexattr_setprioceiling, 
+GOM(pthread_mutexattr_setprioceiling, iFEpi)
 GOM(pthread_mutexattr_setprotocol, iFEpi)
 GOM(pthread_mutexattr_setpshared, iFEpi)
 GOM(pthread_mutexattr_setrobust, iFEpi)