mailing list of musl libc
 help / color / mirror / code / Atom feed
* cluts: Incorrect test expectations in buf module (errno)
@ 2011-07-13 13:51 Rich Felker
  2011-07-13 17:01 ` Luka Marčetić
  0 siblings, 1 reply; 2+ messages in thread
From: Rich Felker @ 2011-07-13 13:51 UTC (permalink / raw)
  To: musl

Hi,
It seems cluts' buf module is surprised that strerror_r and ttyname_r
did not set errno to ERANGE. However these functions are not specified
to report anything in errno. Instead they return the error code
directly. This is an unfortunate inconsistency created in the early
days of "reentrant" (_r) functions due to confusion over whether errno
could be safely used in multithreaded programs. Note that some other
functions which return error codes directly are:

posix_* (posix_memalign etc.)
pthread_*

Rich


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cluts: Incorrect test expectations in buf module (errno)
  2011-07-13 13:51 cluts: Incorrect test expectations in buf module (errno) Rich Felker
@ 2011-07-13 17:01 ` Luka Marčetić
  0 siblings, 0 replies; 2+ messages in thread
From: Luka Marčetić @ 2011-07-13 17:01 UTC (permalink / raw)
  To: musl

On 07/13/2011 03:51 PM, Rich Felker wrote:
> Hi,
> It seems cluts' buf module is surprised that strerror_r and ttyname_r
> did not set errno to ERANGE. However these functions are not specified
> to report anything in errno. Instead they return the error code
> directly. This is an unfortunate inconsistency created in the early
> days of "reentrant" (_r) functions due to confusion over whether errno
> could be safely used in multithreaded programs. Note that some other
> functions which return error codes directly are:
>
> posix_* (posix_memalign etc.)
> pthread_*
>
> Rich

Thanks, fixed (will push changes when I hear about SA_NODEFER).
I guess when you write your own implementation of those, you get to know 
them intimately ;-)
Luka.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-13 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-13 13:51 cluts: Incorrect test expectations in buf module (errno) Rich Felker
2011-07-13 17:01 ` Luka Marčetić

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).