Commit 728584be27b95c95fece7740b5e0b80930b5cc45
1 parent
b9adb4a6
fstat64 fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@108 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
12 additions
and
3 deletions
linux-user/syscall.c
... | ... | @@ -2264,7 +2264,16 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, |
2264 | 2264 | ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0)); |
2265 | 2265 | break; |
2266 | 2266 | case TARGET_NR_ugetrlimit: |
2267 | - goto unimplemented; | |
2267 | + { | |
2268 | + struct rlimit rlim; | |
2269 | + ret = get_errno(getrlimit(arg1, &rlim)); | |
2270 | + if (!is_error(ret)) { | |
2271 | + struct target_rlimit *target_rlim = (void *)arg2; | |
2272 | + target_rlim->rlim_cur = tswapl(rlim.rlim_cur); | |
2273 | + target_rlim->rlim_max = tswapl(rlim.rlim_max); | |
2274 | + } | |
2275 | + break; | |
2276 | + } | |
2268 | 2277 | case TARGET_NR_truncate64: |
2269 | 2278 | goto unimplemented; |
2270 | 2279 | case TARGET_NR_ftruncate64: |
... | ... | @@ -2283,7 +2292,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, |
2283 | 2292 | struct target_stat64 *target_st = (void *)arg2; |
2284 | 2293 | memset(target_st, 0, sizeof(struct target_stat64)); |
2285 | 2294 | target_st->st_dev = tswap16(st.st_dev); |
2286 | - target_st->st_ino = tswapl(st.st_ino); | |
2295 | + target_st->st_ino = tswap64(st.st_ino); | |
2287 | 2296 | #ifdef TARGET_STAT64_HAS_BROKEN_ST_INO |
2288 | 2297 | target_st->__st_ino = tswapl(st.st_ino); |
2289 | 2298 | #endif | ... | ... |
syscall-i386.h
... | ... | @@ -330,7 +330,7 @@ struct target_stat64 { |
330 | 330 | target_ulong __pad7; /* will be high 32 bits of ctime someday */ |
331 | 331 | |
332 | 332 | unsigned long long st_ino; |
333 | -}; | |
333 | +} __attribute__((packed)); | |
334 | 334 | |
335 | 335 | #define TARGET_SA_NOCLDSTOP 0x00000001 |
336 | 336 | #define TARGET_SA_NOCLDWAIT 0x00000002 /* not supported yet */ | ... | ... |