]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: support SO_PASSSEC setsockopt option
authorPaul Burton <paul@archlinuxmips.org>
Sun, 22 Jun 2014 10:25:36 +0000 (11:25 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Sun, 29 Jun 2014 11:19:59 +0000 (14:19 +0300)
Translate the SO_PASSSEC option to setsockopt to the host value &
perform the syscall as expected, allowing use of the option by target
programs.

Signed-off-by: Paul Burton <paul@archlinuxmips.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/socket.h
linux-user/syscall.c

index ae179599021a0bddc90b99a7ea064ef69aba76a3..4dacae612701bef3b310901c3d6ca564aa4fad54 100644 (file)
@@ -63,6 +63,7 @@
     #define TARGET_SO_PEERSEC              30
     #define TARGET_SO_SNDBUFFORCE          31
     #define TARGET_SO_RCVBUFFORCE          33
+    #define TARGET_SO_PASSSEC              34
 
     /** sock_type - Socket types
      *
 
     #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
     #define TARGET_SOCK_TYPE_MASK    0xf  /* Covers up to TARGET_SOCK_MAX-1. */
+
+    #define TARGET_SO_PASSSEC        31
+#else
+    #define TARGET_SO_PASSSEC        34
 #endif
 
     /* For setsockopt(2) */
index bdc60fe0ee8aef83b9d2fabad0a11e132cc6532f..3971cb51d69c4b51d33dcac8a081bcc96efb0bbd 100644 (file)
@@ -1531,6 +1531,9 @@ set_timeout:
         case TARGET_SO_PASSCRED:
                optname = SO_PASSCRED;
                break;
+        case TARGET_SO_PASSSEC:
+                optname = SO_PASSSEC;
+                break;
         case TARGET_SO_TIMESTAMP:
                optname = SO_TIMESTAMP;
                break;