summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_socket.h
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2011-03-26 11:05:53 +0000
committeravg <avg@FreeBSD.org>2011-03-26 11:05:53 +0000
commita92365858357b636caacb1f576fcb0c622aebbec (patch)
treedaedfe407e038d5ae066e6a7e69e93ed5a267423 /sys/compat/linux/linux_socket.h
parentae4ae2c803e333c9798cad1469c5f0cf31c9bb41 (diff)
downloadFreeBSD-src-a92365858357b636caacb1f576fcb0c622aebbec.zip
FreeBSD-src-a92365858357b636caacb1f576fcb0c622aebbec.tar.gz
linux compat: improve and fix sendmsg/recvmsg compatibility
- implement baseic stubs for capget, capset, prctl PR_GET_KEEPCAPS and prctl PR_SET_KEEPCAPS. - add SCM_CREDS support to sendmsg and recvmsg - modify sendmsg to ignore control messages if not using UNIX domain sockets This should allow linux pulse audio daemon and client work on FreeBSD and interoperate with native counter-parts modulo the differences in pulseaudio versions. PR: kern/149168 Submitted by: John Wehle <john@feith.com> Reviewed by: netchild MFC after: 2 weeks
Diffstat (limited to 'sys/compat/linux/linux_socket.h')
-rw-r--r--sys/compat/linux/linux_socket.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h
index c716f02..1fe53ed 100644
--- a/sys/compat/linux/linux_socket.h
+++ b/sys/compat/linux/linux_socket.h
@@ -53,6 +53,7 @@
/* Socket-level control message types */
#define LINUX_SCM_RIGHTS 0x01
+#define LINUX_SCM_CREDENTIALS 0x02
/* Ancilliary data object information macros */
@@ -66,13 +67,14 @@
#define LINUX_CMSG_FIRSTHDR(msg) \
((msg)->msg_controllen >= \
sizeof(struct l_cmsghdr) ? \
- (struct l_cmsghdr *)((msg)->msg_control) : \
+ (struct l_cmsghdr *) \
+ PTRIN((msg)->msg_control) : \
(struct l_cmsghdr *)(NULL))
#define LINUX_CMSG_NXTHDR(msg, cmsg) \
((((char *)(cmsg) + \
LINUX_CMSG_ALIGN((cmsg)->cmsg_len) + \
sizeof(*(cmsg))) > \
- (((char *)(msg)->msg_control) + \
+ (((char *)PTRIN((msg)->msg_control)) + \
(msg)->msg_controllen)) ? \
(struct l_cmsghdr *) NULL : \
(struct l_cmsghdr *)((char *)(cmsg) + \
OpenPOWER on IntegriCloud