Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple errors when compiling libfutex #1

Open
iamalsaher opened this issue Mar 25, 2017 · 1 comment
Open

multiple errors when compiling libfutex #1

iamalsaher opened this issue Mar 25, 2017 · 1 comment

Comments

@iamalsaher
Copy link

[arm64-v8a] Compile        : futex_exploit <= futex.c
libfutex_exploit/futex.c:33:5: error: non-void function 'create_server_socket' should return a value [-Wreturn-type]
    return;
    ^
libfutex_exploit/futex.c:46:5: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
    close(sockfd);
    ^
libfutex_exploit/futex.c:152:9: warning: implicit declaration of function 'fork' is invalid in C99 [-Wimplicit-function-declaration]
  pid = fork();
        ^
libfutex_exploit/futex.c:158:7: warning: implicit declaration of function 'futex_exploit_main' is invalid in C99 [-Wimplicit-function-declaration]
  if (futex_exploit_main()) {
      ^
libfutex_exploit/futex.c:188:7: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]
  if (write(sockfd, req, sizeof (*req)) != sizeof (*req)) {
      ^
libfutex_exploit/futex.c:198:7: warning: implicit declaration of function 'read' is invalid in C99 [-Wimplicit-function-declaration]
  if (read(sockfd, req, sizeof (*req)) != sizeof (*req)) {
      ^
5 warnings and 1 error generated.
make: *** [obj/local/arm64-v8a/objs/futex_exploit/futex.o] Error 1

And since I don't know what it should return, I just set it to false, and then this occurs

[arm64-v8a] Compile        : futex_exploit <= exploit.c
libfutex_exploit/exploit.c:82:8: error: redefinition of 'mmsghdr'
struct mmsghdr {
       ^
/root/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm64/usr/include/sys/socket.h:99:8: note: previous definition is here
struct mmsghdr {
       ^
libfutex_exploit/exploit.c:114:17: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static volatile int_sync_time_out = 0;
~~~~~~~~~~~~~~~ ^
libfutex_exploit/exploit.c:221:15: error: assigning to 'sigset_t' from incompatible type 'int'
  act.sa_mask = 0;
              ^ ~
libfutex_exploit/exploit.c:290:15: error: assigning to 'sigset_t' from incompatible type 'int'
  act.sa_mask = 0;
              ^ ~
libfutex_exploit/exploit.c:317:61: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
  pthread_create(&th4, 0, call_futex_lock_pi_with_priority, (void *)prio);
                                                            ^
2 warnings and 3 errors generated.
make: *** [obj/local/arm64-v8a/objs/futex_exploit/exploit.o] Error 1

Please help me out
Please specify as to what it should return and how to resolve this

@dadreamer
Copy link

For create_server_socket you should alter the return to be return true (not false).
For sigset_t change zero assignment of a variable to sigemptyset call.
For mmsghdr please look at this thread.

You just started digging those errors. There are more to come up. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants