]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/vfscore: Register `access` to syscall_shim
authorConstantin Raducanu <raducanu.costi@gmail.com>
Tue, 28 Apr 2020 12:07:38 +0000 (15:07 +0300)
committerSimon Kuenzer <simon.kuenzer@neclab.eu>
Fri, 4 Dec 2020 14:49:07 +0000 (15:49 +0100)
Registers `access` system call to syscall_shim library.

Signed-off-by: Constantin Raducanu <raducanu.costi@gmail.com>
Reviewed-by: Daniel Dinca <dincadaniel97@gmail.com>
lib/vfscore/Makefile.uk
lib/vfscore/exportsyms.uk
lib/vfscore/main.c

index c629d0d7d034d544ef0909b956b899a4b25b99e5..890c1ccb3e57c420367cac6903bd54a1034e680b 100644 (file)
@@ -33,3 +33,4 @@ UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += close-1
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += lseek-3
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += ftruncate-2
 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += truncate-2
+UK_PROVIDED_SYSCALLS-$(CONFIG_LIBVFSCORE) += access-2
index e16b83ef13713fdeb10979da531ec1b27d6976ef..a10d942f9ef83c2f7ef01523efcf5a524f8953b8 100644 (file)
@@ -87,6 +87,8 @@ symlink
 statvfs
 fstatvfs
 access
+uk_syscall_e_access
+uk_syscall_r_access
 faccessat
 readlink
 uk_syscall_e_readlink
index 0bd370cf42b10a21272b94020b5e622e5a5e256d..581aeabef71742a78a29824855ee08a84d66f4b9 100644 (file)
@@ -1591,7 +1591,7 @@ UK_TRACEPOINT(trace_vfs_access_err, "%d", int);
 /*
  * Check permission for file access
  */
-int access(const char *pathname, int mode)
+UK_SYSCALL_R_DEFINE(int, access, const char*, pathname, int, mode)
 {
        trace_vfs_access(pathname, mode);
        struct task *t = main_task;
@@ -1605,17 +1605,17 @@ int access(const char *pathname, int mode)
                acc |= VWRITE;
 
        if ((error = task_conv(t, pathname, acc, path)) != 0)
-               goto out_errno;
+               goto out_error;
 
        error = sys_access(path, mode);
        if (error)
-               goto out_errno;
+               goto out_error;
        trace_vfs_access_ret();
        return 0;
-       out_errno:
-       errno = error;
+
+       out_error:
        trace_vfs_access_err(error);
-       return -1;
+       return -error;
 }
 
 int faccessat(int dirfd, const char *pathname, int mode, int flags)