[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/2] linux-user: time stamping options for setsockop
From: |
Shu-Chun Weng |
Subject: |
[Qemu-devel] [PATCH 2/2] linux-user: time stamping options for setsockopt() |
Date: |
Thu, 22 Aug 2019 16:14:43 -0700 |
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 <address@hidden>
---
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