summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2016-09-01 09:51:23 +0530
committerAmitesh Singh <amitesh.sh@samsung.com>2016-09-01 09:51:23 +0530
commit49e995b379cab1bdad19d32e756e54f1c7e15995 (patch)
tree5443604827d7ffd77c454a5c37f600236b64eea1
parent5a9da7f32b247282b47c395744d1411a69a9e22d (diff)
get page size code
-rw-r--r--mem/get_page_size.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mem/get_page_size.c b/mem/get_page_size.c
new file mode 100644
index 0000000..46d37b3
--- /dev/null
+++ b/mem/get_page_size.c
@@ -0,0 +1,11 @@
1#include <stdio.h>
2#include <unistd.h> /* sysconf(3) */
3// Also getconf PAGESIZE can be used to get this same info
4
5int main()
6{
7 printf("The page size for this system is %ld bytes.\n",
8 sysconf(_SC_PAGESIZE)); /* _SC_PAGE_SIZE is OK too. */
9
10 return 0;
11}