Add the kernel internal variant of `getpid`, `uk_sys_getpid`. 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
wait4
waitpid
waitid
+uk_sys_getpid
getpid
uk_sys_getppid
getppid
pid_t uk_sys_gettid(void);
pid_t uk_sys_getppid(void);
+pid_t uk_sys_getpid(void);
#if CONFIG_LIBUKSCHED
int uk_posix_process_create(struct uk_alloc *a,
return pthread->process->pid;
}
-UK_SYSCALL_R_DEFINE(pid_t, getpid)
+pid_t uk_sys_getpid(void)
{
if (!pthread_self)
return -ENOTSUP;
#define UNIKRAFT_TID 1
#define UNIKRAFT_PPID 0
-UK_SYSCALL_R_DEFINE(int, getpid)
+pid_t uk_sys_getpid(void)
{
return UNIKRAFT_PID;
}
{
return uk_sys_getppid();
}
+
+UK_SYSCALL_R_DEFINE(pid_t, getpid)
+{
+ return uk_sys_getpid();
+}