mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: [PATCH] _BSD_SOURCE for unistd.h, take 2
Date: Fri, 6 Apr 2012 19:32:12 -0400	[thread overview]
Message-ID: <20120406233212.GG8803@brightrain.aerifal.cx> (raw)
In-Reply-To: <20120406084808.1c71d502@newbook>

On Fri, Apr 06, 2012 at 08:48:08AM -0700, Isaac Dunham wrote:
> On Fri, 6 Apr 2012 10:48:29 -0400
> Rich Felker <dalias@aerifal.cx> 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


  reply	other threads:[~2012-04-06 23:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 22:55 Namespace issues, missing functions, _BSD_SOURCE for unistd.h Isaac Dunham
2012-04-06  0:10 ` Rich Felker
2012-04-06  1:03   ` Isaac Dunham
2012-04-06  1:52     ` Rich Felker
2012-04-06  1:45   ` [PATCH] _BSD_SOURCE for unistd.h, take 2 Isaac Dunham
2012-04-06  2:04     ` Rich Felker
2012-04-06  2:40       ` Isaac Dunham
2012-04-06  2:51         ` Rich Felker
2012-04-06 14:48     ` Rich Felker
2012-04-06 15:48       ` Isaac Dunham
2012-04-06 23:32         ` Rich Felker [this message]
2012-04-07  5:47           ` Isaac Dunham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120406233212.GG8803@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).