about summary refs log tree commit diff stats
path: root/src/libtools/threads.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-05-19 08:45:37 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-05-19 08:45:37 +0200
commit4d347f9ff04e11175bc0c25a693782be6ea5e29e (patch)
treed1e74ee97ff6f81a93d63a17c4542dc07b725884 /src/libtools/threads.c
parent252258d138b0160eee040d5834a0b02d88e0d48d (diff)
downloadbox64-4d347f9ff04e11175bc0c25a693782be6ea5e29e.tar.gz
box64-4d347f9ff04e11175bc0c25a693782be6ea5e29e.zip
Added a few wrapped function to libc and pthreads
Diffstat (limited to 'src/libtools/threads.c')
-rwxr-xr-xsrc/libtools/threads.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/libtools/threads.c b/src/libtools/threads.c
index b2ab3b5d..054451ff 100755
--- a/src/libtools/threads.c
+++ b/src/libtools/threads.c
@@ -681,27 +681,27 @@ EXPORT void my__pthread_cleanup_pop(x64emu_t* emu, void* buffer, int exec)
 	_pthread_cleanup_pop(buffer, exec);
 }
 
-//EXPORT int my_pthread_getaffinity_np(x64emu_t* emu, pthread_t thread, int cpusetsize, void* cpuset)
-//{
-//	(void)emu;
-//	int ret = pthread_getaffinity_np(thread, cpusetsize, cpuset);
-//	if(ret<0) {
-//		printf_log(LOG_INFO, "Warning, pthread_getaffinity_np(%p, %d, %p) errored, with errno=%d\n", (void*)thread, cpusetsize, cpuset, errno);
-//	}
-//
-//    return ret;
-//}
+EXPORT int my_pthread_getaffinity_np(x64emu_t* emu, pthread_t thread, size_t cpusetsize, void* cpuset)
+{
+	(void)emu;
+	int ret = pthread_getaffinity_np(thread, cpusetsize, cpuset);
+	if(ret<0) {
+		printf_log(LOG_INFO, "Warning, pthread_getaffinity_np(%p, %zd, %p) errored, with errno=%d\n", (void*)thread, cpusetsize, cpuset, errno);
+	}
 
-//EXPORT int my_pthread_setaffinity_np(x64emu_t* emu, pthread_t thread, int cpusetsize, void* cpuset)
-//{
-//	(void)emu;
-//	int ret = pthread_setaffinity_np(thread, cpusetsize, cpuset);
-//	if(ret<0) {
-//		printf_log(LOG_INFO, "Warning, pthread_setaffinity_np(%p, %d, %p) errored, with errno=%d\n", (void*)thread, cpusetsize, cpuset, errno);
-//	}
-//
-//    return ret;
-//}
+    return ret;
+}
+
+EXPORT int my_pthread_setaffinity_np(x64emu_t* emu, pthread_t thread, size_t cpusetsize, void* cpuset)
+{
+	(void)emu;
+	int ret = pthread_setaffinity_np(thread, cpusetsize, cpuset);
+	if(ret<0) {
+		printf_log(LOG_INFO, "Warning, pthread_setaffinity_np(%p, %zd, %p) errored, with errno=%d\n", (void*)thread, cpusetsize, cpuset, errno);
+	}
+
+    return ret;
+}
 
 //EXPORT int my_pthread_attr_setaffinity_np(x64emu_t* emu, void* attr, uint32_t cpusetsize, void* cpuset)
 //{