Skip to contentSkip to conversation

linux-user/syscall.c: add missing linux-specific fnctl commands

PATCH In review Arnaud Patard (Rtp) 2 participants 2 messages Jun 18, 2009 – Jun 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user/syscall.c: add missing linux-specific fnctl commands

This patch is adding missing linux-specific fcntl command. I've tested with ltp test SETLEASE and GETLEASE but there was no tests for F_NOTIFY and F_DUPFD_CLOEXEC.

linux-user/syscall.c +5 -0
Index: qemu/linux-user/syscall.c
===================================================================
@@ -3654,6 +3654,11 @@ static int target_to_host_fcntl_cmd(int 
 	case TARGET_F_SETLKW64:
 	    return F_SETLKW64;
 #endif
+	case TARGET_F_SETLEASE:
+	case TARGET_F_GETLEASE:
+	case TARGET_F_NOTIFY:
+	case TARGET_F_DUPFD_CLOEXEC:
+	    return cmd;
 	default:
             return -TARGET_EINVAL;
     }
linux-user/syscall_defs.h +5 -0
Index: qemu/linux-user/syscall_defs.h
===================================================================
@@ -1732,6 +1732,11 @@ struct target_statfs64 {
 };
 #endif
 
+#define TARGET_F_LINUX_SPECIFIC_BASE 1024
+#define TARGET_F_SETLEASE      (TARGET_F_LINUX_SPECIFIC_BASE + 0)
+#define TARGET_F_GETLEASE      (TARGET_F_LINUX_SPECIFIC_BASE + 1)
+#define TARGET_F_NOTIFY        (TARGET_F_LINUX_SPECIFIC_BASE + 2)
+#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6)
 
 #define TARGET_F_DUPFD         0       /* dup */
 #define TARGET_F_GETFD         1       /* get close_on_exec */
#1 lore raw
Quoted 3 lines · Arnaud Patard

This patch is adding missing linux-specific fcntl command. I've tested with ltp test SETLEASE and GETLEASE but there was no tests for F_NOTIFY and F_DUPFD_CLOEXEC.

Looks fine, picked up for next batch of patches to send.

Quoted 34 lines

Index: qemu/linux-user/syscall.c
===================================================================

linux-user/syscall.c +5 -0
@@ -3654,6 +3654,11 @@ static int target_to_host_fcntl_cmd(int 
 	case TARGET_F_SETLKW64:
 	    return F_SETLKW64;
 #endif
+	case TARGET_F_SETLEASE:
+	case TARGET_F_GETLEASE:
+	case TARGET_F_NOTIFY:
+	case TARGET_F_DUPFD_CLOEXEC:
+	    return cmd;
 	default:
             return -TARGET_EINVAL;
     }

Index: qemu/linux-user/syscall_defs.h
===================================================================

linux-user/syscall_defs.h +5 -0
@@ -1732,6 +1732,11 @@ struct target_statfs64 {
 };
 #endif
 
+#define TARGET_F_LINUX_SPECIFIC_BASE 1024
+#define TARGET_F_SETLEASE      (TARGET_F_LINUX_SPECIFIC_BASE + 0)
+#define TARGET_F_GETLEASE      (TARGET_F_LINUX_SPECIFIC_BASE + 1)
+#define TARGET_F_NOTIFY        (TARGET_F_LINUX_SPECIFIC_BASE + 2)
+#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6)
 
 #define TARGET_F_DUPFD         0       /* dup */
 #define TARGET_F_GETFD         1       /* get close_on_exec */