| 1 | typedef unsigned char __u_char;
|
|---|
| 2 | typedef unsigned short int __u_short;
|
|---|
| 3 | typedef unsigned int __u_int;
|
|---|
| 4 | typedef unsigned long int __u_long;
|
|---|
| 5 | typedef signed char __int8_t;
|
|---|
| 6 | typedef unsigned char __uint8_t;
|
|---|
| 7 | typedef signed short int __int16_t;
|
|---|
| 8 | typedef unsigned short int __uint16_t;
|
|---|
| 9 | typedef signed int __int32_t;
|
|---|
| 10 | typedef unsigned int __uint32_t;
|
|---|
| 11 | typedef signed long int __int64_t;
|
|---|
| 12 | typedef unsigned long int __uint64_t;
|
|---|
| 13 | typedef long int __quad_t;
|
|---|
| 14 | typedef unsigned long int __u_quad_t;
|
|---|
| 15 | typedef unsigned long int __dev_t;
|
|---|
| 16 | typedef unsigned int __uid_t;
|
|---|
| 17 | typedef unsigned int __gid_t;
|
|---|
| 18 | typedef unsigned long int __ino_t;
|
|---|
| 19 | typedef unsigned long int __ino64_t;
|
|---|
| 20 | typedef unsigned int __mode_t;
|
|---|
| 21 | typedef unsigned long int __nlink_t;
|
|---|
| 22 | typedef long int __off_t;
|
|---|
| 23 | typedef long int __off64_t;
|
|---|
| 24 | typedef int __pid_t;
|
|---|
| 25 | typedef struct { int __val[2]; } __fsid_t;
|
|---|
| 26 | typedef long int __clock_t;
|
|---|
| 27 | typedef unsigned long int __rlim_t;
|
|---|
| 28 | typedef unsigned long int __rlim64_t;
|
|---|
| 29 | typedef unsigned int __id_t;
|
|---|
| 30 | typedef long int __time_t;
|
|---|
| 31 | typedef unsigned int __useconds_t;
|
|---|
| 32 | typedef long int __suseconds_t;
|
|---|
| 33 | typedef int __daddr_t;
|
|---|
| 34 | typedef int __key_t;
|
|---|
| 35 | typedef int __clockid_t;
|
|---|
| 36 | typedef void * __timer_t;
|
|---|
| 37 | typedef long int __blksize_t;
|
|---|
| 38 | typedef long int __blkcnt_t;
|
|---|
| 39 | typedef long int __blkcnt64_t;
|
|---|
| 40 | typedef unsigned long int __fsblkcnt_t;
|
|---|
| 41 | typedef unsigned long int __fsblkcnt64_t;
|
|---|
| 42 | typedef unsigned long int __fsfilcnt_t;
|
|---|
| 43 | typedef unsigned long int __fsfilcnt64_t;
|
|---|
| 44 | typedef long int __fsword_t;
|
|---|
| 45 | typedef long int __ssize_t;
|
|---|
| 46 | typedef long int __syscall_slong_t;
|
|---|
| 47 | typedef unsigned long int __syscall_ulong_t;
|
|---|
| 48 | typedef __off64_t __loff_t;
|
|---|
| 49 | typedef __quad_t *__qaddr_t;
|
|---|
| 50 | typedef char *__caddr_t;
|
|---|
| 51 | typedef long int __intptr_t;
|
|---|
| 52 | typedef unsigned int __socklen_t;
|
|---|
| 53 | static __inline unsigned int
|
|---|
| 54 | __bswap_32 (unsigned int __bsx)
|
|---|
| 55 | {
|
|---|
| 56 | return __builtin_bswap32 (__bsx);
|
|---|
| 57 | }
|
|---|
| 58 | static __inline __uint64_t
|
|---|
| 59 | __bswap_64 (__uint64_t __bsx)
|
|---|
| 60 | {
|
|---|
| 61 | return __builtin_bswap64 (__bsx);
|
|---|
| 62 | }
|
|---|
| 63 | typedef long unsigned int size_t;
|
|---|
| 64 |
|
|---|
| 65 | typedef __time_t time_t;
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 | struct timespec
|
|---|
| 69 | {
|
|---|
| 70 | __time_t tv_sec;
|
|---|
| 71 | __syscall_slong_t tv_nsec;
|
|---|
| 72 | };
|
|---|
| 73 | typedef __pid_t pid_t;
|
|---|
| 74 | struct sched_param
|
|---|
| 75 | {
|
|---|
| 76 | int __sched_priority;
|
|---|
| 77 | };
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 | struct __sched_param
|
|---|
| 81 | {
|
|---|
| 82 | int __sched_priority;
|
|---|
| 83 | };
|
|---|
| 84 | typedef unsigned long int __cpu_mask;
|
|---|
| 85 | typedef struct
|
|---|
| 86 | {
|
|---|
| 87 | __cpu_mask __bits[4096 / (8 * sizeof (__cpu_mask))];
|
|---|
| 88 | } cpu_set_t;
|
|---|
| 89 |
|
|---|
| 90 | extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
|
|---|
| 91 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 92 | extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 93 | extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | extern int sched_setparam (__pid_t __pid, const struct sched_param *__param)
|
|---|
| 97 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 98 | extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 99 | extern int sched_setscheduler (__pid_t __pid, int __policy,
|
|---|
| 100 | const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 101 | extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 102 | extern int sched_yield (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 103 | extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 104 | extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 105 | extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 | typedef __clock_t clock_t;
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 | typedef __clockid_t clockid_t;
|
|---|
| 113 | typedef __timer_t timer_t;
|
|---|
| 114 |
|
|---|
| 115 | struct tm
|
|---|
| 116 | {
|
|---|
| 117 | int tm_sec;
|
|---|
| 118 | int tm_min;
|
|---|
| 119 | int tm_hour;
|
|---|
| 120 | int tm_mday;
|
|---|
| 121 | int tm_mon;
|
|---|
| 122 | int tm_year;
|
|---|
| 123 | int tm_wday;
|
|---|
| 124 | int tm_yday;
|
|---|
| 125 | int tm_isdst;
|
|---|
| 126 | long int tm_gmtoff;
|
|---|
| 127 | const char *tm_zone;
|
|---|
| 128 | };
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 | struct itimerspec
|
|---|
| 132 | {
|
|---|
| 133 | struct timespec it_interval;
|
|---|
| 134 | struct timespec it_value;
|
|---|
| 135 | };
|
|---|
| 136 | struct sigevent;
|
|---|
| 137 |
|
|---|
| 138 | extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 139 | extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 140 | extern double difftime (time_t __time1, time_t __time0)
|
|---|
| 141 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 142 | extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 143 | extern size_t strftime (char *__restrict __s, size_t __maxsize,
|
|---|
| 144 | const char *__restrict __format,
|
|---|
| 145 | const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 146 |
|
|---|
| 147 | typedef struct __locale_struct
|
|---|
| 148 | {
|
|---|
| 149 | struct __locale_data *__locales[13];
|
|---|
| 150 | const unsigned short int *__ctype_b;
|
|---|
| 151 | const int *__ctype_tolower;
|
|---|
| 152 | const int *__ctype_toupper;
|
|---|
| 153 | const char *__names[13];
|
|---|
| 154 | } *__locale_t;
|
|---|
| 155 | typedef __locale_t locale_t;
|
|---|
| 156 | extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
|
|---|
| 157 | const char *__restrict __format,
|
|---|
| 158 | const struct tm *__restrict __tp,
|
|---|
| 159 | __locale_t __loc) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 160 |
|
|---|
| 161 | extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 162 | extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 163 |
|
|---|
| 164 | extern struct tm *gmtime_r (const time_t *__restrict __timer,
|
|---|
| 165 | struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 166 | extern struct tm *localtime_r (const time_t *__restrict __timer,
|
|---|
| 167 | struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 168 |
|
|---|
| 169 | extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 170 | extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 171 |
|
|---|
| 172 | extern char *asctime_r (const struct tm *__restrict __tp,
|
|---|
| 173 | char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 174 | extern char *ctime_r (const time_t *__restrict __timer,
|
|---|
| 175 | char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 176 | extern char *__tzname[2];
|
|---|
| 177 | extern int __daylight;
|
|---|
| 178 | extern long int __timezone;
|
|---|
| 179 | extern char *tzname[2];
|
|---|
| 180 | extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 181 | extern int daylight;
|
|---|
| 182 | extern long int timezone;
|
|---|
| 183 | extern int stime (const time_t *__when) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 184 | extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 185 | extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 186 | extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 187 | extern int nanosleep (const struct timespec *__requested_time,
|
|---|
| 188 | struct timespec *__remaining);
|
|---|
| 189 | extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 190 | extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 191 | extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
|
|---|
| 192 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 193 | extern int clock_nanosleep (clockid_t __clock_id, int __flags,
|
|---|
| 194 | const struct timespec *__req,
|
|---|
| 195 | struct timespec *__rem);
|
|---|
| 196 | extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 197 | extern int timer_create (clockid_t __clock_id,
|
|---|
| 198 | struct sigevent *__restrict __evp,
|
|---|
| 199 | timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 200 | extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 201 | extern int timer_settime (timer_t __timerid, int __flags,
|
|---|
| 202 | const struct itimerspec *__restrict __value,
|
|---|
| 203 | struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 204 | extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
|
|---|
| 205 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 206 | extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 207 |
|
|---|
| 208 | typedef unsigned long int pthread_t;
|
|---|
| 209 | union pthread_attr_t
|
|---|
| 210 | {
|
|---|
| 211 | char __size[56];
|
|---|
| 212 | long int __align;
|
|---|
| 213 | };
|
|---|
| 214 | typedef union pthread_attr_t pthread_attr_t;
|
|---|
| 215 | typedef struct __pthread_internal_list
|
|---|
| 216 | {
|
|---|
| 217 | struct __pthread_internal_list *__prev;
|
|---|
| 218 | struct __pthread_internal_list *__next;
|
|---|
| 219 | } __pthread_list_t;
|
|---|
| 220 | typedef union
|
|---|
| 221 | {
|
|---|
| 222 | struct __pthread_mutex_s
|
|---|
| 223 | {
|
|---|
| 224 | int __lock;
|
|---|
| 225 | unsigned int __count;
|
|---|
| 226 | int __owner;
|
|---|
| 227 | unsigned int __nusers;
|
|---|
| 228 | int __kind;
|
|---|
| 229 | int __spins;
|
|---|
| 230 | __pthread_list_t __list;
|
|---|
| 231 | } __data;
|
|---|
| 232 | char __size[40];
|
|---|
| 233 | long int __align;
|
|---|
| 234 | } pthread_mutex_t;
|
|---|
| 235 | typedef union
|
|---|
| 236 | {
|
|---|
| 237 | char __size[4];
|
|---|
| 238 | int __align;
|
|---|
| 239 | } pthread_mutexattr_t;
|
|---|
| 240 | typedef union
|
|---|
| 241 | {
|
|---|
| 242 | struct
|
|---|
| 243 | {
|
|---|
| 244 | int __lock;
|
|---|
| 245 | unsigned int __futex;
|
|---|
| 246 | __extension__ unsigned long long int __total_seq;
|
|---|
| 247 | __extension__ unsigned long long int __wakeup_seq;
|
|---|
| 248 | __extension__ unsigned long long int __woken_seq;
|
|---|
| 249 | void *__mutex;
|
|---|
| 250 | unsigned int __nwaiters;
|
|---|
| 251 | unsigned int __broadcast_seq;
|
|---|
| 252 | } __data;
|
|---|
| 253 | char __size[48];
|
|---|
| 254 | __extension__ long long int __align;
|
|---|
| 255 | } pthread_cond_t;
|
|---|
| 256 | typedef union
|
|---|
| 257 | {
|
|---|
| 258 | char __size[4];
|
|---|
| 259 | int __align;
|
|---|
| 260 | } pthread_condattr_t;
|
|---|
| 261 | typedef unsigned int pthread_key_t;
|
|---|
| 262 | typedef int pthread_once_t;
|
|---|
| 263 | typedef union
|
|---|
| 264 | {
|
|---|
| 265 | struct
|
|---|
| 266 | {
|
|---|
| 267 | int __lock;
|
|---|
| 268 | unsigned int __nr_readers;
|
|---|
| 269 | unsigned int __readers_wakeup;
|
|---|
| 270 | unsigned int __writer_wakeup;
|
|---|
| 271 | unsigned int __nr_readers_queued;
|
|---|
| 272 | unsigned int __nr_writers_queued;
|
|---|
| 273 | int __writer;
|
|---|
| 274 | int __shared;
|
|---|
| 275 | unsigned long int __pad1;
|
|---|
| 276 | unsigned long int __pad2;
|
|---|
| 277 | unsigned int __flags;
|
|---|
| 278 | } __data;
|
|---|
| 279 | char __size[56];
|
|---|
| 280 | long int __align;
|
|---|
| 281 | } pthread_rwlock_t;
|
|---|
| 282 | typedef union
|
|---|
| 283 | {
|
|---|
| 284 | char __size[8];
|
|---|
| 285 | long int __align;
|
|---|
| 286 | } pthread_rwlockattr_t;
|
|---|
| 287 | typedef volatile int pthread_spinlock_t;
|
|---|
| 288 | typedef union
|
|---|
| 289 | {
|
|---|
| 290 | char __size[32];
|
|---|
| 291 | long int __align;
|
|---|
| 292 | } pthread_barrier_t;
|
|---|
| 293 | typedef union
|
|---|
| 294 | {
|
|---|
| 295 | char __size[4];
|
|---|
| 296 | int __align;
|
|---|
| 297 | } pthread_barrierattr_t;
|
|---|
| 298 | typedef long int __jmp_buf[8];
|
|---|
| 299 | enum
|
|---|
| 300 | {
|
|---|
| 301 | PTHREAD_CREATE_JOINABLE,
|
|---|
| 302 | PTHREAD_CREATE_DETACHED
|
|---|
| 303 | };
|
|---|
| 304 | enum
|
|---|
| 305 | {
|
|---|
| 306 | PTHREAD_MUTEX_TIMED_NP,
|
|---|
| 307 | PTHREAD_MUTEX_RECURSIVE_NP,
|
|---|
| 308 | PTHREAD_MUTEX_ERRORCHECK_NP,
|
|---|
| 309 | PTHREAD_MUTEX_ADAPTIVE_NP
|
|---|
| 310 | ,
|
|---|
| 311 | PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
|
|---|
| 312 | PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
|
|---|
| 313 | PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
|
|---|
| 314 | PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
|
|---|
| 315 | };
|
|---|
| 316 | enum
|
|---|
| 317 | {
|
|---|
| 318 | PTHREAD_MUTEX_STALLED,
|
|---|
| 319 | PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
|
|---|
| 320 | PTHREAD_MUTEX_ROBUST,
|
|---|
| 321 | PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
|
|---|
| 322 | };
|
|---|
| 323 | enum
|
|---|
| 324 | {
|
|---|
| 325 | PTHREAD_PRIO_NONE,
|
|---|
| 326 | PTHREAD_PRIO_INHERIT,
|
|---|
| 327 | PTHREAD_PRIO_PROTECT
|
|---|
| 328 | };
|
|---|
| 329 | enum
|
|---|
| 330 | {
|
|---|
| 331 | PTHREAD_RWLOCK_PREFER_READER_NP,
|
|---|
| 332 | PTHREAD_RWLOCK_PREFER_WRITER_NP,
|
|---|
| 333 | PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
|
|---|
| 334 | PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
|
|---|
| 335 | };
|
|---|
| 336 | enum
|
|---|
| 337 | {
|
|---|
| 338 | PTHREAD_INHERIT_SCHED,
|
|---|
| 339 | PTHREAD_EXPLICIT_SCHED
|
|---|
| 340 | };
|
|---|
| 341 | enum
|
|---|
| 342 | {
|
|---|
| 343 | PTHREAD_SCOPE_SYSTEM,
|
|---|
| 344 | PTHREAD_SCOPE_PROCESS
|
|---|
| 345 | };
|
|---|
| 346 | enum
|
|---|
| 347 | {
|
|---|
| 348 | PTHREAD_PROCESS_PRIVATE,
|
|---|
| 349 | PTHREAD_PROCESS_SHARED
|
|---|
| 350 | };
|
|---|
| 351 | struct _pthread_cleanup_buffer
|
|---|
| 352 | {
|
|---|
| 353 | void (*__routine) (void *);
|
|---|
| 354 | void *__arg;
|
|---|
| 355 | int __canceltype;
|
|---|
| 356 | struct _pthread_cleanup_buffer *__prev;
|
|---|
| 357 | };
|
|---|
| 358 | enum
|
|---|
| 359 | {
|
|---|
| 360 | PTHREAD_CANCEL_ENABLE,
|
|---|
| 361 | PTHREAD_CANCEL_DISABLE
|
|---|
| 362 | };
|
|---|
| 363 | enum
|
|---|
| 364 | {
|
|---|
| 365 | PTHREAD_CANCEL_DEFERRED,
|
|---|
| 366 | PTHREAD_CANCEL_ASYNCHRONOUS
|
|---|
| 367 | };
|
|---|
| 368 |
|
|---|
| 369 | extern int pthread_create (pthread_t *__restrict __newthread,
|
|---|
| 370 | const pthread_attr_t *__restrict __attr,
|
|---|
| 371 | void *(*__start_routine) (void *),
|
|---|
| 372 | void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
|
|---|
| 373 | extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
|
|---|
| 374 | extern int pthread_join (pthread_t __th, void **__thread_return);
|
|---|
| 375 | extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 376 | extern pthread_t pthread_self (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 377 | extern int pthread_equal (pthread_t __thread1, pthread_t __thread2)
|
|---|
| 378 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 379 | extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 380 | extern int pthread_attr_destroy (pthread_attr_t *__attr)
|
|---|
| 381 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 382 | extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr,
|
|---|
| 383 | int *__detachstate)
|
|---|
| 384 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 385 | extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
|
|---|
| 386 | int __detachstate)
|
|---|
| 387 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 388 | extern int pthread_attr_getguardsize (const pthread_attr_t *__attr,
|
|---|
| 389 | size_t *__guardsize)
|
|---|
| 390 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 391 | extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
|
|---|
| 392 | size_t __guardsize)
|
|---|
| 393 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 394 | extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
|
|---|
| 395 | struct sched_param *__restrict __param)
|
|---|
| 396 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 397 | extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
|
|---|
| 398 | const struct sched_param *__restrict
|
|---|
| 399 | __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 400 | extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict
|
|---|
| 401 | __attr, int *__restrict __policy)
|
|---|
| 402 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 403 | extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
|
|---|
| 404 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 405 | extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict
|
|---|
| 406 | __attr, int *__restrict __inherit)
|
|---|
| 407 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 408 | extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
|
|---|
| 409 | int __inherit)
|
|---|
| 410 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 411 | extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr,
|
|---|
| 412 | int *__restrict __scope)
|
|---|
| 413 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 414 | extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
|
|---|
| 415 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 416 | extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict
|
|---|
| 417 | __attr, void **__restrict __stackaddr)
|
|---|
| 418 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
|
|---|
| 419 | extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
|
|---|
| 420 | void *__stackaddr)
|
|---|
| 421 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
|
|---|
| 422 | extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict
|
|---|
| 423 | __attr, size_t *__restrict __stacksize)
|
|---|
| 424 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 425 | extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
|
|---|
| 426 | size_t __stacksize)
|
|---|
| 427 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 428 | extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
|
|---|
| 429 | void **__restrict __stackaddr,
|
|---|
| 430 | size_t *__restrict __stacksize)
|
|---|
| 431 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));
|
|---|
| 432 | extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
|
|---|
| 433 | size_t __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 434 | extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
|
|---|
| 435 | const struct sched_param *__param)
|
|---|
| 436 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
|
|---|
| 437 | extern int pthread_getschedparam (pthread_t __target_thread,
|
|---|
| 438 | int *__restrict __policy,
|
|---|
| 439 | struct sched_param *__restrict __param)
|
|---|
| 440 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
|
|---|
| 441 | extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
|
|---|
| 442 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 443 | extern int pthread_once (pthread_once_t *__once_control,
|
|---|
| 444 | void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 445 | extern int pthread_setcancelstate (int __state, int *__oldstate);
|
|---|
| 446 | extern int pthread_setcanceltype (int __type, int *__oldtype);
|
|---|
| 447 | extern int pthread_cancel (pthread_t __th);
|
|---|
| 448 | extern void pthread_testcancel (void);
|
|---|
| 449 | typedef struct
|
|---|
| 450 | {
|
|---|
| 451 | struct
|
|---|
| 452 | {
|
|---|
| 453 | __jmp_buf __cancel_jmp_buf;
|
|---|
| 454 | int __mask_was_saved;
|
|---|
| 455 | } __cancel_jmp_buf[1];
|
|---|
| 456 | void *__pad[4];
|
|---|
| 457 | } __pthread_unwind_buf_t __attribute__ ((__aligned__));
|
|---|
| 458 | struct __pthread_cleanup_frame
|
|---|
| 459 | {
|
|---|
| 460 | void (*__cancel_routine) (void *);
|
|---|
| 461 | void *__cancel_arg;
|
|---|
| 462 | int __do_it;
|
|---|
| 463 | int __cancel_type;
|
|---|
| 464 | };
|
|---|
| 465 | extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
|
|---|
| 466 | ;
|
|---|
| 467 | extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
|
|---|
| 468 | ;
|
|---|
| 469 | extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
|
|---|
| 470 | __attribute__ ((__noreturn__))
|
|---|
| 471 | __attribute__ ((__weak__))
|
|---|
| 472 | ;
|
|---|
| 473 | struct __jmp_buf_tag;
|
|---|
| 474 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
|
|---|
| 475 | extern int pthread_mutex_init (pthread_mutex_t *__mutex,
|
|---|
| 476 | const pthread_mutexattr_t *__mutexattr)
|
|---|
| 477 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 478 | extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
|
|---|
| 479 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 480 | extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
|
|---|
| 481 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 482 | extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
|
|---|
| 483 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 484 | extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
|
|---|
| 485 | const struct timespec *__restrict
|
|---|
| 486 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 487 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
|
|---|
| 488 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 489 | extern int pthread_mutex_getprioceiling (const pthread_mutex_t *
|
|---|
| 490 | __restrict __mutex,
|
|---|
| 491 | int *__restrict __prioceiling)
|
|---|
| 492 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 493 | extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
|
|---|
| 494 | int __prioceiling,
|
|---|
| 495 | int *__restrict __old_ceiling)
|
|---|
| 496 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
|
|---|
| 497 | extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
|
|---|
| 498 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 499 | extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
|
|---|
| 500 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 501 | extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
|
|---|
| 502 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 503 | extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t *
|
|---|
| 504 | __restrict __attr,
|
|---|
| 505 | int *__restrict __pshared)
|
|---|
| 506 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 507 | extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
|
|---|
| 508 | int __pshared)
|
|---|
| 509 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 510 | extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict
|
|---|
| 511 | __attr, int *__restrict __kind)
|
|---|
| 512 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 513 | extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
|
|---|
| 514 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 515 | extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t *
|
|---|
| 516 | __restrict __attr,
|
|---|
| 517 | int *__restrict __protocol)
|
|---|
| 518 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 519 | extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
|
|---|
| 520 | int __protocol)
|
|---|
| 521 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 522 | extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *
|
|---|
| 523 | __restrict __attr,
|
|---|
| 524 | int *__restrict __prioceiling)
|
|---|
| 525 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 526 | extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
|
|---|
| 527 | int __prioceiling)
|
|---|
| 528 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 529 | extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
|
|---|
| 530 | int *__robustness)
|
|---|
| 531 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 532 | extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
|
|---|
| 533 | int __robustness)
|
|---|
| 534 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 535 | extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 536 | const pthread_rwlockattr_t *__restrict
|
|---|
| 537 | __attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 538 | extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
|
|---|
| 539 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 540 | extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
|
|---|
| 541 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 542 | extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
|
|---|
| 543 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 544 | extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 545 | const struct timespec *__restrict
|
|---|
| 546 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 547 | extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
|
|---|
| 548 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 549 | extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
|
|---|
| 550 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 551 | extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 552 | const struct timespec *__restrict
|
|---|
| 553 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 554 | extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
|
|---|
| 555 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 556 | extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
|
|---|
| 557 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 558 | extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
|
|---|
| 559 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 560 | extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *
|
|---|
| 561 | __restrict __attr,
|
|---|
| 562 | int *__restrict __pshared)
|
|---|
| 563 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 564 | extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
|
|---|
| 565 | int __pshared)
|
|---|
| 566 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 567 | extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *
|
|---|
| 568 | __restrict __attr,
|
|---|
| 569 | int *__restrict __pref)
|
|---|
| 570 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 571 | extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
|
|---|
| 572 | int __pref) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 573 | extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
|
|---|
| 574 | const pthread_condattr_t *__restrict __cond_attr)
|
|---|
| 575 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 576 | extern int pthread_cond_destroy (pthread_cond_t *__cond)
|
|---|
| 577 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 578 | extern int pthread_cond_signal (pthread_cond_t *__cond)
|
|---|
| 579 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 580 | extern int pthread_cond_broadcast (pthread_cond_t *__cond)
|
|---|
| 581 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 582 | extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
|
|---|
| 583 | pthread_mutex_t *__restrict __mutex)
|
|---|
| 584 | __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 585 | extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
|
|---|
| 586 | pthread_mutex_t *__restrict __mutex,
|
|---|
| 587 | const struct timespec *__restrict __abstime)
|
|---|
| 588 | __attribute__ ((__nonnull__ (1, 2, 3)));
|
|---|
| 589 | extern int pthread_condattr_init (pthread_condattr_t *__attr)
|
|---|
| 590 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 591 | extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
|
|---|
| 592 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 593 | extern int pthread_condattr_getpshared (const pthread_condattr_t *
|
|---|
| 594 | __restrict __attr,
|
|---|
| 595 | int *__restrict __pshared)
|
|---|
| 596 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 597 | extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
|
|---|
| 598 | int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 599 | extern int pthread_condattr_getclock (const pthread_condattr_t *
|
|---|
| 600 | __restrict __attr,
|
|---|
| 601 | __clockid_t *__restrict __clock_id)
|
|---|
| 602 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 603 | extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
|
|---|
| 604 | __clockid_t __clock_id)
|
|---|
| 605 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 606 | extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
|
|---|
| 607 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 608 | extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
|
|---|
| 609 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 610 | extern int pthread_spin_lock (pthread_spinlock_t *__lock)
|
|---|
| 611 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 612 | extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
|
|---|
| 613 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 614 | extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
|
|---|
| 615 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 616 | extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
|
|---|
| 617 | const pthread_barrierattr_t *__restrict
|
|---|
| 618 | __attr, unsigned int __count)
|
|---|
| 619 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 620 | extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
|
|---|
| 621 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 622 | extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
|
|---|
| 623 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 624 | extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
|
|---|
| 625 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 626 | extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
|
|---|
| 627 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 628 | extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *
|
|---|
| 629 | __restrict __attr,
|
|---|
| 630 | int *__restrict __pshared)
|
|---|
| 631 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 632 | extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
|
|---|
| 633 | int __pshared)
|
|---|
| 634 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 635 | extern int pthread_key_create (pthread_key_t *__key,
|
|---|
| 636 | void (*__destr_function) (void *))
|
|---|
| 637 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 638 | extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 639 | extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 640 | extern int pthread_setspecific (pthread_key_t __key,
|
|---|
| 641 | const void *__pointer) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 642 | extern int pthread_getcpuclockid (pthread_t __thread_id,
|
|---|
| 643 | __clockid_t *__clock_id)
|
|---|
| 644 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 645 | extern int pthread_atfork (void (*__prepare) (void),
|
|---|
| 646 | void (*__parent) (void),
|
|---|
| 647 | void (*__child) (void)) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 648 |
|
|---|
| 649 | extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
|
|---|
| 650 |
|
|---|
| 651 | extern void __VERIFIER_error(void);
|
|---|
| 652 | extern void __VERIFIER_assume(int);
|
|---|
| 653 | void __VERIFIER_assert(int cond) {
|
|---|
| 654 | if (!(cond)) {
|
|---|
| 655 | ERROR: __VERIFIER_error();
|
|---|
| 656 | }
|
|---|
| 657 | return;
|
|---|
| 658 | }
|
|---|
| 659 | void __VERIFIER_atomic_assert(int cond) {
|
|---|
| 660 | if (!(cond)) {
|
|---|
| 661 | ERROR: __VERIFIER_error();
|
|---|
| 662 | }
|
|---|
| 663 | return;
|
|---|
| 664 | }
|
|---|
| 665 | int __VERIFIER_nondet_int();
|
|---|
| 666 | int *data;
|
|---|
| 667 | volatile int len;
|
|---|
| 668 | volatile int next;
|
|---|
| 669 | volatile int lock;
|
|---|
| 670 | void __VERIFIER_atomic_acquire() {
|
|---|
| 671 | __VERIFIER_assume(lock == 0);
|
|---|
| 672 | lock = 1;
|
|---|
| 673 | }
|
|---|
| 674 | void __VERIFIER_atomic_release() {
|
|---|
| 675 | __VERIFIER_assume(lock == 1);
|
|---|
| 676 | lock = 0;
|
|---|
| 677 | }
|
|---|
| 678 | void* thr(void* arg) {
|
|---|
| 679 | int c, end;
|
|---|
| 680 | c = 0;
|
|---|
| 681 | end = 0;
|
|---|
| 682 | __VERIFIER_atomic_acquire();
|
|---|
| 683 | if (next + 10 <= len) {
|
|---|
| 684 | c = next;
|
|---|
| 685 | next = end = next + 10;
|
|---|
| 686 | }
|
|---|
| 687 | __VERIFIER_atomic_release();
|
|---|
| 688 | while (c < end) {
|
|---|
| 689 | data[c] = 0;
|
|---|
| 690 | data[c] = 1;
|
|---|
| 691 | __VERIFIER_assert(data[c] == 1);
|
|---|
| 692 | c = c + 1;
|
|---|
| 693 | }
|
|---|
| 694 | }
|
|---|
| 695 | void main(int argc, char* argv[]) {
|
|---|
| 696 | pthread_t t;
|
|---|
| 697 | pthread_mutex_init(&lock, 0);
|
|---|
| 698 | next = 0;
|
|---|
| 699 | len = __VERIFIER_nondet_int();
|
|---|
| 700 | __VERIFIER_assume(len > 0);
|
|---|
| 701 | data = malloc(sizeof(int) * len);
|
|---|
| 702 | while(1) {
|
|---|
| 703 | pthread_create(&t, 0, thr, 0);
|
|---|
| 704 | }
|
|---|
| 705 | }
|
|---|