From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/693 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] _BSD_SOURCE for unistd.h, take 2 Date: Fri, 6 Apr 2012 19:32:12 -0400 Message-ID: <20120406233212.GG8803@brightrain.aerifal.cx> References: <20120405155508.0f782675@newbook> <20120406001049.GA8803@brightrain.aerifal.cx> <20120405184534.77ad0b4b@newbook> <20120406144829.GF8803@brightrain.aerifal.cx> <20120406084808.1c71d502@newbook> 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: dough.gmane.org 1333755039 13739 80.91.229.3 (6 Apr 2012 23:30:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Apr 2012 23:30:39 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-694-gllmg-musl=m.gmane.org@lists.openwall.com Sat Apr 07 01:30:38 2012 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 1SGIbx-0000TB-Ud for gllmg-musl@plane.gmane.org; Sat, 07 Apr 2012 01:30:34 +0200 Original-Received: (qmail 32592 invoked by uid 550); 6 Apr 2012 23:30:33 -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 32584 invoked from network); 6 Apr 2012 23:30:33 -0000 Content-Disposition: inline In-Reply-To: <20120406084808.1c71d502@newbook> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:693 Archived-At: On Fri, Apr 06, 2012 at 08:48:08AM -0700, Isaac Dunham wrote: > On Fri, 6 Apr 2012 10:48:29 -0400 > Rich Felker wrote: > > Looking at this again, it looks to me like almost all of the functions > > under _GNU_SOURCE are also present on BSD. That is to say, just > > replacing #ifdef _GNU_SOURCE with > > > > #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) > > > > would give a closer approximation to what _BSD_SOURCE is supposed to > > do. I'm not saying this is the best solution, but before I go > > committing patches to support _BSD_SOURCE, > Yep, looks like I missed some. > get_current_dir_name, setresuid and setresgid (as well as forkall...) > are the only ones that aren't defined with _BSD_SOURCE. > > Still, I tend to prefer having some respect for even unofficial > namespaces. > > Attached is a patch (3rd revision) that has all the _BSD_SOURCE > functions properly classified. Looks good. One change I will probably make when committing is to just remove forkall; it does not work and in fact this function is fundamentally impossible to have working correctly on any OS due to contradictory requirements for mutex behavior. A more general issue: this patch addresses _BSD_SOURCE enabling the nonstandard functions, but what should the behavior of _BSD_SOURCE be with regards to functions that are in XSI but not POSIX base? My inclination is to make it so _BSD_SOURCE implies _XOPEN_SOURCE and _POSIX_C_SOURCE everywhere (i.e. add it to all the big || lists in all the headers) unless there's a strong argument against doing this. As it stands, defining just _BSD_SOURCE but not _POSIX_C_SOURCE or _XOPEN_SOURCE would leave you with a fairly broken set of headers, I think.. Rich