Re: CLOCK_MONOTONIC datagram timestamps by the kernel

From: Stephen Hemminger
Date: Thu Mar 01 2007 - 18:35:13 EST


On Fri, 02 Mar 2007 00:14:37 +0100
Eric Dumazet <dada1@xxxxxxxxxxxxx> wrote:

> Stephen Hemminger a Ãcrit :
>
> >
> > You probably want to add a SO_TIMESTAMPNS setsockopt() value like existing SO_TIMESTAMP
>
> You mean an alias like this ?
>
> #define SO_TIMESTAMPNS SO_TIMESTAMP
>
> Or should we really use another value ?

Another value since if someone turns on SO_TIMESTAMP they want usec (timeval)
and SO_TIMESTAMPNS would be for nanosecond values. Trying to set both
flags would be not allowed.

- original -

If the SO_TIMESTAMP option is enabled on a SOCK_DGRAM socket, the
recvmsg(2) call will return a timestamp corresponding to when the data-
gram was received. The msg_control field in the msghdr structure points
to a buffer that contains a cmsghdr structure followed by a struct
timeval. The cmsghdr fields have the following values:

cmsg_len = sizeof(struct timeval)
cmsg_level = SOL_SOCKET
cmsg_type = SCM_TIMESTAMP

- add -
If the SO_TIMESTAMPNS option is enabled on a SOCK_DGRAM socket,
...
cmsg_len = sizeof(struct timespec)
cmsg_level = SOL_SOCKET
cmsg_type = SCM_TIMESTAMPNS
--
Stephen Hemminger <shemminger@xxxxxxxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html