Bug 1103816 - Add support for gonk-L to android_stub.h, r=glandium

This commit is contained in:
Michael Wu 2014-12-16 21:35:09 -05:00
parent 70f3195be6
commit 14f46b1099
2 changed files with 18 additions and 1 deletions

View File

@ -212,7 +212,7 @@ DEFAULT_GMAKE_FLAGS += \
OS_PTHREAD= \
$(NULL)
DEFAULT_GMAKE_FLAGS += ARCHFLAG='$(CFLAGS) -DCHECK_FORK_GETPID -DRTLD_NOLOAD=0 -include $(topsrcdir)/security/manager/android_stub.h'
DEFAULT_GMAKE_FLAGS += ARCHFLAG='$(CFLAGS) -DCHECK_FORK_GETPID $(addprefix -DANDROID_VERSION=,$(ANDROID_VERSION)) -include $(topsrcdir)/security/manager/android_stub.h'
endif
endif

View File

@ -15,6 +15,23 @@
#include <sys/cdefs.h>
#include <linux/kernel.h>
#if ANDROID_VERSION >= 21
#include <sys/resource.h>
#include <unistd.h>
static int getdtablesize(void)
{
struct rlimit r;
if (getrlimit(RLIMIT_NOFILE, &r) < 0) {
return sysconf(_SC_OPEN_MAX);
}
return r.rlim_cur;
}
#else
#define RTLD_NOLOAD 0
extern int getdtablesize(void);
#endif
#define sysinfo(foo) -1
#endif /* ANDROID_STUB_H */