| 1 |
|
|---|
| 2 | typedef unsigned int size_t;
|
|---|
| 3 | typedef unsigned char __u_char;
|
|---|
| 4 | typedef unsigned short int __u_short;
|
|---|
| 5 | typedef unsigned int __u_int;
|
|---|
| 6 | typedef unsigned long int __u_long;
|
|---|
| 7 | typedef signed char __int8_t;
|
|---|
| 8 | typedef unsigned char __uint8_t;
|
|---|
| 9 | typedef signed short int __int16_t;
|
|---|
| 10 | typedef unsigned short int __uint16_t;
|
|---|
| 11 | typedef signed int __int32_t;
|
|---|
| 12 | typedef unsigned int __uint32_t;
|
|---|
| 13 | __extension__ typedef signed long long int __int64_t;
|
|---|
| 14 | __extension__ typedef unsigned long long int __uint64_t;
|
|---|
| 15 | __extension__ typedef long long int __quad_t;
|
|---|
| 16 | __extension__ typedef unsigned long long int __u_quad_t;
|
|---|
| 17 | __extension__ typedef __u_quad_t __dev_t;
|
|---|
| 18 | __extension__ typedef unsigned int __uid_t;
|
|---|
| 19 | __extension__ typedef unsigned int __gid_t;
|
|---|
| 20 | __extension__ typedef unsigned long int __ino_t;
|
|---|
| 21 | __extension__ typedef __u_quad_t __ino64_t;
|
|---|
| 22 | __extension__ typedef unsigned int __mode_t;
|
|---|
| 23 | __extension__ typedef unsigned int __nlink_t;
|
|---|
| 24 | __extension__ typedef long int __off_t;
|
|---|
| 25 | __extension__ typedef __quad_t __off64_t;
|
|---|
| 26 | __extension__ typedef int __pid_t;
|
|---|
| 27 | __extension__ typedef struct { int __val[2]; } __fsid_t;
|
|---|
| 28 | __extension__ typedef long int __clock_t;
|
|---|
| 29 | __extension__ typedef unsigned long int __rlim_t;
|
|---|
| 30 | __extension__ typedef __u_quad_t __rlim64_t;
|
|---|
| 31 | __extension__ typedef unsigned int __id_t;
|
|---|
| 32 | __extension__ typedef long int __time_t;
|
|---|
| 33 | __extension__ typedef unsigned int __useconds_t;
|
|---|
| 34 | __extension__ typedef long int __suseconds_t;
|
|---|
| 35 | __extension__ typedef int __daddr_t;
|
|---|
| 36 | __extension__ typedef int __key_t;
|
|---|
| 37 | __extension__ typedef int __clockid_t;
|
|---|
| 38 | __extension__ typedef void * __timer_t;
|
|---|
| 39 | __extension__ typedef long int __blksize_t;
|
|---|
| 40 | __extension__ typedef long int __blkcnt_t;
|
|---|
| 41 | __extension__ typedef __quad_t __blkcnt64_t;
|
|---|
| 42 | __extension__ typedef unsigned long int __fsblkcnt_t;
|
|---|
| 43 | __extension__ typedef __u_quad_t __fsblkcnt64_t;
|
|---|
| 44 | __extension__ typedef unsigned long int __fsfilcnt_t;
|
|---|
| 45 | __extension__ typedef __u_quad_t __fsfilcnt64_t;
|
|---|
| 46 | __extension__ typedef int __fsword_t;
|
|---|
| 47 | __extension__ typedef int __ssize_t;
|
|---|
| 48 | __extension__ typedef long int __syscall_slong_t;
|
|---|
| 49 | __extension__ typedef unsigned long int __syscall_ulong_t;
|
|---|
| 50 | typedef __off64_t __loff_t;
|
|---|
| 51 | typedef __quad_t *__qaddr_t;
|
|---|
| 52 | typedef char *__caddr_t;
|
|---|
| 53 | __extension__ typedef int __intptr_t;
|
|---|
| 54 | __extension__ typedef unsigned int __socklen_t;
|
|---|
| 55 | struct _IO_FILE;
|
|---|
| 56 |
|
|---|
| 57 | typedef struct _IO_FILE FILE;
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 | typedef struct _IO_FILE __FILE;
|
|---|
| 61 | typedef struct
|
|---|
| 62 | {
|
|---|
| 63 | int __count;
|
|---|
| 64 | union
|
|---|
| 65 | {
|
|---|
| 66 | unsigned int __wch;
|
|---|
| 67 | char __wchb[4];
|
|---|
| 68 | } __value;
|
|---|
| 69 | } __mbstate_t;
|
|---|
| 70 | typedef struct
|
|---|
| 71 | {
|
|---|
| 72 | __off_t __pos;
|
|---|
| 73 | __mbstate_t __state;
|
|---|
| 74 | } _G_fpos_t;
|
|---|
| 75 | typedef struct
|
|---|
| 76 | {
|
|---|
| 77 | __off64_t __pos;
|
|---|
| 78 | __mbstate_t __state;
|
|---|
| 79 | } _G_fpos64_t;
|
|---|
| 80 | typedef __builtin_va_list __gnuc_va_list;
|
|---|
| 81 | struct _IO_jump_t; struct _IO_FILE;
|
|---|
| 82 | typedef void _IO_lock_t;
|
|---|
| 83 | struct _IO_marker {
|
|---|
| 84 | struct _IO_marker *_next;
|
|---|
| 85 | struct _IO_FILE *_sbuf;
|
|---|
| 86 | int _pos;
|
|---|
| 87 | };
|
|---|
| 88 | enum __codecvt_result
|
|---|
| 89 | {
|
|---|
| 90 | __codecvt_ok,
|
|---|
| 91 | __codecvt_partial,
|
|---|
| 92 | __codecvt_error,
|
|---|
| 93 | __codecvt_noconv
|
|---|
| 94 | };
|
|---|
| 95 | struct _IO_FILE {
|
|---|
| 96 | int _flags;
|
|---|
| 97 | char* _IO_read_ptr;
|
|---|
| 98 | char* _IO_read_end;
|
|---|
| 99 | char* _IO_read_base;
|
|---|
| 100 | char* _IO_write_base;
|
|---|
| 101 | char* _IO_write_ptr;
|
|---|
| 102 | char* _IO_write_end;
|
|---|
| 103 | char* _IO_buf_base;
|
|---|
| 104 | char* _IO_buf_end;
|
|---|
| 105 | char *_IO_save_base;
|
|---|
| 106 | char *_IO_backup_base;
|
|---|
| 107 | char *_IO_save_end;
|
|---|
| 108 | struct _IO_marker *_markers;
|
|---|
| 109 | struct _IO_FILE *_chain;
|
|---|
| 110 | int _fileno;
|
|---|
| 111 | int _flags2;
|
|---|
| 112 | __off_t _old_offset;
|
|---|
| 113 | unsigned short _cur_column;
|
|---|
| 114 | signed char _vtable_offset;
|
|---|
| 115 | char _shortbuf[1];
|
|---|
| 116 | _IO_lock_t *_lock;
|
|---|
| 117 | __off64_t _offset;
|
|---|
| 118 | void *__pad1;
|
|---|
| 119 | void *__pad2;
|
|---|
| 120 | void *__pad3;
|
|---|
| 121 | void *__pad4;
|
|---|
| 122 | size_t __pad5;
|
|---|
| 123 | int _mode;
|
|---|
| 124 | char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
|
|---|
| 125 | };
|
|---|
| 126 | typedef struct _IO_FILE _IO_FILE;
|
|---|
| 127 | struct _IO_FILE_plus;
|
|---|
| 128 | extern struct _IO_FILE_plus _IO_2_1_stdin_;
|
|---|
| 129 | extern struct _IO_FILE_plus _IO_2_1_stdout_;
|
|---|
| 130 | extern struct _IO_FILE_plus _IO_2_1_stderr_;
|
|---|
| 131 | typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
|
|---|
| 132 | typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,
|
|---|
| 133 | size_t __n);
|
|---|
| 134 | typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
|
|---|
| 135 | typedef int __io_close_fn (void *__cookie);
|
|---|
| 136 | extern int __underflow (_IO_FILE *);
|
|---|
| 137 | extern int __uflow (_IO_FILE *);
|
|---|
| 138 | extern int __overflow (_IO_FILE *, int);
|
|---|
| 139 | extern int _IO_getc (_IO_FILE *__fp);
|
|---|
| 140 | extern int _IO_putc (int __c, _IO_FILE *__fp);
|
|---|
| 141 | extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 142 | extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 143 | extern int _IO_peekc_locked (_IO_FILE *__fp);
|
|---|
| 144 | extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 145 | extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 146 | extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 147 | extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
|
|---|
| 148 | __gnuc_va_list, int *__restrict);
|
|---|
| 149 | extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
|
|---|
| 150 | __gnuc_va_list);
|
|---|
| 151 | extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
|
|---|
| 152 | extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
|
|---|
| 153 | extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
|
|---|
| 154 | extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
|
|---|
| 155 | extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 156 | typedef __gnuc_va_list va_list;
|
|---|
| 157 | typedef __off_t off_t;
|
|---|
| 158 | typedef __ssize_t ssize_t;
|
|---|
| 159 |
|
|---|
| 160 | typedef _G_fpos_t fpos_t;
|
|---|
| 161 |
|
|---|
| 162 | extern struct _IO_FILE *stdin;
|
|---|
| 163 | extern struct _IO_FILE *stdout;
|
|---|
| 164 | extern struct _IO_FILE *stderr;
|
|---|
| 165 |
|
|---|
| 166 | extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 167 | extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 168 |
|
|---|
| 169 | extern int renameat (int __oldfd, const char *__old, int __newfd,
|
|---|
| 170 | const char *__new) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 171 |
|
|---|
| 172 | extern FILE *tmpfile (void) ;
|
|---|
| 173 | extern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 174 |
|
|---|
| 175 | extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 176 | extern char *tempnam (const char *__dir, const char *__pfx)
|
|---|
| 177 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
|
|---|
| 178 |
|
|---|
| 179 | extern int fclose (FILE *__stream);
|
|---|
| 180 | extern int fflush (FILE *__stream);
|
|---|
| 181 |
|
|---|
| 182 | extern int fflush_unlocked (FILE *__stream);
|
|---|
| 183 |
|
|---|
| 184 | extern FILE *fopen (const char *__restrict __filename,
|
|---|
| 185 | const char *__restrict __modes) ;
|
|---|
| 186 | extern FILE *freopen (const char *__restrict __filename,
|
|---|
| 187 | const char *__restrict __modes,
|
|---|
| 188 | FILE *__restrict __stream) ;
|
|---|
| 189 |
|
|---|
| 190 | extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 191 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
|
|---|
| 192 | __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 193 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 194 |
|
|---|
| 195 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 196 | extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
|
|---|
| 197 | int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 198 |
|
|---|
| 199 | extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
|
|---|
| 200 | size_t __size) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 201 | extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 202 |
|
|---|
| 203 | extern int fprintf (FILE *__restrict __stream,
|
|---|
| 204 | const char *__restrict __format, ...);
|
|---|
| 205 | extern int printf (const char *__restrict __format, ...);
|
|---|
| 206 | extern int sprintf (char *__restrict __s,
|
|---|
| 207 | const char *__restrict __format, ...) __attribute__ ((__nothrow__));
|
|---|
| 208 | extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
|
|---|
| 209 | __gnuc_va_list __arg);
|
|---|
| 210 | extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
|
|---|
| 211 | extern int vsprintf (char *__restrict __s, const char *__restrict __format,
|
|---|
| 212 | __gnuc_va_list __arg) __attribute__ ((__nothrow__));
|
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 | extern int snprintf (char *__restrict __s, size_t __maxlen,
|
|---|
| 216 | const char *__restrict __format, ...)
|
|---|
| 217 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
|
|---|
| 218 | extern int vsnprintf (char *__restrict __s, size_t __maxlen,
|
|---|
| 219 | const char *__restrict __format, __gnuc_va_list __arg)
|
|---|
| 220 | __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
|
|---|
| 221 |
|
|---|
| 222 | extern int vdprintf (int __fd, const char *__restrict __fmt,
|
|---|
| 223 | __gnuc_va_list __arg)
|
|---|
| 224 | __attribute__ ((__format__ (__printf__, 2, 0)));
|
|---|
| 225 | extern int dprintf (int __fd, const char *__restrict __fmt, ...)
|
|---|
| 226 | __attribute__ ((__format__ (__printf__, 2, 3)));
|
|---|
| 227 |
|
|---|
| 228 | extern int fscanf (FILE *__restrict __stream,
|
|---|
| 229 | const char *__restrict __format, ...) ;
|
|---|
| 230 | extern int scanf (const char *__restrict __format, ...) ;
|
|---|
| 231 | extern int sscanf (const char *__restrict __s,
|
|---|
| 232 | const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 233 | extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") ;
|
|---|
| 234 | extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") ;
|
|---|
| 235 | extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 | extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
|
|---|
| 239 | __gnuc_va_list __arg)
|
|---|
| 240 | __attribute__ ((__format__ (__scanf__, 2, 0))) ;
|
|---|
| 241 | extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
|
|---|
| 242 | __attribute__ ((__format__ (__scanf__, 1, 0))) ;
|
|---|
| 243 | extern int vsscanf (const char *__restrict __s,
|
|---|
| 244 | const char *__restrict __format, __gnuc_va_list __arg)
|
|---|
| 245 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
|
|---|
| 246 | extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
|
|---|
| 247 | __attribute__ ((__format__ (__scanf__, 2, 0))) ;
|
|---|
| 248 | extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
|
|---|
| 249 | __attribute__ ((__format__ (__scanf__, 1, 0))) ;
|
|---|
| 250 | extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__))
|
|---|
| 251 | __attribute__ ((__format__ (__scanf__, 2, 0)));
|
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 | extern int fgetc (FILE *__stream);
|
|---|
| 255 | extern int getc (FILE *__stream);
|
|---|
| 256 | extern int getchar (void);
|
|---|
| 257 |
|
|---|
| 258 | extern int getc_unlocked (FILE *__stream);
|
|---|
| 259 | extern int getchar_unlocked (void);
|
|---|
| 260 | extern int fgetc_unlocked (FILE *__stream);
|
|---|
| 261 |
|
|---|
| 262 | extern int fputc (int __c, FILE *__stream);
|
|---|
| 263 | extern int putc (int __c, FILE *__stream);
|
|---|
| 264 | extern int putchar (int __c);
|
|---|
| 265 |
|
|---|
| 266 | extern int fputc_unlocked (int __c, FILE *__stream);
|
|---|
| 267 | extern int putc_unlocked (int __c, FILE *__stream);
|
|---|
| 268 | extern int putchar_unlocked (int __c);
|
|---|
| 269 | extern int getw (FILE *__stream);
|
|---|
| 270 | extern int putw (int __w, FILE *__stream);
|
|---|
| 271 |
|
|---|
| 272 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
|
|---|
| 273 | ;
|
|---|
| 274 |
|
|---|
| 275 | extern __ssize_t __getdelim (char **__restrict __lineptr,
|
|---|
| 276 | size_t *__restrict __n, int __delimiter,
|
|---|
| 277 | FILE *__restrict __stream) ;
|
|---|
| 278 | extern __ssize_t getdelim (char **__restrict __lineptr,
|
|---|
| 279 | size_t *__restrict __n, int __delimiter,
|
|---|
| 280 | FILE *__restrict __stream) ;
|
|---|
| 281 | extern __ssize_t getline (char **__restrict __lineptr,
|
|---|
| 282 | size_t *__restrict __n,
|
|---|
| 283 | FILE *__restrict __stream) ;
|
|---|
| 284 |
|
|---|
| 285 | extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
|
|---|
| 286 | extern int puts (const char *__s);
|
|---|
| 287 | extern int ungetc (int __c, FILE *__stream);
|
|---|
| 288 | extern size_t fread (void *__restrict __ptr, size_t __size,
|
|---|
| 289 | size_t __n, FILE *__restrict __stream) ;
|
|---|
| 290 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
|
|---|
| 291 | size_t __n, FILE *__restrict __s);
|
|---|
| 292 |
|
|---|
| 293 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
|
|---|
| 294 | size_t __n, FILE *__restrict __stream) ;
|
|---|
| 295 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
|
|---|
| 296 | size_t __n, FILE *__restrict __stream);
|
|---|
| 297 |
|
|---|
| 298 | extern int fseek (FILE *__stream, long int __off, int __whence);
|
|---|
| 299 | extern long int ftell (FILE *__stream) ;
|
|---|
| 300 | extern void rewind (FILE *__stream);
|
|---|
| 301 |
|
|---|
| 302 | extern int fseeko (FILE *__stream, __off_t __off, int __whence);
|
|---|
| 303 | extern __off_t ftello (FILE *__stream) ;
|
|---|
| 304 |
|
|---|
| 305 | extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
|
|---|
| 306 | extern int fsetpos (FILE *__stream, const fpos_t *__pos);
|
|---|
| 307 |
|
|---|
| 308 |
|
|---|
| 309 | extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 310 | extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 311 | extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 312 |
|
|---|
| 313 | extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 314 | extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 315 | extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 316 |
|
|---|
| 317 | extern void perror (const char *__s);
|
|---|
| 318 |
|
|---|
| 319 | extern int sys_nerr;
|
|---|
| 320 | extern const char *const sys_errlist[];
|
|---|
| 321 | extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 322 | extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 323 | extern FILE *popen (const char *__command, const char *__modes) ;
|
|---|
| 324 | extern int pclose (FILE *__stream);
|
|---|
| 325 | extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 326 | extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 327 | extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 328 | extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 329 |
|
|---|
| 330 | typedef long int wchar_t;
|
|---|
| 331 |
|
|---|
| 332 | typedef enum
|
|---|
| 333 | {
|
|---|
| 334 | P_ALL,
|
|---|
| 335 | P_PID,
|
|---|
| 336 | P_PGID
|
|---|
| 337 | } idtype_t;
|
|---|
| 338 | static __inline unsigned int
|
|---|
| 339 | __bswap_32 (unsigned int __bsx)
|
|---|
| 340 | {
|
|---|
| 341 | return __builtin_bswap32 (__bsx);
|
|---|
| 342 | }
|
|---|
| 343 | static __inline __uint64_t
|
|---|
| 344 | __bswap_64 (__uint64_t __bsx)
|
|---|
| 345 | {
|
|---|
| 346 | return __builtin_bswap64 (__bsx);
|
|---|
| 347 | }
|
|---|
| 348 | union wait
|
|---|
| 349 | {
|
|---|
| 350 | int w_status;
|
|---|
| 351 | struct
|
|---|
| 352 | {
|
|---|
| 353 | unsigned int __w_termsig:7;
|
|---|
| 354 | unsigned int __w_coredump:1;
|
|---|
| 355 | unsigned int __w_retcode:8;
|
|---|
| 356 | unsigned int:16;
|
|---|
| 357 | } __wait_terminated;
|
|---|
| 358 | struct
|
|---|
| 359 | {
|
|---|
| 360 | unsigned int __w_stopval:8;
|
|---|
| 361 | unsigned int __w_stopsig:8;
|
|---|
| 362 | unsigned int:16;
|
|---|
| 363 | } __wait_stopped;
|
|---|
| 364 | };
|
|---|
| 365 | typedef union
|
|---|
| 366 | {
|
|---|
| 367 | union wait *__uptr;
|
|---|
| 368 | int *__iptr;
|
|---|
| 369 | } __WAIT_STATUS __attribute__ ((__transparent_union__));
|
|---|
| 370 |
|
|---|
| 371 | typedef struct
|
|---|
| 372 | {
|
|---|
| 373 | int quot;
|
|---|
| 374 | int rem;
|
|---|
| 375 | } div_t;
|
|---|
| 376 | typedef struct
|
|---|
| 377 | {
|
|---|
| 378 | long int quot;
|
|---|
| 379 | long int rem;
|
|---|
| 380 | } ldiv_t;
|
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 | __extension__ typedef struct
|
|---|
| 384 | {
|
|---|
| 385 | long long int quot;
|
|---|
| 386 | long long int rem;
|
|---|
| 387 | } lldiv_t;
|
|---|
| 388 |
|
|---|
| 389 | extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 390 |
|
|---|
| 391 | extern double atof (const char *__nptr)
|
|---|
| 392 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 393 | extern int atoi (const char *__nptr)
|
|---|
| 394 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 395 | extern long int atol (const char *__nptr)
|
|---|
| 396 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 397 |
|
|---|
| 398 |
|
|---|
| 399 | __extension__ extern long long int atoll (const char *__nptr)
|
|---|
| 400 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 401 |
|
|---|
| 402 |
|
|---|
| 403 | extern double strtod (const char *__restrict __nptr,
|
|---|
| 404 | char **__restrict __endptr)
|
|---|
| 405 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 406 |
|
|---|
| 407 |
|
|---|
| 408 | extern float strtof (const char *__restrict __nptr,
|
|---|
| 409 | char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 410 | extern long double strtold (const char *__restrict __nptr,
|
|---|
| 411 | char **__restrict __endptr)
|
|---|
| 412 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 413 |
|
|---|
| 414 |
|
|---|
| 415 | extern long int strtol (const char *__restrict __nptr,
|
|---|
| 416 | char **__restrict __endptr, int __base)
|
|---|
| 417 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 418 | extern unsigned long int strtoul (const char *__restrict __nptr,
|
|---|
| 419 | char **__restrict __endptr, int __base)
|
|---|
| 420 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 421 |
|
|---|
| 422 | __extension__
|
|---|
| 423 | extern long long int strtoq (const char *__restrict __nptr,
|
|---|
| 424 | char **__restrict __endptr, int __base)
|
|---|
| 425 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 426 | __extension__
|
|---|
| 427 | extern unsigned long long int strtouq (const char *__restrict __nptr,
|
|---|
| 428 | char **__restrict __endptr, int __base)
|
|---|
| 429 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 430 |
|
|---|
| 431 | __extension__
|
|---|
| 432 | extern long long int strtoll (const char *__restrict __nptr,
|
|---|
| 433 | char **__restrict __endptr, int __base)
|
|---|
| 434 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 435 | __extension__
|
|---|
| 436 | extern unsigned long long int strtoull (const char *__restrict __nptr,
|
|---|
| 437 | char **__restrict __endptr, int __base)
|
|---|
| 438 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 439 |
|
|---|
| 440 | extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 441 | extern long int a64l (const char *__s)
|
|---|
| 442 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 443 |
|
|---|
| 444 | typedef __u_char u_char;
|
|---|
| 445 | typedef __u_short u_short;
|
|---|
| 446 | typedef __u_int u_int;
|
|---|
| 447 | typedef __u_long u_long;
|
|---|
| 448 | typedef __quad_t quad_t;
|
|---|
| 449 | typedef __u_quad_t u_quad_t;
|
|---|
| 450 | typedef __fsid_t fsid_t;
|
|---|
| 451 | typedef __loff_t loff_t;
|
|---|
| 452 | typedef __ino_t ino_t;
|
|---|
| 453 | typedef __dev_t dev_t;
|
|---|
| 454 | typedef __gid_t gid_t;
|
|---|
| 455 | typedef __mode_t mode_t;
|
|---|
| 456 | typedef __nlink_t nlink_t;
|
|---|
| 457 | typedef __uid_t uid_t;
|
|---|
| 458 | typedef __pid_t pid_t;
|
|---|
| 459 | typedef __id_t id_t;
|
|---|
| 460 | typedef __daddr_t daddr_t;
|
|---|
| 461 | typedef __caddr_t caddr_t;
|
|---|
| 462 | typedef __key_t key_t;
|
|---|
| 463 |
|
|---|
| 464 | typedef __clock_t clock_t;
|
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 | typedef __time_t time_t;
|
|---|
| 469 |
|
|---|
| 470 |
|
|---|
| 471 | typedef __clockid_t clockid_t;
|
|---|
| 472 | typedef __timer_t timer_t;
|
|---|
| 473 | typedef unsigned long int ulong;
|
|---|
| 474 | typedef unsigned short int ushort;
|
|---|
| 475 | typedef unsigned int uint;
|
|---|
| 476 | typedef int int8_t __attribute__ ((__mode__ (__QI__)));
|
|---|
| 477 | typedef int int16_t __attribute__ ((__mode__ (__HI__)));
|
|---|
| 478 | typedef int int32_t __attribute__ ((__mode__ (__SI__)));
|
|---|
| 479 | typedef int int64_t __attribute__ ((__mode__ (__DI__)));
|
|---|
| 480 | typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
|
|---|
| 481 | typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
|
|---|
| 482 | typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
|
|---|
| 483 | typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
|
|---|
| 484 | typedef int register_t __attribute__ ((__mode__ (__word__)));
|
|---|
| 485 | typedef int __sig_atomic_t;
|
|---|
| 486 | typedef struct
|
|---|
| 487 | {
|
|---|
| 488 | unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
|
|---|
| 489 | } __sigset_t;
|
|---|
| 490 | typedef __sigset_t sigset_t;
|
|---|
| 491 | struct timespec
|
|---|
| 492 | {
|
|---|
| 493 | __time_t tv_sec;
|
|---|
| 494 | __syscall_slong_t tv_nsec;
|
|---|
| 495 | };
|
|---|
| 496 | struct timeval
|
|---|
| 497 | {
|
|---|
| 498 | __time_t tv_sec;
|
|---|
| 499 | __suseconds_t tv_usec;
|
|---|
| 500 | };
|
|---|
| 501 | typedef __suseconds_t suseconds_t;
|
|---|
| 502 | typedef long int __fd_mask;
|
|---|
| 503 | typedef struct
|
|---|
| 504 | {
|
|---|
| 505 | __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
|
|---|
| 506 | } fd_set;
|
|---|
| 507 | typedef __fd_mask fd_mask;
|
|---|
| 508 |
|
|---|
| 509 | extern int select (int __nfds, fd_set *__restrict __readfds,
|
|---|
| 510 | fd_set *__restrict __writefds,
|
|---|
| 511 | fd_set *__restrict __exceptfds,
|
|---|
| 512 | struct timeval *__restrict __timeout);
|
|---|
| 513 | extern int pselect (int __nfds, fd_set *__restrict __readfds,
|
|---|
| 514 | fd_set *__restrict __writefds,
|
|---|
| 515 | fd_set *__restrict __exceptfds,
|
|---|
| 516 | const struct timespec *__restrict __timeout,
|
|---|
| 517 | const __sigset_t *__restrict __sigmask);
|
|---|
| 518 |
|
|---|
| 519 |
|
|---|
| 520 | __extension__
|
|---|
| 521 | extern unsigned int gnu_dev_major (unsigned long long int __dev)
|
|---|
| 522 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 523 | __extension__
|
|---|
| 524 | extern unsigned int gnu_dev_minor (unsigned long long int __dev)
|
|---|
| 525 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 526 | __extension__
|
|---|
| 527 | extern unsigned long long int gnu_dev_makedev (unsigned int __major,
|
|---|
| 528 | unsigned int __minor)
|
|---|
| 529 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 530 |
|
|---|
| 531 | typedef __blksize_t blksize_t;
|
|---|
| 532 | typedef __blkcnt_t blkcnt_t;
|
|---|
| 533 | typedef __fsblkcnt_t fsblkcnt_t;
|
|---|
| 534 | typedef __fsfilcnt_t fsfilcnt_t;
|
|---|
| 535 | typedef unsigned long int pthread_t;
|
|---|
| 536 | union pthread_attr_t
|
|---|
| 537 | {
|
|---|
| 538 | char __size[36];
|
|---|
| 539 | long int __align;
|
|---|
| 540 | };
|
|---|
| 541 | typedef union pthread_attr_t pthread_attr_t;
|
|---|
| 542 | typedef struct __pthread_internal_slist
|
|---|
| 543 | {
|
|---|
| 544 | struct __pthread_internal_slist *__next;
|
|---|
| 545 | } __pthread_slist_t;
|
|---|
| 546 | typedef union
|
|---|
| 547 | {
|
|---|
| 548 | struct __pthread_mutex_s
|
|---|
| 549 | {
|
|---|
| 550 | int __lock;
|
|---|
| 551 | unsigned int __count;
|
|---|
| 552 | int __owner;
|
|---|
| 553 | int __kind;
|
|---|
| 554 | unsigned int __nusers;
|
|---|
| 555 | __extension__ union
|
|---|
| 556 | {
|
|---|
| 557 | struct
|
|---|
| 558 | {
|
|---|
| 559 | short __espins;
|
|---|
| 560 | short __elision;
|
|---|
| 561 | } __elision_data;
|
|---|
| 562 | __pthread_slist_t __list;
|
|---|
| 563 | };
|
|---|
| 564 | } __data;
|
|---|
| 565 | char __size[24];
|
|---|
| 566 | long int __align;
|
|---|
| 567 | } pthread_mutex_t;
|
|---|
| 568 | typedef union
|
|---|
| 569 | {
|
|---|
| 570 | char __size[4];
|
|---|
| 571 | int __align;
|
|---|
| 572 | } pthread_mutexattr_t;
|
|---|
| 573 | typedef union
|
|---|
| 574 | {
|
|---|
| 575 | struct
|
|---|
| 576 | {
|
|---|
| 577 | int __lock;
|
|---|
| 578 | unsigned int __futex;
|
|---|
| 579 | __extension__ unsigned long long int __total_seq;
|
|---|
| 580 | __extension__ unsigned long long int __wakeup_seq;
|
|---|
| 581 | __extension__ unsigned long long int __woken_seq;
|
|---|
| 582 | void *__mutex;
|
|---|
| 583 | unsigned int __nwaiters;
|
|---|
| 584 | unsigned int __broadcast_seq;
|
|---|
| 585 | } __data;
|
|---|
| 586 | char __size[48];
|
|---|
| 587 | __extension__ long long int __align;
|
|---|
| 588 | } pthread_cond_t;
|
|---|
| 589 | typedef union
|
|---|
| 590 | {
|
|---|
| 591 | char __size[4];
|
|---|
| 592 | int __align;
|
|---|
| 593 | } pthread_condattr_t;
|
|---|
| 594 | typedef unsigned int pthread_key_t;
|
|---|
| 595 | typedef int pthread_once_t;
|
|---|
| 596 | typedef union
|
|---|
| 597 | {
|
|---|
| 598 | struct
|
|---|
| 599 | {
|
|---|
| 600 | int __lock;
|
|---|
| 601 | unsigned int __nr_readers;
|
|---|
| 602 | unsigned int __readers_wakeup;
|
|---|
| 603 | unsigned int __writer_wakeup;
|
|---|
| 604 | unsigned int __nr_readers_queued;
|
|---|
| 605 | unsigned int __nr_writers_queued;
|
|---|
| 606 | unsigned char __flags;
|
|---|
| 607 | unsigned char __shared;
|
|---|
| 608 | signed char __rwelision;
|
|---|
| 609 | unsigned char __pad2;
|
|---|
| 610 | int __writer;
|
|---|
| 611 | } __data;
|
|---|
| 612 | char __size[32];
|
|---|
| 613 | long int __align;
|
|---|
| 614 | } pthread_rwlock_t;
|
|---|
| 615 | typedef union
|
|---|
| 616 | {
|
|---|
| 617 | char __size[8];
|
|---|
| 618 | long int __align;
|
|---|
| 619 | } pthread_rwlockattr_t;
|
|---|
| 620 | typedef volatile int pthread_spinlock_t;
|
|---|
| 621 | typedef union
|
|---|
| 622 | {
|
|---|
| 623 | char __size[20];
|
|---|
| 624 | long int __align;
|
|---|
| 625 | } pthread_barrier_t;
|
|---|
| 626 | typedef union
|
|---|
| 627 | {
|
|---|
| 628 | char __size[4];
|
|---|
| 629 | int __align;
|
|---|
| 630 | } pthread_barrierattr_t;
|
|---|
| 631 |
|
|---|
| 632 | extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 633 | extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 634 | extern char *initstate (unsigned int __seed, char *__statebuf,
|
|---|
| 635 | size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 636 | extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 637 | struct random_data
|
|---|
| 638 | {
|
|---|
| 639 | int32_t *fptr;
|
|---|
| 640 | int32_t *rptr;
|
|---|
| 641 | int32_t *state;
|
|---|
| 642 | int rand_type;
|
|---|
| 643 | int rand_deg;
|
|---|
| 644 | int rand_sep;
|
|---|
| 645 | int32_t *end_ptr;
|
|---|
| 646 | };
|
|---|
| 647 | extern int random_r (struct random_data *__restrict __buf,
|
|---|
| 648 | int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 649 | extern int srandom_r (unsigned int __seed, struct random_data *__buf)
|
|---|
| 650 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 651 | extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
|
|---|
| 652 | size_t __statelen,
|
|---|
| 653 | struct random_data *__restrict __buf)
|
|---|
| 654 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
|
|---|
| 655 | extern int setstate_r (char *__restrict __statebuf,
|
|---|
| 656 | struct random_data *__restrict __buf)
|
|---|
| 657 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 658 |
|
|---|
| 659 | extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 660 | extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 661 |
|
|---|
| 662 | extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 663 | extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 664 | extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 665 | extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 666 | extern long int nrand48 (unsigned short int __xsubi[3])
|
|---|
| 667 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 668 | extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 669 | extern long int jrand48 (unsigned short int __xsubi[3])
|
|---|
| 670 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 671 | extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 672 | extern unsigned short int *seed48 (unsigned short int __seed16v[3])
|
|---|
| 673 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 674 | extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 675 | struct drand48_data
|
|---|
| 676 | {
|
|---|
| 677 | unsigned short int __x[3];
|
|---|
| 678 | unsigned short int __old_x[3];
|
|---|
| 679 | unsigned short int __c;
|
|---|
| 680 | unsigned short int __init;
|
|---|
| 681 | __extension__ unsigned long long int __a;
|
|---|
| 682 | };
|
|---|
| 683 | extern int drand48_r (struct drand48_data *__restrict __buffer,
|
|---|
| 684 | double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 685 | extern int erand48_r (unsigned short int __xsubi[3],
|
|---|
| 686 | struct drand48_data *__restrict __buffer,
|
|---|
| 687 | double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 688 | extern int lrand48_r (struct drand48_data *__restrict __buffer,
|
|---|
| 689 | long int *__restrict __result)
|
|---|
| 690 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 691 | extern int nrand48_r (unsigned short int __xsubi[3],
|
|---|
| 692 | struct drand48_data *__restrict __buffer,
|
|---|
| 693 | long int *__restrict __result)
|
|---|
| 694 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 695 | extern int mrand48_r (struct drand48_data *__restrict __buffer,
|
|---|
| 696 | long int *__restrict __result)
|
|---|
| 697 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 698 | extern int jrand48_r (unsigned short int __xsubi[3],
|
|---|
| 699 | struct drand48_data *__restrict __buffer,
|
|---|
| 700 | long int *__restrict __result)
|
|---|
| 701 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 702 | extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
|
|---|
| 703 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 704 | extern int seed48_r (unsigned short int __seed16v[3],
|
|---|
| 705 | struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 706 | extern int lcong48_r (unsigned short int __param[7],
|
|---|
| 707 | struct drand48_data *__buffer)
|
|---|
| 708 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 709 |
|
|---|
| 710 | extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
|
|---|
| 711 | extern void *calloc (size_t __nmemb, size_t __size)
|
|---|
| 712 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
|
|---|
| 713 |
|
|---|
| 714 |
|
|---|
| 715 | extern void *realloc (void *__ptr, size_t __size)
|
|---|
| 716 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__));
|
|---|
| 717 | extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 718 |
|
|---|
| 719 | extern void cfree (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 720 |
|
|---|
| 721 | extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 722 |
|
|---|
| 723 | extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
|
|---|
| 724 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
|
|---|
| 725 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 726 | extern void *aligned_alloc (size_t __alignment, size_t __size)
|
|---|
| 727 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ;
|
|---|
| 728 |
|
|---|
| 729 | extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 730 | extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 731 | extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 732 |
|
|---|
| 733 | extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
|
|---|
| 734 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 735 |
|
|---|
| 736 | extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 737 | extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 738 |
|
|---|
| 739 |
|
|---|
| 740 | extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 741 |
|
|---|
| 742 |
|
|---|
| 743 | extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 744 |
|
|---|
| 745 | extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 746 | extern int setenv (const char *__name, const char *__value, int __replace)
|
|---|
| 747 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 748 | extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 749 | extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 750 | extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 751 | extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 752 | extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 753 | extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 754 |
|
|---|
| 755 | extern int system (const char *__command) ;
|
|---|
| 756 |
|
|---|
| 757 | extern char *realpath (const char *__restrict __name,
|
|---|
| 758 | char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 759 | typedef int (*__compar_fn_t) (const void *, const void *);
|
|---|
| 760 |
|
|---|
| 761 | extern void *bsearch (const void *__key, const void *__base,
|
|---|
| 762 | size_t __nmemb, size_t __size, __compar_fn_t __compar)
|
|---|
| 763 | __attribute__ ((__nonnull__ (1, 2, 5))) ;
|
|---|
| 764 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
|
|---|
| 765 | __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
|
|---|
| 766 | extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 767 | extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 768 |
|
|---|
| 769 | __extension__ extern long long int llabs (long long int __x)
|
|---|
| 770 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 771 |
|
|---|
| 772 | extern div_t div (int __numer, int __denom)
|
|---|
| 773 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 774 | extern ldiv_t ldiv (long int __numer, long int __denom)
|
|---|
| 775 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 776 |
|
|---|
| 777 |
|
|---|
| 778 | __extension__ extern lldiv_t lldiv (long long int __numer,
|
|---|
| 779 | long long int __denom)
|
|---|
| 780 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 781 |
|
|---|
| 782 | extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
|
|---|
| 783 | int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
|
|---|
| 784 | extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
|
|---|
| 785 | int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
|
|---|
| 786 | extern char *gcvt (double __value, int __ndigit, char *__buf)
|
|---|
| 787 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
|
|---|
| 788 | extern char *qecvt (long double __value, int __ndigit,
|
|---|
| 789 | int *__restrict __decpt, int *__restrict __sign)
|
|---|
| 790 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
|
|---|
| 791 | extern char *qfcvt (long double __value, int __ndigit,
|
|---|
| 792 | int *__restrict __decpt, int *__restrict __sign)
|
|---|
| 793 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
|
|---|
| 794 | extern char *qgcvt (long double __value, int __ndigit, char *__buf)
|
|---|
| 795 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
|
|---|
| 796 | extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
|
|---|
| 797 | int *__restrict __sign, char *__restrict __buf,
|
|---|
| 798 | size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
|
|---|
| 799 | extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
|
|---|
| 800 | int *__restrict __sign, char *__restrict __buf,
|
|---|
| 801 | size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
|
|---|
| 802 | extern int qecvt_r (long double __value, int __ndigit,
|
|---|
| 803 | int *__restrict __decpt, int *__restrict __sign,
|
|---|
| 804 | char *__restrict __buf, size_t __len)
|
|---|
| 805 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
|
|---|
| 806 | extern int qfcvt_r (long double __value, int __ndigit,
|
|---|
| 807 | int *__restrict __decpt, int *__restrict __sign,
|
|---|
| 808 | char *__restrict __buf, size_t __len)
|
|---|
| 809 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
|
|---|
| 810 |
|
|---|
| 811 | extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 812 | extern int mbtowc (wchar_t *__restrict __pwc,
|
|---|
| 813 | const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 814 | extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 815 | extern size_t mbstowcs (wchar_t *__restrict __pwcs,
|
|---|
| 816 | const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 817 | extern size_t wcstombs (char *__restrict __s,
|
|---|
| 818 | const wchar_t *__restrict __pwcs, size_t __n)
|
|---|
| 819 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 820 |
|
|---|
| 821 | extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 822 | extern int getsubopt (char **__restrict __optionp,
|
|---|
| 823 | char *const *__restrict __tokens,
|
|---|
| 824 | char **__restrict __valuep)
|
|---|
| 825 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
|
|---|
| 826 | extern int getloadavg (double __loadavg[], int __nelem)
|
|---|
| 827 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 828 |
|
|---|
| 829 | struct sched_param
|
|---|
| 830 | {
|
|---|
| 831 | int __sched_priority;
|
|---|
| 832 | };
|
|---|
| 833 |
|
|---|
| 834 |
|
|---|
| 835 | struct __sched_param
|
|---|
| 836 | {
|
|---|
| 837 | int __sched_priority;
|
|---|
| 838 | };
|
|---|
| 839 | typedef unsigned long int __cpu_mask;
|
|---|
| 840 | typedef struct
|
|---|
| 841 | {
|
|---|
| 842 | __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
|
|---|
| 843 | } cpu_set_t;
|
|---|
| 844 |
|
|---|
| 845 | extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
|
|---|
| 846 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 847 | extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 848 | extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 849 |
|
|---|
| 850 |
|
|---|
| 851 | extern int sched_setparam (__pid_t __pid, const struct sched_param *__param)
|
|---|
| 852 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 853 | extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 854 | extern int sched_setscheduler (__pid_t __pid, int __policy,
|
|---|
| 855 | const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 856 | extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 857 | extern int sched_yield (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 858 | extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 859 | extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 860 | extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 861 |
|
|---|
| 862 |
|
|---|
| 863 |
|
|---|
| 864 | struct tm
|
|---|
| 865 | {
|
|---|
| 866 | int tm_sec;
|
|---|
| 867 | int tm_min;
|
|---|
| 868 | int tm_hour;
|
|---|
| 869 | int tm_mday;
|
|---|
| 870 | int tm_mon;
|
|---|
| 871 | int tm_year;
|
|---|
| 872 | int tm_wday;
|
|---|
| 873 | int tm_yday;
|
|---|
| 874 | int tm_isdst;
|
|---|
| 875 | long int tm_gmtoff;
|
|---|
| 876 | const char *tm_zone;
|
|---|
| 877 | };
|
|---|
| 878 |
|
|---|
| 879 |
|
|---|
| 880 | struct itimerspec
|
|---|
| 881 | {
|
|---|
| 882 | struct timespec it_interval;
|
|---|
| 883 | struct timespec it_value;
|
|---|
| 884 | };
|
|---|
| 885 | struct sigevent;
|
|---|
| 886 |
|
|---|
| 887 | extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 888 | extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 889 | extern double difftime (time_t __time1, time_t __time0)
|
|---|
| 890 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 891 | extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 892 | extern size_t strftime (char *__restrict __s, size_t __maxsize,
|
|---|
| 893 | const char *__restrict __format,
|
|---|
| 894 | const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 895 |
|
|---|
| 896 | typedef struct __locale_struct
|
|---|
| 897 | {
|
|---|
| 898 | struct __locale_data *__locales[13];
|
|---|
| 899 | const unsigned short int *__ctype_b;
|
|---|
| 900 | const int *__ctype_tolower;
|
|---|
| 901 | const int *__ctype_toupper;
|
|---|
| 902 | const char *__names[13];
|
|---|
| 903 | } *__locale_t;
|
|---|
| 904 | typedef __locale_t locale_t;
|
|---|
| 905 | extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
|
|---|
| 906 | const char *__restrict __format,
|
|---|
| 907 | const struct tm *__restrict __tp,
|
|---|
| 908 | __locale_t __loc) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 909 |
|
|---|
| 910 | extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 911 | extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 912 |
|
|---|
| 913 | extern struct tm *gmtime_r (const time_t *__restrict __timer,
|
|---|
| 914 | struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 915 | extern struct tm *localtime_r (const time_t *__restrict __timer,
|
|---|
| 916 | struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 917 |
|
|---|
| 918 | extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 919 | extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 920 |
|
|---|
| 921 | extern char *asctime_r (const struct tm *__restrict __tp,
|
|---|
| 922 | char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 923 | extern char *ctime_r (const time_t *__restrict __timer,
|
|---|
| 924 | char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 925 | extern char *__tzname[2];
|
|---|
| 926 | extern int __daylight;
|
|---|
| 927 | extern long int __timezone;
|
|---|
| 928 | extern char *tzname[2];
|
|---|
| 929 | extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 930 | extern int daylight;
|
|---|
| 931 | extern long int timezone;
|
|---|
| 932 | extern int stime (const time_t *__when) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 933 | extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 934 | extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 935 | extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 936 | extern int nanosleep (const struct timespec *__requested_time,
|
|---|
| 937 | struct timespec *__remaining);
|
|---|
| 938 | extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 939 | extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 940 | extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
|
|---|
| 941 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 942 | extern int clock_nanosleep (clockid_t __clock_id, int __flags,
|
|---|
| 943 | const struct timespec *__req,
|
|---|
| 944 | struct timespec *__rem);
|
|---|
| 945 | extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 946 | extern int timer_create (clockid_t __clock_id,
|
|---|
| 947 | struct sigevent *__restrict __evp,
|
|---|
| 948 | timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 949 | extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 950 | extern int timer_settime (timer_t __timerid, int __flags,
|
|---|
| 951 | const struct itimerspec *__restrict __value,
|
|---|
| 952 | struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 953 | extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
|
|---|
| 954 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 955 | extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 956 | extern int timespec_get (struct timespec *__ts, int __base)
|
|---|
| 957 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 958 |
|
|---|
| 959 | typedef int __jmp_buf[6];
|
|---|
| 960 | enum
|
|---|
| 961 | {
|
|---|
| 962 | PTHREAD_CREATE_JOINABLE,
|
|---|
| 963 | PTHREAD_CREATE_DETACHED
|
|---|
| 964 | };
|
|---|
| 965 | enum
|
|---|
| 966 | {
|
|---|
| 967 | PTHREAD_MUTEX_TIMED_NP,
|
|---|
| 968 | PTHREAD_MUTEX_RECURSIVE_NP,
|
|---|
| 969 | PTHREAD_MUTEX_ERRORCHECK_NP,
|
|---|
| 970 | PTHREAD_MUTEX_ADAPTIVE_NP
|
|---|
| 971 | ,
|
|---|
| 972 | PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
|
|---|
| 973 | PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
|
|---|
| 974 | PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
|
|---|
| 975 | PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
|
|---|
| 976 | };
|
|---|
| 977 | enum
|
|---|
| 978 | {
|
|---|
| 979 | PTHREAD_MUTEX_STALLED,
|
|---|
| 980 | PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
|
|---|
| 981 | PTHREAD_MUTEX_ROBUST,
|
|---|
| 982 | PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
|
|---|
| 983 | };
|
|---|
| 984 | enum
|
|---|
| 985 | {
|
|---|
| 986 | PTHREAD_PRIO_NONE,
|
|---|
| 987 | PTHREAD_PRIO_INHERIT,
|
|---|
| 988 | PTHREAD_PRIO_PROTECT
|
|---|
| 989 | };
|
|---|
| 990 | enum
|
|---|
| 991 | {
|
|---|
| 992 | PTHREAD_RWLOCK_PREFER_READER_NP,
|
|---|
| 993 | PTHREAD_RWLOCK_PREFER_WRITER_NP,
|
|---|
| 994 | PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
|
|---|
| 995 | PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
|
|---|
| 996 | };
|
|---|
| 997 | enum
|
|---|
| 998 | {
|
|---|
| 999 | PTHREAD_INHERIT_SCHED,
|
|---|
| 1000 | PTHREAD_EXPLICIT_SCHED
|
|---|
| 1001 | };
|
|---|
| 1002 | enum
|
|---|
| 1003 | {
|
|---|
| 1004 | PTHREAD_SCOPE_SYSTEM,
|
|---|
| 1005 | PTHREAD_SCOPE_PROCESS
|
|---|
| 1006 | };
|
|---|
| 1007 | enum
|
|---|
| 1008 | {
|
|---|
| 1009 | PTHREAD_PROCESS_PRIVATE,
|
|---|
| 1010 | PTHREAD_PROCESS_SHARED
|
|---|
| 1011 | };
|
|---|
| 1012 | struct _pthread_cleanup_buffer
|
|---|
| 1013 | {
|
|---|
| 1014 | void (*__routine) (void *);
|
|---|
| 1015 | void *__arg;
|
|---|
| 1016 | int __canceltype;
|
|---|
| 1017 | struct _pthread_cleanup_buffer *__prev;
|
|---|
| 1018 | };
|
|---|
| 1019 | enum
|
|---|
| 1020 | {
|
|---|
| 1021 | PTHREAD_CANCEL_ENABLE,
|
|---|
| 1022 | PTHREAD_CANCEL_DISABLE
|
|---|
| 1023 | };
|
|---|
| 1024 | enum
|
|---|
| 1025 | {
|
|---|
| 1026 | PTHREAD_CANCEL_DEFERRED,
|
|---|
| 1027 | PTHREAD_CANCEL_ASYNCHRONOUS
|
|---|
| 1028 | };
|
|---|
| 1029 |
|
|---|
| 1030 | extern int pthread_create (pthread_t *__restrict __newthread,
|
|---|
| 1031 | const pthread_attr_t *__restrict __attr,
|
|---|
| 1032 | void *(*__start_routine) (void *),
|
|---|
| 1033 | void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
|
|---|
| 1034 | extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
|
|---|
| 1035 | extern int pthread_join (pthread_t __th, void **__thread_return);
|
|---|
| 1036 | extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 1037 | extern pthread_t pthread_self (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 1038 | extern int pthread_equal (pthread_t __thread1, pthread_t __thread2)
|
|---|
| 1039 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 1040 | extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1041 | extern int pthread_attr_destroy (pthread_attr_t *__attr)
|
|---|
| 1042 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1043 | extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr,
|
|---|
| 1044 | int *__detachstate)
|
|---|
| 1045 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1046 | extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
|
|---|
| 1047 | int __detachstate)
|
|---|
| 1048 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1049 | extern int pthread_attr_getguardsize (const pthread_attr_t *__attr,
|
|---|
| 1050 | size_t *__guardsize)
|
|---|
| 1051 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1052 | extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
|
|---|
| 1053 | size_t __guardsize)
|
|---|
| 1054 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1055 | extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
|
|---|
| 1056 | struct sched_param *__restrict __param)
|
|---|
| 1057 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1058 | extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
|
|---|
| 1059 | const struct sched_param *__restrict
|
|---|
| 1060 | __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1061 | extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict
|
|---|
| 1062 | __attr, int *__restrict __policy)
|
|---|
| 1063 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1064 | extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
|
|---|
| 1065 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1066 | extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict
|
|---|
| 1067 | __attr, int *__restrict __inherit)
|
|---|
| 1068 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1069 | extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
|
|---|
| 1070 | int __inherit)
|
|---|
| 1071 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1072 | extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr,
|
|---|
| 1073 | int *__restrict __scope)
|
|---|
| 1074 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1075 | extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
|
|---|
| 1076 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1077 | extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict
|
|---|
| 1078 | __attr, void **__restrict __stackaddr)
|
|---|
| 1079 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
|
|---|
| 1080 | extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
|
|---|
| 1081 | void *__stackaddr)
|
|---|
| 1082 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
|
|---|
| 1083 | extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict
|
|---|
| 1084 | __attr, size_t *__restrict __stacksize)
|
|---|
| 1085 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1086 | extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
|
|---|
| 1087 | size_t __stacksize)
|
|---|
| 1088 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1089 | extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
|
|---|
| 1090 | void **__restrict __stackaddr,
|
|---|
| 1091 | size_t *__restrict __stacksize)
|
|---|
| 1092 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3)));
|
|---|
| 1093 | extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
|
|---|
| 1094 | size_t __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1095 | extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
|
|---|
| 1096 | const struct sched_param *__param)
|
|---|
| 1097 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
|
|---|
| 1098 | extern int pthread_getschedparam (pthread_t __target_thread,
|
|---|
| 1099 | int *__restrict __policy,
|
|---|
| 1100 | struct sched_param *__restrict __param)
|
|---|
| 1101 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
|
|---|
| 1102 | extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
|
|---|
| 1103 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 1104 | extern int pthread_once (pthread_once_t *__once_control,
|
|---|
| 1105 | void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1106 | extern int pthread_setcancelstate (int __state, int *__oldstate);
|
|---|
| 1107 | extern int pthread_setcanceltype (int __type, int *__oldtype);
|
|---|
| 1108 | extern int pthread_cancel (pthread_t __th);
|
|---|
| 1109 | extern void pthread_testcancel (void);
|
|---|
| 1110 | typedef struct
|
|---|
| 1111 | {
|
|---|
| 1112 | struct
|
|---|
| 1113 | {
|
|---|
| 1114 | __jmp_buf __cancel_jmp_buf;
|
|---|
| 1115 | int __mask_was_saved;
|
|---|
| 1116 | } __cancel_jmp_buf[1];
|
|---|
| 1117 | void *__pad[4];
|
|---|
| 1118 | } __pthread_unwind_buf_t __attribute__ ((__aligned__));
|
|---|
| 1119 | struct __pthread_cleanup_frame
|
|---|
| 1120 | {
|
|---|
| 1121 | void (*__cancel_routine) (void *);
|
|---|
| 1122 | void *__cancel_arg;
|
|---|
| 1123 | int __do_it;
|
|---|
| 1124 | int __cancel_type;
|
|---|
| 1125 | };
|
|---|
| 1126 | extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
|
|---|
| 1127 | __attribute__ ((__regparm__ (1)));
|
|---|
| 1128 | extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
|
|---|
| 1129 | __attribute__ ((__regparm__ (1)));
|
|---|
| 1130 | extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
|
|---|
| 1131 | __attribute__ ((__regparm__ (1))) __attribute__ ((__noreturn__))
|
|---|
| 1132 | __attribute__ ((__weak__))
|
|---|
| 1133 | ;
|
|---|
| 1134 | struct __jmp_buf_tag;
|
|---|
| 1135 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
|
|---|
| 1136 | extern int pthread_mutex_init (pthread_mutex_t *__mutex,
|
|---|
| 1137 | const pthread_mutexattr_t *__mutexattr)
|
|---|
| 1138 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1139 | extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
|
|---|
| 1140 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1141 | extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
|
|---|
| 1142 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1143 | extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
|
|---|
| 1144 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1145 | extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
|
|---|
| 1146 | const struct timespec *__restrict
|
|---|
| 1147 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1148 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
|
|---|
| 1149 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1150 | extern int pthread_mutex_getprioceiling (const pthread_mutex_t *
|
|---|
| 1151 | __restrict __mutex,
|
|---|
| 1152 | int *__restrict __prioceiling)
|
|---|
| 1153 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1154 | extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
|
|---|
| 1155 | int __prioceiling,
|
|---|
| 1156 | int *__restrict __old_ceiling)
|
|---|
| 1157 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3)));
|
|---|
| 1158 | extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
|
|---|
| 1159 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1160 | extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
|
|---|
| 1161 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1162 | extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
|
|---|
| 1163 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1164 | extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t *
|
|---|
| 1165 | __restrict __attr,
|
|---|
| 1166 | int *__restrict __pshared)
|
|---|
| 1167 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1168 | extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
|
|---|
| 1169 | int __pshared)
|
|---|
| 1170 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1171 | extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict
|
|---|
| 1172 | __attr, int *__restrict __kind)
|
|---|
| 1173 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1174 | extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
|
|---|
| 1175 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1176 | extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t *
|
|---|
| 1177 | __restrict __attr,
|
|---|
| 1178 | int *__restrict __protocol)
|
|---|
| 1179 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1180 | extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
|
|---|
| 1181 | int __protocol)
|
|---|
| 1182 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1183 | extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *
|
|---|
| 1184 | __restrict __attr,
|
|---|
| 1185 | int *__restrict __prioceiling)
|
|---|
| 1186 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1187 | extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
|
|---|
| 1188 | int __prioceiling)
|
|---|
| 1189 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1190 | extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr,
|
|---|
| 1191 | int *__robustness)
|
|---|
| 1192 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1193 | extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
|
|---|
| 1194 | int __robustness)
|
|---|
| 1195 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1196 | extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 1197 | const pthread_rwlockattr_t *__restrict
|
|---|
| 1198 | __attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1199 | extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
|
|---|
| 1200 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1201 | extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
|
|---|
| 1202 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1203 | extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
|
|---|
| 1204 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1205 | extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 1206 | const struct timespec *__restrict
|
|---|
| 1207 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1208 | extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
|
|---|
| 1209 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1210 | extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
|
|---|
| 1211 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1212 | extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
|
|---|
| 1213 | const struct timespec *__restrict
|
|---|
| 1214 | __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1215 | extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
|
|---|
| 1216 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1217 | extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
|
|---|
| 1218 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1219 | extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
|
|---|
| 1220 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1221 | extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *
|
|---|
| 1222 | __restrict __attr,
|
|---|
| 1223 | int *__restrict __pshared)
|
|---|
| 1224 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1225 | extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
|
|---|
| 1226 | int __pshared)
|
|---|
| 1227 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1228 | extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t *
|
|---|
| 1229 | __restrict __attr,
|
|---|
| 1230 | int *__restrict __pref)
|
|---|
| 1231 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1232 | extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
|
|---|
| 1233 | int __pref) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1234 | extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
|
|---|
| 1235 | const pthread_condattr_t *__restrict __cond_attr)
|
|---|
| 1236 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1237 | extern int pthread_cond_destroy (pthread_cond_t *__cond)
|
|---|
| 1238 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1239 | extern int pthread_cond_signal (pthread_cond_t *__cond)
|
|---|
| 1240 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1241 | extern int pthread_cond_broadcast (pthread_cond_t *__cond)
|
|---|
| 1242 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1243 | extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
|
|---|
| 1244 | pthread_mutex_t *__restrict __mutex)
|
|---|
| 1245 | __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1246 | extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
|
|---|
| 1247 | pthread_mutex_t *__restrict __mutex,
|
|---|
| 1248 | const struct timespec *__restrict __abstime)
|
|---|
| 1249 | __attribute__ ((__nonnull__ (1, 2, 3)));
|
|---|
| 1250 | extern int pthread_condattr_init (pthread_condattr_t *__attr)
|
|---|
| 1251 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1252 | extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
|
|---|
| 1253 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1254 | extern int pthread_condattr_getpshared (const pthread_condattr_t *
|
|---|
| 1255 | __restrict __attr,
|
|---|
| 1256 | int *__restrict __pshared)
|
|---|
| 1257 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1258 | extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
|
|---|
| 1259 | int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1260 | extern int pthread_condattr_getclock (const pthread_condattr_t *
|
|---|
| 1261 | __restrict __attr,
|
|---|
| 1262 | __clockid_t *__restrict __clock_id)
|
|---|
| 1263 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1264 | extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
|
|---|
| 1265 | __clockid_t __clock_id)
|
|---|
| 1266 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1267 | extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
|
|---|
| 1268 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1269 | extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
|
|---|
| 1270 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1271 | extern int pthread_spin_lock (pthread_spinlock_t *__lock)
|
|---|
| 1272 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1273 | extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
|
|---|
| 1274 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1275 | extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
|
|---|
| 1276 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1277 | extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
|
|---|
| 1278 | const pthread_barrierattr_t *__restrict
|
|---|
| 1279 | __attr, unsigned int __count)
|
|---|
| 1280 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1281 | extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
|
|---|
| 1282 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1283 | extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
|
|---|
| 1284 | __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1285 | extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
|
|---|
| 1286 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1287 | extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
|
|---|
| 1288 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1289 | extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *
|
|---|
| 1290 | __restrict __attr,
|
|---|
| 1291 | int *__restrict __pshared)
|
|---|
| 1292 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 1293 | extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
|
|---|
| 1294 | int __pshared)
|
|---|
| 1295 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1296 | extern int pthread_key_create (pthread_key_t *__key,
|
|---|
| 1297 | void (*__destr_function) (void *))
|
|---|
| 1298 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 1299 | extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 1300 | extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 1301 | extern int pthread_setspecific (pthread_key_t __key,
|
|---|
| 1302 | const void *__pointer) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 1303 | extern int pthread_getcpuclockid (pthread_t __thread_id,
|
|---|
| 1304 | __clockid_t *__clock_id)
|
|---|
| 1305 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 1306 | extern int pthread_atfork (void (*__prepare) (void),
|
|---|
| 1307 | void (*__parent) (void),
|
|---|
| 1308 | void (*__child) (void)) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 1309 |
|
|---|
| 1310 | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
|
|---|
| 1311 | extern int __VERIFIER_nondet_int(void);
|
|---|
| 1312 | extern void __VERIFIER_assume(int);
|
|---|
| 1313 | extern void __VERIFIER_atomic_begin(void);
|
|---|
| 1314 | extern void __VERIFIER_atomic_end(void);
|
|---|
| 1315 | typedef struct Cell Cell;
|
|---|
| 1316 | struct Cell {
|
|---|
| 1317 | Cell *pnext;
|
|---|
| 1318 | int pdata;
|
|---|
| 1319 | };
|
|---|
| 1320 | typedef struct ThreadInfo ThreadInfo;
|
|---|
| 1321 | struct ThreadInfo {
|
|---|
| 1322 | unsigned int id;
|
|---|
| 1323 | int op;
|
|---|
| 1324 | Cell cell;
|
|---|
| 1325 | };
|
|---|
| 1326 | typedef struct Simple_Stack Simple_Stack;
|
|---|
| 1327 | struct Simple_Stack {
|
|---|
| 1328 | Cell *ptop;
|
|---|
| 1329 | };
|
|---|
| 1330 | Simple_Stack S;
|
|---|
| 1331 | ThreadInfo *location[8];
|
|---|
| 1332 | int collision;
|
|---|
| 1333 | int unique_id = 0;
|
|---|
| 1334 | void StackOp(ThreadInfo *p);
|
|---|
| 1335 | int TryPerformStackOp(ThreadInfo *p);
|
|---|
| 1336 | int TryCollision(ThreadInfo * p, ThreadInfo * q, int him);
|
|---|
| 1337 | void FinishCollision(ThreadInfo * p);
|
|---|
| 1338 | int atomic_int_cas(int *p, int cmp, int new) {
|
|---|
| 1339 | int ret;
|
|---|
| 1340 | __VERIFIER_atomic_begin();
|
|---|
| 1341 | if (*p == cmp) {
|
|---|
| 1342 | *p = new;
|
|---|
| 1343 | ret = 1;
|
|---|
| 1344 | } else {
|
|---|
| 1345 | ret = 0;
|
|---|
| 1346 | }
|
|---|
| 1347 | __VERIFIER_atomic_end();
|
|---|
| 1348 | return ret;
|
|---|
| 1349 | }
|
|---|
| 1350 | int atomic_ti_cas(ThreadInfo * *p, ThreadInfo* cmp, ThreadInfo* new) {
|
|---|
| 1351 | int ret;
|
|---|
| 1352 | __VERIFIER_atomic_begin();
|
|---|
| 1353 | if (*p == cmp) {
|
|---|
| 1354 | *p = new;
|
|---|
| 1355 | ret = 1;
|
|---|
| 1356 | } else {
|
|---|
| 1357 | ret = 0;
|
|---|
| 1358 | }
|
|---|
| 1359 | __VERIFIER_atomic_end();
|
|---|
| 1360 | return ret;
|
|---|
| 1361 | }
|
|---|
| 1362 | int ti_cas(ThreadInfo * *p, ThreadInfo* cmp, ThreadInfo* new) {
|
|---|
| 1363 | if (*p == cmp) {
|
|---|
| 1364 | *p = new;
|
|---|
| 1365 | return 1;
|
|---|
| 1366 | } else {
|
|---|
| 1367 | return 0;
|
|---|
| 1368 | }
|
|---|
| 1369 | }
|
|---|
| 1370 | int atomic_c_cas(Cell * *p, Cell* cmp, Cell* new) {
|
|---|
| 1371 | int ret;
|
|---|
| 1372 | __VERIFIER_atomic_begin();
|
|---|
| 1373 | if (*p == cmp) {
|
|---|
| 1374 | *p = new;
|
|---|
| 1375 | ret = 1;
|
|---|
| 1376 | } else {
|
|---|
| 1377 | ret = 0;
|
|---|
| 1378 | }
|
|---|
| 1379 | __VERIFIER_atomic_end();
|
|---|
| 1380 | return ret;
|
|---|
| 1381 | }
|
|---|
| 1382 | ThreadInfo threads[4];
|
|---|
| 1383 | int allocated[4];
|
|---|
| 1384 | ThreadInfo* malloc_ThreadInfo() {
|
|---|
| 1385 | __VERIFIER_atomic_begin();
|
|---|
| 1386 | int i = __VERIFIER_nondet_int();
|
|---|
| 1387 | __VERIFIER_assume(0 <= i && i < 4);
|
|---|
| 1388 | __VERIFIER_assume(!allocated[i]);
|
|---|
| 1389 | allocated[i] = 1;
|
|---|
| 1390 | __VERIFIER_atomic_end();
|
|---|
| 1391 | return &threads[i];
|
|---|
| 1392 | }
|
|---|
| 1393 | void free_ThreadInfo(ThreadInfo* ti) {
|
|---|
| 1394 | __VERIFIER_atomic_begin();
|
|---|
| 1395 | int i = __VERIFIER_nondet_int();
|
|---|
| 1396 | __VERIFIER_assume(0 <= i && i < 4);
|
|---|
| 1397 | __VERIFIER_assume(&threads[i] == ti);
|
|---|
| 1398 | allocated[i] = 0;
|
|---|
| 1399 | __VERIFIER_atomic_end();
|
|---|
| 1400 | }
|
|---|
| 1401 | void LesOP(ThreadInfo *p) {
|
|---|
| 1402 | int mypid = p->id;
|
|---|
| 1403 | location[mypid] = p;
|
|---|
| 1404 | int him = collision;
|
|---|
| 1405 | __VERIFIER_assume (atomic_int_cas(&collision, him, mypid));
|
|---|
| 1406 | if (him > 0) {
|
|---|
| 1407 | ThreadInfo* q = location[him];
|
|---|
| 1408 | if (q != ((void *)0) && q->id == him && q->op != p->op) {
|
|---|
| 1409 | if (atomic_ti_cas(&location[mypid], p, ((void *)0))) {
|
|---|
| 1410 | if (TryCollision(p, q, him) == 1) {
|
|---|
| 1411 | return;
|
|---|
| 1412 | } else {
|
|---|
| 1413 | goto stack;
|
|---|
| 1414 | }
|
|---|
| 1415 | } else {
|
|---|
| 1416 | FinishCollision(p);
|
|---|
| 1417 | return;
|
|---|
| 1418 | }
|
|---|
| 1419 | }
|
|---|
| 1420 | }
|
|---|
| 1421 | if (!atomic_ti_cas(&location[mypid], p, ((void *)0))) {
|
|---|
| 1422 | FinishCollision(p);
|
|---|
| 1423 | return;
|
|---|
| 1424 | }
|
|---|
| 1425 | stack:
|
|---|
| 1426 | if (TryPerformStackOp(p) == 1) {
|
|---|
| 1427 | return;
|
|---|
| 1428 | }
|
|---|
| 1429 | __VERIFIER_assume(0);
|
|---|
| 1430 | }
|
|---|
| 1431 | int TryPerformStackOp(ThreadInfo * p) {
|
|---|
| 1432 | Cell *phead, *pnext;
|
|---|
| 1433 | if (p->op == 1) {
|
|---|
| 1434 | phead = S.ptop;
|
|---|
| 1435 | p->cell.pnext = phead;
|
|---|
| 1436 | if (atomic_c_cas(&S.ptop, phead, &p->cell)) {
|
|---|
| 1437 | return 1;
|
|---|
| 1438 | } else {
|
|---|
| 1439 | return 0;
|
|---|
| 1440 | }
|
|---|
| 1441 | }
|
|---|
| 1442 | if (p->op == 0) {
|
|---|
| 1443 | phead = S.ptop;
|
|---|
| 1444 | if (phead == ((void *)0)) {
|
|---|
| 1445 | p->cell.pnext = 0; p->cell.pdata = 2;
|
|---|
| 1446 | return 1;
|
|---|
| 1447 | }
|
|---|
| 1448 | pnext = phead->pnext;
|
|---|
| 1449 | if (atomic_c_cas(&S.ptop, phead, pnext)) {
|
|---|
| 1450 | p->cell = *phead;
|
|---|
| 1451 | __VERIFIER_atomic_begin();
|
|---|
| 1452 | int i = __VERIFIER_nondet_int();
|
|---|
| 1453 | __VERIFIER_assume(0 <= i && i < 4);
|
|---|
| 1454 | __VERIFIER_assume(&threads[i].cell == phead);
|
|---|
| 1455 | allocated[i] = 0;
|
|---|
| 1456 | __VERIFIER_atomic_end();
|
|---|
| 1457 | return 1;
|
|---|
| 1458 | } else {
|
|---|
| 1459 | p->cell.pnext = 0; p->cell.pdata = 2;
|
|---|
| 1460 | return 0;
|
|---|
| 1461 | }
|
|---|
| 1462 | }
|
|---|
| 1463 | }
|
|---|
| 1464 | void FinishCollision(ThreadInfo * p) {
|
|---|
| 1465 | __VERIFIER_atomic_begin();
|
|---|
| 1466 | if (p->op == 0) {
|
|---|
| 1467 | int mypid = p->id;
|
|---|
| 1468 | p->cell = location[mypid]->cell;
|
|---|
| 1469 | location[mypid] = ((void *)0);
|
|---|
| 1470 | }
|
|---|
| 1471 | __VERIFIER_atomic_end();
|
|---|
| 1472 | }
|
|---|
| 1473 | int TryCollision(ThreadInfo * p, ThreadInfo * q, int him) {
|
|---|
| 1474 | int ret = 0;
|
|---|
| 1475 | __VERIFIER_atomic_begin();
|
|---|
| 1476 | int mypid = p->id;
|
|---|
| 1477 | if (p->op == 1) {
|
|---|
| 1478 | if (ti_cas(&location[him], q, p)) {
|
|---|
| 1479 | ret = 1;
|
|---|
| 1480 | } else {
|
|---|
| 1481 | ret = 0;
|
|---|
| 1482 | }
|
|---|
| 1483 | }
|
|---|
| 1484 | if (p->op == 0) {
|
|---|
| 1485 | if (ti_cas(&location[him], q, ((void *)0))) {
|
|---|
| 1486 | p->cell = q->cell;
|
|---|
| 1487 | location[mypid] = ((void *)0);
|
|---|
| 1488 | ret = 1;
|
|---|
| 1489 | } else {
|
|---|
| 1490 | ret = 0;
|
|---|
| 1491 | }
|
|---|
| 1492 | }
|
|---|
| 1493 | __VERIFIER_atomic_end();
|
|---|
| 1494 | return ret;
|
|---|
| 1495 | }
|
|---|
| 1496 | void Init() {
|
|---|
| 1497 | S.ptop = ((void *)0);
|
|---|
| 1498 | }
|
|---|
| 1499 | void Push(int x) {
|
|---|
| 1500 | ThreadInfo *ti = malloc_ThreadInfo();
|
|---|
| 1501 | ti->id = ++unique_id;
|
|---|
| 1502 | ti->op = 1;
|
|---|
| 1503 | ti->cell.pdata = x;
|
|---|
| 1504 | if (TryPerformStackOp(ti) == 0) {
|
|---|
| 1505 | LesOP(ti);
|
|---|
| 1506 | }
|
|---|
| 1507 | }
|
|---|
| 1508 | int Pop() {
|
|---|
| 1509 | ThreadInfo *ti = malloc_ThreadInfo();
|
|---|
| 1510 | ti->id = ++unique_id;
|
|---|
| 1511 | ti->op = 0;
|
|---|
| 1512 | if (TryPerformStackOp(ti) == 0) {
|
|---|
| 1513 | LesOP(ti);
|
|---|
| 1514 | }
|
|---|
| 1515 | int v = ti->cell.pdata;
|
|---|
| 1516 | free_ThreadInfo(ti);
|
|---|
| 1517 | return v;
|
|---|
| 1518 | }
|
|---|
| 1519 | int PushOpen[2];
|
|---|
| 1520 | int PushDone[2];
|
|---|
| 1521 | int PopOpen;
|
|---|
| 1522 | int PopDone[3];
|
|---|
| 1523 | void checkInvariant() {
|
|---|
| 1524 | if (!(PopDone[0] <= PushDone[0] + PushOpen[0] && PopDone[1] <= PushDone[1] + PushOpen[1])) __VERIFIER_error();
|
|---|
| 1525 | }
|
|---|
| 1526 | void Incr_Push(int localPush1) {
|
|---|
| 1527 | __VERIFIER_atomic_begin();
|
|---|
| 1528 | PushOpen[localPush1]++;
|
|---|
| 1529 | __VERIFIER_atomic_end();
|
|---|
| 1530 | }
|
|---|
| 1531 | void DecrIncr_Push(int localPush1) {
|
|---|
| 1532 | __VERIFIER_atomic_begin();
|
|---|
| 1533 | PushOpen[localPush1]--;
|
|---|
| 1534 | PushDone[localPush1]++;
|
|---|
| 1535 | checkInvariant();
|
|---|
| 1536 | __VERIFIER_atomic_end();
|
|---|
| 1537 | }
|
|---|
| 1538 | void Incr_Pop() {
|
|---|
| 1539 | __VERIFIER_atomic_begin();
|
|---|
| 1540 | PopOpen++;
|
|---|
| 1541 | __VERIFIER_atomic_end();
|
|---|
| 1542 | }
|
|---|
| 1543 | void DecrIncr_Pop(int localPop_ret) {
|
|---|
| 1544 | __VERIFIER_atomic_begin();
|
|---|
| 1545 | PopOpen--;
|
|---|
| 1546 | PopDone[localPop_ret]++;
|
|---|
| 1547 | checkInvariant();
|
|---|
| 1548 | __VERIFIER_atomic_end();
|
|---|
| 1549 | }
|
|---|
| 1550 | void* instrPush0(void* unused) {
|
|---|
| 1551 | Incr_Push(1);
|
|---|
| 1552 | Push(1);
|
|---|
| 1553 | DecrIncr_Push(1);
|
|---|
| 1554 | return ((void *)0);
|
|---|
| 1555 | }
|
|---|
| 1556 | void* instrPush1(void* unused) {
|
|---|
| 1557 | Incr_Push(1);
|
|---|
| 1558 | Push(1);
|
|---|
| 1559 | DecrIncr_Push(1);
|
|---|
| 1560 | return ((void *)0);
|
|---|
| 1561 | }
|
|---|
| 1562 | void* instrPush2(void* unused) {
|
|---|
| 1563 | Incr_Push(1);
|
|---|
| 1564 | Push(1);
|
|---|
| 1565 | DecrIncr_Push(1);
|
|---|
| 1566 | return ((void *)0);
|
|---|
| 1567 | }
|
|---|
| 1568 | void* instrPop3(void* unused) {
|
|---|
| 1569 | Incr_Pop();
|
|---|
| 1570 | int localPop_ret = Pop();
|
|---|
| 1571 | DecrIncr_Pop(localPop_ret);
|
|---|
| 1572 | return ((void *)0);
|
|---|
| 1573 | }
|
|---|
| 1574 | void* instrPop4(void* unused) {
|
|---|
| 1575 | Incr_Pop();
|
|---|
| 1576 | int localPop_ret = Pop();
|
|---|
| 1577 | DecrIncr_Pop(localPop_ret);
|
|---|
| 1578 | return ((void *)0);
|
|---|
| 1579 | }
|
|---|
| 1580 | void* instrPop5(void* unused) {
|
|---|
| 1581 | Incr_Pop();
|
|---|
| 1582 | int localPop_ret = Pop();
|
|---|
| 1583 | DecrIncr_Pop(localPop_ret);
|
|---|
| 1584 | return ((void *)0);
|
|---|
| 1585 | }
|
|---|
| 1586 | void* instrPop6(void* unused) {
|
|---|
| 1587 | Incr_Pop();
|
|---|
| 1588 | int localPop_ret = Pop();
|
|---|
| 1589 | DecrIncr_Pop(localPop_ret);
|
|---|
| 1590 | return ((void *)0);
|
|---|
| 1591 | }
|
|---|
| 1592 | int main(void) {
|
|---|
| 1593 | Init();
|
|---|
| 1594 | pthread_t tid1, tid2, tid3, tid4, tid5, tid6, tid7;
|
|---|
| 1595 | pthread_create(&tid1, ((void *)0), &instrPush0, ((void *)0));
|
|---|
| 1596 | pthread_create(&tid2, ((void *)0), &instrPush1, ((void *)0));
|
|---|
| 1597 | pthread_create(&tid3, ((void *)0), &instrPush2, ((void *)0));
|
|---|
| 1598 | pthread_create(&tid4, ((void *)0), &instrPop3, ((void *)0));
|
|---|
| 1599 | pthread_create(&tid5, ((void *)0), &instrPop4, ((void *)0));
|
|---|
| 1600 | pthread_create(&tid6, ((void *)0), &instrPop5, ((void *)0));
|
|---|
| 1601 | pthread_create(&tid7, ((void *)0), &instrPop6, ((void *)0));
|
|---|
| 1602 | return 0;
|
|---|
| 1603 | }
|
|---|