Why is POSIX.1c different w.r.t. errno usage?
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