This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: signals and _REENT
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: Freddie Chopin <freddie_chopin at op dot pl>
- Cc: newlib at sourceware dot org
- Date: Wed, 25 Feb 2015 12:34:13 -0500 (EST)
- Subject: Re: signals and _REENT
- Authentication-results: sourceware.org; auth=none
- References: <54E8FC58 dot 1060503 at op dot pl> <20150224133049 dot GH437 at calimero dot vinschen dot de> <820331943 dot 24407010 dot 1424801251193 dot JavaMail dot zimbra at redhat dot com> <54ECE7F2 dot 60909 at op dot pl>
Agreed. I will post a patch.
----- Original Message -----
From: "Freddie Chopin" <freddie_chopin@op.pl>
To: newlib@sourceware.org
Sent: Tuesday, February 24, 2015 4:06:58 PM
Subject: Re: signals and _REENT
On 02/24/2015 07:07 PM, Jeff Johnston wrote:
> 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.
If errno is the only reason for using _REENT instead of _GLOBAL_REENT
then this can be easily solved. The functions may still get pointer to
current _REENT (for errno), but signal actions should be taken/set with
_GLOBAL_REENT.
Regards,
FCh