Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why is POSIX.1c different w.r.t. errno usage?

different errno usage w.r.t
0
Posted

Why is POSIX.1c different w.r.t. errno usage?

0

Bryan O’Sullivan wrote: > d> It’s an issue because that implementation is “klunky” and, more > d> precisely, inefficient. > > I must admit that optimising for uncommon error cases does not make > much sense to me. Sure. In my sentence, I would have to say that “klunky” was a more important consideration than “inefficient”. However, use of errno is NOT strictly in “uncommon error cases”. For example, pthread_mutex_trylock returns EBUSY when the mutex is locked. That’s a normal informational status, not an “uncommon error”. Similarly, pthread_cond_timedwait returns ETIMEDOUT as a normal informational status, not really an “error”. There are plenty of “traditional” UNIX functions that are similar. It’s certainly not universal, but “uncommon” is an overstatement. > d> Still, why propagate the arcane traditions, just because they > d> exist? > > Because they are traditions. I think there is some non-trivial value > in preserving interface consistency – principle of least surprise, and > all

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123