But then, maybe your problem comes from your code : timeStamp should be
declared as "struct timeval" of course, to get both tv_sec and tv_usec.
struct timeval tv;
ioctl(sock, SIOCSTAMP, &tv);
printf("packet arrived at %ld.%06ld\n", (long)tv.tv_sec, (long)tv.tv_usec);
If you *want* nanosecond resolution instead of microsecond, use :
struct timespec ts;
ioctl(sock, SIOCSTAMPNS, &ts);
printf("packet arrived at %ld.%09ld\n", (long)ts.tv_sec, (long)ts.tv_nsec);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html