summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-04-29 20:43:36 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-04-29 20:43:36 +0000
commit728584be27b95c95fece7740b5e0b80930b5cc45 (patch)
tree972d2feee18fbb9620184e6e37f1eead3b108e88
parentb9adb4a6bcf3d2511b6c65aa2e9c6866d03fc88a (diff)
downloadqemu-728584be27b95c95fece7740b5e0b80930b5cc45.tar.gz
fstat64 fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@108 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--linux-user/syscall.c13
-rw-r--r--syscall-i386.h2
2 files changed, 12 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 01e943b70f..e4b543f817 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2264,7 +2264,16 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0));
break;
case TARGET_NR_ugetrlimit:
- goto unimplemented;
+ {
+ struct rlimit rlim;
+ ret = get_errno(getrlimit(arg1, &rlim));
+ if (!is_error(ret)) {
+ struct target_rlimit *target_rlim = (void *)arg2;
+ target_rlim->rlim_cur = tswapl(rlim.rlim_cur);
+ target_rlim->rlim_max = tswapl(rlim.rlim_max);
+ }
+ break;
+ }
case TARGET_NR_truncate64:
goto unimplemented;
case TARGET_NR_ftruncate64:
@@ -2283,7 +2292,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
struct target_stat64 *target_st = (void *)arg2;
memset(target_st, 0, sizeof(struct target_stat64));
target_st->st_dev = tswap16(st.st_dev);
- target_st->st_ino = tswapl(st.st_ino);
+ target_st->st_ino = tswap64(st.st_ino);
#ifdef TARGET_STAT64_HAS_BROKEN_ST_INO
target_st->__st_ino = tswapl(st.st_ino);
#endif
diff --git a/syscall-i386.h b/syscall-i386.h
index a2fb03dead..a38dd32d67 100644
--- a/syscall-i386.h
+++ b/syscall-i386.h
@@ -330,7 +330,7 @@ struct target_stat64 {
target_ulong __pad7; /* will be high 32 bits of ctime someday */
unsigned long long st_ino;
-};
+} __attribute__((packed));
#define TARGET_SA_NOCLDSTOP 0x00000001
#define TARGET_SA_NOCLDWAIT 0x00000002 /* not supported yet */