DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

btoc(D3oddi)


btoc, ctob -- convert between bytes and clicks (memory pages)

Synopsis

#include <sys/sysmacros.h>

unsigned btoc(unsigned bytes);

unsigned ctob(unsigned clicks);

Description

The btoc and ctob macros convert between bytes and clicks (memory pages). btoc returns the number of memory pages that are needed to contain the specified number of bytes. ctob returns the number of bytes contained in the specified number of memory pages.

Arguments


bytes
number of bytes to be converted.

clicks
number of clicks to be converted.

Return values

btoc returns the number of memory pages needed to contain a specified number of bytes.

ctob returns the number of bytes contained in a specified number of memory pages.

btoc(0), or ctob(0) each return 0 (zero).

Usage

btoc returns the number of pages required to hold the specified number of clicks. So, with the page size of 4096 bytes, btoc(5000) returns 2.

With the page size of 4096 bytes, then ctob(2) returns 8192.

Context and synchronization

All contexts.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

This function is not supported in DDI.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005