source: CIVL/examples/pthread/svcomp/stack_true-unreach-call.i@ bb03188

main test-branch
Last change on this file since bb03188 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 39.5 KB
Line 
1extern void __VERIFIER_error() __attribute__ ((__noreturn__));
2
3
4
5
6
7
8
9
10typedef unsigned char __u_char;
11typedef unsigned short int __u_short;
12typedef unsigned int __u_int;
13typedef unsigned long int __u_long;
14
15
16typedef signed char __int8_t;
17typedef unsigned char __uint8_t;
18typedef signed short int __int16_t;
19typedef unsigned short int __uint16_t;
20typedef signed int __int32_t;
21typedef 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
89typedef __off64_t __loff_t;
90typedef __quad_t *__qaddr_t;
91typedef char *__caddr_t;
92
93
94__extension__ typedef int __intptr_t;
95
96
97__extension__ typedef unsigned int __socklen_t;
98
99
100typedef unsigned int size_t;
101
102
103
104
105
106typedef __time_t time_t;
107
108
109
110struct timespec
111 {
112 __time_t tv_sec;
113 long int tv_nsec;
114 };
115
116
117typedef __pid_t pid_t;
118
119
120
121
122
123struct sched_param
124 {
125 int __sched_priority;
126 };
127
128
129
130
131
132
133
134
135
136
137struct __sched_param
138 {
139 int __sched_priority;
140 };
141typedef unsigned long int __cpu_mask;
142
143
144
145
146
147
148typedef struct
149{
150 __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
151} cpu_set_t;
152
153
154extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
155 __attribute__ ((__nothrow__));
156extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__)) ;
157extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__));
158
159
160
161
162
163
164
165
166
167extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
168 __attribute__ ((__nothrow__));
169
170
171extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__));
172
173
174extern int sched_setscheduler (__pid_t __pid, int __policy,
175 __const struct sched_param *__param) __attribute__ ((__nothrow__));
176
177
178extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__));
179
180
181extern int sched_yield (void) __attribute__ ((__nothrow__));
182
183
184extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__));
185
186
187extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__));
188
189
190extern 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
205typedef __clock_t clock_t;
206
207
208
209typedef __clockid_t clockid_t;
210typedef __timer_t timer_t;
211
212
213struct 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
241struct itimerspec
242 {
243 struct timespec it_interval;
244 struct timespec it_value;
245 };
246
247
248struct sigevent;
249
250
251
252extern clock_t clock (void) __attribute__ ((__nothrow__));
253
254
255extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
256
257
258extern double difftime (time_t __time1, time_t __time0)
259 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
260
261
262extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
263
264
265
266
267
268extern size_t strftime (char *__restrict __s, size_t __maxsize,
269 __const char *__restrict __format,
270 __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
271
272typedef 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
287typedef __locale_t locale_t;
288
289extern 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
296extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));
297
298
299
300extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));
301
302
303
304
305
306extern struct tm *gmtime_r (__const time_t *__restrict __timer,
307 struct tm *__restrict __tp) __attribute__ ((__nothrow__));
308
309
310
311extern struct tm *localtime_r (__const time_t *__restrict __timer,
312 struct tm *__restrict __tp) __attribute__ ((__nothrow__));
313
314
315
316
317
318extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));
319
320
321extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));
322
323
324
325
326
327
328
329extern char *asctime_r (__const struct tm *__restrict __tp,
330 char *__restrict __buf) __attribute__ ((__nothrow__));
331
332
333extern char *ctime_r (__const time_t *__restrict __timer,
334 char *__restrict __buf) __attribute__ ((__nothrow__));
335
336
337
338
339extern char *__tzname[2];
340extern int __daylight;
341extern long int __timezone;
342
343
344
345
346extern char *tzname[2];
347
348
349
350extern void tzset (void) __attribute__ ((__nothrow__));
351
352
353
354extern int daylight;
355extern long int timezone;
356
357
358
359
360
361extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
362extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
363
364
365extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
366
367
368extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
369extern int nanosleep (__const struct timespec *__requested_time,
370 struct timespec *__remaining);
371
372
373
374extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
375
376
377extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
378
379
380extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
381 __attribute__ ((__nothrow__));
382
383
384
385
386
387
388extern int clock_nanosleep (clockid_t __clock_id, int __flags,
389 __const struct timespec *__req,
390 struct timespec *__rem);
391
392
393extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__));
394
395
396
397
398extern int timer_create (clockid_t __clock_id,
399 struct sigevent *__restrict __evp,
400 timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
401
402
403extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
404
405
406extern int timer_settime (timer_t __timerid, int __flags,
407 __const struct itimerspec *__restrict __value,
408 struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
409
410
411extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
412 __attribute__ ((__nothrow__));
413
414
415extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
416
417
418typedef unsigned long int pthread_t;
419
420
421typedef union
422{
423 char __size[36];
424 long int __align;
425} pthread_attr_t;
426
427
428typedef struct __pthread_internal_slist
429{
430 struct __pthread_internal_slist *__next;
431} __pthread_slist_t;
432
433
434
435
436typedef 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
457typedef union
458{
459 char __size[4];
460 long int __align;
461} pthread_mutexattr_t;
462
463
464
465
466typedef 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
483typedef union
484{
485 char __size[4];
486 long int __align;
487} pthread_condattr_t;
488
489
490
491typedef unsigned int pthread_key_t;
492
493
494
495typedef int pthread_once_t;
496
497
498
499
500
501typedef 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
523typedef union
524{
525 char __size[8];
526 long int __align;
527} pthread_rwlockattr_t;
528
529
530
531
532
533typedef volatile int pthread_spinlock_t;
534
535
536
537
538typedef union
539{
540 char __size[20];
541 long int __align;
542} pthread_barrier_t;
543
544typedef union
545{
546 char __size[4];
547 int __align;
548} pthread_barrierattr_t;
549typedef int __jmp_buf[6];
550
551
552
553enum
554{
555 PTHREAD_CREATE_JOINABLE,
556
557 PTHREAD_CREATE_DETACHED
558
559};
560
561
562
563enum
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
585enum
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};
592enum
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};
599enum
600{
601 PTHREAD_INHERIT_SCHED,
602
603 PTHREAD_EXPLICIT_SCHED
604
605};
606
607
608
609enum
610{
611 PTHREAD_SCOPE_SYSTEM,
612
613 PTHREAD_SCOPE_PROCESS
614
615};
616
617
618
619enum
620{
621 PTHREAD_PROCESS_PRIVATE,
622
623 PTHREAD_PROCESS_SHARED
624
625};
626struct _pthread_cleanup_buffer
627{
628 void (*__routine) (void *);
629 void *__arg;
630 int __canceltype;
631 struct _pthread_cleanup_buffer *__prev;
632};
633
634
635enum
636{
637 PTHREAD_CANCEL_ENABLE,
638
639 PTHREAD_CANCEL_DISABLE
640
641};
642enum
643{
644 PTHREAD_CANCEL_DEFERRED,
645
646 PTHREAD_CANCEL_ASYNCHRONOUS
647
648};
649
650
651
652
653
654extern 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
663extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
664
665
666
667
668
669
670
671extern int pthread_join (pthread_t __th, void **__thread_return);
672extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__));
673
674
675
676extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
677
678
679extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__));
680
681
682
683
684
685
686
687extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
688
689
690extern int pthread_attr_destroy (pthread_attr_t *__attr)
691 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
692
693
694extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
695 int *__detachstate)
696 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
697
698
699extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
700 int __detachstate)
701 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
702
703
704
705extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
706 size_t *__guardsize)
707 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
708
709
710extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
711 size_t __guardsize)
712 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
713
714
715
716extern 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
722extern 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
727extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
728 __attr, int *__restrict __policy)
729 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
730
731
732extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
733 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
734
735
736extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
737 __attr, int *__restrict __inherit)
738 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
739
740
741extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
742 int __inherit)
743 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
744
745
746
747extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
748 int *__restrict __scope)
749 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
750
751
752extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
753 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
754
755
756extern 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
764extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
765 void *__stackaddr)
766 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
767
768
769extern 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
776extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
777 size_t __stacksize)
778 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
779
780
781
782extern 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
790extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
791 size_t __stacksize) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
792extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
793 __const struct sched_param *__param)
794 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
795
796
797extern 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
803extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
804 __attribute__ ((__nothrow__));
805extern int pthread_once (pthread_once_t *__once_control,
806 void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
807extern int pthread_setcancelstate (int __state, int *__oldstate);
808
809
810
811extern int pthread_setcanceltype (int __type, int *__oldtype);
812
813
814extern int pthread_cancel (pthread_t __th);
815
816
817
818
819extern void pthread_testcancel (void);
820
821
822
823
824typedef 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__));
833struct __pthread_cleanup_frame
834{
835 void (*__cancel_routine) (void *);
836 void *__cancel_arg;
837 int __do_it;
838 int __cancel_type;
839};
840extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
841 __attribute__ ((__regparm__ (1)));
842extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
843 __attribute__ ((__regparm__ (1)));
844extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
845 __attribute__ ((__regparm__ (1))) __attribute__ ((__noreturn__))
846
847 __attribute__ ((__weak__))
848
849 ;
850
851
852
853struct __jmp_buf_tag;
854extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
855
856
857
858
859
860extern int pthread_mutex_init (pthread_mutex_t *__mutex,
861 __const pthread_mutexattr_t *__mutexattr)
862 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
863
864
865extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
866 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
867
868
869extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
870 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
871
872
873extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
874 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
875
876
877
878extern 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
884extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
885 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
886
887
888
889extern 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
896extern 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
904extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
905 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
906extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
907 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
908
909
910extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
911 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
912
913
914extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
915 __restrict __attr,
916 int *__restrict __pshared)
917 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
918
919
920extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
921 int __pshared)
922 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
923
924
925
926extern 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
933extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
934 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
935
936
937
938extern 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
945extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
946 int __protocol)
947 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
948
949
950extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
951 __restrict __attr,
952 int *__restrict __prioceiling)
953 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
954
955
956extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
957 int __prioceiling)
958 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
959
960
961
962extern 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
972extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
973 int __robustness)
974 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
975extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
976 __const pthread_rwlockattr_t *__restrict
977 __attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
978
979
980extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
981 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
982
983
984extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
985 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
986
987
988extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
989 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
990
991
992
993extern 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
999extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
1000 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1001
1002
1003extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
1004 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1005
1006
1007
1008extern 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
1014extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
1015 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1016
1017
1018
1019
1020
1021extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
1022 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1023
1024
1025extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
1026 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1027
1028
1029extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
1030 __restrict __attr,
1031 int *__restrict __pshared)
1032 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1033
1034
1035extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
1036 int __pshared)
1037 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1038
1039
1040extern 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
1046extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
1047 int __pref) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1048
1049
1050
1051
1052
1053
1054
1055extern 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
1060extern int pthread_cond_destroy (pthread_cond_t *__cond)
1061 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1062
1063
1064extern int pthread_cond_signal (pthread_cond_t *__cond)
1065 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1066
1067
1068extern int pthread_cond_broadcast (pthread_cond_t *__cond)
1069 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1070
1071
1072
1073
1074
1075
1076extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
1077 pthread_mutex_t *__restrict __mutex)
1078 __attribute__ ((__nonnull__ (1, 2)));
1079extern 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
1087extern int pthread_condattr_init (pthread_condattr_t *__attr)
1088 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1089
1090
1091extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
1092 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1093
1094
1095extern int pthread_condattr_getpshared (__const pthread_condattr_t *
1096 __restrict __attr,
1097 int *__restrict __pshared)
1098 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1099
1100
1101extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
1102 int __pshared) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1103
1104
1105
1106extern 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
1112extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
1113 __clockid_t __clock_id)
1114 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1115extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
1116 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1117
1118
1119extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
1120 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1121
1122
1123extern int pthread_spin_lock (pthread_spinlock_t *__lock)
1124 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1125
1126
1127extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
1128 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1129
1130
1131extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
1132 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1133
1134
1135
1136
1137
1138
1139extern 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
1145extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
1146 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1147
1148
1149extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
1150 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1151
1152
1153
1154extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
1155 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1156
1157
1158extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
1159 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1160
1161
1162extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
1163 __restrict __attr,
1164 int *__restrict __pshared)
1165 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1166
1167
1168extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
1169 int __pshared)
1170 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1171extern int pthread_key_create (pthread_key_t *__key,
1172 void (*__destr_function) (void *))
1173 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1174
1175
1176extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__));
1177
1178
1179extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__));
1180
1181
1182extern int pthread_setspecific (pthread_key_t __key,
1183 __const void *__pointer) __attribute__ ((__nothrow__)) ;
1184
1185
1186
1187
1188extern int pthread_getcpuclockid (pthread_t __thread_id,
1189 __clockid_t *__clock_id)
1190 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1191extern int pthread_atfork (void (*__prepare) (void),
1192 void (*__parent) (void),
1193 void (*__child) (void)) __attribute__ ((__nothrow__));
1194
1195
1196
1197
1198
1199struct _IO_FILE;
1200
1201
1202
1203typedef struct _IO_FILE FILE;
1204
1205
1206
1207
1208
1209typedef struct _IO_FILE __FILE;
1210
1211
1212
1213
1214typedef 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
1228typedef struct
1229{
1230 __off_t __pos;
1231 __mbstate_t __state;
1232} _G_fpos_t;
1233typedef struct
1234{
1235 __off64_t __pos;
1236 __mbstate_t __state;
1237} _G_fpos64_t;
1238typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
1239typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
1240typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
1241typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
1242typedef __builtin_va_list __gnuc_va_list;
1243struct _IO_jump_t; struct _IO_FILE;
1244typedef void _IO_lock_t;
1245
1246
1247
1248
1249
1250struct _IO_marker {
1251 struct _IO_marker *_next;
1252 struct _IO_FILE *_sbuf;
1253
1254
1255
1256 int _pos;
1257};
1258
1259
1260enum __codecvt_result
1261{
1262 __codecvt_ok,
1263 __codecvt_partial,
1264 __codecvt_error,
1265 __codecvt_noconv
1266};
1267struct _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
1321typedef struct _IO_FILE _IO_FILE;
1322
1323
1324struct _IO_FILE_plus;
1325
1326extern struct _IO_FILE_plus _IO_2_1_stdin_;
1327extern struct _IO_FILE_plus _IO_2_1_stdout_;
1328extern struct _IO_FILE_plus _IO_2_1_stderr_;
1329typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
1330
1331
1332
1333
1334
1335
1336
1337typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
1338 size_t __n);
1339
1340
1341
1342
1343
1344
1345
1346typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
1347
1348
1349typedef int __io_close_fn (void *__cookie);
1350extern int __underflow (_IO_FILE *);
1351extern int __uflow (_IO_FILE *);
1352extern int __overflow (_IO_FILE *, int);
1353extern int _IO_getc (_IO_FILE *__fp);
1354extern int _IO_putc (int __c, _IO_FILE *__fp);
1355extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
1356extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
1357
1358extern int _IO_peekc_locked (_IO_FILE *__fp);
1359
1360
1361
1362
1363
1364extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1365extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1366extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
1367extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
1368 __gnuc_va_list, int *__restrict);
1369extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
1370 __gnuc_va_list);
1371extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
1372extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
1373
1374extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
1375extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
1376
1377extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
1378
1379
1380
1381
1382typedef __gnuc_va_list va_list;
1383typedef __off_t off_t;
1384typedef __ssize_t ssize_t;
1385
1386
1387
1388
1389
1390
1391
1392typedef _G_fpos_t fpos_t;
1393
1394
1395
1396
1397
1398
1399
1400extern struct _IO_FILE *stdin;
1401extern struct _IO_FILE *stdout;
1402extern struct _IO_FILE *stderr;
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
1413
1414extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
1415
1416
1417
1418
1419extern int renameat (int __oldfd, __const char *__old, int __newfd,
1420 __const char *__new) __attribute__ ((__nothrow__));
1421
1422
1423
1424
1425
1426
1427
1428
1429extern FILE *tmpfile (void) ;
1430extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ;
1431
1432
1433
1434
1435
1436extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ;
1437extern char *tempnam (__const char *__dir, __const char *__pfx)
1438 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
1439
1440
1441
1442
1443
1444
1445
1446
1447extern int fclose (FILE *__stream);
1448
1449
1450
1451
1452extern int fflush (FILE *__stream);
1453
1454extern int fflush_unlocked (FILE *__stream);
1455
1456
1457
1458
1459
1460
1461extern FILE *fopen (__const char *__restrict __filename,
1462 __const char *__restrict __modes) ;
1463
1464
1465
1466
1467extern FILE *freopen (__const char *__restrict __filename,
1468 __const char *__restrict __modes,
1469 FILE *__restrict __stream) ;
1470
1471extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ;
1472extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
1473 __attribute__ ((__nothrow__)) ;
1474
1475
1476
1477
1478extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ;
1479
1480
1481
1482
1483
1484
1485extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
1486
1487
1488
1489extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
1490 int __modes, size_t __n) __attribute__ ((__nothrow__));
1491
1492
1493
1494
1495
1496extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
1497 size_t __size) __attribute__ ((__nothrow__));
1498
1499
1500extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
1501
1502
1503
1504
1505
1506
1507
1508
1509extern int fprintf (FILE *__restrict __stream,
1510 __const char *__restrict __format, ...);
1511
1512
1513
1514
1515extern int printf (__const char *__restrict __format, ...);
1516
1517extern int sprintf (char *__restrict __s,
1518 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1519
1520
1521
1522
1523
1524extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
1525 __gnuc_va_list __arg);
1526
1527
1528
1529
1530extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
1531
1532extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
1533 __gnuc_va_list __arg) __attribute__ ((__nothrow__));
1534
1535
1536
1537
1538
1539extern int snprintf (char *__restrict __s, size_t __maxlen,
1540 __const char *__restrict __format, ...)
1541 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
1542
1543extern 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
1547extern int vdprintf (int __fd, __const char *__restrict __fmt,
1548 __gnuc_va_list __arg)
1549 __attribute__ ((__format__ (__printf__, 2, 0)));
1550extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
1551 __attribute__ ((__format__ (__printf__, 2, 3)));
1552
1553
1554
1555
1556
1557
1558
1559
1560extern int fscanf (FILE *__restrict __stream,
1561 __const char *__restrict __format, ...) ;
1562
1563
1564
1565
1566extern int scanf (__const char *__restrict __format, ...) ;
1567
1568extern int sscanf (__const char *__restrict __s,
1569 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1570extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
1571
1572 ;
1573extern int scanf (__const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
1574 ;
1575extern 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
1586extern 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
1594extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
1595 __attribute__ ((__format__ (__scanf__, 1, 0))) ;
1596
1597
1598extern int vsscanf (__const char *__restrict __s,
1599 __const char *__restrict __format, __gnuc_va_list __arg)
1600 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
1601extern 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))) ;
1606extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
1607
1608 __attribute__ ((__format__ (__scanf__, 1, 0))) ;
1609extern 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
1623extern int fgetc (FILE *__stream);
1624extern int getc (FILE *__stream);
1625
1626
1627
1628
1629
1630extern int getchar (void);
1631
1632extern int getc_unlocked (FILE *__stream);
1633extern int getchar_unlocked (void);
1634extern int fgetc_unlocked (FILE *__stream);
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646extern int fputc (int __c, FILE *__stream);
1647extern int putc (int __c, FILE *__stream);
1648
1649
1650
1651
1652
1653extern int putchar (int __c);
1654
1655extern int fputc_unlocked (int __c, FILE *__stream);
1656
1657
1658
1659
1660
1661
1662
1663extern int putc_unlocked (int __c, FILE *__stream);
1664extern int putchar_unlocked (int __c);
1665
1666
1667
1668
1669
1670
1671extern int getw (FILE *__stream);
1672
1673
1674extern int putw (int __w, FILE *__stream);
1675
1676
1677
1678
1679
1680
1681
1682
1683extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
1684 ;
1685
1686
1687
1688
1689
1690
1691extern char *gets (char *__s) ;
1692
1693extern __ssize_t __getdelim (char **__restrict __lineptr,
1694 size_t *__restrict __n, int __delimiter,
1695 FILE *__restrict __stream) ;
1696extern __ssize_t getdelim (char **__restrict __lineptr,
1697 size_t *__restrict __n, int __delimiter,
1698 FILE *__restrict __stream) ;
1699
1700
1701
1702
1703
1704
1705
1706extern __ssize_t getline (char **__restrict __lineptr,
1707 size_t *__restrict __n,
1708 FILE *__restrict __stream) ;
1709
1710
1711
1712
1713
1714
1715
1716
1717extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
1718
1719
1720
1721
1722
1723extern int puts (__const char *__s);
1724
1725
1726
1727
1728
1729
1730extern int ungetc (int __c, FILE *__stream);
1731
1732
1733
1734
1735
1736
1737extern size_t fread (void *__restrict __ptr, size_t __size,
1738 size_t __n, FILE *__restrict __stream) ;
1739
1740
1741
1742
1743extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
1744 size_t __n, FILE *__restrict __s) ;
1745
1746extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
1747 size_t __n, FILE *__restrict __stream) ;
1748extern 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
1758extern int fseek (FILE *__stream, long int __off, int __whence);
1759
1760
1761
1762
1763extern long int ftell (FILE *__stream) ;
1764
1765
1766
1767
1768extern void rewind (FILE *__stream);
1769
1770extern int fseeko (FILE *__stream, __off_t __off, int __whence);
1771
1772
1773
1774
1775extern __off_t ftello (FILE *__stream) ;
1776
1777
1778
1779
1780
1781
1782extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
1783
1784
1785
1786
1787extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
1788
1789
1790
1791extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
1792
1793extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
1794
1795extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
1796
1797
1798
1799
1800extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
1801extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1802extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1803
1804
1805
1806
1807
1808
1809
1810
1811extern void perror (__const char *__s);
1812
1813
1814
1815
1816
1817
1818extern int sys_nerr;
1819extern __const char *__const sys_errlist[];
1820
1821
1822
1823
1824extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
1825
1826
1827
1828
1829extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1830extern FILE *popen (__const char *__command, __const char *__modes) ;
1831
1832
1833
1834
1835
1836extern int pclose (FILE *__stream);
1837
1838
1839
1840
1841
1842extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
1843extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
1844
1845
1846
1847extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
1848
1849
1850extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
1851
1852
1853
1854
1855
1856
1857
1858
1859unsigned int __VERIFIER_nondet_uint();
1860static int top=0;
1861static unsigned int arr[(5)];
1862pthread_mutex_t m;
1863_Bool flag=(0);
1864
1865void error(void)
1866{
1867 ERROR: __VERIFIER_error();
1868 return;
1869}
1870
1871void inc_top(void)
1872{
1873 top++;
1874}
1875
1876void dec_top(void)
1877{
1878 top--;
1879}
1880
1881int get_top(void)
1882{
1883 return top;
1884}
1885
1886int stack_empty(void)
1887{
1888 (top==0) ? (1) : (0);
1889}
1890
1891int 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
1906int 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
1921void *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
1936void *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
1953int 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}
Note: See TracBrowser for help on using the repository browser.