linux-user: implement OFD locks
PATCH 1/1 linux-user: implement OFD locks
Signed-off-by Andreas Schwab <[email protected]>
--- linux-user/generic/fcntl.h | 4 ++++ linux-user/syscall.c | 6 ++++++ 2 files changed, 10 insertions(+)
linux-user/generic/fcntl.h +4 -0
@@ -99,6 +99,10 @@#define TARGET_F_SETLKW64 14#endif +#define TARGET_F_OFD_GETLK 36 +#define TARGET_F_OFD_SETLK 37 +#define TARGET_F_OFD_SETLKW 38 +#ifndef TARGET_F_SETOWN_EX #define TARGET_F_SETOWN_EX 15#define TARGET_F_GETOWN_EX 16
linux-user/syscall.c +6 -0
@@ -6097,6 +6097,9 @@ static int target_to_host_fcntl_cmd(int cmd)case TARGET_F_SETFD :case TARGET_F_GETFL :case TARGET_F_SETFL : +case TARGET_F_OFD_GETLK : +case TARGET_F_OFD_SETLK : +case TARGET_F_OFD_SETLKW : ret = cmd;break ;case TARGET_F_GETLK :
@@ -6382,6 +6385,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)break ;case TARGET_F_GETLK64 : +case TARGET_F_OFD_GETLK : ret =copy_from_user_flock64 (&fl64, arg);if (ret) {return ret;
@@ -6393,6 +6397,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)break ;case TARGET_F_SETLK64 :case TARGET_F_SETLKW64 : +case TARGET_F_OFD_SETLK : +case TARGET_F_OFD_SETLKW : ret =copy_from_user_flock64 (&fl64, arg);if (ret) {return ret;
Signature · 7 lines
2.26.2 -- Andreas Schwab, SUSE Labs, [email protected] GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
Le 25/05/2020 à 09:59, Andreas Schwab a écrit :
Quoted 45 lines
Signed-off-by Andreas Schwab <[email protected]>--- linux-user/generic/fcntl.h | 4 ++++ linux-user/syscall.c | 6 ++++++ 2 files changed, 10 insertions(+)linux-user/generic/fcntl.h +4
-0@@ -99,6 +99,10 @@#define TARGET_F_SETLKW64 14#endif +#define TARGET_F_OFD_GETLK 36 +#define TARGET_F_OFD_SETLK 37 +#define TARGET_F_OFD_SETLKW 38 +#ifndef TARGET_F_SETOWN_EX #define TARGET_F_SETOWN_EX 15#define TARGET_F_GETOWN_EX 16linux-user/syscall.c +4
-0@@ -6097,6 +6097,9 @@ static int target_to_host_fcntl_cmd(int cmd)case TARGET_F_SETFD :case TARGET_F_GETFL :case TARGET_F_SETFL : +case TARGET_F_OFD_GETLK : +case TARGET_F_OFD_SETLK : +case TARGET_F_OFD_SETLKW : ret = cmd;break ;case TARGET_F_GETLK :@@ -6382,6 +6385,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)break ;case TARGET_F_GETLK64 : +case TARGET_F_OFD_GETLK : ret =copy_from_user_flock64 (&fl64, arg);if (ret) {return ret;
linux-user/syscall.c static abi_long do_fcntl(int fd, int cmd, abi_ulong arg) · line 6404
Quoted 8 lines
linux-user/syscall.c +2
-0@@ -6393,6 +6397,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)break ;case TARGET_F_SETLK64 :case TARGET_F_SETLKW64 : +case TARGET_F_OFD_SETLK : +case TARGET_F_OFD_SETLKW : ret =copy_from_user_flock64 (&fl64, arg);if (ret) {return ret;
Reviewed-by Laurent Vivier <[email protected]>
Laurent Vivier
AppliedLe 25/05/2020 à 09:59, Andreas Schwab a écrit :
Quoted 45 lines
Signed-off-by Andreas Schwab <[email protected]>--- linux-user/generic/fcntl.h | 4 ++++ linux-user/syscall.c | 6 ++++++ 2 files changed, 10 insertions(+)linux-user/generic/fcntl.h +4
-0@@ -99,6 +99,10 @@#define TARGET_F_SETLKW64 14#endif +#define TARGET_F_OFD_GETLK 36 +#define TARGET_F_OFD_SETLK 37 +#define TARGET_F_OFD_SETLKW 38 +#ifndef TARGET_F_SETOWN_EX #define TARGET_F_SETOWN_EX 15#define TARGET_F_GETOWN_EX 16linux-user/syscall.c +4
-0@@ -6097,6 +6097,9 @@ static int target_to_host_fcntl_cmd(int cmd)case TARGET_F_SETFD :case TARGET_F_GETFL :case TARGET_F_SETFL : +case TARGET_F_OFD_GETLK : +case TARGET_F_OFD_SETLK : +case TARGET_F_OFD_SETLKW : ret = cmd;break ;case TARGET_F_GETLK :@@ -6382,6 +6385,7 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)break ;case TARGET_F_GETLK64 : +case TARGET_F_OFD_GETLK : ret =copy_from_user_flock64 (&fl64, arg);if (ret) {return ret;
linux-user/syscall.c static abi_long do_fcntl(int fd, int cmd, abi_ulong arg) · line 6404
Quoted 8 lines
linux-user/syscall.c +2
-0@@ -6393,6 +6397,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)break ;case TARGET_F_SETLK64 :case TARGET_F_SETLKW64 : +case TARGET_F_OFD_SETLK : +case TARGET_F_OFD_SETLKW : ret =copy_from_user_flock64 (&fl64, arg);if (ret) {return ret;
Applied to my linux-user branch.
Thanks,
Laurent