From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8495 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:01:11 -0400 Message-ID: <20150911200111.GX17773@brightrain.aerifal.cx> References: 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 1442001703 13674 80.91.229.3 (11 Sep 2015 20:01:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Sep 2015 20:01:43 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8507-gllmg-musl=m.gmane.org@lists.openwall.com Fri Sep 11 22:01:29 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 1ZaUVj-0007gZ-QL for gllmg-musl@m.gmane.org; Fri, 11 Sep 2015 22:01:28 +0200 Original-Received: (qmail 26544 invoked by uid 550); 11 Sep 2015 20:01: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 26513 invoked from network); 11 Sep 2015 20:01:24 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8495 Archived-At: 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? The page size, and whether it's a constant or variable, is part of the target ABI. musl provides the PAGE_SIZE macro on targets where it's constant because it may be useful to applications that want to optimize for the case where a fixed page size is known. This is no different from providing definitions reflecting other parts of the ABI like type definitions or macro constants for communicating with system interfaces. Rich