Break up the rest of stubs.cpp.
Bug: http://b/27999086
Change-Id: Ibcc2c5171d43ebd26b486642052738473f3b7714
diff --git a/libc/Android.bp b/libc/Android.bp
index de0ac0d..7c82695 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1282,6 +1282,7 @@
"bionic/getcwd.cpp",
"bionic/getdomainname.cpp",
"bionic/gethostname.cpp",
+ "bionic/getpagesize.cpp",
"bionic/getpgrp.cpp",
"bionic/getpid.cpp",
"bionic/gettid.cpp",
@@ -1311,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",
@@ -1364,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 49a8bdb..631de5e 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -111,6 +111,7 @@
bionic/getcwd.cpp \
bionic/getdomainname.cpp \
bionic/gethostname.cpp \
+ bionic/getpagesize.cpp \
bionic/getpgrp.cpp \
bionic/getpid.cpp \
bionic/gettid.cpp \
@@ -140,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 \
@@ -198,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/stubs.cpp b/libc/bionic/getpagesize.cpp
similarity index 75%
copy from libc/bionic/stubs.cpp
copy to libc/bionic/getpagesize.cpp
index 4e65756..3a59900 100644
--- a/libc/bionic/stubs.cpp
+++ b/libc/bionic/getpagesize.cpp
@@ -26,29 +26,8 @@
* SUCH DAMAGE.
*/
-#include <netdb.h>
#include <unistd.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;
-}
-
// 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.
diff --git a/libc/bionic/stubs.cpp b/libc/bionic/netdb.cpp
similarity index 89%
rename from libc/bionic/stubs.cpp
rename to libc/bionic/netdb.cpp
index 4e65756..da61f98 100644
--- a/libc/bionic/stubs.cpp
+++ b/libc/bionic/netdb.cpp
@@ -27,7 +27,6 @@
*/
#include <netdb.h>
-#include <unistd.h>
// We don't have an /etc/networks, so all inputs return NULL.
netent* getnetbyname(const char* /*name*/) {
@@ -48,9 +47,3 @@
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;
-}