sysconf: add _SC_PAGESIZE sysconf support

Also implement getpagesize() based on sysconf(_SC_PAGESIZE).

Change-Id: I812eb8f34ed602f7bc12c4cafafcebc0d98fd136
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
liuhaitao 2020-08-31 16:58:26 +08:00 committed by Xiang Xiao
parent 465b065790
commit fd94a32468
2 changed files with 8 additions and 0 deletions

View File

@ -274,6 +274,7 @@
#define link(p1, p2) symlink((p1), (p2))
#define fdatasync(f) fsync(f)
#define getdtablesize(f) ((int)sysconf(_SC_OPEN_MAX))
#define getpagesize(f) ((int)sysconf(_SC_PAGESIZE))
/****************************************************************************
* Public Data

View File

@ -241,6 +241,13 @@ long sysconf(int name)
return 1;
#endif
case _SC_PAGESIZE:
#ifdef CONFIG_MM_PGSIZE
return CONFIG_MM_PGSIZE;
#else
return 1;
#endif
default:
#if 0 /* Assume valid but not implemented for the time being */
errcode = EINVAL;