From: Michael Kerrisk Date: Wed, 26 Aug 2020 06:10:56 +0000 (+0200) Subject: clock_getres.2: Fix type and variable name in dynamic clock code example X-Git-Tag: man-pages-5.09~492 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb84ed2aae44b6998d4fa5f742032b3c3a755aed;p=thirdparty%2Fman-pages.git clock_getres.2: Fix type and variable name in dynamic clock code example Use 'struct timespec', not 'struct timeval', and adjust the variable name accordingly. Reported-by: Tony May Signed-off-by: Michael Kerrisk --- diff --git a/man2/clock_getres.2 b/man2/clock_getres.2 index c0e486c2ab..8fc7c6fef8 100644 --- a/man2/clock_getres.2 +++ b/man2/clock_getres.2 @@ -251,13 +251,13 @@ dynamic clock ID. #define FD_TO_CLOCKID(fd) ((\(ti(clockid_t) (fd) << 3) | CLOCKFD) #define CLOCKID_TO_FD(clk) ((unsigned int) \(ti((clk) >> 3)) -struct timeval tv; +struct timespec ts; clockid_t clkid; int fd; fd = open("/dev/ptp0", O_RDWR); clkid = FD_TO_CLOCKID(fd); -clock_gettime(clkid, &tv); +clock_gettime(clkid, &ts); .EE .in .SH RETURN VALUE