Date: Tue, 17 Sep 1996 19:27:51 -0400 (EDT) From: James Drobina <jdrobina@infinet.com> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/1632: Field names in struct timespec are incorrect Message-ID: <199609172327.TAA29844@infinet.com> Resent-Message-ID: <199609172330.QAA21306@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 1632 >Category: kern >Synopsis: Field names in struct timespec are incorrect >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Sep 17 16:30:01 PDT 1996 >Last-Modified: >Originator: James Drobina >Organization: None >Release: FreeBSD 2.2-CURRENT i386 >Environment: 2.2-CURRENT >Description: In sys/time.h, struct timespec is defined as: /* * Structure defined by POSIX.4 to be like a timeval. */ struct timespec { time_t ts_sec; /* seconds */ long ts_nsec; /* and nanoseconds */ }; The correct names of the fields are tv_sec and tv_nsec. (There was traffic about this problem on freebsd-bugs, but no bug report.) >How-To-Repeat: N/A >Fix: Define the structure as: /* * Structure defined by POSIX.4 to be like a timeval. */ struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; Don't forget the TIMEVAL_TO_TIMESPEC and TIMESPEC_TO_TIMEVAL macros. >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609172327.TAA29844>