summaryrefslogtreecommitdiff
path: root/unistd.h
blob: bdb9efab3a895f73e3fbd8cf47927072c3bb8850 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
#ifndef __UNISTD_H__
#define __UNISTD_H__

/*
UNG's Not GNU

MIT License

Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#if defined _XOPEN_SOURCE && _XOPEN_SOURCE - 1 < 0
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 400
#endif

#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
#	if (_XOPEN_SOURCE >= 700)
#		define _POSIX_C_SOURCE 200809L
#	elif (_XOPEN_SOURCE >= 600)
#		define _POSIX_C_SOURCE 200112L
#	elif (_XOPEN_SOURCE >= 500)
#		define _POSIX_C_SOURCE 199506L
#	else
#		define _POSIX_C_SOURCE 2
#	endif
#endif

#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
#	define _POSIX_SOURCE
#endif

#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 19901L
#	if (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L)
#		error POSIX.1-2001 and later require a C99 compiler
#	elif (defined _XOPEN_SOURCE && _XOPEN_SOURCE >= 600)
#		error XOPEN Issue 6 and later require a C99 compiler
#	endif
#endif

#if	(defined _POSIX_SOURCE)
/* ./src/unistd/F_OK.c */
#define F_OK                                                                   8
/* ./src/unistd/R_OK.c */
#define R_OK                                                                   4
/* ./src/unistd/STDERR_FILENO.c */
#define STDERR_FILENO                                                          2
/* ./src/unistd/STDIN_FILENO.c */
#define STDIN_FILENO                                                           0
/* ./src/unistd/STDOUT_FILENO.c */
#define STDOUT_FILENO                                                          1
/* ./src/unistd/W_OK.c */
#define W_OK                                                                   2
/* ./src/unistd/X_OK.c */
#define X_OK                                                                   1
/* ./src/unistd/_PC_CHOWN_RESTRICTED.c */
#define _PC_CHOWN_RESTRICTED                                                   3
/* ./src/unistd/_PC_LINK_MAX.c */
#define _PC_LINK_MAX                                                           5
/* ./src/unistd/_PC_MAX_CANON.c */
#define _PC_MAX_CANON                                                          6
/* ./src/unistd/_PC_MAX_INPUT.c */
#define _PC_MAX_INPUT                                                          7
/* ./src/unistd/_PC_NAME_MAX.c */
#define _PC_NAME_MAX                                                           8
/* ./src/unistd/_PC_NO_TRUNC.c */
#define _PC_NO_TRUNC                                                           9
/* ./src/unistd/_PC_PATH_MAX.c */
#define _PC_PATH_MAX                                                          10
/* ./src/unistd/_PC_PIPE_BUF.c */
#define _PC_PIPE_BUF                                                          11
/* ./src/unistd/_PC_VDISABLE.c */
#define _PC_VDISABLE                                                          20
/* ./src/unistd/_POSIX_CHOWN_RESTRICTED.c */
#define _POSIX_CHOWN_RESTRICTED                                              (1)
/* ./src/unistd/_POSIX_JOB_CONTROL.c */
#define _POSIX_JOB_CONTROL                                     (_POSIX_C_SOURCE)
/* ./src/unistd/_POSIX_NO_TRUNC.c */
#define _POSIX_NO_TRUNC                                                      (2)
/* ./src/unistd/_POSIX_SAVED_IDS.c */
#define _POSIX_SAVED_IDS                                       (_POSIX_C_SOURCE)
/* ./src/unistd/_POSIX_VDISABLE.c */
#define _POSIX_VDISABLE                                                      (3)
/* ./src/unistd/_POSIX_VERSION.c */
#if _POSIX_C_SOURCE >= 200809L
#define _POSIX_VERISON                                                 (200809L)
#elif _POSIX_C_SOURCE >= 200112L
#define _POSIX_VERSION                                                 (200112L)
#elif _POSIX_C_SOURCE >= 199506L
#define _POSIX_VERSION                                                 (199506L)
#elif _POSIX_C_SOURCE >= 199309L
#define _POSIX_VERSION                                                 (199309L)
#elif defined _POSIX_C_SOURCE
#define _POSIX_VERSION                                                 (199009L)
#else
#define _POSIX_VERSION                                                 (198808L)
#endif
/* ./src/unistd/_SC_ARG_MAX.c */
#define _SC_ARG_MAX                                                           19
/* ./src/unistd/_SC_CHILD_MAX.c */
#define _SC_CHILD_MAX                                                         27
/* ./src/unistd/_SC_CLK_TCK.c */
#define _SC_CLK_TCK                                                           28
/* ./src/unistd/_SC_JOB_CONTROL.c */
#define _SC_JOB_CONTROL                                                       40
/* ./src/unistd/_SC_NGROUPS_MAX.c */
#define _SC_NGROUPS_MAX                                                       51
/* ./src/unistd/_SC_OPEN_MAX.c */
#define _SC_OPEN_MAX                                                          52
/* ./src/unistd/_SC_SAVED_IDS.c */
#define _SC_SAVED_IDS                                                         63
/* ./src/unistd/_SC_STREAM_MAX.c */
#define _SC_STREAM_MAX                                                        74
/* ./src/unistd/_SC_TZNAME_MAX.c */
#define _SC_TZNAME_MAX                                                       106
/* ./src/unistd/_SC_VERSION.c */
#define _SC_VERSION                                                          115
/* src/stddef/NULL.c */
#define NULL                                                          ((void*)0)
/* src/stdio/SEEK_CUR.c */
#define SEEK_CUR                                                             (1)
/* src/stdio/SEEK_END.c */
#define SEEK_END                                                             (2)
/* src/stdio/SEEK_SET.c */
#define SEEK_SET                                                             (3)
#endif

