socket: Add SO_TIMESTAMPING_NEW
Add SO_TIMESTAMPING_NEW variant of socket timestamp options. This is the y2038 safe versions of the SO_TIMESTAMPING_OLD for all architectures. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Acked-by: Willem de Bruijn <willemb@google.com> Cc: chris@zankel.net Cc: fenghua.yu@intel.com Cc: rth@twiddle.net Cc: tglx@linutronix.de Cc: ubraun@linux.ibm.com Cc: linux-alpha@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-ia64@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-s390@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: sparclinux@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
887feae36a
commit
9718475e69
@@ -29,6 +29,7 @@
|
||||
#include <linux/pid.h>
|
||||
#include <linux/nsproxy.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/errqueue.h>
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
@@ -252,6 +253,32 @@ out:
|
||||
}
|
||||
EXPORT_SYMBOL(put_cmsg);
|
||||
|
||||
void put_cmsg_scm_timestamping64(struct msghdr *msg, struct scm_timestamping_internal *tss_internal)
|
||||
{
|
||||
struct scm_timestamping64 tss;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(tss.ts); i++) {
|
||||
tss.ts[i].tv_sec = tss_internal->ts[i].tv_sec;
|
||||
tss.ts[i].tv_nsec = tss_internal->ts[i].tv_nsec;
|
||||
}
|
||||
|
||||
put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPING_NEW, sizeof(tss), &tss);
|
||||
}
|
||||
EXPORT_SYMBOL(put_cmsg_scm_timestamping64);
|
||||
|
||||
void put_cmsg_scm_timestamping(struct msghdr *msg, struct scm_timestamping_internal *tss_internal)
|
||||
{
|
||||
struct scm_timestamping tss;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(tss.ts); i++)
|
||||
tss.ts[i] = timespec64_to_timespec(tss_internal->ts[i]);
|
||||
|
||||
put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPING_OLD, sizeof(tss), &tss);
|
||||
}
|
||||
EXPORT_SYMBOL(put_cmsg_scm_timestamping);
|
||||
|
||||
void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
|
||||
{
|
||||
struct cmsghdr __user *cm
|
||||
|
Reference in New Issue
Block a user