All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
To: qemu-devel@nongnu.org
Cc: aurelien@aurel32.net, arikalo@wavecomp.com,
	smarkovic@wavecomp.com, pjovanovic@wavecomp.com,
	riku.voipio@iki.fi, laurent@vivier.eu, ysu@wavecomp.com
Subject: [Qemu-devel] [PATCH 3/3] linux-user: Add support for SO_REUSEPORT
Date: Tue, 23 Oct 2018 11:58:08 +0200	[thread overview]
Message-ID: <1540288688-4482-4-git-send-email-aleksandar.markovic@rt-rk.com> (raw)
In-Reply-To: <1540288688-4482-1-git-send-email-aleksandar.markovic@rt-rk.com>

From: Yunqiang Su <ysu@wavecomp.com>

Add support for SO_REUSEPORT, including strace support. SO_REUSEPORT
was introduced relatively recently, since Linux 3.9, so use
'#if defined SO_REUSEPORT'.

Signed-off-by: Yunqiang Su <ysu@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 linux-user/strace.c  |  3 +++
 linux-user/syscall.c | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index 33f4a50..d1d1494 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1742,6 +1742,9 @@ print_optint:
         case TARGET_SO_REUSEADDR:
             gemu_log("SO_REUSEADDR,");
             goto print_optint;
+        case TARGET_SO_REUSEPORT:
+            gemu_log("SO_REUSEPORT,");
+            goto print_optint;
         case TARGET_SO_TYPE:
             gemu_log("SO_TYPE,");
             goto print_optint;
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4b00b72..0e9dcfe 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2057,6 +2057,11 @@ set_timeout:
         case TARGET_SO_REUSEADDR:
 		optname = SO_REUSEADDR;
 		break;
+#ifdef SO_REUSEPORT
+        case TARGET_SO_REUSEPORT:
+                optname = SO_REUSEPORT;
+                break;
+#endif
         case TARGET_SO_TYPE:
 		optname = SO_TYPE;
 		break;
@@ -2218,6 +2223,11 @@ static abi_long do_getsockopt(int sockfd, int level, int optname,
         case TARGET_SO_REUSEADDR:
             optname = SO_REUSEADDR;
             goto int_case;
+#ifdef SO_REUSEPORT
+        case TARGET_SO_REUSEPORT:
+            optname = SO_REUSEPORT;
+            goto int_case;
+#endif
         case TARGET_SO_TYPE:
             optname = SO_TYPE;
             goto int_case;
-- 
2.7.4

      parent reply	other threads:[~2018-10-23 10:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  9:58 [Qemu-devel] [PATCH 0/3] linux-user: Support for misc feateres Aleksandar Markovic
2018-10-23  9:58 ` [Qemu-devel] [PATCH 1/3] linux-user: Add support for statx() syscall Aleksandar Markovic
2018-10-23  9:58 ` [Qemu-devel] [PATCH 2/3] linux-user: Add support for semtimedop() syscall Aleksandar Markovic
2018-10-23 12:11   ` Philippe Mathieu-Daudé
2018-10-23  9:58 ` Aleksandar Markovic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1540288688-4482-4-git-send-email-aleksandar.markovic@rt-rk.com \
    --to=aleksandar.markovic@rt-rk.com \
    --cc=arikalo@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=laurent@vivier.eu \
    --cc=pjovanovic@wavecomp.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=smarkovic@wavecomp.com \
    --cc=ysu@wavecomp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.