1

In the android sdk path sdk/bionic/libc/bionic/ there are the C API resource code, such as fork.c, ioctl.c etc.. when open ioctl.c:

#include <stdarg.h> extern int __ioctl(int, int, void *); int ioctl(int fd, int request, ...) { va_list ap; void * arg; enter code here va_start(ap, request); arg = va_arg(ap, void *); va_end(ap); return __ioctl(fd, request, arg); } 

extern int __ioctl(int, int, void *); this means __ioctl(int, int, void *) has been defined somewhere. So I want to know where is the original defined place. Thanks a lot!

2 Answers 2

1

As mentioned, the _ioctl is just a wrapper to a syscall, implemented in asm. In the AOSP code, it can be found in bionic/libc/arch-XXX/syscalls/_ioctl.S where arch-XXX is arch-arm, arch-x86 or arch-mips depending on your target architecture.

Sign up to request clarification or add additional context in comments.

Comments

0

It may be elsewhere in the bionic tree (grep is your friend), or automatically generated as part of the build process, but either way, it's completely uninteresting. It's just a syscall wrapper. All of the interesting work is in the kernel.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.