#if	(defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE)
/* ./src/unistd/_PC_ASYNC_IO.c */
#define _PC_ASYNC_IO                                                           2
/* ./src/unistd/_PC_PRIO_IO.c */
#define _PC_PRIO_IO                                                           12
/* ./src/unistd/_PC_SYNC_IO.c */
#define _PC_SYNC_IO                                                           18
/* ./src/unistd/_POSIX_ASYNCHRONOUS_IO.c */
#define _POSIX_ASYNCHRONOUS_IO                                           200809L
/* ./src/unistd/_POSIX_ASYNC_IO.c */
#define _POSIX_ASYNC_IO                                                  200809L
/* ./src/unistd/_POSIX_FSYNC.c */
#define _POSIX_FSYNC                                                        (-1)
/* ./src/unistd/_POSIX_MAPPED_FILES.c */
#define _POSIX_MAPPED_FILES                                              200809L
/* ./src/unistd/_POSIX_MEMLOCK.c */
#define _POSIX_MEMLOCK                                                      (-1)
/* ./src/unistd/_POSIX_MEMLOCK_RANGE.c */
#define _POSIX_MEMLOCK_RANGE                                                (-1)
/* ./src/unistd/_POSIX_MEMORY_PROTECTION.c */
#define _POSIX_MEMORY_PROTECTION                                         200809L
/* ./src/unistd/_POSIX_MESSAGE_PASSING.c */
#define _POSIX_MESSAGE_PASSING                                              (-1)
/* ./src/unistd/_POSIX_PRIORITIZED_IO.c */
#define _POSIX_PRIORITIZED_IO                                               (-1)
/* ./src/unistd/_POSIX_PRIORITY_SCHEDULING.c */
#define _POSIX_PRIORITY_SCHEDULING                                          (-1)
/* ./src/unistd/_POSIX_PRIO_IO.c */
#define _POSIX_PRIO_IO                                                   200809L
/* ./src/unistd/_POSIX_REALTIME_SIGNALS.c */
#define _POSIX_REALTIME_SIGNALS                                          200809L
/* ./src/unistd/_POSIX_SEMAPHORES.c */
#define _POSIX_SEMAPHORES                                                200809L
/* ./src/unistd/_POSIX_SYNCHRONIZED_IO.c */
#define _POSIX_SYNCHRONIZED_IO                                              (-1)
/* ./src/unistd/_POSIX_SYNC_IO.c */
#define _POSIX_SYNC_IO                                                   200809L
/* ./src/unistd/_POSIX_TIMERS.c */
#define _POSIX_TIMERS                                                    200809L
/* ./src/unistd/_SC_AIO_LISTIO_MAX.c */
#define _SC_AIO_LISTIO_MAX                                                    16
/* ./src/unistd/_SC_AIO_MAX.c */
#define _SC_AIO_MAX                                                           17
/* ./src/unistd/_SC_AIO_PRIO_DELTA_MAX.c */
#define _SC_AIO_PRIO_DELTA_MAX                                                18
/* ./src/unistd/_SC_ASYNCHRONOUS_IO.c */
#define _SC_ASYNCHRONOUS_IO                                                   20
/* ./src/unistd/_SC_DELAYTIMER_MAX.c */
#define _SC_DELAYTIMER_MAX                                                    32
/* ./src/unistd/_SC_FSYNC.c */
#define _SC_FSYNC                                                             34
/* ./src/unistd/_SC_MAPPED_FILES.c */
#define _SC_MAPPED_FILES                                                      43
/* ./src/unistd/_SC_MEMLOCK.c */
#define _SC_MEMLOCK                                                           44
/* ./src/unistd/_SC_MEMLOCK_RANGE.c */
#define _SC_MEMLOCK_RANGE                                                     45
/* ./src/unistd/_SC_MEMORY_PROTECTION.c */
#define _SC_MEMORY_PROTECTION                                                 46
/* ./src/unistd/_SC_MESSAGE_PASSING.c */
#define _SC_MESSAGE_PASSING                                                   47
/* ./src/unistd/_SC_MQ_OPEN_MAX.c */
#define _SC_MQ_OPEN_MAX                                                       49
/* ./src/unistd/_SC_MQ_PRIO_MAX.c */
#define _SC_MQ_PRIO_MAX                                                       50
/* ./src/unistd/_SC_PRIORITIZED_IO.c */
#define _SC_PRIORITIZED_IO /* TODO */
/* ./src/unistd/_SC_PRIORITY_SCHEDULING.c */
#define _SC_PRIORITY_SCHEDULING                                               56
/* ./src/unistd/_SC_REALTIME_SIGNALS.c */
#define _SC_REALTIME_SIGNALS                                                  60
/* ./src/unistd/_SC_RTSIG_MAX.c */
#define _SC_RTSIG_MAX                                                         62
/* ./src/unistd/_SC_SEMAPHORES.c */
#define _SC_SEMAPHORES                                                        66
/* ./src/unistd/_SC_SEM_NSEMS_MAX.c */
#define _SC_SEM_NSEMS_MAX                                                     64
/* ./src/unistd/_SC_SEM_VALUE_MAX.c */
#define _SC_SEM_VALUE_MAX                                                     65
/* ./src/unistd/_SC_SHARED_MEMORY_OBJECTS.c */
#define _SC_SHARED_MEMORY_OBJECTS                                             67
/* ./src/unistd/_SC_SIGQUEUE_MAX.c */
#define _SC_SIGQUEUE_MAX                                                      69
/* ./src/unistd/_SC_SYNCHRONIZED_IO.c */
#define _SC_SYNCHRONIZED_IO                                                   76
/* ./src/unistd/_SC_TIMERS.c */
#define _SC_TIMERS                                                            95
/* ./src/unistd/_SC_TIMER_MAX.c */
#define _SC_TIMER_MAX                                                         94
#endif

