Skip to contentSkip to conversation

alchemy: *_timed API all wrongly documented?

DISCUSSION Jan Kiszka 2 participants 2 messages Oct 11, 2021

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Philippe,

it looks to me like all those *_timed functions are at least confusingly documented - or broken. They all carry

* @param abs_timeout An absolute date expressed in clock ticks,

and

* @note @a abs_timeout is interpreted as a multiple of the Alchemy
* clock resolution (see --alchemy-clock-resolution option, defaults
* to 1 nanosecond).

However, they also all take a timespec argument as argument, means seconds and nanoseconds, not "ticks" that will be multiplied by some resolution. What was the intended API here? Or what should actually be written here? "Absolute timeout in nanoseconds based on CLOCK_COPPERPLATE, to be rounded according to that clock's resolution"?

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 5 lines · Jan Kiszka

Hi Philippe,

it looks to me like all those *_timed functions are at least confusingly documented - or broken. They all carry

Quoted 8 lines

* @param abs_timeout An absolute date expressed in clock ticks,

and

* @note @a abs_timeout is interpreted as a multiple of the Alchemy
* clock resolution (see --alchemy-clock-resolution option, defaults
* to 1 nanosecond).

This is a left over due to copy/pasting the original documentation of the services taking a legacy RTIME argument instead of the current timespec version. This should be dropped for all *_timed calls, which indeed take a plain secs,nanosecs argument representing an absolute date based on CLOCK_COPPERPLATE - no conversion is done on that one.

Quoted 6 lines

However, they also all take a timespec argument as argument, means seconds and nanoseconds, not "ticks" that will be multiplied by some resolution. What was the intended API here? Or what should actually be written here? "Absolute timeout in nanoseconds based on CLOCK_COPPERPLATE, to be rounded according to that clock's resolution"?

Signature · 1 line
Philippe.