[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/13] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}
From: |
Laurent Vivier |
Subject: |
[PULL 10/13] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL} |
Date: |
Mon, 15 Feb 2021 13:45:16 +0100 |
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
These were defined for other platforms but mistakenly left out of mips
and generic, so this commit adds them to the places missing. Then it
makes them be translated in getsockopt.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210204153925.2030606-1-Jason@zx2c4.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/generic/sockbits.h | 3 +++
linux-user/mips/sockbits.h | 2 ++
linux-user/syscall.c | 6 ++++++
3 files changed, 11 insertions(+)
diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h
index e44733c601a4..b3b4a8e44c6d 100644
--- a/linux-user/generic/sockbits.h
+++ b/linux-user/generic/sockbits.h
@@ -55,4 +55,7 @@
#define TARGET_SO_ACCEPTCONN 30
#define TARGET_SO_PEERSEC 31
+
+#define TARGET_SO_PROTOCOL 38
+#define TARGET_SO_DOMAIN 39
#endif
diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h
index 0f022cd598a9..562cad88e2f8 100644
--- a/linux-user/mips/sockbits.h
+++ b/linux-user/mips/sockbits.h
@@ -40,6 +40,8 @@
#define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */
#define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */
#define TARGET_SO_ACCEPTCONN 0x1009
+#define TARGET_SO_PROTOCOL 0x1028 /* protocol type */
+#define TARGET_SO_DOMAIN 0x1029 /* domain/socket family */
/* linux-specific, might as well be the same as on i386 */
#define TARGET_SO_NO_CHECK 11
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6fea00869e6b..36b090105522 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2837,6 +2837,12 @@ get_timeout:
case TARGET_SO_ACCEPTCONN:
optname = SO_ACCEPTCONN;
goto int_case;
+ case TARGET_SO_PROTOCOL:
+ optname = SO_PROTOCOL;
+ goto int_case;
+ case TARGET_SO_DOMAIN:
+ optname = SO_DOMAIN;
+ goto int_case;
default:
goto int_case;
}
--
2.29.2
- [PULL 00/13] Linux user for 6.0 patches, Laurent Vivier, 2021/02/15
- [PULL 05/13] linux-user: fix O_NONBLOCK usage for hppa target, Laurent Vivier, 2021/02/15
- [PULL 06/13] linux-user: fix O_NONBLOCK in signalfd4() and eventfd2() syscalls, Laurent Vivier, 2021/02/15
- [PULL 09/13] linux-user/syscall: Fix do_ioctl_ifconf() for 64 bit targets., Laurent Vivier, 2021/02/15
- [PULL 07/13] linux-user: Fix loading of BSS segments, Laurent Vivier, 2021/02/15
- [PULL 04/13] linux-user: Add missing TARGET___O_TMPFILE for hppa and alpha, Laurent Vivier, 2021/02/15
- [PULL 12/13] docs/user: Remove outdated 'Quick Start' section, Laurent Vivier, 2021/02/15
- [PULL 13/13] linux-user/mips: Support the n32 ABI for the R5900, Laurent Vivier, 2021/02/15
- [PULL 10/13] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL},
Laurent Vivier <=
- [PULL 08/13] linux-user/mmap: Avoid asserts for out of range mremap calls, Laurent Vivier, 2021/02/15
- [PULL 02/13] linux-user/mips64: Support o32 ABI syscalls, Laurent Vivier, 2021/02/15
- [PULL 01/13] linux-user/mips64: Restore setup_frame() for o32 ABI, Laurent Vivier, 2021/02/15
- [PULL 11/13] linux-user: target: signal: Support TARGET_SS_AUTODISARM, Laurent Vivier, 2021/02/15
- [PULL 03/13] linux-user/signal: Decode waitid si_code, Laurent Vivier, 2021/02/15
- Re: [PULL 00/13] Linux user for 6.0 patches, Philippe Mathieu-Daudé, 2021/02/15