提交 9007f0ef 编写于 作者: T ths

linux-user utimensat() syscall, by Thayne Harbaugh.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3240 c046a42c-6fe2-441c-8c8c-71466251a162
上级 eb296a0a
......@@ -157,6 +157,7 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
#define __NR_sys_tgkill __NR_tgkill
#define __NR_sys_tkill __NR_tkill
#define __NR_sys_unlinkat __NR_unlinkat
#define __NR_sys_utimensat __NR_utimensat
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
......@@ -231,6 +232,10 @@ _syscall1(int,set_tid_address,int *,tidptr)
#if defined(TARGET_NR_unlinkat) && defined(__NR_unlinkat)
_syscall3(int,sys_unlinkat,int,dirfd,const char *,pathname,int,flags)
#endif
#if defined(TARGET_NR_utimensat) && defined(__NR_utimensat)
_syscall4(int,sys_utimensat,int,dirfd,const char *,pathname,
const struct timespec *,tsp,int,flags)
#endif
extern int personality(int);
extern int flock(int, int);
......@@ -4900,6 +4905,27 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
goto unimplemented_nowarn;
#endif
#if defined(TARGET_NR_utimensat) && defined(__NR_utimensat)
case TARGET_NR_utimensat:
{
struct timespec ts[2];
target_to_host_timespec(ts, arg3);
target_to_host_timespec(ts+1, arg3+sizeof(struct target_timespec));
if (!arg2)
ret = get_errno(sys_utimensat(arg1, NULL, ts, arg4));
else {
p = lock_user_string(arg2);
if (!access_ok(VERIFY_READ, p, 1))
ret = -EFAULT;
else
ret = get_errno(sys_utimensat(arg1, path(p), ts, arg4));
if (p)
unlock_user(p, arg2, 0);
}
}
break;
#endif
default:
unimplemented:
gemu_log("qemu: Unsupported syscall: %d\n", num);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册