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:
parent
2529925fe9
commit
c99f8af66d
16 changed files with 94 additions and 45 deletions
19
LibC/ioctl.cpp
Normal file
19
LibC/ioctl.cpp
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue