mirror of
https://github.com/pikvm/ustreamer.git
synced 2025-12-23 18:50:00 +00:00
Fix crash on FreeBSD due to incorrect thr_self system call invocation (#285)
The correct signature is: int thr_self(long *id); It was called as thr_self() which caused memory corruption.
This commit is contained in:
parent
793f24c48e
commit
dcddfddf56
@ -113,7 +113,9 @@ INLINE void us_thread_get_name(char *name) { // Always required for logging
|
||||
#if defined(__linux__)
|
||||
const pid_t tid = syscall(SYS_gettid);
|
||||
#elif defined(__FreeBSD__)
|
||||
const pid_t tid = syscall(SYS_thr_self);
|
||||
long id;
|
||||
assert(!syscall(SYS_thr_self, &id));
|
||||
const pid_t tid = id;
|
||||
#elif defined(__OpenBSD__)
|
||||
const pid_t tid = syscall(SYS_getthrid);
|
||||
#elif defined(__NetBSD__)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user