Patchwork linux-user: Rewrite deprecated fnctl options

login
register
mail settings
Submitter dillona@dillona.com
Date Jan. 4, 2013, 4:29 a.m.
Message ID <1357273746-21133-1-git-send-email-dillona@dillona.com>
Download mbox | patch
Permalink /patch/209362/
State New
Headers show

Comments

dillona@dillona.com - Jan. 4, 2013, 4:29 a.m.
From: Dillon Amburgey <dillona@dillona.com>

glibc on alpha still uses these

Signed-off-by: Dillon Amburgey <dillona@dillona.com>
---
 linux-user/syscall.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Richard Henderson - Jan. 4, 2013, 6:46 p.m.
On 01/03/2013 08:29 PM, dillona@dillona.com wrote:
> From: Dillon Amburgey <dillona@dillona.com>
> 
> glibc on alpha still uses these

No it doesn't.

> +        if (fl.l_type == F_SHLCK)
> +            fl.l_type = F_RDLCK;
> +        if (fl.l_type == F_EXLCK)
> +            fl.l_type = F_WRLCK;

Why would you want to do this?


r~

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e99adab..cb19ba1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4558,6 +4558,10 @@  static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
         fl.l_start = tswapal(target_fl->l_start);
         fl.l_len = tswapal(target_fl->l_len);
         fl.l_pid = tswap32(target_fl->l_pid);
+        if (fl.l_type == F_SHLCK)
+            fl.l_type = F_RDLCK;
+        if (fl.l_type == F_EXLCK)
+            fl.l_type = F_WRLCK;
         unlock_user_struct(target_fl, arg, 0);
         ret = get_errno(fcntl(fd, host_cmd, &fl));
         break;