getbsize()

determine user's preferred block size 

Function


SYNOPSIS

#include <stdlib.h>

char *getbsize(int *headersizep, long *blocksizep);


DESCRIPTION

The getbsize() function determines the user's preferred block size based on the value of the BLOCKSIZE environment variable. Commands such as df, du, and ls can use this to determine the units that should be used to display sizes. BLOCKSIZE may be specified in units of a byte by specifying a number, in units of a kilobyte by specifying a number followed by 'K' or 'k', in units of a megabyte by specifying a number followed by 'M' or 'm', and in units of a gigabyte by specifying a number followed by 'G' or 'g'. Sizes less than 512 or greater than a gigabyte are ignored.

If the user's block size is unreasonable, a warning message is written to standard error and the returned information reflects a block size of 512 bytes.


PARAMETERS

headerlenp 

Points to a location where the length of the returned string is to be stored.

blocksizep 

Points to a location where the block size is to be stored.


RETURN VALUES

The getbsize() function returns a pointer to a null-terminated string describing the block size, something like "1K-blocks". The length of this string is stored in headerlenp. The block size is stored in blocksizep.


CONFORMANCE

4.4BSD


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

None


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


PTC MKS Toolkit 10.3 Documentation Build 39.