Expose __res_randomid.

I don't think this will help the original submitter, because <resolv.h>
is mostly useless on Android. One day we might have a deprecation and
removal policy for the NDK, but until then we should probably maintain
this header.

Bug: https://github.com/android-ndk/ndk/issues/739
Test: ran tests
Change-Id: I2db859abfdebc3824c997462fa6133d5b355a8dd
diff --git a/libc/include/resolv.h b/libc/include/resolv.h
index d6db4cf..1518475 100644
--- a/libc/include/resolv.h
+++ b/libc/include/resolv.h
@@ -59,6 +59,9 @@
 int res_query(const char* __name, int __class, int __type, u_char* __answer, int __answer_size);
 int res_search(const char* __name, int __class, int __type, u_char* __answer, int __answer_size);
 
+#define res_randomid __res_randomid
+u_int __res_randomid(void) __INTRODUCED_IN_FUTURE;
+
 __END_DECLS
 
 #endif
diff --git a/libc/libc.arm.map b/libc/libc.arm.map
index 18099dd..a133804 100644
--- a/libc/libc.arm.map
+++ b/libc/libc.arm.map
@@ -1420,6 +1420,11 @@
     wcstoul_l;
 } LIBC_O;
 
+LIBC_Q { # introduced=Q
+  global:
+    __res_randomid;
+} LIBC_P;
+
 LIBC_PRIVATE {
   global:
     ___Unwind_Backtrace; # arm
diff --git a/libc/libc.arm64.map b/libc/libc.arm64.map
index f37641e..b7f7c89 100644
--- a/libc/libc.arm64.map
+++ b/libc/libc.arm64.map
@@ -1341,6 +1341,11 @@
     wcstoul_l;
 } LIBC_O;
 
+LIBC_Q { # introduced=Q
+  global:
+    __res_randomid;
+} LIBC_P;
+
 LIBC_PRIVATE {
   global:
     android_getaddrinfofornet;
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index 21966b3..16fc674 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -1445,6 +1445,11 @@
     wcstoul_l;
 } LIBC_O;
 
+LIBC_Q { # introduced=Q
+  global:
+    __res_randomid;
+} LIBC_P;
+
 LIBC_PRIVATE {
   global:
     ___Unwind_Backtrace; # arm
diff --git a/libc/libc.mips.map b/libc/libc.mips.map
index 0bc6fce..fa858f0 100644
--- a/libc/libc.mips.map
+++ b/libc/libc.mips.map
@@ -1404,6 +1404,11 @@
     wcstoul_l;
 } LIBC_O;
 
+LIBC_Q { # introduced=Q
+  global:
+    __res_randomid;
+} LIBC_P;
+
 LIBC_PRIVATE {
   global:
     __accept4; # arm x86 mips
diff --git a/libc/libc.mips64.map b/libc/libc.mips64.map
index f37641e..b7f7c89 100644
--- a/libc/libc.mips64.map
+++ b/libc/libc.mips64.map
@@ -1341,6 +1341,11 @@
     wcstoul_l;
 } LIBC_O;
 
+LIBC_Q { # introduced=Q
+  global:
+    __res_randomid;
+} LIBC_P;
+
 LIBC_PRIVATE {
   global:
     android_getaddrinfofornet;
diff --git a/libc/libc.x86.map b/libc/libc.x86.map
index 14ee151..ae7de4b 100644
--- a/libc/libc.x86.map
+++ b/libc/libc.x86.map
@@ -1402,6 +1402,11 @@
     wcstoul_l;
 } LIBC_O;
 
+LIBC_Q { # introduced=Q
+  global:
+    __res_randomid;
+} LIBC_P;
+
 LIBC_PRIVATE {
   global:
     __accept4; # arm x86 mips
diff --git a/libc/libc.x86_64.map b/libc/libc.x86_64.map
index f37641e..b7f7c89 100644
--- a/libc/libc.x86_64.map
+++ b/libc/libc.x86_64.map
@@ -1341,6 +1341,11 @@
     wcstoul_l;
 } LIBC_O;
 
+LIBC_Q { # introduced=Q
+  global:
+    __res_randomid;
+} LIBC_P;
+
 LIBC_PRIVATE {
   global:
     android_getaddrinfofornet;
diff --git a/tests/resolv_test.cpp b/tests/resolv_test.cpp
index f1d82e4..5743239 100644
--- a/tests/resolv_test.cpp
+++ b/tests/resolv_test.cpp
@@ -58,3 +58,21 @@
   ASSERT_EQ(static_cast<int>(strlen("hello")), b64_pton("aGVsbG8=", buf, sizeof(buf)));
   ASSERT_STREQ(reinterpret_cast<char*>(buf), "hello");
 }
+
+TEST(resolv, p_class) {
+  ASSERT_STREQ("IN", p_class(ns_c_in));
+  ASSERT_STREQ("BADCLASS", p_class(-1));
+}
+
+TEST(resolv, p_type) {
+  ASSERT_STREQ("AAAA", p_type(ns_t_aaaa));
+  ASSERT_STREQ("BADTYPE", p_type(-1));
+}
+
+TEST(resolv, res_init) {
+  ASSERT_EQ(0, res_init());
+}
+
+TEST(resolv, res_randomid) {
+  res_randomid();
+}