xref: /freebsd/lib/libsys/getpagesize.3 (revision f70c5a0925c621ce862327a1f335394e731fbaed)
1*f70c5a09SBrooks Davis.\" Copyright (c) 1983, 1991, 1993
2*f70c5a09SBrooks Davis.\"	The Regents of the University of California.  All rights reserved.
3*f70c5a09SBrooks Davis.\"
4*f70c5a09SBrooks Davis.\" Redistribution and use in source and binary forms, with or without
5*f70c5a09SBrooks Davis.\" modification, are permitted provided that the following conditions
6*f70c5a09SBrooks Davis.\" are met:
7*f70c5a09SBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
8*f70c5a09SBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
9*f70c5a09SBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
10*f70c5a09SBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
11*f70c5a09SBrooks Davis.\"    documentation and/or other materials provided with the distribution.
12*f70c5a09SBrooks Davis.\" 3. Neither the name of the University nor the names of its contributors
13*f70c5a09SBrooks Davis.\"    may be used to endorse or promote products derived from this software
14*f70c5a09SBrooks Davis.\"    without specific prior written permission.
15*f70c5a09SBrooks Davis.\"
16*f70c5a09SBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17*f70c5a09SBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*f70c5a09SBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*f70c5a09SBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20*f70c5a09SBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21*f70c5a09SBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22*f70c5a09SBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23*f70c5a09SBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24*f70c5a09SBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*f70c5a09SBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*f70c5a09SBrooks Davis.\" SUCH DAMAGE.
27*f70c5a09SBrooks Davis.\"
28*f70c5a09SBrooks Davis.Dd October 17, 2022
29*f70c5a09SBrooks Davis.Dt GETPAGESIZE 3
30*f70c5a09SBrooks Davis.Os
31*f70c5a09SBrooks Davis.Sh NAME
32*f70c5a09SBrooks Davis.Nm getpagesize
33*f70c5a09SBrooks Davis.Nd get system page size
34*f70c5a09SBrooks Davis.Sh LIBRARY
35*f70c5a09SBrooks Davis.Lb libc
36*f70c5a09SBrooks Davis.Sh SYNOPSIS
37*f70c5a09SBrooks Davis.In unistd.h
38*f70c5a09SBrooks Davis.Ft int
39*f70c5a09SBrooks Davis.Fn getpagesize void
40*f70c5a09SBrooks Davis.Sh DESCRIPTION
41*f70c5a09SBrooks DavisThe
42*f70c5a09SBrooks Davis.Fn getpagesize
43*f70c5a09SBrooks Davisfunction
44*f70c5a09SBrooks Davisreturns the number of bytes in a page.
45*f70c5a09SBrooks DavisPage granularity is the granularity of many of the memory
46*f70c5a09SBrooks Davismanagement calls.
47*f70c5a09SBrooks Davis.Pp
48*f70c5a09SBrooks DavisThe page size is a system
49*f70c5a09SBrooks Davispage size and may not be the same as the underlying
50*f70c5a09SBrooks Davishardware page size.
51*f70c5a09SBrooks Davis.Pp
52*f70c5a09SBrooks Davis.St -p1003.1-2001
53*f70c5a09SBrooks Davisremoved
54*f70c5a09SBrooks Davis.Nm .
55*f70c5a09SBrooks DavisPortable applications should use
56*f70c5a09SBrooks Davis.Ql sysconf(_SC_PAGESIZE)
57*f70c5a09SBrooks Davisinstead.
58*f70c5a09SBrooks Davis.Sh SEE ALSO
59*f70c5a09SBrooks Davis.Xr pagesize 1 ,
60*f70c5a09SBrooks Davis.Xr sbrk 2 ,
61*f70c5a09SBrooks Davis.Xr getpagesizes 3 ,
62*f70c5a09SBrooks Davis.Xr sysconf 3
63*f70c5a09SBrooks Davis.Sh HISTORY
64*f70c5a09SBrooks DavisThe
65*f70c5a09SBrooks Davis.Fn getpagesize
66*f70c5a09SBrooks Davisfunction appeared in
67*f70c5a09SBrooks Davis.Bx 4.2 .
68