robertdavidgraham / masscan

TCP port scanner, spews SYN packets asynchronously, scanning entire Internet in under 5 minutes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make install cc -g -ggdb -Wall -O2 -c src/pixie-threads.c -o tmp/pixie-threads.o src/pixie-threads.c:51:5: error: call to undeclared function 'pthread_setschedprio'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 51 | pthread_setschedprio(thread, max_prio_for_policy); | ^ src/pixie-threads.c:51:5: note: did you mean 'pthread_setschedparam'? /data/data/com.termux/files/usr/include/pthread.h:348:5: note: 'pthread_setschedparam' declared here 348 | int pthread_setschedparam(pthread_t

Qs2255 opened this issue · comments

make install
cc -g -ggdb -Wall -O2 -c src/pixie-threads.c -o tmp/pixie-threads.o
src/pixie-threads.c:51:5: error: call to undeclared function 'pthread_setschedprio'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
51 | pthread_setschedprio(thread, max_prio_for_policy);
| ^
src/pixie-threads.c:51:5: note: did you mean 'pthread_setschedparam'?
/data/data/com.termux/files/usr/include/pthread.h:348:5: note: 'pthread_setschedparam' declared here
348 | int pthread_setschedparam(pthread_t __pthread, int __policy, const struct sched_param* _Nonnull __param);
| ^
1 error generated.
make: *** [Makefile:116: tmp/pixie-threads.o] Error 1

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;