pager linux_open/unlink: always use openat/unlinkat

some archs do not have the simple open/unlink variants, while the *at
is always available -- this is simpler than making these arch-dependent
functions

Change-Id: Ic16ae5683e6e375210b1744538d291585e67a2fa
Fujitsu: POSTK_DEBUG_ARCH_DEP_78
This commit is contained in:
Dominique Martinet
2019-01-29 12:52:15 +09:00
parent 342a2e1287
commit 36d473c5b5

View File

@ -168,12 +168,13 @@ static int
linux_open(char *fname, int flag, int mode)
{
ihk_mc_user_context_t ctx0;
int fd;
int fd;
ihk_mc_syscall_arg0(&ctx0) = (uintptr_t) fname;
ihk_mc_syscall_arg1(&ctx0) = flag;
ihk_mc_syscall_arg2(&ctx0) = mode;
fd = syscall_generic_forwarding(__NR_open, &ctx0);
ihk_mc_syscall_arg0(&ctx0) = -100; /* dirfd = AT_FDCWD */
ihk_mc_syscall_arg1(&ctx0) = (uintptr_t)fname; /* pathname = fname */
ihk_mc_syscall_arg2(&ctx0) = flag; /* flags = flag */
ihk_mc_syscall_arg3(&ctx0) = mode; /* mode = mode */
fd = syscall_generic_forwarding(__NR_openat, &ctx0);
return fd;
}
@ -182,8 +183,10 @@ linux_unlink(char *fname)
{
ihk_mc_user_context_t ctx0;
ihk_mc_syscall_arg0(&ctx0) = (uintptr_t) fname;
return syscall_generic_forwarding(__NR_unlink, &ctx0);
ihk_mc_syscall_arg0(&ctx0) = -100; /* dirfd = AT_FDCWD */
ihk_mc_syscall_arg1(&ctx0) = (uintptr_t)fname; /* pathname = fname */
ihk_mc_syscall_arg2(&ctx0) = 0; /* flags = 0 */
return syscall_generic_forwarding(__NR_unlinkat, &ctx0);
}
static ssize_t