#if	(defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/unistd/_SC_PAGESIZE.c */
#define _SC_PAGESIZE /* TODO */
#endif

#if	(defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE)
/* ./src/unistd/_CS_PATH.c */
#define _CS_PATH                                                               0
/* ./src/unistd/_POSIX2_CHAR_TERM.c */
#define _POSIX2_CHAR_TERM                                      (_POSIX2_VERSION)
/* ./src/unistd/_POSIX2_C_BIND.c */
#define _POSIX2_C_BIND                                         (_POSIX2_VERSION)
/* ./src/unistd/_POSIX2_C_DEV.c */
#define _POSIX2_C_DEV                                          (_POSIX2_VERSION)
/* ./src/unistd/_POSIX2_C_VERSION.c */
#define _POSIX2_C_VERSION                                      (_POSIX2_VERSION)
/* ./src/unistd/_POSIX2_FORT_DEV.c */
#define _POSIX2_FORT_DEV                                       (_POSIX2_VERSION)
/* ./src/unistd/_POSIX2_FORT_RUN.c */
#define _POSIX2_FORT_RUN                                       (_POSIX2_VERSION)
/* ./src/unistd/_POSIX2_SW_DEV.c */
#define _POSIX2_SW_DEV                                         (_POSIX2_VERSION)
/* ./src/unistd/_POSIX2_UPE.c */
#define _POSIX2_UPE                                            (_POSIX2_VERSION)
/* ./src/unistd/_POSIX2_VERSION.c */
#if (defined _POSIX_C_SOURCE)
#if _POSIX_C_SOURCE >= 200809L
#define _POSIX2_VERSION                                                (200809L)
#elif _POSIX_C_SOURCE >= 200112L
#define _POSIX2_VERSION                                                (200112L)
#elif _POSIX_C_SOURCE >= 199506L
#define _POSIX2_VERSION                                                (199506L)
#elif _POSIX_C_SOURCE >= 2
#define _POSIX2_VERSION                                                (199209L)
#else
#undef _POSIX2_VERSION
#endif
#endif
/* ./src/unistd/_SC_2_C_BIND.c */
#define _SC_2_C_BIND                                                           1
/* ./src/unistd/_SC_2_C_DEV.c */
#define _SC_2_C_DEV                                                            1
/* ./src/unistd/_SC_2_C_VERSION.c */
#define _SC_2_C_VERSION                                                        1
/* ./src/unistd/_SC_2_FORT_DEV.c */
#define _SC_2_FORT_DEV                                                         3
/* ./src/unistd/_SC_2_FORT_RUN.c */
#define _SC_2_FORT_RUN                                                         4
/* ./src/unistd/_SC_2_LOCALEDEF.c */
#define _SC_2_LOCALEDEF                                                        5
/* ./src/unistd/_SC_2_SW_DEV.c */
#define _SC_2_SW_DEV                                                          12
/* ./src/unistd/_SC_2_UPE.c */
#define _SC_2_UPE                                                             13
/* ./src/unistd/_SC_2_VERSION.c */
#define _SC_2_VERSION                                                         14
/* ./src/unistd/_SC_BC_BASE_MAX.c */
#define _SC_BC_BASE_MAX                                                       23
/* ./src/unistd/_SC_BC_DIM_MAX.c */
#define _SC_BC_DIM_MAX                                                        24
/* ./src/unistd/_SC_BC_SCALE_MAX.c */
#define _SC_BC_SCALE_MAX                                                      25
/* ./src/unistd/_SC_BC_STRING_MAX.c */
#define _SC_BC_STRING_MAX                                                     26
/* ./src/unistd/_SC_COLL_WEIGHTS_MAX.c */
#define _SC_COLL_WEIGHTS_MAX                                                  30
/* ./src/unistd/_SC_EXPR_NEST_MAX.c */
#define _SC_EXPR_NEST_MAX                                                     33
/* ./src/unistd/_SC_LINE_MAX.c */
#define _SC_LINE_MAX                                                          41
/* ./src/unistd/_SC_RE_DUP_MAX.c */
#define _SC_RE_DUP_MAX                                                        58
#endif

