Home | History | Annotate | Download | only in resolv

Lines Matching refs:rt

67     _res_thread*  rt = calloc(1, sizeof(*rt));
69 if (rt) {
70 rt->_h_errno = 0;
72 rt->_serial = 0;
73 rt->_pi = (struct prop_info*) __system_property_find("net.change");
74 if (rt->_pi) {
75 rt->_serial = __system_property_serial(rt->_pi);
77 memset(rt->_rstatic, 0, sizeof rt->_rstatic);
79 return rt;
99 _res_thread* rt = _rt;
101 D("%s: rt=%p for thread=%d", __FUNCTION__, rt, gettid());
103 _res_static_done(rt->_rstatic);
104 res_ndestroy(rt->_nres);
105 free(rt);
117 _res_thread* rt;
119 rt = pthread_getspecific( _res_key );
121 if (rt != NULL) {
124 D("%s: Called for tid=%d rt=%p rt->pi=%p rt->serial=%d",
125 __FUNCTION__, gettid(), rt, rt->_pi, rt->_serial);
126 if (rt->_pi == NULL) {
131 rt->_pi = (struct prop_info*) __system_property_find("net.change");
132 if (rt->_pi == NULL) {
134 D("%s: exiting for tid=%d rt=%d since system property not found",
135 __FUNCTION__, gettid(), rt);
136 return rt;
139 if (rt->_serial == __system_property_serial(rt->_pi)) {
141 D("%s: tid=%d rt=%p nothing changed, returning",
142 __FUNCTION__, gettid(), rt);
143 return rt;
146 rt->_serial = __system_property_serial(rt->_pi);
152 rt = _res_thread_alloc();
153 if (rt == NULL) {
156 pthread_setspecific( _res_key, rt );
157 D("%s: tid=%d Created new DNS state rt=%p",
158 __FUNCTION__, gettid(), rt);
164 D("%s: tid=%d, rt=%p, resetting DNS state (options RES_INIT=%d)",
165 __FUNCTION__, gettid(), rt, (rt->_nres->options & RES_INIT) != 0);
166 if ( res_ninit( rt->_nres ) < 0 ) {
168 D("%s: tid=%d rt=%p, woot, res_ninit() returned < 0",
169 __FUNCTION__, gettid(), rt);
170 _res_thread_free(rt);
174 return rt;
184 _res_thread* rt = _res_thread_get();
186 if (!rt)
189 if (!rt->_cache) {
190 rt->_cache = _resolv_cache_create();
192 return rt->_cache;
199 _res_thread* rt = _res_thread_get();
202 return rt ? &rt->_h_errno : &panic;
208 _res_thread* rt = _res_thread_get();
210 return rt ? rt->_nres : NULL;
222 _res_thread* rt = _res_thread_get();
224 return rt ? rt->_rstatic : NULL;