From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8496 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Why musl define PAGE_SIZE Date: Fri, 11 Sep 2015 16:10:11 -0400 Message-ID: <20150911201011.GY17773@brightrain.aerifal.cx> References: <20150911194359.GB1965@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: ger.gmane.org 1442002228 21758 80.91.229.3 (11 Sep 2015 20:10:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Sep 2015 20:10:28 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8508-gllmg-musl=m.gmane.org@lists.openwall.com Fri Sep 11 22:10:27 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 1ZaUeR-0000uJ-29 for gllmg-musl@m.gmane.org; Fri, 11 Sep 2015 22:10:27 +0200 Original-Received: (qmail 32162 invoked by uid 550); 11 Sep 2015 20:10:25 -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 32131 invoked from network); 11 Sep 2015 20:10:24 -0000 Content-Disposition: inline In-Reply-To: <20150911194359.GB1965@newbook> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8496 Archived-At: On Fri, Sep 11, 2015 at 12:44:02PM -0700, 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. It's not required. Lack of a definition means you have to query the value at runtime with sysconf(_SC_PAGESIZE). But failure to provide a value on platforms where it is constant just gratuitously pessimizes programs that need to know page size. Rich