man.bsd.lv manual page server

Manual Page Search Parameters

CTOD(9) Kernel Developer's Manual CTOD(9)

ctodmacros related to bytes, pages, and disk blocks

#include <sys/param.h>

size
ctod(size x);

size
dtoc(size x);

size
ctob(size x);

size
btoc(size x);

size
dbtob(size x);

size
btodb(size x);

The ctod family of macros can be used to convert between bytes, pages (“clicks”), and disk blocks.

The following table lists the possible conversions:

() pages disk blocks
() disk blocks pages
() pages bytes
() bytes pages
() disk blocks bytes
() bytes disk blocks

These are typical macros that may appear with different names in other operating systems. Examples include () and () in Solaris.

param(3)

Some of these macros appeared in Version 7 AT&T UNIX.

The described macros make no assumptions about the type of the input parameter. A caller should ensure that neither integer overflow nor integer underflow are possible.

April 8, 2011 NetBSD-9.2