From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8494 Path: news.gmane.org!not-for-mail From: Yuxin Ren Newsgroups: gmane.linux.lib.musl.general Subject: Re: Why musl define PAGE_SIZE Date: Fri, 11 Sep 2015 15:53:38 -0400 Message-ID: References: <20150911194359.GB1965@newbook> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1132f6625f65d4051f7e1284 X-Trace: ger.gmane.org 1442001241 6793 80.91.229.3 (11 Sep 2015 19:54:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Sep 2015 19:54:01 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8506-gllmg-musl=m.gmane.org@lists.openwall.com Fri Sep 11 21:53:57 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZaUOO-0007w0-JL for gllmg-musl@m.gmane.org; Fri, 11 Sep 2015 21:53:52 +0200 Original-Received: (qmail 17941 invoked by uid 550); 11 Sep 2015 19:53:50 -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 17910 invoked from network); 11 Sep 2015 19:53:49 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=3tLde6xA8qwVAbLSk89JxomNol2n76R1TfF84RBj1/k=; b=S59sjS/dJF3D4Q3gZiMWmjAZFoD0i9wt36T0Ks7MSx8MIZItWSm/ejstKFYG3TAQIg ZpVT3xOkoonQxM0cGmlAfR4scbIK965pEJd/G/l2jSZrQS1BZjwObrYvsxkQIRjtG2B5 E+DNAGd1tXRoeriRg9Trsfle2FurOTzy7y1K6q7pck9R6jo9gBBNFPeYXYFFBl/LNRNq tSEQcxZGgqj8RFdOKmsT1LalzQ6p1ZmT9rwoKt+dawS+tE/SwZUca6kNEcF67/IyzE45 W/vp7yTVIiZ5jcVmlUmyDEG542ax1z4l2RiUBLkM5FSLDnAIRthyJGtfoiqBoCbsz4Z8 jDCQ== X-Gm-Message-State: ALoCoQk9lJFF8HRUtLQt+RoBUf2YbCo3p5kkqNpovTJFv+WChfJ9RbswZi7ttYpr6ZLHEg1OzmsP X-Received: by 10.152.10.71 with SMTP id g7mr483582lab.61.1442001218130; Fri, 11 Sep 2015 12:53:38 -0700 (PDT) In-Reply-To: <20150911194359.GB1965@newbook> Xref: news.gmane.org gmane.linux.lib.musl.general:8494 Archived-At: --001a1132f6625f65d4051f7e1284 Content-Type: text/plain; charset=UTF-8 But I do not think other libcs define PAGE_SIZE, such as glibc or diet-libc. Is that true? Thanks On Fri, Sep 11, 2015 at 3:44 PM, Isaac Dunham wrote: > On Fri, Sep 11, 2015 at 03:28:52PM -0400, Yuxin Ren wrote: > > Hi, > > > > I found in the bits/limits.h file, musl defines PAGE_SIZE macro . > > I think this macro is always defined by operating system, not libc. > > > > Why does musl define this marco? > > It's required to be in limits.h, which has to be provided by libc for a > full implementation. > Hypothetically, we could get it from the Linux headers. > But the Linux headers can and sometimes do introduce definitions and > structs that violate the header namespaces, resulting in collisions > (ie, kernel header defines struct foo, application defines struct foo > without including any headers that *should* define it, application fails > to compile.) > > HTH, > Isaac Dunham > --001a1132f6625f65d4051f7e1284 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
But I do not think other libcs define PAGE_SIZE, such as g= libc or diet-libc.
Is that true?

Thanks
<= /div>

On Fri, Sep = 11, 2015 at 3:44 PM, Isaac Dunham <ibid.ag@gmail.com> wrote:=
On Fri, Sep 11, 2015 at 03:28:52PM -0400= , Yuxin Ren wrote:
> Hi,
>
> I found in the bits/limits.h file, musl defines PAGE_SIZE macro .
> I think this macro is always defined by operating system, not libc. >
> Why does musl define this marco?

It's required to be in limits.h, which has to be provided by lib= c for a
full implementation.
Hypothetically, we could get it from the Linux headers.
But the Linux headers can and sometimes do introduce definitions and
structs that violate the header namespaces, resulting in collisions
(ie, kernel header defines struct foo, application defines struct foo
without including any headers that *should* define it, application fails to compile.)

HTH,
Isaac Dunham

--001a1132f6625f65d4051f7e1284--