[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT PATCH 10/11] lib/vfscore: Register `lstat` to syscall_shim



Registers `lstat` system call to syscall_shim library.

Signed-off-by: Constantin Raducanu <raducanu.costi@xxxxxxxxx>
---
 lib/vfscore/Makefile.uk   |  3 ++-
 lib/vfscore/exportsyms.uk |  2 ++
 lib/vfscore/main.c        | 14 +++++++-------
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/lib/vfscore/Makefile.uk b/lib/vfscore/Makefile.uk
index c7025bd..dfd33d6 100644
--- a/lib/vfscore/Makefile.uk
+++ b/lib/vfscore/Makefile.uk
@@ -52,4 +52,5 @@ UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += rename-2
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += fsync-1
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += fdatasync-1
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += preadv-4
-UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += umask-1
\ No newline at end of file
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += umask-1
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += lstat-2
\ No newline at end of file
diff --git a/lib/vfscore/exportsyms.uk b/lib/vfscore/exportsyms.uk
index b9c29b1..6061c85 100644
--- a/lib/vfscore/exportsyms.uk
+++ b/lib/vfscore/exportsyms.uk
@@ -71,6 +71,8 @@ uk_syscall_r_chdir
 fstatat
 statfs
 lstat
+uk_syscall_e_lstat
+uk_syscall_r_lstat
 lchown
 openat
 opendir
diff --git a/lib/vfscore/main.c b/lib/vfscore/main.c
index 18cf17c..8f955ff 100644
--- a/lib/vfscore/main.c
+++ b/lib/vfscore/main.c
@@ -1209,25 +1209,25 @@ int __lxstat(int ver __unused, const char *pathname, 
struct stat *st)
 
        error = task_conv(t, pathname, 0, path);
        if (error) {
-               errno = error;
-               trace_vfs_lstat_err(error);
-               return (-1);
+               goto out_error;
        }
 
        error = sys_lstat(path, st);
        if (error) {
-               errno = error;
-               trace_vfs_lstat_err(error);
-               return (-1);
+               goto out_error;
        }
 
        trace_vfs_lstat_ret();
        return 0;
+
+       out_error:
+       trace_vfs_lstat_err(error);
+       return -error;
 }
 
 LFS64(__lxstat);
 
-int lstat(const char *pathname, struct stat *st)
+UK_SYSCALL_R_DEFINE(int, lstat, const char*, pathname, struct stat*, st)
 {
        return __lxstat(1, pathname, st);
 }
-- 
2.17.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.