diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-02-14 16:54:23 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-02-14 16:54:23 +0000 |
commit | 71cd1bccf3bfc4a77434595c3e987daa4e8ff574 (patch) | |
tree | 8de639b675633a69736a26310a4b410d8d99f129 /linux-user/syscall.c | |
parent | bc882694a3c757e7bd95c90e21b048d347ba9244 (diff) | |
parent | 6d485a55d0cd8fbb8b4337b298f79ddb0c2a5511 (diff) |
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging
Implement TARGET_SO_PEERSEC
Fix rt signals management
# gpg: Signature made Thu 13 Feb 2020 12:20:50 GMT
# gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg: issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C
* remotes/vivier2/tags/linux-user-for-5.0-pull-request:
linux-user: implement TARGET_SO_PEERSEC
linux-user: fix use of SIGRTMIN
linux-user: fix TARGET_NSIG and _NSIG uses
linux-user: cleanup signal.c
linux-user: add missing TARGET_SIGRTMIN for hppa
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
# Conflicts:
# linux-user/signal.c
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r-- | linux-user/syscall.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index d60142f069..c930577686 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2344,6 +2344,28 @@ static abi_long do_getsockopt(int sockfd, int level, int optname, } break; } + case TARGET_SO_PEERSEC: { + char *name; + + if (get_user_u32(len, optlen)) { + return -TARGET_EFAULT; + } + if (len < 0) { + return -TARGET_EINVAL; + } + name = lock_user(VERIFY_WRITE, optval_addr, len, 0); + if (!name) { + return -TARGET_EFAULT; + } + lv = len; + ret = get_errno(getsockopt(sockfd, level, SO_PEERSEC, + name, &lv)); + if (put_user_u32(lv, optlen)) { + ret = -TARGET_EFAULT; + } + unlock_user(name, optval_addr, lv); + break; + } case TARGET_SO_LINGER: { struct linger lg; |