aws-c-common icon indicating copy to clipboard operation
aws-c-common copied to clipboard

Should aws_X_clock_get_ticks() return an error code?

Open graebm opened this issue 6 years ago • 3 comments

Reading the kernel docs, it doesn't seem like these functions can ever fail the way we're using them.

In code we're writing that calls aws_X_clock_get_ticks(), it can be very difficult to handle situations where the clock returned a theoretical error code, so we're not bothering with thorough error handling.

Perhaps the signature should simply be: AWS_COMMON_API uint64_t aws_X_clock_get_ticks(void);

graebm avatar May 24 '18 17:05 graebm

I tend to agree. @bdonlan thoughts?

JonathanHenson avatar May 24 '18 17:05 JonathanHenson

Can we confirm if this is the case for all three major OSes we target?

bdonlan avatar May 24 '18 18:05 bdonlan

Yes, and we checked libc++ source as well.

But embedded systems may fail so maybe we should keep it for the event loop implementations on that platform.

Sent from my iPhone

On May 24, 2018, at 11:24 AM, bdonlan [email protected] wrote:

Can we confirm if this is the case for all three major OSes we target?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

JonathanHenson avatar May 24 '18 18:05 JonathanHenson