|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [UNIKRAFT PATCH 08/10] lib/vfscore: Register `dup` to syscall_shim
Registers `dup` system call to syscall_shim library.
Signed-off-by: Constantin Raducanu <raducanu.costi@xxxxxxxxx>
---
lib/vfscore/Makefile.uk | 1 +
lib/vfscore/exportsyms.uk | 2 ++
lib/vfscore/main.c | 10 ++++++----
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/lib/vfscore/Makefile.uk b/lib/vfscore/Makefile.uk
index 68d108c..a1570ed 100644
--- a/lib/vfscore/Makefile.uk
+++ b/lib/vfscore/Makefile.uk
@@ -41,3 +41,4 @@ UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += chmod-2
UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += fchmod-2
UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += chdir-1
UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += fchdir-1
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += dup-1
diff --git a/lib/vfscore/exportsyms.uk b/lib/vfscore/exportsyms.uk
index 583a75e..e16fa90 100644
--- a/lib/vfscore/exportsyms.uk
+++ b/lib/vfscore/exportsyms.uk
@@ -44,6 +44,8 @@ uk_syscall_e_fchmod
uk_syscall_r_fchmod
fchown
dup
+uk_syscall_e_dup
+uk_syscall_r_dup
dup2
dup3
sync
diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
index c6e446a..67344f9 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -1395,7 +1395,7 @@ int dup(int oldfd)
trace_vfs_dup(oldfd);
error = fget(oldfd, &fp);
if (error)
- goto out_errno;
+ goto out_error;
error = fdalloc(fp, &newfd);
if (error)
@@ -1407,10 +1407,12 @@ int dup(int oldfd)
out_fdrop:
fdrop(fp);
- out_errno:
+
+ out_error:
trace_vfs_dup_err(error);
- errno = error;
- return -1;
+ if(error > 0)
+ return -error;
+ return error;
}
UK_TRACEPOINT(trace_vfs_dup3, "%d %d 0x%x", int, int, int);
--
2.17.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |