am 269851bf
: Merge "Declare __page_shift and __page_size with C linkage."
* commit '269851bf950049f16eeb2a402f700952480bcecf': Declare __page_shift and __page_size with C linkage.
This commit is contained in:
commit
94c325fb3b
@ -60,10 +60,6 @@ char** environ;
|
|||||||
// Declared in <private/bionic_ssp.h>.
|
// Declared in <private/bionic_ssp.h>.
|
||||||
uintptr_t __stack_chk_guard = 0;
|
uintptr_t __stack_chk_guard = 0;
|
||||||
|
|
||||||
// Declared in <asm/page.h>.
|
|
||||||
unsigned int __page_size = PAGE_SIZE;
|
|
||||||
unsigned int __page_shift = PAGE_SHIFT;
|
|
||||||
|
|
||||||
static size_t get_main_thread_stack_size() {
|
static size_t get_main_thread_stack_size() {
|
||||||
rlimit stack_limit;
|
rlimit stack_limit;
|
||||||
int rlimit_result = getrlimit(RLIMIT_STACK, &stack_limit);
|
int rlimit_result = getrlimit(RLIMIT_STACK, &stack_limit);
|
||||||
|
@ -469,3 +469,15 @@ void setusershell() {
|
|||||||
void endusershell() {
|
void endusershell() {
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Portable code should use sysconf(_SC_PAGESIZE) directly instead.
|
||||||
|
int getpagesize() {
|
||||||
|
return sysconf(_SC_PAGESIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// These were accidentally declared in <unistd.h> because we stupidly used to inline
|
||||||
|
// getpagesize() and __getpageshift(). Needed for backwards compatibility with old NDK apps.
|
||||||
|
extern "C" {
|
||||||
|
unsigned int __page_size = PAGE_SIZE;
|
||||||
|
unsigned int __page_shift = PAGE_SHIFT;
|
||||||
|
}
|
||||||
|
@ -170,14 +170,7 @@ extern int ttyname_r(int, char*, size_t);
|
|||||||
|
|
||||||
extern int acct(const char* filepath);
|
extern int acct(const char* filepath);
|
||||||
|
|
||||||
static __inline__ int getpagesize(void) {
|
int getpagesize(void);
|
||||||
extern unsigned int __page_size;
|
|
||||||
return __page_size;
|
|
||||||
}
|
|
||||||
static __inline__ int __getpageshift(void) {
|
|
||||||
extern unsigned int __page_shift;
|
|
||||||
return __page_shift;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern int sysconf(int name);
|
extern int sysconf(int name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user