1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +00:00

Add ioctl() and reimplement tcsetpgrp/tcsetpgrp as ioctls.

This commit is contained in:
Andreas Kling 2018-11-16 13:11:21 +01:00
parent 2529925fe9
commit c99f8af66d
16 changed files with 94 additions and 45 deletions

19
LibC/ioctl.cpp Normal file
View file

@ -0,0 +1,19 @@
#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::invoke(Syscall::SC_ioctl, (dword)fd, (dword)request, (dword)arg);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}