| [dba07d0] | 1 | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 | typedef unsigned char __u_char;
|
|---|
| 11 | typedef unsigned short int __u_short;
|
|---|
| 12 | typedef unsigned int __u_int;
|
|---|
| 13 | typedef unsigned long int __u_long;
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 | typedef signed char __int8_t;
|
|---|
| 17 | typedef unsigned char __uint8_t;
|
|---|
| 18 | typedef signed short int __int16_t;
|
|---|
| 19 | typedef unsigned short int __uint16_t;
|
|---|
| 20 | typedef signed int __int32_t;
|
|---|
| 21 | typedef unsigned int __uint32_t;
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | __extension__ typedef signed long long int __int64_t;
|
|---|
| 27 | __extension__ typedef unsigned long long int __uint64_t;
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | __extension__ typedef long long int __quad_t;
|
|---|
| 36 | __extension__ typedef unsigned long long int __u_quad_t;
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | __extension__ typedef __u_quad_t __dev_t;
|
|---|
| 40 | __extension__ typedef unsigned int __uid_t;
|
|---|
| 41 | __extension__ typedef unsigned int __gid_t;
|
|---|
| 42 | __extension__ typedef unsigned long int __ino_t;
|
|---|
| 43 | __extension__ typedef __u_quad_t __ino64_t;
|
|---|
| 44 | __extension__ typedef unsigned int __mode_t;
|
|---|
| 45 | __extension__ typedef unsigned int __nlink_t;
|
|---|
| 46 | __extension__ typedef long int __off_t;
|
|---|
| 47 | __extension__ typedef __quad_t __off64_t;
|
|---|
| 48 | __extension__ typedef int __pid_t;
|
|---|
| 49 | __extension__ typedef struct { int __val[2]; } __fsid_t;
|
|---|
| 50 | __extension__ typedef long int __clock_t;
|
|---|
| 51 | __extension__ typedef unsigned long int __rlim_t;
|
|---|
| 52 | __extension__ typedef __u_quad_t __rlim64_t;
|
|---|
| 53 | __extension__ typedef unsigned int __id_t;
|
|---|
| 54 | __extension__ typedef long int __time_t;
|
|---|
| 55 | __extension__ typedef unsigned int __useconds_t;
|
|---|
| 56 | __extension__ typedef long int __suseconds_t;
|
|---|
| 57 |
|
|---|
| 58 | __extension__ typedef int __daddr_t;
|
|---|
| 59 | __extension__ typedef long int __swblk_t;
|
|---|
| 60 | __extension__ typedef int __key_t;
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 | __extension__ typedef int __clockid_t;
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 | __extension__ typedef void * __timer_t;
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 | __extension__ typedef long int __blksize_t;
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | __extension__ typedef long int __blkcnt_t;
|
|---|
| 75 | __extension__ typedef __quad_t __blkcnt64_t;
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 | __extension__ typedef unsigned long int __fsblkcnt_t;
|
|---|
| 79 | __extension__ typedef __u_quad_t __fsblkcnt64_t;
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 | __extension__ typedef unsigned long int __fsfilcnt_t;
|
|---|
| 83 | __extension__ typedef __u_quad_t __fsfilcnt64_t;
|
|---|
| 84 |
|
|---|
| 85 | __extension__ typedef int __ssize_t;
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 | typedef __off64_t __loff_t;
|
|---|
| 90 | typedef __quad_t *__qaddr_t;
|
|---|
| 91 | typedef char *__caddr_t;
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 | __extension__ typedef int __intptr_t;
|
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 | __extension__ typedef unsigned int __socklen_t;
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 | typedef unsigned int size_t;
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 | typedef __time_t time_t;
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 | struct timespec
|
|---|
| 111 | {
|
|---|
| 112 | __time_t tv_sec;
|
|---|
| 113 | long int tv_nsec;
|
|---|
| 114 | };
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 | typedef __pid_t pid_t;
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 | struct sched_param
|
|---|
| 124 | {
|
|---|
| 125 | int __sched_priority;
|
|---|
| 126 | };
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 | struct __sched_param
|
|---|
| 138 | {
|
|---|
| 139 | int __sched_priority;
|
|---|
| 140 | };
|
|---|
| 141 | typedef unsigned long int __cpu_mask;
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 | typedef struct
|
|---|
| 149 | {
|
|---|
| 150 | __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
|
|---|
| 151 | } cpu_set_t;
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 | extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
|
|---|
| 155 | __attribute__ ((__nothrow__));
|
|---|
| 156 | extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__)) ;
|
|---|
| 157 | extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__));
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 | extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
|
|---|
| 168 | __attribute__ ((__nothrow__));
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 | extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__));
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 | extern int sched_setscheduler (__pid_t __pid, int __policy,
|
|---|
| 175 | __const struct sched_param *__param) __attribute__ ((__nothrow__));
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 | extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__));
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 | extern int sched_yield (void) __attribute__ ((__nothrow__));
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 | extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__));
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 | extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__));
|
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 | extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__));
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 | typedef __clock_t clock_t;
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 | typedef __clockid_t clockid_t;
|
|---|
| 210 | typedef __timer_t timer_t;
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 | struct tm
|
|---|
| 214 | {
|
|---|
| 215 | int tm_sec;
|
|---|
| 216 | int tm_min;
|
|---|
| 217 | int tm_hour;
|
|---|
| 218 | int tm_mday;
|
|---|
| 219 | int tm_mon;
|
|---|
| 220 | int tm_year;
|
|---|
| 221 | int tm_wday;
|
|---|
| 222 | int tm_yday;
|
|---|
| 223 | int tm_isdst;
|
|---|
| 224 |
|
|---|
| 225 |
|
|---|
| 226 | long int tm_gmtoff;
|
|---|
| 227 | __const char *tm_zone;
|
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 | };
|
|---|
| 233 |
|
|---|
| 234 |
|
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 |
|
|---|
| 239 |
|
|---|
| 240 |
|
|---|
| 241 | struct itimerspec
|
|---|
| 242 | {
|
|---|
| 243 | struct timespec it_interval;
|
|---|
| 244 | struct timespec it_value;
|
|---|
| 245 | };
|
|---|
| 246 |
|
|---|
| 247 |
|
|---|
| 248 | struct sigevent;
|
|---|
| 249 |
|
|---|
| 250 |
|
|---|
| 251 |
|
|---|
| 252 | extern clock_t clock (void) __attribute__ ((__nothrow__));
|
|---|
| 253 |
|
|---|
| 254 |
|
|---|
| 255 | extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
|
|---|
| 256 |
|
|---|
| 257 |
|
|---|
| 258 | extern double difftime (time_t __time1, time_t __time0)
|
|---|
| 259 | __attribute__ ((__nothrow__)) __attribute__ ((__const__));
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 | extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 | extern size_t strftime (char *__restrict __s, size_t __maxsize,
|
|---|
| 269 | __const char *__restrict __format,
|
|---|
| 270 | __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
|
|---|
| 271 |
|
|---|
| 272 | typedef struct __locale_struct
|
|---|
| 273 | {
|
|---|
| 274 |
|
|---|
| 275 | struct __locale_data *__locales[13];
|
|---|
| 276 |
|
|---|
| 277 |
|
|---|
| 278 | const unsigned short int *__ctype_b;
|
|---|
| 279 | const int *__ctype_tolower;
|
|---|
| 280 | const int *__ctype_toupper;
|
|---|
| 281 |
|
|---|
| 282 |
|
|---|
| 283 | const char *__names[13];
|
|---|
| 284 | } *__locale_t;
|
|---|
| 285 |
|
|---|
| 286 |
|
|---|
| 287 | typedef __locale_t locale_t;
|
|---|
| 288 |
|
|---|
| 289 | extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
|
|---|
| 290 | __const char *__restrict __format,
|
|---|
| 291 | __const struct tm *__restrict __tp,
|
|---|
| 292 | __locale_t __loc) __attribute__ ((__nothrow__));
|
|---|
| 293 |
|
|---|
| 294 |
|
|---|
| 295 |
|
|---|
| 296 | extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));
|
|---|
| 297 |
|
|---|
| 298 |
|
|---|
| 299 |
|
|---|
| 300 | extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));
|
|---|
| 301 |
|
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 |
|
|---|
| 306 | extern struct tm *gmtime_r (__const time_t *__restrict __timer,
|
|---|
| 307 | struct tm *__restrict __tp) __attribute__ ((__nothrow__));
|
|---|
| 308 |
|
|---|
| 309 |
|
|---|
| 310 |
|
|---|
| 311 | extern struct tm *localtime_r (__const time_t *__restrict __timer,
|
|---|
| 312 | struct tm *__restrict __tp) __attribute__ ((__nothrow__));
|
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
|
|---|
| 318 | extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));
|
|---|
| 319 |
|
|---|
| 320 |
|
|---|
| 321 | extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 |
|
|---|
| 325 |
|
|---|
| 326 |
|
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 | extern char *asctime_r (__const struct tm *__restrict __tp,
|
|---|
| 330 | char *__restrict __buf) __attribute__ ((__nothrow__));
|
|---|
| 331 |
|
|---|
| 332 |
|
|---|
| 333 | extern char *ctime_r (__const time_t *__restrict __timer,
|
|---|
| 334 | char *__restrict __buf) __attribute__ ((__nothrow__));
|
|---|
| 335 |
|
|---|
| 336 |
|
|---|
| 337 |
|
|---|
| 338 |
|
|---|
| 339 | extern char *__tzname[2];
|
|---|
| 340 | extern int __daylight;
|
|---|
| 341 | extern long int __timezone;
|
|---|
| 342 |
|
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| 346 | extern char *tzname[2];
|
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 | extern void tzset (void) __attribute__ ((__nothrow__));
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 |
|
|---|
| 354 | extern int daylight;
|
|---|
| 355 | extern long int timezone;
|
|---|
| 356 |
|
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 |
|
|---|
| 360 |
|
|---|
| 361 | extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
|
|---|
| 362 | extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
|
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 | extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
|
|---|
| 366 |
|
|---|
| 367 |
|
|---|
| 368 | extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
|
|---|
| 369 | extern int nanosleep (__const struct timespec *__requested_time,
|
|---|
| 370 | struct timespec *__remaining);
|
|---|
| 371 |
|
|---|
| 372 |
|
|---|
| 373 |
|
|---|
| 374 | extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
|
|---|
| 375 |
|
|---|
| 376 |
|
|---|
| 377 | extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
|
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 | extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
|
|---|
| 381 | __attribute__ ((__nothrow__));
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 | extern int clock_nanosleep (clockid_t __clock_id, int __flags,
|
|---|
| 389 | __const struct timespec *__req,
|
|---|
| 390 | struct timespec *__rem);
|
|---|
| 391 |
|
|---|
| 392 |
|
|---|
| 393 | extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__));
|
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 | extern int timer_create (clockid_t __clock_id,
|
|---|
| 399 | struct sigevent *__restrict __evp,
|
|---|
| 400 | timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
|
|---|
| 401 |
|
|---|
| 402 |
|
|---|
| 403 | extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
|
|---|
| 404 |
|
|---|
| 405 |
|
|---|
| 406 | extern int timer_settime (timer_t __timerid, int __flags,
|
|---|
| 407 | __const struct itimerspec *__restrict __value,
|
|---|
| 408 | struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
|
|---|
| 409 |
|
|---|
| 410 |
|
|---|
| 411 | extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
|
|---|
| 412 | __attribute__ ((__nothrow__));
|
|---|
| 413 |
|
|---|
| 414 |
|
|---|
| 415 | extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
|
|---|
| 416 |
|
|---|
| 417 |
|
|---|
| 418 | typedef unsigned long int pthread_t;
|
|---|
| 419 |
|
|---|
| 420 |
|
|---|
| 421 | typedef union
|
|---|
| 422 | {
|
|---|
| 423 | char __size[36];
|
|---|
| 424 | long int __align;
|
|---|
| 425 | } pthread_attr_t;
|
|---|
| 426 |
|
|---|
| 427 |
|
|---|
| 428 | typedef struct __pthread_internal_slist
|
|---|
| 429 | {
|
|---|
| 430 | struct __pthread_internal_slist *__next;
|
|---|
| 431 | } __pthread_slist_t;
|
|---|
| 432 |
|
|---|
| 433 |
|
|---|
| 434 |
|
|---|
| 435 |
|
|---|
| 436 | typedef union
|
|---|
| 437 | {
|
|---|
| 438 | struct __pthread_mutex_s
|
|---|
| 439 | {
|
|---|
| 440 | int __lock;
|
|---|
| 441 | unsigned int __count;
|
|---|
| 442 | int __owner;
|
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 | int __kind;
|
|---|
| 446 | unsigned int __nusers;
|
|---|
| 447 | __extension__ union
|
|---|
| 448 | {
|
|---|
| 449 | int __spins;
|
|---|
| 450 | __pthread_slist_t __list;
|
|---|
| 451 | };
|
|---|
| 452 | } __data;
|
|---|
| 453 | char __size[24];
|
|---|
| 454 | long int __align;
|
|---|
| 455 | } pthread_mutex_t;
|
|---|
| 456 |
|
|---|
| 457 | typedef union
|
|---|
| 458 | {
|
|---|
| 459 | char __size[4];
|
|---|
| 460 | long int __align;
|
|---|
| 461 | } pthread_mutexattr_t;
|
|---|
| 462 |
|
|---|
| 463 |
|
|---|
| 464 |
|
|---|
| 465 |
|
|---|
| 466 | typedef union
|
|---|
| 467 | {
|
|---|
| 468 | struct
|
|---|
| 469 | {
|
|---|
| 470 | int __lock;
|
|---|
| 471 | unsigned int __futex;
|
|---|
| 472 | __extension__ unsigned long long int __total_seq;
|
|---|
| 473 | __extension__ unsigned long long int __wakeup_seq;
|
|---|
| 474 | __extension__ unsigned long long int __woken_seq;
|
|---|
| 475 | void *__mutex;
|
|---|
| 476 | unsigned int __nwaiters;
|
|---|
| 477 | unsigned int __broadcast_seq;
|
|---|
| 478 | } __data;
|
|---|
| 479 | char __size[48];
|
|---|
| 480 | __extension__ long long int __align;
|
|---|
| 481 | } pthread_cond_t;
|
|---|
| 482 |
|
|---|
| 483 | typedef union
|
|---|
| 484 | {
|
|---|
| 485 | char __size[4];
|
|---|
| 486 | long int __align;
|
|---|
| 487 | } pthread_condattr_t;
|
|---|
| 488 |
|
|---|
| 489 |
|
|---|
| 490 |
|
|---|
| 491 | typedef unsigned int pthread_key_t;
|
|---|
| 492 |
|
|---|
| 493 |
|
|---|
| 494 |
|
|---|
| 495 | typedef int pthread_once_t;
|
|---|
| 496 |
|
|---|
| 497 |
|
|---|
| 498 |
|
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 | typedef union
|
|---|
| 502 | {
|
|---|
| 503 | struct
|
|---|
| 504 | {
|
|---|
| 505 | int __lock;
|
|---|
| 506 | unsigned int __nr_readers;
|
|---|
| 507 | unsigned int __readers_wakeup;
|
|---|
| 508 | unsigned int __writer_wakeup;
|
|---|
| 509 | unsigned int __nr_readers_queued;
|
|---|
| 510 | unsigned int __nr_writers_queued;
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 | unsigned char __flags;
|
|---|
| 514 | unsigned char __shared;
|
|---|
| 515 | unsigned char __pad1;
|
|---|
| 516 | unsigned char __pad2;
|
|---|
| 517 | int __writer;
|
|---|
| 518 | } __data;
|
|---|
| 519 | char __size[32];
|
|---|
| 520 | long int __align;
|
|---|
| 521 | } pthread_rwlock_t;
|
|---|
| 522 |
|
|---|
| 523 | typedef union
|
|---|
| 524 | {
|
|---|
| 525 | char __size[8];
|
|---|
| 526 | long int __align;
|
|---|
| 527 | } pthread_rwlockattr_t;
|
|---|
| 528 |
|
|---|
| 529 |
|
|---|
| 530 |
|
|---|
| 531 |
|
|---|
| 532 |
|
|---|
| 533 | typedef volatile int pthread_spinlock_t;
|
|---|
| 534 |
|
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 | typedef union
|
|---|
| 539 | {
|
|---|
| 540 | char __size[20];
|
|---|
| 541 | long int __align;
|
|---|
| 542 | } pthread_barrier_t;
|
|---|
| 543 |
|
|---|
| 544 | typedef union
|
|---|
| 545 | {
|
|---|
| 546 | char __size[4];
|
|---|
| 547 | int __align;
|
|---|
| 548 | } pthread_barrierattr_t;
|
|---|
| 549 | typedef int __jmp_buf[6];
|
|---|
| 550 |
|
|---|
| 551 |
|
|---|
| 552 |
|
|---|
| 553 | enum
|
|---|
| 554 | {
|
|---|
| 555 | PTHREAD_CREATE_JOINABLE,
|
|---|
| 556 |
|
|---|
| 557 | PTHREAD_CREATE_DETACHED
|
|---|
| 558 |
|
|---|
| 559 | };
|
|---|
| 560 |
|
|---|
| 561 |
|
|---|
| 562 |
|
|---|
| 563 | enum
|
|---|
| 564 | {
|
|---|
| 565 | PTHREAD_MUTEX_TIMED_NP,
|
|---|
| 566 | PTHREAD_MUTEX_RECURSIVE_NP,
|
|---|
| 567 | PTHREAD_MUTEX_ERRORCHECK_NP,
|
|---|
| 568 | PTHREAD_MUTEX_ADAPTIVE_NP
|
|---|
| 569 |
|
|---|
| 570 | ,
|
|---|
| 571 | PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
|
|---|
| 572 | PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
|
|---|
| 573 | PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
|
|---|
| 574 | PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
|
|---|
| 575 |
|
|---|
| 576 |
|
|---|
| 577 |
|
|---|
| 578 |
|
|---|
| 579 |
|
|---|
| 580 | };
|
|---|
| 581 |
|
|---|
| 582 |
|
|---|
| 583 |
|
|---|
| 584 |
|
|---|
| 585 | enum
|
|---|
| 586 | {
|
|---|
| 587 | PTHREAD_MUTEX_STALLED,
|
|---|
| 588 | PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
|
|---|
| 589 | PTHREAD_MUTEX_ROBUST,
|
|---|
| 590 | PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
|
|---|
| 591 | };
|
|---|
| 592 | enum
|
|---|
| 593 | {
|
|---|
| 594 | PTHREAD_RWLOCK_PREFER_READER_NP,
|
|---|
| 595 | PTHREAD_RWLOCK_PREFER_WRITER_NP,
|
|---|
| 596 | PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
|
|---|
| 597 | PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
|
|---|
| 598 | };
|
|---|
| 599 | enum
|
|---|
| 600 | {
|
|---|
| 601 | PTHREAD_INHERIT_SCHED,
|
|---|
| 602 |
|
|---|
| 603 | PTHREAD_EXPLICIT_SCHED
|
|---|
| 604 |
|
|---|
| 605 | };
|
|---|
| 606 |
|
|---|
| 607 |
|
|---|
| 608 |
|
|---|
| 609 | enum
|
|---|
| 610 | {
|
|---|
| 611 | PTHREAD_SCOPE_SYSTEM,
|
|---|
| 612 |
|
|---|
| 613 | PTHREAD_SCOPE_PROCESS
|
|---|
| 614 |
|
|---|
| 615 | };
|
|---|
| 616 |
|
|---|
| 617 |
|
|---|
| 618 |
|
|---|
| 619 | enum
|
|---|
| 620 | {
|
|---|
| 621 | PTHREAD_PROCESS_PRIVATE,
|
|---|
| 622 |
|
|---|
| 623 | PTHREAD_PROCESS_SHARED
|
|---|
| 624 |
|
|---|
| 625 | };
|
|---|
| 626 | struct _pthread_cleanup_buffer
|
|---|
| 627 | {
|
|---|
| 628 | void (*__routine) (void *);
|
|---|
| 629 | void *__arg;
|
|---|
| 630 | int __canceltype;
|
|---|
| 631 | struct _pthread_cleanup_buffer *__prev;
|
|---|
| 632 | };
|
|---|
| 633 |
|
|---|
| 634 |
|
|---|
| 635 | enum
|
|---|
| 636 | {
|
|---|
| 637 | PTHREAD_CANCEL_ENABLE,
|
|---|
| 638 |
|
|---|
| 639 | PTHREAD_CANCEL_DISABLE
|
|---|
| 640 |
|
|---|
| 641 | };
|
|---|
| 642 | enum
|
|---|
| 643 | {
|
|---|
| 644 | PTHREAD_CANCEL_DEFERRED,
|
|---|
| 645 |
|
|---|
| 646 | PTHREAD_CANCEL_ASYNCHRONOUS
|
|---|
| 647 |
|
|---|
| 648 | };
|
|---|
| 649 |
|
|---|
| 650 |
|
|---|
| 651 |
|
|---|
| 652 |
|
|---|
| 653 |
|
|---|
| 654 | extern int pthread_create (pthread_t *__restrict __newthread,
|
|---|
| 655 | __const pthread_attr_t *__restrict __attr,
|
|---|
| 656 | void *(*__start_routine) (void *),
|
|---|
| 657 | void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
|
|---|
| 658 |
|
|---|
| 659 |
|
|---|
| 660 |
|
|---|
| 661 |
|
|---|
| 662 |
|
|---|
| 663 | extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
|
|---|
| 664 |
|
|---|
| 665 |
|
|---|
| 666 |
|
|---|
| 667 |
|
|---|
| 668 |
|
|---|
| 669 |
|
|---|
| 670 |
|
|---|
| 671 | extern int pthread_join (pthread_t __th, void **__thread_return);
|
|---|
| 672 | extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__));
|
|---|
| 673 |
|
|---|
| 674 |
|
|---|
| 675 |
|
|---|
| 676 | extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
|
|---|
| 677 |
|
|---|
| 678 |
|
|---|
| 679 | extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__));
|
|---|
| 680 |
|
|---|
| 681 |
|
|---|
| 682 |
|
|---|
| 683 |
|
|---|
| 684 |
|
|---|
| 685 |
|
|---|
| 686 |
|
|---|
| 687 | extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 688 |
|
|---|
| 689 |
|
|---|
| 690 | extern int pthread_attr_destroy (pthread_attr_t *__attr)
|
|---|
| 691 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 692 |
|
|---|
| 693 |
|
|---|
| 694 | extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
|
|---|
| 695 | int *__detachstate)
|
|---|
| 696 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 697 |
|
|---|
| 698 |
|
|---|
| 699 | extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
|
|---|
| 700 | int __detachstate)
|
|---|
| 701 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 702 |
|
|---|
| 703 |
|
|---|
| 704 |
|
|---|
| 705 | extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
|
|---|
| 706 | size_t *__guardsize)
|
|---|
| 707 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 708 |
|
|---|
| 709 |
|
|---|
| 710 | extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
|
|---|
| 711 | size_t __guardsize)
|
|---|
| 712 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 713 |
|
|---|
| 714 |
|
|---|
| 715 |
|
|---|
| 716 | extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
|
|---|
| 717 | __attr,
|
|---|
| 718 | struct sched_param *__restrict __param)
|
|---|
| 719 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 720 |
|
|---|
| 721 |
|
|---|
| 722 | extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
|
|---|
| 723 | __const struct sched_param *__restrict
|
|---|
| 724 | __param) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 725 |
|
|---|
| 726 |
|
|---|
| 727 | extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
|
|---|
| 728 | __attr, int *__restrict __policy)
|
|---|
| 729 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 730 |
|
|---|
| 731 |
|
|---|
| 732 | extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
|
|---|
| 733 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 734 |
|
|---|
| 735 |
|
|---|
| 736 | extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
|
|---|
| 737 | __attr, int *__restrict __inherit)
|
|---|
| 738 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 739 |
|
|---|
| 740 |
|
|---|
| 741 | extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
|
|---|
| 742 | int __inherit)
|
|---|
| 743 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 744 |
|
|---|
| 745 |
|
|---|
| 746 |
|
|---|
| 747 | extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
|
|---|
| 748 | int *__restrict __scope)
|
|---|
| 749 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 750 |
|
|---|
| 751 |
|
|---|
| 752 | extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
|
|---|
| 753 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 754 |
|
|---|
| 755 |
|
|---|
| 756 | extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
|
|---|
| 757 | __attr, void **__restrict __stackaddr)
|
|---|
| 758 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
|
|---|
| 759 |
|
|---|
| 760 |
|
|---|
| 761 |
|
|---|
| 762 |
|
|---|
| 763 |
|
|---|
| 764 | extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
|
|---|
| 765 | void *__stackaddr)
|
|---|
| 766 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
|
|---|
| 767 |
|
|---|
| 768 |
|
|---|
| 769 | extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
|
|---|
| 770 | __attr, size_t *__restrict __stacksize)
|
|---|
| 771 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 772 |
|
|---|
| 773 |
|
|---|
| 774 |
|
|---|
| 775 |
|
|---|
| 776 | extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
|
|---|
| 777 | size_t __stacksize)
|
|---|
| 778 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 779 |
|
|---|
| 780 |
|
|---|
| 781 |
|
|---|
| 782 | extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
|
|---|
| 783 | void **__restrict __stackaddr,
|
|---|
| 784 | size_t *__restrict __stacksize)
|
|---|
| 785 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3)));
|
|---|
| 786 |
|
|---|
| 787 |
|
|---|
| 788 |
|
|---|
| 789 |
|
|---|
| 790 | extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
|
|---|
| 791 | size_t __stacksize) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 792 | extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
|
|---|
| 793 | __const struct sched_param *__param)
|
|---|
| 794 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
|
|---|
| 795 |
|
|---|
| 796 |
|
|---|
| 797 | extern int pthread_getschedparam (pthread_t __target_thread,
|
|---|
| 798 | int *__restrict __policy,
|
|---|
| 799 | struct sched_param *__restrict __param)
|
|---|
| 800 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
|
|---|
| 801 |
|
|---|
| 802 |
|
|---|
| 803 | extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
|
|---|
| 804 | __attribute__ ((__nothrow__));
|
|---|
| 805 | extern int pthread_once (pthread_once_t *__once_control,
|
|---|
| 806 | void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 807 | extern int pthread_setcancelstate (int __state, int *__oldstate);
|
|---|
| 808 |
|
|---|
| 809 |
|
|---|
| 810 |
|
|---|
| 811 | extern int pthread_setcanceltype (int __type, int *__oldtype);
|
|---|
| 812 |
|
|---|
| 813 |
|
|---|
| 814 | extern int pthread_cancel (pthread_t __th);
|
|---|
| 815 |
|
|---|
| 816 |
|
|---|
| 817 |
|
|---|
| 818 |
|
|---|
| 819 | extern void pthread_testcancel (void);
|
|---|
| 820 |
|
|---|
| 821 |
|
|---|
| 822 |
|
|---|
| 823 |
|
|---|
| 824 | typedef struct
|
|---|
| 825 | {
|
|---|
| 826 | struct
|
|---|
| 827 | {
|
|---|
| 828 | __jmp_buf __cancel_jmp_buf;
|
|---|
| 829 | int __mask_was_saved;
|
|---|
| 830 | } __cancel_jmp_buf[1];
|
|---|
| 831 | void *__pad[4];
|
|---|
| 832 | } __pthread_unwind_buf_t __attribute__ ((__aligned__));
|
|---|
| 833 | struct __pthread_cleanup_frame
|
|---|
| 834 | {
|
|---|
| 835 | void (*__cancel_routine) (void *);
|
|---|
| 836 | void *__cancel_arg;
|
|---|
| 837 | int __do_it;
|
|---|
| 838 | int __cancel_type;
|
|---|
| 839 | };
|
|---|
| 840 | extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
|
|---|
| 841 | __attribute__ ((__regparm__ (1)));
|
|---|
| 842 | extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
|
|---|
| 843 | __attribute__ ((__regparm__ (1)));
|
|---|
| 844 | extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
|
|---|
| 845 | __attribute__ ((__regparm__ (1))) __attribute__ ((__noreturn__))
|
|---|
| 846 |
|
|---|
| 847 | __attribute__ ((__weak__))
|
|---|
| 848 |
|
|---|
| 849 | ;
|
|---|
| 850 |
|
|---|
| 851 |
|
|---|
| 852 |
|
|---|
| 853 | struct __jmp_buf_tag;
|
|---|
| 854 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
|
|---|
| 855 |
|
|---|
| 856 |
|
|---|
| 857 |
|
|---|
| 858 |
|
|---|
| 859 |
|
|---|
| 860 | extern int pthread_mutex_init (pthread_mutex_t *__mutex,
|
|---|
| 861 | __const pthread_mutexattr_t *__mutexattr)
|
|---|
| 862 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 863 |
|
|---|
| 864 |
|
|---|
| 865 | extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
|
|---|
| 866 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 867 |
|
|---|
| 868 |
|
|---|
| 869 | extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
|
|---|
| 870 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 871 |
|
|---|
| 872 |
|
|---|
| 873 | extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
|
|---|
| 874 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 875 |
|
|---|
| 876 |
|
|---|
| 877 |
|
|---|
| 878 | extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
|
|---|
| 879 | __const struct timespec *__restrict
|
|---|
| 880 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 881 |
|
|---|
| 882 |
|
|---|
| 883 |
|
|---|
| 884 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
|
|---|
| 885 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 886 |
|
|---|
| 887 |
|
|---|
| 888 |
|
|---|
| 889 | extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
|
|---|
| 890 | __restrict __mutex,
|
|---|
| 891 | int *__restrict __prioceiling)
|
|---|
| 892 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 893 |
|
|---|
| 894 |
|
|---|
| 895 |
|
|---|
| 896 | extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
|
|---|
| 897 | int __prioceiling,
|
|---|
| 898 | int *__restrict __old_ceiling)
|
|---|
| 899 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
|
|---|
| 900 |
|
|---|
| 901 |
|
|---|
| 902 |
|
|---|
| 903 |
|
|---|
| 904 | extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
|
|---|
| 905 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 906 | extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
|
|---|
| 907 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 908 |
|
|---|
| 909 |
|
|---|
| 910 | extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
|
|---|
| 911 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 912 |
|
|---|
| 913 |
|
|---|
| 914 | extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
|
|---|
| 915 | __restrict __attr,
|
|---|
| 916 | int *__restrict __pshared)
|
|---|
| 917 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 918 |
|
|---|
| 919 |
|
|---|
| 920 | extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
|
|---|
| 921 | int __pshared)
|
|---|
| 922 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 923 |
|
|---|
| 924 |
|
|---|
| 925 |
|
|---|
| 926 | extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
|
|---|
| 927 | __attr, int *__restrict __kind)
|
|---|
| 928 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 929 |
|
|---|
| 930 |
|
|---|
| 931 |
|
|---|
| 932 |
|
|---|
| 933 | extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
|
|---|
| 934 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 935 |
|
|---|
| 936 |
|
|---|
| 937 |
|
|---|
| 938 | extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
|
|---|
| 939 | __restrict __attr,
|
|---|
| 940 | int *__restrict __protocol)
|
|---|
| 941 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 942 |
|
|---|
| 943 |
|
|---|
| 944 |
|
|---|
| 945 | extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
|
|---|
| 946 | int __protocol)
|
|---|
| 947 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 948 |
|
|---|
| 949 |
|
|---|
| 950 | extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
|
|---|
| 951 | __restrict __attr,
|
|---|
| 952 | int *__restrict __prioceiling)
|
|---|
| 953 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 954 |
|
|---|
| 955 |
|
|---|
| 956 | extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
|
|---|
| 957 | int __prioceiling)
|
|---|
| 958 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 959 |
|
|---|
| 960 |
|
|---|
| 961 |
|
|---|
| 962 | extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
|
|---|
| 963 | int *__robustness)
|
|---|
| 964 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 965 |
|
|---|
| 966 |
|
|---|
| 967 |
|
|---|
| 968 |
|
|---|
| 969 |
|
|---|
| 970 |
|
|---|
| 971 |
|
|---|
| 972 | extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
|
|---|
| 973 | int __robustness)
|
|---|
| 974 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 975 | extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 976 | __const pthread_rwlockattr_t *__restrict
|
|---|
| 977 | __attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 978 |
|
|---|
| 979 |
|
|---|
| 980 | extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
|
|---|
| 981 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 982 |
|
|---|
| 983 |
|
|---|
| 984 | extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
|
|---|
| 985 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 986 |
|
|---|
| 987 |
|
|---|
| 988 | extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
|
|---|
| 989 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 990 |
|
|---|
| 991 |
|
|---|
| 992 |
|
|---|
| 993 | extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 994 | __const struct timespec *__restrict
|
|---|
| 995 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 996 |
|
|---|
| 997 |
|
|---|
| 998 |
|
|---|
| 999 | extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
|
|---|
| 1000 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1001 |
|
|---|
| 1002 |
|
|---|
| 1003 | extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
|
|---|
| 1004 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1005 |
|
|---|
| 1006 |
|
|---|
| 1007 |
|
|---|
| 1008 | extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 1009 | __const struct timespec *__restrict
|
|---|
| 1010 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1011 |
|
|---|
| 1012 |
|
|---|
| 1013 |
|
|---|
| 1014 | extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
|
|---|
| 1015 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1016 |
|
|---|
| 1017 |
|
|---|
| 1018 |
|
|---|
| 1019 |
|
|---|
| 1020 |
|
|---|
| 1021 | extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
|
|---|
| 1022 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1023 |
|
|---|
| 1024 |
|
|---|
| 1025 | extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
|
|---|
| 1026 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1027 |
|
|---|
| 1028 |
|
|---|
| 1029 | extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
|
|---|
| 1030 | __restrict __attr,
|
|---|
| 1031 | int *__restrict __pshared)
|
|---|
| 1032 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1033 |
|
|---|
| 1034 |
|
|---|
| 1035 | extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
|
|---|
| 1036 | int __pshared)
|
|---|
| 1037 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1038 |
|
|---|
| 1039 |
|
|---|
| 1040 | extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
|
|---|
| 1041 | __restrict __attr,
|
|---|
| 1042 | int *__restrict __pref)
|
|---|
| 1043 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1044 |
|
|---|
| 1045 |
|
|---|
| 1046 | extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
|
|---|
| 1047 | int __pref) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1048 |
|
|---|
| 1049 |
|
|---|
| 1050 |
|
|---|
| 1051 |
|
|---|
| 1052 |
|
|---|
| 1053 |
|
|---|
| 1054 |
|
|---|
| 1055 | extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
|
|---|
| 1056 | __const pthread_condattr_t *__restrict
|
|---|
| 1057 | __cond_attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1058 |
|
|---|
| 1059 |
|
|---|
| 1060 | extern int pthread_cond_destroy (pthread_cond_t *__cond)
|
|---|
| 1061 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1062 |
|
|---|
| 1063 |
|
|---|
| 1064 | extern int pthread_cond_signal (pthread_cond_t *__cond)
|
|---|
| 1065 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1066 |
|
|---|
| 1067 |
|
|---|
| 1068 | extern int pthread_cond_broadcast (pthread_cond_t *__cond)
|
|---|
| 1069 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1070 |
|
|---|
| 1071 |
|
|---|
| 1072 |
|
|---|
| 1073 |
|
|---|
| 1074 |
|
|---|
| 1075 |
|
|---|
| 1076 | extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
|
|---|
| 1077 | pthread_mutex_t *__restrict __mutex)
|
|---|
| 1078 | __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1079 | extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
|
|---|
| 1080 | pthread_mutex_t *__restrict __mutex,
|
|---|
| 1081 | __const struct timespec *__restrict
|
|---|
| 1082 | __abstime) __attribute__ ((__nonnull__ (1, 2, 3)));
|
|---|
| 1083 |
|
|---|
| 1084 |
|
|---|
| 1085 |
|
|---|
| 1086 |
|
|---|
| 1087 | extern int pthread_condattr_init (pthread_condattr_t *__attr)
|
|---|
| 1088 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1089 |
|
|---|
| 1090 |
|
|---|
| 1091 | extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
|
|---|
| 1092 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1093 |
|
|---|
| 1094 |
|
|---|
| 1095 | extern int pthread_condattr_getpshared (__const pthread_condattr_t *
|
|---|
| 1096 | __restrict __attr,
|
|---|
| 1097 | int *__restrict __pshared)
|
|---|
| 1098 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1099 |
|
|---|
| 1100 |
|
|---|
| 1101 | extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
|
|---|
| 1102 | int __pshared) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1103 |
|
|---|
| 1104 |
|
|---|
| 1105 |
|
|---|
| 1106 | extern int pthread_condattr_getclock (__const pthread_condattr_t *
|
|---|
| 1107 | __restrict __attr,
|
|---|
| 1108 | __clockid_t *__restrict __clock_id)
|
|---|
| 1109 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1110 |
|
|---|
| 1111 |
|
|---|
| 1112 | extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
|
|---|
| 1113 | __clockid_t __clock_id)
|
|---|
| 1114 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1115 | extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
|
|---|
| 1116 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1117 |
|
|---|
| 1118 |
|
|---|
| 1119 | extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
|
|---|
| 1120 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1121 |
|
|---|
| 1122 |
|
|---|
| 1123 | extern int pthread_spin_lock (pthread_spinlock_t *__lock)
|
|---|
| 1124 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1125 |
|
|---|
| 1126 |
|
|---|
| 1127 | extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
|
|---|
| 1128 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1129 |
|
|---|
| 1130 |
|
|---|
| 1131 | extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
|
|---|
| 1132 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1133 |
|
|---|
| 1134 |
|
|---|
| 1135 |
|
|---|
| 1136 |
|
|---|
| 1137 |
|
|---|
| 1138 |
|
|---|
| 1139 | extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
|
|---|
| 1140 | __const pthread_barrierattr_t *__restrict
|
|---|
| 1141 | __attr, unsigned int __count)
|
|---|
| 1142 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1143 |
|
|---|
| 1144 |
|
|---|
| 1145 | extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
|
|---|
| 1146 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1147 |
|
|---|
| 1148 |
|
|---|
| 1149 | extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
|
|---|
| 1150 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1151 |
|
|---|
| 1152 |
|
|---|
| 1153 |
|
|---|
| 1154 | extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
|
|---|
| 1155 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1156 |
|
|---|
| 1157 |
|
|---|
| 1158 | extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
|
|---|
| 1159 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1160 |
|
|---|
| 1161 |
|
|---|
| 1162 | extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
|
|---|
| 1163 | __restrict __attr,
|
|---|
| 1164 | int *__restrict __pshared)
|
|---|
| 1165 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1166 |
|
|---|
| 1167 |
|
|---|
| 1168 | extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
|
|---|
| 1169 | int __pshared)
|
|---|
| 1170 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1171 | extern int pthread_key_create (pthread_key_t *__key,
|
|---|
| 1172 | void (*__destr_function) (void *))
|
|---|
| 1173 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1174 |
|
|---|
| 1175 |
|
|---|
| 1176 | extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__));
|
|---|
| 1177 |
|
|---|
| 1178 |
|
|---|
| 1179 | extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__));
|
|---|
| 1180 |
|
|---|
| 1181 |
|
|---|
| 1182 | extern int pthread_setspecific (pthread_key_t __key,
|
|---|
| 1183 | __const void *__pointer) __attribute__ ((__nothrow__)) ;
|
|---|
| 1184 |
|
|---|
| 1185 |
|
|---|
| 1186 |
|
|---|
| 1187 |
|
|---|
| 1188 | extern int pthread_getcpuclockid (pthread_t __thread_id,
|
|---|
| 1189 | __clockid_t *__clock_id)
|
|---|
| 1190 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 1191 | extern int pthread_atfork (void (*__prepare) (void),
|
|---|
| 1192 | void (*__parent) (void),
|
|---|
| 1193 | void (*__child) (void)) __attribute__ ((__nothrow__));
|
|---|
| 1194 |
|
|---|
| 1195 |
|
|---|
| 1196 |
|
|---|
| 1197 |
|
|---|
| 1198 |
|
|---|
| 1199 | struct _IO_FILE;
|
|---|
| 1200 |
|
|---|
| 1201 |
|
|---|
| 1202 |
|
|---|
| 1203 | typedef struct _IO_FILE FILE;
|
|---|
| 1204 |
|
|---|
| 1205 |
|
|---|
| 1206 |
|
|---|
| 1207 |
|
|---|
| 1208 |
|
|---|
| 1209 | typedef struct _IO_FILE __FILE;
|
|---|
| 1210 |
|
|---|
| 1211 |
|
|---|
| 1212 |
|
|---|
| 1213 |
|
|---|
| 1214 | typedef struct
|
|---|
| 1215 | {
|
|---|
| 1216 | int __count;
|
|---|
| 1217 | union
|
|---|
| 1218 | {
|
|---|
| 1219 |
|
|---|
| 1220 | unsigned int __wch;
|
|---|
| 1221 |
|
|---|
| 1222 |
|
|---|
| 1223 |
|
|---|
| 1224 | char __wchb[4];
|
|---|
| 1225 | } __value;
|
|---|
| 1226 | } __mbstate_t;
|
|---|
| 1227 |
|
|---|
| 1228 | typedef struct
|
|---|
| 1229 | {
|
|---|
| 1230 | __off_t __pos;
|
|---|
| 1231 | __mbstate_t __state;
|
|---|
| 1232 | } _G_fpos_t;
|
|---|
| 1233 | typedef struct
|
|---|
| 1234 | {
|
|---|
| 1235 | __off64_t __pos;
|
|---|
| 1236 | __mbstate_t __state;
|
|---|
| 1237 | } _G_fpos64_t;
|
|---|
| 1238 | typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
|
|---|
| 1239 | typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
|
|---|
| 1240 | typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
|
|---|
| 1241 | typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
|
|---|
| 1242 | typedef __builtin_va_list __gnuc_va_list;
|
|---|
| 1243 | struct _IO_jump_t; struct _IO_FILE;
|
|---|
| 1244 | typedef void _IO_lock_t;
|
|---|
| 1245 |
|
|---|
| 1246 |
|
|---|
| 1247 |
|
|---|
| 1248 |
|
|---|
| 1249 |
|
|---|
| 1250 | struct _IO_marker {
|
|---|
| 1251 | struct _IO_marker *_next;
|
|---|
| 1252 | struct _IO_FILE *_sbuf;
|
|---|
| 1253 |
|
|---|
| 1254 |
|
|---|
| 1255 |
|
|---|
| 1256 | int _pos;
|
|---|
| 1257 | };
|
|---|
| 1258 |
|
|---|
| 1259 |
|
|---|
| 1260 | enum __codecvt_result
|
|---|
| 1261 | {
|
|---|
| 1262 | __codecvt_ok,
|
|---|
| 1263 | __codecvt_partial,
|
|---|
| 1264 | __codecvt_error,
|
|---|
| 1265 | __codecvt_noconv
|
|---|
| 1266 | };
|
|---|
| 1267 | struct _IO_FILE {
|
|---|
| 1268 | int _flags;
|
|---|
| 1269 |
|
|---|
| 1270 |
|
|---|
| 1271 |
|
|---|
| 1272 |
|
|---|
| 1273 | char* _IO_read_ptr;
|
|---|
| 1274 | char* _IO_read_end;
|
|---|
| 1275 | char* _IO_read_base;
|
|---|
| 1276 | char* _IO_write_base;
|
|---|
| 1277 | char* _IO_write_ptr;
|
|---|
| 1278 | char* _IO_write_end;
|
|---|
| 1279 | char* _IO_buf_base;
|
|---|
| 1280 | char* _IO_buf_end;
|
|---|
| 1281 |
|
|---|
| 1282 | char *_IO_save_base;
|
|---|
| 1283 | char *_IO_backup_base;
|
|---|
| 1284 | char *_IO_save_end;
|
|---|
| 1285 |
|
|---|
| 1286 | struct _IO_marker *_markers;
|
|---|
| 1287 |
|
|---|
| 1288 | struct _IO_FILE *_chain;
|
|---|
| 1289 |
|
|---|
| 1290 | int _fileno;
|
|---|
| 1291 |
|
|---|
| 1292 |
|
|---|
| 1293 |
|
|---|
| 1294 | int _flags2;
|
|---|
| 1295 |
|
|---|
| 1296 | __off_t _old_offset;
|
|---|
| 1297 |
|
|---|
| 1298 |
|
|---|
| 1299 |
|
|---|
| 1300 | unsigned short _cur_column;
|
|---|
| 1301 | signed char _vtable_offset;
|
|---|
| 1302 | char _shortbuf[1];
|
|---|
| 1303 |
|
|---|
| 1304 |
|
|---|
| 1305 |
|
|---|
| 1306 | _IO_lock_t *_lock;
|
|---|
| 1307 | __off64_t _offset;
|
|---|
| 1308 | void *__pad1;
|
|---|
| 1309 | void *__pad2;
|
|---|
| 1310 | void *__pad3;
|
|---|
| 1311 | void *__pad4;
|
|---|
| 1312 | size_t __pad5;
|
|---|
| 1313 |
|
|---|
| 1314 | int _mode;
|
|---|
| 1315 |
|
|---|
| 1316 | char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
|
|---|
| 1317 |
|
|---|
| 1318 | };
|
|---|
| 1319 |
|
|---|
| 1320 |
|
|---|
| 1321 | typedef struct _IO_FILE _IO_FILE;
|
|---|
| 1322 |
|
|---|
| 1323 |
|
|---|
| 1324 | struct _IO_FILE_plus;
|
|---|
| 1325 |
|
|---|
| 1326 | extern struct _IO_FILE_plus _IO_2_1_stdin_;
|
|---|
| 1327 | extern struct _IO_FILE_plus _IO_2_1_stdout_;
|
|---|
| 1328 | extern struct _IO_FILE_plus _IO_2_1_stderr_;
|
|---|
| 1329 | typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
|
|---|
| 1330 |
|
|---|
| 1331 |
|
|---|
| 1332 |
|
|---|
| 1333 |
|
|---|
| 1334 |
|
|---|
| 1335 |
|
|---|
| 1336 |
|
|---|
| 1337 | typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
|
|---|
| 1338 | size_t __n);
|
|---|
| 1339 |
|
|---|
| 1340 |
|
|---|
| 1341 |
|
|---|
| 1342 |
|
|---|
| 1343 |
|
|---|
| 1344 |
|
|---|
| 1345 |
|
|---|
| 1346 | typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
|
|---|
| 1347 |
|
|---|
| 1348 |
|
|---|
| 1349 | typedef int __io_close_fn (void *__cookie);
|
|---|
| 1350 | extern int __underflow (_IO_FILE *);
|
|---|
| 1351 | extern int __uflow (_IO_FILE *);
|
|---|
| 1352 | extern int __overflow (_IO_FILE *, int);
|
|---|
| 1353 | extern int _IO_getc (_IO_FILE *__fp);
|
|---|
| 1354 | extern int _IO_putc (int __c, _IO_FILE *__fp);
|
|---|
| 1355 | extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
|
|---|
| 1356 | extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
|
|---|
| 1357 |
|
|---|
| 1358 | extern int _IO_peekc_locked (_IO_FILE *__fp);
|
|---|
| 1359 |
|
|---|
| 1360 |
|
|---|
| 1361 |
|
|---|
| 1362 |
|
|---|
| 1363 |
|
|---|
| 1364 | extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
|
|---|
| 1365 | extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
|
|---|
| 1366 | extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
|
|---|
| 1367 | extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
|
|---|
| 1368 | __gnuc_va_list, int *__restrict);
|
|---|
| 1369 | extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
|
|---|
| 1370 | __gnuc_va_list);
|
|---|
| 1371 | extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
|
|---|
| 1372 | extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
|
|---|
| 1373 |
|
|---|
| 1374 | extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
|
|---|
| 1375 | extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
|
|---|
| 1376 |
|
|---|
| 1377 | extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
|
|---|
| 1378 |
|
|---|
| 1379 |
|
|---|
| 1380 |
|
|---|
| 1381 |
|
|---|
| 1382 | typedef __gnuc_va_list va_list;
|
|---|
| 1383 | typedef __off_t off_t;
|
|---|
| 1384 | typedef __ssize_t ssize_t;
|
|---|
| 1385 |
|
|---|
| 1386 |
|
|---|
| 1387 |
|
|---|
| 1388 |
|
|---|
| 1389 |
|
|---|
| 1390 |
|
|---|
| 1391 |
|
|---|
| 1392 | typedef _G_fpos_t fpos_t;
|
|---|
| 1393 |
|
|---|
| 1394 |
|
|---|
| 1395 |
|
|---|
| 1396 |
|
|---|
| 1397 |
|
|---|
| 1398 |
|
|---|
| 1399 |
|
|---|
| 1400 | extern struct _IO_FILE *stdin;
|
|---|
| 1401 | extern struct _IO_FILE *stdout;
|
|---|
| 1402 | extern struct _IO_FILE *stderr;
|
|---|
| 1403 |
|
|---|
| 1404 |
|
|---|
| 1405 |
|
|---|
| 1406 |
|
|---|
| 1407 |
|
|---|
| 1408 |
|
|---|
| 1409 |
|
|---|
| 1410 |
|
|---|
| 1411 |
|
|---|
| 1412 | extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
|
|---|
| 1413 |
|
|---|
| 1414 | extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
|
|---|
| 1415 |
|
|---|
| 1416 |
|
|---|
| 1417 |
|
|---|
| 1418 |
|
|---|
| 1419 | extern int renameat (int __oldfd, __const char *__old, int __newfd,
|
|---|
| 1420 | __const char *__new) __attribute__ ((__nothrow__));
|
|---|
| 1421 |
|
|---|
| 1422 |
|
|---|
| 1423 |
|
|---|
| 1424 |
|
|---|
| 1425 |
|
|---|
| 1426 |
|
|---|
| 1427 |
|
|---|
| 1428 |
|
|---|
| 1429 | extern FILE *tmpfile (void) ;
|
|---|
| 1430 | extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ;
|
|---|
| 1431 |
|
|---|
| 1432 |
|
|---|
| 1433 |
|
|---|
| 1434 |
|
|---|
| 1435 |
|
|---|
| 1436 | extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ;
|
|---|
| 1437 | extern char *tempnam (__const char *__dir, __const char *__pfx)
|
|---|
| 1438 | __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
|
|---|
| 1439 |
|
|---|
| 1440 |
|
|---|
| 1441 |
|
|---|
| 1442 |
|
|---|
| 1443 |
|
|---|
| 1444 |
|
|---|
| 1445 |
|
|---|
| 1446 |
|
|---|
| 1447 | extern int fclose (FILE *__stream);
|
|---|
| 1448 |
|
|---|
| 1449 |
|
|---|
| 1450 |
|
|---|
| 1451 |
|
|---|
| 1452 | extern int fflush (FILE *__stream);
|
|---|
| 1453 |
|
|---|
| 1454 | extern int fflush_unlocked (FILE *__stream);
|
|---|
| 1455 |
|
|---|
| 1456 |
|
|---|
| 1457 |
|
|---|
| 1458 |
|
|---|
| 1459 |
|
|---|
| 1460 |
|
|---|
| 1461 | extern FILE *fopen (__const char *__restrict __filename,
|
|---|
| 1462 | __const char *__restrict __modes) ;
|
|---|
| 1463 |
|
|---|
| 1464 |
|
|---|
| 1465 |
|
|---|
| 1466 |
|
|---|
| 1467 | extern FILE *freopen (__const char *__restrict __filename,
|
|---|
| 1468 | __const char *__restrict __modes,
|
|---|
| 1469 | FILE *__restrict __stream) ;
|
|---|
| 1470 |
|
|---|
| 1471 | extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ;
|
|---|
| 1472 | extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
|
|---|
| 1473 | __attribute__ ((__nothrow__)) ;
|
|---|
| 1474 |
|
|---|
| 1475 |
|
|---|
| 1476 |
|
|---|
| 1477 |
|
|---|
| 1478 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ;
|
|---|
| 1479 |
|
|---|
| 1480 |
|
|---|
| 1481 |
|
|---|
| 1482 |
|
|---|
| 1483 |
|
|---|
| 1484 |
|
|---|
| 1485 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
|
|---|
| 1486 |
|
|---|
| 1487 |
|
|---|
| 1488 |
|
|---|
| 1489 | extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
|
|---|
| 1490 | int __modes, size_t __n) __attribute__ ((__nothrow__));
|
|---|
| 1491 |
|
|---|
| 1492 |
|
|---|
| 1493 |
|
|---|
| 1494 |
|
|---|
| 1495 |
|
|---|
| 1496 | extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
|
|---|
| 1497 | size_t __size) __attribute__ ((__nothrow__));
|
|---|
| 1498 |
|
|---|
| 1499 |
|
|---|
| 1500 | extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
|
|---|
| 1501 |
|
|---|
| 1502 |
|
|---|
| 1503 |
|
|---|
| 1504 |
|
|---|
| 1505 |
|
|---|
| 1506 |
|
|---|
| 1507 |
|
|---|
| 1508 |
|
|---|
| 1509 | extern int fprintf (FILE *__restrict __stream,
|
|---|
| 1510 | __const char *__restrict __format, ...);
|
|---|
| 1511 |
|
|---|
| 1512 |
|
|---|
| 1513 |
|
|---|
| 1514 |
|
|---|
| 1515 | extern int printf (__const char *__restrict __format, ...);
|
|---|
| 1516 |
|
|---|
| 1517 | extern int sprintf (char *__restrict __s,
|
|---|
| 1518 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
|
|---|
| 1519 |
|
|---|
| 1520 |
|
|---|
| 1521 |
|
|---|
| 1522 |
|
|---|
| 1523 |
|
|---|
| 1524 | extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
|
|---|
| 1525 | __gnuc_va_list __arg);
|
|---|
| 1526 |
|
|---|
| 1527 |
|
|---|
| 1528 |
|
|---|
| 1529 |
|
|---|
| 1530 | extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
|
|---|
| 1531 |
|
|---|
| 1532 | extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
|
|---|
| 1533 | __gnuc_va_list __arg) __attribute__ ((__nothrow__));
|
|---|
| 1534 |
|
|---|
| 1535 |
|
|---|
| 1536 |
|
|---|
| 1537 |
|
|---|
| 1538 |
|
|---|
| 1539 | extern int snprintf (char *__restrict __s, size_t __maxlen,
|
|---|
| 1540 | __const char *__restrict __format, ...)
|
|---|
| 1541 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
|
|---|
| 1542 |
|
|---|
| 1543 | extern int vsnprintf (char *__restrict __s, size_t __maxlen,
|
|---|
| 1544 | __const char *__restrict __format, __gnuc_va_list __arg)
|
|---|
| 1545 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
|
|---|
| 1546 |
|
|---|
| 1547 | extern int vdprintf (int __fd, __const char *__restrict __fmt,
|
|---|
| 1548 | __gnuc_va_list __arg)
|
|---|
| 1549 | __attribute__ ((__format__ (__printf__, 2, 0)));
|
|---|
| 1550 | extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
|
|---|
| 1551 | __attribute__ ((__format__ (__printf__, 2, 3)));
|
|---|
| 1552 |
|
|---|
| 1553 |
|
|---|
| 1554 |
|
|---|
| 1555 |
|
|---|
| 1556 |
|
|---|
| 1557 |
|
|---|
| 1558 |
|
|---|
| 1559 |
|
|---|
| 1560 | extern int fscanf (FILE *__restrict __stream,
|
|---|
| 1561 | __const char *__restrict __format, ...) ;
|
|---|
| 1562 |
|
|---|
| 1563 |
|
|---|
| 1564 |
|
|---|
| 1565 |
|
|---|
| 1566 | extern int scanf (__const char *__restrict __format, ...) ;
|
|---|
| 1567 |
|
|---|
| 1568 | extern int sscanf (__const char *__restrict __s,
|
|---|
| 1569 | __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
|
|---|
| 1570 | extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
|
|---|
| 1571 |
|
|---|
| 1572 | ;
|
|---|
| 1573 | extern int scanf (__const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
|
|---|
| 1574 | ;
|
|---|
| 1575 | extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__))
|
|---|
| 1576 |
|
|---|
| 1577 | ;
|
|---|
| 1578 |
|
|---|
| 1579 |
|
|---|
| 1580 |
|
|---|
| 1581 |
|
|---|
| 1582 |
|
|---|
| 1583 |
|
|---|
| 1584 |
|
|---|
| 1585 |
|
|---|
| 1586 | extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
|
|---|
| 1587 | __gnuc_va_list __arg)
|
|---|
| 1588 | __attribute__ ((__format__ (__scanf__, 2, 0))) ;
|
|---|
| 1589 |
|
|---|
| 1590 |
|
|---|
| 1591 |
|
|---|
| 1592 |
|
|---|
| 1593 |
|
|---|
| 1594 | extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
|
|---|
| 1595 | __attribute__ ((__format__ (__scanf__, 1, 0))) ;
|
|---|
| 1596 |
|
|---|
| 1597 |
|
|---|
| 1598 | extern int vsscanf (__const char *__restrict __s,
|
|---|
| 1599 | __const char *__restrict __format, __gnuc_va_list __arg)
|
|---|
| 1600 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
|
|---|
| 1601 | extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
|
|---|
| 1602 |
|
|---|
| 1603 |
|
|---|
| 1604 |
|
|---|
| 1605 | __attribute__ ((__format__ (__scanf__, 2, 0))) ;
|
|---|
| 1606 | extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
|
|---|
| 1607 |
|
|---|
| 1608 | __attribute__ ((__format__ (__scanf__, 1, 0))) ;
|
|---|
| 1609 | extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__))
|
|---|
| 1610 |
|
|---|
| 1611 |
|
|---|
| 1612 |
|
|---|
| 1613 | __attribute__ ((__format__ (__scanf__, 2, 0)));
|
|---|
| 1614 |
|
|---|
| 1615 |
|
|---|
| 1616 |
|
|---|
| 1617 |
|
|---|
| 1618 |
|
|---|
| 1619 |
|
|---|
| 1620 |
|
|---|
| 1621 |
|
|---|
| 1622 |
|
|---|
| 1623 | extern int fgetc (FILE *__stream);
|
|---|
| 1624 | extern int getc (FILE *__stream);
|
|---|
| 1625 |
|
|---|
| 1626 |
|
|---|
| 1627 |
|
|---|
| 1628 |
|
|---|
| 1629 |
|
|---|
| 1630 | extern int getchar (void);
|
|---|
| 1631 |
|
|---|
| 1632 | extern int getc_unlocked (FILE *__stream);
|
|---|
| 1633 | extern int getchar_unlocked (void);
|
|---|
| 1634 | extern int fgetc_unlocked (FILE *__stream);
|
|---|
| 1635 |
|
|---|
| 1636 |
|
|---|
| 1637 |
|
|---|
| 1638 |
|
|---|
| 1639 |
|
|---|
| 1640 |
|
|---|
| 1641 |
|
|---|
| 1642 |
|
|---|
| 1643 |
|
|---|
| 1644 |
|
|---|
| 1645 |
|
|---|
| 1646 | extern int fputc (int __c, FILE *__stream);
|
|---|
| 1647 | extern int putc (int __c, FILE *__stream);
|
|---|
| 1648 |
|
|---|
| 1649 |
|
|---|
| 1650 |
|
|---|
| 1651 |
|
|---|
| 1652 |
|
|---|
| 1653 | extern int putchar (int __c);
|
|---|
| 1654 |
|
|---|
| 1655 | extern int fputc_unlocked (int __c, FILE *__stream);
|
|---|
| 1656 |
|
|---|
| 1657 |
|
|---|
| 1658 |
|
|---|
| 1659 |
|
|---|
| 1660 |
|
|---|
| 1661 |
|
|---|
| 1662 |
|
|---|
| 1663 | extern int putc_unlocked (int __c, FILE *__stream);
|
|---|
| 1664 | extern int putchar_unlocked (int __c);
|
|---|
| 1665 |
|
|---|
| 1666 |
|
|---|
| 1667 |
|
|---|
| 1668 |
|
|---|
| 1669 |
|
|---|
| 1670 |
|
|---|
| 1671 | extern int getw (FILE *__stream);
|
|---|
| 1672 |
|
|---|
| 1673 |
|
|---|
| 1674 | extern int putw (int __w, FILE *__stream);
|
|---|
| 1675 |
|
|---|
| 1676 |
|
|---|
| 1677 |
|
|---|
| 1678 |
|
|---|
| 1679 |
|
|---|
| 1680 |
|
|---|
| 1681 |
|
|---|
| 1682 |
|
|---|
| 1683 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
|
|---|
| 1684 | ;
|
|---|
| 1685 |
|
|---|
| 1686 |
|
|---|
| 1687 |
|
|---|
| 1688 |
|
|---|
| 1689 |
|
|---|
| 1690 |
|
|---|
| 1691 | extern char *gets (char *__s) ;
|
|---|
| 1692 |
|
|---|
| 1693 | extern __ssize_t __getdelim (char **__restrict __lineptr,
|
|---|
| 1694 | size_t *__restrict __n, int __delimiter,
|
|---|
| 1695 | FILE *__restrict __stream) ;
|
|---|
| 1696 | extern __ssize_t getdelim (char **__restrict __lineptr,
|
|---|
| 1697 | size_t *__restrict __n, int __delimiter,
|
|---|
| 1698 | FILE *__restrict __stream) ;
|
|---|
| 1699 |
|
|---|
| 1700 |
|
|---|
| 1701 |
|
|---|
| 1702 |
|
|---|
| 1703 |
|
|---|
| 1704 |
|
|---|
| 1705 |
|
|---|
| 1706 | extern __ssize_t getline (char **__restrict __lineptr,
|
|---|
| 1707 | size_t *__restrict __n,
|
|---|
| 1708 | FILE *__restrict __stream) ;
|
|---|
| 1709 |
|
|---|
| 1710 |
|
|---|
| 1711 |
|
|---|
| 1712 |
|
|---|
| 1713 |
|
|---|
| 1714 |
|
|---|
| 1715 |
|
|---|
| 1716 |
|
|---|
| 1717 | extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
|
|---|
| 1718 |
|
|---|
| 1719 |
|
|---|
| 1720 |
|
|---|
| 1721 |
|
|---|
| 1722 |
|
|---|
| 1723 | extern int puts (__const char *__s);
|
|---|
| 1724 |
|
|---|
| 1725 |
|
|---|
| 1726 |
|
|---|
| 1727 |
|
|---|
| 1728 |
|
|---|
| 1729 |
|
|---|
| 1730 | extern int ungetc (int __c, FILE *__stream);
|
|---|
| 1731 |
|
|---|
| 1732 |
|
|---|
| 1733 |
|
|---|
| 1734 |
|
|---|
| 1735 |
|
|---|
| 1736 |
|
|---|
| 1737 | extern size_t fread (void *__restrict __ptr, size_t __size,
|
|---|
| 1738 | size_t __n, FILE *__restrict __stream) ;
|
|---|
| 1739 |
|
|---|
| 1740 |
|
|---|
| 1741 |
|
|---|
| 1742 |
|
|---|
| 1743 | extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
|
|---|
| 1744 | size_t __n, FILE *__restrict __s) ;
|
|---|
| 1745 |
|
|---|
| 1746 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
|
|---|
| 1747 | size_t __n, FILE *__restrict __stream) ;
|
|---|
| 1748 | extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
|
|---|
| 1749 | size_t __n, FILE *__restrict __stream) ;
|
|---|
| 1750 |
|
|---|
| 1751 |
|
|---|
| 1752 |
|
|---|
| 1753 |
|
|---|
| 1754 |
|
|---|
| 1755 |
|
|---|
| 1756 |
|
|---|
| 1757 |
|
|---|
| 1758 | extern int fseek (FILE *__stream, long int __off, int __whence);
|
|---|
| 1759 |
|
|---|
| 1760 |
|
|---|
| 1761 |
|
|---|
| 1762 |
|
|---|
| 1763 | extern long int ftell (FILE *__stream) ;
|
|---|
| 1764 |
|
|---|
| 1765 |
|
|---|
| 1766 |
|
|---|
| 1767 |
|
|---|
| 1768 | extern void rewind (FILE *__stream);
|
|---|
| 1769 |
|
|---|
| 1770 | extern int fseeko (FILE *__stream, __off_t __off, int __whence);
|
|---|
| 1771 |
|
|---|
| 1772 |
|
|---|
| 1773 |
|
|---|
| 1774 |
|
|---|
| 1775 | extern __off_t ftello (FILE *__stream) ;
|
|---|
| 1776 |
|
|---|
| 1777 |
|
|---|
| 1778 |
|
|---|
| 1779 |
|
|---|
| 1780 |
|
|---|
| 1781 |
|
|---|
| 1782 | extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
|
|---|
| 1783 |
|
|---|
| 1784 |
|
|---|
| 1785 |
|
|---|
| 1786 |
|
|---|
| 1787 | extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
|
|---|
| 1788 |
|
|---|
| 1789 |
|
|---|
| 1790 |
|
|---|
| 1791 | extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
|
|---|
| 1792 |
|
|---|
| 1793 | extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
|
|---|
| 1794 |
|
|---|
| 1795 | extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
|
|---|
| 1796 |
|
|---|
| 1797 |
|
|---|
| 1798 |
|
|---|
| 1799 |
|
|---|
| 1800 | extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
|
|---|
| 1801 | extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
|
|---|
| 1802 | extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
|
|---|
| 1803 |
|
|---|
| 1804 |
|
|---|
| 1805 |
|
|---|
| 1806 |
|
|---|
| 1807 |
|
|---|
| 1808 |
|
|---|
| 1809 |
|
|---|
| 1810 |
|
|---|
| 1811 | extern void perror (__const char *__s);
|
|---|
| 1812 |
|
|---|
| 1813 |
|
|---|
| 1814 |
|
|---|
| 1815 |
|
|---|
| 1816 |
|
|---|
| 1817 |
|
|---|
| 1818 | extern int sys_nerr;
|
|---|
| 1819 | extern __const char *__const sys_errlist[];
|
|---|
| 1820 |
|
|---|
| 1821 |
|
|---|
| 1822 |
|
|---|
| 1823 |
|
|---|
| 1824 | extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
|
|---|
| 1825 |
|
|---|
| 1826 |
|
|---|
| 1827 |
|
|---|
| 1828 |
|
|---|
| 1829 | extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
|
|---|
| 1830 | extern FILE *popen (__const char *__command, __const char *__modes) ;
|
|---|
| 1831 |
|
|---|
| 1832 |
|
|---|
| 1833 |
|
|---|
| 1834 |
|
|---|
| 1835 |
|
|---|
| 1836 | extern int pclose (FILE *__stream);
|
|---|
| 1837 |
|
|---|
| 1838 |
|
|---|
| 1839 |
|
|---|
| 1840 |
|
|---|
| 1841 |
|
|---|
| 1842 | extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
|
|---|
| 1843 | extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
|
|---|
| 1844 |
|
|---|
| 1845 |
|
|---|
| 1846 |
|
|---|
| 1847 | extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
|
|---|
| 1848 |
|
|---|
| 1849 |
|
|---|
| 1850 | extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
|
|---|
| 1851 |
|
|---|
| 1852 |
|
|---|
| 1853 |
|
|---|
| 1854 |
|
|---|
| 1855 |
|
|---|
| 1856 |
|
|---|
| 1857 |
|
|---|
| 1858 |
|
|---|
| 1859 | unsigned int __VERIFIER_nondet_uint();
|
|---|
| 1860 | static int top=0;
|
|---|
| 1861 | static unsigned int arr[(5)];
|
|---|
| 1862 | pthread_mutex_t m;
|
|---|
| 1863 | _Bool flag=(0);
|
|---|
| 1864 |
|
|---|
| 1865 | void error(void)
|
|---|
| 1866 | {
|
|---|
| 1867 | ERROR: __VERIFIER_error();
|
|---|
| 1868 | return;
|
|---|
| 1869 | }
|
|---|
| 1870 |
|
|---|
| 1871 | void inc_top(void)
|
|---|
| 1872 | {
|
|---|
| 1873 | top++;
|
|---|
| 1874 | }
|
|---|
| 1875 |
|
|---|
| 1876 | void dec_top(void)
|
|---|
| 1877 | {
|
|---|
| 1878 | top--;
|
|---|
| 1879 | }
|
|---|
| 1880 |
|
|---|
| 1881 | int get_top(void)
|
|---|
| 1882 | {
|
|---|
| 1883 | return top;
|
|---|
| 1884 | }
|
|---|
| 1885 |
|
|---|
| 1886 | int stack_empty(void)
|
|---|
| 1887 | {
|
|---|
| 1888 | (top==0) ? (1) : (0);
|
|---|
| 1889 | }
|
|---|
| 1890 |
|
|---|
| 1891 | int push(unsigned int *stack, int x)
|
|---|
| 1892 | {
|
|---|
| 1893 | if (top==(5))
|
|---|
| 1894 | {
|
|---|
| 1895 | printf("stack overflow\n");
|
|---|
| 1896 | return (-1);
|
|---|
| 1897 | }
|
|---|
| 1898 | else
|
|---|
| 1899 | {
|
|---|
| 1900 | stack[get_top()] = x;
|
|---|
| 1901 | inc_top();
|
|---|
| 1902 | }
|
|---|
| 1903 | return 0;
|
|---|
| 1904 | }
|
|---|
| 1905 |
|
|---|
| 1906 | int pop(unsigned int *stack)
|
|---|
| 1907 | {
|
|---|
| 1908 | if (top==0)
|
|---|
| 1909 | {
|
|---|
| 1910 | printf("stack underflow\n");
|
|---|
| 1911 | return (-2);
|
|---|
| 1912 | }
|
|---|
| 1913 | else
|
|---|
| 1914 | {
|
|---|
| 1915 | dec_top();
|
|---|
| 1916 | return stack[get_top()];
|
|---|
| 1917 | }
|
|---|
| 1918 | return 0;
|
|---|
| 1919 | }
|
|---|
| 1920 |
|
|---|
| 1921 | void *t1(void *arg)
|
|---|
| 1922 | {
|
|---|
| 1923 | int i;
|
|---|
| 1924 | unsigned int tmp;
|
|---|
| 1925 |
|
|---|
| 1926 | for(i=0; i<(5); i++)
|
|---|
| 1927 | {
|
|---|
| 1928 | pthread_mutex_lock(&m);
|
|---|
| 1929 | tmp = __VERIFIER_nondet_uint()%(5);
|
|---|
| 1930 | if ((push(arr,tmp)==(-1)))
|
|---|
| 1931 | error();
|
|---|
| 1932 | pthread_mutex_unlock(&m);
|
|---|
| 1933 | }
|
|---|
| 1934 | }
|
|---|
| 1935 |
|
|---|
| 1936 | void *t2(void *arg)
|
|---|
| 1937 | {
|
|---|
| 1938 | int i;
|
|---|
| 1939 |
|
|---|
| 1940 | for(i=0; i<(5); i++)
|
|---|
| 1941 | {
|
|---|
| 1942 | pthread_mutex_lock(&m);
|
|---|
| 1943 | if (top>0)
|
|---|
| 1944 | {
|
|---|
| 1945 | if ((pop(arr)==(-2)))
|
|---|
| 1946 | error();
|
|---|
| 1947 | }
|
|---|
| 1948 | pthread_mutex_unlock(&m);
|
|---|
| 1949 | }
|
|---|
| 1950 | }
|
|---|
| 1951 |
|
|---|
| 1952 |
|
|---|
| 1953 | int main(void)
|
|---|
| 1954 | {
|
|---|
| 1955 | pthread_t id1, id2;
|
|---|
| 1956 |
|
|---|
| 1957 | pthread_mutex_init(&m, 0);
|
|---|
| 1958 |
|
|---|
| 1959 | pthread_create(&id1, ((void *)0), t1, ((void *)0));
|
|---|
| 1960 | pthread_create(&id2, ((void *)0), t2, ((void *)0));
|
|---|
| 1961 |
|
|---|
| 1962 | pthread_join(id1, ((void *)0));
|
|---|
| 1963 | pthread_join(id2, ((void *)0));
|
|---|
| 1964 |
|
|---|
| 1965 | return 0;
|
|---|
| 1966 | }
|
|---|