Convert SCM_TIMESTAMP in recvmsg().
This commit is contained in:
parent
bff1d8cd6f
commit
a71dbd5ba1
@ -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, l_int s, struct l_msghdr *msghdr,
|
||||
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, l_int s, struct l_msghdr *msghdr,
|
||||
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) >
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user