Open YvoIovY opened 3 years ago
~/masscan $ cc src/*.c -o bin/masscan src/pixie-threads.c:50:5: warning: implicit declaration of function 'pthread_setschedprio' is invalid in C99 [-Wimplicit-function-declaration] pthread_setschedprio(thread, max_prio_for_policy); ^ 1 warning generated. /data/data/com.termux/files/usr/bin/ld: /data/data/com.termux/files/usr/tmp/pixie-threads-fd1959.o: in function pixie_cpu_raise_priority': pixie-threads.c:(.text+0x50): undefined reference to
pthread_setschedprio' clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
Edit your pixie thread.c file in src folder
Replace this
pthread_t thread = pthread_self(); pthread_attr_t thAttr; int policy = 0; int max_prio_for_policy = 0; pthread_attr_init(&thAttr); pthread_attr_getschedpolicy(&thAttr, &policy); max_prio_for_policy = sched_get_priority_max(policy); pthread_setschedprio(thread, max_prio_for_policy); pthread_attr_destroy(&thAttr); return;
TO THIS (BELOW)
int policy; struct sched_param param;
pthread_getschedparam(pthread_self(), &policy, ¶m); param.sched_priority = sched_get_priority_max(policy); pthread_setschedparam(pthread_self(), policy, ¶m); return;
/data/data/com.termux/files/usr/bin/ld: tmp/out-tcp-services.o: in function
tcp_service_name': /data/data/com.termux/files/home/masscan-1.3.2/src/out-tcp-services.c:33: undefined reference to
getservbyport_r' /data/data/com.termux/files/usr/bin/ld: tmp/out-tcp-services.o: in functionudp_service_name': /data/data/com.termux/files/home/masscan-1.3.2/src/out-tcp-services.c:65: undefined reference to
getservbyport_r' /data/data/com.termux/files/usr/bin/ld: tmp/pixie-threads.o: in functionpixie_cpu_raise_priority': /data/data/com.termux/files/home/masscan-1.3.2/src/pixie-threads.c:50: undefined reference to
pthread_setschedprio' /data/data/com.termux/files/usr/bin/ld: tmp/pixie-threads.o: in functionpixie_cpu_set_affinity': /data/data/com.termux/files/home/masscan-1.3.2/src/pixie-threads.c:86: undefined reference to
pthread_setaffinity_np' clang-12: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:112: bin/masscan] Error 1