From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Riku Voipio <riku.voipio@iki.fi>,
Laurent Vivier <laurent@vivier.eu>,
Yunqiang Su <ysu@wavecomp.com>,
Aleksandar Markovic <amarkovic@wavecomp.com>
Subject: [Qemu-devel] [PULL 4/4] linux-user: Add support for SO_REUSEPORT
Date: Mon, 12 Nov 2018 21:49:29 +0100 [thread overview]
Message-ID: <20181112204929.12625-5-laurent@vivier.eu> (raw)
In-Reply-To: <20181112204929.12625-1-laurent@vivier.eu>
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>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1540904108-30873-4-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
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 33f4a506a2..d1d14945f9 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 810a58b704..5c166928a4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2061,6 +2061,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;
@@ -2222,6 +2227,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.17.2
next prev parent reply other threads:[~2018-11-12 20:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 20:49 [Qemu-devel] [PULL 0/4] Linux user for 3.1 patches Laurent Vivier
2018-11-12 20:49 ` [Qemu-devel] [PULL 1/4] linux-user: Remove dead error-checking code Laurent Vivier
2018-11-12 20:49 ` [Qemu-devel] [PULL 2/4] linux-user: Don't call gdb_handlesig() before queue_signal() Laurent Vivier
2018-11-12 20:49 ` [Qemu-devel] [PULL 3/4] linux-user: Clean up nios2 main loop signal handling Laurent Vivier
2018-11-12 20:49 ` Laurent Vivier [this message]
2018-11-13 12:32 ` [Qemu-devel] [PULL 0/4] Linux user for 3.1 patches Peter Maydell
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=20181112204929.12625-5-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=amarkovic@wavecomp.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).