ladybird/LibC/ioctl.cpp
Andreas Kling 3a0a8848fb Make syscall invocations look pleasant.
Old: Syscall::invoke(Syscall::SC_foo, (dword)arg1, (dword)arg2)
New: syscall(SC_foo, arg1, arg2)
2018-12-21 03:02:06 +01:00

20 lines
344 B
C++

#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <Kernel/Syscall.h>
extern "C" {
int ioctl(int fd, unsigned request, ...)
{
va_list ap;
va_start(ap, request);
unsigned arg = va_arg(ap, unsigned);
int rc = syscall(SC_ioctl, fd, request, arg);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}