~ubuntu-branches/ubuntu/trusty/llvm-toolchain-snapshot/trusty-201310232150

« back to all changes in this revision

Viewing changes to compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-27 15:01:57 UTC
  • mfrom: (0.10.1) (0.9.1) (0.8.1) (0.7.1) (0.6.1) (0.5.2)
  • Revision ID: package-import@ubuntu.com-20130527150157-tdkrsjpuvht7v0qx
Tags: 1:3.4~svn182733-1~exp1
* New snapshot release (3.4 release)
* Add a symlink of libLLVM-3.4.so.1 to usr/lib/llvm-3.4/lib/libLLVM-3.4.so
    to fix make the llvm-config-3.4 --libdir work (Closes: #708677)
  * Various packages rename to allow co installations:
    * libclang1 => libclang1-3.4
    * libclang1-dbg => libclang1-3.4-dbg
    * libclang-dev => libclang-3.4-dev
    * libclang-common-dev => libclang-common-3.4-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "sanitizer_internal_defs.h"
20
20
#include "sanitizer_platform_limits_posix.h"
21
21
 
 
22
#include <arpa/inet.h>
22
23
#include <dirent.h>
 
24
#include <grp.h>
23
25
#include <pthread.h>
24
26
#include <pwd.h>
25
27
#include <signal.h>
 
28
#include <stddef.h>
26
29
#include <sys/utsname.h>
27
30
#include <sys/types.h>
28
31
#include <sys/stat.h>
 
32
#include <sys/socket.h>
29
33
#include <sys/time.h>
30
34
#include <sys/resource.h>
31
35
#include <sys/socket.h>
 
36
#include <netdb.h>
32
37
#include <time.h>
33
38
 
34
39
#if !SANITIZER_ANDROID
36
41
#endif // !SANITIZER_ANDROID
37
42
 
38
43
#if SANITIZER_LINUX
 
44
#include <link.h>
39
45
#include <sys/vfs.h>
40
46
#include <sys/epoll.h>
41
47
#endif // SANITIZER_LINUX
47
53
  unsigned struct_rusage_sz = sizeof(struct rusage);
48
54
  unsigned struct_tm_sz = sizeof(struct tm);
49
55
  unsigned struct_passwd_sz = sizeof(struct passwd);
 
56
  unsigned struct_group_sz = sizeof(struct group);
50
57
  unsigned siginfo_t_sz = sizeof(siginfo_t);
51
58
  unsigned struct_sigaction_sz = sizeof(struct sigaction);
52
59
  unsigned struct_itimerval_sz = sizeof(struct itimerval);
53
60
  unsigned pthread_t_sz = sizeof(pthread_t);
 
61
  unsigned struct_sockaddr_sz = sizeof(struct sockaddr);
54
62
 
55
63
#if !SANITIZER_ANDROID
56
64
  unsigned ucontext_t_sz = sizeof(ucontext_t);
103
111
    struct sigaction *a = (struct sigaction *)act;
104
112
    return a->sa_flags & SA_SIGINFO;
105
113
  }
 
114
 
 
115
  uptr __sanitizer_in_addr_sz(int af) {
 
116
    if (af == AF_INET)
 
117
      return sizeof(struct in_addr);
 
118
    else if (af == AF_INET6)
 
119
      return sizeof(struct in6_addr);
 
120
    else
 
121
      return 0;
 
122
  }
106
123
}  // namespace __sanitizer
107
124
 
108
125
COMPILER_CHECK(sizeof(__sanitizer_pthread_attr_t) >= sizeof(pthread_attr_t));
109
126
COMPILER_CHECK(sizeof(__sanitizer::struct_sigaction_max_sz) >=
110
127
                   sizeof(__sanitizer::struct_sigaction_sz));
 
128
#if SANITIZER_LINUX
 
129
COMPILER_CHECK(offsetof(struct __sanitizer_dl_phdr_info, dlpi_addr) ==
 
130
               offsetof(struct dl_phdr_info, dlpi_addr));
 
131
COMPILER_CHECK(offsetof(struct __sanitizer_dl_phdr_info, dlpi_name) ==
 
132
               offsetof(struct dl_phdr_info, dlpi_name));
 
133
COMPILER_CHECK(offsetof(struct __sanitizer_dl_phdr_info, dlpi_phdr) ==
 
134
               offsetof(struct dl_phdr_info, dlpi_phdr));
 
135
COMPILER_CHECK(offsetof(struct __sanitizer_dl_phdr_info, dlpi_phnum) ==
 
136
               offsetof(struct dl_phdr_info, dlpi_phnum));
 
137
#endif
 
138
 
 
139
COMPILER_CHECK(sizeof(struct __sanitizer_addrinfo) == sizeof(struct addrinfo));
 
140
COMPILER_CHECK(offsetof(struct __sanitizer_addrinfo, ai_addr) ==
 
141
               offsetof(struct addrinfo, ai_addr));
 
142
COMPILER_CHECK(offsetof(struct __sanitizer_addrinfo, ai_canonname) ==
 
143
               offsetof(struct addrinfo, ai_canonname));
 
144
COMPILER_CHECK(offsetof(struct __sanitizer_addrinfo, ai_next) ==
 
145
               offsetof(struct addrinfo, ai_next));
 
146
 
 
147
COMPILER_CHECK(sizeof(struct __sanitizer_hostent) == sizeof(struct hostent));
 
148
COMPILER_CHECK(offsetof(struct __sanitizer_hostent, h_name) ==
 
149
               offsetof(struct hostent, h_name));
 
150
COMPILER_CHECK(offsetof(struct __sanitizer_hostent, h_aliases) ==
 
151
               offsetof(struct hostent, h_aliases));
 
152
COMPILER_CHECK(offsetof(struct __sanitizer_hostent, h_addr_list) ==
 
153
               offsetof(struct hostent, h_addr_list));
 
154
 
111
155
#endif  // SANITIZER_LINUX || SANITIZER_MAC