mirror of
https://github.com/apache/nuttx.git
synced 2026-09-01 14:43:02 +00:00
sysconf: add _SC_PAGESIZE sysconf support
MIRTOS-262 Also implement getpagesize() based on sysconf(_SC_PAGESIZE). Signed-off-by: liuhaitao <liuhaitao@xiaomi.com> Change-Id: Ib6baccb9f7dac19f5e3c681db1c51e8a2fe8d3fe
This commit is contained in:
parent
5cc042dc1a
commit
da9b962e97
2 changed files with 9 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -241,6 +241,14 @@ long sysconf(int name)
|
|||
return 1;
|
||||
#endif
|
||||
|
||||
case _SC_PAGESIZE:
|
||||
#ifdef CONFIG_MM_PGSIZE
|
||||
return CONFIG_MM_PGSIZE;
|
||||
#else
|
||||
#define PAGESIZE 4096
|
||||
return PAGESIZE;
|
||||
#endif
|
||||
|
||||
default:
|
||||
#if 0 /* Assume valid but not implemented for the time being */
|
||||
errcode = EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue