Kernel/LibC: implement proper getpgid and setpgid

This commit is contained in:
Bananymous
2023-08-22 14:53:12 +03:00
parent d634fec8dc
commit 60a2185ee6
5 changed files with 117 additions and 12 deletions

View File

@@ -48,8 +48,8 @@ __BEGIN_DECLS
#define SYS_SIGNAL_DONE 41
#define SYS_TCSETPGRP 42
#define SYS_GET_PID 43
#define SYS_GET_PGRP 44
#define SYS_SET_PGRP 45
#define SYS_GET_PGID 44
#define SYS_SET_PGID 45
__END_DECLS

View File

@@ -210,7 +210,12 @@ gid_t getegid(void)
pid_t getpgrp(void)
{
return syscall(SYS_GET_PGRP);
return getpgid(0);
}
pid_t getpgid(pid_t pid)
{
return syscall(SYS_GET_PGID, pid);
}
int seteuid(uid_t uid)
@@ -245,7 +250,13 @@ int setregid(gid_t rgid, gid_t egid)
pid_t setpgrp(void)
{
return syscall(SYS_SET_PGRP);
setpgid(0, 0);
return getpgrp();
}
int setpgid(pid_t pid, pid_t pgid)
{
return syscall(SYS_SET_PGID, pid, pgid);
}
int tcsetpgrp(int fildes, pid_t pgid_id)