source: CIVL/mods/dev.civl.com/examples/svcomp17/race-2_2-container_of_false-unreach-call.i@ cb4d4f4

1.23 2.0 main test-branch
Last change on this file since cb4d4f4 was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

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

  • Property mode set to 100644
File size: 76.3 KB
Line 
1
2
3typedef unsigned char __u_char;
4typedef unsigned short int __u_short;
5typedef unsigned int __u_int;
6typedef unsigned long int __u_long;
7
8
9typedef signed char __int8_t;
10typedef unsigned char __uint8_t;
11typedef signed short int __int16_t;
12typedef unsigned short int __uint16_t;
13typedef signed int __int32_t;
14typedef unsigned int __uint32_t;
15
16typedef signed long int __int64_t;
17typedef unsigned long int __uint64_t;
18
19
20
21
22
23
24
25typedef long int __quad_t;
26typedef unsigned long int __u_quad_t;
27
28
29typedef unsigned long int __dev_t;
30typedef unsigned int __uid_t;
31typedef unsigned int __gid_t;
32typedef unsigned long int __ino_t;
33typedef unsigned long int __ino64_t;
34typedef unsigned int __mode_t;
35typedef unsigned long int __nlink_t;
36typedef long int __off_t;
37typedef long int __off64_t;
38typedef int __pid_t;
39typedef struct { int __val[2]; } __fsid_t;
40typedef long int __clock_t;
41typedef unsigned long int __rlim_t;
42typedef unsigned long int __rlim64_t;
43typedef unsigned int __id_t;
44typedef long int __time_t;
45typedef unsigned int __useconds_t;
46typedef long int __suseconds_t;
47
48typedef int __daddr_t;
49typedef int __key_t;
50
51
52typedef int __clockid_t;
53
54
55typedef void * __timer_t;
56
57
58typedef long int __blksize_t;
59
60
61
62
63typedef long int __blkcnt_t;
64typedef long int __blkcnt64_t;
65
66
67typedef unsigned long int __fsblkcnt_t;
68typedef unsigned long int __fsblkcnt64_t;
69
70
71typedef unsigned long int __fsfilcnt_t;
72typedef unsigned long int __fsfilcnt64_t;
73
74
75typedef long int __fsword_t;
76
77typedef long int __ssize_t;
78
79
80typedef long int __syscall_slong_t;
81
82typedef unsigned long int __syscall_ulong_t;
83
84
85
86typedef __off64_t __loff_t;
87typedef __quad_t *__qaddr_t;
88typedef char *__caddr_t;
89
90
91typedef long int __intptr_t;
92
93
94typedef unsigned int __socklen_t;
95
96
97
98
99
100
101static __inline unsigned int
102__bswap_32 (unsigned int __bsx)
103{
104 return __builtin_bswap32 (__bsx);
105}
106static __inline __uint64_t
107__bswap_64 (__uint64_t __bsx)
108{
109 return __builtin_bswap64 (__bsx);
110}
111typedef long unsigned int size_t;
112
113
114
115
116
117typedef __time_t time_t;
118
119
120
121struct timespec
122 {
123 __time_t tv_sec;
124 __syscall_slong_t tv_nsec;
125 };
126
127
128typedef __pid_t pid_t;
129
130
131
132
133
134struct sched_param
135 {
136 int __sched_priority;
137 };
138
139
140
141
142
143
144
145
146
147
148struct __sched_param
149 {
150 int __sched_priority;
151 };
152typedef unsigned long int __cpu_mask;
153
154
155
156
157
158
159typedef struct
160{
161 __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
162} cpu_set_t;
163
164
165extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
166 __attribute__ ((__nothrow__ , __leaf__));
167extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__ , __leaf__)) ;
168extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__ , __leaf__));
169
170
171
172
173
174
175
176
177
178extern int sched_setparam (__pid_t __pid, const struct sched_param *__param)
179 __attribute__ ((__nothrow__ , __leaf__));
180
181
182extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__));
183
184
185extern int sched_setscheduler (__pid_t __pid, int __policy,
186 const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__));
187
188
189extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
190
191
192extern int sched_yield (void) __attribute__ ((__nothrow__ , __leaf__));
193
194
195extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__ , __leaf__));
196
197
198extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__ , __leaf__));
199
200
201extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__ , __leaf__));
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216typedef __clock_t clock_t;
217
218
219
220typedef __clockid_t clockid_t;
221typedef __timer_t timer_t;
222
223
224struct tm
225{
226 int tm_sec;
227 int tm_min;
228 int tm_hour;
229 int tm_mday;
230 int tm_mon;
231 int tm_year;
232 int tm_wday;
233 int tm_yday;
234 int tm_isdst;
235
236
237 long int tm_gmtoff;
238 const char *tm_zone;
239
240
241
242
243};
244
245
246
247
248
249
250
251
252struct itimerspec
253 {
254 struct timespec it_interval;
255 struct timespec it_value;
256 };
257
258
259struct sigevent;
260
261
262
263extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__));
264
265
266extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
267
268
269extern double difftime (time_t __time1, time_t __time0)
270 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
271
272
273extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
274
275
276
277
278
279extern size_t strftime (char *__restrict __s, size_t __maxsize,
280 const char *__restrict __format,
281 const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
282
283typedef struct __locale_struct
284{
285
286 struct __locale_data *__locales[13];
287
288
289 const unsigned short int *__ctype_b;
290 const int *__ctype_tolower;
291 const int *__ctype_toupper;
292
293
294 const char *__names[13];
295} *__locale_t;
296
297
298typedef __locale_t locale_t;
299
300extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
301 const char *__restrict __format,
302 const struct tm *__restrict __tp,
303 __locale_t __loc) __attribute__ ((__nothrow__ , __leaf__));
304
305
306
307extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
308
309
310
311extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
312
313
314
315
316
317extern struct tm *gmtime_r (const time_t *__restrict __timer,
318 struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
319
320
321
322extern struct tm *localtime_r (const time_t *__restrict __timer,
323 struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
324
325
326
327
328
329extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
330
331
332extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
333
334
335
336
337
338
339
340extern char *asctime_r (const struct tm *__restrict __tp,
341 char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
342
343
344extern char *ctime_r (const time_t *__restrict __timer,
345 char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
346
347
348
349
350extern char *__tzname[2];
351extern int __daylight;
352extern long int __timezone;
353
354
355
356
357extern char *tzname[2];
358
359
360
361extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__));
362
363
364
365extern int daylight;
366extern long int timezone;
367
368
369
370
371
372extern int stime (const time_t *__when) __attribute__ ((__nothrow__ , __leaf__));
373extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
374
375
376extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
377
378
379extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
380extern int nanosleep (const struct timespec *__requested_time,
381 struct timespec *__remaining);
382
383
384
385extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__));
386
387
388extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__));
389
390
391extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
392 __attribute__ ((__nothrow__ , __leaf__));
393
394
395
396
397
398
399extern int clock_nanosleep (clockid_t __clock_id, int __flags,
400 const struct timespec *__req,
401 struct timespec *__rem);
402
403
404extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__));
405
406
407
408
409extern int timer_create (clockid_t __clock_id,
410 struct sigevent *__restrict __evp,
411 timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__));
412
413
414extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
415
416
417extern int timer_settime (timer_t __timerid, int __flags,
418 const struct itimerspec *__restrict __value,
419 struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__));
420
421
422extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
423 __attribute__ ((__nothrow__ , __leaf__));
424
425
426extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
427
428
429typedef unsigned long int pthread_t;
430
431
432union pthread_attr_t
433{
434 char __size[56];
435 long int __align;
436};
437
438typedef union pthread_attr_t pthread_attr_t;
439
440
441
442
443
444typedef struct __pthread_internal_list
445{
446 struct __pthread_internal_list *__prev;
447 struct __pthread_internal_list *__next;
448} __pthread_list_t;
449typedef union
450{
451 struct __pthread_mutex_s
452 {
453 int __lock;
454 unsigned int __count;
455 int __owner;
456
457 unsigned int __nusers;
458
459
460
461 int __kind;
462
463 short __spins;
464 short __elision;
465 __pthread_list_t __list;
466 } __data;
467 char __size[40];
468 long int __align;
469} pthread_mutex_t;
470
471typedef union
472{
473 char __size[4];
474 int __align;
475} pthread_mutexattr_t;
476
477
478
479
480typedef union
481{
482 struct
483 {
484 int __lock;
485 unsigned int __futex;
486 __extension__ unsigned long long int __total_seq;
487 __extension__ unsigned long long int __wakeup_seq;
488 __extension__ unsigned long long int __woken_seq;
489 void *__mutex;
490 unsigned int __nwaiters;
491 unsigned int __broadcast_seq;
492 } __data;
493 char __size[48];
494 __extension__ long long int __align;
495} pthread_cond_t;
496
497typedef union
498{
499 char __size[4];
500 int __align;
501} pthread_condattr_t;
502
503
504
505typedef unsigned int pthread_key_t;
506
507
508
509typedef int pthread_once_t;
510
511
512
513
514
515typedef union
516{
517
518 struct
519 {
520 int __lock;
521 unsigned int __nr_readers;
522 unsigned int __readers_wakeup;
523 unsigned int __writer_wakeup;
524 unsigned int __nr_readers_queued;
525 unsigned int __nr_writers_queued;
526 int __writer;
527 int __shared;
528 unsigned long int __pad1;
529 unsigned long int __pad2;
530
531
532 unsigned int __flags;
533
534 } __data;
535 char __size[56];
536 long int __align;
537} pthread_rwlock_t;
538
539typedef union
540{
541 char __size[8];
542 long int __align;
543} pthread_rwlockattr_t;
544
545
546
547
548
549typedef volatile int pthread_spinlock_t;
550
551
552
553
554typedef union
555{
556 char __size[32];
557 long int __align;
558} pthread_barrier_t;
559
560typedef union
561{
562 char __size[4];
563 int __align;
564} pthread_barrierattr_t;
565
566
567
568
569typedef long int __jmp_buf[8];
570
571
572
573enum
574{
575 PTHREAD_CREATE_JOINABLE,
576
577 PTHREAD_CREATE_DETACHED
578
579};
580
581
582
583enum
584{
585 PTHREAD_MUTEX_TIMED_NP,
586 PTHREAD_MUTEX_RECURSIVE_NP,
587 PTHREAD_MUTEX_ERRORCHECK_NP,
588 PTHREAD_MUTEX_ADAPTIVE_NP
589
590 ,
591 PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
592 PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
593 PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
594 PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
595
596
597
598
599
600};
601
602
603
604
605enum
606{
607 PTHREAD_MUTEX_STALLED,
608 PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
609 PTHREAD_MUTEX_ROBUST,
610 PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
611};
612
613
614
615
616
617enum
618{
619 PTHREAD_PRIO_NONE,
620 PTHREAD_PRIO_INHERIT,
621 PTHREAD_PRIO_PROTECT
622};
623enum
624{
625 PTHREAD_RWLOCK_PREFER_READER_NP,
626 PTHREAD_RWLOCK_PREFER_WRITER_NP,
627 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
628 PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
629};
630enum
631{
632 PTHREAD_INHERIT_SCHED,
633
634 PTHREAD_EXPLICIT_SCHED
635
636};
637
638
639
640enum
641{
642 PTHREAD_SCOPE_SYSTEM,
643
644 PTHREAD_SCOPE_PROCESS
645
646};
647
648
649
650enum
651{
652 PTHREAD_PROCESS_PRIVATE,
653
654 PTHREAD_PROCESS_SHARED
655
656};
657struct _pthread_cleanup_buffer
658{
659 void (*__routine) (void *);
660 void *__arg;
661 int __canceltype;
662 struct _pthread_cleanup_buffer *__prev;
663};
664
665
666enum
667{
668 PTHREAD_CANCEL_ENABLE,
669
670 PTHREAD_CANCEL_DISABLE
671
672};
673enum
674{
675 PTHREAD_CANCEL_DEFERRED,
676
677 PTHREAD_CANCEL_ASYNCHRONOUS
678
679};
680
681
682
683
684
685extern int pthread_create (pthread_t *__restrict __newthread,
686 const pthread_attr_t *__restrict __attr,
687 void *(*__start_routine) (void *),
688 void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
689
690
691
692
693
694extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
695
696
697
698
699
700
701
702extern int pthread_join (pthread_t __th, void **__thread_return);
703extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__ , __leaf__));
704
705
706
707extern pthread_t pthread_self (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
708
709
710extern int pthread_equal (pthread_t __thread1, pthread_t __thread2)
711 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
712
713
714
715
716
717
718
719extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
720
721
722extern int pthread_attr_destroy (pthread_attr_t *__attr)
723 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
724
725
726extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr,
727 int *__detachstate)
728 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
729
730
731extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
732 int __detachstate)
733 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
734
735
736
737extern int pthread_attr_getguardsize (const pthread_attr_t *__attr,
738 size_t *__guardsize)
739 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
740
741
742extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
743 size_t __guardsize)
744 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
745
746
747
748extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
749 struct sched_param *__restrict __param)
750 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
751
752
753extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
754 const struct sched_param *__restrict
755 __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
756
757
758extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict
759 __attr, int *__restrict __policy)
760 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
761
762
763extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
764 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
765
766
767extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict
768 __attr, int *__restrict __inherit)
769 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
770
771
772extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
773 int __inherit)
774 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
775
776
777
778extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr,
779 int *__restrict __scope)
780 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
781
782
783extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
784 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
785
786
787extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict
788 __attr, void **__restrict __stackaddr)
789 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
790
791
792
793
794
795extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
796 void *__stackaddr)
797 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
798
799
800extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict
801 __attr, size_t *__restrict __stacksize)
802 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
803
804
805
806
807extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
808 size_t __stacksize)
809 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
810
811
812
813extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
814 void **__restrict __stackaddr,
815 size_t *__restrict __stacksize)
816 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));
817
818
819
820
821extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
822 size_t __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
823extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
824 const struct sched_param *__param)
825 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
826
827
828extern int pthread_getschedparam (pthread_t __target_thread,
829 int *__restrict __policy,
830 struct sched_param *__restrict __param)
831 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
832
833
834extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
835 __attribute__ ((__nothrow__ , __leaf__));
836extern int pthread_once (pthread_once_t *__once_control,
837 void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
838extern int pthread_setcancelstate (int __state, int *__oldstate);
839
840
841
842extern int pthread_setcanceltype (int __type, int *__oldtype);
843
844
845extern int pthread_cancel (pthread_t __th);
846
847
848
849
850extern void pthread_testcancel (void);
851
852
853
854
855typedef struct
856{
857 struct
858 {
859 __jmp_buf __cancel_jmp_buf;
860 int __mask_was_saved;
861 } __cancel_jmp_buf[1];
862 void *__pad[4];
863} __pthread_unwind_buf_t __attribute__ ((__aligned__));
864struct __pthread_cleanup_frame
865{
866 void (*__cancel_routine) (void *);
867 void *__cancel_arg;
868 int __do_it;
869 int __cancel_type;
870};
871extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
872 ;
873extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
874 ;
875extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
876 __attribute__ ((__noreturn__))
877
878 __attribute__ ((__weak__))
879
880 ;
881
882
883
884struct __jmp_buf_tag;
885extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
886
887
888
889
890
891extern int pthread_mutex_init (pthread_mutex_t *__mutex,
892 const pthread_mutexattr_t *__mutexattr)
893 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
894
895
896extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
897 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
898
899
900extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
901 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
902
903
904extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
905 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
906
907
908
909extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
910 const struct timespec *__restrict
911 __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
912
913
914
915extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
916 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
917
918
919
920extern int pthread_mutex_getprioceiling (const pthread_mutex_t *
921 __restrict __mutex,
922 int *__restrict __prioceiling)
923 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
924
925
926
927extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
928 int __prioceiling,
929 int *__restrict __old_ceiling)
930 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
931
932
933
934
935extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
936 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
937extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
938 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
939
940
941extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
942 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
943
944
945extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t *
946 __restrict __attr,
947 int *__restrict __pshared)
948 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
949
950
951extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
952 int __pshared)
953 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
954
955
956
957extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict
958 __attr, int *__restrict __kind)
959 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
960
961
962
963
964extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
965 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
966
967
968
969extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t *
970 __restrict __attr,
971 int *__restrict __protocol)
972 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
973
974
975
976extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
977 int __protocol)
978 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
979
980
981extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *
982 __restrict __attr,
983 int *__restrict __prioceiling)
984 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
985
986
987extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
988 int __prioceiling)
989 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
990
991
992
993extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
994 int *__robustness)
995 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
996
997
998
999
1000
1001
1002
1003extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
1004 int __robustness)
1005 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1006extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
1007 const pthread_rwlockattr_t *__restrict
1008 __attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1009
1010
1011extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
1012 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1013
1014
1015extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
1016 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1017
1018
1019extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
1020 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1021
1022
1023
1024extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
1025 const struct timespec *__restrict
1026 __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1027
1028
1029
1030extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
1031 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1032
1033
1034extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
1035 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1036
1037
1038
1039extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
1040 const struct timespec *__restrict
1041 __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1042
1043
1044
1045extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
1046 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1047
1048
1049
1050
1051
1052extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
1053 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1054
1055
1056extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
1057 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1058
1059
1060extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *
1061 __restrict __attr,
1062 int *__restrict __pshared)
1063 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
1064
1065
1066extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
1067 int __pshared)
1068 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1069
1070
1071extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *
1072 __restrict __attr,
1073 int *__restrict __pref)
1074 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
1075
1076
1077extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
1078 int __pref) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1079
1080
1081
1082
1083
1084
1085
1086extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
1087 const pthread_condattr_t *__restrict __cond_attr)
1088 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1089
1090
1091extern int pthread_cond_destroy (pthread_cond_t *__cond)
1092 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1093
1094
1095extern int pthread_cond_signal (pthread_cond_t *__cond)
1096 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1097
1098
1099extern int pthread_cond_broadcast (pthread_cond_t *__cond)
1100 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1101
1102
1103
1104
1105
1106
1107extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
1108 pthread_mutex_t *__restrict __mutex)
1109 __attribute__ ((__nonnull__ (1, 2)));
1110extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
1111 pthread_mutex_t *__restrict __mutex,
1112 const struct timespec *__restrict __abstime)
1113 __attribute__ ((__nonnull__ (1, 2, 3)));
1114
1115
1116
1117
1118extern int pthread_condattr_init (pthread_condattr_t *__attr)
1119 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1120
1121
1122extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
1123 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1124
1125
1126extern int pthread_condattr_getpshared (const pthread_condattr_t *
1127 __restrict __attr,
1128 int *__restrict __pshared)
1129 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
1130
1131
1132extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
1133 int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1134
1135
1136
1137extern int pthread_condattr_getclock (const pthread_condattr_t *
1138 __restrict __attr,
1139 __clockid_t *__restrict __clock_id)
1140 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
1141
1142
1143extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
1144 __clockid_t __clock_id)
1145 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1146extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
1147 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1148
1149
1150extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
1151 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1152
1153
1154extern int pthread_spin_lock (pthread_spinlock_t *__lock)
1155 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1156
1157
1158extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
1159 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1160
1161
1162extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
1163 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1164
1165
1166
1167
1168
1169
1170extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
1171 const pthread_barrierattr_t *__restrict
1172 __attr, unsigned int __count)
1173 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1174
1175
1176extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
1177 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1178
1179
1180extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
1181 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1182
1183
1184
1185extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
1186 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1187
1188
1189extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
1190 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1191
1192
1193extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *
1194 __restrict __attr,
1195 int *__restrict __pshared)
1196 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
1197
1198
1199extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
1200 int __pshared)
1201 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1202extern int pthread_key_create (pthread_key_t *__key,
1203 void (*__destr_function) (void *))
1204 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1205
1206
1207extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
1208
1209
1210extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
1211
1212
1213extern int pthread_setspecific (pthread_key_t __key,
1214 const void *__pointer) __attribute__ ((__nothrow__ , __leaf__)) ;
1215
1216
1217
1218
1219extern int pthread_getcpuclockid (pthread_t __thread_id,
1220 __clockid_t *__clock_id)
1221 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
1222extern int pthread_atfork (void (*__prepare) (void),
1223 void (*__parent) (void),
1224 void (*__child) (void)) __attribute__ ((__nothrow__ , __leaf__));
1225
1226
1227
1228
1229
1230struct _IO_FILE;
1231
1232
1233
1234typedef struct _IO_FILE FILE;
1235
1236
1237
1238
1239
1240typedef struct _IO_FILE __FILE;
1241
1242
1243
1244
1245typedef struct
1246{
1247 int __count;
1248 union
1249 {
1250
1251 unsigned int __wch;
1252
1253
1254
1255 char __wchb[4];
1256 } __value;
1257} __mbstate_t;
1258typedef struct
1259{
1260 __off_t __pos;
1261 __mbstate_t __state;
1262} _G_fpos_t;
1263typedef struct
1264{
1265 __off64_t __pos;
1266 __mbstate_t __state;
1267} _G_fpos64_t;
1268typedef __builtin_va_list __gnuc_va_list;
1269struct _IO_jump_t; struct _IO_FILE;
1270typedef void _IO_lock_t;
1271
1272
1273
1274
1275
1276struct _IO_marker {
1277 struct _IO_marker *_next;
1278 struct _IO_FILE *_sbuf;
1279
1280
1281
1282 int _pos;
1283};
1284
1285
1286enum __codecvt_result
1287{
1288 __codecvt_ok,
1289 __codecvt_partial,
1290 __codecvt_error,
1291 __codecvt_noconv
1292};
1293struct _IO_FILE {
1294 int _flags;
1295
1296
1297
1298
1299 char* _IO_read_ptr;
1300 char* _IO_read_end;
1301 char* _IO_read_base;
1302 char* _IO_write_base;
1303 char* _IO_write_ptr;
1304 char* _IO_write_end;
1305 char* _IO_buf_base;
1306 char* _IO_buf_end;
1307
1308 char *_IO_save_base;
1309 char *_IO_backup_base;
1310 char *_IO_save_end;
1311
1312 struct _IO_marker *_markers;
1313
1314 struct _IO_FILE *_chain;
1315
1316 int _fileno;
1317
1318
1319
1320 int _flags2;
1321
1322 __off_t _old_offset;
1323
1324
1325
1326 unsigned short _cur_column;
1327 signed char _vtable_offset;
1328 char _shortbuf[1];
1329
1330
1331
1332 _IO_lock_t *_lock;
1333 __off64_t _offset;
1334 void *__pad1;
1335 void *__pad2;
1336 void *__pad3;
1337 void *__pad4;
1338 size_t __pad5;
1339
1340 int _mode;
1341
1342 char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
1343
1344};
1345
1346
1347typedef struct _IO_FILE _IO_FILE;
1348
1349
1350struct _IO_FILE_plus;
1351
1352extern struct _IO_FILE_plus _IO_2_1_stdin_;
1353extern struct _IO_FILE_plus _IO_2_1_stdout_;
1354extern struct _IO_FILE_plus _IO_2_1_stderr_;
1355typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
1356
1357
1358
1359
1360
1361
1362
1363typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,
1364 size_t __n);
1365
1366
1367
1368
1369
1370
1371
1372typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
1373
1374
1375typedef int __io_close_fn (void *__cookie);
1376extern int __underflow (_IO_FILE *);
1377extern int __uflow (_IO_FILE *);
1378extern int __overflow (_IO_FILE *, int);
1379extern int _IO_getc (_IO_FILE *__fp);
1380extern int _IO_putc (int __c, _IO_FILE *__fp);
1381extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__));
1382extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__));
1383
1384extern int _IO_peekc_locked (_IO_FILE *__fp);
1385
1386
1387
1388
1389
1390extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
1391extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
1392extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
1393extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
1394 __gnuc_va_list, int *__restrict);
1395extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
1396 __gnuc_va_list);
1397extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
1398extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
1399
1400extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
1401extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
1402
1403extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
1404
1405
1406
1407
1408typedef __gnuc_va_list va_list;
1409typedef __off_t off_t;
1410typedef __ssize_t ssize_t;
1411
1412
1413
1414
1415
1416
1417
1418typedef _G_fpos_t fpos_t;
1419
1420
1421
1422
1423
1424
1425
1426extern struct _IO_FILE *stdin;
1427extern struct _IO_FILE *stdout;
1428extern struct _IO_FILE *stderr;
1429
1430
1431
1432
1433
1434
1435
1436extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));
1437
1438extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));
1439
1440
1441
1442
1443extern int renameat (int __oldfd, const char *__old, int __newfd,
1444 const char *__new) __attribute__ ((__nothrow__ , __leaf__));
1445
1446
1447
1448
1449
1450
1451
1452
1453extern FILE *tmpfile (void) ;
1454extern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
1455
1456
1457
1458
1459
1460extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
1461extern char *tempnam (const char *__dir, const char *__pfx)
1462 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
1463
1464
1465
1466
1467
1468
1469
1470
1471extern int fclose (FILE *__stream);
1472
1473
1474
1475
1476extern int fflush (FILE *__stream);
1477
1478extern int fflush_unlocked (FILE *__stream);
1479
1480
1481
1482
1483
1484
1485extern FILE *fopen (const char *__restrict __filename,
1486 const char *__restrict __modes) ;
1487
1488
1489
1490
1491extern FILE *freopen (const char *__restrict __filename,
1492 const char *__restrict __modes,
1493 FILE *__restrict __stream) ;
1494
1495extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ;
1496extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
1497 __attribute__ ((__nothrow__ , __leaf__)) ;
1498
1499
1500
1501
1502extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) ;
1503
1504
1505
1506
1507
1508
1509extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
1510
1511
1512
1513extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
1514 int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
1515
1516
1517
1518
1519
1520extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
1521 size_t __size) __attribute__ ((__nothrow__ , __leaf__));
1522
1523
1524extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
1525
1526
1527
1528
1529
1530
1531
1532
1533extern int fprintf (FILE *__restrict __stream,
1534 const char *__restrict __format, ...);
1535
1536
1537
1538
1539extern int printf (const char *__restrict __format, ...);
1540
1541extern int sprintf (char *__restrict __s,
1542 const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1543
1544
1545
1546
1547
1548extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
1549 __gnuc_va_list __arg);
1550
1551
1552
1553
1554extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
1555
1556extern int vsprintf (char *__restrict __s, const char *__restrict __format,
1557 __gnuc_va_list __arg) __attribute__ ((__nothrow__));
1558
1559
1560
1561
1562
1563extern int snprintf (char *__restrict __s, size_t __maxlen,
1564 const char *__restrict __format, ...)
1565 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
1566
1567extern int vsnprintf (char *__restrict __s, size_t __maxlen,
1568 const char *__restrict __format, __gnuc_va_list __arg)
1569 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
1570
1571extern int vdprintf (int __fd, const char *__restrict __fmt,
1572 __gnuc_va_list __arg)
1573 __attribute__ ((__format__ (__printf__, 2, 0)));
1574extern int dprintf (int __fd, const char *__restrict __fmt, ...)
1575 __attribute__ ((__format__ (__printf__, 2, 3)));
1576
1577
1578
1579
1580
1581
1582
1583
1584extern int fscanf (FILE *__restrict __stream,
1585 const char *__restrict __format, ...) ;
1586
1587
1588
1589
1590extern int scanf (const char *__restrict __format, ...) ;
1591
1592extern int sscanf (const char *__restrict __s,
1593 const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__));
1594extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
1595
1596 ;
1597extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
1598 ;
1599extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__))
1600
1601 ;
1602
1603
1604
1605
1606
1607
1608
1609
1610extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
1611 __gnuc_va_list __arg)
1612 __attribute__ ((__format__ (__scanf__, 2, 0))) ;
1613
1614
1615
1616
1617
1618extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
1619 __attribute__ ((__format__ (__scanf__, 1, 0))) ;
1620
1621
1622extern int vsscanf (const char *__restrict __s,
1623 const char *__restrict __format, __gnuc_va_list __arg)
1624 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
1625extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
1626
1627
1628
1629 __attribute__ ((__format__ (__scanf__, 2, 0))) ;
1630extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
1631
1632 __attribute__ ((__format__ (__scanf__, 1, 0))) ;
1633extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__))
1634
1635
1636
1637 __attribute__ ((__format__ (__scanf__, 2, 0)));
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647extern int fgetc (FILE *__stream);
1648extern int getc (FILE *__stream);
1649
1650
1651
1652
1653
1654extern int getchar (void);
1655
1656extern int getc_unlocked (FILE *__stream);
1657extern int getchar_unlocked (void);
1658extern int fgetc_unlocked (FILE *__stream);
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670extern int fputc (int __c, FILE *__stream);
1671extern int putc (int __c, FILE *__stream);
1672
1673
1674
1675
1676
1677extern int putchar (int __c);
1678
1679extern int fputc_unlocked (int __c, FILE *__stream);
1680
1681
1682
1683
1684
1685
1686
1687extern int putc_unlocked (int __c, FILE *__stream);
1688extern int putchar_unlocked (int __c);
1689
1690
1691
1692
1693
1694
1695extern int getw (FILE *__stream);
1696
1697
1698extern int putw (int __w, FILE *__stream);
1699
1700
1701
1702
1703
1704
1705
1706
1707extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
1708 ;
1709extern char *gets (char *__s) __attribute__ ((__deprecated__));
1710
1711
1712extern __ssize_t __getdelim (char **__restrict __lineptr,
1713 size_t *__restrict __n, int __delimiter,
1714 FILE *__restrict __stream) ;
1715extern __ssize_t getdelim (char **__restrict __lineptr,
1716 size_t *__restrict __n, int __delimiter,
1717 FILE *__restrict __stream) ;
1718
1719
1720
1721
1722
1723
1724
1725extern __ssize_t getline (char **__restrict __lineptr,
1726 size_t *__restrict __n,
1727 FILE *__restrict __stream) ;
1728
1729
1730
1731
1732
1733
1734
1735
1736extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
1737
1738
1739
1740
1741
1742extern int puts (const char *__s);
1743
1744
1745
1746
1747
1748
1749extern int ungetc (int __c, FILE *__stream);
1750
1751
1752
1753
1754
1755
1756extern size_t fread (void *__restrict __ptr, size_t __size,
1757 size_t __n, FILE *__restrict __stream) ;
1758
1759
1760
1761
1762extern size_t fwrite (const void *__restrict __ptr, size_t __size,
1763 size_t __n, FILE *__restrict __s);
1764
1765extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
1766 size_t __n, FILE *__restrict __stream) ;
1767extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
1768 size_t __n, FILE *__restrict __stream);
1769
1770
1771
1772
1773
1774
1775
1776
1777extern int fseek (FILE *__stream, long int __off, int __whence);
1778
1779
1780
1781
1782extern long int ftell (FILE *__stream) ;
1783
1784
1785
1786
1787extern void rewind (FILE *__stream);
1788
1789extern int fseeko (FILE *__stream, __off_t __off, int __whence);
1790
1791
1792
1793
1794extern __off_t ftello (FILE *__stream) ;
1795
1796
1797
1798
1799
1800
1801extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
1802
1803
1804
1805
1806extern int fsetpos (FILE *__stream, const fpos_t *__pos);
1807
1808
1809
1810extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
1811
1812extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
1813
1814extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
1815
1816
1817
1818
1819extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
1820extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
1821extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
1822
1823
1824
1825
1826
1827
1828
1829
1830extern void perror (const char *__s);
1831
1832
1833
1834
1835
1836
1837extern int sys_nerr;
1838extern const char *const sys_errlist[];
1839
1840
1841
1842
1843extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
1844
1845
1846
1847
1848extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
1849extern FILE *popen (const char *__command, const char *__modes) ;
1850
1851
1852
1853
1854
1855extern int pclose (FILE *__stream);
1856
1857
1858
1859
1860
1861extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__));
1862extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
1863
1864
1865
1866extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
1867
1868
1869extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
1870
1871typedef int wchar_t;
1872
1873
1874
1875
1876
1877
1878
1879
1880typedef enum
1881{
1882 P_ALL,
1883 P_PID,
1884 P_PGID
1885} idtype_t;
1886union wait
1887 {
1888 int w_status;
1889 struct
1890 {
1891
1892 unsigned int __w_termsig:7;
1893 unsigned int __w_coredump:1;
1894 unsigned int __w_retcode:8;
1895 unsigned int:16;
1896
1897
1898
1899
1900
1901
1902
1903 } __wait_terminated;
1904 struct
1905 {
1906
1907 unsigned int __w_stopval:8;
1908 unsigned int __w_stopsig:8;
1909 unsigned int:16;
1910
1911
1912
1913
1914
1915
1916 } __wait_stopped;
1917 };
1918typedef union
1919 {
1920 union wait *__uptr;
1921 int *__iptr;
1922 } __WAIT_STATUS __attribute__ ((__transparent_union__));
1923
1924
1925typedef struct
1926 {
1927 int quot;
1928 int rem;
1929 } div_t;
1930
1931
1932
1933typedef struct
1934 {
1935 long int quot;
1936 long int rem;
1937 } ldiv_t;
1938
1939
1940
1941
1942
1943
1944
1945__extension__ typedef struct
1946 {
1947 long long int quot;
1948 long long int rem;
1949 } lldiv_t;
1950
1951
1952extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;
1953
1954
1955
1956
1957extern double atof (const char *__nptr)
1958 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1959
1960extern int atoi (const char *__nptr)
1961 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1962
1963extern long int atol (const char *__nptr)
1964 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1965
1966
1967
1968
1969
1970__extension__ extern long long int atoll (const char *__nptr)
1971 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1972
1973
1974
1975
1976
1977extern double strtod (const char *__restrict __nptr,
1978 char **__restrict __endptr)
1979 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1980
1981
1982
1983
1984
1985extern float strtof (const char *__restrict __nptr,
1986 char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1987
1988extern long double strtold (const char *__restrict __nptr,
1989 char **__restrict __endptr)
1990 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1991
1992
1993
1994
1995
1996extern long int strtol (const char *__restrict __nptr,
1997 char **__restrict __endptr, int __base)
1998 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
1999
2000extern unsigned long int strtoul (const char *__restrict __nptr,
2001 char **__restrict __endptr, int __base)
2002 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2003
2004
2005
2006
2007__extension__
2008extern long long int strtoq (const char *__restrict __nptr,
2009 char **__restrict __endptr, int __base)
2010 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2011
2012__extension__
2013extern unsigned long long int strtouq (const char *__restrict __nptr,
2014 char **__restrict __endptr, int __base)
2015 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2016
2017
2018
2019
2020
2021__extension__
2022extern long long int strtoll (const char *__restrict __nptr,
2023 char **__restrict __endptr, int __base)
2024 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2025
2026__extension__
2027extern unsigned long long int strtoull (const char *__restrict __nptr,
2028 char **__restrict __endptr, int __base)
2029 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2030
2031extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;
2032
2033
2034extern long int a64l (const char *__s)
2035 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046typedef __u_char u_char;
2047typedef __u_short u_short;
2048typedef __u_int u_int;
2049typedef __u_long u_long;
2050typedef __quad_t quad_t;
2051typedef __u_quad_t u_quad_t;
2052typedef __fsid_t fsid_t;
2053
2054
2055
2056
2057typedef __loff_t loff_t;
2058
2059
2060
2061typedef __ino_t ino_t;
2062typedef __dev_t dev_t;
2063
2064
2065
2066
2067typedef __gid_t gid_t;
2068
2069
2070
2071
2072typedef __mode_t mode_t;
2073
2074
2075
2076
2077typedef __nlink_t nlink_t;
2078
2079
2080
2081
2082typedef __uid_t uid_t;
2083typedef __id_t id_t;
2084typedef __daddr_t daddr_t;
2085typedef __caddr_t caddr_t;
2086
2087
2088
2089
2090
2091typedef __key_t key_t;
2092
2093
2094
2095typedef unsigned long int ulong;
2096typedef unsigned short int ushort;
2097typedef unsigned int uint;
2098typedef int int8_t __attribute__ ((__mode__ (__QI__)));
2099typedef int int16_t __attribute__ ((__mode__ (__HI__)));
2100typedef int int32_t __attribute__ ((__mode__ (__SI__)));
2101typedef int int64_t __attribute__ ((__mode__ (__DI__)));
2102
2103
2104typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
2105typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
2106typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
2107typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
2108
2109typedef int register_t __attribute__ ((__mode__ (__word__)));
2110
2111
2112typedef int __sig_atomic_t;
2113
2114
2115
2116
2117typedef struct
2118 {
2119 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
2120 } __sigset_t;
2121
2122
2123
2124typedef __sigset_t sigset_t;
2125
2126
2127
2128
2129
2130
2131
2132struct timeval
2133 {
2134 __time_t tv_sec;
2135 __suseconds_t tv_usec;
2136 };
2137
2138
2139typedef __suseconds_t suseconds_t;
2140
2141
2142
2143
2144
2145typedef long int __fd_mask;
2146typedef struct
2147 {
2148
2149
2150
2151
2152
2153
2154 __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
2155
2156
2157 } fd_set;
2158
2159
2160
2161
2162
2163
2164typedef __fd_mask fd_mask;
2165
2166extern int select (int __nfds, fd_set *__restrict __readfds,
2167 fd_set *__restrict __writefds,
2168 fd_set *__restrict __exceptfds,
2169 struct timeval *__restrict __timeout);
2170extern int pselect (int __nfds, fd_set *__restrict __readfds,
2171 fd_set *__restrict __writefds,
2172 fd_set *__restrict __exceptfds,
2173 const struct timespec *__restrict __timeout,
2174 const __sigset_t *__restrict __sigmask);
2175
2176
2177
2178
2179
2180__extension__
2181extern unsigned int gnu_dev_major (unsigned long long int __dev)
2182 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
2183__extension__
2184extern unsigned int gnu_dev_minor (unsigned long long int __dev)
2185 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
2186__extension__
2187extern unsigned long long int gnu_dev_makedev (unsigned int __major,
2188 unsigned int __minor)
2189 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
2190
2191
2192
2193
2194
2195
2196typedef __blksize_t blksize_t;
2197
2198
2199
2200
2201
2202
2203typedef __blkcnt_t blkcnt_t;
2204
2205
2206
2207typedef __fsblkcnt_t fsblkcnt_t;
2208
2209
2210
2211typedef __fsfilcnt_t fsfilcnt_t;
2212
2213
2214
2215
2216
2217
2218
2219extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));
2220
2221
2222extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
2223
2224
2225
2226
2227
2228extern char *initstate (unsigned int __seed, char *__statebuf,
2229 size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
2230
2231
2232
2233extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2234
2235
2236
2237
2238
2239
2240
2241struct random_data
2242 {
2243 int32_t *fptr;
2244 int32_t *rptr;
2245 int32_t *state;
2246 int rand_type;
2247 int rand_deg;
2248 int rand_sep;
2249 int32_t *end_ptr;
2250 };
2251
2252extern int random_r (struct random_data *__restrict __buf,
2253 int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2254
2255extern int srandom_r (unsigned int __seed, struct random_data *__buf)
2256 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
2257
2258extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
2259 size_t __statelen,
2260 struct random_data *__restrict __buf)
2261 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
2262
2263extern int setstate_r (char *__restrict __statebuf,
2264 struct random_data *__restrict __buf)
2265 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2266
2267
2268
2269
2270
2271
2272extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));
2273
2274extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
2275
2276
2277
2278
2279extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));
2280
2281
2282
2283
2284
2285
2286
2287extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
2288extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2289
2290
2291extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
2292extern long int nrand48 (unsigned short int __xsubi[3])
2293 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2294
2295
2296extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
2297extern long int jrand48 (unsigned short int __xsubi[3])
2298 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2299
2300
2301extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
2302extern unsigned short int *seed48 (unsigned short int __seed16v[3])
2303 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2304extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2305
2306
2307
2308
2309
2310struct drand48_data
2311 {
2312 unsigned short int __x[3];
2313 unsigned short int __old_x[3];
2314 unsigned short int __c;
2315 unsigned short int __init;
2316 __extension__ unsigned long long int __a;
2317
2318 };
2319
2320
2321extern int drand48_r (struct drand48_data *__restrict __buffer,
2322 double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2323extern int erand48_r (unsigned short int __xsubi[3],
2324 struct drand48_data *__restrict __buffer,
2325 double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2326
2327
2328extern int lrand48_r (struct drand48_data *__restrict __buffer,
2329 long int *__restrict __result)
2330 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2331extern int nrand48_r (unsigned short int __xsubi[3],
2332 struct drand48_data *__restrict __buffer,
2333 long int *__restrict __result)
2334 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2335
2336
2337extern int mrand48_r (struct drand48_data *__restrict __buffer,
2338 long int *__restrict __result)
2339 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2340extern int jrand48_r (unsigned short int __xsubi[3],
2341 struct drand48_data *__restrict __buffer,
2342 long int *__restrict __result)
2343 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2344
2345
2346extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
2347 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
2348
2349extern int seed48_r (unsigned short int __seed16v[3],
2350 struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2351
2352extern int lcong48_r (unsigned short int __param[7],
2353 struct drand48_data *__buffer)
2354 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
2365
2366extern void *calloc (size_t __nmemb, size_t __size)
2367 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378extern void *realloc (void *__ptr, size_t __size)
2379 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__));
2380
2381extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
2382
2383
2384
2385
2386extern void cfree (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
2410
2411
2412
2413
2414extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
2415 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
2416
2417
2418extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
2419
2420
2421
2422extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2423
2424
2425
2426
2427
2428extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
2429 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2430
2431
2432
2433
2434
2435
2436extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
2451
2452
2453
2454
2455
2456
2457extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
2458
2459extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2460
2461
2462
2463
2464
2465extern int setenv (const char *__name, const char *__value, int __replace)
2466 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
2467
2468
2469extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2470
2471
2472
2473
2474
2475
2476extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
2477extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2478extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
2479extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
2480extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
2481
2482
2483
2484
2485
2486extern int system (const char *__command) ;
2487
2488extern char *realpath (const char *__restrict __name,
2489 char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;
2490
2491
2492
2493
2494
2495
2496typedef int (*__compar_fn_t) (const void *, const void *);
2497
2498
2499
2500extern void *bsearch (const void *__key, const void *__base,
2501 size_t __nmemb, size_t __size, __compar_fn_t __compar)
2502 __attribute__ ((__nonnull__ (1, 2, 5))) ;
2503
2504
2505
2506
2507
2508
2509
2510extern void qsort (void *__base, size_t __nmemb, size_t __size,
2511 __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
2512extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
2513extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
2514
2515
2516
2517__extension__ extern long long int llabs (long long int __x)
2518 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
2519
2520
2521
2522
2523
2524
2525
2526extern div_t div (int __numer, int __denom)
2527 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
2528extern ldiv_t ldiv (long int __numer, long int __denom)
2529 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
2530
2531
2532
2533
2534__extension__ extern lldiv_t lldiv (long long int __numer,
2535 long long int __denom)
2536 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
2537
2538extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
2539 int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
2540
2541
2542
2543
2544extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
2545 int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
2546
2547
2548
2549
2550extern char *gcvt (double __value, int __ndigit, char *__buf)
2551 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
2552
2553
2554
2555
2556extern char *qecvt (long double __value, int __ndigit,
2557 int *__restrict __decpt, int *__restrict __sign)
2558 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
2559extern char *qfcvt (long double __value, int __ndigit,
2560 int *__restrict __decpt, int *__restrict __sign)
2561 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
2562extern char *qgcvt (long double __value, int __ndigit, char *__buf)
2563 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
2564
2565
2566
2567
2568extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
2569 int *__restrict __sign, char *__restrict __buf,
2570 size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2571extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
2572 int *__restrict __sign, char *__restrict __buf,
2573 size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2574
2575extern int qecvt_r (long double __value, int __ndigit,
2576 int *__restrict __decpt, int *__restrict __sign,
2577 char *__restrict __buf, size_t __len)
2578 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2579extern int qfcvt_r (long double __value, int __ndigit,
2580 int *__restrict __decpt, int *__restrict __sign,
2581 char *__restrict __buf, size_t __len)
2582 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2583
2584
2585
2586
2587
2588
2589extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
2590
2591
2592extern int mbtowc (wchar_t *__restrict __pwc,
2593 const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
2594
2595
2596extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));
2597
2598
2599
2600extern size_t mbstowcs (wchar_t *__restrict __pwcs,
2601 const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
2602
2603extern size_t wcstombs (char *__restrict __s,
2604 const wchar_t *__restrict __pwcs, size_t __n)
2605 __attribute__ ((__nothrow__ , __leaf__));
2606
2607
2608
2609
2610
2611
2612
2613
2614extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
2615extern int getsubopt (char **__restrict __optionp,
2616 char *const *__restrict __tokens,
2617 char **__restrict __valuep)
2618 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
2619extern int getloadavg (double __loadavg[], int __nelem)
2620 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2621
2622
2623
2624
2625
2626
2627
2628typedef __useconds_t useconds_t;
2629typedef __intptr_t intptr_t;
2630
2631
2632
2633
2634
2635
2636typedef __socklen_t socklen_t;
2637extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
2638extern int faccessat (int __fd, const char *__file, int __type, int __flag)
2639 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
2640extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__ , __leaf__));
2641extern int close (int __fd);
2642
2643
2644
2645
2646
2647
2648extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
2649
2650
2651
2652
2653
2654extern ssize_t write (int __fd, const void *__buf, size_t __n) ;
2655extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
2656 __off_t __offset) ;
2657
2658
2659
2660
2661
2662
2663extern ssize_t pwrite (int __fd, const void *__buf, size_t __n,
2664 __off_t __offset) ;
2665extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;
2666extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
2667extern unsigned int sleep (unsigned int __seconds);
2668
2669
2670
2671
2672
2673
2674
2675extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
2676 __attribute__ ((__nothrow__ , __leaf__));
2677
2678
2679
2680
2681
2682
2683extern int usleep (__useconds_t __useconds);
2684extern int pause (void);
2685
2686
2687
2688extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
2689 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
2690
2691
2692
2693extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;
2694
2695
2696
2697
2698extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
2699 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
2700
2701
2702
2703
2704
2705
2706extern int fchownat (int __fd, const char *__file, __uid_t __owner,
2707 __gid_t __group, int __flag)
2708 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
2709
2710
2711
2712extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
2713
2714
2715
2716extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
2717extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;
2718extern char *getwd (char *__buf)
2719 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ;
2720
2721
2722
2723
2724extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
2725
2726
2727extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));
2728extern char **__environ;
2729
2730
2731
2732
2733
2734
2735
2736extern int execve (const char *__path, char *const __argv[],
2737 char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2738
2739
2740
2741
2742extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
2743 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
2744
2745
2746
2747
2748extern int execv (const char *__path, char *const __argv[])
2749 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2750
2751
2752
2753extern int execle (const char *__path, const char *__arg, ...)
2754 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2755
2756
2757
2758extern int execl (const char *__path, const char *__arg, ...)
2759 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2760
2761
2762
2763extern int execvp (const char *__file, char *const __argv[])
2764 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2765
2766
2767
2768
2769extern int execlp (const char *__file, const char *__arg, ...)
2770 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
2771extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;
2772
2773
2774
2775
2776extern void _exit (int __status) __attribute__ ((__noreturn__));
2777
2778
2779
2780
2781
2782enum
2783 {
2784 _PC_LINK_MAX,
2785
2786 _PC_MAX_CANON,
2787
2788 _PC_MAX_INPUT,
2789
2790 _PC_NAME_MAX,
2791
2792 _PC_PATH_MAX,
2793
2794 _PC_PIPE_BUF,
2795
2796 _PC_CHOWN_RESTRICTED,
2797
2798 _PC_NO_TRUNC,
2799
2800 _PC_VDISABLE,
2801
2802 _PC_SYNC_IO,
2803
2804 _PC_ASYNC_IO,
2805
2806 _PC_PRIO_IO,
2807
2808 _PC_SOCK_MAXBUF,
2809
2810 _PC_FILESIZEBITS,
2811
2812 _PC_REC_INCR_XFER_SIZE,
2813
2814 _PC_REC_MAX_XFER_SIZE,
2815
2816 _PC_REC_MIN_XFER_SIZE,
2817
2818 _PC_REC_XFER_ALIGN,
2819
2820 _PC_ALLOC_SIZE_MIN,
2821
2822 _PC_SYMLINK_MAX,
2823
2824 _PC_2_SYMLINKS
2825
2826 };
2827
2828
2829enum
2830 {
2831 _SC_ARG_MAX,
2832
2833 _SC_CHILD_MAX,
2834
2835 _SC_CLK_TCK,
2836
2837 _SC_NGROUPS_MAX,
2838
2839 _SC_OPEN_MAX,
2840
2841 _SC_STREAM_MAX,
2842
2843 _SC_TZNAME_MAX,
2844
2845 _SC_JOB_CONTROL,
2846
2847 _SC_SAVED_IDS,
2848
2849 _SC_REALTIME_SIGNALS,
2850
2851 _SC_PRIORITY_SCHEDULING,
2852
2853 _SC_TIMERS,
2854
2855 _SC_ASYNCHRONOUS_IO,
2856
2857 _SC_PRIORITIZED_IO,
2858
2859 _SC_SYNCHRONIZED_IO,
2860
2861 _SC_FSYNC,
2862
2863 _SC_MAPPED_FILES,
2864
2865 _SC_MEMLOCK,
2866
2867 _SC_MEMLOCK_RANGE,
2868
2869 _SC_MEMORY_PROTECTION,
2870
2871 _SC_MESSAGE_PASSING,
2872
2873 _SC_SEMAPHORES,
2874
2875 _SC_SHARED_MEMORY_OBJECTS,
2876
2877 _SC_AIO_LISTIO_MAX,
2878
2879 _SC_AIO_MAX,
2880
2881 _SC_AIO_PRIO_DELTA_MAX,
2882
2883 _SC_DELAYTIMER_MAX,
2884
2885 _SC_MQ_OPEN_MAX,
2886
2887 _SC_MQ_PRIO_MAX,
2888
2889 _SC_VERSION,
2890
2891 _SC_PAGESIZE,
2892
2893
2894 _SC_RTSIG_MAX,
2895
2896 _SC_SEM_NSEMS_MAX,
2897
2898 _SC_SEM_VALUE_MAX,
2899
2900 _SC_SIGQUEUE_MAX,
2901
2902 _SC_TIMER_MAX,
2903
2904
2905
2906
2907 _SC_BC_BASE_MAX,
2908
2909 _SC_BC_DIM_MAX,
2910
2911 _SC_BC_SCALE_MAX,
2912
2913 _SC_BC_STRING_MAX,
2914
2915 _SC_COLL_WEIGHTS_MAX,
2916
2917 _SC_EQUIV_CLASS_MAX,
2918
2919 _SC_EXPR_NEST_MAX,
2920
2921 _SC_LINE_MAX,
2922
2923 _SC_RE_DUP_MAX,
2924
2925 _SC_CHARCLASS_NAME_MAX,
2926
2927
2928 _SC_2_VERSION,
2929
2930 _SC_2_C_BIND,
2931
2932 _SC_2_C_DEV,
2933
2934 _SC_2_FORT_DEV,
2935
2936 _SC_2_FORT_RUN,
2937
2938 _SC_2_SW_DEV,
2939
2940 _SC_2_LOCALEDEF,
2941
2942
2943 _SC_PII,
2944
2945 _SC_PII_XTI,
2946
2947 _SC_PII_SOCKET,
2948
2949 _SC_PII_INTERNET,
2950
2951 _SC_PII_OSI,
2952
2953 _SC_POLL,
2954
2955 _SC_SELECT,
2956
2957 _SC_UIO_MAXIOV,
2958
2959 _SC_IOV_MAX = _SC_UIO_MAXIOV,
2960
2961 _SC_PII_INTERNET_STREAM,
2962
2963 _SC_PII_INTERNET_DGRAM,
2964
2965 _SC_PII_OSI_COTS,
2966
2967 _SC_PII_OSI_CLTS,
2968
2969 _SC_PII_OSI_M,
2970
2971 _SC_T_IOV_MAX,
2972
2973
2974
2975 _SC_THREADS,
2976
2977 _SC_THREAD_SAFE_FUNCTIONS,
2978
2979 _SC_GETGR_R_SIZE_MAX,
2980
2981 _SC_GETPW_R_SIZE_MAX,
2982
2983 _SC_LOGIN_NAME_MAX,
2984
2985 _SC_TTY_NAME_MAX,
2986
2987 _SC_THREAD_DESTRUCTOR_ITERATIONS,
2988
2989 _SC_THREAD_KEYS_MAX,
2990
2991 _SC_THREAD_STACK_MIN,
2992
2993 _SC_THREAD_THREADS_MAX,
2994
2995 _SC_THREAD_ATTR_STACKADDR,
2996
2997 _SC_THREAD_ATTR_STACKSIZE,
2998
2999 _SC_THREAD_PRIORITY_SCHEDULING,
3000
3001 _SC_THREAD_PRIO_INHERIT,
3002
3003 _SC_THREAD_PRIO_PROTECT,
3004
3005 _SC_THREAD_PROCESS_SHARED,
3006
3007
3008 _SC_NPROCESSORS_CONF,
3009
3010 _SC_NPROCESSORS_ONLN,
3011
3012 _SC_PHYS_PAGES,
3013
3014 _SC_AVPHYS_PAGES,
3015
3016 _SC_ATEXIT_MAX,
3017
3018 _SC_PASS_MAX,
3019
3020
3021 _SC_XOPEN_VERSION,
3022
3023 _SC_XOPEN_XCU_VERSION,
3024
3025 _SC_XOPEN_UNIX,
3026
3027 _SC_XOPEN_CRYPT,
3028
3029 _SC_XOPEN_ENH_I18N,
3030
3031 _SC_XOPEN_SHM,
3032
3033
3034 _SC_2_CHAR_TERM,
3035
3036 _SC_2_C_VERSION,
3037
3038 _SC_2_UPE,
3039
3040
3041 _SC_XOPEN_XPG2,
3042
3043 _SC_XOPEN_XPG3,
3044
3045 _SC_XOPEN_XPG4,
3046
3047
3048 _SC_CHAR_BIT,
3049
3050 _SC_CHAR_MAX,
3051
3052 _SC_CHAR_MIN,
3053
3054 _SC_INT_MAX,
3055
3056 _SC_INT_MIN,
3057
3058 _SC_LONG_BIT,
3059
3060 _SC_WORD_BIT,
3061
3062 _SC_MB_LEN_MAX,
3063
3064 _SC_NZERO,
3065
3066 _SC_SSIZE_MAX,
3067
3068 _SC_SCHAR_MAX,
3069
3070 _SC_SCHAR_MIN,
3071
3072 _SC_SHRT_MAX,
3073
3074 _SC_SHRT_MIN,
3075
3076 _SC_UCHAR_MAX,
3077
3078 _SC_UINT_MAX,
3079
3080 _SC_ULONG_MAX,
3081
3082 _SC_USHRT_MAX,
3083
3084
3085 _SC_NL_ARGMAX,
3086
3087 _SC_NL_LANGMAX,
3088
3089 _SC_NL_MSGMAX,
3090
3091 _SC_NL_NMAX,
3092
3093 _SC_NL_SETMAX,
3094
3095 _SC_NL_TEXTMAX,
3096
3097
3098 _SC_XBS5_ILP32_OFF32,
3099
3100 _SC_XBS5_ILP32_OFFBIG,
3101
3102 _SC_XBS5_LP64_OFF64,
3103
3104 _SC_XBS5_LPBIG_OFFBIG,
3105
3106
3107 _SC_XOPEN_LEGACY,
3108
3109 _SC_XOPEN_REALTIME,
3110
3111 _SC_XOPEN_REALTIME_THREADS,
3112
3113
3114 _SC_ADVISORY_INFO,
3115
3116 _SC_BARRIERS,
3117
3118 _SC_BASE,
3119
3120 _SC_C_LANG_SUPPORT,
3121
3122 _SC_C_LANG_SUPPORT_R,
3123
3124 _SC_CLOCK_SELECTION,
3125
3126 _SC_CPUTIME,
3127
3128 _SC_THREAD_CPUTIME,
3129
3130 _SC_DEVICE_IO,
3131
3132 _SC_DEVICE_SPECIFIC,
3133
3134 _SC_DEVICE_SPECIFIC_R,
3135
3136 _SC_FD_MGMT,
3137
3138 _SC_FIFO,
3139
3140 _SC_PIPE,
3141
3142 _SC_FILE_ATTRIBUTES,
3143
3144 _SC_FILE_LOCKING,
3145
3146 _SC_FILE_SYSTEM,
3147
3148 _SC_MONOTONIC_CLOCK,
3149
3150 _SC_MULTI_PROCESS,
3151
3152 _SC_SINGLE_PROCESS,
3153
3154 _SC_NETWORKING,
3155
3156 _SC_READER_WRITER_LOCKS,
3157
3158 _SC_SPIN_LOCKS,
3159
3160 _SC_REGEXP,
3161
3162 _SC_REGEX_VERSION,
3163
3164 _SC_SHELL,
3165
3166 _SC_SIGNALS,
3167
3168 _SC_SPAWN,
3169
3170 _SC_SPORADIC_SERVER,
3171
3172 _SC_THREAD_SPORADIC_SERVER,
3173
3174 _SC_SYSTEM_DATABASE,
3175
3176 _SC_SYSTEM_DATABASE_R,
3177
3178 _SC_TIMEOUTS,
3179
3180 _SC_TYPED_MEMORY_OBJECTS,
3181
3182 _SC_USER_GROUPS,
3183
3184 _SC_USER_GROUPS_R,
3185
3186 _SC_2_PBS,
3187
3188 _SC_2_PBS_ACCOUNTING,
3189
3190 _SC_2_PBS_LOCATE,
3191
3192 _SC_2_PBS_MESSAGE,
3193
3194 _SC_2_PBS_TRACK,
3195
3196 _SC_SYMLOOP_MAX,
3197
3198 _SC_STREAMS,
3199
3200 _SC_2_PBS_CHECKPOINT,
3201
3202
3203 _SC_V6_ILP32_OFF32,
3204
3205 _SC_V6_ILP32_OFFBIG,
3206
3207 _SC_V6_LP64_OFF64,
3208
3209 _SC_V6_LPBIG_OFFBIG,
3210
3211
3212 _SC_HOST_NAME_MAX,
3213
3214 _SC_TRACE,
3215
3216 _SC_TRACE_EVENT_FILTER,
3217
3218 _SC_TRACE_INHERIT,
3219
3220 _SC_TRACE_LOG,
3221
3222
3223 _SC_LEVEL1_ICACHE_SIZE,
3224
3225 _SC_LEVEL1_ICACHE_ASSOC,
3226
3227 _SC_LEVEL1_ICACHE_LINESIZE,
3228
3229 _SC_LEVEL1_DCACHE_SIZE,
3230
3231 _SC_LEVEL1_DCACHE_ASSOC,
3232
3233 _SC_LEVEL1_DCACHE_LINESIZE,
3234
3235 _SC_LEVEL2_CACHE_SIZE,
3236
3237 _SC_LEVEL2_CACHE_ASSOC,
3238
3239 _SC_LEVEL2_CACHE_LINESIZE,
3240
3241 _SC_LEVEL3_CACHE_SIZE,
3242
3243 _SC_LEVEL3_CACHE_ASSOC,
3244
3245 _SC_LEVEL3_CACHE_LINESIZE,
3246
3247 _SC_LEVEL4_CACHE_SIZE,
3248
3249 _SC_LEVEL4_CACHE_ASSOC,
3250
3251 _SC_LEVEL4_CACHE_LINESIZE,
3252
3253
3254
3255 _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
3256
3257 _SC_RAW_SOCKETS,
3258
3259
3260 _SC_V7_ILP32_OFF32,
3261
3262 _SC_V7_ILP32_OFFBIG,
3263
3264 _SC_V7_LP64_OFF64,
3265
3266 _SC_V7_LPBIG_OFFBIG,
3267
3268
3269 _SC_SS_REPL_MAX,
3270
3271
3272 _SC_TRACE_EVENT_NAME_MAX,
3273
3274 _SC_TRACE_NAME_MAX,
3275
3276 _SC_TRACE_SYS_MAX,
3277
3278 _SC_TRACE_USER_EVENT_MAX,
3279
3280
3281 _SC_XOPEN_STREAMS,
3282
3283
3284 _SC_THREAD_ROBUST_PRIO_INHERIT,
3285
3286 _SC_THREAD_ROBUST_PRIO_PROTECT
3287
3288 };
3289
3290
3291enum
3292 {
3293 _CS_PATH,
3294
3295
3296 _CS_V6_WIDTH_RESTRICTED_ENVS,
3297
3298
3299
3300 _CS_GNU_LIBC_VERSION,
3301
3302 _CS_GNU_LIBPTHREAD_VERSION,
3303
3304
3305 _CS_V5_WIDTH_RESTRICTED_ENVS,
3306
3307
3308
3309 _CS_V7_WIDTH_RESTRICTED_ENVS,
3310
3311
3312
3313 _CS_LFS_CFLAGS = 1000,
3314
3315 _CS_LFS_LDFLAGS,
3316
3317 _CS_LFS_LIBS,
3318
3319 _CS_LFS_LINTFLAGS,
3320
3321 _CS_LFS64_CFLAGS,
3322
3323 _CS_LFS64_LDFLAGS,
3324
3325 _CS_LFS64_LIBS,
3326
3327 _CS_LFS64_LINTFLAGS,
3328
3329
3330 _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
3331
3332 _CS_XBS5_ILP32_OFF32_LDFLAGS,
3333
3334 _CS_XBS5_ILP32_OFF32_LIBS,
3335
3336 _CS_XBS5_ILP32_OFF32_LINTFLAGS,
3337
3338 _CS_XBS5_ILP32_OFFBIG_CFLAGS,
3339
3340 _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
3341
3342 _CS_XBS5_ILP32_OFFBIG_LIBS,
3343
3344 _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
3345
3346 _CS_XBS5_LP64_OFF64_CFLAGS,
3347
3348 _CS_XBS5_LP64_OFF64_LDFLAGS,
3349
3350 _CS_XBS5_LP64_OFF64_LIBS,
3351
3352 _CS_XBS5_LP64_OFF64_LINTFLAGS,
3353
3354 _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
3355
3356 _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
3357
3358 _CS_XBS5_LPBIG_OFFBIG_LIBS,
3359
3360 _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
3361
3362
3363 _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
3364
3365 _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
3366
3367 _CS_POSIX_V6_ILP32_OFF32_LIBS,
3368
3369 _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
3370
3371 _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
3372
3373 _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
3374
3375 _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
3376
3377 _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
3378
3379 _CS_POSIX_V6_LP64_OFF64_CFLAGS,
3380
3381 _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
3382
3383 _CS_POSIX_V6_LP64_OFF64_LIBS,
3384
3385 _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
3386
3387 _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
3388
3389 _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
3390
3391 _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
3392
3393 _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
3394
3395
3396 _CS_POSIX_V7_ILP32_OFF32_CFLAGS,
3397
3398 _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
3399
3400 _CS_POSIX_V7_ILP32_OFF32_LIBS,
3401
3402 _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
3403
3404 _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
3405
3406 _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
3407
3408 _CS_POSIX_V7_ILP32_OFFBIG_LIBS,
3409
3410 _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
3411
3412 _CS_POSIX_V7_LP64_OFF64_CFLAGS,
3413
3414 _CS_POSIX_V7_LP64_OFF64_LDFLAGS,
3415
3416 _CS_POSIX_V7_LP64_OFF64_LIBS,
3417
3418 _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
3419
3420 _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
3421
3422 _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
3423
3424 _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
3425
3426 _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
3427
3428
3429 _CS_V6_ENV,
3430
3431 _CS_V7_ENV
3432
3433 };
3434
3435
3436extern long int pathconf (const char *__path, int __name)
3437 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
3438
3439
3440extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));
3441
3442
3443extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));
3444
3445
3446
3447extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__));
3448
3449
3450
3451
3452extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));
3453
3454
3455extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));
3456
3457
3458extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));
3459
3460
3461extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
3462
3463extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
3464
3465
3466
3467
3468
3469
3470extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
3471extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));
3472
3473
3474
3475
3476
3477
3478extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));
3479
3480
3481
3482extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
3483
3484
3485
3486extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));
3487
3488
3489extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));
3490
3491
3492extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));
3493
3494
3495extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));
3496
3497
3498
3499
3500extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__)) ;
3501extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;
3502
3503
3504
3505
3506extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;
3507
3508
3509
3510
3511extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;
3512
3513
3514
3515
3516
3517
3518extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;
3519
3520
3521
3522
3523extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;
3524
3525
3526
3527
3528extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;
3529extern __pid_t fork (void) __attribute__ ((__nothrow__));
3530
3531
3532
3533
3534
3535
3536
3537extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));
3538
3539
3540
3541
3542
3543extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));
3544
3545
3546
3547extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
3548 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
3549
3550
3551
3552extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));
3553
3554
3555
3556
3557
3558extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));
3559
3560
3561
3562
3563extern int link (const char *__from, const char *__to)
3564 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
3565
3566
3567
3568
3569extern int linkat (int __fromfd, const char *__from, int __tofd,
3570 const char *__to, int __flags)
3571 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;
3572
3573
3574
3575
3576extern int symlink (const char *__from, const char *__to)
3577 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
3578
3579
3580
3581
3582extern ssize_t readlink (const char *__restrict __path,
3583 char *__restrict __buf, size_t __len)
3584 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
3585
3586
3587
3588
3589extern int symlinkat (const char *__from, int __tofd,
3590 const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;
3591
3592
3593extern ssize_t readlinkat (int __fd, const char *__restrict __path,
3594 char *__restrict __buf, size_t __len)
3595 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))) ;
3596
3597
3598
3599extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
3600
3601
3602
3603extern int unlinkat (int __fd, const char *__name, int __flag)
3604 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
3605
3606
3607
3608extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
3609
3610
3611
3612extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));
3613
3614
3615extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));
3616
3617
3618
3619
3620
3621
3622extern char *getlogin (void);
3623
3624
3625
3626
3627
3628
3629
3630extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
3631
3632
3633
3634
3635extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
3636extern char *optarg;
3637extern int optind;
3638
3639
3640
3641
3642extern int opterr;
3643
3644
3645
3646extern int optopt;
3647extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
3648 __attribute__ ((__nothrow__ , __leaf__));
3649
3650
3651
3652
3653
3654
3655
3656extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
3657
3658
3659
3660
3661
3662
3663extern int sethostname (const char *__name, size_t __len)
3664 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
3665
3666
3667
3668extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;
3669
3670
3671
3672
3673
3674extern int getdomainname (char *__name, size_t __len)
3675 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
3676extern int setdomainname (const char *__name, size_t __len)
3677 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
3678
3679
3680
3681
3682
3683extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));
3684
3685
3686extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
3687
3688
3689
3690
3691
3692
3693
3694extern int profil (unsigned short int *__sample_buffer, size_t __size,
3695 size_t __offset, unsigned int __scale)
3696 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
3697
3698
3699
3700
3701
3702extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));
3703
3704
3705
3706extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
3707extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
3708extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));
3709
3710
3711
3712
3713
3714extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;
3715
3716
3717
3718
3719
3720
3721extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
3722
3723
3724
3725extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));
3726
3727
3728
3729
3730
3731
3732
3733extern int fsync (int __fd);
3734extern long int gethostid (void);
3735
3736
3737extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));
3738
3739
3740
3741
3742
3743extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
3744
3745
3746
3747
3748extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
3749extern int truncate (const char *__file, __off_t __length)
3750 __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
3751extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
3752extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;
3753
3754
3755
3756
3757
3758extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
3759extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
3760extern int lockf (int __fd, int __cmd, __off_t __len) ;
3761extern int fdatasync (int __fildes);
3762
3763
3764
3765
3766
3767
3768
3769
3770extern void __VERIFIER_error() __attribute__ ((__noreturn__));
3771int __VERIFIER_nondet_int(void);
3772void ldv_assert(int expression) { if (!expression) { ERROR: __VERIFIER_error();}; return; }
3773
3774pthread_t t1,t2;
3775
3776struct device {
3777
3778};
3779
3780struct A {
3781 int a;
3782 int b;
3783};
3784
3785struct my_data {
3786 pthread_mutex_t lock;
3787 struct device dev;
3788 struct A shared;
3789};
3790
3791void *my_callback(void *arg) {
3792 struct device *dev = (struct device*)arg;
3793 struct my_data *data;
3794 data = ({ const typeof( ((struct my_data *)0)->dev ) *__mptr = (dev); (struct my_data *)( (char *)__mptr - ((unsigned long) &((struct my_data *)0)->dev) );});
3795
3796
3797
3798 data->shared.a = 1;
3799 data->shared.b = data->shared.b + 1;
3800
3801}
3802
3803int my_drv_probe(struct my_data *data) {
3804 struct device *d = &data->dev;
3805
3806
3807
3808 pthread_mutex_init(&data->lock, ((void *)0));
3809 data->shared.a = 0;
3810 data->shared.b = 0;
3811
3812 int res = __VERIFIER_nondet_int();
3813 if(res)
3814 goto exit;
3815
3816 pthread_create(&t1, ((void *)0), my_callback, (void *)d);
3817 pthread_create(&t2, ((void *)0), my_callback, (void *)d);
3818 return 0;
3819
3820exit:
3821 pthread_mutex_destroy(&data->lock);
3822 return -1;
3823}
3824
3825void my_drv_disconnect(struct my_data *data) {
3826 void *status;
3827 pthread_join(t1, &status);
3828 pthread_join(t2, &status);
3829 pthread_mutex_destroy(&data->lock);
3830}
3831
3832int my_drv_init(void) {
3833 return 0;
3834}
3835
3836void my_drv_cleanup(void) {
3837 return;
3838}
3839
3840int main(void) {
3841 int ret = my_drv_init();
3842 if(ret==0) {
3843 int probe_ret;
3844 struct my_data data;
3845 probe_ret = my_drv_probe(&data);
3846 if(probe_ret==0) {
3847 my_drv_disconnect(&data);
3848 ldv_assert(data.shared.a==1);
3849 ldv_assert(data.shared.b==2);
3850 }
3851 my_drv_cleanup();
3852 data.shared.a = -1;
3853 data.shared.b = -1;
3854 ldv_assert(data.shared.a==-1);
3855 ldv_assert(data.shared.b==-1);
3856 }
3857 return 0;
3858}
Note: See TracBrowser for help on using the repository browser.