[lkml]   [2003]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Fire Engine??
On Wed, 26 Nov 2003 12:03:16 -0800
"David S. Miller" <> wrote:

> On Wed, 26 Nov 2003 11:58:44 -0800
> Paul Menage <> wrote:
> > How about tracking the number of current sockets that have had timestamp
> > requests for them? If this number is zero, don't bother with the
> > timestamps. The first time you get a SIOCGSTAMP ioctl on a given socket,
> > bump the count and set a flag; decrement the count when the socket is
> > destroyed if the flag is set.
> Reread what I said please, the user can ask for timestamps using CMSG
> objects via the recvmsg() system call, there are no ioctls or socket
> controls done on the socket. It is completely dynamic and
> unpredictable.

The user sets the SO_TIMESTAMP setsockopt to 1 and then you get the cmsg.
That's per socket state. The other way is to use the SIOCGTSTAMP ioctl.
That is a bit more ugly because it has no state, but you can do
a heuristic and assume that an process that does SIOCGTSTAMP once
will do it in future too and set a flag in this case.

The first SIOCGTSTAMP would be inaccurate, but the following (after
all untimestamped packets have been flushed) would be ok.

Doing for IP would be relatively easy, the only major user of the
timestamp seems to be DECnet and the bridge, but I supose those could be
converted to use jiffies too.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:58    [W:0.064 / U:1.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site