Skip to content

multiple errors when compiling libfutex #1

Open
@iamalsaher

Description

@iamalsaher
[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions