qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Shu-Chun Weng via Qemu-devel <qemu-devel@nongnu.org>
To: Laurent Vivier <laurent@vivier.eu>
Cc: Riku Voipio <riku.voipio@iki.fi>,
	qemu-devel@nongnu.org, Shu-Chun Weng <scw@google.com>
Subject: [Qemu-devel] [PATCH 2/2] linux-user: time stamping options for setsockopt()
Date: Thu, 22 Aug 2019 16:14:43 -0700	[thread overview]
Message-ID: <20190822231443.172099-3-scw@google.com> (raw)
In-Reply-To: <20190822231443.172099-1-scw@google.com>

This change supports SO_TIMESTAMPNS and SO_TIMESTAMPING for
setsocketopt() with SOL_SOCKET.

The TARGET_SO_TIMESTAMP{NS,ING} constants are already defined for
alpha, hppa, and sparc. In include/uapi/asm-generic/socket.h:

In arch/mips/include/uapi/asm/socket.h:

Signed-off-by: Shu-Chun Weng <scw@google.com>
---
 linux-user/generic/sockbits.h |  4 ++++
 linux-user/mips/sockbits.h    |  4 ++++
 linux-user/syscall.c          | 10 ++++++++--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h
index e44733c601..5cbafdb49b 100644
--- a/linux-user/generic/sockbits.h
+++ b/linux-user/generic/sockbits.h
@@ -51,6 +51,10 @@
 #define TARGET_SO_PEERNAME             28
 #define TARGET_SO_TIMESTAMP            29
 #define TARGET_SCM_TIMESTAMP           TARGET_SO_TIMESTAMP
+#define TARGET_SO_TIMESTAMPNS          35
+#define TARGET_SCM_TIMESTAMPNS         TARGET_SO_TIMESTAMPNS
+#define TARGET_SO_TIMESTAMPING         37
+#define TARGET_SCM_TIMESTAMPING        TARGET_SO_TIMESTAMPING
 
 #define TARGET_SO_ACCEPTCONN           30
 
diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h
index 0f022cd598..1246b7d988 100644
--- a/linux-user/mips/sockbits.h
+++ b/linux-user/mips/sockbits.h
@@ -63,6 +63,10 @@
 #define TARGET_SO_PEERNAME             28
 #define TARGET_SO_TIMESTAMP            29
 #define SCM_TIMESTAMP          SO_TIMESTAMP
+#define TARGET_SO_TIMESTAMPNS          35
+#define SCM_TIMESTAMPNS         SO_TIMESTAMPNS
+#define TARGET_SO_TIMESTAMPING         37
+#define SCM_TIMESTAMPING        SO_TIMESTAMPING
 
 #define TARGET_SO_PEERSEC              30
 #define TARGET_SO_SNDBUFFORCE          31
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8dc4255f12..bac00d3fd4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2230,8 +2230,14 @@ set_timeout:
                 optname = SO_PASSSEC;
                 break;
         case TARGET_SO_TIMESTAMP:
-		optname = SO_TIMESTAMP;
-		break;
+                optname = SO_TIMESTAMP;
+                break;
+        case TARGET_SO_TIMESTAMPNS:
+                optname = SO_TIMESTAMPNS;
+                break;
+        case TARGET_SO_TIMESTAMPING:
+                optname = SO_TIMESTAMPING;
+                break;
         case TARGET_SO_RCVLOWAT:
 		optname = SO_RCVLOWAT;
 		break;
-- 
2.23.0.187.g17f5b7556c-goog



  parent reply	other threads:[~2019-08-22 23:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 23:14 [Qemu-devel] [PATCH 0/2] Adding some setsockopt() options Shu-Chun Weng via Qemu-devel
2019-08-22 23:14 ` [Qemu-devel] [PATCH 1/2] linux-user: add missing UDP and IPv6 setsockopt options Shu-Chun Weng via Qemu-devel
2019-09-07 14:10   ` Laurent Vivier
2019-08-22 23:14 ` Shu-Chun Weng via Qemu-devel [this message]
2019-09-07 14:26   ` [Qemu-devel] [PATCH 2/2] linux-user: time stamping options for setsockopt() Laurent Vivier
2019-08-22 23:47 ` [Qemu-devel] [PATCH 0/2] Adding some setsockopt() options no-reply
2019-08-23 10:04 ` Aleksandar Markovic
2019-09-06 18:53 ` Shu-Chun Weng via Qemu-devel
2019-09-06 18:56   ` mailer

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=20190822231443.172099-3-scw@google.com \
    --to=qemu-devel@nongnu.org \
    --cc=laurent@vivier.eu \
    --cc=riku.voipio@iki.fi \
    --cc=scw@google.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).