OLD | NEW |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 # Copyright 2009 The Go Authors. All rights reserved. | 2 # Copyright 2009 The Go Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style | 3 # Use of this source code is governed by a BSD-style |
4 # license that can be found in the LICENSE file. | 4 # license that can be found in the LICENSE file. |
5 | 5 |
6 # Generate Go code listing errors and other #defined constant | 6 # Generate Go code listing errors and other #defined constant |
7 # values (ENAMETOOLONG etc.), by asking the preprocessor | 7 # values (ENAMETOOLONG etc.), by asking the preprocessor |
8 # about the definitions. | 8 # about the definitions. |
9 | 9 |
10 unset LANG | 10 unset LANG |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 #define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq co
ntains if_data | 113 #define SIOCSIFPHYADDR _IOW(105, 70, struct oifaliasreq) // ifaliasreq co
ntains if_data |
114 #endif | 114 #endif |
115 ' | 115 ' |
116 | 116 |
117 includes_Linux=' | 117 includes_Linux=' |
118 #define _LARGEFILE_SOURCE | 118 #define _LARGEFILE_SOURCE |
119 #define _LARGEFILE64_SOURCE | 119 #define _LARGEFILE64_SOURCE |
120 #define _FILE_OFFSET_BITS 64 | 120 #define _FILE_OFFSET_BITS 64 |
121 #define _GNU_SOURCE | 121 #define _GNU_SOURCE |
122 | 122 |
123 #include <bits/sockaddr.h> | 123 #include <termios.h> |
124 #include <sys/epoll.h> | 124 #include <sys/epoll.h> |
125 #include <sys/inotify.h> | 125 #include <sys/inotify.h> |
126 #include <sys/ioctl.h> | 126 #include <sys/ioctl.h> |
127 #include <sys/mman.h> | 127 #include <sys/mman.h> |
128 #include <sys/mount.h> | 128 #include <sys/mount.h> |
129 #include <sys/prctl.h> | 129 #include <sys/prctl.h> |
| 130 #include <sys/socket.h> |
130 #include <sys/stat.h> | 131 #include <sys/stat.h> |
131 #include <sys/types.h> | 132 #include <sys/types.h> |
132 #include <sys/time.h> | 133 #include <sys/time.h> |
133 #include <sys/socket.h> | 134 #include <bits/sockaddr.h> |
| 135 #include <net/route.h> |
| 136 #include <linux/icmpv6.h> |
134 #include <linux/if.h> | 137 #include <linux/if.h> |
| 138 #include <linux/if_addr.h> |
135 #include <linux/if_arp.h> | 139 #include <linux/if_arp.h> |
136 #include <linux/if_ether.h> | 140 #include <linux/if_ether.h> |
| 141 #include <linux/if_packet.h> |
137 #include <linux/if_tun.h> | 142 #include <linux/if_tun.h> |
138 #include <linux/if_packet.h> | |
139 #include <linux/if_addr.h> | |
140 #include <linux/filter.h> | 143 #include <linux/filter.h> |
141 #include <linux/netlink.h> | 144 #include <linux/netlink.h> |
| 145 #include <linux/ptrace.h> |
142 #include <linux/reboot.h> | 146 #include <linux/reboot.h> |
143 #include <linux/rtnetlink.h> | 147 #include <linux/rtnetlink.h> |
144 #include <linux/ptrace.h> | |
145 #include <linux/sched.h> | 148 #include <linux/sched.h> |
146 #include <linux/wait.h> | 149 #include <linux/wait.h> |
147 #include <linux/icmpv6.h> | |
148 #include <net/route.h> | |
149 #include <termios.h> | |
150 | 150 |
151 #ifndef MSG_FASTOPEN | 151 #ifndef MSG_FASTOPEN |
152 #define MSG_FASTOPEN 0x20000000 | 152 #define MSG_FASTOPEN» 0x20000000 |
| 153 #endif |
| 154 |
| 155 // We keep some constants not supported in Linux 3.14 and beyond for |
| 156 // the promise of compatibility. |
| 157 #ifndef ARPHRD_IEEE802154_PHY |
| 158 #define ARPHRD_IEEE802154_PHY» » 0x325 |
| 159 #endif |
| 160 #ifndef EPOLL_NONBLOCK |
| 161 #define EPOLL_NONBLOCK» » » 0x800 |
| 162 #endif |
| 163 #ifdef __ARM_EABI__ |
| 164 #ifndef ELF_NGREG |
| 165 #define ELF_NGREG» » » 0x12 |
| 166 #endif |
| 167 #ifndef ELF_PRARGSZ |
| 168 #define ELF_PRARGSZ» » » 0x50 |
| 169 #endif |
| 170 #ifndef PR_SECCOMP_FILTER_SYSCALL |
| 171 #define PR_SECCOMP_FILTER_SYSCALL» 0x0 |
| 172 #endif |
| 173 #ifndef PR_SECCOMP_FILTER_EVENT |
| 174 #define PR_SECCOMP_FILTER_EVENT»» 0x1 |
| 175 #endif |
| 176 #ifndef PR_GET_SECCOMP_FILTER |
| 177 #define PR_GET_SECCOMP_FILTER» » 0x23 |
| 178 #endif |
| 179 #ifndef PR_SET_SECCOMP_FILTER |
| 180 #define PR_SET_SECCOMP_FILTER» » 0x24 |
| 181 #endif |
| 182 #ifndef PR_CLEAR_SECCOMP_FILTER |
| 183 #define PR_CLEAR_SECCOMP_FILTER»» 0x25 |
| 184 #endif |
153 #endif | 185 #endif |
154 ' | 186 ' |
155 | 187 |
156 includes_NetBSD=' | 188 includes_NetBSD=' |
157 #include <sys/types.h> | 189 #include <sys/types.h> |
158 #include <sys/param.h> | 190 #include <sys/param.h> |
159 #include <sys/event.h> | 191 #include <sys/event.h> |
160 #include <sys/mman.h> | 192 #include <sys/mman.h> |
161 #include <sys/socket.h> | 193 #include <sys/socket.h> |
162 #include <sys/sockio.h> | 194 #include <sys/sockio.h> |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 302 |
271 $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers | 303 $2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers |
272 $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next} | 304 $2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next} |
273 $2 ~ /^(SCM_SRCRT)$/ {next} | 305 $2 ~ /^(SCM_SRCRT)$/ {next} |
274 $2 ~ /^(MAP_FAILED)$/ {next} | 306 $2 ~ /^(MAP_FAILED)$/ {next} |
275 | 307 |
276 $2 !~ /^ETH_/ && | 308 $2 !~ /^ETH_/ && |
277 $2 !~ /^EPROC_/ && | 309 $2 !~ /^EPROC_/ && |
278 $2 !~ /^EQUIV_/ && | 310 $2 !~ /^EQUIV_/ && |
279 $2 !~ /^EXPR_/ && | 311 $2 !~ /^EXPR_/ && |
| 312 $2 !~ "EPOLLET" && |
280 $2 ~ /^E[A-Z0-9_]+$/ || | 313 $2 ~ /^E[A-Z0-9_]+$/ || |
281 $2 ~ /^B[0-9_]+$/ || | 314 $2 ~ /^B[0-9_]+$/ || |
282 $2 ~ /^V[A-Z0-9]+$/ || | 315 $2 ~ /^V[A-Z0-9]+$/ || |
283 $2 ~ /^CS[A-Z0-9]/ || | 316 $2 ~ /^CS[A-Z0-9]/ || |
284 $2 ~ /^I(SIG|CANON|CRNL|EXTEN|MAXBEL|STRIP|UTF8)$/ || | 317 $2 ~ /^I(SIG|CANON|CRNL|EXTEN|MAXBEL|STRIP|UTF8)$/ || |
285 $2 ~ /^IGN/ || | 318 $2 ~ /^IGN/ || |
286 $2 ~ /^IX(ON|ANY|OFF)$/ || | 319 $2 ~ /^IX(ON|ANY|OFF)$/ || |
287 $2 ~ /^IN(LCR|PCK)$/ || | 320 $2 ~ /^IN(LCR|PCK)$/ || |
288 $2 ~ /(^FLU?SH)|(FLU?SH$)/ || | 321 $2 ~ /(^FLU?SH)|(FLU?SH$)/ || |
289 $2 ~ /^C(LOCAL|READ)$/ || | 322 $2 ~ /^C(LOCAL|READ)$/ || |
| 323 $2 ~ /^TC(GETS|SETS)$/ || |
290 $2 == "BRKINT" || | 324 $2 == "BRKINT" || |
291 $2 == "HUPCL" || | 325 $2 == "HUPCL" || |
292 $2 == "PENDIN" || | 326 $2 == "PENDIN" || |
293 $2 == "TOSTOP" || | 327 $2 == "TOSTOP" || |
| 328 $2 == "IUCLC" || |
| 329 $2 == "OLCUC" || |
| 330 $2 == "XCASE" || |
294 $2 ~ /^PAR/ || | 331 $2 ~ /^PAR/ || |
295 $2 ~ /^SIG[^_]/ || | 332 $2 ~ /^SIG[^_]/ || |
296 $2 ~ /^O[CNPFP][A-Z]+[^_][A-Z]+$/ || | 333 $2 ~ /^O[CNPFP][A-Z]+[^_][A-Z]+$/ || |
297 $2 ~ /^IN_/ || | 334 $2 ~ /^IN_/ || |
298 $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || | 335 $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || |
299 $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|
SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR|MCAST)_/ || | 336 $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|
SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR|MCAST)_/ || |
300 $2 == "ICMPV6_FILTER" || | 337 $2 == "ICMPV6_FILTER" || |
301 $2 == "SOMAXCONN" || | 338 $2 == "SOMAXCONN" || |
302 $2 == "NAME_MAX" || | 339 $2 == "NAME_MAX" || |
303 $2 == "IFNAMSIZ" || | 340 $2 == "IFNAMSIZ" || |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 } | 491 } |
455 printf("}\n\n"); | 492 printf("}\n\n"); |
456 | 493 |
457 return 0; | 494 return 0; |
458 } | 495 } |
459 | 496 |
460 ' | 497 ' |
461 ) >_errors.c | 498 ) >_errors.c |
462 | 499 |
463 $CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors
_const.go _error.grep _signal.grep _error.out | 500 $CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors
_const.go _error.grep _signal.grep _error.out |
OLD | NEW |