Re: Long-standing bugs and typos

Clive Messer (clive@epos.demon.co.uk)
Sat, 9 Mar 1996 02:45:56 +0000 (GMT)


On Fri, 8 Mar 1996, Daniel Deckers wrote:

> Another possible typo may be found in <linux/time.h>, which recently (late
> 1.3.5x I think) had a timespec struct added to it that looks like this:
>
> struct timespec {
> long tv_sec; /* seconds */
> long tv_nsec; /* nanoseconds */
> };
>
> I suspect these are typos (from timeval?) for ts_sec/ts_nsec respectively?
>
> libc-5.2.18 has the following (conflicting) definition of timespec in its
> include/pthread/mit/sys/timers.h:
>
> struct timespec {
> time_t ts_sec;
> long ts_nsec;
> };
>
> I suspect one of these ought to be changed...

This is not the first time this has been mentioned.

-----------------------------------------------------------------------
>From mskuhn@unrza3.dialin.rrze.uni-erlangen.deSat Mar 9 02:39:27 1996
Date: 13 Feb 1996 17:44:01 +0100
From: Markus Kuhn <mskuhn@unrza3.dialin.rrze.uni-erlangen.de>
Reply to: mskuhn@cip.informatik.uni-erlangen.de
Newsgroups: comp.os.linux.development.system
Subject: Re: Linux 1.3.62 broke POSIX timespec compliance

Bryon G. Rigg writes:

>I was wondering why the change in the 1.3.62 kernel for linux/time.h.
>The following struct is POSIX (pre 1.3.62):

> struct timespec {
> long tv_sec; /* seconds */
> long tv_nsec; /* nanoseconds */
> };

>The following struct is not POSIX (new change with 1.3.62):

> struct timespec {
> long ts_sec; /* seconds */
> long ts_nsec; /* nanoseconds */
> };

>Any code that you had written to the POSIX specification for this
>structure will no longer compile. Why the change?

I have no idea why this has been changed. Please forward the following
to whoever made this change.

I wrote the old patch which added the original POSIX.1b conforming
struct timespec with tv_*, that is used for example in the POSIX.1b
sched_rr_get_interval() system call (see kernel/sched.c).

I suggest to reverse this new 1.3.62 change quickly. The original
struct timespec definition conformed to POSIX.1b (to be precise: IEEE
Std 1003.1b-1993, section 14.1.1, page 261). Or has this been changed
in the POSIX spec recently (then please tell which document?)?

[For those how do not have yet access to the document:

You can order the POSIX.1b standard (officially called IEEE Std
1003.1b-1993; this book includes also all text of POSIX.1) as well as
the other POSIX standards directly from IEEE:

phone: +1 908 981 1393 (TZ: eastern standard time)
1 800 678 4333 (from US+Canada only)
fax: +1 908 981 9667
e-mail: stds.info@ieee.org

Information about POSIX and other IEEE standards is also available on
<http://stdsbbs.ieee.org:70/0/pub/ieeestds.htm>, however unfortunately
the full standard documents are only available as books or on CD-ROM,
not on the Internet. Having access to the POSIX specs is certainly a
good idea for any Linux kernel hacker.]

Markus

-- 
Markus Kuhn, Computer Science student -- University of Erlangen,
Internet Mail: <mskuhn@cip.informatik.uni-erlangen.de> - Germany
WWW Home: <http://wwwcip.informatik.uni-erlangen.de/user/mskuhn>
-------------------------------------------------------------------------

Clive.

-- 
C Messer. Epos Systems. UK.  |
<clive@epos.demon.co.uk>     |   "I pressed her thigh and death smiled."
<epos@easynet.co.uk>         |    Jim Morrison.