Commit 4ce6f8de1aa07cd0587f100200f949a2defdf5cb

Authored by ths
1 parent a029baa4

Fix statfs(64) syscall wrapper, by Andreas Schwab.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3082 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user/syscall.c
... ... @@ -3352,7 +3352,8 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
3352 3352 put_user(stfs.f_bavail, &target_stfs->f_bavail);
3353 3353 put_user(stfs.f_files, &target_stfs->f_files);
3354 3354 put_user(stfs.f_ffree, &target_stfs->f_ffree);
3355   - put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid);
  3355 + put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]);
  3356 + put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]);
3356 3357 put_user(stfs.f_namelen, &target_stfs->f_namelen);
3357 3358 unlock_user_struct(target_stfs, arg2, 1);
3358 3359 }
... ... @@ -3378,7 +3379,8 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
3378 3379 put_user(stfs.f_bavail, &target_stfs->f_bavail);
3379 3380 put_user(stfs.f_files, &target_stfs->f_files);
3380 3381 put_user(stfs.f_ffree, &target_stfs->f_ffree);
3381   - put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid);
  3382 + put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid.val[0]);
  3383 + put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]);
3382 3384 put_user(stfs.f_namelen, &target_stfs->f_namelen);
3383 3385 unlock_user_struct(target_stfs, arg3, 0);
3384 3386 }
... ...
linux-user/syscall_defs.h
... ... @@ -1356,6 +1356,10 @@ struct target_stat64 {
1356 1356 #error unsupported CPU
1357 1357 #endif
1358 1358  
  1359 +typedef struct {
  1360 + int val[2];
  1361 +} target_fsid_t;
  1362 +
1359 1363 #ifdef TARGET_MIPS
1360 1364 struct target_statfs {
1361 1365 target_long f_type;
... ... @@ -1368,7 +1372,7 @@ struct target_statfs {
1368 1372 target_long f_bavail;
1369 1373  
1370 1374 /* Linux specials */
1371   - int f_fsid;
  1375 + target_fsid_t f_fsid;
1372 1376 target_long f_namelen;
1373 1377 target_long f_spare[6];
1374 1378 };
... ... @@ -1383,7 +1387,7 @@ struct target_statfs64 {
1383 1387 uint64_t f_files;
1384 1388 uint64_t f_ffree;
1385 1389 uint64_t f_bavail;
1386   - int f_fsid;
  1390 + target_fsid_t f_fsid;
1387 1391 uint32_t f_namelen;
1388 1392 uint32_t f_spare[6];
1389 1393 };
... ... @@ -1396,7 +1400,7 @@ struct target_statfs {
1396 1400 uint32_t f_bavail;
1397 1401 uint32_t f_files;
1398 1402 uint32_t f_ffree;
1399   - int f_fsid;
  1403 + target_fsid_t f_fsid;
1400 1404 uint32_t f_namelen;
1401 1405 uint32_t f_frsize;
1402 1406 uint32_t f_spare[5];
... ... @@ -1410,7 +1414,7 @@ struct target_statfs64 {
1410 1414 uint64_t f_bavail;
1411 1415 uint64_t f_files;
1412 1416 uint64_t f_ffree;
1413   - int f_fsid;
  1417 + target_fsid_t f_fsid;
1414 1418 uint32_t f_namelen;
1415 1419 uint32_t f_frsize;
1416 1420 uint32_t f_spare[5];
... ...