Commit 6db45e6519fee264ef3bbe88f50233f23640b403
1 parent
072ae847
Use correct data structures for stat syscalls, by Magnus Damm.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3001 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
60 additions
and
1 deletions
linux-user/syscall_defs.h
@@ -869,7 +869,7 @@ struct target_winsize { | @@ -869,7 +869,7 @@ struct target_winsize { | ||
869 | #define TARGET_MAP_NORESERVE 0x4000 /* don't check for reservations */ | 869 | #define TARGET_MAP_NORESERVE 0x4000 /* don't check for reservations */ |
870 | #endif | 870 | #endif |
871 | 871 | ||
872 | -#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SH4) | 872 | +#if defined(TARGET_I386) || defined(TARGET_ARM) |
873 | struct target_stat { | 873 | struct target_stat { |
874 | unsigned short st_dev; | 874 | unsigned short st_dev; |
875 | unsigned short __pad1; | 875 | unsigned short __pad1; |
@@ -1242,6 +1242,65 @@ struct target_stat64 { | @@ -1242,6 +1242,65 @@ struct target_stat64 { | ||
1242 | target_long __unused[3]; | 1242 | target_long __unused[3]; |
1243 | }; | 1243 | }; |
1244 | 1244 | ||
1245 | +#elif defined(TARGET_SH4) | ||
1246 | + | ||
1247 | +struct target_stat { | ||
1248 | + target_ulong st_dev; | ||
1249 | + target_ulong st_ino; | ||
1250 | + unsigned short st_mode; | ||
1251 | + unsigned short st_nlink; | ||
1252 | + unsigned short st_uid; | ||
1253 | + unsigned short st_gid; | ||
1254 | + target_ulong st_rdev; | ||
1255 | + target_ulong st_size; | ||
1256 | + target_ulong st_blksize; | ||
1257 | + target_ulong st_blocks; | ||
1258 | + target_ulong target_st_atime; | ||
1259 | + target_ulong target_st_atime_nsec; | ||
1260 | + target_ulong target_st_mtime; | ||
1261 | + target_ulong target_st_mtime_nsec; | ||
1262 | + target_ulong target_st_ctime; | ||
1263 | + target_ulong target_st_ctime_nsec; | ||
1264 | + target_ulong __unused4; | ||
1265 | + target_ulong __unused5; | ||
1266 | +}; | ||
1267 | + | ||
1268 | +/* This matches struct stat64 in glibc2.1, hence the absolutely | ||
1269 | + * insane amounts of padding around dev_t's. | ||
1270 | + */ | ||
1271 | +struct target_stat64 { | ||
1272 | + unsigned long long st_dev; | ||
1273 | + unsigned char __pad0[4]; | ||
1274 | + | ||
1275 | +#define TARGET_STAT64_HAS_BROKEN_ST_INO 1 | ||
1276 | + target_ulong __st_ino; | ||
1277 | + | ||
1278 | + unsigned int st_mode; | ||
1279 | + unsigned int st_nlink; | ||
1280 | + | ||
1281 | + target_ulong st_uid; | ||
1282 | + target_ulong st_gid; | ||
1283 | + | ||
1284 | + unsigned long long st_rdev; | ||
1285 | + unsigned char __pad3[4]; | ||
1286 | + | ||
1287 | + long long st_size; | ||
1288 | + target_ulong st_blksize; | ||
1289 | + | ||
1290 | + unsigned long long st_blocks; /* Number 512-byte blocks allocated. */ | ||
1291 | + | ||
1292 | + target_ulong target_st_atime; | ||
1293 | + target_ulong target_st_atime_nsec; | ||
1294 | + | ||
1295 | + target_ulong target_st_mtime; | ||
1296 | + target_ulong target_st_mtime_nsec; | ||
1297 | + | ||
1298 | + target_ulong target_st_ctime; | ||
1299 | + target_ulong target_st_ctime_nsec; | ||
1300 | + | ||
1301 | + unsigned long long st_ino; | ||
1302 | +}; | ||
1303 | + | ||
1245 | #else | 1304 | #else |
1246 | #error unsupported CPU | 1305 | #error unsupported CPU |
1247 | #endif | 1306 | #endif |