1 2 3 4 5 6 7 8 9 10 11 12 13
#include <sys/ioctl.h> #include <stdarg.h> #include "syscall.h" int ioctl(int fd, int req, ...) { void *arg; va_list ap; va_start(ap, req); arg = va_arg(ap, void *); va_end(ap); return syscall(SYS_ioctl, fd, req, arg); }