[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    btop(9F) manual page Table of Contents

Name

btop - convert size in bytes to size in pages (round down)

Synopsis


#include <sys/ddi.h>

unsigned long btop(unsigned long numbytes);

Interface Level

Architecture independent level 1 (DDI/DKI).

Arguments

numbytes
Number of bytes.

Description

btop() returns the number of memory pages that are contained in the specified number of bytes, with downward rounding in the case that the byte count is not a page multiple. For example, if the page size is 2048, then btop(4096) returns 2, and btop(4097) returns 2 as well. btop(0) returns 0.

Return Values

The return value is always the number of pages. There are no invalid input values, and therefore no error return values.

Context

btop() can be called from user or interrupt context.

See Also

btopr(9F) , ddi_btop(9F) , ptob(9F)


Table of Contents