From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/682 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: Re: Namespace issues, missing functions, _BSD_SOURCE for unistd.h Date: Thu, 5 Apr 2012 18:03:07 -0700 Message-ID: <20120405180307.38e2b00f@newbook> References: <20120405155508.0f782675@newbook> <20120406001049.GA8803@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1333674208 706 80.91.229.3 (6 Apr 2012 01:03:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Apr 2012 01:03:28 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-683-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 06 03:03:28 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 1SFxaK-0007SL-38 for gllmg-musl@plane.gmane.org; Fri, 06 Apr 2012 03:03:28 +0200 Original-Received: (qmail 27730 invoked by uid 550); 6 Apr 2012 01:03:26 -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 27696 invoked from network); 6 Apr 2012 01:03:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=BsccX8jXR906HHpkbsmvRMEmAcJuY+ZQkoLJ9rIu4+hRFuYmRSkFg2/CRACflqMN4ZAqmD17tKDVKzqek9+p05lsu5iV/8CppM9CmASH21Z7UL8fbfCjMWugogT7xtAXLbZWuQTF6mDMwTeqAMP9lV7PhBhY8T+mlGr+ClCS9NE=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <20120406001049.GA8803@brightrain.aerifal.cx> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.20.1; i486-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:682 Archived-At: > There is no "ANSI" namespace in unistd.h because it's not a standard C > header but a POSIX header. It's definitely correct for POSIX 2008 base > as-is without any patching. Should have checked that. I guess it will be a rewrite then. Which profiles are you aiming to support? Latest versions only for POSIX, ISO, and X/Open? Or only versions in the past decade? I don't see any signs of version checks, so I assume you want POSIX2008 and XOPEN2008 (_XOPEN_SOURCE >= 700) only, and no support for SUSv3. This will make the patch a lot smaller and cleaner. > > BSD || XOPEN means the macro test should be > > #if defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE) > > I see glibc turns on both of these with _GNU_SOURCE. > Yes, I think you overlooked some of the logic of how glibc's > features.h works... Tried to decode it, but it's pretty easy to lose track (especially in the ifdef nest that handles XOPEN_SOURCE). > > Misplaced (should be BSD || XOPEN): > > (Properly, these require XOPEN >= 500) > > usleep, ualarm, fchown, fchdir, lchown,vhangup, > > apparently fsync? > All incorrect. > usleep and ualarm were removed by SUSv4/POSIX 2008 and thus do not > belong in any profile except ones with nonstandard extensions. > fchown, fchdir, and lchown are all POSIX 2008 base. > vhangup was perhaps standard at one time but removed OK. _GNU_SOURCE || _BSD_SOURCE It's _XOPEN_SOURCE == 500 || 600, which I take it will not be supported. > AFAIK most of these do not exist in musl at the moment. Guessed that. It was meant as a comment on the status. > > BSD||GNU: .. > > +#if defined(_BSD_SOURCE) && !defined(L_SET) > > +#define L_SET > > +#define L_INCR > > +#define L_XTND > > +#endif Forgot to add the SEEK_SET, etc. here. Should be #define L_SET SEEK_SET .. hence the placement. > > +#if !( (_POSIX_SOURCE - 0) < 200112L ) > > +int seteuid(uid_t); > > +int setegid(gid_t); > > +#endif > > I have no intention of trying to make a profile that conforms to the > 1990 version of POSIX. Forgot they went from straight from 1993 to 2001; I'll take that test out. > > > +#if defined(_BSD_SOURCE) || ... > > +pid_t vfork(void); > > +int vhangup(void); > > +int usleep(unsigned); > > +unsigned ualarm(unsigned, unsigned); > > And these do not exist in SUSv4. (The first two are not in SUSv3 > either.) Will fix. Thanks for the comments. Isaac Dunham