Unix Programming - CLOCK_MONOTONIC datagram timestamps by the kernel

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > February 2007 > CLOCK_MONOTONIC datagram timestamps by the kernel





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author CLOCK_MONOTONIC datagram timestamps by the kernel
Spoon

2007-02-24, 1:16 pm

Hello,

In Linux, it is possible to ask the kernel to timestamp incoming
datagrams when they are received, then to retrieve this timestamp with
an ioctl command.

SIOCGSTAMP
Return a struct timeval with the receive timestamp of the last
packet passed to the user. This is useful for accurate round trip time
measurements. See setitimer(2) for a description of struct timeval.

As far as I understand, this timestamp is given by the CLOCK_REALTIME
clock. I would like to get the timestamp given by a different clock: the
CLOCK_MONOTONIC clock.

In other words, I would like the kernel to do the equivalent of

struct timespec spec;
clock_gettime(CLOCK_MONOTONIC, &spec)

for each datagram the system receives, as soon as it is received.

How can I achieve that?

Is there a different ioctl perhaps? (I don't think so.)
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com