#if	(defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE)
/* ./src/unistd/_SC_XOPEN_CRYPT.c */
#define _SC_XOPEN_CRYPT                                                      116
/* ./src/unistd/_SC_XOPEN_ENH_I18N.c */
#define _SC_XOPEN_ENH_I18N                                                   117
/* ./src/unistd/_SC_XOPEN_SHM.c */
#define _SC_XOPEN_SHM                                                        120
#endif

#if	(defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/unistd/_SC_ATEXIT_MAX.c */
#define _SC_ATEXIT_MAX                                                        21
/* ./src/unistd/_SC_IOV_MAX.c */
#define _SC_IOV_MAX                                                           38
/* ./src/unistd/_SC_PAGE_SIZE.c */
#define _SC_PAGE_SIZE                                                         53
/* ./src/unistd/_SC_XOPEN_UNIX.c */
#define _SC_XOPEN_UNIX                                                       122
#endif

#if	(defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE && 500 <= _XOPEN_SOURCE)
/* ./src/unistd/_SC_XOPEN_VERSION.c */
#define _SC_XOPEN_VERSION                                                    124
#endif

#if	(defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/unistd/_POSIX2_LOCALEDEF.c */
#define _POSIX2_LOCALEDEF                                      (_POSIX2_VERSION)
#endif

