2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2018-11-16 13:11:21 +01:00
|
|
|
#include <errno.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/ioctl.h>
|
2021-02-05 12:16:30 +01:00
|
|
|
#include <syscall.h>
|
2018-11-16 13:11:21 +01:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
int ioctl(int fd, unsigned request, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, request);
|
|
|
|
unsigned arg = va_arg(ap, unsigned);
|
2018-12-21 03:02:06 +01:00
|
|
|
int rc = syscall(SC_ioctl, fd, request, arg);
|
2020-08-16 17:41:20 -07:00
|
|
|
va_end(ap);
|
2018-11-16 13:11:21 +01:00
|
|
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
|
|
|
}
|
|
|
|
}
|