~ubuntu-branches/ubuntu/precise/eglibc/precise

« back to all changes in this revision

Viewing changes to resolv/res_libc.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-10-04 17:48:26 UTC
  • mfrom: (216.1.23 oneiric)
  • Revision ID: package-import@ubuntu.com-20111004174826-2cyb9ewn3ucymlsx
Tags: 2.13-20ubuntu5
libc6-dev: Don't break the current {gnat,gcj}-4.4-base versons. LP: #853688.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
   out) since res_init() should go into libc.so but the rest of that
29
29
   file should not.  */
30
30
 
31
 
__libc_lock_define_initialized (static, lock);
32
31
extern unsigned long long int __res_initstamp attribute_hidden;
33
32
/* We have atomic increment operations on 64-bit platforms.  */
34
33
#if __WORDSIZE == 64
36
35
# define atomicincunlock(lock) (void) 0
37
36
# define atomicinc(var) catomic_increment (&(var))
38
37
#else
 
38
__libc_lock_define_initialized (static, lock);
39
39
# define atomicinclock(lock) __libc_lock_lock (lock)
40
40
# define atomicincunlock(lock) __libc_lock_unlock (lock)
41
41
# define atomicinc(var) ++var
100
100
 
101
101
        if (resp->options & RES_INIT) {
102
102
                ret = stat (_PATH_RESCONF, &statbuf);
103
 
                __libc_lock_lock (lock);
104
103
                if ((ret == 0) && (last_mtime != statbuf.st_mtime)) {
105
104
                        last_mtime = statbuf.st_mtime;
 
105
                        atomicinclock (lock);
106
106
                        atomicinc (__res_initstamp);
 
107
                        atomicincunlock (lock);
107
108
                }
108
 
                __libc_lock_unlock (lock);
109
109
                if (__res_initstamp != resp->_u._ext.initstamp) {
110
110
                        if (resp->nscount > 0)
111
111
                                __res_iclose (resp, true);
137
137
 
138
138
#include <tls.h>
139
139
 
 
140
#if USE___THREAD
140
141
#undef __resp
141
142
__thread struct __res_state *__resp = &_res;
142
143
extern __thread struct __res_state *__libc_resp
143
144
  __attribute__ ((alias ("__resp"))) attribute_hidden;
 
145
#endif
144
146
 
145
147
/* We declare this with compat_symbol so that it's not
146
148
   visible at link time.  Programs must use the accessor functions.  */