因为gettid()是Linux他自己的,因此把里面实现函数拷贝出来,写到自己的程序里即可。 //因为gettid()是Linux他自己的,因此把里面实现函数复制出来,写到自己的程序里即可。头文件有 #include<sys/syscall.h> pid_t gettid() { return syscall(SYS_gettid); } #include <linux/unistd.h> pid_t gettid(void){ ...
Linking fails with an undefined reference to gettid when building libblkio on CentOS 8.3 with glibc 2.28. Description: The gettid function is...
cpu_set_t set; CPU_ZERO(&set); CPU_SET(proc_num, &set); if (sched_setaffinity(gettid(), sizeof(cpu_set_t), &set)) { perror("sched_setaffinity"); return NULL; } But when I compile I find undefined reference to 'CPU_ZERO' undefined reference to 'CPU_SET' How can I fix t...