Skip to contentSkip to conversation

linux-user: Rewrite deprecated fnctl options

PATCH In review [email protected] 2 participants 2 messages Jan 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Rewrite deprecated fnctl options

From: Dillon Amburgey <[email protected]>

glibc on alpha still uses these

---
 linux-user/syscall.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
linux-user/syscall.c +4 -0
index e99adab..cb19ba1 100644
@@ -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;
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 3 lines · On 01/03/2013 08:29 PM, [email protected] wrote:

From: Dillon Amburgey <[email protected]>

glibc on alpha still uses these

No it doesn't.

linux-user/syscall.c static abi_long do_fcntl(int fd, int cmd, abi_ulong arg) · line 4564

Quoted 4 lines
linux-user/syscall.c +4 -0
+        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~