]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-process: Define kernel internal `getppid`
authorSergiu Moga <sergiu@unikraft.io>
Fri, 7 Feb 2025 09:35:04 +0000 (11:35 +0200)
committerUnikraft Bot <monkey@unikraft.io>
Fri, 14 Feb 2025 14:16:47 +0000 (14:16 +0000)
Add the kernel internal variant of `getppid`, `uk_sys_getppid`. This
allows kernel internal code to call this system call's logic without
having the syscall shim wrapper logic intervene.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1583

lib/posix-process/exportsyms.uk
lib/posix-process/include/uk/process.h
lib/posix-process/process.c

index 427e2ce55fdc817750e08ba754dbd0d664a4b34a..d44e781bb442531f8a79c4305845291b2c595b1e 100644 (file)
@@ -31,6 +31,7 @@ wait4
 waitpid
 waitid
 getpid
+uk_sys_getppid
 getppid
 uk_sys_gettid
 gettid
index e7bdc17cbc4de191f7784d52bea14814357453d5..decd79a2d2165407892ae3a837197ee8d2759ae3 100644 (file)
@@ -148,6 +148,7 @@ static inline int uk_sys_setrlimit(int resource, const struct rlimit *rlim)
 }
 
 pid_t uk_sys_gettid(void);
+pid_t uk_sys_getppid(void);
 
 #if CONFIG_LIBUKSCHED
 int uk_posix_process_create(struct uk_alloc *a,
index 01b20ba716fa00619f859d385a3164c7986da839..bfab83f7fd387c413cced11b83ae3722f92daa81 100644 (file)
@@ -548,7 +548,7 @@ pid_t uk_sys_gettid(void)
 }
 
 /* PID of parent process  */
-UK_SYSCALL_R_DEFINE(pid_t, getppid)
+pid_t uk_sys_getppid(void)
 {
        if (!pthread_self)
                return -ENOTSUP;
@@ -665,7 +665,7 @@ pid_t uk_sys_gettid(void)
        return UNIKRAFT_TID;
 }
 
-UK_SYSCALL_R_DEFINE(pid_t, getppid)
+pid_t uk_sys_getppid(void)
 {
        return UNIKRAFT_PPID;
 }
@@ -676,3 +676,8 @@ UK_SYSCALL_R_DEFINE(pid_t, gettid)
 {
        return uk_sys_gettid();
 }
+
+UK_SYSCALL_R_DEFINE(pid_t, getppid)
+{
+       return uk_sys_getppid();
+}