mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
libc: Let _SC_PAGESIZE return 4096 when CONFIG_MM_PGSIZE isn't defined
since most application doesn't expect the page size equals one Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
28027d0bee
commit
ee9787a254
@@ -30,6 +30,12 @@
|
|||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_MM_PGSIZE
|
||||||
|
# define DEFAULT_MM_PGSIZE CONFIG_MM_PGSIZE
|
||||||
|
#else
|
||||||
|
# define DEFAULT_MM_PGSIZE 4096
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -226,11 +232,7 @@ long sysconf(int name)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case _SC_PAGESIZE:
|
case _SC_PAGESIZE:
|
||||||
#ifdef CONFIG_MM_PGSIZE
|
return DEFAULT_MM_PGSIZE;
|
||||||
return CONFIG_MM_PGSIZE;
|
|
||||||
#else
|
|
||||||
return 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
#if 0 /* Assume valid but not implemented for the time being */
|
#if 0 /* Assume valid but not implemented for the time being */
|
||||||
|
|||||||
Reference in New Issue
Block a user