robertdavidgraham / masscan

TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes.
GNU Affero General Public License v3.0
23.78k stars 3.08k forks source link

How To Install Masscan In Termux (Android) #627

Open YvoIovY opened 3 years ago

YvoIovY commented 3 years ago

/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 togetservbyport_r' /data/data/com.termux/files/usr/bin/ld: tmp/out-tcp-services.o: in function udp_service_name': /data/data/com.termux/files/home/masscan-1.3.2/src/out-tcp-services.c:65: undefined reference togetservbyport_r' /data/data/com.termux/files/usr/bin/ld: tmp/pixie-threads.o: in function pixie_cpu_raise_priority': /data/data/com.termux/files/home/masscan-1.3.2/src/pixie-threads.c:50: undefined reference topthread_setschedprio' /data/data/com.termux/files/usr/bin/ld: tmp/pixie-threads.o: in function pixie_cpu_set_affinity': /data/data/com.termux/files/home/masscan-1.3.2/src/pixie-threads.c:86: undefined reference topthread_setaffinity_np' clang-12: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:112: bin/masscan] Error 1

YvoIovY commented 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 topthread_setschedprio' clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

johnzxlin commented 9 months ago

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, &param); param.sched_priority = sched_get_priority_max(policy); pthread_setschedparam(pthread_self(), policy, &param); return;