pstat_getlocality.2 (2010 09)
p
pstat_getlocality(2) pstat_getlocality(2)
/*
* Given a quantity of memory in pages, fill str with a
* human-readable string representing that amount.
*/
void
pages_to_str ( uint64_t pages, char *str )
{
uint64_t kpg = pages*(pgsize/1024L);
uint64_t mpg = kpg/1024L;
uint64_t gpg = mpg/1024L;
if ( gpg > 10 ) {
sprintf ( str, "%lluG", gpg );
} else if ( mpg > 10 ) {
sprintf ( str, "%lluM", mpg );
} else if ( kpg >1){
sprintf ( str, "%lluK", kpg );
} else {
sprintf ( str, "%llu", pages );
}
}
AUTHOR
The
pstat routines were developed by Hewlett-Packard Company.
SEE ALSO
pstat(2), mpctl(2).
HP-UX 11i Version 3: September 2010 − 7 − Hewlett-Packard Company 7