Jakub Jelinek 81c97a
--- valgrind-3.7.0/include/vki/vki-ppc64-linux.h.jj	2010-10-08 11:14:21.000000000 +0200
Jakub Jelinek 81c97a
+++ valgrind-3.7.0/include/vki/vki-ppc64-linux.h	2012-01-27 16:45:19.418707191 +0100
Jakub Jelinek 81c97a
@@ -386,6 +386,16 @@ struct vki_sigcontext {
Jakub Jelinek 81c97a
 #define VKI_F_SETSIG        10      /*  for sockets. */
Jakub Jelinek 81c97a
 #define VKI_F_GETSIG        11      /*  for sockets. */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
+#define VKI_F_SETOWN_EX		15
Jakub Jelinek 81c97a
+#define VKI_F_GETOWN_EX		16
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+struct vki_f_owner_ex
Jakub Jelinek 81c97a
+{
Jakub Jelinek 81c97a
+  enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP }
Jakub Jelinek 81c97a
+    type;			/* Owner type of ID.  */
Jakub Jelinek 81c97a
+  __vki_kernel_pid_t pid;	/* ID of owner.  */
Jakub Jelinek 81c97a
+};
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
 /* for F_[GET|SET]FL */
Jakub Jelinek 81c97a
 #define VKI_FD_CLOEXEC  1  /* actually anything with low bit set goes */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
--- valgrind-3.7.0/include/vki/vki-arm-linux.h.jj	2011-03-28 16:09:17.000000000 +0200
Jakub Jelinek 81c97a
+++ valgrind-3.7.0/include/vki/vki-arm-linux.h	2012-01-27 16:44:48.356887209 +0100
Jakub Jelinek 81c97a
@@ -270,6 +270,16 @@ struct vki_sigcontext {
Jakub Jelinek 81c97a
 #define VKI_F_SETLK64		13
Jakub Jelinek 81c97a
 #define VKI_F_SETLKW64		14
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
+#define VKI_F_SETOWN_EX		15
Jakub Jelinek 81c97a
+#define VKI_F_GETOWN_EX		16
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+struct vki_f_owner_ex
Jakub Jelinek 81c97a
+{
Jakub Jelinek 81c97a
+  enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP }
Jakub Jelinek 81c97a
+    type;			/* Owner type of ID.  */
Jakub Jelinek 81c97a
+  __vki_kernel_pid_t pid;	/* ID of owner.  */
Jakub Jelinek 81c97a
+};
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
 /* for F_[GET|SET]FL */
Jakub Jelinek 81c97a
 #define VKI_FD_CLOEXEC	1	/* actually anything with low bit set goes */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
--- valgrind-3.7.0/include/vki/vki-x86-linux.h.jj	2010-10-08 11:14:21.000000000 +0200
Jakub Jelinek 81c97a
+++ valgrind-3.7.0/include/vki/vki-x86-linux.h	2012-01-27 16:43:45.727249836 +0100
Jakub Jelinek 81c97a
@@ -308,6 +308,16 @@ struct vki_sigcontext {
Jakub Jelinek 81c97a
 #define VKI_F_SETLK64		13
Jakub Jelinek 81c97a
 #define VKI_F_SETLKW64		14
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
+#define VKI_F_SETOWN_EX		15
Jakub Jelinek 81c97a
+#define VKI_F_GETOWN_EX		16
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+struct vki_f_owner_ex
Jakub Jelinek 81c97a
+{
Jakub Jelinek 81c97a
+  enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP }
Jakub Jelinek 81c97a
+    type;			/* Owner type of ID.  */
Jakub Jelinek 81c97a
+  __vki_kernel_pid_t pid;	/* ID of owner.  */
Jakub Jelinek 81c97a
+};
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
 /* for F_[GET|SET]FL */
Jakub Jelinek 81c97a
 #define VKI_FD_CLOEXEC	1	/* actually anything with low bit set goes */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
