summaryrefslogtreecommitdiff
path: root/vapi/posix.vapi
blob: 8651cdc9ab0e43e54f621f190d7cd92c123d9a5a (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
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
/* posix.vapi
 *
 * Copyright (C) 2008-2009  Jürg Billeter
 * Copyright (C) 2010 Marco Trevisan (Treviño)
 * Copyright (C) 2013 Nikolay Orliuk
 * Copyright (C) 2020 Reuben Thomas
 * Copyright (C) 2021 Nikola Hadžić
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Jürg Billeter <j@bitron.ch>
 *  Marco Trevisan (Treviño) <mail@3v1n0.net>
 *  Nikolay Orliuk <virkony@gmail.com>
 *  Nikola Hadžić <nikola.hadzic.000@protonmail.com>
 */

#if POSIX
[CCode (cname = "bool", cheader_filename = "stdbool.h", default_value = "false")]
[BooleanType]
public struct bool {
	public inline unowned string to_string () {
		if (this) {
			return "true";
		} else {
			return "false";
		}
	}

	public static inline bool parse (string str) {
		if (str == "true") {
			return true;
		} else {
			return false;
		}
	}
}

[CCode (cname = "char", default_value = "\'\\0\'")]
[IntegerType (rank = 2, min = 0, max = 127)]
public struct char {
	public inline string to_string () {
		return "%c".printf (this);
	}
}

[CCode (cname = "unsigned char", default_value = "\'\\0\'")]
[IntegerType (rank = 3, min = 0, max = 255)]
public struct uchar {
	public inline string to_string () {
		return "%hhu".printf (this);
	}
}

[CCode (cname = "int", default_value = "0")]
[IntegerType (rank = 6)]
public struct int {
	public inline string to_string () {
		return "%d".printf (this);
	}

	[CCode (cname = "atoi", cheader_filename = "stdlib.h")]
	public static int parse (string str);
}

[CCode (cname = "unsigned int", default_value = "0U")]
[IntegerType (rank = 7)]
public struct uint {
	public inline string to_string () {
		return "%u".printf (this);
	}
}

[CCode (cname = "short", default_value = "0")]
[IntegerType (rank = 4, min = -32768, max = 32767)]
public struct short {
	public inline string to_string () {
		return "%hi".printf (this);
	}
}

[CCode (cname = "unsigned short", default_value = "0U")]
[IntegerType (rank = 5, min = 0, max = 65535)]
public struct ushort {
	public inline string to_string () {
		return "%hu".printf (this);
	}
}

[CCode (cname = "long", default_value = "0L")]
[IntegerType (rank = 8)]
public struct long {
	public inline string to_string () {
		return "%li".printf (this);
	}

	[CCode (cname = "atol", cheader_filename = "stdlib.h")]
	public static long parse (string str);
}

[CCode (cname = "unsigned long", default_value = "0UL")]
[IntegerType (rank = 9)]
public struct ulong {
	public inline string to_string () {
		return "%lu".printf (this);
	}
}

[CCode (cname = "size_t", cheader_filename = "sys/types.h", default_value = "0UL")]
[IntegerType (rank = 9)]
public struct size_t {
	public inline string to_string () {
		return "%zu".printf (this);
	}
}

[CCode (cname = "ssize_t", cheader_filename = "sys/types.h", default_value = "0L")]
[IntegerType (rank = 8)]
public struct ssize_t {
	public inline string to_string () {
		return "%zi".printf (this);
	}
}

[CCode (cname = "int8_t", cheader_filename = "stdint.h", default_value = "0")]
[IntegerType (rank = 1, min = -128, max = 127)]
public struct int8 {
	[CCode (cname = "PRIi8", cheader_filename = "inttypes.h")]
	public const string FORMAT;

	public inline string to_string () {
		return ("%" + FORMAT).printf (this);
	}
}

[CCode (cname = "uint8_t", cheader_filename = "stdint.h", default_value = "0U")]
[IntegerType (rank = 3, min = 0, max = 255)]
public struct uint8 {
	[CCode (cname = "PRIu8", cheader_filename = "inttypes.h")]
	public const string FORMAT;

	public inline string to_string () {
		return ("%" + FORMAT).printf (this);
	}
}

[CCode (cname = "int16_t", cheader_filename = "stdint.h", default_value = "0")]
[IntegerType (rank = 4, min = -32768, max = 32767)]
public struct int16 {
	[CCode (cname = "PRIi16", cheader_filename = "inttypes.h")]
	public const string FORMAT;

	public inline string to_string () {
		return ("%" + FORMAT).printf (this);
	}
}

[CCode (cname = "uint16_t", cheader_filename = "stdint.h", default_value = "0U")]
[IntegerType (rank = 5, min = 0, max = 65535)]
public struct uint16 {
	[CCode (cname = "PRIu16", cheader_filename = "inttypes.h")]
	public const string FORMAT;

	public inline string to_string () {
		return ("%" + FORMAT).printf (this);
	}
}

[CCode (cname = "int32_t", cheader_filename = "stdint.h", default_value = "0")]
[IntegerType (rank = 6)]
public struct int32 {
	[CCode (cname = "PRIi32", cheader_filename = "inttypes.h")]
	public const string FORMAT;

	public inline string to_string () {
		return ("%" + FORMAT).printf (this);
	}
}

[CCode (cname = "uint32_t", cheader_filename = "stdint.h", default_value = "0U")]
[IntegerType (rank = 7)]
public struct uint32 {
	[CCode (cname = "PRIu32", cheader_filename = "inttypes.h")]
	public const string FORMAT;

	public inline string to_string () {
		return ("%" + FORMAT).printf (this);
	}
}

[CCode (cname = "int64_t", cheader_filename = "stdint.h", default_value = "0LL")]
[IntegerType (rank = 10)]
public struct int64 {
	[CCode (cname = "PRIi64", cheader_filename = "inttypes.h")]
	public const string FORMAT;

	public inline string to_string () {
		return ("%" + FORMAT).printf (this);
	}

	[CCode (cname = "strtoll", cheader_filename = "stdlib.h")]
	public static int64 parse (string str, out unowned string? end = null, int base = 10);
}

[CCode (cname = "uint64_t", cheader_filename = "stdint.h", default_value = "0ULL")]
[IntegerType (rank = 11)]
public struct uint64 {
	[CCode (cname = "PRIu64", cheader_filename = "inttypes.h")]
	public const string FORMAT;

	public inline string to_string () {
		return ("%" + FORMAT).printf (this);
	}

	[CCode (cname = "strtoull", cheader_filename = "stdlib.h")]
	public static uint64 parse (string str, out unowned string? end = null, int base = 10);
}

[CCode (cname = "float", default_value = "0.0F")]
[FloatingType (rank = 1)]
public struct float {
	public inline string to_string () {
		return "%.8g".printf (this);
	}
}

[CCode (cname = "double", default_value = "0.0")]
[FloatingType (rank = 2)]
public struct double {
	public inline string to_string () {
		return "%.17g".printf (this);
	}

	[CCode (cname = "strtod", cheader_filename = "stdlib.h")]
	public static double parse (string str, out unowned string? end = null);
}

[CCode (cheader_filename = "time.h")]
[IntegerType (rank = 8)]
public struct time_t {
	[CCode (cname = "time")]
	public time_t (time_t? tloc = null);
}

[SimpleType]
[CCode (cheader_filename = "stdarg.h", cprefix = "va_", has_type_id = false, destroy_function = "va_end", lvalue_access = false)]
public struct va_list {
	[CCode (cname = "va_start")]
	public va_list ();
	[CCode (cname = "va_copy")]
	public va_list.copy (va_list src);
	[CCode (generic_type_pos = 1.1, simple_generics = true)]
	public unowned G arg<G> ();
}

[Compact]
[Immutable]
[CCode (cname = "char", const_cname = "const char", copy_function = "strdup", free_function = "free", cheader_filename = "stdlib.h,string.h")]
public class string {
	[PrintfFormat]
	public string printf (...);

	public string concat (...) {
		string result = this;
		var l = va_list ();
		while (true) {
			unowned string? arg = l.arg ();
			if (arg == null) {
				break;
			} else {
				result += arg;
			}
		}
		return result;
	}

	public inline unowned string to_string () {
		return this;
	}

	public int length {
		[CCode (cname = "strlen")]
		get;
	}
}

[CCode (cname="printf", cheader_filename = "stdio.h")]
[PrintfFormat]
public void print (string format,...);

#endif

[CCode (cprefix = "", lower_case_cprefix = "")]
namespace Posix {
	[CCode (cheader_filename = "assert.h")]
	public void assert (bool expression);

	[CCode (cheader_filename = "ctype.h")]
	public bool isalnum (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool isalpha (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool isascii (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool iscntrl (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool isdigit (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool isgraph (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool islower (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool isprint (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool ispunct (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool isspace (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool isupper (int c);
	[CCode (cheader_filename = "ctype.h")]
	public bool isxdigit (int c);
	[CCode (cheader_filename = "ctype.h")]
	public int toascii (int c);
	[CCode (cheader_filename = "ctype.h")]
	public int tolower (int c);
	[CCode (cheader_filename = "ctype.h")]
	public int toupper (int c);

	[Compact]
	[CCode (cname = "struct dirent", cheader_filename = "dirent.h")]
	public class DirEnt {
		public ino_t d_ino;
		public off_t d_off;
		public ushort d_reclen;
		public char d_type;
		public char d_name[256];
	}

	[Compact]
	[CCode (cname = "DIR", free_function = "closedir", cheader_filename = "dirent.h")]
	public class Dir {
	}

	[CCode (cheader_filename = "dirent.h")]
	public int dirfd (Dir dir);
	[CCode (cheader_filename = "dirent.h")]
	public Dir? opendir (string filename);
	[CCode (cheader_filename = "dirent.h")]
	public Dir? fdopendir (int fd);
	[CCode (cheader_filename = "dirent.h")]
	public unowned DirEnt? readdir (Dir dir);
	[CCode (cheader_filename = "dirent.h")]
	public void rewinddir (Dir dir);
	[CCode (cheader_filename = "dirent.h")]
	public void seekdir (Dir dir, long pos);
	[CCode (cheader_filename = "dirent.h")]
	public long telldir (Dir dir);

	[CCode (cheader_filename = "errno.h")]
	public int errno;
	[CCode (cheader_filename = "errno.h")]
	public const int E2BIG;
	[CCode (cheader_filename = "errno.h")]
	public const int EACCES;
	[CCode (cheader_filename = "errno.h")]
	public const int EADDRINUSE;
	[CCode (cheader_filename = "errno.h")]
	public const int EADDRNOTAVAIL;
	[CCode (cheader_filename = "errno.h")]
	public const int EAFNOSUPPORT;
	[CCode (cheader_filename = "errno.h")]
	public const int EAGAIN;
	[CCode (cheader_filename = "errno.h")]
	public const int EALREADY;
	[CCode (cheader_filename = "errno.h")]
	public const int EBADF;
	[CCode (cheader_filename = "errno.h")]
	public const int EBADMSG;
	[CCode (cheader_filename = "errno.h")]
	public const int EBUSY;
	[CCode (cheader_filename = "errno.h")]
	public const int ECANCELED;
	[CCode (cheader_filename = "errno.h")]
	public const int ECHILD;
	[CCode (cheader_filename = "errno.h")]
	public const int ECONNABORTED;
	[CCode (cheader_filename = "errno.h")]
	public const int ECONNREFUSED;
	[CCode (cheader_filename = "errno.h")]
	public const int ECONNRESET;
	[CCode (cheader_filename = "errno.h")]
	public const int EDEADLK;
	[CCode (cheader_filename = "errno.h")]
	public const int EDESTADDRREQ;
	[CCode (cheader_filename = "errno.h")]
	public const int EDOM;
	[CCode (cheader_filename = "errno.h")]
	public const int EDQUOT;
	[CCode (cheader_filename = "errno.h")]
	public const int EEXIST;
	[CCode (cheader_filename = "errno.h")]
	public const int EFAULT;
	[CCode (cheader_filename = "errno.h")]
	public const int EFBIG;
	[CCode (cheader_filename = "errno.h")]
	public const int EHOSTUNREACH;
	[CCode (cheader_filename = "errno.h")]
	public const int EIDRM;
	[CCode (cheader_filename = "errno.h")]
	public const int EILSEQ;
	[CCode (cheader_filename = "errno.h")]
	public const int EINPROGRESS;
	[CCode (cheader_filename = "errno.h")]
	public const int EINTR;
	[CCode (cheader_filename = "errno.h")]
	public const int EINVAL;
	[CCode (cheader_filename = "errno.h")]
	public const int EIO;
	[CCode (cheader_filename = "errno.h")]
	public const int EISCONN;
	[CCode (cheader_filename = "errno.h")]
	public const int EISDIR;
	[CCode (cheader_filename = "errno.h")]
	public const int ELOOP;
	[CCode (cheader_filename = "errno.h")]
	public const int EMFILE;
	[CCode (cheader_filename = "errno.h")]
	public const int EMLINK;
	[CCode (cheader_filename = "errno.h")]
	public const int EMSGSIZE;
	[CCode (cheader_filename = "errno.h")]
	public const int EMULTIHOP;
	[CCode (cheader_filename = "errno.h")]
	public const int ENAMETOOLONG;
	[CCode (cheader_filename = "errno.h")]
	public const int ENETDOWN;
	[CCode (cheader_filename = "errno.h")]
	public const int ENETRESET;
	[CCode (cheader_filename = "errno.h")]
	public const int ENETUNREACH;
	[CCode (cheader_filename = "errno.h")]
	public const int ENFILE;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOBUFS;
	[CCode (cheader_filename = "errno.h")]
	public const int ENODATA;
	[CCode (cheader_filename = "errno.h")]
	public const int ENODEV;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOENT;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOEXEC;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOLCK;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOLINK;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOMEM;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOMSG;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOPROTOOPT;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOSPC;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOSR;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOSTR;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOSYS;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOTCONN;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOTDIR;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOTEMPTY;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOTSOCK;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOTSUP;
	[CCode (cheader_filename = "errno.h")]
	public const int ENOTTY;
	[CCode (cheader_filename = "errno.h")]
	public const int ENXIO;
	[CCode (cheader_filename = "errno.h")]
	public const int EOPNOTSUPP;
	[CCode (cheader_filename = "errno.h")]
	public const int EOVERFLOW;
	[CCode (cheader_filename = "errno.h")]
	public const int EPERM;
	[CCode (cheader_filename = "errno.h")]
	public const int EPIPE;
	[CCode (cheader_filename = "errno.h")]
	public const int EPROTO;
	[CCode (cheader_filename = "errno.h")]
	public const int EPROTONOSUPPORT;
	[CCode (cheader_filename = "errno.h")]
	public const int EPROTOTYPE;
	[CCode (cheader_filename = "errno.h")]
	public const int ERANGE;
	[CCode (cheader_filename = "errno.h")]
	public const int EROFS;
	[CCode (cheader_filename = "errno.h")]
	public const int ESPIPE;
	[CCode (cheader_filename = "errno.h")]
	public const int ESRCH;
	[CCode (cheader_filename = "errno.h")]
	public const int ESTALE;
	[CCode (cheader_filename = "errno.h")]
	public const int ETIME;
	[CCode (cheader_filename = "errno.h")]
	public const int ETIMEDOUT;
	[CCode (cheader_filename = "errno.h")]
	public const int ETXTBSY;
	[CCode (cheader_filename = "errno.h")]
	public const int EWOULDBLOCK;
	[CCode (cheader_filename = "errno.h")]
	public const int EXDEV;

	[CCode (cheader_filename = "fcntl.h")]
	public const int F_DUPFD;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_GETFD;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_SETFD;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_GETFL;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_SETFL;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_GETLK;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_SETLK;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_SETLKW;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_GETOWN;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_SETOWN;
	[CCode (cheader_filename = "fcntl.h")]
	public const int FD_CLOEXEC;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_RDLCK;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_UNLCK;
	[CCode (cheader_filename = "fcntl.h")]
	public const int F_WRLCK;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_CREAT;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_EXCL;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_NOCTTY;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_TRUNC;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_APPEND;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_DSYNC;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_NONBLOCK;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_RSYNC;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_SYNC;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_ACCMODE;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_RDONLY;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_RDWR;
	[CCode (cheader_filename = "fcntl.h")]
	public const int O_WRONLY;
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public const int O_DIRECTORY;
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public const int O_CLOEXEC;
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public const int O_NOFOLLOW;
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public const int AT_FDCWD;
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public const int AT_EACCESS;
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public const int AT_SYMLINK_FOLLOW;
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public const int AT_SYMLINK_NOFOLLOW;
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public const int AT_REMOVEDIR;
	[CCode (cheader_filename = "fcntl.h")]
	public const int POSIX_FADV_NORMAL;
	[CCode (cheader_filename = "fcntl.h")]
	public const int POSIX_FADV_SEQUENTIAL;
	[CCode (cheader_filename = "fcntl.h")]
	public const int POSIX_FADV_RANDOM;
	[CCode (cheader_filename = "fcntl.h")]
	public const int POSIX_FADV_WILLNEED;
	[CCode (cheader_filename = "fcntl.h")]
	public const int POSIX_FADV_DONTNEED;
	[CCode (cheader_filename = "fcntl.h")]
	public const int POSIX_FADV_NOREUSE;
	[CCode (cheader_filename = "fcntl.h")]
	public int creat (string path, mode_t mode);
	[CCode (cheader_filename = "fcntl.h")]
	public int fcntl (int fd, int cmd, ...);
	[CCode (cheader_filename = "fcntl.h")]
	public int open (string path, int oflag, mode_t mode=0);
	[CCode (cheader_filename = "fcntl.h", feature_test_macro = "_GNU_SOURCE")]
	public int openat (int dirfd, string path, int oflag, mode_t mode=0);
	[CCode (cheader_filename = "fcntl.h")]
	public int posix_fadvise (int fd, long offset, long len, int advice);
	[CCode (cheader_filename = "fcntl.h")]
	public int posix_fallocate (int fd, long offset, long len);

	[CCode (cname = "struct flock", cheader_filename = "fcntl.h", has_type_id = false)]
	public struct Flock {
		public int l_type;
		public int l_whence;
		public off_t l_start;
		public off_t l_len;
		public pid_t l_pid;
	}

	[CCode(cheader_filename = "fnmatch.h")]
	public int fnmatch (string pattern, string str, int flags = 0);

	[CCode(cheader_filename = "fnmatch.h", feature_test_macro = "_GNU_SOURCE")]
	public const int FNM_CASEFOLD;
	[CCode(cheader_filename = "fnmatch.h", feature_test_macro = "_GNU_SOURCE")]
	public const int FNM_EXTMATCH;
	[CCode(cheader_filename = "fnmatch.h", feature_test_macro = "_GNU_SOURCE")]
	public const int FNM_FILE_NAME;
	[CCode(cheader_filename = "fnmatch.h", feature_test_macro = "_GNU_SOURCE")]
	public const int FNM_LEADING_DIR;
	[CCode(cheader_filename = "fnmatch.h")]
	public const int FNM_NOESCAPE;
	[CCode(cheader_filename = "fnmatch.h")]
	public const int FNM_NOMATCH;
	[CCode(cheader_filename = "fnmatch.h")]
	public const int FNM_PATHNAME;
	[CCode(cheader_filename = "fnmatch.h")]
	public const int FNM_PERIOD;

	[Compact]
	[CCode (cname = "struct group", cheader_filename = "grp.h")]
	public class Group {
		public string gr_name;
		public string gr_passwd;
		public gid_t gr_gid;
		[CCode (array_length = false, array_null_terminated = true)]
		public string[] gr_mem;
	}
	[CCode (cheader_filename = "grp.h")]
	public void endgrent ();
	public unowned Group? getgrent ();
	public void setgrent ();
	[CCode (cheader_filename = "grp.h")]
	public unowned Group? getgrgid (gid_t gid);
	[CCode (cheader_filename = "grp.h")]
	public unowned Group? getgrnam (string name);

	[CCode (cheader_filename = "netinet/in.h")]
	public const int INET_ADDRSTRLEN;
	[CCode (cheader_filename = "netinet/in.h")]
	public const int INET6_ADDRSTRLEN;

	[CCode (cheader_filename = "netinet/in.h", cname = "int", cprefix = "IPPROTO_", has_type_id = false)]
	public enum IPProto {
		IP,
		ICMP,
		IGMP,
		IPIP,
		TCP,
		EGP,
		PUP,
		UDP,
		IDP,
		TP,
		DCCP,
		IPV6,
		RSVP,
		GRE,
		ESP,
		AH,
		MTP,
		BEETPH,
		ENCAP,
		PIM,
		COMP,
		SCTP,
		UDPLITE,
		RAW,
	}

	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_NODELAY;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_MAXSEG;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_CORK;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_KEEPIDLE;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_KEEPINTVL;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_KEEPCNT;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_SYNCNT;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_LINGER2;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_DEFER_ACCEPT;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_WINDOW_CLAMP;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_INFO;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_QUICKACK;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_CONGESTION;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_MD5SIG;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_COOKIE_TRANSACTIONS;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_THIN_LINEAR_TIMEOUTS;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_THIN_DUPACK;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_USER_TIMEOUT;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_REPAIR;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_REPAIR_QUEUE;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_QUEUE_SEQ;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_REPAIR_OPTIONS;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_FASTOPEN;
	[CCode (cheader_filename = "netinet/tcp.h")]
	public const int TCP_TIMESTAMP;

	[CCode (cheader_filename = "arpa/inet.h")]
	public uint32 inet_addr (string host);
	[CCode (cheader_filename = "arpa/inet.h")]
	public unowned string inet_ntoa (InAddr addr);
	[CCode (cheader_filename = "arpa/inet.h")]
	public unowned string? inet_ntop (int af, void* src, uint8[] dst);
	[CCode (cheader_filename = "arpa/inet.h")]
	public int inet_pton (int af, string src, void* dst);
	[CCode (cheader_filename = "arpa/inet.h")]
	public uint32 htonl (uint32 hostlong);
	[CCode (cheader_filename = "arpa/inet.h")]
	public uint32 ntohl (uint32 netlong);
	[CCode (cheader_filename = "arpa/inet.h")]
	public uint16 htons (uint16 hostshort);
	[CCode (cheader_filename = "arpa/inet.h")]
	public uint16 ntohs (uint16 netshort);

	[CCode (cheader_filename = "math.h")]
	public double acos (double x);
	[CCode (cheader_filename = "math.h")]
	public float acosf (float x);
	[CCode (cheader_filename = "math.h")]
	public double asin (double x);
	[CCode (cheader_filename = "math.h")]
	public float asinf (float x);
	[CCode (cheader_filename = "math.h")]
	public double atan (double x);
	[CCode (cheader_filename = "math.h")]
	public float atanf (float x);
	[CCode (cheader_filename = "math.h")]
	public double atan2 (double y, double x);
	[CCode (cheader_filename = "math.h")]
	public float atan2f (float y, float x);
	[CCode (cheader_filename = "math.h")]
	public double cos (double x);
	[CCode (cheader_filename = "math.h")]
	public float cosf (float x);
	[CCode (cheader_filename = "math.h")]
	public double sin (double x);
	[CCode (cheader_filename = "math.h")]
	public float sinf (float x);
	[CCode (cheader_filename = "math.h")]
	public double tan (double x);
	[CCode (cheader_filename = "math.h")]
	public float tanf (float x);
	[CCode (cheader_filename = "math.h")]
	public double cosh (double x);
	[CCode (cheader_filename = "math.h")]
	public float coshf (float x);
	[CCode (cheader_filename = "math.h")]
	public double sinh (double x);
	[CCode (cheader_filename = "math.h")]
	public float sinhf (float x);
	[CCode (cheader_filename = "math.h")]
	public double tanh (double x);
	[CCode (cheader_filename = "math.h")]
	public float tanhf (float x);
	[CCode (cheader_filename = "math.h")]
	public void sincos (double x, out double sinx, out double cosx);
	[CCode (cheader_filename = "math.h")]
	public void sincosf (float x, out float sinx, out float cosx);
	[CCode (cheader_filename = "math.h")]
	public double acosh (double x);
	[CCode (cheader_filename = "math.h")]
	public float acoshf (float x);
	[CCode (cheader_filename = "math.h")]
	public double asinh (double x);
	[CCode (cheader_filename = "math.h")]
	public float asinhf (float x);
	[CCode (cheader_filename = "math.h")]
	public double atanh (double x);
	[CCode (cheader_filename = "math.h")]
	public float atanhf (float x);
	[CCode (cheader_filename = "math.h")]
	public double exp (double x);
	[CCode (cheader_filename = "math.h")]
	public float expf (float x);
	[CCode (cheader_filename = "math.h")]
	public double frexp (double x, out int exponent);
	[CCode (cheader_filename = "math.h")]
	public float frexpf (float x, out int exponent);
	[CCode (cheader_filename = "math.h")]
	public double ldexp (double x, int exponent);
	[CCode (cheader_filename = "math.h")]
	public float ldexpf (float x, int exponent);
	[CCode (cheader_filename = "math.h")]
	public double log (double x);
	[CCode (cheader_filename = "math.h")]
	public float logf (float x);
	[CCode (cheader_filename = "math.h")]
	public double log10 (double x);
	[CCode (cheader_filename = "math.h")]
	public float log10f (float x);
	[CCode (cheader_filename = "math.h")]
	public double modf (double x, out double iptr);
	[CCode (cheader_filename = "math.h")]
	public float modff (float x, out float iptr);
	[CCode (cheader_filename = "math.h", feature_test_macro = "_GNU_SOURCE")]
	public double exp10 (double x);
	[CCode (cheader_filename = "math.h", feature_test_macro = "_GNU_SOURCE")]
	public float exp10f (float x);
	[CCode (cheader_filename = "math.h", feature_test_macro = "_GNU_SOURCE")]
	public double pow10 (double x);
	[CCode (cheader_filename = "math.h", feature_test_macro = "_GNU_SOURCE")]
	public float pow10f (float x);
	[CCode (cheader_filename = "math.h")]
	public double expm1 (double x);
	[CCode (cheader_filename = "math.h")]
	public float expm1f (float x);
	[CCode (cheader_filename = "math.h")]
	public double log1p (double x);
	[CCode (cheader_filename = "math.h")]
	public float log1pf (float x);
	[CCode (cheader_filename = "math.h")]
	public double logb (double x);
	[CCode (cheader_filename = "math.h")]
	public float logbf (float x);
	[CCode (cheader_filename = "math.h")]
	public double exp2 (double x);
	[CCode (cheader_filename = "math.h")]
	public float exp2f (float x);
	[CCode (cheader_filename = "math.h")]
	public double log2 (double x);
	[CCode (cheader_filename = "math.h")]
	public float log2f (float x);
	[CCode (cheader_filename = "math.h")]
	public double pow (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float powf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double sqrt (double x);
	[CCode (cheader_filename = "math.h")]
	public float sqrtf (float x);
	[CCode (cheader_filename = "math.h")]
	public double hypot (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float hypotf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double cbrt (double x);
	[CCode (cheader_filename = "math.h")]
	public float cbrtf (float x);
	[CCode (cheader_filename = "math.h")]
	public double ceil (double x);
	[CCode (cheader_filename = "math.h")]
	public float ceilf (float x);
	[CCode (cheader_filename = "math.h")]
	public double fabs (double x);
	[CCode (cheader_filename = "math.h")]
	public float fabsf (float x);
	[CCode (cheader_filename = "math.h")]
	public double floor (double x);
	[CCode (cheader_filename = "math.h")]
	public float floorf (float x);
	[CCode (cheader_filename = "math.h")]
	public double fmod (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float fmodf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public int isinf (double value);
	[CCode (cheader_filename = "math.h")]
	public int isinff (float value);
	[CCode (cheader_filename = "math.h")]
	public int finite (double value);
	[CCode (cheader_filename = "math.h")]
	public int finitef (float value);
	[CCode (cheader_filename = "math.h")]
	public double drem (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float dremf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double significand (double x);
	[CCode (cheader_filename = "math.h")]
	public float significandf (float x);
	[CCode (cheader_filename = "math.h")]
	public double copysign (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float copysignf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double nan (string tagb);
	[CCode (cheader_filename = "math.h")]
	public float nanf (string tagb);
	[CCode (cheader_filename = "math.h")]
	public int isnan (double value);
	[CCode (cheader_filename = "math.h")]
	public int isnanf (float value);
	[CCode (cheader_filename = "math.h")]
	public double j0 (double x0);
	[CCode (cheader_filename = "math.h")]
	public float j0f (float x0);
	[CCode (cheader_filename = "math.h")]
	public double j1 (double x0);
	[CCode (cheader_filename = "math.h")]
	public float j1f (float x0);
	[CCode (cheader_filename = "math.h")]
	public double jn (int x0, double x1);
	[CCode (cheader_filename = "math.h")]
	public float jnf (int x0, float x1);
	[CCode (cheader_filename = "math.h")]
	public double y0 (double x0);
	[CCode (cheader_filename = "math.h")]
	public float y0f (float x0);
	[CCode (cheader_filename = "math.h")]
	public double y1 (double x0);
	[CCode (cheader_filename = "math.h")]
	public float y1f (float x0);
	[CCode (cheader_filename = "math.h")]
	public double yn (int x0, double x1);
	[CCode (cheader_filename = "math.h")]
	public float ynf (int x0, float x1);
	[CCode (cheader_filename = "math.h")]
	public double erf (double x0);
	[CCode (cheader_filename = "math.h")]
	public float erff (float x0);
	[CCode (cheader_filename = "math.h")]
	public double erfc (double x0);
	[CCode (cheader_filename = "math.h")]
	public float erfcf (float x0);
	[CCode (cheader_filename = "math.h")]
	public double lgamma (double x0);
	[CCode (cheader_filename = "math.h")]
	public float lgammaf (float x0);
	[CCode (cheader_filename = "math.h")]
	public double tgamma (double x0);
	[CCode (cheader_filename = "math.h")]
	public float tgammaf (float x0);
	[CCode (cheader_filename = "math.h")]
	public double gamma (double x0);
	[CCode (cheader_filename = "math.h")]
	public float gammaf (float x0);
	[CCode (cheader_filename = "math.h")]
	public double lgamma_r (double x0, out int signgamp);
	[CCode (cheader_filename = "math.h")]
	public float lgamma_rf (float x0, out int signgamp);
	[CCode (cheader_filename = "math.h")]
	public double rint (double x);
	[CCode (cheader_filename = "math.h")]
	public float rintf (float x);
	[CCode (cheader_filename = "math.h")]
	public double nextafter (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float nextafterf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double nexttoward (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float nexttowardf (float x, double y);
	[CCode (cheader_filename = "math.h")]
	public double remainder (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float remainderf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double scalbn (double x, int n);
	[CCode (cheader_filename = "math.h")]
	public float scalbnf (float x, int n);
	[CCode (cheader_filename = "math.h")]
	public int ilogb (double x);
	[CCode (cheader_filename = "math.h")]
	public int ilogbf (float x);
	[CCode (cheader_filename = "math.h")]
	public double scalbln (double x, long n);
	[CCode (cheader_filename = "math.h")]
	public float scalblnf (float x, long n);
	[CCode (cheader_filename = "math.h")]
	public double nearbyint (double x);
	[CCode (cheader_filename = "math.h")]
	public float nearbyintf (float x);
	[CCode (cheader_filename = "math.h")]
	public double round (double x);
	[CCode (cheader_filename = "math.h")]
	public float roundf (float x);
	[CCode (cheader_filename = "math.h")]
	public double trunc (double x);
	[CCode (cheader_filename = "math.h")]
	public float truncf (float x);
	[CCode (cheader_filename = "math.h")]
	public double remquo (double x, double y, out int quo);
	[CCode (cheader_filename = "math.h")]
	public float remquof (float x, float y, out int quo);
	[CCode (cheader_filename = "math.h")]
	public long lrint (double x);
	[CCode (cheader_filename = "math.h")]
	public long lrintf (float x);
	[CCode (cheader_filename = "math.h")]
	public int64 llrint (double x);
	[CCode (cheader_filename = "math.h")]
	public int64 llrintf (float x);
	[CCode (cheader_filename = "math.h")]
	public long lround (double x);
	[CCode (cheader_filename = "math.h")]
	public long lroundf (float x);
	[CCode (cheader_filename = "math.h")]
	public int64 llround (double x);
	[CCode (cheader_filename = "math.h")]
	public int64 llroundf (float x);
	[CCode (cheader_filename = "math.h")]
	public double fdim (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float fdimf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double fmax (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float fmaxf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double fmin (double x, double y);
	[CCode (cheader_filename = "math.h")]
	public float fminf (float x, float y);
	[CCode (cheader_filename = "math.h")]
	public double fma (double x, double y, double z);
	[CCode (cheader_filename = "math.h")]
	public float fmaf (float x, float y, float z);
	[CCode (cheader_filename = "math.h")]
	public double scalb (double x, double n);
	[CCode (cheader_filename = "math.h")]
	public float scalbf (float x, float n);

	[SimpleType]
	[CCode (cname = "mqd_t", cheader_filename = "mqueue.h", lower_case_cprefix = "mq_", free_function = "mq_close", has_type_id = false)]
	public struct MessageQueue {
		[CCode (cname = "mq_open")]
		public MessageQueue (string name, int oflag, mode_t mode = 0, MqAttr? attr = null);
		public static int unlink (string name);
		public int notify (sigevent_t? notification = null);
		public int getattr (MqAttr attr);
		public int setattr (MqAttr attr, MqAttr? oldattr = null);
		public int send (uint8[] msg, uint prio = 0);
		public int timedsend (uint8[] msg, uint prio, timespec abs_timeout);
		public ssize_t receive (uint8[] msg, out uint prio);
		public ssize_t timedreceive (uint8[] msg, out uint prio, timespec abs_timeout);
	}

	[CCode (cname = "struct mq_attr", cheader_filename = "mqueue.h", destroy_function = "", has_type_id = false)]
	public struct MqAttr {
		public long mq_flags;
		public long mq_maxmsg;
		public long mq_msgsize;
		public long mq_curmsgs;
	}

	[CCode (cheader_filename = "netdb.h")]
	public const int NI_NAMEREQD;
	[CCode (cheader_filename = "netdb.h")]
	public const int NI_DGRAM;
	[CCode (cheader_filename = "netdb.h")]
	public const int NI_NOFQDN;
	[CCode (cheader_filename = "netdb.h")]
	public const int NI_NUMERICHOST;
	[CCode (cheader_filename = "netdb.h")]
	public const int NI_NUMERICSERV;

	[CCode (cheader_filename = "netdb.h,sys/socket.h")]
	public int getnameinfo (SockAddr sa, socklen_t salen, char[] node, char[] service, int flags);

	[CCode (cheader_filename = "poll.h", cname = "struct pollfd", has_type_id = false)]
	public struct pollfd {
		public int fd;
		public int events;
		public int revents;
	}

	[CCode (cheader_filename = "poll.h")]
	public const int POLLIN;
	[CCode (cheader_filename = "poll.h")]
	public const int POLLPRI;
	[CCode (cheader_filename = "poll.h")]
	public const int POLLOUT;
	[CCode (cheader_filename = "poll.h")]
	public const int POLLRDHUP;
	[CCode (cheader_filename = "poll.h")]
	public const int POLLERR;
	[CCode (cheader_filename = "poll.h")]
	public const int POLLHUP;
	[CCode (cheader_filename = "poll.h")]
	public const int POLLNVAL;

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "poll.h", cname = "nfds_t", has_type_id = false)]
	public struct nfds_t {
	}

	[CCode (cheader_filename = "poll.h")]
	public int poll (pollfd[] fds, int timeout);
	[CCode (cheader_filename = "poll.h")]
	public int ppoll (pollfd[] fds, timespec? timeout, sigset_t? sigmask);

	[Compact]
	[CCode (cname = "struct passwd", cheader_filename = "pwd.h")]
	public class Passwd {
		public string pw_name;
		public string pw_passwd;
		public uid_t pw_uid;
		public gid_t pw_gid;
		public string pw_gecos;
		public string pw_dir;
		public string pw_shell;
	}
	[CCode (cheader_filename = "pwd.h")]
	public void endpwent ();
	public unowned Passwd? getpwent ();
	public void setpwent ();
	[CCode (cheader_filename = "pwd.h")]
	public unowned Passwd? getpwnam (string name);
	[CCode (cheader_filename = "pwd.h")]
	public unowned Passwd? getpwuid (uid_t uid);

	[Compact]
	[CCode (cname = "sem_t", cheader_filename = "semaphore.h", cprefix = "SEM_", lower_case_cprefix = "sem_", has_type_id = false, copy_function = "", free_function = "sem_close")]
	public class NamedSemaphore {
		[CCode (cname = "sem_open")]
		public NamedSemaphore (string name, int oflag = 0, mode_t mode = 0, uint val = 0);
		public int getvalue (out int sval);
		public int post ();
		public int wait ();
		public int trywait ();
		public int timedwait (Posix.timespec abs_timeout);
		public static int unlink (string name);
		public const int FAILED;
	}

	[CCode (cheader_filename = "sys/resource.h")]
	public const int PRIO_PROCESS;
	[CCode (cheader_filename = "sys/resource.h")]
	public const int PRIO_PGRP;
	[CCode (cheader_filename = "sys/resource.h")]
	public const int PRIO_USER;

	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.ABRT")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGABRT;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.ALRM")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGALRM;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.BUS")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGBUS;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.CHLD")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGCHLD;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.CONT")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGCONT;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.FPE")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGFPE;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.HUP")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGHUP;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.ILL")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGILL;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.INT")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGINT;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.KILL")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGKILL;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.PIPE")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGPIPE;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.QUIT")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGQUIT;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.SEGV")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGSEGV;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.STOP")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGSTOP;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.TERM")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGTERM;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.TSTP")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGTSTP;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.TTIN")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGTTIN;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.TTOU")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGTTOU;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.USR1")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGUSR1;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.USR2")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGUSR2;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.POLL")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGPOLL;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.PROF")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGPROF;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.SYS")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGSYS;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.TRAP")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGTRAP;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.URG")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGURG;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.VTALRM")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGVTALRM;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.XCPU")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGXCPU;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.XFSZ")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGXFSZ;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.IOT")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGIOT;
	[Version (deprecated = true, deprecated_since = "vala-0.40", replacement = "Posix.Signal.STKFLT")]
	[CCode (cheader_filename = "signal.h")]
	public const int SIGSTKFLT;

	/**
	 * Signal constants
	 */
	[CCode (cheader_filename = "signal.h", cname = "int", cprefix = "SIG", has_type_id = false)]
	public enum Signal {
		/**
		 * Abort signal (ANSI)
		 */
		ABRT,
		/**
		 * Alarm clock signal (POSIX)
		 */
		ALRM,
		/**
		 * Access to an undefined portion of memory signal (4.2 BSD)
		 */
		BUS,
		/**
		 * Child process terminated, stopped or continued signal (POSIX)
		 */
		CHLD,
		/**
		 * Old System V name for CHLD
		 */
		[Version (replacement = "Posix.Signal.CHLD")]
		CLD,
		/**
		 * Continue executing, if stopped, signal (POSIX)
		 */
		CONT,
		/**
		 * Emulator trap
		 */
		EMT,
		/**
		 * Floating-point exception signal (ANSI)
		 */
		FPE,
		/**
		 * Hangup signal (POSIX)
		 */
		HUP,
		/**
		 * Illegal instruction signal (ANSI)
		 */
		ILL,
		/**
		 * Information request
		 */
		INFO,
		/**
		 * Terminal interrupt signal (ANSI)
		 */
		INT,
		/**
		 * I/O now possible (4.2 BSD)
		 */
		IO,
		/**
		 * IOT trap signal (4.2 BSD)
		 */
		IOT,
		/**
		 * Kill signal (cannot be caught or ignored) (POSIX)
		 */
		KILL,
		/**
		 * File lock lost
		 */
		LOST,
		/**
		 * Broken pipe signal (POSIX)
		 */
		PIPE,
		/**
		 * Pollable event occurred signal (System V)
		 */
		POLL,
		/**
		 * Profiling timer expired signal (4.2 BSD)
		 */
		PROF,
		/**
		 * Power failure restart (System V)
		 */
		PWR,
		/**
		 * Terminal quit signal (POSIX)
		 */
		QUIT,
		/**
		 * Memory reference segmentation violation signal (ANSI)
		 */
		SEGV,
		/**
		 * Stack fault signal
		 */
		STKFLT,
		/**
		 * Stop executing signal (cannot be caught or ignored) (POSIX)
		 */
		STOP,
		/**
		 * Bad system call signal
		 */
		SYS,
		/**
		 * Termination signal (ANSI)
		 */
		TERM,
		/**
		 * Trace/breakpoint trap signal (POSIX)
		 */
		TRAP,
		/**
		 * Terminal stop signal (POSIX)
		 */
		TSTP,
		/**
		 * Background read from tty signal (POSIX)
		 */
		TTIN,
		/**
		 * Background write to tty signal (POSIX)
		 */
		TTOU,
		/**
		 * Urgent condition on socket signal (4.2 BSD)
		 */
		URG,
		/**
		 * User-defined signal 1 (POSIX)
		 */
		USR1,
		/**
		 * User-defined signal 2 (POSIX)
		 */
		USR2,
		/**
		 * Virtual timer expired signal (4.2 BSD)
		 */
		VTALRM,
		/**
		 * Window size changed signal (4.3 BSD, Sun)
		 */
		WINCH,
		/**
		 * CPU time limit exceeded signal (4.2 BSD)
		 */
		XCPU,
		/**
		 * File size limit exceeded signal (4.2 BSD)
		 */
		XFSZ,
	}

	[CCode (cheader_filename = "signal.h")]
	public const int SA_NOCLDSTOP;
	[CCode (cheader_filename = "signal.h")]
	public const int SA_NOCLDWAIT;
	[CCode (cheader_filename = "signal.h")]
	public const int SA_NODEFER;
	[CCode (cheader_filename = "signal.h")]
	public const int SA_ONSTACK;
	[CCode (cheader_filename = "signal.h")]
	public const int SA_RESETHAND;
	[CCode (cheader_filename = "signal.h")]
	public const int SA_RESTART;
	[CCode (cheader_filename = "signal.h")]
	public const int SA_SIGINFO;
	[CCode (cheader_filename = "signal.h")]
	public const int SI_USER;
	[CCode (cheader_filename = "signal.h")]
	public const int SI_KERNEL;
	[CCode (cheader_filename = "signal.h")]
	public const int SI_QUEUE;
	[CCode (cheader_filename = "signal.h")]
	public const int SI_TIMER;
	[CCode (cheader_filename = "signal.h")]
	public const int SI_MESGQ;
	[CCode (cheader_filename = "signal.h")]
	public const int SI_ASYNCIO;
	[CCode (cheader_filename = "signal.h")]
	public const int SI_SIGIO;
	[CCode (cheader_filename = "signal.h")]
	public const int SI_TKILL;
	[CCode (cheader_filename = "signal.h")]
	public const int ILL_ILLOPC;
	[CCode (cheader_filename = "signal.h")]
	public const int ILL_ILLOPN;
	[CCode (cheader_filename = "signal.h")]
	public const int ILL_ILLADR;
	[CCode (cheader_filename = "signal.h")]
	public const int ILL_ILLTRP;
	[CCode (cheader_filename = "signal.h")]
	public const int ILL_PRVOPC;
	[CCode (cheader_filename = "signal.h")]
	public const int ILL_PRVREG;
	[CCode (cheader_filename = "signal.h")]
	public const int ILL_COPROC;
	[CCode (cheader_filename = "signal.h")]
	public const int ILL_BADSTK;
	[CCode (cheader_filename = "signal.h")]
	public const int FPE_INTDIV;
	[CCode (cheader_filename = "signal.h")]
	public const int FPE_INTOVF;
	[CCode (cheader_filename = "signal.h")]
	public const int FPE_FLTDIV;
	[CCode (cheader_filename = "signal.h")]
	public const int FPE_FLTOVF;
	[CCode (cheader_filename = "signal.h")]
	public const int FPE_FLTUND;
	[CCode (cheader_filename = "signal.h")]
	public const int FPE_FLTRES;
	[CCode (cheader_filename = "signal.h")]
	public const int FPE_FLTINV;
	[CCode (cheader_filename = "signal.h")]
	public const int FPE_FLTSUB;
	[CCode (cheader_filename = "signal.h")]
	public const int SEGV_MAPERR;
	[CCode (cheader_filename = "signal.h")]
	public const int SEGV_ACCERR;
	[CCode (cheader_filename = "signal.h")]
	public const int BUS_ADRALN;
	[CCode (cheader_filename = "signal.h")]
	public const int BUS_ADRERR;
	[CCode (cheader_filename = "signal.h")]
	public const int BUS_OBJERR;
	[CCode (cheader_filename = "signal.h")]
	public const int BUS_MCEERR_AR;
	[CCode (cheader_filename = "signal.h")]
	public const int BUS_MCEERR_AO;
	[CCode (cheader_filename = "signal.h")]
	public const int TRAP_BRKPT;
	[CCode (cheader_filename = "signal.h")]
	public const int TRAP_TRACE;
	[CCode (cheader_filename = "signal.h")]
	public const int TRAP_BRANCH;
	[CCode (cheader_filename = "signal.h")]
	public const int TRAP_HWBKPT;
	[CCode (cheader_filename = "signal.h")]
	public const int CLD_EXITED;
	[CCode (cheader_filename = "signal.h")]
	public const int CLD_KILLED;
	[CCode (cheader_filename = "signal.h")]
	public const int CLD_DUMPED;
	[CCode (cheader_filename = "signal.h")]
	public const int CLD_TRAPPED;
	[CCode (cheader_filename = "signal.h")]
	public const int CLD_STOPPED;
	[CCode (cheader_filename = "signal.h")]
	public const int CLD_CONTINUED;
	[CCode (cheader_filename = "signal.h")]
	public const int POLL_IN;
	[CCode (cheader_filename = "signal.h")]
	public const int POLL_OUT;
	[CCode (cheader_filename = "signal.h")]
	public const int POLL_MSG;
	[CCode (cheader_filename = "signal.h")]
	public const int POLL_ERR;
	[CCode (cheader_filename = "signal.h")]
	public const int POLL_PRI;
	[CCode (cheader_filename = "signal.h")]
	public const int POLL_HUP;
	[CCode (cheader_filename = "signal.h")]
	public const int SIG_BLOCK;
	[CCode (cheader_filename = "signal.h")]
	public const int SIG_UNBLOCK;
	[CCode (cheader_filename = "signal.h")]
	public const int SIG_SETMASK;

	[SimpleType]
	[IntegerType (rank = 6)]
	[CCode (cname = "pid_t", default_value = "0", cheader_filename = "sys/types.h", has_type_id = false)]
	public struct pid_t {
	}

	[CCode (cname = "struct sigaction", cheader_filename = "signal.h", has_type_id = false)]
	public struct sigaction_t {
		sighandler_t     sa_handler;
		siginfohandler_t sa_sigaction;
		sigset_t         sa_mask;
		int              sa_flags;
	}

	[CCode (cname = "struct sigevent", cheader_filename = "signal.h", has_type_id = false)]
	public struct sigevent_t {
		sigval_t         sigev_value;
		int              sigev_signo;
		int              sigev_notify;
	}

	[SimpleType]
	[CCode (cname = "sigval_t", cheader_filename = "signal.h", has_type_id = false)]
	public struct sigval_t {
		int   sival_int;
		void* sival_ptr;
	}

	[CCode (cname = "siginfo_t", cheader_filename = "signal.h", has_type_id = false)]
	public struct siginfo_t {
		int	     si_signo;
		int      si_errno;
		int      si_code;
		int      si_trapno;
		pid_t    si_pid;
		uid_t    si_uid;
		int      si_status;
		clock_t  si_utime;
		clock_t  si_stime;
		sigval_t si_value;
		int      si_int;
		void*    si_ptr;
		int      si_overrun;
		int      si_timerid;
		void*    si_addr;
		long     si_band;
		int      si_fd;
		short    si_addr_lsb;
	}

	[CCode (cheader_filename = "signal.h")]
	public int kill (pid_t pid, int signum);
	[CCode (cheader_filename = "signal.h")]
	public int killpg (pid_t pgpr, int signum);
	[CCode (cheader_filename = "signal.h")]
	public int raise (int signum);
	[CCode (cheader_filename = "signal.h")]
	public void psignal (int signum, string message);
	[CCode (cheader_filename = "signal.h")]
	public int sigemptyset (out sigset_t sigset);
	[CCode (cheader_filename = "signal.h")]
	public int sigfillset (out sigset_t sigset);
	[CCode (cheader_filename = "signal.h")]
	public int sigaddset (ref sigset_t sigset, int signo);
	[CCode (cheader_filename = "signal.h")]
	public int sigdelset (ref sigset_t sigset, int __signo);
	[CCode (cheader_filename = "signal.h")]
	public int sigismember (sigset_t sigset, int __signo);
	[CCode (cheader_filename = "signal.h")]
	public int sigprocmask (int how, sigset_t sigset, out sigset_t oset);
	[CCode (cheader_filename = "signal.h")]
	public int sigqueue (pid_t pid, int signum, sigval_t val);
	[CCode (cheader_filename = "signal.h")]
	public int sigsuspend (sigset_t sigset);
	[CCode (cheader_filename = "signal.h")]
	public int sigpending (sigset_t sigset);
	[CCode (cheader_filename = "signal.h")]
	public int sigwait (sigset_t sigset, out int sig);
	[CCode (cheader_filename = "signal.h")]
	public int sigaction (int signum, sigaction_t? act, out sigaction_t? oldact);

	[CCode (has_target = false, cheader_filename = "signal.h", feature_test_macro = "_GNU_SOURCE")]
	public delegate void sighandler_t (int signal);

	[CCode (has_typedef = false, has_target = false, cheader_filename = "signal.h")]
	public delegate void siginfohandler_t (int signal, siginfo_t info, void* data);

	[CCode (cheader_filename = "signal.h")]
	public sighandler_t SIG_DFL;

	[CCode (cheader_filename = "signal.h")]
	public sighandler_t SIG_ERR;

	[CCode (cheader_filename = "signal.h")]
	public sighandler_t SIG_IGN;

	[CCode (cheader_filename = "signal.h")]
	public sighandler_t signal (int signum, sighandler_t? handler);

	[CCode (cheader_filename = "stdio.h")]
	[PrintfFormat]
	public void printf (string format,...);

	[CCode (cheader_filename = "stdlib.h")]
	public void abort ();
	[CCode (cheader_filename = "stdlib.h")]
	public void exit (int status);

	[CCode (cheader_filename = "stdlib.h")]
	public void _exit (int status);

	[CCode (has_target = false, has_typedef = false)]
	public delegate void AtExitFunc ();

	[CCode (cheader_filename = "stdlib.h")]
	public void atexit (AtExitFunc func);

	[CCode (cheader_filename = "stdlib.h")]
	public int mkstemp (string template);

	[CCode (cheader_filename = "stdlib.h")]
	public int mkostemp (string template, int flags);

	[CCode (cheader_filename = "stdlib.h")]
	public string? realpath (string path, [CCode (array_length = false)] uint8[]? resolved_path = null);

	[CCode (cheader_filename = "stdlib.h")]
	public int posix_openpt (int flags);
	[CCode (cheader_filename = "stdlib.h")]
	public int grantpt (int fd);
	[CCode (cheader_filename = "stdlib.h")]
	public int unlockpt (int fd);
	[CCode (cheader_filename = "stdlib.h")]
	public unowned string? ptsname (int fd);

	[CCode (cheader_filename = "stdlib.h")]
	public int system (string command);

	[CCode (has_target = false, cheader_filename = "stdlib.h", cname = "__compar_fn_t")]
	public delegate int compar_fn_t (void* key1, void* key2);

	[CCode (cheader_filename = "stdlib.h")]
	public void* bsearch (void* key, void* base, size_t nmemb, size_t size, compar_fn_t func);

	[CCode (cheader_filename = "stdlib.h")]
	public void qsort (void* base, size_t nmemb, size_t size, compar_fn_t func);

	[CCode (cheader_filename = "stdlib.h")]
	public void qsort_r (void* base, size_t nmemb, size_t size, compar_fn_t func, void* arg);

	[CCode (cheader_filename = "stdlib.h")]
	public const int EXIT_FAILURE;
	[CCode (cheader_filename = "stdlib.h")]
	public const int EXIT_SUCCESS;

	/* Memory Allocation */
	[CCode (cheader_filename = "stdlib.h")]
	public void* malloc (size_t size);
	[CCode (cheader_filename = "stdlib.h")]
	public void* calloc (size_t nmemb, size_t size);
	[CCode (cheader_filename = "stdlib.h")]
	public void* realloc (void* ptr, size_t size);
	[CCode (cheader_filename = "stdlib.h", feature_test_macro = "_GNU_SOURCE")]
	public void* reallocarray (void* ptr, size_t nmemb, size_t size);
	[CCode (cheader_filename = "stdlib.h")]
	public void free (void* ptr);

	[CCode (cheader_filename = "string.h")]
	public void* memccpy (void* s1, void* s2, int c, size_t n);
	[CCode (cheader_filename = "string.h")]
	public void* memchr (void* s, int c, size_t n);
	[CCode (cheader_filename = "string.h")]
	public int memcmp (void* s1, void* s2, size_t n);
	[CCode (cheader_filename = "string.h")]
	public void* memcpy (void* s1, void* s2, size_t n);
	[CCode (cheader_filename = "string.h")]
	public void* memmove (void* s1, void* s2, size_t n);
	[CCode (cheader_filename = "string.h")]
	public void* memset (void* s, int c, size_t n);
	[CCode (cheader_filename = "string.h")]
	public unowned string strcat (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public unowned string? strchr (string s, int c);
	[CCode (cheader_filename = "string.h")]
	public int strcmp (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public int strcoll (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public unowned string strcpy (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public size_t strcspn (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public string strdup (string s1);
	[CCode (cheader_filename = "string.h")]
	public unowned string strerror (int errnum);
	[CCode (cheader_filename = "string.h")]
	public int* strerror_r (int errnum, string strerrbuf, size_t buflen);
	[CCode (cheader_filename = "string.h")]
	public size_t strlen (string s);
	[CCode (cheader_filename = "string.h")]
	public unowned string strncat (string s1, string s2, size_t n);
	[CCode (cheader_filename = "string.h")]
	public int strncmp (string s1, string s2, size_t n);
	[CCode (cheader_filename = "string.h")]
	public unowned string strncpy (string s1, string s2, size_t n);
	[CCode (cheader_filename = "string.h")]
	public unowned string? strpbrk (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public unowned string? strrchr (string s, int c);
	[CCode (cheader_filename = "string.h")]
	public unowned string? strsignal (int signum);
	[CCode (cheader_filename = "string.h")]
	public size_t strspn (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public unowned string? strstr (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public unowned string? strtok (string s1, string s2);
	[CCode (cheader_filename = "string.h")]
	public unowned string? strtok_r (string? s, string sep, out unowned string lasts);
	[CCode (cheader_filename = "string.h")]
	public size_t strxfrm (string s1, string s2, size_t n);

	[CCode (cheader_filename = "strings.h")]
	public int ffs (int i);

	[CCode (cheader_filename = "stropts.h")]
	public const int I_PUSH;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_POP;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_LOOK;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_FLUSH;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_FLUSHBAND;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_SETSIG;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_GETSIG;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_FIND;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_PEEK;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_SRDOPT;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_GRDOPT;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_NREAD;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_FDINSERT;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_STR;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_SWROPT;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_GWROPT;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_SENDFD;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_RECVFD;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_LIST;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_ATMARK;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_CKBAND;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_GETBAND;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_CANPUT;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_SETCLTIME;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_GETCLTIME;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_LINK;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_UNLINK;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_PLINK;
	[CCode (cheader_filename = "stropts.h")]
	public const int I_PUNLINK;
	[CCode (cheader_filename = "stropts.h")]
	public const int FLUSHR;
	[CCode (cheader_filename = "stropts.h")]
	public const int FLUSHW;
	[CCode (cheader_filename = "stropts.h")]
	public const int FLUSHRW;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_RDNORM;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_RDBAND;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_INPUT;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_HIPRI;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_OUTPUT;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_WRNORM;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_WRBAND;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_MSG;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_ERROR;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_HANGUP;
	[CCode (cheader_filename = "stropts.h")]
	public const int S_BANDURG;
	[CCode (cheader_filename = "stropts.h")]
	public const int RS_HIPRI;
	[CCode (cheader_filename = "stropts.h")]
	public const int RNORM;
	[CCode (cheader_filename = "stropts.h")]
	public const int RMSGD;
	[CCode (cheader_filename = "stropts.h")]
	public const int RMSGN;
	[CCode (cheader_filename = "stropts.h")]
	public const int RPROTNORN;
	[CCode (cheader_filename = "stropts.h")]
	public const int RPROTDAT;
	[CCode (cheader_filename = "stropts.h")]
	public const int RPROTDIS;
	[CCode (cheader_filename = "stropts.h")]
	public const int SNDZERO;
	[CCode (cheader_filename = "stropts.h")]
	public const int ANYMARK;
	[CCode (cheader_filename = "stropts.h")]
	public const int LASTMARK;
	[CCode (cheader_filename = "stropts.h")]
	public const int MUXID_ALL;
	[CCode (cheader_filename = "stropts.h")]
	public const int MSG_ANY;
	[CCode (cheader_filename = "stropts.h")]
	public const int MSG_BAND;
	[CCode (cheader_filename = "stropts.h")]
	public const int MSG_HIPRI;
	[CCode (cheader_filename = "stropts.h")]
	public const int MORECTL;
	[CCode (cheader_filename = "stropts.h")]
	public const int MOREDATA;
	[CCode (cheader_filename = "sys/ioctl.h", sentinel = "")]
	public int ioctl (int fildes, int request, ...);

	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_CREAT;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_EXCL;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_NOWAIT;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const key_t IPC_PRIVATE;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_RMID;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_SET;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_STAT;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_R;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_W;
	[CCode (cheader_filename = "sys/ipc.h")]
	public const int IPC_M;
	[CCode (cheader_filename = "sys/ipc.h")]
	public key_t ftok (string pathname, int proj_id);

	[CCode (cheader_filename = "syslog.h")]
	public void openlog (string ident, int option, int facility );

	[CCode (cheader_filename = "syslog.h")]
	public int setlogmask (int mask);

	[CCode (cheader_filename = "syslog.h")]
	public int LOG_UPTO (int pri);

	[CCode (cheader_filename = "syslog.h"), PrintfFormat]
	public void syslog (int priority, string format, ... );

	[CCode (cheader_filename = "syslog.h")]
	public void closelog ();

	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_PID;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_CONS;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_ODELAY;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_NDELAY;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_NOWAIT;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_EMERG;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_ALERT;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_CRIT;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_ERR;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_WARNING;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_NOTICE;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_INFO;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_DEBUG;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_KERN;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_USER;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_MAIL;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_DAEMON;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_SYSLOG;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LPR;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_NEWS;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_UUCP;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_CRON;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_AUTHPRIV;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_FTP;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LOCAL0;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LOCAL1;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LOCAL2;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LOCAL3;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LOCAL4;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LOCAL5;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LOCAL6;
	[CCode (cheader_filename = "syslog.h")]
	public const int LOG_LOCAL7;

	[CCode (cheader_filename = "sys/socket.h")]
	public const int SOCK_DGRAM;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int SOCK_RAW;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int SOCK_SEQPACKET;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int SOCK_STREAM;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int AF_UNSPEC;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int AF_INET;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int AF_INET6;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int AF_UNIX;

	[CCode (cheader_filename = "sys/socket.h")]
	public const int SHUT_RD;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int SHUT_WR;
	[CCode (cheader_filename = "sys/socket.h")]
	public const int SHUT_RDWR;

	[CCode (cheader_filename = "netdb.h")]
	public const int AI_PASSIVE;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_CANONNAME;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_NUMERICHOST;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_V4MAPPED;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_ALL;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_ADDRCONFIG;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_IDN;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_CANONIDN;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_IDN_ALLOW_UNASSIGNED;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_IDN_USE_STD3_ASCII_RULES;
	[CCode (cheader_filename = "netdb.h")]
	public const int AI_NUMERICSERV;

	[CCode (cheader_filename = "sys/socket.h", sentinel = "")]
	public int accept (int sfd, ... );
	[CCode (cheader_filename = "sys/socket.h", sentinel = "")]
	public int bind (int sockfd, ...);
	[CCode (cheader_filename = "sys/socket.h",  sentinel = "")]
	public int connect(int sfd, ... );
	[CCode (cheader_filename = "sys/socket.h")]
	public int getsockopt (int sockfd, int level, int optname, void* optval, out socklen_t optlen);
	[CCode (cheader_filename = "sys/socket.h")]
	public int listen (int sfd, int backlog);
	[CCode (cheader_filename = "sys/socket.h")]
	public ssize_t recv (int sockfd, void *buf, size_t len, int flags);
	[CCode (cheader_filename = "sys/socket.h")]
	public ssize_t send (int sockfd, void* buf, size_t len, int flags);
	[CCode (cheader_filename = "sys/socket.h", sentinel = "")]
	public ssize_t sendto (int sockfd, void* buf, size_t len, int flags, ...);
	[CCode (cheader_filename = "sys/socket.h", sentinel = "")]
	public ssize_t sendmsg (int sockfd, ...);
	[CCode (cheader_filename = "sys/socket.h")]
	public int setsockopt (int sockfd, int level, int optname, void* optval, socklen_t optlen);
	[CCode (cheader_filename = "sys/socket.h")]
	public int shutdown (int sockfd, int how);
	[CCode (cheader_filename = "sys/socket.h")]
	public int socket (int domain, int type, int protocol);
	[CCode (cheader_filename = "sys/socket.h")]
	public int socketpair (int domain, int type, int protocol, [CCode (array_length = false)] int[] sv);
	[CCode (cheader_filename = "netdb.h")]
	public int getaddrinfo (string node, string service, AddrInfo hints, out AddrInfo *res);
	[CCode (cheader_filename = "netdb.h")]
	public void freeaddrinfo (AddrInfo *res);
	[CCode (cheader_filename = "netdb.h")]
	public unowned string gai_strerror (int errcode);
	[CCode (cheader_filename = "netdb.h")]
	public unowned HostEnt? gethostbyname (string name);

	[CCode (cname = "socklen_t", cheader_filename = "sys/socket.h", default_value = "0", has_type_id = false)]
	public struct socklen_t : int {
	}

	[SimpleType]
	[CCode (cname = "struct in_addr", cheader_filename = "sys/socket.h,netinet/in.h", destroy_function = "", has_type_id = false)]
	public struct InAddr {
		public uint32 s_addr;
	}

	[CCode (cname = "struct in6_addr", cheader_filename = "sys/socket.h,netinet/in.h", destroy_function = "", has_type_id = false)]
	public struct In6Addr {
		public uint8 s6_addr[16];
	}

	[CCode (cname = "struct sockaddr", cheader_filename = "sys/socket.h", destroy_function = "", has_type_id = false)]
	public struct SockAddr {
		public int sa_family;
		[CCode (array_length = false)]
		public char[] sa_data;
	}

	[CCode (cname = "struct sockaddr_in", cheader_filename = "netinet/in.h", destroy_function = "", has_type_id = false)]
	public struct SockAddrIn {
		public int sin_family;
		public uint16 sin_port;
		public InAddr sin_addr;
	}

	[CCode (cname = "struct sockaddr_in6", cheader_filename = "netinet/in.h", destroy_function = "", has_type_id = false)]
	public struct SockAddrIn6 {
		public int sin6_family;
		public uint16 sin6_port;
		public uint32 sin6_flowinfo;
		public In6Addr sin6_addr;
		public uint32 sin6_scope_id;
	}

	[CCode (cname = "struct addrinfo", cheader_filename = "netdb.h", destroy_function = "", has_type_id = false)]
	public struct AddrInfo {
		public int ai_flags;
		public int ai_family;
		public int ai_socktype;
		public int ai_protocol;
		public socklen_t ai_addrlen;
		public SockAddr *ai_addr;
		public string ai_canonname;
		public AddrInfo *ai_next;
	}

	[Compact]
	[CCode (cname = "struct hostent", cheader_filename = "netdb.h", destroy_function = "", has_type_id = false)]
	public class HostEnt {
		public string h_name;
		[CCode (array_length=false, array_null_terminated=true)]
		public string[] h_aliases;
		public int h_addrtype;
		public int h_length;
		[CCode (array_length=false, array_null_terminated=true)]
		public string[] h_addr_list;
	}

	[CCode (cname = "struct msqid_ds", cheader_filename = "sys/msg.h", free_function = "", has_type_id = false)]
	public struct MsqIdDs {
	}

	[CCode (cname = "short", cheader_filename = "sys/msg.h", cprefix = "MSG_", has_type_id = false)]
	public enum MsqCmd {
		STAT,
		INFO
	}

	[CCode (cheader_filename = "sys/msg.h")]
	public const int MSG_COPY;
	[CCode (cheader_filename = "sys/msg.h")]
	public const int MSG_EXCEPT;
	[CCode (cheader_filename = "sys/msg.h")]
	public const int MSG_NOERROR;
	[CCode (cheader_filename = "sys/msg.h")]
	public int msgctrl (int msqid, MsqCmd cmd, MsqIdDs buf);
	[CCode (cheader_filename = "sys/msg.h")]
	public int msgget (key_t key, int msgflg = 0);
	[CCode (cheader_filename = "sys/msg.h")]
	public ssize_t msgrcv (int msqid, uint8[] buf, long msgtyp = 0, int msgflg = 0);
	[CCode (cheader_filename = "sys/msg.h")]
	public int msgsnd (int msqid, uint8[] buf, int msgflg = 0);

	[CCode (cname = "struct sembuf", cheader_filename = "sys/sem.h", free_function = "", has_type_id = false)]
	public struct SemBuf {
		public ushort sem_num;
		public SemCmd sem_op;
		public short sem_flg;
	}

	[CCode (cname = "short", cheader_filename = "sys/sem.h", cprefix = "", has_type_id = false)]
	public enum SemCmd {
		GETPID,
		GETVAL,
		GETALL,
		GETNCNT,
		GETZCNT,
		SETVAL,
		SETALL,
		IPC_STAT,
		IPC_SET,
		IPC_RMID,
	}

	[CCode (cheader_filename = "sys/sem.h")]
	public const short SEM_UNDO;
	[CCode (cheader_filename = "sys/sem.h")]
	public int semctl (int semid, int semnum, int cmd, ...);
	[CCode (cheader_filename = "sys/sem.h")]
	public int semget (key_t key, int nsems, int semflg = 0);
	[CCode (cheader_filename = "sys/sem.h")]
	public int semop (int semid, SemBuf[] sops);

	[CCode (cheader_filename = "sys/shm.h")]
	public void* shmat (int shmid, void* shmaddr, int shmflg = 0);
	[CCode (cheader_filename = "sys/shm.h")]
	public int shmdt (void* shmaddr);
	[CCode (cheader_filename = "sys/shm.h")]
	public int shmget (key_t key, size_t size, int shmflg = 0);

	[CCode (cheader_filename = "sys/stat.h")]
	public int mkfifo (string filename, mode_t mode);
	[CCode (cheader_filename = "sys/stat.h", feature_test_macro = "_GNU_SOURCE")]
	public int mkfifoat (int dirfd, string pathname, mode_t mode);

	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IFMT;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IFBLK;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IFCHR;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IFIFO;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IFREG;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IFDIR;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IFLNK;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IFSOCK;

	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IRWXU;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IRUSR;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IWUSR;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IXUSR;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IRWXG;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IRGRP;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IWGRP;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IXGRP;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IRWXO;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IROTH;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IWOTH;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_IXOTH;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_ISUID;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_ISGID;
	[CCode (cheader_filename = "sys/stat.h")]
	public const mode_t S_ISVTX;

	[CCode (cheader_filename = "sys/stat.h")]
	public bool S_ISBLK (mode_t mode);
	[CCode (cheader_filename = "sys/stat.h")]
	public bool S_ISCHR (mode_t mode);
	[CCode (cheader_filename = "sys/stat.h")]
	public bool S_ISDIR (mode_t mode);
	[CCode (cheader_filename = "sys/stat.h")]
	public bool S_ISFIFO (mode_t mode);
	[CCode (cheader_filename = "sys/stat.h")]
	public bool S_ISREG (mode_t mode);
	[CCode (cheader_filename = "sys/stat.h")]
	public bool S_ISLNK (mode_t mode);
	[CCode (cheader_filename = "sys/stat.h")]
	public bool S_ISSOCK (mode_t mode);

	[CCode (cheader_filename = "sys/stat.h", cname = "struct stat", has_type_id = false)]
	public struct Stat {
		public dev_t st_dev;
		public ino_t st_ino;
		public mode_t st_mode;
		public nlink_t st_nlink;
		public uid_t st_uid;
		public gid_t st_gid;
		public dev_t st_rdev;
		public size_t st_size;
		public timespec st_atim;
		public time_t st_atime;
		public timespec st_mtim;
		public time_t st_mtime;
		public timespec st_ctim;
		public time_t st_ctime;
		public blksize_t st_blksize;
		public blkcnt_t st_blocks;
	}
	[CCode (cheader_filename = "sys/stat.h")]
	public int fstat (int fd, out Stat buf);
	[CCode (cheader_filename = "sys/stat.h")]
	public int stat (string filename, out Stat buf);
	[CCode (cheader_filename = "sys/stat.h")]
	public int lstat (string filename, out Stat buf);
	[CCode (cheader_filename = "sys/stat.h", feature_test_macro = "_GNU_SOURCE")]
	public int fstatat (int dirfd, string pathname, out Stat buf, int flags);

	[CCode (cheader_filename = "sys/stat.h")]
	public int chmod (string filename, mode_t mode);
	[CCode (cheader_filename = "sys/stat.h")]
	public int fchmod (int fd, mode_t mode);
	[CCode (cheader_filename = "sys/stat.h", feature_test_macro = "_GNU_SOURCE")]
	public int fchmodat (int dirfd, string pathname, mode_t mode, int flags);
	[CCode (cheader_filename = "sys/stat.h")]
	public mode_t umask (mode_t mask);
	[CCode (cheader_filename = "sys/stat.h")]
	public int mkdir (string path, mode_t mode);
	[CCode (cheader_filename = "sys/stat.h", feature_test_macro = "_GNU_SOURCE")]
	public int mkdirat (int dirfd, string pathname, mode_t mode);
	[CCode (cheader_filename = "sys/types.h,sys/stat.h,fcntl.h,unistd.h")]
	public int mknod (string pathname, mode_t mode, dev_t dev);
	[CCode (cheader_filename = "sys/stat.h", feature_test_macro = "_GNU_SOURCE")]
	public int mknodat (int dirfd, string pathname, mode_t mode, dev_t dev);

	[CCode (cheader_filename = "sys/stat.h")]
	public int utimensat (int dirfd, string pathname, [CCode (array_length = false)] timespec[] times, int flags = 0);
	[CCode (cheader_filename = "sys/stat.h")]
	public int futimens (int fd, [CCode (array_length = false)] timespec[] times);

	[CCode (cheader_filename = "sys/wait.h")]
	public pid_t wait (out int status);
	[CCode (cheader_filename = "sys/wait.h")]
	public pid_t waitpid (pid_t pid, out int status, int options);
	[CCode (cheader_filename = "sys/wait.h")]
	public const int WNOHANG;
	[CCode (cheader_filename = "sys/wait.h")]
	public const int WUNTRACED;
	[CCode (cheader_filename = "sys/wait.h")]
	public const int WCONTINUED;

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/types.h", cname = "key_t", has_type_id = false)]
	public struct key_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/statvfs.h", has_type_id = false)]
	public struct fsblkcnt_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/statvfs.h", has_type_id = false)]
	public struct fsfilcnt_t {
	}

	[CCode (cheader_filename = "sys/statvfs.h", cname = "struct statvfs", has_type_id = false)]
	public struct statvfs {
		public ulong f_bsize;
		public ulong f_frsize;
		public fsblkcnt_t f_blocks;
		public fsblkcnt_t f_bfree;
		public fsblkcnt_t f_bavail;
		public fsfilcnt_t f_files;
		public fsfilcnt_t f_ffree;
		public fsfilcnt_t f_favail;
	}

	[CCode (cheader_filename = "sys/statvfs.h", cname = "statvfs")]
	public int statvfs_exec (string path, out statvfs buf);
	[CCode (cheader_filename = "sys/statvfs.h")]
	public int fstatvfs (int fs, out statvfs buf);

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cname="off_t", cheader_filename = "sys/types.h", has_type_id = false)]
	public struct off_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/types.h", has_type_id = false)]
	public struct uid_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/types.h", has_type_id = false)]
	public struct gid_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cname = "mode_t", cheader_filename = "sys/types.h", has_type_id = false)]
	public struct mode_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/types.h", has_type_id = false)]
	public struct dev_t {
	}

	[CCode (cheader_filename = "sys/sysmacros.h")]
	uint major (dev_t dev);
	[CCode (cheader_filename = "sys/sysmacros.h")]
	uint minor (dev_t dev);
	[CCode (cheader_filename = "sys/sysmacros.h")]
	dev_t makedev (int maj, int min);

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/types.h", has_type_id = false)]
	public struct ino_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/types.h", has_type_id = false)]
	public struct nlink_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/types.h", has_type_id = false)]
	public struct blksize_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode (cheader_filename = "sys/types.h", has_type_id = false)]
	public struct blkcnt_t {
	}

	[CCode (cheader_filename = "time.h", has_type_id = false)]
	[IntegerType (rank = 8)]
	public struct clock_t {
		[CCode (cname = "clock")]
		public clock_t ();
	}

	[CCode (cheader_filename = "time.h")]
	public unowned string? ctime (ref time_t clock);

	[CCode (cname = "struct tm", cheader_filename = "time.h", has_type_id = false)]
	public struct tm {
		public int tm_sec;
		public int tm_min;
		public int tm_hour;
		public int tm_mday;
		public int tm_mon;
		public int tm_year;
		public int tm_wday;
		public int tm_yday;
		public int tm_isdst;
	}

	[CCode (cname = "struct timespec", cheader_filename = "time.h", has_type_id = false)]
	public struct timespec {
		public time_t tv_sec;
		public long tv_nsec;
	}

    [CCode (array_length = false, cheader_filename = "time.h")]
	public string[] tzname;
	[CCode (cheader_filename = "time.h")]
	public const long timezone;
	[CCode (cheader_filename = "time.h")]
	public const int daylight;

	[CCode (cheader_filename = "time.h")]
	public void tzset ();

	[SimpleType]
	[IntegerType (rank = 8)]
	[CCode (cheader_filename = "time.h", has_type_id = false)]
	public struct clockid_t {
	}

	[CCode (cheader_filename = "time.h")]
	public const clockid_t CLOCK_REALTIME;
	[CCode (cheader_filename = "time.h")]
	public const clockid_t CLOCK_MONOTONIC;
	[CCode (cheader_filename = "time.h")]
	public const clockid_t CLOCK_PROCESS_CPUTIME_ID;
	[CCode (cheader_filename = "time.h")]
	public const clockid_t CLOCK_THREAD_CPUTIME_ID;
	[CCode (cheader_filename = "time.h")]
	public const clockid_t CLOCK_REALTIME_COARSE;
	[CCode (cheader_filename = "time.h")]
	public const clockid_t CLOCK_MONOTONIC_COARSE;

	[CCode (cheader_filename = "time.h")]
	int clock_gettime (clockid_t clk_id, out timespec tp);

	[CCode (cheader_filename = "sys/time.h,sys/resource.h")]
	public int getpriority (int which, int who);
	[CCode (cheader_filename = "sys/time.h,sys/resource.h")]
	public int setpriority (int which, int who, int prio);

	[CCode (cname = "struct iovec", cheader_filename = "sys/uio.h", has_type_id = false)]
	public struct iovector {
		public void* iov_base;
		public size_t iov_len;
	}

	[CCode (cheader_filename = "unistd.h")]
	public int close (int fd);
	[CCode (cheader_filename = "unistd.h")]
	public int execl (string path, params string[] arg);
	[CCode (cheader_filename = "unistd.h")]
	public int execlp (string path, params string[] arg);
	[CCode (cheader_filename = "unistd.h")]
	public int execv (string path, [CCode (array_length = false, array_null_terminated = true)] string[] arg);
	[CCode (cheader_filename = "unistd.h")]
	public int execvp (string path, [CCode (array_length = false, array_null_terminated = true)] string[] arg);
	[CCode (cheader_filename = "unistd.h")]
	public int pipe ([CCode (array_length = false, array_null_terminated = false)] int[] pipefd);
	[CCode (cheader_filename = "unistd.h")]
	public ssize_t read (int fd, void* buf, size_t count);
	[CCode (cheader_filename = "unistd.h")]
	public ssize_t pread (int fd, void* buf, size_t count, off_t offset);
	[CCode (cheader_filename = "unistd.h")]
	public ssize_t readlink (string path, char[] buf);
	[CCode (cheader_filename = "unistd.h", feature_test_macro = "_GNU_SOURCE")]
	public ssize_t readlinkat (int dirfd, string pathname, char[] buf);
	[CCode (cheader_filename = "sys/uio.h")]
	public ssize_t readv (int fd, iovector vector, int iovcnt = 1);
	[CCode (cname = "readv", cheader_filename = "sys/uio.h")]
	public ssize_t read_vectors (int fd, iovector[] vector);
	[CCode (cheader_filename = "unistd.h,sys/types.h")]
	public int setegid (gid_t egid);
	[CCode (cheader_filename = "unistd.h,sys/types.h")]
	public int seteuid (gid_t euid);
	[CCode (cheader_filename = "unistd.h,sys/types.h")]
	public int setgid (gid_t gid);
	[CCode (cheader_filename = "unistd.h,sys/types.h")]
	public int setuid (uid_t uid);
	[CCode (cheader_filename = "unistd.h")]
	public int unlink (string filename);
	[CCode (cheader_filename = "unistd.h", feature_test_macro = "_GNU_SOURCE")]
	public int unlinkat (int dirfd, string pathname, int flags);
	[CCode (cheader_filename = "unistd.h")]
	public ssize_t write (int fd, void* buf, size_t count);
	[CCode (cheader_filename = "unistd.h")]
	public ssize_t pwrite (int fd, void* buf, size_t count, off_t offset);
	[CCode (cheader_filename = "sys/uio.h")]
	public ssize_t writev (int fd, iovector vector, int iovcnt = 1);
	[CCode (cname = "writev", cheader_filename = "sys/uio.h")]
	public ssize_t write_vectors (int fd, iovector[] vector);
	[CCode (cheader_filename = "unistd.h")]
	public off_t lseek(int fildes, off_t offset, int whence);

	[CCode (cheader_filename = "unistd.h")]
	public const int SEEK_SET;
	[CCode (cheader_filename = "unistd.h")]
	public const int SEEK_CUR;
	[CCode (cheader_filename = "unistd.h")]
	public const int SEEK_END;

	[CCode (cheader_filename = "unistd.h")]
	public pid_t fork ();
	[CCode (cheader_filename = "unistd.h")]
	public pid_t vfork ();
	[CCode (cheader_filename = "unistd.h")]
	public unowned string ttyname (int fd);
	[CCode (cheader_filename = "unistd.h")]
	public int ttyname_r (int fd, char[] buf);
	[CCode (cheader_filename = "unistd.h")]
	public bool isatty (int fd);
	[CCode (cheader_filename = "unistd.h")]
	public int link (string from, string to);
	[CCode (cheader_filename = "unistd.h", feature_test_macro = "_GNU_SOURCE")]
	public int linkat (int from_dirfd, string from, int to_dirfd, string to, int flags);
	[CCode (cheader_filename = "unistd.h")]
	public int symlink (string from, string to);
	[CCode (cheader_filename = "unistd.h", feature_test_macro = "_GNU_SOURCE")]
	public int symlinkat (string from, int to_dirfd, string to);
	[CCode (cheader_filename = "unistd.h")]
	public long sysconf (int name);
	[CCode (cheader_filename = "unistd.h")]
	public int rmdir (string path);
	[CCode (cheader_filename = "stdio.h", feature_test_macro = "_GNU_SOURCE")]
	public int renameat (int from_fd, string from, int to_dirfd, string to);
	[CCode (cheader_filename = "unistd.h")]
	public pid_t tcgetpgrp (int fd);
	[CCode (cheader_filename = "unistd.h")]
	public int tcsetpgrp (int fd, pid_t pgrp_id);
	[CCode (cheader_filename = "unistd.h")]
	public unowned string getlogin ();
	[CCode (cheader_filename = "unistd.h")]
	public int vhangup ();
	[CCode (cheader_filename = "unistd.h")]
	public int revoke (string file);
	[CCode (cheader_filename = "unistd.h")]
	public int acct (string name);
	[CCode (cheader_filename = "unistd.h")]
	public unowned string getusershell ();
	[CCode (cheader_filename = "unistd.h")]
	public void endusershell ();
	[CCode (cheader_filename = "unistd.h")]
	public void setusershell ();
	[CCode (cheader_filename = "unistd.h")]
	public int chroot (string path);
	[Version (deprecated_since = "POSIX.2", replacement = "termios ECHO flag")]
	[CCode (cheader_filename = "unistd.h")]
	public unowned string? getpass (string prompt);
	[CCode (cheader_filename = "unistd.h", feature_test_macro = "_XOPEN_SOURCE")]
	public unowned string? crypt (string key, string salt);
	[CCode (cheader_filename = "unistd.h")]
	public int getpagesize ();
	[CCode (cheader_filename = "unistd.h")]
	public int getdtablesize ();

	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_ARG_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_CHILD_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_HOST_NAME_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_LOGIN_NAME_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_CLK_TCK;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_OPEN_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_PAGESIZE;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_RE_DUP_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_STREAM_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_SYMLOOP_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_TTY_NAME_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_TZNAME_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_VERSION;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_BC_BASE_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_BC_DIM_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_BC_SCALE_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_BC_STRING_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_COLL_WEIGHTS_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_EXPR_NEST_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_LINE_MAX;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_2_VERSION;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_2_C_DEV;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_2_FORT_DEV;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_2_FORT_RUN;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_2_LOCALEDEF;
	[CCode (cheader_filename = "unistd.h")]
	public const int _SC_2_SW_DEV;

	[CCode (cheader_filename = "unistd.h")]
	public const int STDIN_FILENO;
	[CCode (cheader_filename = "unistd.h")]
	public const int STDOUT_FILENO;
	[CCode (cheader_filename = "unistd.h")]
	public const int STDERR_FILENO;
	[CCode (cheader_filename = "unistd.h")]
	public const int R_OK;
	[CCode (cheader_filename = "unistd.h")]
	public const int W_OK;
	[CCode (cheader_filename = "unistd.h")]
	public const int X_OK;
	[CCode (cheader_filename = "unistd.h")]
	public const int F_OK;

	[CCode (cheader_filename = "unistd.h")]
	public int access (string patchname, int mode);
	[CCode (cheader_filename = "unistd.h")]
	public int euidaccess (string patchname, int mode);
	[CCode (cheader_filename = "unistd.h")]
	public int eaccess (string patchname, int mode);
	[CCode (cheader_filename = "unistd.h", feature_test_macro = "_GNU_SOURCE")]
	public int faccessat (int dirfd, string pathname, int mode, int flags);

	/**
	 * Gets a value for the configuration option name for the open file
	 * descriptor fd.
	 */
	[CCode (cheader_filename = "unistd.h")]
	public long fpathconf (int fd, Posix.PathConfName name);

	/**
	 * Gets a value for the configuration option name for the filename path.
	 */
	[CCode (cheader_filename = "unistd.h")]
	public long pathconf (string path, Posix.PathConfName name);

	[CCode (cname = "int", cprefix = "_PC_", has_type_id = false, cheader_filename = "unistd.h")]
	public enum PathConfName {
		/**
		 * Returns the maximum number of links to the file. If fd or path refer
		 * to a directory, then the value applies to the whole directory.
		 */
		LINK_MAX,
		/**
		 * Returns the maximum length of a formatted input line, where fd or
		 * path must refer to a terminal.
		 */
		MAX_CANON,
		/**
		 * Returns the maximum length of an input line, where fd or path must
		 * refer to a terminal.
		 */
		MAX_INPUT,
		/**
		 * Returns the maximum length of a filename in the directory path or fd
		 * that the process is allowed to create.
		 */
		NAME_MAX,
		/**
		 * Returns the maximum length of a relative pathname when path or fd is
		 * the current working directory.
		 */
		PATH_MAX,
		/**
		 * Returns the size of the pipe buffer, where fd must refer to a pipe or
		 * FIFO and path must refer to a FIFO.
		 */
		PIPE_BUF,
		/**
		 * Returns nonzero if the chown call may not be used on this file. If fd
		 * or path refer to a directory, then this applies to all files in that
		 * directory.
		 */
		CHOWN_RESTRICTED,
		/**
		 * Returns nonzero if accessing filenames longer than
		 * #Posix.PathConfName.NAME_MAX generates an error.
		 */
		NO_TRUNC,
		/**
		 * Returns nonzero if special character processing can be disabled,
		 * where fd or path must refer to a terminal.
		 */
		VDISABLE
	}

	[CCode (cheader_filename = "unistd.h")]
	public uint alarm (uint seconds);
	[CCode (cheader_filename = "unistd.h")]
	public uint ualarm (uint useconds, uint interval);
	[CCode (cheader_filename = "unistd.h")]
	public uint sleep (uint seconds);
	[CCode (cheader_filename = "unistd.h")]
	public uint usleep (uint useconds);
	[CCode (cheader_filename = "unistd.h")]
	public int pause ();
	[CCode (cheader_filename = "unistd.h")]
	public int chown (string filename, uid_t owner, gid_t group);
	[CCode (cheader_filename = "unistd.h")]
	public int fchown (int fd, uid_t owner, gid_t group);
	[CCode (cheader_filename = "unistd.h")]
	public int lchown (string filename, uid_t owner, gid_t group);
	[CCode (cheader_filename = "unistd.h", feature_test_macro = "_GNU_SOURCE")]
	public int fchownat (int dirfd, string pathname, uid_t owner, gid_t group, int flags);
	[CCode (cheader_filename = "unistd.h")]
	public int chdir (string filepath);
	[CCode (cheader_filename = "unistd.h")]
	public int fchdir (int file);
	[CCode (cheader_filename = "unistd.h")]
	public int dup (int fd);
	[CCode (cheader_filename = "unistd.h")]
	public int dup2 (int fd1, int fd2);
	[CCode (cheader_filename = "unistd.h")]
	public int gethostname (char[] name);
	[CCode (cheader_filename = "unistd.h")]
	public pid_t getpid ();
	[CCode (cheader_filename = "unistd.h")]
	public pid_t getppid ();
	[CCode (cheader_filename = "unistd.h")]
	public pid_t getpgrp ();
	[CCode (cheader_filename = "unistd.h")]
	public pid_t getpgid (pid_t pid);
	[CCode (cheader_filename = "unistd.h")]
	public int setpgid (pid_t pid, pid_t pgid);
	[CCode (cheader_filename = "unistd.h")]
	public pid_t setpgrp ();
	[CCode (cheader_filename = "unistd.h")]
	public pid_t getsid (pid_t pid);
	[CCode (cheader_filename = "unistd.h")]
	public uid_t getuid ();
	[CCode (cheader_filename = "unistd.h")]
	public uid_t geteuid ();
	[CCode (cheader_filename = "unistd.h")]
	public gid_t getgid ();
	[CCode (cheader_filename = "unistd.h")]
	public gid_t getegid ();
	[CCode (cheader_filename = "unistd.h")]
	public int group_member (gid_t gid);
	[CCode (cheader_filename = "unistd.h")]
	public pid_t setsid ();
	[CCode (cheader_filename = "termios.h", feature_test_macro = "_GNU_SOURCE")]
	public pid_t tcgetsid (int fd);

	[CCode (cheader_filename = "unistd.h")]
	public int fsync (int fd);
	[CCode (cheader_filename = "unistd.h")]
	public int fdatasync (int fd);
	[CCode (cheader_filename = "unistd.h")]
	public int sync ();

	[CCode (cheader_filename = "unistd.h")]
	public int ftruncate(int fd, off_t length);
	[CCode (cheader_filename = "unistd.h")]
	public int truncate(string path, off_t length);
	[CCode (cheader_filename = "unistd.h")]
	public int nice (int inc);

	[SimpleType]
	[CCode (cname = "cc_t", cheader_filename = "termios.h", has_type_id = false)]
	[IntegerType (rank = 3, min = 0, max = 255)]
	public struct cc_t {
	}

	[SimpleType]
	[CCode (cname = "speed_t", cheader_filename = "termios.h", has_type_id = false)]
	[IntegerType (rank = 7)]
	public struct speed_t {
	}

	[SimpleType]
	[CCode (cname = "tcflag_t", cheader_filename = "termios.h", has_type_id = false)]
	[IntegerType (rank = 7)]
	public struct tcflag_t {
	}

	[CCode (cname="struct termios", cheader_filename = "termios.h", has_type_id = false)]
	public struct termios
	{
		public tcflag_t c_iflag;
		public tcflag_t c_oflag;
		public tcflag_t c_cflag;
		public tcflag_t c_lflag;
		public cc_t c_line;
		public cc_t c_cc[32];
		public speed_t c_ispeed;
		public speed_t c_ospeed;
	}

	[CCode (cheader_filename = "termios.h")]
	public int tcgetattr (int fd, out termios termios_p);
	[CCode (cheader_filename = "termios.h")]
	public int tcsetattr (int fd, int optional_actions, termios termios_p);
	[CCode (cheader_filename = "termios.h")]
	public int tcsendbreak (int fd, int duration);
	[CCode (cheader_filename = "termios.h")]
	public int tcdrain (int fd);
	[CCode (cheader_filename = "termios.h")]
	public int tcflush (int fd, int queue_selector);
	[CCode (cheader_filename = "termios.h")]
	public int tcflow (int fd, int action);
	[CCode (cheader_filename = "termios.h")]
	public void cfmakeraw (ref termios termios_p);
	[CCode (cheader_filename = "termios.h")]
	public speed_t cfgetispeed (termios termios_p);
	[CCode (cheader_filename = "termios.h")]
	public speed_t cfgetospeed (termios termios_p);
	[CCode (cheader_filename = "termios.h")]
	public int cfsetispeed (ref termios termios_p, speed_t speed);
	[CCode (cheader_filename = "termios.h")]
	public int cfsetospeed (ref termios termios_p, speed_t speed);
	[CCode (cheader_filename = "termios.h")]
	public int cfsetspeed (ref termios termios, speed_t speed);

	//c_iflag
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t IGNBRK;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t BRKINT;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t IGNPAR;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t PARMRK;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t INPCK;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ISTRIP;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t INLCR;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t IGNCR;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t IXON;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t IXANY;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t IXOFF;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ICRNL;

	//c_oflag
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t OPOST;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ONLCR;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t OCRNL;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ONOCR;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ONLRET;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t OFILL;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t NLDLY;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t NL0;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t NL1;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CRDLY;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CR0;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CR1;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CR2;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CR3;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t TABDLY;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t TAB0;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t TAB1;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t TAB2;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t TAB3;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t BSDLY;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t BS0;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t BS1;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t VTDLY;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t VT0;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t VT1;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t FFDLY;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t FF0;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t FF1;

	//c_cflag
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CSIZE;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CS5;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CS6;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CS7;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CS8;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CSTOPB;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CREAD;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t PARENB;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t PARODD;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t HUPCL;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t CLOCAL;

	//c_lflag
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ISIG;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ICANON;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ECHO;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ECHOE;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ECHOK;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t ECHONL;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t NOFLSH;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t TOSTOP;
	[CCode (cheader_filename = "termios.h")]
	public const tcflag_t IEXTEN;

	//c_cc indexes
	[CCode (cheader_filename = "termios.h")]
	public const int VINTR;
	[CCode (cheader_filename = "termios.h")]
	public const int VQUIT;
	[CCode (cheader_filename = "termios.h")]
	public const int VERASE;
	[CCode (cheader_filename = "termios.h")]
	public const int VKILL;
	[CCode (cheader_filename = "termios.h")]
	public const int VEOF;
	[CCode (cheader_filename = "termios.h")]
	public const int VMIN;
	[CCode (cheader_filename = "termios.h")]
	public const int VEOL;
	[CCode (cheader_filename = "termios.h")]
	public const int VTIME;
	[CCode (cheader_filename = "termios.h")]
	public const int VSTART;
	[CCode (cheader_filename = "termios.h")]
	public const int VSTOP;
	[CCode (cheader_filename = "termios.h")]
	public const int VSUSP;

	//optional_actions
	[CCode (cheader_filename = "termios.h")]
	public const int TCSANOW;
	[CCode (cheader_filename = "termios.h")]
	public const int TCSADRAIN;
	[CCode (cheader_filename = "termios.h")]
	public const int TCSAFLUSH;

	//queue_selector
	[CCode (cheader_filename = "termios.h")]
	public const int TCIFLUSH;
	[CCode (cheader_filename = "termios.h")]
	public const int TCOFLUSH;
	[CCode (cheader_filename = "termios.h")]
	public const int TCIOFLUSH;

	//action
	[CCode (cheader_filename = "termios.h")]
	public const int TCOOFF;
	[CCode (cheader_filename = "termios.h")]
	public const int TCOON;
	[CCode (cheader_filename = "termios.h")]
	public const int TCIOFF;
	[CCode (cheader_filename = "termios.h")]
	public const int TCION;

	//speed
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B0;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B50;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B75;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B110;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B134;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B150;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B200;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B300;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B600;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B1200;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B1800;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B2400;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B4800;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B9600;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B19200;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B38400;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B57600;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B115200;
	[CCode (cheader_filename = "termios.h")]
	public const speed_t B230400;

	[CCode (cname = "fd_set", cheader_filename = "sys/select.h", has_type_id = false)]
	public struct fd_set {
	}

	[CCode (cname = "struct timeval", cheader_filename = "sys/time.h", has_type_id = false)]
	public struct timeval {
		public time_t tv_sec;
		public long tv_usec;
		[CCode (cname = "gettimeofday")]
		public int get_time_of_day (void * timezone = null);
		[CCode (cname = "settimeofday")]
		public int set_time_of_day (void * timezone = null);
	}

	[CCode (cname = "sigset_t", cheader_filename = "sys/select.h", has_type_id = false)]
	public struct sigset_t {
	}

	[CCode (cheader_filename = "sys/select.h")]
	public int select (int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, timeval timeout);
	[CCode (cheader_filename = "sys/select.h")]
	public void FD_CLR (int fd, ref fd_set @set);
	[CCode (cheader_filename = "sys/select.h")]
	public int  FD_ISSET (int fd, fd_set @set);
	[CCode (cheader_filename = "sys/select.h")]
	public void FD_SET (int fd, ref fd_set @set);
	[CCode (cheader_filename = "sys/select.h")]
	public void FD_ZERO (out fd_set @set);
	[CCode (cheader_filename = "sys/select.h")]
	public int pselect (int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, timespec timeout, sigset_t sigmask);

	// sys/mman.h - Posix mmap(), munmap(), mprotect()
	[CCode (cheader_filename = "sys/mman.h")]
	public void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
	[CCode (cheader_filename = "sys/mman.h")]
	public int munmap(void *addr, size_t length);
	[CCode (cheader_filename = "sys/mman.h")]
	public int mprotect(void *addr, size_t len, int prot);
	[CCode (cheader_filename = "sys/mman.h")]
	public const int PROT_READ;
	[CCode (cheader_filename = "sys/mman.h")]
	public const int PROT_WRITE;
	[CCode (cheader_filename = "sys/mman.h")]
	public const int PROT_EXEC;
	[CCode (cheader_filename = "sys/mman.h")]
	public const int MAP_SHARED;
	[CCode (cheader_filename = "sys/mman.h")]
	public const int MAP_PRIVATE;
	[CCode (cheader_filename = "sys/mman.h")]
	public const int MAP_FIXED;
	[CCode (cheader_filename = "sys/mman.h")]
	public void *MAP_FAILED;
	// sys/mman.h - [MLR] Range Memory Locking
	[CCode (cheader_filename = "sys/mman.h")]
	public int mlock(void *addr, size_t len);
	[CCode (cheader_filename = "sys/mman.h")]
	public int munlock(void *addr, size_t len);
	// sys/mman.h - [SHM] Shared Memory
	[CCode (cheader_filename = "sys/mman.h")]
	public int shm_open (string name, int oflag, mode_t mode = 0);
	[CCode (cheader_filename = "sys/mman.h")]
	public int shm_unlink (string name);
	// sys/mman.h - Process Memory Locking
	[CCode (cheader_filename = "sys/mman.h")]
	public const int MCL_CURRENT;
	[CCode (cheader_filename = "sys/mman.h")]
	public const int MCL_FUTURE;
	[CCode (cheader_filename = "sys/mman.h")]
	public int mlockall (int flags);
	[CCode (cheader_filename = "sys/mman.h")]
	public int munlockall ();
	// sys/mman.h - [XSI] X/Open System Interfaces
	[CCode (cheader_filename = "sys/mman.h")]
	public int msync(void *addr, size_t len, int flags);
	[CCode (cheader_filename = "sys/mman.h")]
	public const int MS_ASYNC;
	[CCode (cheader_filename = "sys/mman.h")]
	public const int MS_INVALIDATE;
	[CCode (cheader_filename = "sys/mman.h")]
	public const int MS_SYNC;

	[CCode (cname = "struct utsname", cheader_filename = "sys/utsname.h", has_type_id = false)]
	public struct utsname {
		public unowned string sysname;
		public unowned string nodename;
		public unowned string release;
		public unowned string version;
		public unowned string machine;
		[CCode (cname = "uname")]
		public utsname ();
	}

	[Compact]
	[CCode (cname = "FILE", free_function = "fclose", cheader_filename = "stdio.h")]
	public class FILE {
		[CCode (cname = "EOF", cheader_filename = "stdio.h")]
		public const int EOF;
		[CCode (cname = "SEEK_SET", cheader_filename = "stdio.h")]
		public const int SEEK_SET;
		[CCode (cname = "SEEK_CUR", cheader_filename = "stdio.h")]
		public const int SEEK_CUR;
		[CCode (cname = "SEEK_END", cheader_filename = "stdio.h")]
		public const int SEEK_END;

		[CCode (cname = "fopen")]
		public static FILE? open (string path, string mode);
		[CCode (cname = "freopen", instance_pos = -1)]
		[ReturnsModifiedPointer]
		public void reopen (string filename, string mode);
		[CCode (cname = "fdopen")]
		public static FILE? fdopen (int fildes, string mode);
		[CCode (cname = "popen")]
		public static CommandPipe? popen (string command, string mode);

		[CCode (cname = "fclose")]
		[DestroysInstance]
		public int close ();
		[CCode (cname = "fprintf")]
		[PrintfFormat ()]
		public int printf (string format, ...);
		[CCode (cname = "fputc", instance_pos = -1)]
		public int putc (char c);
		[CCode (cname = "fputs", instance_pos = -1)]
		public int puts (string s);
		[CCode (cname = "fwrite", instance_pos = -1)]
		public size_t write (void *ptr, size_t size, size_t nmemb);
		[CCode (cname = "fread", instance_pos = -1)]
		public size_t read (void *ptr, size_t size, size_t nmemb);
		[CCode (cname = "fgetc")]
		public int getc ();
		[CCode (cname = "fgets", instance_pos = -1)]
		public unowned string? gets (char[] s);
		[CCode (cname = "feof")]
		public bool eof ();
		[CCode (cname = "fscanf"), ScanfFormat]
		public int scanf (string format, ...);
		[CCode (cname = "fflush")]
		public int flush ();
		[CCode (cname = "fseek")]
		public int seek (long offset, int whence);
		[CCode (cname = "ftell")]
		public long tell ();
		[CCode (cname = "rewind")]
		public void rewind ();
		[CCode (cname = "fileno")]
		public int fileno ();
		[CCode (cname = "ferror")]
		public int error ();
		[CCode (cname = "clearerr")]
		public void clearerr ();
	}

	public static FILE stderr;
	public static FILE stdout;
	public static FILE stdin;

	/**
	 * A pipe to the given command run in a child process
	 *
	 * This is a binding to popen () and pclose (). popen () is the equivalent
	 * of pipe (), fork (), dup2 () and then exec () in a single operation
	 */
	[Compact]
	[CCode (cname = "FILE", free_function = "pclose", cheader_filename = "stdio.h")]
	[Version (since = "vala-0.44")]
	public class CommandPipe : FILE {
		/**
		 * A pipe to the given command run in a child process
		 *
		 * @param command The command to run
		 * @param mode Either 'r' or 'w'. 'r' creates a pipe to the command's
		 * STDOUT, the command's STDIN is the same as the parent process.
		 * 'w' creates a pipe to the command's STDIN, the command's STDOUT is
		 * the same as the parent process
		 */
		[CCode (cname = "popen")]
		public CommandPipe (string command, string mode = "r");
		/**
		 * Explicitly close the pipe
		 *
		 * Explicitly closing the pipe is only necessary when checking the
		 * termination status of the command language interpreter. Normally
		 * Vala will generate code to automatically close the pipe when the
		 * CommandPipe instance goes out of scope
		 *
		 * CommandPipe.close () is synchronous and will return when the child
		 * process has terminated
		 *
		 * @return The termination status of the command language interpreter
		 * or -1 if status could not be obtained. errno will be set if -1
		 */
		[CCode (cname = "pclose")]
		[DestroysInstance]
		public int close ();
	}

	[CCode (cheader_filename = "stdio.h")]
	public void perror (string s);

	[CCode (cheader_filename = "limits.h", cname = "long", cprefix = "", has_type_id = false)]
	public enum Limits {
		AIO_LISTIO_MAX,
		AIO_MAX,
		AIO_PRIO_DELTA_MAX,
		ARG_MAX,
		ATEXIT_MAX,
		CHILD_MAX,
		DELAYTIMER_MAX,
		HOST_NAME_MAX,
		IOV_MAX,
		LOGIN_NAME_MAX,
		MQ_OPEN_MAX,
		MQ_PRIO_MAX,
		OPEN_MAX,
		PAGESIZE,
		PAGE_SIZE,
		PTHREAD_DESTRUCTOR_ITERATIONS,
		PTHREAD_KEYS_MAX,
		PTHREAD_STACK_MIN,
		PTHREAD_THREADS_MAX,
		RTSIG_MAX,
		SEM_NSEMS_MAX,
		SEM_VALUE_MAX,
		SIGQUEUE_MAX,
		SS_REPL_MAX,
		STREAM_MAX,
		SYMLOOP_MAX,
		TIMER_MAX,
		TRACE_EVENT_NAME_MAX,
		TRACE_NAME_MAX,
		TRACE_SYS_MAX,
		TRACE_USER_EVENT_MAX,
		TTY_NAME_MAX,
		TZNAME_MAX,
		FILESIZEBITS,
		LINK_MAX,
		MAX_CANON,
		MAX_INPUT,
		NAME_MAX,
		PATH_MAX,
		PIPE_BUF,
		POSIX_ALLOC_SIZE_MIN,
		POSIX_REC_INCR_XFER_SIZE,
		POSIX_REC_MAX_XFER_SIZE,
		POSIX_REC_MIN_XFER_SIZE,
		POSIX_REC_XFER_ALIGN,
		SYMLINK_MAX,
		BC_BASE_MAX,
		BC_DIM_MAX,
		BC_SCALE_MAX,
		BC_STRING_MAX,
		CHARCLASS_NAME_MAX,
		COLL_WEIGHTS_MAX,
		EXPR_NEST_MAX,
		LINE_MAX,
		NGROUPS_MAX,
		RE_DUP_MAX,
		_POSIX_CLOCKRES_MIN,
		_POSIX_AIO_LISTIO_MAX,
		_POSIX_AIO_MAX,
		_POSIX_ARG_MAX,
		_POSIX_CHILD_MAX,
		_POSIX_DELAYTIMER_MAX,
		_POSIX_HOST_NAME_MAX,
		_POSIX_LINK_MAX,
		_POSIX_LOGIN_NAME_MAX,
		_POSIX_MAX_CANON,
		_POSIX_MAX_INPUT,
		_POSIX_MQ_OPEN_MAX,
		_POSIX_MQ_PRIO_MAX,
		_POSIX_NAME_MAX,
		_POSIX_NGROUPS_MAX,
		_POSIX_OPEN_MAX,
		_POSIX_PATH_MAX,
		_POSIX_PIPE_BUF,
		_POSIX_RE_DUP_MAX,
		_POSIX_RTSIG_MAX,
		_POSIX_SEM_NSEMS_MAX,
		_POSIX_SEM_VALUE_MAX,
		_POSIX_SIGQUEUE_MAX,
		_POSIX_SSIZE_MAX,
		_POSIX_SS_REPL_MAX,
		_POSIX_STREAM_MAX,
		_POSIX_SYMLINK_MAX,
		_POSIX_SYMLOOP_MAX,
		_POSIX_THREAD_DESTRUCTOR_ITERATIONS,
		_POSIX_THREAD_KEYS_MAX,
		_POSIX_THREAD_THREADS_MAX,
		_POSIX_TIMER_MAX,
		_POSIX_TRACE_EVENT_NAME_MAX,
		_POSIX_TRACE_NAME_MAX,
		_POSIX_TRACE_SYS_MAX,
		_POSIX_TRACE_USER_EVENT_MAX,
		_POSIX_TTY_NAME_MAX,
		_POSIX_TZNAME_MAX,
		_POSIX2_BC_BASE_MAX,
		_POSIX2_BC_DIM_MAX,
		_POSIX2_BC_SCALE_MAX,
		_POSIX2_BC_STRING_MAX,
		_POSIX2_CHARCLASS_NAME_MAX,
		_POSIX2_COLL_WEIGHTS_MAX,
		_POSIX2_EXPR_NEST_MAX,
		_POSIX2_LINE_MAX,
		_POSIX2_RE_DUP_MAX,
		_XOPEN_IOV_MAX,
		_XOPEN_NAME_MAX,
		_XOPEN_PATH_MAX,
		CHAR_BIT,
		CHAR_MAX,
		CHAR_MIN,
		INT_MAX,
		INT_MIN,
		LLONG_MAX,
		LLONG_MIN,
		LONG_BIT,
		LONG_MAX,
		LONG_MIN,
		MB_LEN_MAX,
		SCHAR_MAX,
		SCHAR_MIN,
		SHRT_MAX,
		SHRT_MIN,
		SSIZE_MAX,
		UCHAR_MAX,
		UINT_MAX,
		ULLONG_MAX,
		ULONG_MAX,
		USHRT_MAX,
		WORD_BIT,
		NL_ARGMAX,
		NL_LANGMAX,
		NL_MSGMAX,
		NL_SETMAX,
		NL_TEXTMAX,
		NZERO
	}

	[CCode(cheader_filename = "sched.h", cprefix = "sched_")]
	namespace Sched {
		[SimpleType]
		[CCode (cname = "struct sched_param", has_type_id = false)]
		public struct Param {
			public int sched_priority;
		}

		public static int setparam(Posix.pid_t pid, ref Sched.Param param);
		public static int getparam(Posix.pid_t pid, out Sched.Param param);

		public static int setscheduler(Posix.pid_t pid, Algorithm policy, ref Sched.Param param);
		public static Algorithm getscheduler(Posix.pid_t pid);

		public static int @yield();

		public static int get_priority_max(int algorithm);
		public static int get_priority_min(int algorithm);

		public static int rr_get_interval(Posix.pid_t pid, out Posix.timespec? interval);

		[CCode (cprefix = "SCHED_", cname = "int", has_type_id = false)]
		public enum Algorithm {
			OTHER,
			FIFO,
			RR,
			BATCH,
			IDLE
		}
	}

	[Compact]
	[CCode(cheader_filename = "sched.h", cname = "cpu_set_t", free_function = "CPU_FREE", copy_function="memcpy")]
	public class CpuSet {
		[CCode(cname = "CPU_ALLOC")]
		public CpuSet(int num = 1);

		[CCode(cname = "CPU_ALLOC_SIZE")]
		public static size_t alloc_size(int num = 1);

		[CCode(cname = "CPU_SETSIZE")]
		public static size_t size;

		[CCode(cname = "CPU_COUNT")]
		public int count();

		[CCode(cname = "CPU_COUNT_S", instance_pos = -1)]
		public int count_sized(size_t num);

		[CCode(cname = "CPU_ZERO")]
		public void zero();

		[CCode(cname = "CPU_ZERO_S", instance_pos = -1)]
		public void zero_sized(size_t num);

		[CCode(cname = "CPU_SET", instance_pos = -1)]
		public void @set(int cpu);

		[CCode(cname = "CPU_SET_S", instance_pos = -1)]
		public void @set_sized(int cpu, size_t num);

		[CCode(cname = "CPU_CLR", instance_pos = -1)]
		public void clr(int cpu);

		[CCode(cname = "CPU_CLR_S", instance_pos = -1)]
		public void clr_sized(int cpu, size_t num);

		[CCode(cname = "CPU_ISSET", instance_pos = -1)]
		public bool is_set(int cpu);

		[CCode(cname = "CPU_ISSET_S", instance_pos = -1)]
		public bool is_set_sized(int cpu, size_t num);

		[CCode(cname = "CPU_EQUAL")]
		public static bool equal(CpuSet cs1, CpuSet cs2);

		public bool is_equal(CpuSet cs) {
			return CpuSet.equal(this, cs);
		}

		[CCode(cname = "CPU_EQUAL_S", instance_pos = -1)]
		public static bool equal_sized(size_t num, CpuSet cs1, CpuSet cs2);

		public bool is_equal_sized(size_t num, CpuSet cs) {
			return CpuSet.equal_sized(num, this, cs);
		}

		[CCode(cname = "CPU_AND", instance_pos = -1)]
		public void and(CpuSet destset, CpuSet srcset);

		[CCode(cname = "CPU_AND_S", instance_pos = -1)]
		public void and_sized(size_t num, CpuSet destset, CpuSet srcset);

		[CCode(cname = "CPU_OR", instance_pos = -1)]
		public void or(CpuSet destset, CpuSet srcset);

		[CCode(cname = "CPU_OR_S", instance_pos = -1)]
		public void or_sized(size_t num, CpuSet destset, CpuSet srcset);

		[CCode(cname = "CPU_XOR", instance_pos = -1)]
		public void xor(CpuSet destset, CpuSet srcset);

		[CCode(cname = "CPU_XOR_S", instance_pos = -1)]
		public void xor_sized(size_t num, CpuSet destset, CpuSet srcset);

		[CCode(cname = "sched_setaffinity", instance_pos = -1)]
		public int setaffinity(size_t num, [CCode(pos = 0)]Posix.pid_t pid = 0);

		[CCode(cname = "sched_getaffinity", instance_pos = -1)]
		public int getaffinity(size_t num, [CCode(pos = 0)]Posix.pid_t pid = 0);

		public static CpuSet init(int num = 1) {
			CpuSet cpus = new CpuSet(num);
			var size = CpuSet.alloc_size(num);
			cpus.zero_sized(size);
			return cpus;
		}
	}

	[CCode (has_target = false, has_typedef = false)]
	public delegate int GlobErrorFunc (string filename, int errcode);

	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_ERR;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_MARK;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_NOSORT;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_DOOFFS;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_NOCHECK;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_APPEND;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_NOESCAPE;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_PERIOD;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_MAGCHAR;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_ALTDIRFUNC;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_BRACE;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_NOMAGIC;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_TILDE;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_ONLYDIR;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_TILDE_CHECK;

	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_NOSPACE;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_ABORTED;
	[CCode (cheader_filename = "glob.h")]
	public const int GLOB_NOMATCH;

	[CCode (cheader_filename = "glob.h", cname = "glob_t", destroy_function = "globfree", has_type_id = false)]
	public struct Glob {
		[CCode (cname = "gl_pathc")]
		public size_t pathc;
		[CCode (cname = "gl_pathv", array_length = false, array_null_terminated = true)]
		public string[] pathv;
		[CCode (cname = "gl_offs")]
		public size_t offs;

		[CCode (cname = "glob", instance_pos = -1)]
		public int glob (string pattern, int flags = 0, GlobErrorFunc? errfunc = null);
	}

	[CCode (cheader_filename = "langinfo.h", cname = "nl_item", cprefix = "", has_type_id = false)]
	public enum NLItem {
		ABDAY_1,
		ABDAY_2,
		ABDAY_3,
		ABDAY_4,
		ABDAY_5,
		ABDAY_6,
		ABDAY_7,
		DAY_1,
		DAY_2,
		DAY_3,
		DAY_4,
		DAY_5,
		DAY_6,
		DAY_7,
		ABMON_1,
		ABMON_2,
		ABMON_3,
		ABMON_4,
		ABMON_5,
		ABMON_6,
		ABMON_7,
		ABMON_8,
		ABMON_9,
		ABMON_10,
		ABMON_11,
		ABMON_12,
		MON_1,
		MON_2,
		MON_3,
		MON_4,
		MON_5,
		MON_6,
		MON_7,
		MON_8,
		MON_9,
		MON_10,
		MON_11,
		MON_12,
		AM_STR,
		PM_STR,
		D_T_FMT,
		D_FMT,
		T_FMT,
		T_FMT_AMPM,
		ERA,
		ERA_D_FMT,
		ALT_DIGITS,
		ERA_D_T_FMT,
		ERA_T_FMT,
		CODESET,
		CRNCYSTR,
		RADIXCHAR,
		THOUSEP,
		YESEXPR,
		NOEXPR;
		[CCode (cheader_filename = "langinfo.h", cname = "nl_langinfo")]
		public unowned string to_string ();
	}

	[CCode (cheader_filename = "langinfo.h", cname = "nl_item", cprefix = "_NL_TIME_", has_type_id = false)]
	public enum NLTime {
		WEEK_NDAYS,
		WEEK_1STDAY,
		WEEK_1STWEEK,
		FIRST_WEEKDAY,
		FIRST_WORKDAY,
		CAL_DIRECTION,
		TIMEZONE;
		[CCode (cheader_filename = "langinfo.h", cname = "nl_langinfo")]
		public unowned string to_string ();
	}

	[CCode (cheader_filename = "langinfo.h")]
	public unowned string nl_langinfo (NLItem item);

	[CCode (cheader_filename = "unistd.h")]
	public int getopt ([CCode (array_length_pos = 0)] string[] args, string optstring);
	[CCode (cheader_filename = "unistd.h")]
	public static string optarg;
	[CCode (cheader_filename = "unistd.h")]
	public static int optind;
	[CCode (cheader_filename = "unistd.h")]
	public static int opterr;
	[CCode (cheader_filename = "unistd.h")]
	public static int optopt;

	[CCode(cname = "wordexp_t", cheader_filename = "wordexp.h", destroy_function = "wordfree")]
	public struct Wordexp {
		[CCode(cname = "we_wordv", array_length_cname = "we_wordc", array_length_type = "size_t")]
		public string[] words;

		[CCode(cname = "wordexp", instance_pos = 1.1)]
		private int _wordexp (string s, int flags = 0);
		[CCode(cname = "wordfree")]
		private int _wordfree ();

		public int expand (string s, int flags = 0) {
			if (!(WRDE_APPEND in flags || WRDE_REUSE in flags)) {
				_wordfree();
			}
			return _wordexp (s, flags);
		}
		public int append(string s, int flags = 0) {
			return _wordexp (s, flags | WRDE_APPEND);
		}
	}

	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_APPEND;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_BADCHAR;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_BADVAL;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_CMDSUB;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_NOCMD;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_NOSPACE;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_REUSE;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_SHOWERR;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_SYNTAX;
	[CCode(cheader_filename = "wordexp.h")]
	public const int WRDE_UNDEF;


	/* Regular expressions - regex.h */

	[SimpleType]
#if _REGEX_LARGE_OFFSETS
	[IntegerType (rank = 9)]
#else
	[IntegerType (rank = 7)]
#endif
	[CCode(cheader_filename = "regex.h")]
	public struct __re_size_t {
	}

	[SimpleType]
	[IntegerType (rank = 9)]
	[CCode(cheader_filename = "regex.h")]
	public struct __re_long_size_t {
	}

	/* GNU APIs. */
	[Flags]
	[CCode (cname = "reg_syntax_t", cprefix = "RE_", has_type_id = false, cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
	[IntegerType (rank = 9)]
	public enum RegexSyntax {
		BACKSLASH_ESCAPE_IN_LISTS,
		BK_PLUS_QM,
		CHAR_CLASSES,
		CONTEXT_INDEP_ANCHORS,
		CONTEXT_INDEP_OPS,
		CONTEXT_INVALID_OPS,
		DOT_NEWLINE,
		DOT_NOT_NULL,
		HAT_LISTS_NOT_NEWLINE,
		INTERVALS,
		LIMITED_OPS,
		NEWLINE_ALT,
		NO_BK_BRACES,
		NO_BK_PARENS,
		NO_BK_REFS,
		NO_BK_VBAR,
		NO_EMPTY_RANGES,
		UNMATCHED_RIGHT_PAREN_ORD,
		NO_POSIX_BACKTRACKING,
		NO_GNU_OPS,
		DEBUG,
		INVALID_INTERVAL_ORD,
		ICASE,
		CARET_ANCHORS_HERE,
		CONTEXT_INVALID_DUP,
		NO_SUB;

		[CCode (cname = "re_set_syntax", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
		public static RegexSyntax set_syntax (RegexSyntax syntax);
	}

	[CCode (cname = "re_syntax_options", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
	public RegexSyntax syntax_options;

	[CCode (cprefix = "RE_SYNTAX_", lower_case_cprefix = "RE_SYNTAX_", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
	namespace RegexSyntaxType {
		public const RegexSyntax EMACS;
		public const RegexSyntax AWK;
		public const RegexSyntax GNU_AWK;
		public const RegexSyntax POSIX_AWK;
		public const RegexSyntax GREP;
		public const RegexSyntax EGREP;
		public const RegexSyntax POSIX_EGREP;
		public const RegexSyntax ED;
		public const RegexSyntax SED;
		[CCode (cname = "_RE_SYNTAX_POSIX_COMMON")]
		public const RegexSyntax _POSIX_COMMON;
		public const RegexSyntax POSIX_BASIC;
		public const RegexSyntax POSIX_MINIMAL_BASIC;
		public const RegexSyntax POSIX_EXTENDED;
		public const RegexSyntax POSIX_MINIMAL_EXTENDED;
	}

	[CCode (cname = "RE_DUP_MAX", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
	public const ulong REGEX_DUP_MAX;

	/* This is defined as a private enumeration in regex.h. */
	[CCode (cname = "reg_errcode_t", cprefix = "REG_", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
	[SimpleType]
	[IntegerType (rank = 7)]
	public enum RegexError {
		ENOSYS = -1, /* (Strictly speaking, requires _XOPEN_SOURCE) */
		NOERROR = 0,
		NOMATCH,
		BADPAT,
		ECOLLATE,
		ECTYPE,
		EESCAPE,
		ESUBREG,
		EBRACK,
		EPAREN,
		EBRACE,
		BADBR,
		ERANGE,
		ESPACE,
		BADRPT,
		EEND,
		ESIZE,
		ERPAREN
	}

	[CCode (cname = "struct re_pattern_buffer", destroy_function = "regfree", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
	public struct RegexPattern {
		void *buffer;
		__re_long_size_t allocated;
		unowned string fastmap;
		void *translate;
		size_t re_nsub;
		bool no_sub;
		bool not_bol;
		bool not_eol;

		[CCode (cname = "re_compile_pattern", instance_pos = -1, cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
		public unowned string? compile (string pattern, size_t length);

		[CCode (cname = "re_compile_fastmap", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
		public int compile_fastmap ();

		[CCode (cname = "re_search", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
		public RegexOffset search (string String, RegexOffset length, RegexOffset start, RegexOffset range, out RegexRegisters regs);

		[CCode (cname = "re_search_2", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
		public RegexOffset search_2 (string string1, RegexOffset length1, string string2, RegexOffset length2, RegexOffset start, RegexOffset range, out RegexRegisters regs, RegexOffset stop);

		[CCode (cname = "re_match", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
		public RegexOffset match (string String, RegexOffset length, RegexOffset start, out RegexRegisters regs);

		[CCode (cname = "re_match_2", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
		public RegexOffset match_2 (string string1, RegexOffset length1, string string2, RegexOffset length2, RegexOffset start, out RegexRegisters regs, RegexOffset stop);

		[CCode (cname = "re_set_registers", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
		public void set_registers ([CCode (array_length_pos = 1.1)] RegexRegisters[] regs, out RegexOffset starts, out RegexOffset ends);
	}

	[CCode (cname = "int", cprefix = "REGS_", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
	public enum RegexBufferRegs {
		UNALLOCATED,
		REALLOCATE,
		FIXED
	}

	/* POSIX regex APIs. */
	[Flags]
	[CCode (cname = "int", cprefix = "REG_", has_type_id = false, cheader_filename = "regex.h")]
	public enum RegexCompileFlags {
		EXTENDED,
		ICASE,
		NEWLINE,
		NOSUB
	}

	[Flags]
	[CCode (cname = "int", cprefix = "REG_", has_type_id = false, cheader_filename = "regex.h")]
	public enum RegexExecFlags {
		NOTBOL,
		NOTEOL,
		STARTEND
	}

	[CCode (cname = "regex_t", destroy_function = "regfree", cheader_filename = "regex.h")]
	public struct Regex : RegexPattern {
		[CCode (cname = "regcomp", instance_pos = 0)]
		public int comp (string pattern, RegexCompileFlags cflags);

		[CCode (cname = "regexec")]
		public int exec (string String, [CCode (array_length_pos = 1.1, array_length_type = "size_t")] RegexMatch[] pmatch, RegexExecFlags eflags);

		[CCode (cname = "regerror", instance_pos = 1.1)]
		size_t regerror (int errcode, char[]? errbuf);
		public string error (int errcode) {
			size_t errlen = regerror(errcode, null);
			char[] errbuf = new char[errlen];
			regerror(errcode, errbuf);
			return (string) errbuf;
		}
	}

	[SimpleType]
	[CCode (cname = "regoff_t", cheader_filename = "regex.h")]
#if _REGEX_LARGE_OFFSETS
	[IntegerType (rank = 8)]
#else
	[IntegerType (rank = 6)]
#endif
	public struct RegexOffset {
	}

	[CCode (cname = "struct re_registers", cheader_filename = "regex.h", destroy_function = "", feature_test_macro = "_GNU_SOURCE")]
	public struct RegexRegisters {
		public __re_size_t num_regs;
		[CCode (array_length_cname = "num_regs", array_length_type = "__re_size_t")]
		public RegexOffset[] start;
		[CCode (array_length_cname = "num_regs", array_length_type = "__re_size_t")]
		public RegexOffset[] end;

		public void destroy () {
			Posix.free (start);
			Posix.free (end);
		}
	}

	[CCode (cname = "RE_NREGS", cheader_filename = "regex.h", feature_test_macro = "_GNU_SOURCE")]
	public const int REGEX_NREGS;

	[CCode (cname = "regmatch_t")]
	public struct RegexMatch {
		[CCode (cname = "rm_so")]
		public RegexOffset so;  /* Byte offset from string's start to substring's start.  */
		[CCode (cname = "rm_eo")]
		public RegexOffset eo;  /* Byte offset from string's start to substring's end.  */
	}

	/* BSD regex APIs. */
	[CCode (cheader_filename = "regex.h", feature_test_macro = "_REGEX_RE_COMP")]
	public unowned string? re_comp (string re);
	[CCode (cheader_filename = "regex.h", feature_test_macro = "_REGEX_RE_COMP")]
	public int re_exec (string re);
}