From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/906 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH]_BSD_SOURCE for musl, take 2. Date: Tue, 22 May 2012 16:19:31 -0700 Message-ID: <20120522161931.63139ff9@newbook> References: <20120520232651.4ed2d315@newbook> <20120521133629.GA9215@brightrain.aerifal.cx> <20120521113158.70ce8b36@newbook> <20120522152256.GS163@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 1337728797 8839 80.91.229.3 (22 May 2012 23:19:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 May 2012 23:19:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-907-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 23 01:19:53 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 1SWyMn-0003UM-9T for gllmg-musl@plane.gmane.org; Wed, 23 May 2012 01:19:49 +0200 Original-Received: (qmail 24572 invoked by uid 550); 22 May 2012 23:19:49 -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 24564 invoked from network); 22 May 2012 23:19:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=Px4TT8LARJ4L0Y4v50JJrYACtPASf6C6Kz9f1ElwDu1cgDb6kCMqGvft1HTimkOnAVM2fqOBNPg8hiQ1eq/d/k4lCPKIjaXUd1m2tMLcElVgd47mLJfYcp3JNjg2+gFTCvg39KiqWBn5knOzPT6xhIj6niOYvTEZN+8csexqWr4=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <20120522152256.GS163@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:906 Archived-At: On Tue, 22 May 2012 11:22:56 -0400 Rich Felker wrote: > On Mon, May 21, 2012 at 11:31:58AM -0700, Isaac Dunham wrote: > > Here's a second verion of the patch, with all the issues below > > addressed. > > Looks good. A few more things, mostly just questions to make sure > stuff is ok.. > > > I'm still declaring bsd_signal if _BSD_SOURCE is defined, because it > > uses the signature of BSD signal(). > > Is there a reason for this? bsd_signal was a legacy SUSv3 function > removed in SUSv4/POSIX-2008, which was originally added mainly so that > programs written for BSD signal semantics could do: > > #define signal bsd_signal > > on non-BSD systems and still work. On glibc and musl it's utterly > useless since signal, by default, has BSD semantics. (POSIX allows > either and only BSD is sane.) > I doubt any code for BSD would ever be calling bsd_signal, as the > whole purpose of it is to provide an alternate function with BSD > behavior on non-BSD systems. I had not realized that musl used BSD semantics. You can drop that, if you want. > > diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h > > index c8a1a4b..797ce68 100644 > > --- a/include/netinet/tcp.h > > +++ b/include/netinet/tcp.h > > @@ -2,5 +2,22 @@ > > #define _NETINET_TCP_H > > > > #define TCP_NODELAY 1 > > +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) > > +#include > > +#include > > +#define TCP_MAXSEG 2 > > +#define TCP_CORK 3 > > +#define TCP_KEEPIDLE 4 > > [...] > > TCP_* is in the reserved namespace for this header, so I think it > would be reasonable to define all the macros unconditionally. What > about the two includes, though? If they're needed to make GNU/BSD > programs work, we should still keep the check just for them. I'm not sure whether the includes are expected by some programs. > > diff --git a/include/unistd.h b/include/unistd.h > > index b1a84d7..0112276 100644 > > --- a/include/unistd.h > > +++ b/include/unistd.h > > @@ -16,6 +16,12 @@ extern "C" { > > #define SEEK_CUR 1 > > #define SEEK_END 2 > > > > +#if defined(_BSD_SOURCE) && !defined(L_SET) > > +#define L_SET SEEK_SET > > +#define L_INCR SEEK_CUR > > +#define L_XTND SEEK_END > > Is L_SET defined somewhere else? Not in the patch; glibc has it in sys/file.h, which I somehow missed. I'm inclined to say keep the test and I'll send a patch for that, but take your pick. For unknown reasons it looks like sys/file.h has no content except that protected by _GNU_SOURCE | _BSD_SOURCE -- which sounds like an unnecessary test. Isaac Dunham