tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: {clock,pthread}_getcpuclockid return values



In article <20170227153935.GA9153%issan.sis.pasteur.fr@localhost>,
Nicolas Joly  <njoly%pasteur.fr@localhost> wrote:
>
>Hi,
>
>Checking the Opengroup online specifications, i noticed that both
>clock_getcpuclockid[1] and pthread_getcpuclockid[2] should return 0 on
>success and an error number otherwise. But our implementation does not
>follow that and returns -1 and set errno on failure. Both functions
>are wrappers around clock_getcpuclockid2 syscall.
>
>Unless there is a specific reason for this behaviour, we'll have to
>fix them for follow the standard ... but where. Both wrappers, or the
>underling syscall ?
>
>Thanks.
>
>[1]
>http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getcpuclockid.html
>[2]
>http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getcpuclockid.html

I am torn; on one side making it NOERR makes clock_getcpuclockid
and clock_getcpuclockid2 returns consistent, but the NOERR syscalls
are inconsistent amongst themselves (for some non-zero returns means
error, others return values that need more examination to see if it
was an error, and some can never return an error). These fall in the
first category, so it is not a big deal.

You choose :-)

christos



Home | Main Index | Thread Index | Old Index