#if	(defined _XOPEN_SOURCE)
/* ./src/unistd/_XOPEN_CRYPT.c */
#define _XOPEN_CRYPT                                               _XOPEN_SOURCE
/* ./src/unistd/_XOPEN_ENH_I18N.c */
#define _XOPEN_ENH_I18N                                            _XOPEN_SOURCE
/* ./src/unistd/_XOPEN_VERSION.c */
#if (defined _XOPEN_SOURCE)
#if _XOPEN_SOURCE >= 700
#define _XOPEN_VERSION                                                     (700)
#elif _XOPEN_SOURCE >= 600
#define _XOPEN_VERSION                                                     (600)
#elif _XOPEN_SOURCE >= 500
#define _XOPEN_VERSION                                                     (500)
#else
#define _XOPEN_VERSION                                                       (4)
#endif
#endif
#endif

#if	(defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600)
/* ./src/unistd/_SC_PASS_MAX.c */
#define _SC_PASS_MAX /* TODO */
/* ./src/unistd/_XOPEN_XCU_VERSION.c */
#define _XOPEN_XCU_VERSION /* TODO */
#endif

#if	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/unistd/F_LOCK.c */
#define F_LOCK                                                                 0
/* ./src/unistd/F_TEST.c */
#define F_TEST                                                                 1
/* ./src/unistd/F_TLOCK.c */
#define F_TLOCK                                                                2
/* ./src/unistd/F_ULOCK.c */
#define F_ULOCK                                                                3
/* ./src/unistd/_XOPEN_SHM.c */
#define _XOPEN_SHM                                                 _XOPEN_SOURCE
/* ./src/unistd/_XOPEN_UNIX.c */
#define _XOPEN_UNIX /* TODO */
#endif

#if	(defined _XOPEN_SOURCE && 500 <= _XOPEN_SOURCE && _XOPEN_SOURCE < 600)
/* ./src/unistd/_SC_XOPEN_XCU_VERSION.c */
#define _SC_XOPEN_XCU_VERSION /* TODO */
#endif

/* src/stddef/size_t.c */
#ifndef __TYPE_size_t_DEFINED__
#define __TYPE_size_t_DEFINED__
#ifdef __LLP64__
# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L
typedef unsigned __int64                                                 size_t;
# else
typedef unsigned long long int                                           size_t;
# endif
#else
typedef unsigned long int                                                size_t;
#endif
#endif

/* src/sys/types/ssize_t.c */
#ifndef __TYPE_ssize_t_DEFINED__
#define __TYPE_ssize_t_DEFINED__
typedef long int                                                        ssize_t;
#endif


#if	(defined _XOPEN_SOURCE)
/* src/sys/types/gid_t.c */
#ifndef __TYPE_gid_t_DEFINED__
#define __TYPE_gid_t_DEFINED__
typedef                                                        unsigned long int
	gid_t;
#endif

/* src/sys/types/off_t.c */
#ifndef __TYPE_off_t_DEFINED__
#define __TYPE_off_t_DEFINED__
typedef                                                                 long int
	off_t;
#endif

/* src/sys/types/pid_t.c */
#ifndef __TYPE_pid_t_DEFINED__
#define __TYPE_pid_t_DEFINED__
typedef long int                                                          pid_t;
#endif

/* src/sys/types/uid_t.c */
#ifndef __TYPE_uid_t_DEFINED__
#define __TYPE_uid_t_DEFINED__
typedef                                                        unsigned long int
	uid_t;
#endif

#endif

#if	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* src/sys/types/useconds_t.c */
#ifndef __TYPE_useconds_t_DEFINED__
#define __TYPE_useconds_t_DEFINED__
typedef unsigned int                                                 useconds_t;
#endif

#endif

#if	(defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE)
/* ./src/unistd/optarg.c */
extern char * optarg;
/* ./src/unistd/opterr.c */
extern int opterr;
/* ./src/unistd/optind.c */
extern int optind;
/* ./src/unistd/optopt.c */
extern int optopt;
#endif

#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
#define restrict
#endif

#if	(defined _POSIX_SOURCE)
/* ./src/unistd/_exit.c */
void _exit(int __status);
/* ./src/unistd/access.c */
int access(const char *__path, int __amode);
/* ./src/unistd/alarm.c */
unsigned alarm(unsigned __seconds);
/* ./src/unistd/chdir.c */
int chdir(const char *__path);
/* ./src/unistd/chown.c */
int chown(const char *__path, uid_t __owner, gid_t __group);
/* ./src/unistd/close.c */
int close(int __fildes);
/* ./src/unistd/ctermid.c */
char * ctermid(char * __s);
/* ./src/unistd/dup.c */
int dup(int __fildes);
/* ./src/unistd/dup2.c */
int dup2(int __fildes, int __fildes2);
/* ./src/unistd/execl.c */
int execl(const char *__path, const char *__arg0, ...  /*, (char *)0 */);
/* ./src/unistd/execle.c */
int execle(const char *__path, const char *__arg0, ... /*, (char *)0, char *const envp[] */);
/* ./src/unistd/execlp.c */
int execlp(const char *__file, const char *__arg0, ...  /*, (char *0) */);
/* ./src/unistd/execv.c */
int execv(const char *__path, char *const argv[]);
/* ./src/unistd/execve.c */
int execve(const char *__path, char *const argv[], char *const envp[]);
/* ./src/unistd/execvp.c */
int execvp(const char *__file, char *const argv[]);
/* ./src/unistd/fork.c */
pid_t fork(void);
/* ./src/unistd/fpathconf.c */
long fpathconf(int __fildes, int __name);
/* ./src/unistd/getcwd.c */
char * getcwd(char *__buf, size_t __size);
/* ./src/unistd/getegid.c */
gid_t getegid(void);
/* ./src/unistd/geteuid.c */
uid_t geteuid(void);
/* ./src/unistd/getgid.c */
gid_t getgid(void);
/* ./src/unistd/getgroups.c */
int getgroups(int __gidsetsize, gid_t grouplist[]);
/* ./src/unistd/getlogin.c */
char * getlogin(void);
/* ./src/unistd/getpgrp.c */
pid_t getpgrp(void);
/* ./src/unistd/getpid.c */
pid_t getpid(void);
/* ./src/unistd/getppid.c */
pid_t getppid(void);
/* ./src/unistd/getuid.c */
uid_t getuid(void);
/* ./src/unistd/isatty.c */
int isatty(int __fildes);
/* ./src/unistd/link.c */
int link(const char *__path1, const char *__path2);
/* ./src/unistd/lseek.c */
off_t lseek(int __fildes, off_t __offset, int __whence);
/* ./src/unistd/pathconf.c */
long pathconf(const char *__path, int __name);
/* ./src/unistd/pause.c */
int pause(void);
/* ./src/unistd/pipe.c */
int pipe(int fildes[2]);
/* ./src/unistd/read.c */
ssize_t read(int __fildes, void *__buf, size_t __nbyte);
/* ./src/unistd/rmdir.c */
int rmdir(const char *__path);
/* ./src/unistd/setgid.c */
int setgid(gid_t __gid);
/* ./src/unistd/setpgid.c */
int setpgid(pid_t __pid, pid_t __pgid);
/* ./src/unistd/setsid.c */
pid_t setsid(void);
/* ./src/unistd/setuid.c */
int setuid(uid_t __uid);
/* ./src/unistd/sleep.c */
unsigned sleep(unsigned __seconds);
/* ./src/unistd/sysconf.c */
long sysconf(int __name);
/* ./src/unistd/tcgetpgrp.c */
pid_t tcgetpgrp(int __fildes);
/* ./src/unistd/tcsetpgrp.c */
int tcsetpgrp(int __fildes, pid_t __pgid_id);
/* ./src/unistd/ttyname.c */
char *ttyname(int __fildes);
/* ./src/unistd/unlink.c */
int unlink(const char *__path);
/* ./src/unistd/write.c */
ssize_t write(int __fildes, const void *__buf, size_t __nbyte);
#endif

