summaryrefslogtreecommitdiff
path: root/lib/sys/sys+freebsd-x64.myr
blob: 73821b4fa91f7b68b7b6159ed6c1bed65a753fe2 (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
/*
  generated-ish source
  stitched for freebsd arch:x64
  edit with caution.
 */
pkg sys =
	type size	= int64		/* spans entire address space */
	type usize	= uint64	/* unsigned size */
	type off	= int64		/* file offsets */
	type intptr	= uint64	/* can hold any pointer losslessly */
	type time	= int64		/* milliseconds since epoch */
	type pid	= int		/* process id */
	type scno	= int64		/*syscall*/
	type fdopt	= int64		/* fd options */
	type fd		= int32		/* fd */
	type whence	= uint64	/* seek from whence */
	type mprot	= int64		/* memory protection */
	type mopt	= int64		/* memory mapping options */
	type socktype	= int64		/* socket type */
	type sockopt	= int64		/* socket option */
	type sockproto	= int64		/* socket protocol */
	type sockfam	= uint8		/* socket family */
	type filemode	= uint16
	type filetype	= uint8
	type fcntlcmd	= int64
	type umtxop	= int32
	type signo	= int32
	type sigflags	= int32
	type gid	= int32
	type uid	= int32
	type ffcounter	= int64
	type register	= int64
	type lwpid	= int32
	type rlim	= int64
	type socklen	= int32
	type cpuwhich	= int32
	type id		= int64
	type cpulevel	= int
	type cpusetid	= int
	type idtype	= int
	type sysarchop	= int64
	
	type acltype	= int
	type acltag	= uint32
	type aclperm	= uint32
	type aclenttype	= uint16
	type aclflag	= uint16
	type aclpermset = int#
	type aclflagset	= uint16#
	type clockid	= int32
	type dev	= int32
	
	type caddr	= byte#
	
	type clock = union
		`Clockrealtime
		`Clockrealtime_precise
		`Clockrealtime_fast
		`Clockmonotonic
		`Clockmonotonic_precise     
		`Clockmonotonic_fast
		`Clockuptime
		`Clockuptime_precise
		`Clockuptime_fast
		`Clockvirtual
		`Clockprof
		`Clocksecond
	;;
	
	type kevent = struct
		ident	: intptr	/* identifier for this event */
		filter	: int16		/* filter for event */
		flags	: uint16
		fflags	: int32
		data	: intptr
		udata	: void#		/* user : opaque data identifier */
	;;
	
	type pollfd = struct
		fd	: fd
		events	: uint16
		revents	: uint16
	;;
	
	const Fdsetsize = 1024
	type fdset = struct
		_mask	: uint64[Fdsetsize/64]
	;;
	
	type bintime = struct
		sec	: time
		frac	: uint64
	;;
	
	type mac = struct
		buflen	: size
		string	: byte#
	;;
	
	const Aclmaxent = 254
	type acl = struct
		maxcnt	: uint
		cnt	: uint
		/* Will be required e.g. to implement NFSv4.1 ACL inheritance. */
		spare	: int[4];
		entry	: aclentry[Aclmaxent];
	;;
	
	type aclentry = struct
		tag	: acltag
		id	: uid
		perm	: aclperm
		/* NFSv4 entry type, "allow" or "deny".  Unused in POSIX.1e ACLs. */
		etype	: aclenttype
		/* NFSv4 ACL inheritance.  Unused in POSIX.1e ACLs. */
		flags	: aclflag
	;;
	
	const _MC_FPFMT_NODEV	: int64 = 0x10000	/* device not present or configured */
	const _MC_FPFMT_XMM	: int64 = 0x10002
	const _MC_FPOWNED_NONE	: int64 = 0x20000	/* FP state not used */
	const _MC_FPOWNED_FPU	: int64 = 0x20001	/* FP state came from FPU */
	const _MC_FPOWNED_PCB	: int64 = 0x20002	/* FP state came from PCB */
	
	type mcontext = struct
		/*
		 * The definition of mcontext must match the layout of
		 * struct sigcontext after the sc_mask member.  This is so
		 * that we can support sigcontext and ucontext at the same
		 * time.
		 */
		onstack	: register	/* XXX - sigcontext compat. */
		rdi	: register		/* machine state (struct trapframe) */
		rsi	: register
		rdx	: register
		rcx	: register
		r8	: register
		r9	: register
		rax	: register
		rbx	: register
		rbp	: register
		r10	: register
		r11	: register
		r12	: register
		r13	: register
		r14	: register
		r15	: register
		trapno	: uint32
		fs	: uint16
		gs	: uint16
		addr	: register
		flags	: uint32
		es	: uint16
		ds	: uint16
		err	: register
		rip	: register
		cs	: register
		rflags	: register
		rsp	: register
		ss	: register
	
		len	: int64			/* sizeof(mcontext) */
	
		fpfmt	: int64
		ownedfp	: int64
		/*
		 * See <machine/fpu.h> for the internals of mc_fpstate[].
		 */
		/* FIXME: needs padding? */
		fpstate	: uint64[64]// __aligned(16);
	
		fsbase	: register
		gsbase	: register
	
		xfpustate	: register
		xfpustate_len	: register
	
		mc_spare : int64[4];
	;;
	
	type ucontext = struct
		/*
		 * Keep the order of the first two fields. Also,
		 * keep them the first two fields in the structure.
		 * This way we can have a union with struct
		 * sigcontext and ucontext. This allows us to
		 * support them both at the same time.
		 * note: the union is not defined, though.
		 */
		sigmask		: sigset
		mcontext	: mcontext
		link		: ucontext#
		sigstack	: sigstack
	
		flags		: int
		spare		: int[4]
	;;
	
	type ffclock_estimate = struct
		update_time	: bintime	/* Time of last estimates update. */
		update_ffcount	: ffcounter	/* Counter value at last update. */
		leapsec_next	: ffcounter	/* Counter value of next leap second. */
		period		: uint64	/* Estimate of counter period. */
		errb_abs	: uint32	/* Bound on absolute clock error [ns]. */
		errb_rate	: uint32	/* Bound on counter rate error [ps/s]. */
		status		: uint32	/* Clock status. */
		leapsec_total	: int16		/* All leap seconds seen so far. */
		leapsec		: int8		/* Next leap second (in {-1,0,1}). */
	;;
	
	type sigset = struct
		bits	: uint32[4]
	;;
	
	type sigaction = struct
		handler	: byte#	/* code pointer */
		flags	: sigflags
		mask	: sigset
	;;
	
	type sigstack = struct
		sp	: void#	/* signal stack base */
		size	: size 	/* signal stack length */
		flags	: int  	/* SS_DISABLE and/or SS_ONSTACK */
	;;
	
	type sigevent = struct
		notify	: int;		/* Notification type */
		signo	: int;		/* Signal number */
		value	: uint64
		_union	: uint64[8]	/* FIXME: replace with actual type */
	;;
	
	type siginfo = struct
		signo	: int		/* signal number */
		errno	: int		/* errno association */
		/*
		 * Cause of signal, one of the SI_ macros or signal-specific
		 * values, i.e. one of the FPE_... values for SIGFPE.  This
		 * value is equivalent to the second argument to an old-style
		 * FreeBSD signal handler.
		 */
		code	: int		/* signal code */
		pid	: pid			/* sending process */
		uid	: uid			/* sender's ruid */
		status	: int		/* exit value */
		addr	: void#		/* faulting instruction */
		val	: uint64
		_spare1	: int64	/* FIXME: abi */
		_spare2	: int[7]
	;;
	
	type waitstatus = union
		`Waitfail int32
		`Waitexit int32
		`Waitsig  int32
		`Waitstop int32
	;;
	
	type timezone = struct
		minswest	: int	/* minutes west of Greenwich */
		dsttime		: int	/* type of dst correction */
	;;
	
	type timespec = struct
		sec	: int64
		nsec	: int64
	;;
	
	type timeval = struct
		sec	: int64
		usec	: int64
	;;
	
	type itimerval = struct
		interval	: timeval
		value		: timeval
	;;
	
	type itimerspec = struct
		interval	: timespec
		value		: timespec
	;;
	
	/*
	 * NTP daemon interface -- ntp_adjtime(2) -- used to discipline CPU clock
	 * oscillator and control/determine status.
	 *
	 * Note: The offset, precision and jitter members are in microseconds if
	 * STA_NANO is zero and nanoseconds if not.
	 */
	type timex = struct
		modes 		: uint	/* clock mode bits (wo) */
		offset		: int64			/* time offset (ns/us) (rw) */
		freq		: int64			/* frequency offset (scaled PPM) (rw) */
		maxerror	: int64		/* maximum error (us) (rw) */
		esterror	: int64		/* estimated error (us) (rw) */
		status		: int	   	/* clock status bits (rw) */
		constant	: int64		/* poll interval (log2 s) (rw) */
		precision	: int64		/* clock precision (ns/us) (ro) */
		tolerance	: int64		/* clock frequency tolerance (scaled
					 	 * PPM) (ro) */
		/*
		 * following : The read-only structure members are implemented
		 * if : only the PPS signal discipline is configured in the
		 * kernel. are : They included in all configurations to insure
		 * portability.
		 */
		ppsfreq	: int64		/* PPS frequency (scaled PPM) (ro) */
		jitter	: int64			/* PPS jitter (ns/us) (ro) */
		shift	: int			/* interval duration (s) (shift) (ro) */
		stabil	: int64			/* PPS stability (scaled PPM) (ro) */
		jitcnt	: int64			/* jitter limit exceeded (ro) */
		calcnt	: int64			/* calibration intervals (ro) */
		errcnt	: int64			/* calibration errors (ro) */
		stbcnt	: int64			/* stability limit exceeded (ro) */
	;;
	
	type rusage = struct
		utime	: timeval /* user time */
		stime	: timeval /* system time */
		maxrss	: uint64 /* max resident set size*/
		ixrss	: uint64 /* shared text size */
		idrss	: uint64 /* unshared data size */
		isrss	: uint64 /* unshared stack size */
		minflt	: uint64 /* page reclaims */
		majflt	: uint64 /* page faults */
		nswap	: uint64 /* swaps */
		inblock	: uint64 /* block input ops */
		oublock	: uint64 /* block output ops */
		msgsnd	: uint64 /* messages sent */	
		msgrcv	: uint64 /* messages received */
		nsignals : uint64 /* signals received */
		nvcsw	: uint64 /* voluntary context switches */
		nivcsw	: uint64 /* involuntary context switches */
	;;
	
	type wrusage = struct
		self	: rusage
		child	: rusage
	;;
	
	type rlimit = struct
		cur	: rlim
		max	: rlim
	;;
	
	const Caprightsversion	= 0
	type caprights = struct
		rights	: uint64[Caprightsversion + 2]
	;;
	
	type statbuf = struct
		dev	: uint32 
		ino	: uint32 
		mode	: filemode
		nlink	: uint16
		uid	: uint32
		gid	: uint32
		rdev	: uint32
		atime	: timespec
		mtime	: timespec
		ctime	: timespec
		size	: int64
		blocks	: int64
		blksize	: uint32
		flags	: uint32
		gen	: uint32
		lspare	: int32
		birthtim	: timespec 
	;;
	
	const Mfsnamelen	= 16		/* length of type name including null */
	const Mnamelen		= 88		/* size of on/from name bufs */
	const Statfs_version	= 0x20030518	/* current version number */
	type statfs = struct
		version		: uint32	/* structure version number */
		kind		: uint32	/* type of filesystem */
		flags		: uint64	/* copy of mount exported flags */
		bsize		: uint64	/* filesystem fragment size */
		iosize		: uint64	/* optimal transfer block size */
		blocks		: uint64	/* total data blocks in filesystem */
		bfree		: uint64	/* free blocks in filesystem */
		bavail		: int64		/* free blocks avail to non-superuser */
		files		: uint64	/* total file nodes in filesystem */
		ffree		: int64		/* free nodes avail to non-superuser */
		syncwrites	: uint64	/* count of sync writes since mount */
		asyncwrites	: uint64	/* count of async writes since mount */
		syncreads	: uint64	/* count of sync reads since mount */
		asyncreads	: uint64	/* count of async reads since mount */
		spare		: uint64[10]	/* unused spare */
		namemax		: uint32	/* maximum filename length */
		owner	  	: uid		/* user that mounted the filesystem */
		fsid	  	: fsid		/* filesystem id */
		charspare	: byte[80]	/* spare string space */
		fstypename	: byte[Mfsnamelen]	/* filesystem type name */
		mntfromname	: byte[Mnamelen]	/* mounted filesystem */
		mntonname	: byte[Mnamelen]	/* directory on which mounted */
	;;
	
	type fhandle = struct
		fsid	: fsid
		fid	: fid
	;;
	
	type fsid = struct
		val	: int32[2]
	;;
	
	const Maxfidsz = 16
	type fid = struct
		len	: int16		/* length of data in bytes */
		data0	: int16	/* force longword alignment */
		data	: byte[Maxfidsz];	/* data (variable length) */
	;;
	
	type utsname = struct
		system	: byte[256]
		node	: byte[256] 
		release	: byte[256]
		version	: byte[256]
		machine	: byte[256]
	;;
	
	
	type inaddr = struct
		addr	: byte[4]
	;;
	
	type in6addr = struct
		addr	: byte[16]
	;;
	
	type sockaddr = struct
		len	: byte
		fam	: sockfam
		data	: byte[14] /* what is the *actual* length? */
	;;
	
	type sockaddr_in = struct
		len	: byte
		fam	: sockfam
		port	: uint16
		addr	: byte[4]
		zero	: byte[8]
	;;
	
	type sockaddr_in6 = struct
		len	: byte
		fam	: sockfam
		port	: uint16
		flow	: uint32
		addr	: byte[16]
		scope	: uint32
	;;
	
	type sockaddr_un = struct
		len	: uint8
		fam	: sockfam
		path	: byte[104]
	;;
	
	type sockaddr_storage = struct
		len	: byte
		fam	: sockfam
		__pad1	: byte[6]
		__align	: int64
		__pad2 	: byte[112]
	;;	
	
	type dirent = struct
		fileno	: uint32
		reclen	: uint16
		ftype	: filetype
		namelen	: uint8
		name	: byte[256]	
	;;	
	
	type rtprio = struct
		rttype	: uint16
		rtprio	: uint16
	;;
	
	type thrparam = struct
		startfn	: void#	/* pointer to code for thread entry */
		arg	: void#	/* pointer argument for thread entry */
		stkbase	: byte#	/* stack base address */
		stksz	: size	/* size of stack */
		tlsbase	: byte#	/* base of thread local storage */
		tlssz	: size	/* size of tls */
		tid	: uint64#	/* place to store new tid */
		ptid	: uint64#	/* place to store parent tid */
		flags	: int32	/* flags for the thread */
		rtp	: rtprio#	/* realtime priority */
		spare	: void#[3]	/* padding */
	;;
	
	type iovec = struct
		base	: byte#
		len	: uint64
	;;
	
	const Maxcpu = 256
	type cpuset = struct
		bits	: uint64[Maxcpu/64]
	;;
	
	type sched_param = struct
		priority	: int
	;;
	
	const Jailapi =	2
	type jail =  struct
		version	: uint32;
		path	: byte#
		hostname		: byte#
		jailname		: byte#
		ip4s	: uint32
		ip6s	: uint32
		ip4	: inaddr#
		ip6	: in6addr#
	;;
	
	const Msgoob		= 0x1		/* process out-of-band data */
	const Msgpeek		= 0x2		/* peek at incoming message */
	const Msgdontroute	= 0x4		/* send without using routing tables */
	const Msgeor		= 0x8		/* data completes record */
	const Msgtrunc		= 0x10		/* data discarded before delivery */
	const Msgctrunc		= 0x20		/* control data lost before delivery */
	const Msgwaitall	= 0x40		/* wait for full request or error */
	const Msgnosignal	= 0x20000	/* do not generate SIGPIPE on EOF */
	const Msgdontwait	= 0x80		/* this message should be nonblocking */
	const Msgeof		= 0x100		/* data completes connection */
	const Msgnotification	= 0x2000        /* SCTP notification */
	const Msgnbio		= 0x4000	/* FIONBIO mode, used by fifofs */
	const Msgcompat      	= 0x8000	/* used in sendit() */
	const Msgcmsg_cloexec 	= 0x40000	/* make received fds close-on-exec */
	const Msgwaitforone	= 0x80000	/* for recvmmsg() */
	type msghdr = struct
		name	: void#	/* optional address */
		namelen	: int32	/* size of address */
		iov	: iovec	/* scatter/gather array */
		iovlen	: int	/* # elements in msg_iov */
		ctl	: void#	/* ancillary data, see below */
		ctllen	: int32	/* ancillary data buffer len */
		flags	: int	/* flags on received message */
	;;
	
	type sf_hdtr = struct
		hdr	: iovec#
		hdrcnt	: int
		trl	: iovec#
		trlcnt	: int
	;;
	
	type aiocb = struct
		fildes	: int		/* File descriptor */
		offset	: off		/* File offset for I/O */
		buf	: void# 	/* I/O buffer in process space */
		nbytes	: size		/* Number of bytes for I/O */
		__spare__ 	: int[2]
		__spare2__	: void#
		lio_opcode	: int		/* LIO opcode */
		reqprio		: int		/* Request priority -- ignored */
		_aiocb_private	: __aiocb_private
		sigevent	: sigevent	/* Signal to deliver */
	;;
	
	type __aiocb_private = struct
		status	: int64
		error	: int64
		kinfo	: void#
	;;
	
	const _Uuidnodesz = 6
	type uuid = struct
		time_low			: uint32
		time_mid			: uint16
		time_hi_and_version		: uint16
		clock_seq_hi_and_reserved	: uint8
		clock_seq_low			: uint8
		node				: uint8[_Uuidnodesz];
	;;
	
	const Umtxabstime = 1
	type umtx_time = struct
		timeout	: timespec
		flags	: uint32
		clockid	: uint32
	;;
	
	/* open options */
	const Ordonly  	: fdopt = 0x0
	const Owronly  	: fdopt = 0x1
	const Ordwr    	: fdopt = 0x2
	const Oappend  	: fdopt = 0x8
	const Ocreat   	: fdopt = 0x200
	const Onofollow	: fdopt = 0x100
	const Ondelay  	: fdopt = 0x4
	const Otrunc   	: fdopt = 0x400
	const Odir	: fdopt = 0x20000
	
	const Oshlock	: fdopt = 0x0010	/* open with shared file lock */
	const Oexlock	: fdopt = 0x0020	/* open with exclusive file lock */
	const Oasync	: fdopt = 0x0040	/* signal pgrp when data ready */
	const Ofsync	: fdopt = 0x0080	/* synchronous writes */
	const Oexcl	: fdopt = 0x0800	/* error if already exists */
	const Ocloexec	: fdopt = 0x00100000
	
	/* stat modes */	
	const Sifmt	: filemode = 0xf000
	const Sififo	: filemode = 0x1000
	const Sifchr	: filemode = 0x2000
	const Sifdir	: filemode = 0x4000
	const Sifblk	: filemode = 0x6000
	const Sifreg	: filemode = 0x8000
	const Siflnk	: filemode = 0xa000
	const Sifsock 	: filemode = 0xc000
	
	/* mmap protection */
	const Mprotnone	: mprot = 0x0
	const Mprotrd	: mprot = 0x1
	const Mprotwr	: mprot = 0x2
	const Mprotexec	: mprot = 0x4
	const Mprotrw	: mprot = 0x3
	
	/* mmap options */
	const Mshared	: mopt = 0x1
	const Mpriv	: mopt = 0x2
	const Mfixed	: mopt = 0x10
	const Mfile	: mopt = 0x0
	const Manon	: mopt = 0x1000
	const M32bit	: mopt = 0x80000
	
	/* file types */
	const Dtunknown	: filetype = 0
	const Dtfifo	: filetype = 1
	const Dtchr	: filetype = 2
	const Dtdir	: filetype = 4
	const Dtblk	: filetype = 6
	const Dtreg	: filetype = 8
	const Dtlnk	: filetype = 10
	const Dtsock	: filetype = 12
	const Dtwht	: filetype = 14
	
	/* socket families. INCOMPLETE. */
	const Afunspec	: sockfam = 0
	const Afunix	: sockfam = 1
	const Afinet	: sockfam = 2
	const Afinet6	: sockfam = 28
	
	/* socket types. */
	const Sockstream	: socktype = 1
	const Sockdgram		: socktype = 2
	const Sockraw		: socktype = 3
	const Sockrdm		: socktype = 4
	const Sockseqpacket	: socktype = 5
	
	/* socket options */
	const Sodebug	: sockopt = 0x0001		/* turn on debugging info recording */
	const Soacceptconn	: sockopt = 0x0002	/* socket has had listen() */
	const Soreuseaddr	: sockopt = 0x0004	/* allow local address reuse */
	const Sokeepalive	: sockopt = 0x0008	/* keep connections alive */
	const Sodontroute	: sockopt = 0x0010	/* just use interface addresses */
	const Sobroadcast	: sockopt = 0x0020	/* permit sending of broadcast msgs */
	const Souseloopback	: sockopt = 0x0040	/* bypass hardware when possible */
	const Solinger		: sockopt = 0x0080	/* linger on close if data present */
	const Sooobinline	: sockopt = 0x0100	/* leave received OOB data in line */
	const Soreuseport	: sockopt = 0x0200	/* allow local address & port reuse */
	const Sotimestamp	: sockopt = 0x0400	/* timestamp received dgram traffic */
	const Sonosigpipe	: sockopt = 0x0800	/* no SIGPIPE from EPIPE */
	const Soacceptfilter	: sockopt = 0x1000	/* there is an accept filter */
	const Sobintime		: sockopt = 0x2000	/* timestamp received dgram traffic */
	const Sonooffload	: sockopt = 0x4000	/* socket cannot be offloaded */
	const Sonoddp		: sockopt = 0x8000	/* disable direct data placement */
	
	/* socket option levels */
	const Solsocket		: sockproto = 0xffff
	
	/* network protocols */
	const Ipproto_ip	: sockproto = 0
	const Ipproto_icmp	: sockproto = 1
	const Ipproto_tcp	: sockproto = 6
	const Ipproto_udp	: sockproto = 17
	const Ipproto_raw	: sockproto = 255
	
	/* poll options */
	const Pollin		: uint16 = 0x0001	/* any readable data available */
	const Pollpri		: uint16 = 0x0002	/* OOB/Urgent readable data */
	const Pollout		: uint16 = 0x0004	/* file descriptor is writeable */
	const Pollrdnorm	: uint16 = 0x0040	/* non-OOB/URG data available */
	const Pollwrnorm	: uint16 = Pollout	/* no write type differentiation */
	const Pollrdband	: uint16 = 0x0080	/* OOB/Urgent readable data */
	const Pollwrband	: uint16 = 0x0100	/* OOB/Urgent data can be written */
	/* General FreeBSD extension (currently only supported for sockets): */
	const Pollinigneof	: uint16 = 0x2000	/* like POLLIN, except ignore EOF */
	/*
	* These events are set if they occur regardless of whether they were
	* requested.
	*/
	const Pollerr		: uint16 = 0x0008		/* some poll error occurred */
	const Pollhup		: uint16 = 0x0010		/* file descriptor was "hung up" */
	const Pollnval		: uint16 = 0x0020		/* requested events "invalid" */
	
	const Seekset	: whence = 0
	const Seekcur	: whence = 1
	const Seekend	: whence = 2
	
	/* system specific constants */
	const Maxpathlen	: size = 1024
	
	/* fcntl constants */
	const Fdupfd	: fcntlcmd = 0		/* duplicate file descriptor */
	const Fgetfd	: fcntlcmd = 1		/* get file descriptor flags */
	const Fsetfd	: fcntlcmd = 2		/* set file descriptor flags */
	const Fgetfl	: fcntlcmd = 3		/* get file status flags */
	const Fsetfl	: fcntlcmd = 4		/* set file status flags */
	const Fgetown	: fcntlcmd = 5		/* get SIGIO/SIGURG proc/pgrp */
	const Fsetown	: fcntlcmd = 6		/* set SIGIO/SIGURG proc/pgrp */
	const Fogetlk	: fcntlcmd = 7		/* get record locking information */
	const Fosetlk	: fcntlcmd = 8		/* set record locking information */
	const Fosetlkw	: fcntlcmd = 9		/* F_SETLK; wait if blocked */
	const Fdup2fd	: fcntlcmd = 10		/* duplicate file descriptor to arg */
	const Fgetlk	: fcntlcmd = 11		/* get record locking information */
	const Fsetlk	: fcntlcmd = 12		/* set record locking information */
	const Fsetlkw	: fcntlcmd = 13		/* F_SETLK; wait if blocked */
	const Fsetlk_remote	: fcntlcmd = 14		/* debugging support for remote locks */
	const Freadahead	: fcntlcmd = 15		/* read ahead */
	const Frdahead	: fcntlcmd = 16		/* Darwin compatible read ahead */
	const Fdupfd_cloexec	: fcntlcmd = 17		/* Like F_DUPFD, but FD_CLOEXEC is set */
	const Fdup2fd_cloexec	: fcntlcmd = 18		/* Like F_DUP2FD, but FD_CLOEXEC is set */
	
	/* return value for a failed mapping */
	const Mapbad	: byte# = (-1 : byte#)
	
	/* umtx ops */
	const Umtxlock	: umtxop = 0
	const Umtxunlock	: umtxop = 1
	const Umtxwait	: umtxop = 2
	const Umtxwake	: umtxop = 3
	const UmtxmtxTrylock	: umtxop = 4
	const Umtxmtxlock	: umtxop = 5
	const Umtxmtxunlock	: umtxop = 6
	const Umtxsetceiling	: umtxop = 7
	const Umtxcvwait	: umtxop = 8
	const Umtxcvsignal	: umtxop = 9
	const Umtxcvbroadcast	: umtxop = 10
	const Umtxwaituint	: umtxop = 11
	const Umtxrwrdlock	: umtxop = 12
	const Umtxrwwrlock	: umtxop = 13
	const Umtxrwunlock	: umtxop = 14
	const Umtxwaituintpriv	: umtxop = 15
	const Umtxwakepriv	: umtxop = 16
	const Umtxmutexwait	: umtxop = 17
	const Umtxsemwait	: umtxop = 19
	const Umtxsemwake	: umtxop = 20
	const Umtxnwakepriv	: umtxop = 21
	const Umtxmtxwake2	: umtxop = 22
	const Umtxmax	: umtxop = 23
	
	/* signal actions */
	const Saonstack		: sigflags = 0x0001	/* take signal on signal stack */
	const Sarestart		: sigflags = 0x0002	/* restart system call on signal return */
	const Saresethand	: sigflags = 0x0004	/* reset to SIG_DFL when taking signal */
	const Sanodefer		: sigflags = 0x0010	/* don't mask the signal we're delivering */
	const Sanocldwait	: sigflags = 0x0020	/* don't keep zombies around */
	const Sasiginfo		: sigflags = 0x0040	/* signal handler with SA_SIGINFO args */
	
	/* signal numbers */
	const Sighup	: signo = 1	/* hangup */
	const Sigint	: signo = 2	/* interrupt */
	const Sigquit	: signo = 3	/* quit */
	const Sigill	: signo = 4	/* illegal instr. (not reset when caught) */
	const Sigtrap	: signo = 5	/* trace trap (not reset when caught) */
	const Sigabrt	: signo = 6	/* abort() */
	const Sigiot	: signo = Sigabrt	/* compatibility */
	const Sigemt	: signo = 7	/* EMT instruction */
	const Sigfpe	: signo = 8	/* floating point exception */
	const Sigkill	: signo = 9	/* kill (cannot be caught or ignored) */
	const Sigbus	: signo = 10	/* bus error */
	const Sigsegv	: signo = 11	/* segmentation violation */
	const Sigsys	: signo = 12	/* non-existent system call invoked */
	const Sigpipe	: signo = 13	/* write on a pipe with no one to read it */
	const Sigalrm	: signo = 14	/* alarm clock */
	const Sigterm	: signo = 15	/* software termination signal from kill */
	const Sigurg	: signo = 16	/* urgent condition on IO channel */
	const Sigstop	: signo = 17	/* sendable stop signal not from tty */
	const Sigtstp	: signo = 18	/* stop signal from tty */
	const Sigcont	: signo = 19	/* continue a stopped process */
	const Sigchld	: signo = 20	/* to parent on child stop or exit */
	const Sigttin	: signo = 21	/* to readers pgrp upon background tty read */
	const Sigttou	: signo = 22	/* like TTIN if (tp->t_local&LTOSTOP) */
	const Sigio	: signo = 23	/* input/output possible signal */
	const Sigxcpu	: signo = 24	/* exceeded CPU time limit */
	const Sigxfsz	: signo = 25	/* exceeded file size limit */
	const Sigvtalrm	: signo = 26	/* virtual time alarm */
	const Sigprof	: signo = 27	/* profiling time alarm */
	const Sigwinch	: signo = 28	/* window size changes */
	const Siginfo	: signo = 29	/* information request */
	const Sigusr1	: signo = 30	/* user defined signal 1 */
	const Sigusr2	: signo = 31	/* user defined signal 2 */
	const Sigthr	: signo = 32	/* reserved by thread library. */
	const Siglwp	: signo = Sigthr
	const Siglibrt	: signo = 33	/* reserved by real-time library. */
	
	/* sysarch ops */
	const Archamd64getfs   : sysarchop = 128
	const Archamd64setfs   : sysarchop = 129
	const Archamd64getgs   : sysarchop = 130
	const Archamd64setgs   : sysarchop = 131
	const Archamd64getxfpu : sysarchop = 132
	
	extern const syscall : (sc:scno, args:... -> int64)
	extern var __cenvp : byte##
	

	const Sysnosys			: scno = 0
	const Sysexit			: scno = 1
	const Sysfork			: scno = 2
	const Sysread			: scno = 3
	const Syswrite			: scno = 4
	const Sysopen			: scno = 5
	const Sysclose			: scno = 6
	const Syswait4			: scno = 7
	const Syslink			: scno = 9
	const Sysunlink			: scno = 10
	const Syschdir			: scno = 12
	const Sysfchdir			: scno = 13
	const Sysmknod			: scno = 14
	const Syschmod			: scno = 15
	const Syschown			: scno = 16
	const Sysobreak			: scno = 17
	const Sysgetpid			: scno = 20
	const Sysmount			: scno = 21
	const Sysunmount		: scno = 22
	const Syssetuid			: scno = 23
	const Sysgetuid			: scno = 24
	const Sysgeteuid		: scno = 25
	const Sysptrace			: scno = 26
	const Sysrecvmsg		: scno = 27
	const Syssendmsg		: scno = 28
	const Sysrecvfrom		: scno = 29
	const Sysaccept			: scno = 30
	const Sysgetpeername		: scno = 31
	const Sysgetsockname		: scno = 32
	const Sysaccess			: scno = 33
	const Syschflags		: scno = 34
	const Sysfchflags		: scno = 35
	const Syssync			: scno = 36
	const Syskill			: scno = 37
	const Sysgetppid		: scno = 39
	const Sysdup			: scno = 41
	const Sysgetegid		: scno = 43
	const Sysprofil			: scno = 44
	const Sysktrace			: scno = 45
	const Sysgetgid			: scno = 47
	const Sysgetlogin		: scno = 49
	const Syssetlogin		: scno = 50
	const Sysacct			: scno = 51
	const Syssigaltstack		: scno = 53
	const Sysioctl			: scno = 54
	const Sysreboot			: scno = 55
	const Sysrevoke			: scno = 56
	const Syssymlink		: scno = 57
	const Sysreadlink		: scno = 58
	const Sysexecve			: scno = 59
	const Sysumask			: scno = 60
	const Syschroot			: scno = 61
	const Sysmsync			: scno = 65
	const Sysvfork			: scno = 66
	const Syssbrk			: scno = 69
	const Syssstk			: scno = 70
	const Sysovadvise		: scno = 72
	const Sysmunmap			: scno = 73
	const Sysmprotect		: scno = 74
	const Sysmadvise		: scno = 75
	const Sysmincore		: scno = 78
	const Sysgetgroups		: scno = 79
	const Syssetgroups		: scno = 80
	const Sysgetpgrp		: scno = 81
	const Syssetpgid		: scno = 82
	const Syssetitimer		: scno = 83
	const Sysswapon			: scno = 85
	const Sysgetitimer		: scno = 86
	const Sysgetdtablesize		: scno = 89
	const Sysdup2			: scno = 90
	const Sysfcntl			: scno = 92
	const Sysselect			: scno = 93
	const Sysfsync			: scno = 95
	const Syssetpriority		: scno = 96
	const Syssocket			: scno = 97
	const Sysconnect		: scno = 98
	const Sysgetpriority		: scno = 100
	const Sysbind			: scno = 104
	const Syssetsockopt		: scno = 105
	const Syslisten			: scno = 106
	const Sysgettimeofday		: scno = 116
	const Sysgetrusage		: scno = 117
	const Sysgetsockopt		: scno = 118
	const Sysreadv			: scno = 120
	const Syswritev			: scno = 121
	const Syssettimeofday		: scno = 122
	const Sysfchown			: scno = 123
	const Sysfchmod			: scno = 124
	const Syssetreuid		: scno = 126
	const Syssetregid		: scno = 127
	const Sysrename			: scno = 128
	const Sysflock			: scno = 131
	const Sysmkfifo			: scno = 132
	const Syssendto			: scno = 133
	const Sysshutdown		: scno = 134
	const Syssocketpair		: scno = 135
	const Sysmkdir			: scno = 136
	const Sysrmdir			: scno = 137
	const Sysutimes			: scno = 138
	const Sysadjtime		: scno = 140
	const Syssetsid			: scno = 147
	const Sysquotactl		: scno = 148
	const Syslgetfh			: scno = 160
	const Sysgetfh			: scno = 161
	const Syssysarch		: scno = 165
	const Sysrtprio			: scno = 166
	const Syssetfib			: scno = 175
	const Sysntp_adjtime		: scno = 176
	const Syssetgid			: scno = 181
	const Syssetegid		: scno = 182
	const Sysseteuid		: scno = 183
	const Sysstat			: scno = 188
	const Sysfstat			: scno = 189
	const Syslstat			: scno = 190
	const Syspathconf		: scno = 191
	const Sysfpathconf		: scno = 192
	const Sysgetrlimit		: scno = 194
	const Syssetrlimit		: scno = 195
	const Sysgetdirentries		: scno = 196
	const Sys__sysctl		: scno = 202
	const Sysmlock			: scno = 203
	const Sysmunlock		: scno = 204
	const Sysundelete		: scno = 205
	const Sysfutimes		: scno = 206
	const Sysgetpgid		: scno = 207
	const Syspoll			: scno = 209
	const Sysclock_gettime		: scno = 232
	const Sysclock_settime		: scno = 233
	const Sysclock_getres		: scno = 234
	const Sysktimer_create		: scno = 235
	const Sysktimer_delete		: scno = 236
	const Sysktimer_settime		: scno = 237
	const Sysktimer_gettime		: scno = 238
	const Sysktimer_getoverrun	: scno = 239
	const Sysnanosleep		: scno = 240
	const Sysffclock_getcounter	: scno = 241
	const Sysffclock_setestimate	: scno = 242
	const Sysffclock_getestimate	: scno = 243
	const Sysclock_getcpuclockid2	: scno = 247
	const Sysminherit		: scno = 250
	const Sysrfork			: scno = 251
	const Sysopenbsd_poll		: scno = 252
	const Sysissetugid		: scno = 253
	const Syslchown			: scno = 254
	const Sysaio_read		: scno = 255
	const Sysaio_write		: scno = 256
	const Syslio_listio		: scno = 257
	const Sysgetdents		: scno = 272
	const Syslchmod			: scno = 274
	const Syslutimes		: scno = 276
	const Sysnstat			: scno = 278
	const Sysnfstat			: scno = 279
	const Sysnlstat			: scno = 280
	const Syspreadv			: scno = 289
	const Syspwritev		: scno = 290
	const Sysfhopen			: scno = 298
	const Sysfhstat			: scno = 299
	const Sysmodnext		: scno = 300
	const Sysmodfnext		: scno = 302
	const Sysmodfind		: scno = 303
	const Syskldload		: scno = 304
	const Syskldunload		: scno = 305
	const Syskldfind		: scno = 306
	const Syskldnext		: scno = 307
	const Syskldfirstmod		: scno = 309
	const Sysgetsid			: scno = 310
	const Syssetresuid		: scno = 311
	const Syssetresgid		: scno = 312
	const Sysaio_return		: scno = 314
	const Sysaio_suspend		: scno = 315
	const Sysaio_cancel		: scno = 316
	const Sysaio_error		: scno = 317
	const Sysyield			: scno = 321
	const Sysmlockall		: scno = 324
	const Sysmunlockall		: scno = 325
	const Sys__getcwd		: scno = 326
	const Syssched_setparam		: scno = 327
	const Syssched_getparam		: scno = 328
	const Syssched_setscheduler	: scno = 329
	const Syssched_getscheduler	: scno = 330
	const Syssched_yield		: scno = 331
	const Syssched_get_priority_max	: scno = 332
	const Syssched_get_priority_min	: scno = 333
	const Syssched_rr_get_interval	: scno = 334
	const Sysutrace			: scno = 335
	const Syskldsym			: scno = 337
	const Sysjail			: scno = 338
	const Syssigprocmask		: scno = 340
	const Syssigsuspend		: scno = 341
	const Syssigpending		: scno = 343
	const Syssigtimedwait		: scno = 345
	const Syssigwaitinfo		: scno = 346
	const Sys__acl_get_file		: scno = 347
	const Sys__acl_set_file		: scno = 348
	const Sys__acl_get_fd		: scno = 349
	const Sys__acl_set_fd		: scno = 350
	const Sys__acl_delete_file	: scno = 351
	const Sys__acl_delete_fd	: scno = 352
	const Sys__acl_aclcheck_file	: scno = 353
	const Sys__acl_aclcheck_fd	: scno = 354
	const Sysextattrctl		: scno = 355
	const Sysextattr_set_file	: scno = 356
	const Sysextattr_get_file	: scno = 357
	const Sysextattr_delete_file	: scno = 358
	const Sysaio_waitcomplete	: scno = 359
	const Sysgetresuid		: scno = 360
	const Sysgetresgid		: scno = 361
	const Syskqueue			: scno = 362
	const Syskevent			: scno = 363
	const Sysextattr_set_fd		: scno = 371
	const Sysextattr_get_fd		: scno = 372
	const Sysextattr_delete_fd	: scno = 373
	const Sys__setugid		: scno = 374
	const Syseaccess		: scno = 376
	const Sysnmount			: scno = 378
	const Sys__mac_get_proc		: scno = 384
	const Sys__mac_set_proc		: scno = 385
	const Sys__mac_get_fd		: scno = 386
	const Sys__mac_get_file		: scno = 387
	const Sys__mac_set_fd		: scno = 388
	const Sys__mac_set_file		: scno = 389
	const Syskenv			: scno = 390
	const Syslchflags		: scno = 391
	const Sysuuidgen		: scno = 392
	const Syssendfile		: scno = 393
	const Sysmac_syscall		: scno = 394
	const Sysgetfsstat		: scno = 395
	const Sysstatfs			: scno = 396
	const Sysfstatfs		: scno = 397
	const Sysfhstatfs		: scno = 398
	const Sys__mac_get_pid		: scno = 409
	const Sys__mac_get_link		: scno = 410
	const Sys__mac_set_link		: scno = 411
	const Sysextattr_set_link	: scno = 412
	const Sysextattr_get_link	: scno = 413
	const Sysextattr_delete_link	: scno = 414
	const Sys__mac_execve		: scno = 415
	const Syssigaction		: scno = 416
	const Syssigreturn		: scno = 417
	const Sysgetcontext		: scno = 421
	const Syssetcontext		: scno = 422
	const Sysswapcontext		: scno = 423
	const Sysswapoff		: scno = 424
	const Sys__acl_get_link		: scno = 425
	const Sys__acl_set_link		: scno = 426
	const Sys__acl_delete_link	: scno = 427
	const Sys__acl_aclcheck_link	: scno = 428
	const Syssigwait		: scno = 429
	const Systhr_create		: scno = 430
	const Systhr_exit		: scno = 431
	const Systhr_self		: scno = 432
	const Systhr_kill		: scno = 433
	const Sysjail_attach		: scno = 436
	const Sysextattr_list_fd	: scno = 437
	const Sysextattr_list_file	: scno = 438
	const Sysextattr_list_link	: scno = 439
	const Systhr_suspend		: scno = 442
	const Systhr_wake		: scno = 443
	const Syskldunloadf		: scno = 444
	const Sysaudit			: scno = 445
	const Sysauditon		: scno = 446
	const Sys_umtx_op		: scno = 454
	const Systhr_new		: scno = 455
	const Syssigqueue		: scno = 456
	const Sysabort2			: scno = 463
	const Systhr_set_name		: scno = 464
	const Sysaio_fsync		: scno = 465
	const Sysrtprio_thread		: scno = 466
	const Syspread			: scno = 475
	const Syspwrite			: scno = 476
	const Sysmmap			: scno = 477
	const Syslseek			: scno = 478
	const Systruncate		: scno = 479
	const Sysftruncate		: scno = 480
	const Systhr_kill2		: scno = 481
	const Sysshm_open		: scno = 482
	const Sysshm_unlink		: scno = 483
	const Syscpuset			: scno = 484
	const Syscpuset_setid		: scno = 485
	const Syscpuset_getid		: scno = 486
	const Syscpuset_getaffinity	: scno = 487
	const Syscpuset_setaffinity	: scno = 488
	const Sysfaccessat		: scno = 489
	const Sysfchmodat		: scno = 490
	const Sysfchownat		: scno = 491
	const Sysfexecve		: scno = 492
	const Sysfstatat		: scno = 493
	const Sysfutimesat		: scno = 494
	const Syslinkat			: scno = 495
	const Sysmkdirat		: scno = 496
	const Sysmkfifoat		: scno = 497
	const Sysmknodat		: scno = 498
	const Sysopenat			: scno = 499
	const Sysreadlinkat		: scno = 500
	const Sysrenameat		: scno = 501
	const Syssymlinkat		: scno = 502
	const Sysunlinkat		: scno = 503
	const Sysposix_openpt		: scno = 504
	const Sysjail_get		: scno = 506
	const Sysjail_set		: scno = 507
	const Sysjail_remove		: scno = 508
	const Sysclosefrom		: scno = 509
	const Syslpathconf		: scno = 513
	const Sys__cap_rights_get	: scno = 515
	const Syscap_enter		: scno = 516
	const Syscap_getmode		: scno = 517
	const Syspdfork			: scno = 518
	const Syspdkill			: scno = 519
	const Syspdgetpid		: scno = 520
	const Syspselect		: scno = 522
	const Sysgetloginclass		: scno = 523
	const Syssetloginclass		: scno = 524
	const Sysrctl_get_racct		: scno = 525
	const Sysrctl_get_rules		: scno = 526
	const Sysrctl_get_limits	: scno = 527
	const Sysrctl_add_rule		: scno = 528
	const Sysrctl_remove_rule	: scno = 529
	const Sysposix_fallocate	: scno = 530
	const Sysposix_fadvise		: scno = 531
	const Syswait6			: scno = 532
	const Syscap_rights_limit	: scno = 533
	const Syscap_ioctls_limit	: scno = 534
	const Syscap_ioctls_get		: scno = 535
	const Syscap_fcntls_limit	: scno = 536
	const Syscap_fcntls_get		: scno = 537
	const Sysbindat			: scno = 538
	const Sysconnectat		: scno = 539
	const Syschflagsat		: scno = 540
	const Sysaccept4		: scno = 541
	const Syspipe2			: scno = 542
	const Sysaio_mlock		: scno = 543
	const Sysprocctl		: scno = 544
	const Sysppoll			: scno = 545
	const Sysfutimens		: scno = 546
	const Sysutimensat		: scno = 547

	/* start manual overrides { */
		const exit	: (status:int -> void)
		const getpid	: ( -> pid)
		const kill	: (pid:pid, sig:int64 -> int64)
		const fork	: (-> pid)
		const wait4	: (pid:pid, loc:int32#, opt : int64, usage:rusage#	-> int64)
		const waitpid	: (pid:pid, loc:int32#, opt : int64	-> int64)
		const execv	: (cmd : byte[:], args : byte[:][:] -> int64)
		const execve	: (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> int64)
		const waitstatus	: (st : int32 -> waitstatus)
		const thr_new	: (param : thrparam#, paramsz : int -> int)
		const thr_exit	: (state : int64# -> void)
		const umtx_op	: (obj : void#, op : umtxop, val : uint64, a1 : void#, a2 : void# -> int)
		const yield	: (-> int)
		const open	: (path:byte[:], opts:fdopt -> fd)
		const openmode	: (path:byte[:], opts:fdopt, mode:int64 -> fd)
		const close	: (fd:fd -> int64)
		const creat	: (path:byte[:], mode:int64 -> fd)
		const unlink	: (path:byte[:] -> int)
		const read	: (fd:fd, buf:byte[:] -> size)
		const pread	: (fd:fd, buf:byte[:], off : off -> size)
		const readv	: (fd:fd, iov:iovec[:] -> size)
		const write	: (fd:fd, buf:byte[:] -> size)
		const pwrite	: (fd:fd, buf:byte[:], off : off -> size)
		const writev	: (fd:fd, iov : iovec[:] -> size)
		const lseek	: (fd:fd, off : off, whence : whence -> int64)
		const stat	: (path:byte[:], sb:statbuf# -> int64)
		const lstat	: (path:byte[:], sb:statbuf# -> int64)
		const fstat	: (fd:fd, sb:statbuf# -> int64)
		const mkdir	: (path : byte[:], mode : int64	-> int64)
		generic ioctl	: (fd:fd, req : int64, arg:@a# -> int64)
		const getdirentries	: (fd : fd, buf : byte[:], basep : int64# -> int64)
		const chdir	: (p : byte[:] -> int64)
		const __getcwd	: (buf : byte[:] -> int64)
		const sigaction	: (sig : signo, act : sigaction#, oact : sigaction# -> int)
		const sigprocmask	: (how : int32, set : sigset#, oset : sigset# -> int)
		const pipe	: (fds : fd[2]# -> int64)
		const dup	: (fd : fd -> fd)
		const dup2	: (src : fd, dst : fd -> fd)
		const fcntl	: (fd : fd, cmd : fcntlcmd, args : byte# -> int64)
		const poll	: (pfd : pollfd[:], tm : int -> int)
		const socket	: (dom : sockfam, stype : socktype, proto : sockproto	-> fd)
		const connect	: (sock	: fd, addr : sockaddr#, len : size -> int)
		const accept	: (sock : fd, addr : sockaddr#, len : size# -> fd)
		const listen	: (sock : fd, backlog : int	-> int)
		const bind	: (sock : fd, addr : sockaddr#, len : size -> int)
		const setsockopt	: (sock : fd, lev : sockproto, opt : sockopt, val : void#, len : size -> int)
		const getsockopt	: (sock : fd, lev : sockproto, opt : sockopt, val : void#, len : size# -> int)
		const munmap	: (addr:byte#, len:size -> int64)
		const mmap	: (addr:byte#, len:size, prot:mprot, flags:mopt, fd:fd, off:off -> byte#)
		const clockid		: (clk : clock -> uint64)
		const clock_getres	: (clk : clock, ts : timespec# -> int32)
		const clock_gettime	: (clk : clock, ts : timespec# -> int32)
		const clock_settime	: (clk : clock, ts : timespec# -> int32)
		const nanosleep	: (req : timespec#, rem : timespec# -> int32)
		const sched_yield	: (-> void)
		const uname 	: (buf : utsname# -> int)
		const sysctl	: (mib : int[:], \
		old : void#, oldsz : size#, \
		new : void#, newsz : size# \
		-> int)
	extern const cstring	: (str : byte[:] -> byte#)
	extern const alloca	: (sz : size	-> byte#)
	extern const __freebsd_pipe	: (fds : fd[2]# -> int64)
	/* } end manual overrides */

	const nosys			:  ( -> int)
	const link			:  (path : byte#, link : byte# -> int)
	const fchdir			:  (fd : int -> int)
	const mknod			:  (path : byte#, mode : int, dev : int -> int)
	const chmod			:  (path : byte#, mode : int -> int)
	const chown			:  (path : byte#, uid : int, gid : int -> int)
	const obreak			:  (nsize : byte# -> int)
	const mount			:  (kind : byte#, path : byte#, flags : int, data : void# -> int)
	const unmount			:  (path : byte#, flags : int -> int)
	const setuid			:  (uid : uid -> int)
	const getuid			:  ( -> uid)
	const geteuid			:  ( -> uid)
	const ptrace			:  (req : int, pid : pid, addr : void#, data : int -> int)
	const recvmsg			:  (s : int, msg : msghdr#, flags : int -> int)
	const sendmsg			:  (s : int, msg : msghdr#, flags : int -> int)
	const recvfrom			:  (s : int, buf : void#, len : size, flags : int, from : sockaddr#, fromlenaddr : int32# -> int)
	const getpeername		:  (fdes : int, asa : sockaddr#, alen : int32# -> int)
	const getsockname		:  (fdes : int, asa : sockaddr#, alen : int32# -> int)
	const access			:  (path : byte#, amode : int -> int)
	const chflags			:  (path : byte#, flags : uint64 -> int)
	const fchflags			:  (fd : int, flags : uint64 -> int)
	const sync			:  ( -> int)
	const getppid			:  ( -> pid)
	const getegid			:  ( -> gid)
	const profil			:  (samples : void#, size : size, offset : size, scale : uint -> int)
	const ktrace			:  (fname : byte#, ops : int, facs : int, pid : int -> int)
	const getgid			:  ( -> gid)
	const getlogin			:  (namebuf : byte#, namelen : uint -> int)
	const setlogin			:  (namebuf : byte# -> int)
	const acct			:  (path : byte# -> int)
	const sigaltstack		:  (ss : sigstack#, oss : sigstack# -> int)
	const reboot			:  (opt : int -> int)
	const revoke			:  (path : byte# -> int)
	const symlink			:  (path : byte#, link : byte# -> int)
	const readlink			:  (path : byte#, buf : byte#, count : size -> size)
	const umask			:  (newmask : int -> int)
	const chroot			:  (path : byte# -> int)
	const msync			:  (addr : void#, len : size, flags : int -> int)
	const vfork			:  ( -> int)
	const sbrk			:  (incr : int -> int)
	const sstk			:  (incr : int -> int)
	const ovadvise			:  (anom : int -> int)
	const mprotect			:  (addr : void#, len : size, prot : int -> int)
	const madvise			:  (addr : void#, len : size, behav : int -> int)
	const mincore			:  (addr : void#, len : size, vec : byte# -> int)
	const getgroups			:  (gidsetsize : uint, gidset : gid# -> int)
	const setgroups			:  (gidsetsize : uint, gidset : gid# -> int)
	const getpgrp			:  ( -> int)
	const setpgid			:  (pid : int, pgid : int -> int)
	const setitimer			:  (which : uint, itv : itimerval#, oitv : itimerval# -> int)
	const swapon			:  (name : byte# -> int)
	const getitimer			:  (which : uint, itv : itimerval# -> int)
	const getdtablesize		:  ( -> int)
	const select			:  (nd : int, _in : fdset#, ou : fdset#, ex : fdset#, tv : timeval# -> int)
	const fsync			:  (fd : int -> int)
	const setpriority		:  (which : int, who : int, prio : int -> int)
	const getpriority		:  (which : int, who : int -> int)
	const gettimeofday		:  (tp : timeval#, tzp : timezone# -> int)
	const getrusage			:  (who : int, rusage : rusage# -> int)
	const settimeofday		:  (tv : timeval#, tzp : timezone# -> int)
	const fchown			:  (fd : int, uid : int, gid : int -> int)
	const fchmod			:  (fd : int, mode : int -> int)
	const setreuid			:  (ruid : int, euid : int -> int)
	const setregid			:  (rgid : int, egid : int -> int)
	const rename			:  (from : byte#, to : byte# -> int)
	const flock			:  (fd : int, how : int -> int)
	const mkfifo			:  (path : byte#, mode : int -> int)
	const sendto			:  (s : int, buf : void#, len : size, flags : int, to : void#, tolen : int -> int)
	const shutdown			:  (s : int, how : int -> int)
	const socketpair		:  (domain : int, kind : int, protocol : int, rsv : int# -> int)
	const rmdir			:  (path : byte# -> int)
	const utimes			:  (path : byte#, tptr : timeval# -> int)
	const adjtime			:  (delta : timeval#, olddelta : timeval# -> int)
	const setsid			:  ( -> int)
	const quotactl			:  (path : byte#, cmd : int, uid : int, arg : void# -> int)
	const lgetfh			:  (fname : byte#, fhp : fhandle# -> int)
	const getfh			:  (fname : byte#, fhp : fhandle# -> int)
	const sysarch			:  (op : sysarchop, parms : void## -> int)
	const rtprio			:  (function : int, pid : pid, rtp : rtprio# -> int)
	const setfib			:  (fibnum : int -> int)
	const ntp_adjtime		:  (tp : timex# -> int)
	const setgid			:  (gid : gid -> int)
	const setegid			:  (egid : gid -> int)
	const seteuid			:  (euid : uid -> int)
	const pathconf			:  (path : byte#, name : int -> int)
	const fpathconf			:  (fd : int, name : int -> int)
	const getrlimit			:  (which : uint, rlp : rlimit# -> int)
	const setrlimit			:  (which : uint, rlp : rlimit# -> int)
	const __sysctl			:  (name : int#, namelen : uint, old : void#, oldlenp : size#, new : void#, newlen : size -> int)
	const mlock			:  (addr : void#, len : size -> int)
	const munlock			:  (addr : void#, len : size -> int)
	const undelete			:  (path : byte# -> int)
	const futimes			:  (fd : int, tptr : timeval# -> int)
	const getpgid			:  (pid : pid -> int)
	const ktimer_create		:  (clock_id : clockid, evp : sigevent#, timerid : int# -> int)
	const ktimer_delete		:  (timerid : int -> int)
	const ktimer_settime		:  (timerid : int, flags : int, value : itimerspec#, ovalue : itimerspec# -> int)
	const ktimer_gettime		:  (timerid : int, value : itimerspec# -> int)
	const ktimer_getoverrun		:  (timerid : int -> int)
	const ffclock_getcounter	:  (ffcount : ffcounter# -> int)
	const ffclock_setestimate	:  (cest : ffclock_estimate# -> int)
	const ffclock_getestimate	:  (cest : ffclock_estimate# -> int)
	const clock_getcpuclockid2	:  (id : id, which : int, clock_id : clockid# -> int)
	const minherit			:  (addr : void#, len : size, inherit : int -> int)
	const rfork			:  (flags : int -> int)
	const openbsd_poll		:  (fds : pollfd#, nfds : uint, timeout : int -> int)
	const issetugid			:  ( -> int)
	const lchown			:  (path : byte#, uid : int, gid : int -> int)
	const aio_read			:  (aiocbp : aiocb# -> int)
	const aio_write			:  (aiocbp : aiocb# -> int)
	const lio_listio		:  (mode : int, acb_list : aiocb##, nent : int, sig : sigevent# -> int)
	const getdents			:  (fd : int, buf : byte#, count : size -> int)
	const lchmod			:  (path : byte#, mode : filemode -> int)
	const lutimes			:  (path : byte#, tptr : timeval# -> int)
	const nstat			:  (path : byte#, ub : statbuf# -> int)
	const nfstat			:  (fd : int, sb : statbuf# -> int)
	const nlstat			:  (path : byte#, ub : statbuf# -> int)
	const preadv			:  (fd : int, iovp : iovec#, iovcnt : uint, offset : off -> size)
	const pwritev			:  (fd : int, iovp : iovec#, iovcnt : uint, offset : off -> size)
	const fhopen			:  (u_fhp : fhandle#, flags : int -> int)
	const fhstat			:  (u_fhp : fhandle#, sb : statbuf# -> int)
	const modnext			:  (modid : int -> int)
	const modfnext			:  (modid : int -> int)
	const modfind			:  (name : byte# -> int)
	const kldload			:  (file : byte# -> int)
	const kldunload			:  (fileid : int -> int)
	const kldfind			:  (file : byte# -> int)
	const kldnext			:  (fileid : int -> int)
	const kldfirstmod		:  (fileid : int -> int)
	const getsid			:  (pid : pid -> int)
	const setresuid			:  (ruid : uid, euid : uid, suid : uid -> int)
	const setresgid			:  (rgid : gid, egid : gid, sgid : gid -> int)
	const aio_return		:  (aiocbp : aiocb# -> size)
	const aio_suspend		:  (aiocbp : aiocb##, nent : int, timeout : timespec# -> int)
	const aio_cancel		:  (fd : int, aiocbp : aiocb# -> int)
	const aio_error			:  (aiocbp : aiocb# -> int)
	const mlockall			:  (how : int -> int)
	const munlockall		:  ( -> int)
	const sched_setparam		:  (pid : pid, param : sched_param# -> int)
	const sched_getparam		:  (pid : pid, param : sched_param# -> int)
	const sched_setscheduler	:  (pid : pid, policy : int, param : sched_param# -> int)
	const sched_getscheduler	:  (pid : pid -> int)
	const sched_get_priority_max	:  (policy : int -> int)
	const sched_get_priority_min	:  (policy : int -> int)
	const sched_rr_get_interval	:  (pid : pid, interval : timespec# -> int)
	const utrace			:  (addr : void#, len : size -> int)
	const kldsym			:  (fileid : int, cmd : int, data : void# -> int)
	const jail			:  (jail : jail# -> int)
	const sigsuspend		:  (sigmask : sigset# -> int)
	const sigpending		:  (set : sigset# -> int)
	const sigtimedwait		:  (set : sigset#, info : siginfo#, timeout : timespec# -> int)
	const sigwaitinfo		:  (set : sigset#, info : siginfo# -> int)
	const __acl_get_file		:  (path : byte#, kind : acltype, aclp : acl# -> int)
	const __acl_set_file		:  (path : byte#, kind : acltype, aclp : acl# -> int)
	const __acl_get_fd		:  (filedes : int, kind : acltype, aclp : acl# -> int)
	const __acl_set_fd		:  (filedes : int, kind : acltype, aclp : acl# -> int)
	const __acl_delete_file		:  (path : byte#, kind : acltype -> int)
	const __acl_delete_fd		:  (filedes : int, kind : acltype -> int)
	const __acl_aclcheck_file	:  (path : byte#, kind : acltype, aclp : acl# -> int)
	const __acl_aclcheck_fd		:  (filedes : int, kind : acltype, aclp : acl# -> int)
	const extattrctl		:  (path : byte#, cmd : int, filename : byte#, attrnamespace : int, attrname : byte# -> int)
	const extattr_set_file		:  (path : byte#, attrnamespace : int, attrname : byte#, data : void#, nbytes : size -> size)
	const extattr_get_file		:  (path : byte#, attrnamespace : int, attrname : byte#, data : void#, nbytes : size -> size)
	const extattr_delete_file	:  (path : byte#, attrnamespace : int, attrname : byte# -> int)
	const aio_waitcomplete		:  (aiocbp : aiocb##, timeout : timespec# -> size)
	const getresuid			:  (ruid : uid#, euid : uid#, suid : uid# -> int)
	const getresgid			:  (rgid : gid#, egid : gid#, sgid : gid# -> int)
	const kqueue			:  ( -> int)
	const kevent			:  (fd : int, changelist : kevent#, nchanges : int, eventlist : kevent#, nevents : int, timeout : timespec# -> int)
	const extattr_set_fd		:  (fd : int, attrnamespace : int, attrname : byte#, data : void#, nbytes : size -> size)
	const extattr_get_fd		:  (fd : int, attrnamespace : int, attrname : byte#, data : void#, nbytes : size -> size)
	const extattr_delete_fd		:  (fd : int, attrnamespace : int, attrname : byte# -> int)
	const __setugid			:  (flag : int -> int)
	const eaccess			:  (path : byte#, amode : int -> int)
	const nmount			:  (iovp : iovec#, iovcnt : uint, flags : int -> int)
	const __mac_get_proc		:  (mac_p : mac# -> int)
	const __mac_set_proc		:  (mac_p : mac# -> int)
	const __mac_get_fd		:  (fd : int, mac_p : mac# -> int)
	const __mac_get_file		:  (path_p : byte#, mac_p : mac# -> int)
	const __mac_set_fd		:  (fd : int, mac_p : mac# -> int)
	const __mac_set_file		:  (path_p : byte#, mac_p : mac# -> int)
	const kenv			:  (what : int, name : byte#, value : byte#, len : int -> int)
	const lchflags			:  (path : byte#, flags : uint64 -> int)
	const uuidgen			:  (store : uuid#, count : int -> int)
	const sendfile			:  (fd : int, s : int, offset : off, nbytes : size, hdtr : sf_hdtr#, sbytes : off#, flags : int -> int)
	const mac_syscall		:  (policy : byte#, call : int, arg : void# -> int)
	const getfsstat			:  (buf : statfs#, bufsize : int64, flags : int -> int)
	const statfs			:  (path : byte#, buf : statfs# -> int)
	const fstatfs			:  (fd : int, buf : statfs# -> int)
	const fhstatfs			:  (u_fhp : fhandle#, buf : statfs# -> int)
	const __mac_get_pid		:  (pid : pid, mac_p : mac# -> int)
	const __mac_get_link		:  (path_p : byte#, mac_p : mac# -> int)
	const __mac_set_link		:  (path_p : byte#, mac_p : mac# -> int)
	const extattr_set_link		:  (path : byte#, attrnamespace : int, attrname : byte#, data : void#, nbytes : size -> size)
	const extattr_get_link		:  (path : byte#, attrnamespace : int, attrname : byte#, data : void#, nbytes : size -> size)
	const extattr_delete_link	:  (path : byte#, attrnamespace : int, attrname : byte# -> int)
	const __mac_execve		:  (fname : byte#, argv : byte##, envv : byte##, mac_p : mac# -> int)
	const sigreturn			:  (sigcntxp : ucontext# -> int)
	const getcontext		:  (ucp : ucontext# -> int)
	const setcontext		:  (ucp : ucontext# -> int)
	const swapcontext		:  (oucp : ucontext#, ucp : ucontext# -> int)
	const swapoff			:  (name : byte# -> int)
	const __acl_get_link		:  (path : byte#, kind : acltype, aclp : acl# -> int)
	const __acl_set_link		:  (path : byte#, kind : acltype, aclp : acl# -> int)
	const __acl_delete_link		:  (path : byte#, kind : acltype -> int)
	const __acl_aclcheck_link	:  (path : byte#, kind : acltype, aclp : acl# -> int)
	const sigwait			:  (set : sigset#, sig : int# -> int)
	const thr_create		:  (ctx : ucontext#, id : int64#, flags : int -> int)
	const thr_self			:  (id : int64# -> int)
	const thr_kill			:  (id : int64, sig : int -> int)
	const jail_attach		:  (jid : int -> int)
	const extattr_list_fd		:  (fd : int, attrnamespace : int, data : void#, nbytes : size -> size)
	const extattr_list_file		:  (path : byte#, attrnamespace : int, data : void#, nbytes : size -> size)
	const extattr_list_link		:  (path : byte#, attrnamespace : int, data : void#, nbytes : size -> size)
	const thr_suspend		:  (timeout : timespec# -> int)
	const thr_wake			:  (id : int64 -> int)
	const kldunloadf		:  (fileid : int, flags : int -> int)
	const audit			:  (record : void#, length : uint -> int)
	const auditon			:  (cmd : int, data : void#, length : uint -> int)
	const _umtx_op			:  (obj : void#, op : int, val : uint64, uaddr1 : void#, uaddr2 : void# -> int)
	const sigqueue			:  (pid : pid, signum : int, value : void# -> int)
	const abort2			:  (why : byte#, nargs : int, args : void## -> int)
	const thr_set_name		:  (id : int64, name : byte# -> int)
	const aio_fsync			:  (op : int, aiocbp : aiocb# -> int)
	const rtprio_thread		:  (function : int, lwpid : lwpid, rtp : rtprio# -> int)
	const truncate			:  (path : byte#, length : off -> int)
	const ftruncate			:  (fd : int, length : off -> int)
	const thr_kill2			:  (pid : pid, id : int64, sig : int -> int)
	const shm_open			:  (path : byte#, flags : int, mode : filemode -> int)
	const shm_unlink		:  (path : byte# -> int)
	const cpuset			:  (setid : cpusetid# -> int)
	const cpuset_setid		:  (which : cpuwhich, id : id, setid : cpusetid -> int)
	const cpuset_getid		:  (level : cpulevel, which : cpuwhich, id : id, setid : cpusetid# -> int)
	const cpuset_getaffinity	:  (level : cpulevel, which : cpuwhich, id : id, cpusetsize : size, mask : cpuset# -> int)
	const cpuset_setaffinity	:  (level : cpulevel, which : cpuwhich, id : id, cpusetsize : size, mask : cpuset# -> int)
	const faccessat			:  (fd : int, path : byte#, amode : int, flag : int -> int)
	const fchmodat			:  (fd : int, path : byte#, mode : filemode, flag : int -> int)
	const fchownat			:  (fd : int, path : byte#, uid : uid, gid : gid, flag : int -> int)
	const fexecve			:  (fd : int, argv : byte##, envv : byte## -> int)
	const fstatat			:  (fd : int, path : byte#, buf : statbuf#, flag : int -> int)
	const futimesat			:  (fd : int, path : byte#, times : timeval# -> int)
	const linkat			:  (fd1 : int, path1 : byte#, fd2 : int, path2 : byte#, flag : int -> int)
	const mkdirat			:  (fd : int, path : byte#, mode : filemode -> int)
	const mkfifoat			:  (fd : int, path : byte#, mode : filemode -> int)
	const mknodat			:  (fd : int, path : byte#, mode : filemode, dev : dev -> int)
	const openat			:  (fd : int, path : byte#, flag : int, mode : filemode -> int)
	const readlinkat		:  (fd : int, path : byte#, buf : byte#, bufsize : size -> int)
	const renameat			:  (oldfd : int, old : byte#, newfd : int, new : byte# -> int)
	const symlinkat			:  (path1 : byte#, fd : int, path2 : byte# -> int)
	const unlinkat			:  (fd : int, path : byte#, flag : int -> int)
	const posix_openpt		:  (flags : int -> int)
	const jail_get			:  (iovp : iovec#, iovcnt : uint, flags : int -> int)
	const jail_set			:  (iovp : iovec#, iovcnt : uint, flags : int -> int)
	const jail_remove		:  (jid : int -> int)
	const closefrom			:  (lowfd : int -> int)
	const lpathconf			:  (path : byte#, name : int -> int)
	const __cap_rights_get		:  (version : int, fd : int, rightsp : caprights# -> int)
	const cap_enter			:  ( -> int)
	const cap_getmode		:  (modep : uint# -> int)
	const pdfork			:  (fdp : int#, flags : int -> int)
	const pdkill			:  (fd : int, signum : int -> int)
	const pdgetpid			:  (fd : int, pidp : pid# -> int)
	const pselect			:  (nd : int, _in : fdset#, ou : fdset#, ex : fdset#, ts : timespec#, sm : sigset# -> int)
	const getloginclass		:  (namebuf : byte#, namelen : size -> int)
	const setloginclass		:  (namebuf : byte# -> int)
	const rctl_get_racct		:  (inbufp : void#, inbuflen : size, outbufp : void#, outbuflen : size -> int)
	const rctl_get_rules		:  (inbufp : void#, inbuflen : size, outbufp : void#, outbuflen : size -> int)
	const rctl_get_limits		:  (inbufp : void#, inbuflen : size, outbufp : void#, outbuflen : size -> int)
	const rctl_add_rule		:  (inbufp : void#, inbuflen : size, outbufp : void#, outbuflen : size -> int)
	const rctl_remove_rule		:  (inbufp : void#, inbuflen : size, outbufp : void#, outbuflen : size -> int)
	const posix_fallocate		:  (fd : int, offset : off, len : off -> int)
	const posix_fadvise		:  (fd : int, offset : off, len : off, advice : int -> int)
	const wait6			:  (idtype : idtype, id : id, status : int#, options : int, wrusage : wrusage#, info : siginfo# -> int)
	const cap_rights_limit		:  (fd : int, rightsp : caprights# -> int)
	const cap_ioctls_limit		:  (fd : int, cmds : uint64#, ncmds : size -> int)
	const cap_ioctls_get		:  (fd : int, cmds : uint64#, maxcmds : size -> size)
	const cap_fcntls_limit		:  (fd : int, fcntlrights : uint32 -> int)
	const cap_fcntls_get		:  (fd : int, fcntlrightsp : uint32# -> int)
	const bindat			:  (fd : int, s : int, name : void#, namelen : int -> int)
	const connectat			:  (fd : int, s : int, name : void#, namelen : int -> int)
	const chflagsat			:  (fd : int, path : byte#, flags : uint64, atflag : int -> int)
	const accept4			:  (s : int, name : sockaddr#, anamelen : int32#, flags : int -> int)
	const pipe2			:  (fildes : int#, flags : int -> int)
	const aio_mlock			:  (aiocbp : aiocb# -> int)
	const procctl			:  (idtype : idtype, id : id, com : int, data : void# -> int)
	const ppoll			:  (fds : pollfd#, nfds : uint, ts : timespec#, set : sigset# -> int)
	const futimens			:  (fd : int, times : timespec# -> int)
	const utimensat			:  (fd : int, path : byte#, times : timespec#, flag : int -> int)
;;

	/* start manual overrides { */
	/* pkg sys */
		/* process control */
		/* wrappers to extract wait status */
	
		/* thread control */
	
		/* fd manipulation */
	
		/* signals */
	
		/* fd stuff */
		/* NB: the C ABI uses '...' for the args. */
	
		/* networking */
	
		/* memory mapping */
	
		/* time - doublecheck if this is right */
	
		/* system information */
	
		/* filled by start code */
	/* ;; */
	
	/* 
	wraps a syscall argument, converting it to 64 bits for the syscall function. This is
	the same as casting, but more concise than (writing : int64)
	*/
	generic a = {x : @t; -> (x : uint64)}
	
	
	
	/* process management */
	const exit	= {status;		syscall(Sysexit, a(status))}
	const getpid	= {;			-> (syscall(Sysgetpid, 1) : pid)}
	const kill	= {pid, sig;		-> syscall(Syskill, pid, sig)}
	const fork	= {;			-> (syscall(Sysfork) : pid)}
	const wait4	= {pid, loc, opt, usage;	-> syscall(Syswait4, pid, loc, opt, usage)}
	const waitpid	= {pid, loc, opt;
		-> wait4(pid, loc, opt, (0 : rusage#)) 
	}
	
	const execv	= {cmd, args
		var p, cargs, i
	
		/* of course we fucking have to duplicate this code everywhere,
		* since we want to stack allocate... */
		p = alloca((args.len + 1)*sizeof(byte#))
		cargs = ((p : byte##))[:args.len + 1]
		for i = 0; i < args.len; i++
			cargs[i] = cstring(args[i])
		;;
		cargs[args.len] = (0 : byte#)
		-> syscall(Sysexecve, cstring(cmd), a(p), a(__cenvp))
	}
	
	const execve	= {cmd, args, env
		var cargs, cenv, i
		var p
	
		/* copy the args */
		p = alloca((args.len + 1)*sizeof(byte#))
		cargs = ((p : byte##))[:args.len]
		for i = 0; i < args.len; i++
			cargs[i] = cstring(args[i])
		;;
		cargs[args.len] = (0 : byte#)
	
		/*
		 copy the env.
		 of course we fucking have to duplicate this code everywhere,
		 since we want to stack allocate... 
		*/
		p = alloca((env.len + 1)*sizeof(byte#))
		cenv = ((p : byte##))[:env.len]
		for i = 0; i < env.len; i++
			cenv[i] = cstring(env[i])
		;;
		cenv[env.len] = (0 : byte#)
	
		-> syscall(Sysexecve, cstring(cmd), a(p), a(cenv))
	}
	
	/* thread management */
	const thr_new	= {param, sz;	-> (syscall(Systhr_new, a(param), a(sz)) : int)}
	const thr_exit	= {state;	syscall(Systhr_exit, a(state))}
	const umtx_op	= {obj, op, val, a1, a2; -> (syscall(Sys_umtx_op, a(obj), a(op), a(val), a(a1), a(a2)) : int)}
	const yield	= {;	-> (syscall(Sysyield) : int)}
	
	/* fd manipulation */
	const open	= {path, opts;		-> (syscall(Sysopen, cstring(path), a(opts), a(0o777)) : fd)}
	const openmode	= {path, opts, mode;	-> (syscall(Sysopen, cstring(path), a(opts), a(mode)) : fd)}
	const close	= {fd;			-> syscall(Sysclose, a(fd))}
	const creat	= {path, mode;		-> (openmode(path, Ocreat | Otrunc | Owronly, mode) : fd)}
	const unlink	= {path;		-> (syscall(Sysunlink, cstring(path)) : int)}
	const read	= {fd, buf;		-> (syscall(Sysread, a(fd), (buf : byte#), a(buf.len)) : size)}
	const pread	= {fd, buf, off;	-> (syscall(Syspread, a(fd), (buf : byte#), a(buf.len), a(off)) : size)}
	const readv	= {fd, vec;		-> (syscall(Sysreadv, a(fd), (vec : iovec#), a(vec.len)) : size)}
	const write	= {fd, buf;		-> (syscall(Syswrite, a(fd), (buf : byte#), a(buf.len)) : size)}
	const pwrite	= {fd, buf, off;	-> (syscall(Syspwrite, a(fd), (buf : byte#), a(buf.len), a(off)) : size)}
	const writev	= {fd, vec;		-> (syscall(Syswritev, a(fd), (vec : iovec#), a(vec.len)) : size)}
	const lseek	= {fd, off, whence;	-> syscall(Syslseek, a(fd), a(off), a(whence))}
	const stat	= {path, sb;		-> syscall(Sysstat, cstring(path), a(sb))}
	const lstat	= {path, sb;		-> syscall(Syslstat, cstring(path), a(sb))}
	const fstat	= {fd, sb;		-> syscall(Sysfstat, a(fd), a(sb))}
	const mkdir	= {path, mode;		-> (syscall(Sysmkdir, cstring(path), a(mode)) : int64)}
	generic ioctl	= {fd, req, arg;	-> (syscall(Sysioctl, a(fd), a(req), a(arg)) : int64)
	}
	const getdirentries	= {fd, buf, basep;	-> syscall(Sysgetdirentries, a(fd), (buf : byte#), a(buf.len), a(basep))}
	const chdir	= {dir;	-> syscall(Syschdir, cstring(dir))}
	const __getcwd	= {buf;	-> syscall(Sys__getcwd, a(buf), a(buf.len))}
	
	/* file stuff */
	const pipe	= {fds;	-> __freebsd_pipe(fds)}
	const dup 	= {fd;	-> (syscall(Sysdup, a(fd)) : fd)}
	const dup2 	= {src, dst;	-> (syscall(Sysdup2, a(src), a(dst)) : fd)}
	const fcntl	= {fd, cmd, args; 	-> syscall(Sysfcntl, a(fd), a(cmd), a(args))}
	const poll	= {pfd, tm;	-> (syscall(Syspoll, (pfd : byte#), a(pfd.len), a(tm)) : int)}
	
	/* signals */
	const sigaction	= {sig, act, oact;	-> (syscall(Syssigaction, a(sig), a(act), a(oact)) : int)}
	const sigprocmask	= {sig, act, oact;	-> (syscall(Syssigprocmask, a(sig), a(act), a(oact)) : int)}
	
	/* networking */
	const socket	= {dom, stype, proto;	-> (syscall(Syssocket, a(dom), a(stype), a(proto)) : fd) }
	const connect	= {sock, addr, len;	-> (syscall(Sysconnect, a(sock), a(addr), a(len)) : int)}
	const accept	= {sock, addr, len;	-> (syscall(Sysaccept, a(sock), a(addr), a(len)) : fd)}
	const listen	= {sock, backlog;	-> (syscall(Syslisten, a(sock), a(backlog)) : int)}
	const bind	= {sock, addr, len;	-> (syscall(Sysbind, a(sock), a(addr), a(len)) : int)}
	const setsockopt	= {sock, lev, opt, val, len;	-> (syscall(Syssetsockopt, a(sock), a(lev), a(opt), a(val), a(len)) : int)}
	const getsockopt	= {sock, lev, opt, val, len;	-> (syscall(Syssetsockopt, a(sock), a(lev), a(opt), a(val), a(len)) : int)}
	
	/* memory management */
	const munmap	= {addr, len;		-> syscall(Sysmunmap, a(addr), a(len))}
	const mmap	= {addr, len, prot, flags, fd, off;
		-> (syscall(Sysmmap, a(addr), a(len), a(prot), a(flags), a(fd), a(off)) : byte#)}
	
	/* time */
	const clock_getres = {clk, ts;	-> (syscall(Sysclock_getres, clockid(clk), a(ts)) : int32)}
	const clock_gettime = {clk, ts;	-> (syscall(Sysclock_gettime, clockid(clk), a(ts)) : int32)}
	const clock_settime = {clk, ts;	-> (syscall(Sysclock_settime, clockid(clk), a(ts)) : int32)}
	const nanosleep	= {req, rem;	-> (syscall(Sysnanosleep, a(req), a(rem)) : int32)}
	const sched_yield = {;	syscall(Syssched_yield)}
	
	
	const sysctl = {mib, old, oldsz, new, newsz
		/* all args already passed through a() or ar  ptrs */
		-> (syscall(Sys__sysctl, \
		(mib : int#), a(mib.len), old, oldsz, new, newsz) : int)
	}
	
	const clockid = {clk
		match clk
		| `Clockrealtime:		-> 0
		| `Clockvirtual:		-> 1
		| `Clockprof:			-> 2
		| `Clockmonotonic:		-> 4
		| `Clockuptime:			-> 5
		| `Clockuptime_precise:		-> 7
		| `Clockuptime_fast:		-> 8
		| `Clockrealtime_precise:	-> 9
		| `Clockrealtime_fast:		-> 10
		| `Clockmonotonic_precise:	-> 11
		| `Clockmonotonic_fast:		-> 12
		| `Clocksecond:			-> 13
		;;
		-> a(-1)
	}
	
	const waitstatus = {st
		if st < 0
			-> `Waitfail st
		;;
		match st & 0o177
		| 0:    -> `Waitexit (st >> 8)
		| 0x7f:-> `Waitstop (st >> 8)
		| sig:  -> `Waitsig sig
		;;
	}
	
	const uname	= {buf
		var mib : int[2]
		var ret
		var sys, syssz
		var nod, nodsz
		var rel, relsz
		var ver, versz
		var mach, machsz
	
		ret = 0
		mib[0] = 1 /* CTL_KERN */
		mib[1] = 1 /* KERN_OSTYPE */
		sys = (buf.system[:] : void#)
		syssz = buf.system.len
		ret = sysctl(mib[:], sys, &syssz, (0 : void#), (0 : size#))
		if ret < 0
			-> ret
		;;
	
		mib[0] = 1 /* CTL_KERN */
		mib[1] = 10 /* KERN_HOSTNAME */
		nod = (buf.node[:] : void#)
		nodsz = buf.node.len
		ret = sysctl(mib[:], nod, &nodsz, (0 : void#), (0 : size#))
		if ret < 0
			-> ret
		;;
	
		mib[0] = 1 /* CTL_KERN */
		mib[1] = 2 /* KERN_OSRELEASE */
		rel = (buf.release[:] : void#)
		relsz = buf.release.len
		ret = sysctl(mib[:], rel, &relsz, (0 : void#), (0 : size#))
		if ret < 0
			-> ret
		;;
	
		mib[0] = 1 /* CTL_KERN */
		mib[1] = 4 /* KERN_VERSION */
		ver = (buf.version[:] : void#)
		versz = buf.version.len
		ret = sysctl(mib[:], ver, &versz, (0 : void#), (0 : size#))
		if ret < 0
			-> ret
		;;
	
		mib[0] = 6 /* CTL_HW */
		mib[1] = 1 /* HW_MACHINE */
		mach = (buf.machine[:] : void#)
		machsz = buf.machine.len
		ret = sysctl(mib[:], mach, &machsz, (0 : void#), (0 : size#))
		if ret < 0
			-> ret
		;;
	
		-> 0
	}
	/* } end manual overrides */
const nosys	= {
	 -> (syscall(Sysnosys) : int)
}
const link	= {path, link
	 -> (syscall(Syslink, a(path), a(link)) : int)
}
const fchdir	= {fd
	 -> (syscall(Sysfchdir, a(fd)) : int)
}
const mknod	= {path, mode, dev
	 -> (syscall(Sysmknod, a(path), a(mode), a(dev)) : int)
}
const chmod	= {path, mode
	 -> (syscall(Syschmod, a(path), a(mode)) : int)
}
const chown	= {path, uid, gid
	 -> (syscall(Syschown, a(path), a(uid), a(gid)) : int)
}
const obreak	= {nsize
	 -> (syscall(Sysobreak, a(nsize)) : int)
}
const mount	= {kind, path, flags, data
	 -> (syscall(Sysmount, a(kind), a(path), a(flags), a(data)) : int)
}
const unmount	= {path, flags
	 -> (syscall(Sysunmount, a(path), a(flags)) : int)
}
const setuid	= {uid
	 -> (syscall(Syssetuid, a(uid)) : int)
}
const getuid	= {
	 -> (syscall(Sysgetuid) : uid)
}
const geteuid	= {
	 -> (syscall(Sysgeteuid) : uid)
}
const ptrace	= {req, pid, addr, data
	 -> (syscall(Sysptrace, a(req), a(pid), a(addr), a(data)) : int)
}
const recvmsg	= {s, msg, flags
	 -> (syscall(Sysrecvmsg, a(s), a(msg), a(flags)) : int)
}
const sendmsg	= {s, msg, flags
	 -> (syscall(Syssendmsg, a(s), a(msg), a(flags)) : int)
}
const recvfrom	= {s, buf, len, flags, from, fromlenaddr
	 -> (syscall(Sysrecvfrom, a(s), a(buf), a(len), a(flags), a(from), a(fromlenaddr)) : int)
}
const getpeername	= {fdes, asa, alen
	 -> (syscall(Sysgetpeername, a(fdes), a(asa), a(alen)) : int)
}
const getsockname	= {fdes, asa, alen
	 -> (syscall(Sysgetsockname, a(fdes), a(asa), a(alen)) : int)
}
const access	= {path, amode
	 -> (syscall(Sysaccess, a(path), a(amode)) : int)
}
const chflags	= {path, flags
	 -> (syscall(Syschflags, a(path), a(flags)) : int)
}
const fchflags	= {fd, flags
	 -> (syscall(Sysfchflags, a(fd), a(flags)) : int)
}
const sync	= {
	 -> (syscall(Syssync) : int)
}
const getppid	= {
	 -> (syscall(Sysgetppid) : pid)
}
const getegid	= {
	 -> (syscall(Sysgetegid) : gid)
}
const profil	= {samples, size, offset, scale
	 -> (syscall(Sysprofil, a(samples), a(size), a(offset), a(scale)) : int)
}
const ktrace	= {fname, ops, facs, pid
	 -> (syscall(Sysktrace, a(fname), a(ops), a(facs), a(pid)) : int)
}
const getgid	= {
	 -> (syscall(Sysgetgid) : gid)
}
const getlogin	= {namebuf, namelen
	 -> (syscall(Sysgetlogin, a(namebuf), a(namelen)) : int)
}
const setlogin	= {namebuf
	 -> (syscall(Syssetlogin, a(namebuf)) : int)
}
const acct	= {path
	 -> (syscall(Sysacct, a(path)) : int)
}
const sigaltstack	= {ss, oss
	 -> (syscall(Syssigaltstack, a(ss), a(oss)) : int)
}
const reboot	= {opt
	 -> (syscall(Sysreboot, a(opt)) : int)
}
const revoke	= {path
	 -> (syscall(Sysrevoke, a(path)) : int)
}
const symlink	= {path, link
	 -> (syscall(Syssymlink, a(path), a(link)) : int)
}
const readlink	= {path, buf, count
	 -> (syscall(Sysreadlink, a(path), a(buf), a(count)) : size)
}
const umask	= {newmask
	 -> (syscall(Sysumask, a(newmask)) : int)
}
const chroot	= {path
	 -> (syscall(Syschroot, a(path)) : int)
}
const msync	= {addr, len, flags
	 -> (syscall(Sysmsync, a(addr), a(len), a(flags)) : int)
}
const vfork	= {
	 -> (syscall(Sysvfork) : int)
}
const sbrk	= {incr
	 -> (syscall(Syssbrk, a(incr)) : int)
}
const sstk	= {incr
	 -> (syscall(Syssstk, a(incr)) : int)
}
const ovadvise	= {anom
	 -> (syscall(Sysovadvise, a(anom)) : int)
}
const mprotect	= {addr, len, prot
	 -> (syscall(Sysmprotect, a(addr), a(len), a(prot)) : int)
}
const madvise	= {addr, len, behav
	 -> (syscall(Sysmadvise, a(addr), a(len), a(behav)) : int)
}
const mincore	= {addr, len, vec
	 -> (syscall(Sysmincore, a(addr), a(len), a(vec)) : int)
}
const getgroups	= {gidsetsize, gidset
	 -> (syscall(Sysgetgroups, a(gidsetsize), a(gidset)) : int)
}
const setgroups	= {gidsetsize, gidset
	 -> (syscall(Syssetgroups, a(gidsetsize), a(gidset)) : int)
}
const getpgrp	= {
	 -> (syscall(Sysgetpgrp) : int)
}
const setpgid	= {pid, pgid
	 -> (syscall(Syssetpgid, a(pid), a(pgid)) : int)
}
const setitimer	= {which, itv, oitv
	 -> (syscall(Syssetitimer, a(which), a(itv), a(oitv)) : int)
}
const swapon	= {name
	 -> (syscall(Sysswapon, a(name)) : int)
}
const getitimer	= {which, itv
	 -> (syscall(Sysgetitimer, a(which), a(itv)) : int)
}
const getdtablesize	= {
	 -> (syscall(Sysgetdtablesize) : int)
}
const select	= {nd, _in, ou, ex, tv
	 -> (syscall(Sysselect, a(nd), a(_in), a(ou), a(ex), a(tv)) : int)
}
const fsync	= {fd
	 -> (syscall(Sysfsync, a(fd)) : int)
}
const setpriority	= {which, who, prio
	 -> (syscall(Syssetpriority, a(which), a(who), a(prio)) : int)
}
const getpriority	= {which, who
	 -> (syscall(Sysgetpriority, a(which), a(who)) : int)
}
const gettimeofday	= {tp, tzp
	 -> (syscall(Sysgettimeofday, a(tp), a(tzp)) : int)
}
const getrusage	= {who, rusage
	 -> (syscall(Sysgetrusage, a(who), a(rusage)) : int)
}
const settimeofday	= {tv, tzp
	 -> (syscall(Syssettimeofday, a(tv), a(tzp)) : int)
}
const fchown	= {fd, uid, gid
	 -> (syscall(Sysfchown, a(fd), a(uid), a(gid)) : int)
}
const fchmod	= {fd, mode
	 -> (syscall(Sysfchmod, a(fd), a(mode)) : int)
}
const setreuid	= {ruid, euid
	 -> (syscall(Syssetreuid, a(ruid), a(euid)) : int)
}
const setregid	= {rgid, egid
	 -> (syscall(Syssetregid, a(rgid), a(egid)) : int)
}
const rename	= {from, to
	 -> (syscall(Sysrename, a(from), a(to)) : int)
}
const flock	= {fd, how
	 -> (syscall(Sysflock, a(fd), a(how)) : int)
}
const mkfifo	= {path, mode
	 -> (syscall(Sysmkfifo, a(path), a(mode)) : int)
}
const sendto	= {s, buf, len, flags, to, tolen
	 -> (syscall(Syssendto, a(s), a(buf), a(len), a(flags), a(to), a(tolen)) : int)
}
const shutdown	= {s, how
	 -> (syscall(Sysshutdown, a(s), a(how)) : int)
}
const socketpair	= {domain, kind, protocol, rsv
	 -> (syscall(Syssocketpair, a(domain), a(kind), a(protocol), a(rsv)) : int)
}
const rmdir	= {path
	 -> (syscall(Sysrmdir, a(path)) : int)
}
const utimes	= {path, tptr
	 -> (syscall(Sysutimes, a(path), a(tptr)) : int)
}
const adjtime	= {delta, olddelta
	 -> (syscall(Sysadjtime, a(delta), a(olddelta)) : int)
}
const setsid	= {
	 -> (syscall(Syssetsid) : int)
}
const quotactl	= {path, cmd, uid, arg
	 -> (syscall(Sysquotactl, a(path), a(cmd), a(uid), a(arg)) : int)
}
const lgetfh	= {fname, fhp
	 -> (syscall(Syslgetfh, a(fname), a(fhp)) : int)
}
const getfh	= {fname, fhp
	 -> (syscall(Sysgetfh, a(fname), a(fhp)) : int)
}
const sysarch	= {op, parms
	 -> (syscall(Syssysarch, op, a(parms)) : int)
}
const rtprio	= {function, pid, rtp
	 -> (syscall(Sysrtprio, a(function), a(pid), a(rtp)) : int)
}
const setfib	= {fibnum
	 -> (syscall(Syssetfib, a(fibnum)) : int)
}
const ntp_adjtime	= {tp
	 -> (syscall(Sysntp_adjtime, a(tp)) : int)
}
const setgid	= {gid
	 -> (syscall(Syssetgid, a(gid)) : int)
}
const setegid	= {egid
	 -> (syscall(Syssetegid, a(egid)) : int)
}
const seteuid	= {euid
	 -> (syscall(Sysseteuid, a(euid)) : int)
}
const pathconf	= {path, name
	 -> (syscall(Syspathconf, a(path), a(name)) : int)
}
const fpathconf	= {fd, name
	 -> (syscall(Sysfpathconf, a(fd), a(name)) : int)
}
const getrlimit	= {which, rlp
	 -> (syscall(Sysgetrlimit, a(which), a(rlp)) : int)
}
const setrlimit	= {which, rlp
	 -> (syscall(Syssetrlimit, a(which), a(rlp)) : int)
}
const __sysctl	= {name, namelen, old, oldlenp, new, newlen
	 -> (syscall(Sys__sysctl, a(name), a(namelen), a(old), a(oldlenp), a(new), a(newlen)) : int)
}
const mlock	= {addr, len
	 -> (syscall(Sysmlock, a(addr), a(len)) : int)
}
const munlock	= {addr, len
	 -> (syscall(Sysmunlock, a(addr), a(len)) : int)
}
const undelete	= {path
	 -> (syscall(Sysundelete, a(path)) : int)
}
const futimes	= {fd, tptr
	 -> (syscall(Sysfutimes, a(fd), a(tptr)) : int)
}
const getpgid	= {pid
	 -> (syscall(Sysgetpgid, a(pid)) : int)
}
const ktimer_create	= {clock_id, evp, timerid
	 -> (syscall(Sysktimer_create, a(clock_id), a(evp), a(timerid)) : int)
}
const ktimer_delete	= {timerid
	 -> (syscall(Sysktimer_delete, a(timerid)) : int)
}
const ktimer_settime	= {timerid, flags, value, ovalue
	 -> (syscall(Sysktimer_settime, a(timerid), a(flags), a(value), a(ovalue)) : int)
}
const ktimer_gettime	= {timerid, value
	 -> (syscall(Sysktimer_gettime, a(timerid), a(value)) : int)
}
const ktimer_getoverrun	= {timerid
	 -> (syscall(Sysktimer_getoverrun, a(timerid)) : int)
}
const ffclock_getcounter	= {ffcount
	 -> (syscall(Sysffclock_getcounter, a(ffcount)) : int)
}
const ffclock_setestimate	= {cest
	 -> (syscall(Sysffclock_setestimate, a(cest)) : int)
}
const ffclock_getestimate	= {cest
	 -> (syscall(Sysffclock_getestimate, a(cest)) : int)
}
const clock_getcpuclockid2	= {id, which, clock_id
	 -> (syscall(Sysclock_getcpuclockid2, a(id), a(which), a(clock_id)) : int)
}
const minherit	= {addr, len, inherit
	 -> (syscall(Sysminherit, a(addr), a(len), a(inherit)) : int)
}
const rfork	= {flags
	 -> (syscall(Sysrfork, a(flags)) : int)
}
const openbsd_poll	= {fds, nfds, timeout
	 -> (syscall(Sysopenbsd_poll, a(fds), a(nfds), a(timeout)) : int)
}
const issetugid	= {
	 -> (syscall(Sysissetugid) : int)
}
const lchown	= {path, uid, gid
	 -> (syscall(Syslchown, a(path), a(uid), a(gid)) : int)
}
const aio_read	= {aiocbp
	 -> (syscall(Sysaio_read, a(aiocbp)) : int)
}
const aio_write	= {aiocbp
	 -> (syscall(Sysaio_write, a(aiocbp)) : int)
}
const lio_listio	= {mode, acb_list, nent, sig
	 -> (syscall(Syslio_listio, a(mode), a(acb_list), a(nent), a(sig)) : int)
}
const getdents	= {fd, buf, count
	 -> (syscall(Sysgetdents, a(fd), a(buf), a(count)) : int)
}
const lchmod	= {path, mode
	 -> (syscall(Syslchmod, a(path), a(mode)) : int)
}
const lutimes	= {path, tptr
	 -> (syscall(Syslutimes, a(path), a(tptr)) : int)
}
const nstat	= {path, ub
	 -> (syscall(Sysnstat, a(path), a(ub)) : int)
}
const nfstat	= {fd, sb
	 -> (syscall(Sysnfstat, a(fd), a(sb)) : int)
}
const nlstat	= {path, ub
	 -> (syscall(Sysnlstat, a(path), a(ub)) : int)
}
const preadv	= {fd, iovp, iovcnt, offset
	 -> (syscall(Syspreadv, a(fd), a(iovp), a(iovcnt), a(offset)) : size)
}
const pwritev	= {fd, iovp, iovcnt, offset
	 -> (syscall(Syspwritev, a(fd), a(iovp), a(iovcnt), a(offset)) : size)
}
const fhopen	= {u_fhp, flags
	 -> (syscall(Sysfhopen, a(u_fhp), a(flags)) : int)
}
const fhstat	= {u_fhp, sb
	 -> (syscall(Sysfhstat, a(u_fhp), a(sb)) : int)
}
const modnext	= {modid
	 -> (syscall(Sysmodnext, a(modid)) : int)
}
const modfnext	= {modid
	 -> (syscall(Sysmodfnext, a(modid)) : int)
}
const modfind	= {name
	 -> (syscall(Sysmodfind, a(name)) : int)
}
const kldload	= {file
	 -> (syscall(Syskldload, a(file)) : int)
}
const kldunload	= {fileid
	 -> (syscall(Syskldunload, a(fileid)) : int)
}
const kldfind	= {file
	 -> (syscall(Syskldfind, a(file)) : int)
}
const kldnext	= {fileid
	 -> (syscall(Syskldnext, a(fileid)) : int)
}
const kldfirstmod	= {fileid
	 -> (syscall(Syskldfirstmod, a(fileid)) : int)
}
const getsid	= {pid
	 -> (syscall(Sysgetsid, a(pid)) : int)
}
const setresuid	= {ruid, euid, suid
	 -> (syscall(Syssetresuid, a(ruid), a(euid), a(suid)) : int)
}
const setresgid	= {rgid, egid, sgid
	 -> (syscall(Syssetresgid, a(rgid), a(egid), a(sgid)) : int)
}
const aio_return	= {aiocbp
	 -> (syscall(Sysaio_return, a(aiocbp)) : size)
}
const aio_suspend	= {aiocbp, nent, timeout
	 -> (syscall(Sysaio_suspend, a(aiocbp), a(nent), a(timeout)) : int)
}
const aio_cancel	= {fd, aiocbp
	 -> (syscall(Sysaio_cancel, a(fd), a(aiocbp)) : int)
}
const aio_error	= {aiocbp
	 -> (syscall(Sysaio_error, a(aiocbp)) : int)
}
const mlockall	= {how
	 -> (syscall(Sysmlockall, a(how)) : int)
}
const munlockall	= {
	 -> (syscall(Sysmunlockall) : int)
}
const sched_setparam	= {pid, param
	 -> (syscall(Syssched_setparam, a(pid), a(param)) : int)
}
const sched_getparam	= {pid, param
	 -> (syscall(Syssched_getparam, a(pid), a(param)) : int)
}
const sched_setscheduler	= {pid, policy, param
	 -> (syscall(Syssched_setscheduler, a(pid), a(policy), a(param)) : int)
}
const sched_getscheduler	= {pid
	 -> (syscall(Syssched_getscheduler, a(pid)) : int)
}
const sched_get_priority_max	= {policy
	 -> (syscall(Syssched_get_priority_max, a(policy)) : int)
}
const sched_get_priority_min	= {policy
	 -> (syscall(Syssched_get_priority_min, a(policy)) : int)
}
const sched_rr_get_interval	= {pid, interval
	 -> (syscall(Syssched_rr_get_interval, a(pid), a(interval)) : int)
}
const utrace	= {addr, len
	 -> (syscall(Sysutrace, a(addr), a(len)) : int)
}
const kldsym	= {fileid, cmd, data
	 -> (syscall(Syskldsym, a(fileid), a(cmd), a(data)) : int)
}
const jail	= {jail
	 -> (syscall(Sysjail, a(jail)) : int)
}
const sigsuspend	= {sigmask
	 -> (syscall(Syssigsuspend, a(sigmask)) : int)
}
const sigpending	= {set
	 -> (syscall(Syssigpending, a(set)) : int)
}
const sigtimedwait	= {set, info, timeout
	 -> (syscall(Syssigtimedwait, a(set), a(info), a(timeout)) : int)
}
const sigwaitinfo	= {set, info
	 -> (syscall(Syssigwaitinfo, a(set), a(info)) : int)
}
const __acl_get_file	= {path, kind, aclp
	 -> (syscall(Sys__acl_get_file, a(path), a(kind), a(aclp)) : int)
}
const __acl_set_file	= {path, kind, aclp
	 -> (syscall(Sys__acl_set_file, a(path), a(kind), a(aclp)) : int)
}
const __acl_get_fd	= {filedes, kind, aclp
	 -> (syscall(Sys__acl_get_fd, a(filedes), a(kind), a(aclp)) : int)
}
const __acl_set_fd	= {filedes, kind, aclp
	 -> (syscall(Sys__acl_set_fd, a(filedes), a(kind), a(aclp)) : int)
}
const __acl_delete_file	= {path, kind
	 -> (syscall(Sys__acl_delete_file, a(path), a(kind)) : int)
}
const __acl_delete_fd	= {filedes, kind
	 -> (syscall(Sys__acl_delete_fd, a(filedes), a(kind)) : int)
}
const __acl_aclcheck_file	= {path, kind, aclp
	 -> (syscall(Sys__acl_aclcheck_file, a(path), a(kind), a(aclp)) : int)
}
const __acl_aclcheck_fd	= {filedes, kind, aclp
	 -> (syscall(Sys__acl_aclcheck_fd, a(filedes), a(kind), a(aclp)) : int)
}
const extattrctl	= {path, cmd, filename, attrnamespace, attrname
	 -> (syscall(Sysextattrctl, a(path), a(cmd), a(filename), a(attrnamespace), a(attrname)) : int)
}
const extattr_set_file	= {path, attrnamespace, attrname, data, nbytes
	 -> (syscall(Sysextattr_set_file, a(path), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_get_file	= {path, attrnamespace, attrname, data, nbytes
	 -> (syscall(Sysextattr_get_file, a(path), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_delete_file	= {path, attrnamespace, attrname
	 -> (syscall(Sysextattr_delete_file, a(path), a(attrnamespace), a(attrname)) : int)
}
const aio_waitcomplete	= {aiocbp, timeout
	 -> (syscall(Sysaio_waitcomplete, a(aiocbp), a(timeout)) : size)
}
const getresuid	= {ruid, euid, suid
	 -> (syscall(Sysgetresuid, a(ruid), a(euid), a(suid)) : int)
}
const getresgid	= {rgid, egid, sgid
	 -> (syscall(Sysgetresgid, a(rgid), a(egid), a(sgid)) : int)
}
const kqueue	= {
	 -> (syscall(Syskqueue) : int)
}
const kevent	= {fd, changelist, nchanges, eventlist, nevents, timeout
	 -> (syscall(Syskevent, a(fd), a(changelist), a(nchanges), a(eventlist), a(nevents), a(timeout)) : int)
}
const extattr_set_fd	= {fd, attrnamespace, attrname, data, nbytes
	 -> (syscall(Sysextattr_set_fd, a(fd), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_get_fd	= {fd, attrnamespace, attrname, data, nbytes
	 -> (syscall(Sysextattr_get_fd, a(fd), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_delete_fd	= {fd, attrnamespace, attrname
	 -> (syscall(Sysextattr_delete_fd, a(fd), a(attrnamespace), a(attrname)) : int)
}
const __setugid	= {flag
	 -> (syscall(Sys__setugid, a(flag)) : int)
}
const eaccess	= {path, amode
	 -> (syscall(Syseaccess, a(path), a(amode)) : int)
}
const nmount	= {iovp, iovcnt, flags
	 -> (syscall(Sysnmount, a(iovp), a(iovcnt), a(flags)) : int)
}
const __mac_get_proc	= {mac_p
	 -> (syscall(Sys__mac_get_proc, a(mac_p)) : int)
}
const __mac_set_proc	= {mac_p
	 -> (syscall(Sys__mac_set_proc, a(mac_p)) : int)
}
const __mac_get_fd	= {fd, mac_p
	 -> (syscall(Sys__mac_get_fd, a(fd), a(mac_p)) : int)
}
const __mac_get_file	= {path_p, mac_p
	 -> (syscall(Sys__mac_get_file, a(path_p), a(mac_p)) : int)
}
const __mac_set_fd	= {fd, mac_p
	 -> (syscall(Sys__mac_set_fd, a(fd), a(mac_p)) : int)
}
const __mac_set_file	= {path_p, mac_p
	 -> (syscall(Sys__mac_set_file, a(path_p), a(mac_p)) : int)
}
const kenv	= {what, name, value, len
	 -> (syscall(Syskenv, a(what), a(name), a(value), a(len)) : int)
}
const lchflags	= {path, flags
	 -> (syscall(Syslchflags, a(path), a(flags)) : int)
}
const uuidgen	= {store, count
	 -> (syscall(Sysuuidgen, a(store), a(count)) : int)
}
const sendfile	= {fd, s, offset, nbytes, hdtr, sbytes, flags
	 -> (syscall(Syssendfile, a(fd), a(s), a(offset), a(nbytes), a(hdtr), a(sbytes), a(flags)) : int)
}
const mac_syscall	= {policy, call, arg
	 -> (syscall(Sysmac_syscall, a(policy), a(call), a(arg)) : int)
}
const getfsstat	= {buf, bufsize, flags
	 -> (syscall(Sysgetfsstat, a(buf), a(bufsize), a(flags)) : int)
}
const statfs	= {path, buf
	 -> (syscall(Sysstatfs, a(path), a(buf)) : int)
}
const fstatfs	= {fd, buf
	 -> (syscall(Sysfstatfs, a(fd), a(buf)) : int)
}
const fhstatfs	= {u_fhp, buf
	 -> (syscall(Sysfhstatfs, a(u_fhp), a(buf)) : int)
}
const __mac_get_pid	= {pid, mac_p
	 -> (syscall(Sys__mac_get_pid, a(pid), a(mac_p)) : int)
}
const __mac_get_link	= {path_p, mac_p
	 -> (syscall(Sys__mac_get_link, a(path_p), a(mac_p)) : int)
}
const __mac_set_link	= {path_p, mac_p
	 -> (syscall(Sys__mac_set_link, a(path_p), a(mac_p)) : int)
}
const extattr_set_link	= {path, attrnamespace, attrname, data, nbytes
	 -> (syscall(Sysextattr_set_link, a(path), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_get_link	= {path, attrnamespace, attrname, data, nbytes
	 -> (syscall(Sysextattr_get_link, a(path), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_delete_link	= {path, attrnamespace, attrname
	 -> (syscall(Sysextattr_delete_link, a(path), a(attrnamespace), a(attrname)) : int)
}
const __mac_execve	= {fname, argv, envv, mac_p
	 -> (syscall(Sys__mac_execve, a(fname), a(argv), a(envv), a(mac_p)) : int)
}
const sigreturn	= {sigcntxp
	 -> (syscall(Syssigreturn, a(sigcntxp)) : int)
}
const getcontext	= {ucp
	 -> (syscall(Sysgetcontext, a(ucp)) : int)
}
const setcontext	= {ucp
	 -> (syscall(Syssetcontext, a(ucp)) : int)
}
const swapcontext	= {oucp, ucp
	 -> (syscall(Sysswapcontext, a(oucp), a(ucp)) : int)
}
const swapoff	= {name
	 -> (syscall(Sysswapoff, a(name)) : int)
}
const __acl_get_link	= {path, kind, aclp
	 -> (syscall(Sys__acl_get_link, a(path), a(kind), a(aclp)) : int)
}
const __acl_set_link	= {path, kind, aclp
	 -> (syscall(Sys__acl_set_link, a(path), a(kind), a(aclp)) : int)
}
const __acl_delete_link	= {path, kind
	 -> (syscall(Sys__acl_delete_link, a(path), a(kind)) : int)
}
const __acl_aclcheck_link	= {path, kind, aclp
	 -> (syscall(Sys__acl_aclcheck_link, a(path), a(kind), a(aclp)) : int)
}
const sigwait	= {set, sig
	 -> (syscall(Syssigwait, a(set), a(sig)) : int)
}
const thr_create	= {ctx, id, flags
	 -> (syscall(Systhr_create, a(ctx), a(id), a(flags)) : int)
}
const thr_self	= {id
	 -> (syscall(Systhr_self, a(id)) : int)
}
const thr_kill	= {id, sig
	 -> (syscall(Systhr_kill, a(id), a(sig)) : int)
}
const jail_attach	= {jid
	 -> (syscall(Sysjail_attach, a(jid)) : int)
}
const extattr_list_fd	= {fd, attrnamespace, data, nbytes
	 -> (syscall(Sysextattr_list_fd, a(fd), a(attrnamespace), a(data), a(nbytes)) : size)
}
const extattr_list_file	= {path, attrnamespace, data, nbytes
	 -> (syscall(Sysextattr_list_file, a(path), a(attrnamespace), a(data), a(nbytes)) : size)
}
const extattr_list_link	= {path, attrnamespace, data, nbytes
	 -> (syscall(Sysextattr_list_link, a(path), a(attrnamespace), a(data), a(nbytes)) : size)
}
const thr_suspend	= {timeout
	 -> (syscall(Systhr_suspend, a(timeout)) : int)
}
const thr_wake	= {id
	 -> (syscall(Systhr_wake, a(id)) : int)
}
const kldunloadf	= {fileid, flags
	 -> (syscall(Syskldunloadf, a(fileid), a(flags)) : int)
}
const audit	= {record, length
	 -> (syscall(Sysaudit, a(record), a(length)) : int)
}
const auditon	= {cmd, data, length
	 -> (syscall(Sysauditon, a(cmd), a(data), a(length)) : int)
}
const _umtx_op	= {obj, op, val, uaddr1, uaddr2
	 -> (syscall(Sys_umtx_op, a(obj), a(op), a(val), a(uaddr1), a(uaddr2)) : int)
}
const sigqueue	= {pid, signum, value
	 -> (syscall(Syssigqueue, a(pid), a(signum), a(value)) : int)
}
const abort2	= {why, nargs, args
	 -> (syscall(Sysabort2, a(why), a(nargs), a(args)) : int)
}
const thr_set_name	= {id, name
	 -> (syscall(Systhr_set_name, a(id), a(name)) : int)
}
const aio_fsync	= {op, aiocbp
	 -> (syscall(Sysaio_fsync, a(op), a(aiocbp)) : int)
}
const rtprio_thread	= {function, lwpid, rtp
	 -> (syscall(Sysrtprio_thread, a(function), a(lwpid), a(rtp)) : int)
}
const truncate	= {path, length
	 -> (syscall(Systruncate, a(path), a(length)) : int)
}
const ftruncate	= {fd, length
	 -> (syscall(Sysftruncate, a(fd), a(length)) : int)
}
const thr_kill2	= {pid, id, sig
	 -> (syscall(Systhr_kill2, a(pid), a(id), a(sig)) : int)
}
const shm_open	= {path, flags, mode
	 -> (syscall(Sysshm_open, a(path), a(flags), a(mode)) : int)
}
const shm_unlink	= {path
	 -> (syscall(Sysshm_unlink, a(path)) : int)
}
const cpuset	= {setid
	 -> (syscall(Syscpuset, a(setid)) : int)
}
const cpuset_setid	= {which, id, setid
	 -> (syscall(Syscpuset_setid, a(which), a(id), a(setid)) : int)
}
const cpuset_getid	= {level, which, id, setid
	 -> (syscall(Syscpuset_getid, a(level), a(which), a(id), a(setid)) : int)
}
const cpuset_getaffinity	= {level, which, id, cpusetsize, mask
	 -> (syscall(Syscpuset_getaffinity, a(level), a(which), a(id), a(cpusetsize), a(mask)) : int)
}
const cpuset_setaffinity	= {level, which, id, cpusetsize, mask
	 -> (syscall(Syscpuset_setaffinity, a(level), a(which), a(id), a(cpusetsize), a(mask)) : int)
}
const faccessat	= {fd, path, amode, flag
	 -> (syscall(Sysfaccessat, a(fd), a(path), a(amode), a(flag)) : int)
}
const fchmodat	= {fd, path, mode, flag
	 -> (syscall(Sysfchmodat, a(fd), a(path), a(mode), a(flag)) : int)
}
const fchownat	= {fd, path, uid, gid, flag
	 -> (syscall(Sysfchownat, a(fd), a(path), a(uid), a(gid), a(flag)) : int)
}
const fexecve	= {fd, argv, envv
	 -> (syscall(Sysfexecve, a(fd), a(argv), a(envv)) : int)
}
const fstatat	= {fd, path, buf, flag
	 -> (syscall(Sysfstatat, a(fd), a(path), a(buf), a(flag)) : int)
}
const futimesat	= {fd, path, times
	 -> (syscall(Sysfutimesat, a(fd), a(path), a(times)) : int)
}
const linkat	= {fd1, path1, fd2, path2, flag
	 -> (syscall(Syslinkat, a(fd1), a(path1), a(fd2), a(path2), a(flag)) : int)
}
const mkdirat	= {fd, path, mode
	 -> (syscall(Sysmkdirat, a(fd), a(path), a(mode)) : int)
}
const mkfifoat	= {fd, path, mode
	 -> (syscall(Sysmkfifoat, a(fd), a(path), a(mode)) : int)
}
const mknodat	= {fd, path, mode, dev
	 -> (syscall(Sysmknodat, a(fd), a(path), a(mode), a(dev)) : int)
}
const openat	= {fd, path, flag, mode
	 -> (syscall(Sysopenat, a(fd), a(path), a(flag), a(mode)) : int)
}
const readlinkat	= {fd, path, buf, bufsize
	 -> (syscall(Sysreadlinkat, a(fd), a(path), a(buf), a(bufsize)) : int)
}
const renameat	= {oldfd, old, newfd, new
	 -> (syscall(Sysrenameat, a(oldfd), a(old), a(newfd), a(new)) : int)
}
const symlinkat	= {path1, fd, path2
	 -> (syscall(Syssymlinkat, a(path1), a(fd), a(path2)) : int)
}
const unlinkat	= {fd, path, flag
	 -> (syscall(Sysunlinkat, a(fd), a(path), a(flag)) : int)
}
const posix_openpt	= {flags
	 -> (syscall(Sysposix_openpt, a(flags)) : int)
}
const jail_get	= {iovp, iovcnt, flags
	 -> (syscall(Sysjail_get, a(iovp), a(iovcnt), a(flags)) : int)
}
const jail_set	= {iovp, iovcnt, flags
	 -> (syscall(Sysjail_set, a(iovp), a(iovcnt), a(flags)) : int)
}
const jail_remove	= {jid
	 -> (syscall(Sysjail_remove, a(jid)) : int)
}
const closefrom	= {lowfd
	 -> (syscall(Sysclosefrom, a(lowfd)) : int)
}
const lpathconf	= {path, name
	 -> (syscall(Syslpathconf, a(path), a(name)) : int)
}
const __cap_rights_get	= {version, fd, rightsp
	 -> (syscall(Sys__cap_rights_get, a(version), a(fd), a(rightsp)) : int)
}
const cap_enter	= {
	 -> (syscall(Syscap_enter) : int)
}
const cap_getmode	= {modep
	 -> (syscall(Syscap_getmode, a(modep)) : int)
}
const pdfork	= {fdp, flags
	 -> (syscall(Syspdfork, a(fdp), a(flags)) : int)
}
const pdkill	= {fd, signum
	 -> (syscall(Syspdkill, a(fd), a(signum)) : int)
}
const pdgetpid	= {fd, pidp
	 -> (syscall(Syspdgetpid, a(fd), a(pidp)) : int)
}
const pselect	= {nd, _in, ou, ex, ts, sm
	 -> (syscall(Syspselect, a(nd), a(_in), a(ou), a(ex), a(ts), a(sm)) : int)
}
const getloginclass	= {namebuf, namelen
	 -> (syscall(Sysgetloginclass, a(namebuf), a(namelen)) : int)
}
const setloginclass	= {namebuf
	 -> (syscall(Syssetloginclass, a(namebuf)) : int)
}
const rctl_get_racct	= {inbufp, inbuflen, outbufp, outbuflen
	 -> (syscall(Sysrctl_get_racct, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const rctl_get_rules	= {inbufp, inbuflen, outbufp, outbuflen
	 -> (syscall(Sysrctl_get_rules, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const rctl_get_limits	= {inbufp, inbuflen, outbufp, outbuflen
	 -> (syscall(Sysrctl_get_limits, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const rctl_add_rule	= {inbufp, inbuflen, outbufp, outbuflen
	 -> (syscall(Sysrctl_add_rule, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const rctl_remove_rule	= {inbufp, inbuflen, outbufp, outbuflen
	 -> (syscall(Sysrctl_remove_rule, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const posix_fallocate	= {fd, offset, len
	 -> (syscall(Sysposix_fallocate, a(fd), a(offset), a(len)) : int)
}
const posix_fadvise	= {fd, offset, len, advice
	 -> (syscall(Sysposix_fadvise, a(fd), a(offset), a(len), a(advice)) : int)
}
const wait6	= {idtype, id, status, options, wrusage, info
	 -> (syscall(Syswait6, a(idtype), a(id), a(status), a(options), a(wrusage), a(info)) : int)
}
const cap_rights_limit	= {fd, rightsp
	 -> (syscall(Syscap_rights_limit, a(fd), a(rightsp)) : int)
}
const cap_ioctls_limit	= {fd, cmds, ncmds
	 -> (syscall(Syscap_ioctls_limit, a(fd), a(cmds), a(ncmds)) : int)
}
const cap_ioctls_get	= {fd, cmds, maxcmds
	 -> (syscall(Syscap_ioctls_get, a(fd), a(cmds), a(maxcmds)) : size)
}
const cap_fcntls_limit	= {fd, fcntlrights
	 -> (syscall(Syscap_fcntls_limit, a(fd), a(fcntlrights)) : int)
}
const cap_fcntls_get	= {fd, fcntlrightsp
	 -> (syscall(Syscap_fcntls_get, a(fd), a(fcntlrightsp)) : int)
}
const bindat	= {fd, s, name, namelen
	 -> (syscall(Sysbindat, a(fd), a(s), a(name), a(namelen)) : int)
}
const connectat	= {fd, s, name, namelen
	 -> (syscall(Sysconnectat, a(fd), a(s), a(name), a(namelen)) : int)
}
const chflagsat	= {fd, path, flags, atflag
	 -> (syscall(Syschflagsat, a(fd), a(path), a(flags), a(atflag)) : int)
}
const accept4	= {s, name, anamelen, flags
	 -> (syscall(Sysaccept4, a(s), a(name), a(anamelen), a(flags)) : int)
}
const pipe2	= {fildes, flags
	 -> (syscall(Syspipe2, a(fildes), a(flags)) : int)
}
const aio_mlock	= {aiocbp
	 -> (syscall(Sysaio_mlock, a(aiocbp)) : int)
}
const procctl	= {idtype, id, com, data
	 -> (syscall(Sysprocctl, a(idtype), a(id), a(com), a(data)) : int)
}
const ppoll	= {fds, nfds, ts, set
	 -> (syscall(Sysppoll, a(fds), a(nfds), a(ts), a(set)) : int)
}
const futimens	= {fd, times
	 -> (syscall(Sysfutimens, a(fd), a(times)) : int)
}
const utimensat	= {fd, path, times, flag
	 -> (syscall(Sysutimensat, a(fd), a(path), a(times), a(flag)) : int)
}