Return to getpagesize.c CVS log | Up to [cvs.NetBSD.org] / src / lib / libc / gen |
Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. |
version 1.3, 1994/09/18 04:32:35 | version 1.4, 1994/09/19 23:46:29 | ||
---|---|---|---|
|
|
||
int | int | ||
getpagesize() | getpagesize() | ||
{ | { | ||
static int pagsz; | static int pagsz; | ||
int mib[2]; | |||
size_t size; | |||
if (pagsz == 0) { | if (pagsz == 0) { | ||
int mib[2]; | |||
size_t size; | |||
mib[0] = CTL_HW; | mib[0] = CTL_HW; | ||
mib[1] = HW_PAGESIZE; | mib[1] = HW_PAGESIZE; | ||
size = sizeof value; | size = sizeof pagsz; | ||
if (sysctl(mib, 2, &pagsz, &size, NULL, 0) == -1) | if (sysctl(mib, 2, &pagsz, &size, NULL, 0) == -1) | ||
return (-1); | return (-1); | ||
} | } |