#if	(defined _POSIX_SOURCE && (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 199506))
/* ./src/unistd/cuserid.c */
char *cuserid(char *__s);
#endif

#if	(defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE)
/* ./src/unistd/fdatasync.c */
int fdatasync(int __fildes);
#endif

#if	(defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE)
/* ./src/unistd/fsync.c */
int fsync(int __fildes);
#endif

#if	(defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/unistd/ftruncate.c */
int ftruncate(int __fildes, off_t __length);
#endif

#if	(defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE)
/* ./src/unistd/confstr.c */
size_t confstr(int __name, char *__buf, size_t __len);
/* ./src/unistd/getopt.c */
int getopt(int __argc, char * const argv[], const char *__optstring);
#endif

#if	(defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/unistd/fchown.c */
int fchown(int __fildes, uid_t __owner, gid_t __group);
/* ./src/unistd/readlink.c */
ssize_t readlink(const char * restrict __path, char * restrict __buf, size_t __bufsize);
/* ./src/unistd/symlink.c */
int symlink(const char*__path1, const char *__path2);
#endif

#if	(defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/unistd/fchdir.c */
int fchdir(int __fildes);
/* ./src/unistd/getpgid.c */
pid_t getpgid(pid_t __pid);
/* ./src/unistd/getsid.c */
pid_t getsid(pid_t __pid);
/* ./src/unistd/lchown.c */
int lchown(const char *__path, uid_t __owner, gid_t __group);
/* ./src/unistd/truncate.c */
int truncate(const char *__path, off_t __length);
#endif

#if	(defined _XOPEN_SOURCE)
/* ./src/unistd/crypt.c */
char * crypt( const char *__key, const char *__salt);
/* ./src/unistd/encrypt.c */
void encrypt(char block[64], int __edflag);
/* ./src/unistd/nice.c */
int nice(int __incr);
/* ./src/unistd/swab.c */
void swab(const void * restrict __src, void * restrict __dest, ssize_t __nbytes);
#endif

#if	(defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600)
/* ./src/unistd/getpass.c */
char *getpass(const char *__prompt);
#endif

#if	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/unistd/gethostid.c */
long gethostid(void);
/* ./src/unistd/lockf.c */
int lockf(int __fildes, int __function, off_t __size);
/* ./src/unistd/setpgrp.c */
pid_t setpgrp(void);
/* ./src/unistd/setregid.c */
int setregid(gid_t __rgid, gid_t __egid);
/* ./src/unistd/setreuid.c */
int setreuid(uid_t __ruid, uid_t __euid);
/* ./src/unistd/sync.c */
void sync(void);
#endif

#if	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600)
/* ./src/unistd/brk.c */
int brk(void *__addr);
/* ./src/unistd/chroot.c */
int chroot(const char *__path);
/* ./src/unistd/getdtablesize.c */
int getdtablesize(void);
/* ./src/unistd/getpagesize.c */
int getpagesize(void);
/* ./src/unistd/sbrk.c */
void *sbrk(int __incr);
#endif

#if	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700)
/* ./src/unistd/getwd.c */
char *getwd(char *__path_name);
/* ./src/unistd/ualarm.c */
useconds_t ualarm(useconds_t __useconds, useconds_t __interval);
/* ./src/unistd/usleep.c */
int usleep(useconds_t __useconds);
/* ./src/unistd/vfork.c */
pid_t vfork(void);
#endif


#endif