#include <sys/param.h>
#include <sys/pstat.h>
#include <sys/unistd.h>
#include <string.h>
#include <pwd.h>
int main()
{
struct pst_static pmt;
int page_size = 0;
// 페이지 크기를 얻어온다.
// 페이지 크기는 메모리와 같은 자원의 크기를 검사하는데 중요하게 사용된다.
if (pstat_getstatic(&pmt, sizeof(pmt), (size_t)1, 0) != -1)
{
page_size = pmt.page_size;
}
else
{
perror("static error");
}
printf("page size is %ld\n", page_size);
return 0;
}
'IT-Consultant' 카테고리의 다른 글
rck2로 검색 후 에러가 있으면 서비스를 재시작하는 스크립트 (0) | 2008.06.05 |
---|---|
rck2로 검색 후 에러가 있으면 서비스를 재시작하는 스크립트 (0) | 2008.06.05 |
HPUX page size 알아내기 (0) | 2008.06.02 |
코드의 간결화 (0) | 2008.05.29 |
코드의 간결화 (0) | 2008.05.29 |