signals and _REENT

Jeff Johnston jjohnstn@redhat.com
Tue Feb 24 19:03:00 GMT 2015


These functions set errno for the caller when an error has occurred.
This would mean a user would have to check the global errno value (not using
the dynamic reentrancy errno macro) which in turn could be changed by
another thread making similar calls and therefore unreliable.

----- Original Message -----
From: "Corinna Vinschen" <vinschen@redhat.com>
To: newlib@sourceware.org
Sent: Tuesday, February 24, 2015 8:30:49 AM
Subject: Re: signals and _REENT

On Feb 21 22:44, Freddie Chopin wrote:
> Hello!
> 
> While browsing newlib's source I noticed that signal-related functions in
> newlib (like signal() or raise()) use _REENT, which is per-thread. Shouldn't
> these functions use _GLOBAL_REENT, which I assume is per-process?

Hmm.  Hard to tell.  I'm not sure about the original intention of
this code.  I *think* you're right, though.  Jeff?


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat



More information about the Newlib mailing list