--- valgrind-3.7.0/include/vki/vki-ppc32-linux.h.jj	2010-10-08 11:14:21.000000000 +0200
Jakub Jelinek 81c97a
+++ valgrind-3.7.0/include/vki/vki-ppc32-linux.h	2012-01-27 16:45:11.912752106 +0100
Jakub Jelinek 81c97a
@@ -337,6 +337,16 @@ struct vki_sigcontext {
Jakub Jelinek 81c97a
 #define VKI_F_SETLK64		13
Jakub Jelinek 81c97a
 #define VKI_F_SETLKW64		14
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
+#define VKI_F_SETOWN_EX		15
Jakub Jelinek 81c97a
+#define VKI_F_GETOWN_EX		16
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+struct vki_f_owner_ex
Jakub Jelinek 81c97a
+{
Jakub Jelinek 81c97a
+  enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP }
Jakub Jelinek 81c97a
+    type;			/* Owner type of ID.  */
Jakub Jelinek 81c97a
+  __vki_kernel_pid_t pid;	/* ID of owner.  */
Jakub Jelinek 81c97a
+};
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
 /* for F_[GET|SET]FL */
Jakub Jelinek 81c97a
 #define VKI_FD_CLOEXEC	 1		/* actually anything with low bit set goes */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
--- valgrind-3.7.0/include/vki/vki-s390x-linux.h.jj	2011-06-08 17:26:29.000000000 +0200
Jakub Jelinek 81c97a
+++ valgrind-3.7.0/include/vki/vki-s390x-linux.h	2012-01-27 16:45:31.078639504 +0100
Jakub Jelinek 81c97a
@@ -332,6 +332,16 @@ typedef struct vki_sigaltstack {
Jakub Jelinek 81c97a
 #define VKI_F_SETSIG	10	/* for sockets. */
Jakub Jelinek 81c97a
 #define VKI_F_GETSIG	11	/* for sockets. */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
+#define VKI_F_SETOWN_EX		15
Jakub Jelinek 81c97a
+#define VKI_F_GETOWN_EX		16
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+struct vki_f_owner_ex
Jakub Jelinek 81c97a
+{
Jakub Jelinek 81c97a
+  enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP }
Jakub Jelinek 81c97a
+    type;			/* Owner type of ID.  */
Jakub Jelinek 81c97a
+  __vki_kernel_pid_t pid;	/* ID of owner.  */
Jakub Jelinek 81c97a
+};
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
 #define VKI_FD_CLOEXEC  1  /* actually anything with low bit set goes */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
 #define VKI_F_LINUX_SPECIFIC_BASE   1024
Jakub Jelinek 81c97a
--- valgrind-3.7.0/include/vki/vki-amd64-linux.h.jj	2010-10-08 11:14:21.000000000 +0200
Jakub Jelinek 81c97a
+++ valgrind-3.7.0/include/vki/vki-amd64-linux.h	2012-01-27 16:44:23.592030914 +0100
Jakub Jelinek 81c97a
@@ -268,6 +268,16 @@ struct vki_sigcontext {
Jakub Jelinek 81c97a
 #define VKI_F_SETSIG		10	/*  for sockets. */
Jakub Jelinek 81c97a
 #define VKI_F_GETSIG		11	/*  for sockets. */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
+#define VKI_F_SETOWN_EX		15
Jakub Jelinek 81c97a
+#define VKI_F_GETOWN_EX		16
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+struct vki_f_owner_ex
Jakub Jelinek 81c97a
+{
Jakub Jelinek 81c97a
+  enum { VKI_F_OWNER_TID, VKI_F_OWNER_PID, VKI_F_OWNER_PGRP }
Jakub Jelinek 81c97a
+    type;			/* Owner type of ID.  */
Jakub Jelinek 81c97a
+  __vki_kernel_pid_t pid;	/* ID of owner.  */
Jakub Jelinek 81c97a
+};
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
 #define VKI_FD_CLOEXEC	1	/* actually anything with low bit set goes */
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
 #define VKI_F_LINUX_SPECIFIC_BASE	1024
Jakub Jelinek 81c97a
--- valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c.jj	2011-08-02 14:49:29.000000000 +0200
Jakub Jelinek 81c97a
+++ valgrind-3.7.0/coregrind/m_syswrap/syswrap-linux.c	2012-01-27 17:08:11.621732289 +0100
Jakub Jelinek 81c97a
@@ -3778,6 +3778,22 @@ PRE(sys_fcntl)
Jakub Jelinek 81c97a
                     struct flock64 *, lock);
