Skip to content

compile error on LD_PRELOAD version #942

Description

@zcuder

following instructions by https://cloud.tencent.com/developer/article/2278480 using branch dev
But got compile errors:
./ff_declare_syscalls.h:25:22: error: conflicting types for ‘ioctl’; have ‘int(int, long unsigned int, long unsigned int)’
25 | FF_SYSCALL_DECL(int, ioctl, (int, unsigned long, unsigned long));
| ^~~~~
ff_hook_syscall.c:37:28: note: in definition of macro ‘strong_alias’
37 | extern __typeof (name) aliasname attribute ((alias (#name)));
| ^~~~~~~~~
./ff_declare_syscalls.h:25:1: note: in expansion of macro ‘FF_SYSCALL_DECL’
25 | FF_SYSCALL_DECL(int, ioctl, (int, unsigned long, unsigned long));
| ^~~~~~~~~~~~~~~
In file included from /usr/include/sys/epoll.h:22,
from ff_hook_syscall.c:4:
/usr/include/sys/ioctl.h:42:12: note: previous declaration of ‘ioctl’ with type ‘int(int, long unsigned int, ...)’
42 | extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
| ^~~~~
make: *** [Makefile:129: ff_hook_syscall.o] Error 1
uname -r
5.15.178-120.180.amzn2.x86_64

It looks to me ioctl has always been variable paramerters. int ioctl (int __fd, unsigned long int __request, ...) https://man7.org/linux/man-pages/man2/ioctl.2.html
I am wondering how actually does this work, and any expert could help fix this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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