From e5acf4a99e07dfab507a3335027ebde3f466e284 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Thu, 20 Feb 2025 01:49:12 +0200 Subject: [PATCH] feat(userspace/libc): implement getpid, getppid & getuid Signed-off-by: EnderIce2 --- Userspace/libc/src/std/unistd.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Userspace/libc/src/std/unistd.c b/Userspace/libc/src/std/unistd.c index 9bf75384..43e8fffd 100644 --- a/Userspace/libc/src/std/unistd.c +++ b/Userspace/libc/src/std/unistd.c @@ -208,11 +208,25 @@ export char *getpass(const char *); export pid_t getpgid(pid_t); export pid_t getpgrp(void); -export pid_t getpid(void) { return syscall0(SYS_GETPID); } -export pid_t getppid(void) { return syscall0(SYS_GETPPID); } +export pid_t getpid(void) +{ + return call_getpid(); +} + +export pid_t getppid(void) +{ + return call_getppid(); +} export pid_t getsid(pid_t); -export uid_t getuid(void); + +export uid_t getuid(void) +{ + /* FIXME: getuid */ + return 0; + // return call_getuid(); +} + export char *getwd(char *); export int isatty(int); export int lchown(const char *, uid_t, gid_t);