Jakub Jelinek 81c97a
       break;
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
+   case VKI_F_SETOWN_EX:
Jakub Jelinek 81c97a
+      PRINT("sys_fcntl[F_SETOWN_EX] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3);
Jakub Jelinek 81c97a
+      PRE_REG_READ3(long, "fcntl",
Jakub Jelinek 81c97a
+                    unsigned int, fd, unsigned int, cmd,
Jakub Jelinek 81c97a
+                    struct vki_f_owner_ex *, arg);
Jakub Jelinek 81c97a
+      PRE_MEM_READ("fcntl(F_SETOWN_EX)", ARG3, sizeof(struct vki_f_owner_ex));
Jakub Jelinek 81c97a
+      break;
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+   case VKI_F_GETOWN_EX:
Jakub Jelinek 81c97a
+      PRINT("sys_fcntl[F_GETOWN_EX] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3);
Jakub Jelinek 81c97a
+      PRE_REG_READ3(long, "fcntl",
Jakub Jelinek 81c97a
+                    unsigned int, fd, unsigned int, cmd,
Jakub Jelinek 81c97a
+                    struct vki_f_owner_ex *, arg);
Jakub Jelinek 81c97a
+      PRE_MEM_WRITE("fcntl(F_GETOWN_EX)", ARG3, sizeof(struct vki_f_owner_ex));
Jakub Jelinek 81c97a
+      break;
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
    default:
Jakub Jelinek 81c97a
       PRINT("sys_fcntl[UNKNOWN] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3);
Jakub Jelinek 81c97a
       I_die_here;
Jakub Jelinek 81c97a
@@ -3812,6 +3828,8 @@ POST(sys_fcntl)
Jakub Jelinek 81c97a
          if (VG_(clo_track_fds))
Jakub Jelinek 81c97a
             ML_(record_fd_open_named)(tid, RES);
Jakub Jelinek 81c97a
       }
Jakub Jelinek 81c97a
+   } else if (ARG2 == VKI_F_GETOWN_EX) {
Jakub Jelinek 81c97a
+      POST_MEM_WRITE(ARG3, sizeof(struct vki_f_owner_ex));
Jakub Jelinek 81c97a
    }
Jakub Jelinek 81c97a
 }
Jakub Jelinek 81c97a
 
Jakub Jelinek 81c97a
@@ -3857,6 +3875,22 @@ PRE(sys_fcntl64)
Jakub Jelinek 81c97a
                     unsigned int, fd, unsigned int, cmd,
Jakub Jelinek 81c97a
                     struct flock64 *, lock);
Jakub Jelinek 81c97a
       break;
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+   case VKI_F_SETOWN_EX:
Jakub Jelinek 81c97a
+      PRINT("sys_fcntl[F_SETOWN_EX] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3);
Jakub Jelinek 81c97a
+      PRE_REG_READ3(long, "fcntl",
Jakub Jelinek 81c97a
+                    unsigned int, fd, unsigned int, cmd,
Jakub Jelinek 81c97a
+                    struct vki_f_owner_ex *, arg);
Jakub Jelinek 81c97a
+      PRE_MEM_READ("fcntl(F_SETOWN_EX)", ARG3, sizeof(struct vki_f_owner_ex));
Jakub Jelinek 81c97a
+      break;
Jakub Jelinek 81c97a
+
Jakub Jelinek 81c97a
+   case VKI_F_GETOWN_EX:
Jakub Jelinek 81c97a
+      PRINT("sys_fcntl[F_GETOWN_EX] ( %ld, %ld, %ld )", ARG1,ARG2,ARG3);
Jakub Jelinek 81c97a
+      PRE_REG_READ3(long, "fcntl",
Jakub Jelinek 81c97a
+                    unsigned int, fd, unsigned int, cmd,
Jakub Jelinek 81c97a
+                    struct vki_f_owner_ex *, arg);
Jakub Jelinek 81c97a
+      PRE_MEM_WRITE("fcntl(F_GETOWN_EX)", ARG3, sizeof(struct vki_f_owner_ex));
Jakub Jelinek 81c97a
+      break;
Jakub Jelinek 81c97a
    }
Jakub Jelinek 81c97a
    
Jakub Jelinek 81c97a
 #  if defined(VGP_x86_linux)
Jakub Jelinek 81c97a
@@ -3887,6 +3921,8 @@ POST(sys_fcntl64)
Jakub Jelinek 81c97a
          if (VG_(clo_track_fds))
Jakub Jelinek 81c97a
             ML_(record_fd_open_named)(tid, RES);
Jakub Jelinek 81c97a
       }
Jakub Jelinek 81c97a
+   } else if (ARG2 == VKI_F_GETOWN_EX) {
Jakub Jelinek 81c97a
+      POST_MEM_WRITE(ARG3, sizeof(struct vki_f_owner_ex));
Jakub Jelinek 81c97a
    }
Jakub Jelinek 81c97a
 }
Jakub Jelinek 81c97a