Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / btop.9f
blob7524c12ee539cca835ed8a5df95c50b84e06482a
1 '\" te
2 .\"  Copyright 1989 AT&T
3 .\" Copyright (c) 2006, Sun Microsystems, Inc.  All Rights Reserved
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH BTOP 9F "Jan 16, 2006"
8 .SH NAME
9 btop \- convert size in bytes to size in pages (round down)
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/ddi.h>
17 \fBunsigned long\fR \fBbtop\fR(\fBunsigned long\fR \fInumbytes\fR);
18 .fi
20 .SH INTERFACE LEVEL
21 .sp
22 .LP
23 Architecture independent level 1 (DDI/DKI).
24 .SH PARAMETERS
25 .sp
26 .ne 2
27 .na
28 \fB\fInumbytes\fR\fR
29 .ad
30 .RS 12n
31 Number of bytes.
32 .RE
34 .SH DESCRIPTION
35 .sp
36 .LP
37 The \fBbtop()\fR function returns the number of memory pages that are contained
38 in the specified number of bytes, with downward rounding in the case that the
39 byte count is not a page multiple. For example, if the page size is \fB2048\fR,
40 then \fBbtop(4096)\fR returns \fB2\fR, and \fBbtop(4097)\fR returns \fB2\fR as
41 well. \fBbtop(0)\fR returns \fB0\fR.
42 .SH RETURN VALUES
43 .sp
44 .LP
45 The return value is always the number of pages. There are no invalid input
46 values, and therefore no error return values.
47 .SH CONTEXT
48 .sp
49 .LP
50 The \fBbtop()\fR function can be called from user, interrupt, or kernel
51 context.
52 .SH SEE ALSO
53 .sp
54 .LP
55 \fBbtopr\fR(9F), \fBddi_btop\fR(9F), \fBptob\fR(9F)
56 .sp
57 .LP
58 \fIWriting Device Drivers\fR