+
+static bool
+getNumRevPair(char const *str, int *num, int *rev)
+{
+ char const * blank_pos = strchr(str, ' ');
+ char const * eol_pos = strchr(str, '\n');
+
+ *num = atoi(str);
+ if (*num==0) return false;
+
+ if (blank_pos!=0 && eol_pos!=0 && blank_pos<eol_pos &&
+ strncmp(blank_pos+1, "rev", 3)==0)
+ *rev = atoi(blank_pos+4);
+
+ return true;
+}
+
+#define SET_TAG_POS(TAG) \
+ pos = strstr(buf, (TAG)); \
+ if (pos) pos+=sizeof(TAG)-1
+
+static bool init_internal()
+{
+ size_t bufsize = utilvserver_getProcEntryBufsize();
+ char buf[bufsize];
+ char const * pos = 0;
+ pid_t pid = getpid();
+ int num;
+
+ errno = 0;
+
+ pos=utilvserver_getProcEntry(pid, 0, buf, bufsize);
+ if (pos==0 && errno==EAGAIN) return false;
+
+ SET_TAG_POS("\n__NR_set_ipv4root: ");
+ if ( pos!=0 && getNumRevPair(pos, &num, &rev_ipv4root) ) {
+ __NR_set_ipv4root_rev0 =
+ __NR_set_ipv4root_rev1 =
+ __NR_set_ipv4root_rev2 =
+ __NR_set_ipv4root_rev3 = num;
+ }
+
+ SET_TAG_POS("\n__NR_new_s_context: ");
+ if ( pos!=0 && getNumRevPair(pos, &num, &rev_s_context) )
+ __NR_new_s_context_rev0 = num;
+
+ return true;
+}
+
+#undef SET_TAG_POS
+