]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - lib/libc/gen/getpagesizes.3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / lib / libc / gen / getpagesizes.3
1 .\" Copyright (c) 2009 Alan L. Cox <alc@cs.rice.edu>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd September 21, 2009
28 .Dt GETPAGESIZES 3
29 .Os
30 .Sh NAME
31 .Nm getpagesizes
32 .Nd "get system page sizes"
33 .Sh LIBRARY
34 .Lb libc
35 .Sh SYNOPSIS
36 .In sys/mman.h
37 .Ft int
38 .Fn getpagesizes "size_t pagesize[]" "int nelem"
39 .Sh DESCRIPTION
40 The
41 .Fn getpagesizes
42 function retrieves page size information from the system.
43 When it is called with
44 .Fa pagesize
45 specified as
46 .Dv NULL
47 and
48 .Fa nelem
49 specified as 0, it returns the number of distinct page sizes that are
50 supported by the system.
51 Otherwise, it assigns up to
52 .Fa nelem
53 of the system-supported page sizes to consecutive elements of the
54 array referenced by
55 .Fa pagesize .
56 These page sizes are expressed in bytes.
57 In this case,
58 .Fn getpagesizes
59 returns the number of such page sizes that it assigned to the array.
60 .Sh RETURN VALUES
61 If successful, the
62 .Fn getpagesizes
63 function returns either the number of page sizes that are supported by
64 the system or the number of supported page sizes that it assigned to
65 the array referenced by
66 .Fa pagesize .
67 Otherwise, it returns the value\~\-1 and sets
68 .Va errno
69 to indicate the error.
70 .Sh ERRORS
71 The
72 .Fn getpagesizes
73 function will succeed unless:
74 .Bl -tag -width Er
75 .It Bq Er EINVAL
76 The
77 .Fa pagesize
78 argument is
79 .Dv NULL
80 and the
81 .Fa nelem
82 argument is non-zero.
83 .It Bq Er EINVAL
84 The
85 .Fa nelem
86 argument is less than zero.
87 .El
88 .Sh SEE ALSO
89 .Xr getpagesize 3
90 .Sh HISTORY
91 The
92 .Fn getpagesizes
93 function first appeared in Solaris 9.
94 This manual page was written in conjunction with a new but compatible
95 implementation that was first released in
96 .Fx 7.3 .
97 .Sh AUTHORS
98 This manual page was written by
99 .An Alan L. Cox Aq alc@cs.rice.edu .