diff options
author | Dan Albert <danalbert@google.com> | 2014-06-13 16:51:24 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-06-16 10:12:37 -0700 |
commit | 462abab12b074c62c0999859e65d5a32ebb41951 (patch) | |
tree | c0979cfcae24863834ccc28821bd7d1483bac732 /libc/bionic/ndk_cruft.cpp | |
parent | 72dc1c22dc6a92dea925398c9e3880364ab29c1c (diff) | |
download | bionic-462abab12b074c62c0999859e65d5a32ebb41951.zip bionic-462abab12b074c62c0999859e65d5a32ebb41951.tar.gz bionic-462abab12b074c62c0999859e65d5a32ebb41951.tar.bz2 |
Removes getdtablesize(3) from LP64.
getdtablesize(3) was removed fro POSIX 2004. Keep the symbol around in LP32 for
binary compatibility, but remove the declaration from unistd.h.
Bug: 13935372
Change-Id: I1f96cd290bf9176f922dad58bd5a7ab2cae7ef0f
Diffstat (limited to 'libc/bionic/ndk_cruft.cpp')
-rw-r--r-- | libc/bionic/ndk_cruft.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 4834d6e..43078fd 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -255,4 +255,15 @@ extern "C" pid_t wait3(int* status, int options, struct rusage* rusage) { return wait4(-1, status, options, rusage); } +// This was removed from POSIX 2004. +extern "C" int getdtablesize() { + struct rlimit r; + + if (getrlimit(RLIMIT_NOFILE, &r) < 0) { + return sysconf(_SC_OPEN_MAX); + } + + return r.rlim_cur; +} + #endif |