Rewrite syslog(3) to use Android logging.

Since we don't have syslogd on Android and you can't run one on a non-rooted
device, it's more useful if syslog output just goes to the regular Android
logging system.

Bug: 14292866
Change-Id: Icee7f088b97f88ccbdaf471b98cbac7f19f9210a
diff --git a/tests/libc_logging_test.cpp b/tests/libc_logging_test.cpp
index 950161e..ef39d1c 100644
--- a/tests/libc_logging_test.cpp
+++ b/tests/libc_logging_test.cpp
@@ -176,3 +176,14 @@
   GTEST_LOG_(INFO) << "This test does nothing.\n";
 #endif // __BIONIC__
 }
+
+TEST(libc_logging, m) {
+#if defined(__BIONIC__)
+  char buf[BUFSIZ];
+  errno = EBADF;
+  __libc_format_buffer(buf, sizeof(buf), "<%m>");
+  EXPECT_STREQ("<Bad file number>", buf);
+#else // __BIONIC__
+  GTEST_LOG_(INFO) << "This test does nothing.\n";
+#endif // __BIONIC__
+}