this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support setting thread name via sys_proc_info()

+15
+15
src/kernel/emulation/linux/misc/proc_info.c
··· 6 6 #include "../ext/syslog.h" 7 7 #include "../simple.h" 8 8 9 + #define LINUX_PR_SET_NAME 15 10 + 9 11 long sys_proc_info(uint32_t callnum, int32_t pid, uint32_t flavor, 10 12 uint64_t arg, void* buffer, int32_t bufsize) 11 13 { ··· 17 19 18 20 ret = __linux_syslog(SYSLOG_ACTION_READ_ALL, (char*) buffer, 19 21 bufsize); 22 + if (ret < 0) 23 + return errno_linux_to_bsd(ret); 24 + 25 + return ret; 26 + } 27 + case 5: // proc_setthreadname 28 + { 29 + // On macOS, pthread_setname_np() takes only one argument, 30 + // thus we can ignore pid and assume we're talking about 31 + // the current thread. 32 + int ret; 33 + 34 + ret = LINUX_SYSCALL(__NR_prctl, LINUX_PR_SET_NAME, buffer, 0UL, 0UL, 0UL); 20 35 if (ret < 0) 21 36 return errno_linux_to_bsd(ret); 22 37