Luna/libc/src/sys/ioctl.cpp

23 lines
390 B
C++

#include <bits/errno-return.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <unistd.h>
extern "C"
{
int ioctl(int fd, int request, ...)
{
va_list ap;
va_start(ap, request);
void* arg = va_arg(ap, void*);
long rc = syscall(SYS_ioctl, fd, request, arg);
va_end(ap);
__errno_return(rc, int);
}
}