aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-08-03 22:13:02 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-08-03 22:13:02 +0000
commit6e0c8e1ae292e567ba6260d9a6c0b771629a89e3 (patch)
tree7e907ced00311ca65beaf6f1c593bdbd544dd01d /sys
parente67c55c998417a2b3ad6d25086e14a96e6fabe69 (diff)
downloadsrc-6e0c8e1ae292e567ba6260d9a6c0b771629a89e3.tar.gz
src-6e0c8e1ae292e567ba6260d9a6c0b771629a89e3.zip
Add SOL_LOCAL symbolic constant for unix socket option level.
The constant seems to exists on MacOS X >= 10.8. Requested by: swills Reviewed by: allanjude, kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25933
Notes
Notes: svn path=/head/; revision=363813
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_usrreq.c2
-rw-r--r--sys/sys/un.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index efd592f82fe2..6261135f64ad 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1470,7 +1470,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt)
struct xucred xu;
int error, optval;
- if (sopt->sopt_level != 0)
+ if (sopt->sopt_level != SOL_LOCAL)
return (EINVAL);
unp = sotounpcb(so);
diff --git a/sys/sys/un.h b/sys/sys/un.h
index 3c408628ce0a..3a011aeef635 100644
--- a/sys/sys/un.h
+++ b/sys/sys/un.h
@@ -62,6 +62,8 @@ struct sockaddr_un {
#if __BSD_VISIBLE
+#define SOL_LOCAL 0 /* Options for local socket */
+
/* Socket options. */
#define LOCAL_PEERCRED 1 /* retrieve peer credentials */
#define LOCAL_CREDS 2 /* pass credentials to receiver */