From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5614 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: C11 threads Date: Sat, 26 Jul 2014 05:03:54 -0400 Message-ID: <20140726090354.GK4038@brightrain.aerifal.cx> References: <20140725104056.GO9928@port70.net> <1406286404.6438.38.camel@eris.loria.fr> <20140725154141.GC4038@brightrain.aerifal.cx> <1406308202.6438.63.camel@eris.loria.fr> <20140725221950.GE4038@brightrain.aerifal.cx> <1406330769.6438.85.camel@eris.loria.fr> <20140726022453.GH4038@brightrain.aerifal.cx> <1406359000.6438.95.camel@eris.loria.fr> <20140726073501.GI4038@brightrain.aerifal.cx> <1406363575.6438.97.camel@eris.loria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1406365455 13280 80.91.229.3 (26 Jul 2014 09:04:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Jul 2014 09:04:15 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5619-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jul 26 11:04:09 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XAxtg-0003Pw-Cy for gllmg-musl@plane.gmane.org; Sat, 26 Jul 2014 11:04:08 +0200 Original-Received: (qmail 24210 invoked by uid 550); 26 Jul 2014 09:04:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 24182 invoked from network); 26 Jul 2014 09:04:06 -0000 Content-Disposition: inline In-Reply-To: <1406363575.6438.97.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5614 Archived-At: On Sat, Jul 26, 2014 at 10:32:55AM +0200, Jens Gustedt wrote: > Anybody with reason and with knowledge of POSIX and C (which are > standards from the same organization, ISO) would just have specified > error codes in line with pthreads. There are not many places in the > standard that uses enumeration constants for a similar purpose, and it > has not much of an advantage. There is the general requirement of the > standard that all constant integer expressions that it defines must be > testable by the preprocessor. I agree that they're ugly and contrary to style used elsewhere in the standard, but I don't see how cross-polluting this mess with errno.h makes it any less offensive. > > It's > > possible that they might match errno values, but that's certainly an > > implementation detail, not something that applications could > > reasonably depend on, and therefore I think it makes no sense to > > require or allow threads.h to expose errno.h. > > As you can see I strongly disagree here. We shouldn't introduce values > that semantically serve as error return values of library functions > and that are not regulated by errno.h and that aren't fixed in > compilation phase 3. Is this just ideological? POSIX has plenty of such values, such as the GAI_*, REG_*, FNM_*, WRDE_*, etc. result codes. Maybe there are not many (any?) in plain C, but C11 added them and I don't think there's any use in trying to change it now... Also C has no precedent for _returning_ error codes (excluding of course Annex K); the errno.h constants are only used with the errno object. Rich