linux-user: Correct signedness of target_flock l_start and l_len fields
The l_start and l_len fields in the various target_flock structures are supposed to be '__kernel_off_t' or '__kernel_loff_t', which means they should be signed, not unsigned. Correcting the structure definitions means that __get_user() and __put_user() will correctly sign extend them if the guest is using 32 bit offsets and the host is using 64 bit offsets. This fixes failures in the LTP 'fcntl14' tests where it checks that negative seek offsets work correctly. We reindent the structures to drop hard tabs since we're touching 40% of the fields anyway. RV: long long -> abi_llong as suggested by Laurent Vivier <laurent@vivier.eu> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
parent
49ca6f3e24
commit
8efb2ed5ec
@ -2291,8 +2291,8 @@ struct target_statfs64 {
|
||||
struct target_flock {
|
||||
short l_type;
|
||||
short l_whence;
|
||||
abi_ulong l_start;
|
||||
abi_ulong l_len;
|
||||
abi_long l_start;
|
||||
abi_long l_len;
|
||||
int l_pid;
|
||||
};
|
||||
|
||||
@ -2304,8 +2304,8 @@ struct target_flock64 {
|
||||
|| defined(TARGET_MICROBLAZE) || defined(TARGET_TILEGX)
|
||||
int __pad;
|
||||
#endif
|
||||
unsigned long long l_start;
|
||||
unsigned long long l_len;
|
||||
abi_llong l_start;
|
||||
abi_llong l_len;
|
||||
int l_pid;
|
||||
} QEMU_PACKED;
|
||||
|
||||
@ -2314,8 +2314,8 @@ struct target_eabi_flock64 {
|
||||
short l_type;
|
||||
short l_whence;
|
||||
int __pad;
|
||||
unsigned long long l_start;
|
||||
unsigned long long l_len;
|
||||
abi_llong l_start;
|
||||
abi_llong l_len;
|
||||
int l_pid;
|
||||
} QEMU_PACKED;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user