1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:18:12 +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

View file

@ -6,6 +6,7 @@
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <Kernel/Syscall.h>
extern "C" {
@ -60,14 +61,12 @@ pid_t setsid()
pid_t tcgetpgrp(int fd)
{
int rc = Syscall::invoke(Syscall::SC_tcgetpgrp, (dword)fd);
__RETURN_WITH_ERRNO(rc, rc, -1);
return ioctl(fd, TIOCGPGRP);
}
int tcsetpgrp(int fd, pid_t pgid)
{
int rc = Syscall::invoke(Syscall::SC_tcsetpgrp, (dword)fd, (dword)pgid);
__RETURN_WITH_ERRNO(rc, rc, -1);
return ioctl(fd, TIOCSPGRP, pgid);
}
int setpgid(pid_t pid, pid_t pgid)