Lines Matching refs:rs

38 struct servent* getservent_r(res_static rs) {  in getservent_r()  argument
47 p = rs->servent_ptr; in getservent_r()
68 p2 = realloc( (char*)rs->servent.s_aliases, total ); in getservent_r()
73 rs->servent.s_aliases = (char**) p2; in getservent_r()
75 rs->servent.s_name = p2; in getservent_r()
77 rs->servent.s_proto = p2; in getservent_r()
80 memcpy( rs->servent.s_name, p+1, namelen ); in getservent_r()
81 rs->servent.s_name[namelen] = 0; in getservent_r()
88 rs->servent.s_port = htons(port); in getservent_r()
89 rs->servent.s_proto = p[2] == 't' ? "tcp" : "udp"; in getservent_r()
94 rs->servent.s_aliases[nn] = p2; in getservent_r()
100 rs->servent.s_aliases[nn] = NULL; in getservent_r()
102 rs->servent_ptr = p; in getservent_r()
104 return &rs->servent; in getservent_r()
112 res_static rs = __res_get_static(); in endservent() local
113 if (rs) rs->servent_ptr = NULL; in endservent()
117 res_static rs = __res_get_static(); in getservent() local
118 return rs ? getservent_r(rs) : NULL; in getservent()
122 res_static rs = __res_get_static(); in getservbyname() local
123 if (rs == NULL) return NULL; in getservbyname()
125 const char* old_servent_ptr = rs->servent_ptr; in getservbyname()
126 rs->servent_ptr = NULL; in getservbyname()
128 while ((s = getservent_r(rs)) != NULL) { in getservbyname()
133 rs->servent_ptr = old_servent_ptr; in getservbyname()
138 res_static rs = __res_get_static(); in getservbyport() local
139 if (rs == NULL) return NULL; in getservbyport()
141 const char* old_servent_ptr = rs->servent_ptr; in getservbyport()
142 rs->servent_ptr = NULL; in getservbyport()
144 while ((s = getservent_r(rs)) != NULL) { in getservbyport()
149 rs->servent_ptr = old_servent_ptr; in getservbyport()