Date: Sat, 9 Jan 2016 18:04:10 +0000 (UTC) From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293597 - stable/10/sys/compat/linux Message-ID: <201601091804.u09I4AQs071511@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Sat Jan 9 18:04:10 2016 New Revision: 293597 URL: https://svnweb.freebsd.org/changeset/base/293597 Log: MFC r283497: Convert SCM_TIMESTAMP in recvmsg(). Modified: stable/10/sys/compat/linux/linux_socket.c stable/10/sys/compat/linux/linux_socket.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_socket.c ============================================================================== --- stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 18:03:09 2016 (r293596) +++ stable/10/sys/compat/linux/linux_socket.c Sat Jan 9 18:04:10 2016 (r293597) @@ -483,6 +483,8 @@ bsd_to_linux_cmsg_type(int cmsg_type) return (LINUX_SCM_RIGHTS); case SCM_CREDS: return (LINUX_SCM_CREDENTIALS); + case SCM_TIMESTAMP: + return (LINUX_SCM_TIMESTAMP); } return (-1); } @@ -1221,6 +1223,8 @@ linux_recvmsg_common(struct thread *td, struct iovec *iov, *uiov; struct mbuf *control = NULL; struct mbuf **controlp; + struct timeval *ftmvl; + l_timeval ltmvl; caddr_t outbuf; void *data; int error, i, fd, fds, *fdp; @@ -1331,6 +1335,18 @@ linux_recvmsg_common(struct thread *td, data = &linux_ucred; datalen = sizeof(linux_ucred); break; + + case SCM_TIMESTAMP: + if (datalen != sizeof(struct timeval)) { + error = EMSGSIZE; + goto bad; + } + ftmvl = (struct timeval *)data; + ltmvl.tv_sec = ftmvl->tv_sec; + ltmvl.tv_usec = ftmvl->tv_usec; + data = <mvl; + datalen = sizeof(ltmvl); + break; } if (outlen + LINUX_CMSG_LEN(datalen) > Modified: stable/10/sys/compat/linux/linux_socket.h ============================================================================== --- stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 18:03:09 2016 (r293596) +++ stable/10/sys/compat/linux/linux_socket.h Sat Jan 9 18:04:10 2016 (r293597) @@ -54,7 +54,8 @@ /* Socket-level control message types */ #define LINUX_SCM_RIGHTS 0x01 -#define LINUX_SCM_CREDENTIALS 0x02 +#define LINUX_SCM_CREDENTIALS 0x02 +#define LINUX_SCM_TIMESTAMP 0x1D struct l_msghdr { l_uintptr_t msg_name;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601091804.u09I4AQs071511>