Merge "Add <sys/quota.h>."
diff --git a/libc/Android.bp b/libc/Android.bp
index cbca35f..7c82695 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1282,10 +1282,12 @@
"bionic/getcwd.cpp",
"bionic/getdomainname.cpp",
"bionic/gethostname.cpp",
+ "bionic/getpagesize.cpp",
"bionic/getpgrp.cpp",
"bionic/getpid.cpp",
"bionic/gettid.cpp",
"bionic/__gnu_basename.cpp",
+ "bionic/grp_pwd.cpp",
"bionic/ifaddrs.cpp",
"bionic/inotify_init.cpp",
"bionic/ioctl.cpp",
@@ -1310,6 +1312,7 @@
"bionic/mknod.cpp",
"bionic/mntent.cpp",
"bionic/mremap.cpp",
+ "bionic/netdb.cpp",
"bionic/NetdClientDispatch.cpp",
"bionic/net_if.cpp",
"bionic/netinet_in.cpp",
@@ -1363,7 +1366,6 @@
"bionic/strerror_r.cpp",
"bionic/strsignal.cpp",
"bionic/strtold.cpp",
- "bionic/stubs.cpp",
"bionic/symlink.cpp",
"bionic/sysinfo.cpp",
"bionic/syslog.cpp",
diff --git a/libc/Android.mk b/libc/Android.mk
index 0e4dc11..631de5e 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -111,10 +111,12 @@
bionic/getcwd.cpp \
bionic/getdomainname.cpp \
bionic/gethostname.cpp \
+ bionic/getpagesize.cpp \
bionic/getpgrp.cpp \
bionic/getpid.cpp \
bionic/gettid.cpp \
bionic/__gnu_basename.cpp \
+ bionic/grp_pwd.cpp \
bionic/ifaddrs.cpp \
bionic/inotify_init.cpp \
bionic/ioctl.cpp \
@@ -139,6 +141,7 @@
bionic/mknod.cpp \
bionic/mntent.cpp \
bionic/mremap.cpp \
+ bionic/netdb.cpp \
bionic/NetdClientDispatch.cpp \
bionic/net_if.cpp \
bionic/netinet_in.cpp \
@@ -197,7 +200,6 @@
bionic/strerror_r.cpp \
bionic/strsignal.cpp \
bionic/strtold.cpp \
- bionic/stubs.cpp \
bionic/symlink.cpp \
bionic/sync_file_range.cpp \
bionic/sysinfo.cpp \
diff --git a/libc/bionic/getpagesize.cpp b/libc/bionic/getpagesize.cpp
new file mode 100644
index 0000000..3a59900
--- /dev/null
+++ b/libc/bionic/getpagesize.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <unistd.h>
+
+// Portable code should use sysconf(_SC_PAGE_SIZE) directly instead.
+int getpagesize() {
+ // We dont use sysconf(3) here because that drags in stdio, which makes static binaries fat.
+ return PAGE_SIZE;
+}
diff --git a/libc/bionic/stubs.cpp b/libc/bionic/grp_pwd.cpp
similarity index 95%
rename from libc/bionic/stubs.cpp
rename to libc/bionic/grp_pwd.cpp
index 374d015..1cabab4 100644
--- a/libc/bionic/stubs.cpp
+++ b/libc/bionic/grp_pwd.cpp
@@ -30,7 +30,6 @@
#include <errno.h>
#include <grp.h>
#include <mntent.h>
-#include <netdb.h>
#include <pthread.h>
#include <pwd.h>
#include <stdio.h>
@@ -531,29 +530,3 @@
struct group **result) {
return getgroup_r(true, name, 0, grp, buf, buflen, result);
}
-
-// We don't have an /etc/networks, so all inputs return NULL.
-netent* getnetbyname(const char* /*name*/) {
- return NULL;
-}
-
-// We don't have an /etc/networks, so all inputs return NULL.
-netent* getnetbyaddr(uint32_t /*net*/, int /*type*/) {
- return NULL;
-}
-
-// We don't have an /etc/protocols, so all inputs return NULL.
-protoent* getprotobyname(const char* /*name*/) {
- return NULL;
-}
-
-// We don't have an /etc/protocols, so all inputs return NULL.
-protoent* getprotobynumber(int /*proto*/) {
- return NULL;
-}
-
-// Portable code should use sysconf(_SC_PAGE_SIZE) directly instead.
-int getpagesize() {
- // We dont use sysconf(3) here because that drags in stdio, which makes static binaries fat.
- return PAGE_SIZE;
-}
diff --git a/libc/bionic/netdb.cpp b/libc/bionic/netdb.cpp
new file mode 100644
index 0000000..da61f98
--- /dev/null
+++ b/libc/bionic/netdb.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <netdb.h>
+
+// We don't have an /etc/networks, so all inputs return NULL.
+netent* getnetbyname(const char* /*name*/) {
+ return NULL;
+}
+
+// We don't have an /etc/networks, so all inputs return NULL.
+netent* getnetbyaddr(uint32_t /*net*/, int /*type*/) {
+ return NULL;
+}
+
+// We don't have an /etc/protocols, so all inputs return NULL.
+protoent* getprotobyname(const char* /*name*/) {
+ return NULL;
+}
+
+// We don't have an /etc/protocols, so all inputs return NULL.
+protoent* getprotobynumber(int /*proto*/) {
+ return NULL;
+}
diff --git a/libc/dns/resolv/res_stats.c b/libc/dns/resolv/res_stats.c
index b6f5ecb..5cc592e 100644
--- a/libc/dns/resolv/res_stats.c
+++ b/libc/dns/resolv/res_stats.c
@@ -22,7 +22,7 @@
#include "private/libc_logging.h"
#include "isc/eventlib.h"
-#define DBG 1
+#define DBG 0
/* Calculate the round-trip-time from start time t0 and end time t1. */
int
diff --git a/tests/Android.mk b/tests/Android.mk
index 3e8c1a7..1582f3b 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -60,6 +60,7 @@
ftw_test.cpp \
getauxval_test.cpp \
getcwd_test.cpp \
+ grp_pwd_test.cpp \
ifaddrs_test.cpp \
inttypes_test.cpp \
libc_logging_test.cpp \
@@ -95,7 +96,6 @@
string_posix_strerror_r_test.cpp \
strings_nofortify_test.cpp \
strings_test.cpp \
- stubs_test.cpp \
sstream_test.cpp \
sys_epoll_test.cpp \
sys_mman_test.cpp \
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index 1123163..19f9978 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -211,6 +211,8 @@
dlclose(handle);
}
+// mips doesn't support ifuncs
+#if !defined(__mips__)
TEST(dlfcn, ifunc) {
typedef const char* (*fn_ptr)();
@@ -254,6 +256,7 @@
ASSERT_STREQ("true", is_ctor_called());
dlclose(handle);
}
+#endif
TEST(dlfcn, dlopen_check_relocation_dt_needed_order) {
// This is the structure of the test library and
diff --git a/tests/stubs_test.cpp b/tests/grp_pwd_test.cpp
similarity index 100%
rename from tests/stubs_test.cpp
rename to tests/grp_pwd_test.cpp
diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk
index a903732..82bfc05 100644
--- a/tests/libs/Android.mk
+++ b/tests/libs/Android.mk
@@ -348,12 +348,19 @@
# TODO(dimitry): clang does not support ifunc attribute
libtest_ifunc_clang_host := false
-libtest_ifunc_clang_target := false
module := libtest_ifunc
build_target := SHARED_LIBRARY
-include $(LOCAL_PATH)/Android.build.testlib.mk
+build_type := host
+include $(TEST_PATH)/Android.build.mk
+
+ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm arm64 x86 x86_64))
+ build_type := target
+ libtest_ifunc_clang_target := false
+ include $(TEST_PATH)/Android.build.mk
+endif
+
# -----------------------------------------------------------------------------
# Library used by atexit tests