|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [UNIKRAFT PATCH 1/5] lib/vfscore: Register `getpid` and `getppid` to syscall_shim
Registers `getpid` and `getppid` system call to syscall_shim library.
Signed-off-by: Constantin Raducanu <raducanu.costi@xxxxxxxxx>
---
lib/posix-process/Makefile.uk | 2 ++
lib/posix-process/process.c | 6 +++---
lib/posix-user/exportsyms.uk | 6 ++++++
3 files changed, 11 insertions(+), 3 deletions(-)
create mode 100644 lib/posix-user/exportsyms.uk
diff --git a/lib/posix-process/Makefile.uk b/lib/posix-process/Makefile.uk
index f7a623d..0b3ac82 100644
--- a/lib/posix-process/Makefile.uk
+++ b/lib/posix-process/Makefile.uk
@@ -10,3 +10,5 @@ LIBPOSIX_PROCESS_SUPPRESS_FLAGS-y += -Wno-unused-parameter
LIBPOSIX_PROCESS_CFLAGS-y += $(LIBPOSIX_PROCESS_SUPPRESS_FLAGS-y)
LIBPOSIX_PROCESS_SRCS-y += $(LIBPOSIX_PROCESS_BASE)/process.c
+
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBPOSIX_PROCESS) += getpid-0 getppid-0
\ No newline at end of file
diff --git a/lib/posix-process/process.c b/lib/posix-process/process.c
index 0f3bd53..59b5bb0 100644
--- a/lib/posix-process/process.c
+++ b/lib/posix-process/process.c
@@ -40,7 +40,7 @@
#include <sys/resource.h>
#include <uk/process.h>
#include <uk/print.h>
-
+#include <uk/syscall.h>
int fork(void)
{
@@ -215,12 +215,12 @@ pid_t wait4(pid_t pid __unused, int *wstatus __unused,
int options __unused,
return -1;
}
-int getpid(void)
+UK_SYSCALL_R_DEFINE(int, getpid)
{
return UNIKRAFT_PID;
}
-pid_t getppid(void)
+UK_SYSCALL_R_DEFINE(pid_t, getppid)
{
return UNIKRAFT_PPID;
}
diff --git a/lib/posix-user/exportsyms.uk b/lib/posix-user/exportsyms.uk
new file mode 100644
index 0000000..2acde9d
--- /dev/null
+++ b/lib/posix-user/exportsyms.uk
@@ -0,0 +1,6 @@
+getpid
+uk_syscall_e_getpid
+uk_syscall_r_getpid
+getppid
+uk_syscall_e_getppid
+uk_syscall_r_getppid
--
2.17.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |