mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user