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:
parent
465b065790
commit
fd94a32468
@ -274,6 +274,7 @@
|
|||||||
#define link(p1, p2) symlink((p1), (p2))
|
#define link(p1, p2) symlink((p1), (p2))
|
||||||
#define fdatasync(f) fsync(f)
|
#define fdatasync(f) fsync(f)
|
||||||
#define getdtablesize(f) ((int)sysconf(_SC_OPEN_MAX))
|
#define getdtablesize(f) ((int)sysconf(_SC_OPEN_MAX))
|
||||||
|
#define getpagesize(f) ((int)sysconf(_SC_PAGESIZE))
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
|
@ -241,6 +241,13 @@ long sysconf(int name)
|
|||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
case _SC_PAGESIZE:
|
||||||
|
#ifdef CONFIG_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 */
|
||||||
errcode = EINVAL;
|
errcode = EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user