diff options
author | kib <kib@FreeBSD.org> | 2007-02-01 13:36:19 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2007-02-01 13:36:19 +0000 |
commit | 8f812418c1ae9367d5f65cdf384261133103866a (patch) | |
tree | 611522f00adc4f98a7c06a3d071adcf3730527b6 /sys/compat | |
parent | 3f2b6c010a7e8108cc1c386fb716b119a3fdd692 (diff) | |
download | FreeBSD-src-8f812418c1ae9367d5f65cdf384261133103866a.zip FreeBSD-src-8f812418c1ae9367d5f65cdf384261133103866a.tar.gz |
Introduce some more SO_ option equivalents from Linux to FreeBSD.
The msg variable in linux_recvmsg() was not initialized.
Copy it from userspace.
Submitted by: rdivacky
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_socket.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 174fba6..9a90c57 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include <sys/syscallsubr.h> #include <sys/uio.h> #include <sys/syslog.h> +#include <sys/un.h> #include <netinet/in.h> #include <netinet/in_systm.h> @@ -292,6 +293,20 @@ linux_to_bsd_so_sockopt(int opt) return (SO_OOBINLINE); case LINUX_SO_LINGER: return (SO_LINGER); + case LINUX_SO_PEERCRED: + return (LOCAL_PEERCRED); + case LINUX_SO_RCVLOWAT: + return (SO_RCVLOWAT); + case LINUX_SO_SNDLOWAT: + return (SO_SNDLOWAT); + case LINUX_SO_RCVTIMEO: + return (SO_RCVTIMEO); + case LINUX_SO_SNDTIMEO: + return (SO_SNDTIMEO); + case LINUX_SO_TIMESTAMP: + return (SO_TIMESTAMP); + case LINUX_SO_ACCEPTCONN: + return (SO_ACCEPTCONN); } return (-1); } @@ -1048,6 +1063,9 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) if ((error = copyin(args, &linux_args, sizeof(linux_args)))) return (error); + if ((error = copyin(PTRIN(args->msg), &msg, sizeof (msg)))) + return (error); + bsd_args.s = linux_args.s; bsd_args.msg = PTRIN(linux_args.msg); bsd_args.flags = linux_to_bsd_msg_flags(linux_args.flags); |