File: local-sysdeps.diff

package info (click to toggle)
glibc 2.36-9%2Bdeb12u10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 299,916 kB
  • sloc: ansic: 1,055,590; asm: 324,891; makefile: 15,194; python: 12,603; sh: 10,884; cpp: 5,685; awk: 1,883; perl: 518; yacc: 292; pascal: 182; sed: 39
file content (37641 lines) | stat: -rw-r--r-- 1,222,002 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
24851
24852
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862
24863
24864
24865
24866
24867
24868
24869
24870
24871
24872
24873
24874
24875
24876
24877
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
24947
24948
24949
24950
24951
24952
24953
24954
24955
24956
24957
24958
24959
24960
24961
24962
24963
24964
24965
24966
24967
24968
24969
24970
24971
24972
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983
24984
24985
24986
24987
24988
24989
24990
24991
24992
24993
24994
24995
24996
24997
24998
24999
25000
25001
25002
25003
25004
25005
25006
25007
25008
25009
25010
25011
25012
25013
25014
25015
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029
25030
25031
25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
25048
25049
25050
25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
25068
25069
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
25090
25091
25092
25093
25094
25095
25096
25097
25098
25099
25100
25101
25102
25103
25104
25105
25106
25107
25108
25109
25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
25149
25150
25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
25161
25162
25163
25164
25165
25166
25167
25168
25169
25170
25171
25172
25173
25174
25175
25176
25177
25178
25179
25180
25181
25182
25183
25184
25185
25186
25187
25188
25189
25190
25191
25192
25193
25194
25195
25196
25197
25198
25199
25200
25201
25202
25203
25204
25205
25206
25207
25208
25209
25210
25211
25212
25213
25214
25215
25216
25217
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228
25229
25230
25231
25232
25233
25234
25235
25236
25237
25238
25239
25240
25241
25242
25243
25244
25245
25246
25247
25248
25249
25250
25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
25279
25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
25302
25303
25304
25305
25306
25307
25308
25309
25310
25311
25312
25313
25314
25315
25316
25317
25318
25319
25320
25321
25322
25323
25324
25325
25326
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354
25355
25356
25357
25358
25359
25360
25361
25362
25363
25364
25365
25366
25367
25368
25369
25370
25371
25372
25373
25374
25375
25376
25377
25378
25379
25380
25381
25382
25383
25384
25385
25386
25387
25388
25389
25390
25391
25392
25393
25394
25395
25396
25397
25398
25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
25422
25423
25424
25425
25426
25427
25428
25429
25430
25431
25432
25433
25434
25435
25436
25437
25438
25439
25440
25441
25442
25443
25444
25445
25446
25447
25448
25449
25450
25451
25452
25453
25454
25455
25456
25457
25458
25459
25460
25461
25462
25463
25464
25465
25466
25467
25468
25469
25470
25471
25472
25473
25474
25475
25476
25477
25478
25479
25480
25481
25482
25483
25484
25485
25486
25487
25488
25489
25490
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501
25502
25503
25504
25505
25506
25507
25508
25509
25510
25511
25512
25513
25514
25515
25516
25517
25518
25519
25520
25521
25522
25523
25524
25525
25526
25527
25528
25529
25530
25531
25532
25533
25534
25535
25536
25537
25538
25539
25540
25541
25542
25543
25544
25545
25546
25547
25548
25549
25550
25551
25552
25553
25554
25555
25556
25557
25558
25559
25560
25561
25562
25563
25564
25565
25566
25567
25568
25569
25570
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25589
25590
25591
25592
25593
25594
25595
25596
25597
25598
25599
25600
25601
25602
25603
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
25619
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
25950
25951
25952
25953
25954
25955
25956
25957
25958
25959
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
25974
25975
25976
25977
25978
25979
25980
25981
25982
25983
25984
25985
25986
25987
25988
25989
25990
25991
25992
25993
25994
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
26010
26011
26012
26013
26014
26015
26016
26017
26018
26019
26020
26021
26022
26023
26024
26025
26026
26027
26028
26029
26030
26031
26032
26033
26034
26035
26036
26037
26038
26039
26040
26041
26042
26043
26044
26045
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
26061
26062
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
26078
26079
26080
26081
26082
26083
26084
26085
26086
26087
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098
26099
26100
26101
26102
26103
26104
26105
26106
26107
26108
26109
26110
26111
26112
26113
26114
26115
26116
26117
26118
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180
26181
26182
26183
26184
26185
26186
26187
26188
26189
26190
26191
26192
26193
26194
26195
26196
26197
26198
26199
26200
26201
26202
26203
26204
26205
26206
26207
26208
26209
26210
26211
26212
26213
26214
26215
26216
26217
26218
26219
26220
26221
26222
26223
26224
26225
26226
26227
26228
26229
26230
26231
26232
26233
26234
26235
26236
26237
26238
26239
26240
26241
26242
26243
26244
26245
26246
26247
26248
26249
26250
26251
26252
26253
26254
26255
26256
26257
26258
26259
26260
26261
26262
26263
26264
26265
26266
26267
26268
26269
26270
26271
26272
26273
26274
26275
26276
26277
26278
26279
26280
26281
26282
26283
26284
26285
26286
26287
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
26315
26316
26317
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
26333
26334
26335
26336
26337
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442
26443
26444
26445
26446
26447
26448
26449
26450
26451
26452
26453
26454
26455
26456
26457
26458
26459
26460
26461
26462
26463
26464
26465
26466
26467
26468
26469
26470
26471
26472
26473
26474
26475
26476
26477
26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
26508
26509
26510
26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
26535
26536
26537
26538
26539
26540
26541
26542
26543
26544
26545
26546
26547
26548
26549
26550
26551
26552
26553
26554
26555
26556
26557
26558
26559
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
26575
26576
26577
26578
26579
26580
26581
26582
26583
26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
26598
26599
26600
26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
26617
26618
26619
26620
26621
26622
26623
26624
26625
26626
26627
26628
26629
26630
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645
26646
26647
26648
26649
26650
26651
26652
26653
26654
26655
26656
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
26672
26673
26674
26675
26676
26677
26678
26679
26680
26681
26682
26683
26684
26685
26686
26687
26688
26689
26690
26691
26692
26693
26694
26695
26696
26697
26698
26699
26700
26701
26702
26703
26704
26705
26706
26707
26708
26709
26710
26711
26712
26713
26714
26715
26716
26717
26718
26719
26720
26721
26722
26723
26724
26725
26726
26727
26728
26729
26730
26731
26732
26733
26734
26735
26736
26737
26738
26739
26740
26741
26742
26743
26744
26745
26746
26747
26748
26749
26750
26751
26752
26753
26754
26755
26756
26757
26758
26759
26760
26761
26762
26763
26764
26765
26766
26767
26768
26769
26770
26771
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26783
26784
26785
26786
26787
26788
26789
26790
26791
26792
26793
26794
26795
26796
26797
26798
26799
26800
26801
26802
26803
26804
26805
26806
26807
26808
26809
26810
26811
26812
26813
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
26836
26837
26838
26839
26840
26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
26852
26853
26854
26855
26856
26857
26858
26859
26860
26861
26862
26863
26864
26865
26866
26867
26868
26869
26870
26871
26872
26873
26874
26875
26876
26877
26878
26879
26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
26890
26891
26892
26893
26894
26895
26896
26897
26898
26899
26900
26901
26902
26903
26904
26905
26906
26907
26908
26909
26910
26911
26912
26913
26914
26915
26916
26917
26918
26919
26920
26921
26922
26923
26924
26925
26926
26927
26928
26929
26930
26931
26932
26933
26934
26935
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
26951
26952
26953
26954
26955
26956
26957
26958
26959
26960
26961
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001
27002
27003
27004
27005
27006
27007
27008
27009
27010
27011
27012
27013
27014
27015
27016
27017
27018
27019
27020
27021
27022
27023
27024
27025
27026
27027
27028
27029
27030
27031
27032
27033
27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115
27116
27117
27118
27119
27120
27121
27122
27123
27124
27125
27126
27127
27128
27129
27130
27131
27132
27133
27134
27135
27136
27137
27138
27139
27140
27141
27142
27143
27144
27145
27146
27147
27148
27149
27150
27151
27152
27153
27154
27155
27156
27157
27158
27159
27160
27161
27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
27194
27195
27196
27197
27198
27199
27200
27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
27224
27225
27226
27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
27245
27246
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258
27259
27260
27261
27262
27263
27264
27265
27266
27267
27268
27269
27270
27271
27272
27273
27274
27275
27276
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314
27315
27316
27317
27318
27319
27320
27321
27322
27323
27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
27363
27364
27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
27393
27394
27395
27396
27397
27398
27399
27400
27401
27402
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
27418
27419
27420
27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
27431
27432
27433
27434
27435
27436
27437
27438
27439
27440
27441
27442
27443
27444
27445
27446
27447
27448
27449
27450
27451
27452
27453
27454
27455
27456
27457
27458
27459
27460
27461
27462
27463
27464
27465
27466
27467
27468
27469
27470
27471
27472
27473
27474
27475
27476
27477
27478
27479
27480
27481
27482
27483
27484
27485
27486
27487
27488
27489
27490
27491
27492
27493
27494
27495
27496
27497
27498
27499
27500
27501
27502
27503
27504
27505
27506
27507
27508
27509
27510
27511
27512
27513
27514
27515
27516
27517
27518
27519
27520
27521
27522
27523
27524
27525
27526
27527
27528
27529
27530
27531
27532
27533
27534
27535
27536
27537
27538
27539
27540
27541
27542
27543
27544
27545
27546
27547
27548
27549
27550
27551
27552
27553
27554
27555
27556
27557
27558
27559
27560
27561
27562
27563
27564
27565
27566
27567
27568
27569
27570
27571
27572
27573
27574
27575
27576
27577
27578
27579
27580
27581
27582
27583
27584
27585
27586
27587
27588
27589
27590
27591
27592
27593
27594
27595
27596
27597
27598
27599
27600
27601
27602
27603
27604
27605
27606
27607
27608
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618
27619
27620
27621
27622
27623
27624
27625
27626
27627
27628
27629
27630
27631
27632
27633
27634
27635
27636
27637
27638
27639
27640
27641
27642
27643
27644
27645
27646
27647
27648
27649
27650
27651
27652
27653
27654
27655
27656
27657
27658
27659
27660
27661
27662
27663
27664
27665
27666
27667
27668
27669
27670
27671
27672
27673
27674
27675
27676
27677
27678
27679
27680
27681
27682
27683
27684
27685
27686
27687
27688
27689
27690
27691
27692
27693
27694
27695
27696
27697
27698
27699
27700
27701
27702
27703
27704
27705
27706
27707
27708
27709
27710
27711
27712
27713
27714
27715
27716
27717
27718
27719
27720
27721
27722
27723
27724
27725
27726
27727
27728
27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
27744
27745
27746
27747
27748
27749
27750
27751
27752
27753
27754
27755
27756
27757
27758
27759
27760
27761
27762
27763
27764
27765
27766
27767
27768
27769
27770
27771
27772
27773
27774
27775
27776
27777
27778
27779
27780
27781
27782
27783
27784
27785
27786
27787
27788
27789
27790
27791
27792
27793
27794
27795
27796
27797
27798
27799
27800
27801
27802
27803
27804
27805
27806
27807
27808
27809
27810
27811
27812
27813
27814
27815
27816
27817
27818
27819
27820
27821
27822
27823
27824
27825
27826
27827
27828
27829
27830
27831
27832
27833
27834
27835
27836
27837
27838
27839
27840
27841
27842
27843
27844
27845
27846
27847
27848
27849
27850
27851
27852
27853
27854
27855
27856
27857
27858
27859
27860
27861
27862
27863
27864
27865
27866
27867
27868
27869
27870
27871
27872
27873
27874
27875
27876
27877
27878
27879
27880
27881
27882
27883
27884
27885
27886
27887
27888
27889
27890
27891
27892
27893
27894
27895
27896
27897
27898
27899
27900
27901
27902
27903
27904
27905
27906
27907
27908
27909
27910
27911
27912
27913
27914
27915
27916
27917
27918
27919
27920
27921
27922
27923
27924
27925
27926
27927
27928
27929
27930
27931
27932
27933
27934
27935
27936
27937
27938
27939
27940
27941
27942
27943
27944
27945
27946
27947
27948
27949
27950
27951
27952
27953
27954
27955
27956
27957
27958
27959
27960
27961
27962
27963
27964
27965
27966
27967
27968
27969
27970
27971
27972
27973
27974
27975
27976
27977
27978
27979
27980
27981
27982
27983
27984
27985
27986
27987
27988
27989
27990
27991
27992
27993
27994
27995
27996
27997
27998
27999
28000
28001
28002
28003
28004
28005
28006
28007
28008
28009
28010
28011
28012
28013
28014
28015
28016
28017
28018
28019
28020
28021
28022
28023
28024
28025
28026
28027
28028
28029
28030
28031
28032
28033
28034
28035
28036
28037
28038
28039
28040
28041
28042
28043
28044
28045
28046
28047
28048
28049
28050
28051
28052
28053
28054
28055
28056
28057
28058
28059
28060
28061
28062
28063
28064
28065
28066
28067
28068
28069
28070
28071
28072
28073
28074
28075
28076
28077
28078
28079
28080
28081
28082
28083
28084
28085
28086
28087
28088
28089
28090
28091
28092
28093
28094
28095
28096
28097
28098
28099
28100
28101
28102
28103
28104
28105
28106
28107
28108
28109
28110
28111
28112
28113
28114
28115
28116
28117
28118
28119
28120
28121
28122
28123
28124
28125
28126
28127
28128
28129
28130
28131
28132
28133
28134
28135
28136
28137
28138
28139
28140
28141
28142
28143
28144
28145
28146
28147
28148
28149
28150
28151
28152
28153
28154
28155
28156
28157
28158
28159
28160
28161
28162
28163
28164
28165
28166
28167
28168
28169
28170
28171
28172
28173
28174
28175
28176
28177
28178
28179
28180
28181
28182
28183
28184
28185
28186
28187
28188
28189
28190
28191
28192
28193
28194
28195
28196
28197
28198
28199
28200
28201
28202
28203
28204
28205
28206
28207
28208
28209
28210
28211
28212
28213
28214
28215
28216
28217
28218
28219
28220
28221
28222
28223
28224
28225
28226
28227
28228
28229
28230
28231
28232
28233
28234
28235
28236
28237
28238
28239
28240
28241
28242
28243
28244
28245
28246
28247
28248
28249
28250
28251
28252
28253
28254
28255
28256
28257
28258
28259
28260
28261
28262
28263
28264
28265
28266
28267
28268
28269
28270
28271
28272
28273
28274
28275
28276
28277
28278
28279
28280
28281
28282
28283
28284
28285
28286
28287
28288
28289
28290
28291
28292
28293
28294
28295
28296
28297
28298
28299
28300
28301
28302
28303
28304
28305
28306
28307
28308
28309
28310
28311
28312
28313
28314
28315
28316
28317
28318
28319
28320
28321
28322
28323
28324
28325
28326
28327
28328
28329
28330
28331
28332
28333
28334
28335
28336
28337
28338
28339
28340
28341
28342
28343
28344
28345
28346
28347
28348
28349
28350
28351
28352
28353
28354
28355
28356
28357
28358
28359
28360
28361
28362
28363
28364
28365
28366
28367
28368
28369
28370
28371
28372
28373
28374
28375
28376
28377
28378
28379
28380
28381
28382
28383
28384
28385
28386
28387
28388
28389
28390
28391
28392
28393
28394
28395
28396
28397
28398
28399
28400
28401
28402
28403
28404
28405
28406
28407
28408
28409
28410
28411
28412
28413
28414
28415
28416
28417
28418
28419
28420
28421
28422
28423
28424
28425
28426
28427
28428
28429
28430
28431
28432
28433
28434
28435
28436
28437
28438
28439
28440
28441
28442
28443
28444
28445
28446
28447
28448
28449
28450
28451
28452
28453
28454
28455
28456
28457
28458
28459
28460
28461
28462
28463
28464
28465
28466
28467
28468
28469
28470
28471
28472
28473
28474
28475
28476
28477
28478
28479
28480
28481
28482
28483
28484
28485
28486
28487
28488
28489
28490
28491
28492
28493
28494
28495
28496
28497
28498
28499
28500
28501
28502
28503
28504
28505
28506
28507
28508
28509
28510
28511
28512
28513
28514
28515
28516
28517
28518
28519
28520
28521
28522
28523
28524
28525
28526
28527
28528
28529
28530
28531
28532
28533
28534
28535
28536
28537
28538
28539
28540
28541
28542
28543
28544
28545
28546
28547
28548
28549
28550
28551
28552
28553
28554
28555
28556
28557
28558
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577
28578
28579
28580
28581
28582
28583
28584
28585
28586
28587
28588
28589
28590
28591
28592
28593
28594
28595
28596
28597
28598
28599
28600
28601
28602
28603
28604
28605
28606
28607
28608
28609
28610
28611
28612
28613
28614
28615
28616
28617
28618
28619
28620
28621
28622
28623
28624
28625
28626
28627
28628
28629
28630
28631
28632
28633
28634
28635
28636
28637
28638
28639
28640
28641
28642
28643
28644
28645
28646
28647
28648
28649
28650
28651
28652
28653
28654
28655
28656
28657
28658
28659
28660
28661
28662
28663
28664
28665
28666
28667
28668
28669
28670
28671
28672
28673
28674
28675
28676
28677
28678
28679
28680
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699
28700
28701
28702
28703
28704
28705
28706
28707
28708
28709
28710
28711
28712
28713
28714
28715
28716
28717
28718
28719
28720
28721
28722
28723
28724
28725
28726
28727
28728
28729
28730
28731
28732
28733
28734
28735
28736
28737
28738
28739
28740
28741
28742
28743
28744
28745
28746
28747
28748
28749
28750
28751
28752
28753
28754
28755
28756
28757
28758
28759
28760
28761
28762
28763
28764
28765
28766
28767
28768
28769
28770
28771
28772
28773
28774
28775
28776
28777
28778
28779
28780
28781
28782
28783
28784
28785
28786
28787
28788
28789
28790
28791
28792
28793
28794
28795
28796
28797
28798
28799
28800
28801
28802
28803
28804
28805
28806
28807
28808
28809
28810
28811
28812
28813
28814
28815
28816
28817
28818
28819
28820
28821
28822
28823
28824
28825
28826
28827
28828
28829
28830
28831
28832
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842
28843
28844
28845
28846
28847
28848
28849
28850
28851
28852
28853
28854
28855
28856
28857
28858
28859
28860
28861
28862
28863
28864
28865
28866
28867
28868
28869
28870
28871
28872
28873
28874
28875
28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
28888
28889
28890
28891
28892
28893
28894
28895
28896
28897
28898
28899
28900
28901
28902
28903
28904
28905
28906
28907
28908
28909
28910
28911
28912
28913
28914
28915
28916
28917
28918
28919
28920
28921
28922
28923
28924
28925
28926
28927
28928
28929
28930
28931
28932
28933
28934
28935
28936
28937
28938
28939
28940
28941
28942
28943
28944
28945
28946
28947
28948
28949
28950
28951
28952
28953
28954
28955
28956
28957
28958
28959
28960
28961
28962
28963
28964
28965
28966
28967
28968
28969
28970
28971
28972
28973
28974
28975
28976
28977
28978
28979
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
28993
28994
28995
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
29010
29011
29012
29013
29014
29015
29016
29017
29018
29019
29020
29021
29022
29023
29024
29025
29026
29027
29028
29029
29030
29031
29032
29033
29034
29035
29036
29037
29038
29039
29040
29041
29042
29043
29044
29045
29046
29047
29048
29049
29050
29051
29052
29053
29054
29055
29056
29057
29058
29059
29060
29061
29062
29063
29064
29065
29066
29067
29068
29069
29070
29071
29072
29073
29074
29075
29076
29077
29078
29079
29080
29081
29082
29083
29084
29085
29086
29087
29088
29089
29090
29091
29092
29093
29094
29095
29096
29097
29098
29099
29100
29101
29102
29103
29104
29105
29106
29107
29108
29109
29110
29111
29112
29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
29123
29124
29125
29126
29127
29128
29129
29130
29131
29132
29133
29134
29135
29136
29137
29138
29139
29140
29141
29142
29143
29144
29145
29146
29147
29148
29149
29150
29151
29152
29153
29154
29155
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165
29166
29167
29168
29169
29170
29171
29172
29173
29174
29175
29176
29177
29178
29179
29180
29181
29182
29183
29184
29185
29186
29187
29188
29189
29190
29191
29192
29193
29194
29195
29196
29197
29198
29199
29200
29201
29202
29203
29204
29205
29206
29207
29208
29209
29210
29211
29212
29213
29214
29215
29216
29217
29218
29219
29220
29221
29222
29223
29224
29225
29226
29227
29228
29229
29230
29231
29232
29233
29234
29235
29236
29237
29238
29239
29240
29241
29242
29243
29244
29245
29246
29247
29248
29249
29250
29251
29252
29253
29254
29255
29256
29257
29258
29259
29260
29261
29262
29263
29264
29265
29266
29267
29268
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
29285
29286
29287
29288
29289
29290
29291
29292
29293
29294
29295
29296
29297
29298
29299
29300
29301
29302
29303
29304
29305
29306
29307
29308
29309
29310
29311
29312
29313
29314
29315
29316
29317
29318
29319
29320
29321
29322
29323
29324
29325
29326
29327
29328
29329
29330
29331
29332
29333
29334
29335
29336
29337
29338
29339
29340
29341
29342
29343
29344
29345
29346
29347
29348
29349
29350
29351
29352
29353
29354
29355
29356
29357
29358
29359
29360
29361
29362
29363
29364
29365
29366
29367
29368
29369
29370
29371
29372
29373
29374
29375
29376
29377
29378
29379
29380
29381
29382
29383
29384
29385
29386
29387
29388
29389
29390
29391
29392
29393
29394
29395
29396
29397
29398
29399
29400
29401
29402
29403
29404
29405
29406
29407
29408
29409
29410
29411
29412
29413
29414
29415
29416
29417
29418
29419
29420
29421
29422
29423
29424
29425
29426
29427
29428
29429
29430
29431
29432
29433
29434
29435
29436
29437
29438
29439
29440
29441
29442
29443
29444
29445
29446
29447
29448
29449
29450
29451
29452
29453
29454
29455
29456
29457
29458
29459
29460
29461
29462
29463
29464
29465
29466
29467
29468
29469
29470
29471
29472
29473
29474
29475
29476
29477
29478
29479
29480
29481
29482
29483
29484
29485
29486
29487
29488
29489
29490
29491
29492
29493
29494
29495
29496
29497
29498
29499
29500
29501
29502
29503
29504
29505
29506
29507
29508
29509
29510
29511
29512
29513
29514
29515
29516
29517
29518
29519
29520
29521
29522
29523
29524
29525
29526
29527
29528
29529
29530
29531
29532
29533
29534
29535
29536
29537
29538
29539
29540
29541
29542
29543
29544
29545
29546
29547
29548
29549
29550
29551
29552
29553
29554
29555
29556
29557
29558
29559
29560
29561
29562
29563
29564
29565
29566
29567
29568
29569
29570
29571
29572
29573
29574
29575
29576
29577
29578
29579
29580
29581
29582
29583
29584
29585
29586
29587
29588
29589
29590
29591
29592
29593
29594
29595
29596
29597
29598
29599
29600
29601
29602
29603
29604
29605
29606
29607
29608
29609
29610
29611
29612
29613
29614
29615
29616
29617
29618
29619
29620
29621
29622
29623
29624
29625
29626
29627
29628
29629
29630
29631
29632
29633
29634
29635
29636
29637
29638
29639
29640
29641
29642
29643
29644
29645
29646
29647
29648
29649
29650
29651
29652
29653
29654
29655
29656
29657
29658
29659
29660
29661
29662
29663
29664
29665
29666
29667
29668
29669
29670
29671
29672
29673
29674
29675
29676
29677
29678
29679
29680
29681
29682
29683
29684
29685
29686
29687
29688
29689
29690
29691
29692
29693
29694
29695
29696
29697
29698
29699
29700
29701
29702
29703
29704
29705
29706
29707
29708
29709
29710
29711
29712
29713
29714
29715
29716
29717
29718
29719
29720
29721
29722
29723
29724
29725
29726
29727
29728
29729
29730
29731
29732
29733
29734
29735
29736
29737
29738
29739
29740
29741
29742
29743
29744
29745
29746
29747
29748
29749
29750
29751
29752
29753
29754
29755
29756
29757
29758
29759
29760
29761
29762
29763
29764
29765
29766
29767
29768
29769
29770
29771
29772
29773
29774
29775
29776
29777
29778
29779
29780
29781
29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
29793
29794
29795
29796
29797
29798
29799
29800
29801
29802
29803
29804
29805
29806
29807
29808
29809
29810
29811
29812
29813
29814
29815
29816
29817
29818
29819
29820
29821
29822
29823
29824
29825
29826
29827
29828
29829
29830
29831
29832
29833
29834
29835
29836
29837
29838
29839
29840
29841
29842
29843
29844
29845
29846
29847
29848
29849
29850
29851
29852
29853
29854
29855
29856
29857
29858
29859
29860
29861
29862
29863
29864
29865
29866
29867
29868
29869
29870
29871
29872
29873
29874
29875
29876
29877
29878
29879
29880
29881
29882
29883
29884
29885
29886
29887
29888
29889
29890
29891
29892
29893
29894
29895
29896
29897
29898
29899
29900
29901
29902
29903
29904
29905
29906
29907
29908
29909
29910
29911
29912
29913
29914
29915
29916
29917
29918
29919
29920
29921
29922
29923
29924
29925
29926
29927
29928
29929
29930
29931
29932
29933
29934
29935
29936
29937
29938
29939
29940
29941
29942
29943
29944
29945
29946
29947
29948
29949
29950
29951
29952
29953
29954
29955
29956
29957
29958
29959
29960
29961
29962
29963
29964
29965
29966
29967
29968
29969
29970
29971
29972
29973
29974
29975
29976
29977
29978
29979
29980
29981
29982
29983
29984
29985
29986
29987
29988
29989
29990
29991
29992
29993
29994
29995
29996
29997
29998
29999
30000
30001
30002
30003
30004
30005
30006
30007
30008
30009
30010
30011
30012
30013
30014
30015
30016
30017
30018
30019
30020
30021
30022
30023
30024
30025
30026
30027
30028
30029
30030
30031
30032
30033
30034
30035
30036
30037
30038
30039
30040
30041
30042
30043
30044
30045
30046
30047
30048
30049
30050
30051
30052
30053
30054
30055
30056
30057
30058
30059
30060
30061
30062
30063
30064
30065
30066
30067
30068
30069
30070
30071
30072
30073
30074
30075
30076
30077
30078
30079
30080
30081
30082
30083
30084
30085
30086
30087
30088
30089
30090
30091
30092
30093
30094
30095
30096
30097
30098
30099
30100
30101
30102
30103
30104
30105
30106
30107
30108
30109
30110
30111
30112
30113
30114
30115
30116
30117
30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
30154
30155
30156
30157
30158
30159
30160
30161
30162
30163
30164
30165
30166
30167
30168
30169
30170
30171
30172
30173
30174
30175
30176
30177
30178
30179
30180
30181
30182
30183
30184
30185
30186
30187
30188
30189
30190
30191
30192
30193
30194
30195
30196
30197
30198
30199
30200
30201
30202
30203
30204
30205
30206
30207
30208
30209
30210
30211
30212
30213
30214
30215
30216
30217
30218
30219
30220
30221
30222
30223
30224
30225
30226
30227
30228
30229
30230
30231
30232
30233
30234
30235
30236
30237
30238
30239
30240
30241
30242
30243
30244
30245
30246
30247
30248
30249
30250
30251
30252
30253
30254
30255
30256
30257
30258
30259
30260
30261
30262
30263
30264
30265
30266
30267
30268
30269
30270
30271
30272
30273
30274
30275
30276
30277
30278
30279
30280
30281
30282
30283
30284
30285
30286
30287
30288
30289
30290
30291
30292
30293
30294
30295
30296
30297
30298
30299
30300
30301
30302
30303
30304
30305
30306
30307
30308
30309
30310
30311
30312
30313
30314
30315
30316
30317
30318
30319
30320
30321
30322
30323
30324
30325
30326
30327
30328
30329
30330
30331
30332
30333
30334
30335
30336
30337
30338
30339
30340
30341
30342
30343
30344
30345
30346
30347
30348
30349
30350
30351
30352
30353
30354
30355
30356
30357
30358
30359
30360
30361
30362
30363
30364
30365
30366
30367
30368
30369
30370
30371
30372
30373
30374
30375
30376
30377
30378
30379
30380
30381
30382
30383
30384
30385
30386
30387
30388
30389
30390
30391
30392
30393
30394
30395
30396
30397
30398
30399
30400
30401
30402
30403
30404
30405
30406
30407
30408
30409
30410
30411
30412
30413
30414
30415
30416
30417
30418
30419
30420
30421
30422
30423
30424
30425
30426
30427
30428
30429
30430
30431
30432
30433
30434
30435
30436
30437
30438
30439
30440
30441
30442
30443
30444
30445
30446
30447
30448
30449
30450
30451
30452
30453
30454
30455
30456
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467
30468
30469
30470
30471
30472
30473
30474
30475
30476
30477
30478
30479
30480
30481
30482
30483
30484
30485
30486
30487
30488
30489
30490
30491
30492
30493
30494
30495
30496
30497
30498
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509
30510
30511
30512
30513
30514
30515
30516
30517
30518
30519
30520
30521
30522
30523
30524
30525
30526
30527
30528
30529
30530
30531
30532
30533
30534
30535
30536
30537
30538
30539
30540
30541
30542
30543
30544
30545
30546
30547
30548
30549
30550
30551
30552
30553
30554
30555
30556
30557
30558
30559
30560
30561
30562
30563
30564
30565
30566
30567
30568
30569
30570
30571
30572
30573
30574
30575
30576
30577
30578
30579
30580
30581
30582
30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
30593
30594
30595
30596
30597
30598
30599
30600
30601
30602
30603
30604
30605
30606
30607
30608
30609
30610
30611
30612
30613
30614
30615
30616
30617
30618
30619
30620
30621
30622
30623
30624
30625
30626
30627
30628
30629
30630
30631
30632
30633
30634
30635
30636
30637
30638
30639
30640
30641
30642
30643
30644
30645
30646
30647
30648
30649
30650
30651
30652
30653
30654
30655
30656
30657
30658
30659
30660
30661
30662
30663
30664
30665
30666
30667
30668
30669
30670
30671
30672
30673
30674
30675
30676
30677
30678
30679
30680
30681
30682
30683
30684
30685
30686
30687
30688
30689
30690
30691
30692
30693
30694
30695
30696
30697
30698
30699
30700
30701
30702
30703
30704
30705
30706
30707
30708
30709
30710
30711
30712
30713
30714
30715
30716
30717
30718
30719
30720
30721
30722
30723
30724
30725
30726
30727
30728
30729
30730
30731
30732
30733
30734
30735
30736
30737
30738
30739
30740
30741
30742
30743
30744
30745
30746
30747
30748
30749
30750
30751
30752
30753
30754
30755
30756
30757
30758
30759
30760
30761
30762
30763
30764
30765
30766
30767
30768
30769
30770
30771
30772
30773
30774
30775
30776
30777
30778
30779
30780
30781
30782
30783
30784
30785
30786
30787
30788
30789
30790
30791
30792
30793
30794
30795
30796
30797
30798
30799
30800
30801
30802
30803
30804
30805
30806
30807
30808
30809
30810
30811
30812
30813
30814
30815
30816
30817
30818
30819
30820
30821
30822
30823
30824
30825
30826
30827
30828
30829
30830
30831
30832
30833
30834
30835
30836
30837
30838
30839
30840
30841
30842
30843
30844
30845
30846
30847
30848
30849
30850
30851
30852
30853
30854
30855
30856
30857
30858
30859
30860
30861
30862
30863
30864
30865
30866
30867
30868
30869
30870
30871
30872
30873
30874
30875
30876
30877
30878
30879
30880
30881
30882
30883
30884
30885
30886
30887
30888
30889
30890
30891
30892
30893
30894
30895
30896
30897
30898
30899
30900
30901
30902
30903
30904
30905
30906
30907
30908
30909
30910
30911
30912
30913
30914
30915
30916
30917
30918
30919
30920
30921
30922
30923
30924
30925
30926
30927
30928
30929
30930
30931
30932
30933
30934
30935
30936
30937
30938
30939
30940
30941
30942
30943
30944
30945
30946
30947
30948
30949
30950
30951
30952
30953
30954
30955
30956
30957
30958
30959
30960
30961
30962
30963
30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974
30975
30976
30977
30978
30979
30980
30981
30982
30983
30984
30985
30986
30987
30988
30989
30990
30991
30992
30993
30994
30995
30996
30997
30998
30999
31000
31001
31002
31003
31004
31005
31006
31007
31008
31009
31010
31011
31012
31013
31014
31015
31016
31017
31018
31019
31020
31021
31022
31023
31024
31025
31026
31027
31028
31029
31030
31031
31032
31033
31034
31035
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045
31046
31047
31048
31049
31050
31051
31052
31053
31054
31055
31056
31057
31058
31059
31060
31061
31062
31063
31064
31065
31066
31067
31068
31069
31070
31071
31072
31073
31074
31075
31076
31077
31078
31079
31080
31081
31082
31083
31084
31085
31086
31087
31088
31089
31090
31091
31092
31093
31094
31095
31096
31097
31098
31099
31100
31101
31102
31103
31104
31105
31106
31107
31108
31109
31110
31111
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
31126
31127
31128
31129
31130
31131
31132
31133
31134
31135
31136
31137
31138
31139
31140
31141
31142
31143
31144
31145
31146
31147
31148
31149
31150
31151
31152
31153
31154
31155
31156
31157
31158
31159
31160
31161
31162
31163
31164
31165
31166
31167
31168
31169
31170
31171
31172
31173
31174
31175
31176
31177
31178
31179
31180
31181
31182
31183
31184
31185
31186
31187
31188
31189
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
31205
31206
31207
31208
31209
31210
31211
31212
31213
31214
31215
31216
31217
31218
31219
31220
31221
31222
31223
31224
31225
31226
31227
31228
31229
31230
31231
31232
31233
31234
31235
31236
31237
31238
31239
31240
31241
31242
31243
31244
31245
31246
31247
31248
31249
31250
31251
31252
31253
31254
31255
31256
31257
31258
31259
31260
31261
31262
31263
31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
31279
31280
31281
31282
31283
31284
31285
31286
31287
31288
31289
31290
31291
31292
31293
31294
31295
31296
31297
31298
31299
31300
31301
31302
31303
31304
31305
31306
31307
31308
31309
31310
31311
31312
31313
31314
31315
31316
31317
31318
31319
31320
31321
31322
31323
31324
31325
31326
31327
31328
31329
31330
31331
31332
31333
31334
31335
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
31351
31352
31353
31354
31355
31356
31357
31358
31359
31360
31361
31362
31363
31364
31365
31366
31367
31368
31369
31370
31371
31372
31373
31374
31375
31376
31377
31378
31379
31380
31381
31382
31383
31384
31385
31386
31387
31388
31389
31390
31391
31392
31393
31394
31395
31396
31397
31398
31399
31400
31401
31402
31403
31404
31405
31406
31407
31408
31409
31410
31411
31412
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
31435
31436
31437
31438
31439
31440
31441
31442
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
31461
31462
31463
31464
31465
31466
31467
31468
31469
31470
31471
31472
31473
31474
31475
31476
31477
31478
31479
31480
31481
31482
31483
31484
31485
31486
31487
31488
31489
31490
31491
31492
31493
31494
31495
31496
31497
31498
31499
31500
31501
31502
31503
31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
31515
31516
31517
31518
31519
31520
31521
31522
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
31538
31539
31540
31541
31542
31543
31544
31545
31546
31547
31548
31549
31550
31551
31552
31553
31554
31555
31556
31557
31558
31559
31560
31561
31562
31563
31564
31565
31566
31567
31568
31569
31570
31571
31572
31573
31574
31575
31576
31577
31578
31579
31580
31581
31582
31583
31584
31585
31586
31587
31588
31589
31590
31591
31592
31593
31594
31595
31596
31597
31598
31599
31600
31601
31602
31603
31604
31605
31606
31607
31608
31609
31610
31611
31612
31613
31614
31615
31616
31617
31618
31619
31620
31621
31622
31623
31624
31625
31626
31627
31628
31629
31630
31631
31632
31633
31634
31635
31636
31637
31638
31639
31640
31641
31642
31643
31644
31645
31646
31647
31648
31649
31650
31651
31652
31653
31654
31655
31656
31657
31658
31659
31660
31661
31662
31663
31664
31665
31666
31667
31668
31669
31670
31671
31672
31673
31674
31675
31676
31677
31678
31679
31680
31681
31682
31683
31684
31685
31686
31687
31688
31689
31690
31691
31692
31693
31694
31695
31696
31697
31698
31699
31700
31701
31702
31703
31704
31705
31706
31707
31708
31709
31710
31711
31712
31713
31714
31715
31716
31717
31718
31719
31720
31721
31722
31723
31724
31725
31726
31727
31728
31729
31730
31731
31732
31733
31734
31735
31736
31737
31738
31739
31740
31741
31742
31743
31744
31745
31746
31747
31748
31749
31750
31751
31752
31753
31754
31755
31756
31757
31758
31759
31760
31761
31762
31763
31764
31765
31766
31767
31768
31769
31770
31771
31772
31773
31774
31775
31776
31777
31778
31779
31780
31781
31782
31783
31784
31785
31786
31787
31788
31789
31790
31791
31792
31793
31794
31795
31796
31797
31798
31799
31800
31801
31802
31803
31804
31805
31806
31807
31808
31809
31810
31811
31812
31813
31814
31815
31816
31817
31818
31819
31820
31821
31822
31823
31824
31825
31826
31827
31828
31829
31830
31831
31832
31833
31834
31835
31836
31837
31838
31839
31840
31841
31842
31843
31844
31845
31846
31847
31848
31849
31850
31851
31852
31853
31854
31855
31856
31857
31858
31859
31860
31861
31862
31863
31864
31865
31866
31867
31868
31869
31870
31871
31872
31873
31874
31875
31876
31877
31878
31879
31880
31881
31882
31883
31884
31885
31886
31887
31888
31889
31890
31891
31892
31893
31894
31895
31896
31897
31898
31899
31900
31901
31902
31903
31904
31905
31906
31907
31908
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920
31921
31922
31923
31924
31925
31926
31927
31928
31929
31930
31931
31932
31933
31934
31935
31936
31937
31938
31939
31940
31941
31942
31943
31944
31945
31946
31947
31948
31949
31950
31951
31952
31953
31954
31955
31956
31957
31958
31959
31960
31961
31962
31963
31964
31965
31966
31967
31968
31969
31970
31971
31972
31973
31974
31975
31976
31977
31978
31979
31980
31981
31982
31983
31984
31985
31986
31987
31988
31989
31990
31991
31992
31993
31994
31995
31996
31997
31998
31999
32000
32001
32002
32003
32004
32005
32006
32007
32008
32009
32010
32011
32012
32013
32014
32015
32016
32017
32018
32019
32020
32021
32022
32023
32024
32025
32026
32027
32028
32029
32030
32031
32032
32033
32034
32035
32036
32037
32038
32039
32040
32041
32042
32043
32044
32045
32046
32047
32048
32049
32050
32051
32052
32053
32054
32055
32056
32057
32058
32059
32060
32061
32062
32063
32064
32065
32066
32067
32068
32069
32070
32071
32072
32073
32074
32075
32076
32077
32078
32079
32080
32081
32082
32083
32084
32085
32086
32087
32088
32089
32090
32091
32092
32093
32094
32095
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105
32106
32107
32108
32109
32110
32111
32112
32113
32114
32115
32116
32117
32118
32119
32120
32121
32122
32123
32124
32125
32126
32127
32128
32129
32130
32131
32132
32133
32134
32135
32136
32137
32138
32139
32140
32141
32142
32143
32144
32145
32146
32147
32148
32149
32150
32151
32152
32153
32154
32155
32156
32157
32158
32159
32160
32161
32162
32163
32164
32165
32166
32167
32168
32169
32170
32171
32172
32173
32174
32175
32176
32177
32178
32179
32180
32181
32182
32183
32184
32185
32186
32187
32188
32189
32190
32191
32192
32193
32194
32195
32196
32197
32198
32199
32200
32201
32202
32203
32204
32205
32206
32207
32208
32209
32210
32211
32212
32213
32214
32215
32216
32217
32218
32219
32220
32221
32222
32223
32224
32225
32226
32227
32228
32229
32230
32231
32232
32233
32234
32235
32236
32237
32238
32239
32240
32241
32242
32243
32244
32245
32246
32247
32248
32249
32250
32251
32252
32253
32254
32255
32256
32257
32258
32259
32260
32261
32262
32263
32264
32265
32266
32267
32268
32269
32270
32271
32272
32273
32274
32275
32276
32277
32278
32279
32280
32281
32282
32283
32284
32285
32286
32287
32288
32289
32290
32291
32292
32293
32294
32295
32296
32297
32298
32299
32300
32301
32302
32303
32304
32305
32306
32307
32308
32309
32310
32311
32312
32313
32314
32315
32316
32317
32318
32319
32320
32321
32322
32323
32324
32325
32326
32327
32328
32329
32330
32331
32332
32333
32334
32335
32336
32337
32338
32339
32340
32341
32342
32343
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
32355
32356
32357
32358
32359
32360
32361
32362
32363
32364
32365
32366
32367
32368
32369
32370
32371
32372
32373
32374
32375
32376
32377
32378
32379
32380
32381
32382
32383
32384
32385
32386
32387
32388
32389
32390
32391
32392
32393
32394
32395
32396
32397
32398
32399
32400
32401
32402
32403
32404
32405
32406
32407
32408
32409
32410
32411
32412
32413
32414
32415
32416
32417
32418
32419
32420
32421
32422
32423
32424
32425
32426
32427
32428
32429
32430
32431
32432
32433
32434
32435
32436
32437
32438
32439
32440
32441
32442
32443
32444
32445
32446
32447
32448
32449
32450
32451
32452
32453
32454
32455
32456
32457
32458
32459
32460
32461
32462
32463
32464
32465
32466
32467
32468
32469
32470
32471
32472
32473
32474
32475
32476
32477
32478
32479
32480
32481
32482
32483
32484
32485
32486
32487
32488
32489
32490
32491
32492
32493
32494
32495
32496
32497
32498
32499
32500
32501
32502
32503
32504
32505
32506
32507
32508
32509
32510
32511
32512
32513
32514
32515
32516
32517
32518
32519
32520
32521
32522
32523
32524
32525
32526
32527
32528
32529
32530
32531
32532
32533
32534
32535
32536
32537
32538
32539
32540
32541
32542
32543
32544
32545
32546
32547
32548
32549
32550
32551
32552
32553
32554
32555
32556
32557
32558
32559
32560
32561
32562
32563
32564
32565
32566
32567
32568
32569
32570
32571
32572
32573
32574
32575
32576
32577
32578
32579
32580
32581
32582
32583
32584
32585
32586
32587
32588
32589
32590
32591
32592
32593
32594
32595
32596
32597
32598
32599
32600
32601
32602
32603
32604
32605
32606
32607
32608
32609
32610
32611
32612
32613
32614
32615
32616
32617
32618
32619
32620
32621
32622
32623
32624
32625
32626
32627
32628
32629
32630
32631
32632
32633
32634
32635
32636
32637
32638
32639
32640
32641
32642
32643
32644
32645
32646
32647
32648
32649
32650
32651
32652
32653
32654
32655
32656
32657
32658
32659
32660
32661
32662
32663
32664
32665
32666
32667
32668
32669
32670
32671
32672
32673
32674
32675
32676
32677
32678
32679
32680
32681
32682
32683
32684
32685
32686
32687
32688
32689
32690
32691
32692
32693
32694
32695
32696
32697
32698
32699
32700
32701
32702
32703
32704
32705
32706
32707
32708
32709
32710
32711
32712
32713
32714
32715
32716
32717
32718
32719
32720
32721
32722
32723
32724
32725
32726
32727
32728
32729
32730
32731
32732
32733
32734
32735
32736
32737
32738
32739
32740
32741
32742
32743
32744
32745
32746
32747
32748
32749
32750
32751
32752
32753
32754
32755
32756
32757
32758
32759
32760
32761
32762
32763
32764
32765
32766
32767
32768
32769
32770
32771
32772
32773
32774
32775
32776
32777
32778
32779
32780
32781
32782
32783
32784
32785
32786
32787
32788
32789
32790
32791
32792
32793
32794
32795
32796
32797
32798
32799
32800
32801
32802
32803
32804
32805
32806
32807
32808
32809
32810
32811
32812
32813
32814
32815
32816
32817
32818
32819
32820
32821
32822
32823
32824
32825
32826
32827
32828
32829
32830
32831
32832
32833
32834
32835
32836
32837
32838
32839
32840
32841
32842
32843
32844
32845
32846
32847
32848
32849
32850
32851
32852
32853
32854
32855
32856
32857
32858
32859
32860
32861
32862
32863
32864
32865
32866
32867
32868
32869
32870
32871
32872
32873
32874
32875
32876
32877
32878
32879
32880
32881
32882
32883
32884
32885
32886
32887
32888
32889
32890
32891
32892
32893
32894
32895
32896
32897
32898
32899
32900
32901
32902
32903
32904
32905
32906
32907
32908
32909
32910
32911
32912
32913
32914
32915
32916
32917
32918
32919
32920
32921
32922
32923
32924
32925
32926
32927
32928
32929
32930
32931
32932
32933
32934
32935
32936
32937
32938
32939
32940
32941
32942
32943
32944
32945
32946
32947
32948
32949
32950
32951
32952
32953
32954
32955
32956
32957
32958
32959
32960
32961
32962
32963
32964
32965
32966
32967
32968
32969
32970
32971
32972
32973
32974
32975
32976
32977
32978
32979
32980
32981
32982
32983
32984
32985
32986
32987
32988
32989
32990
32991
32992
32993
32994
32995
32996
32997
32998
32999
33000
33001
33002
33003
33004
33005
33006
33007
33008
33009
33010
33011
33012
33013
33014
33015
33016
33017
33018
33019
33020
33021
33022
33023
33024
33025
33026
33027
33028
33029
33030
33031
33032
33033
33034
33035
33036
33037
33038
33039
33040
33041
33042
33043
33044
33045
33046
33047
33048
33049
33050
33051
33052
33053
33054
33055
33056
33057
33058
33059
33060
33061
33062
33063
33064
33065
33066
33067
33068
33069
33070
33071
33072
33073
33074
33075
33076
33077
33078
33079
33080
33081
33082
33083
33084
33085
33086
33087
33088
33089
33090
33091
33092
33093
33094
33095
33096
33097
33098
33099
33100
33101
33102
33103
33104
33105
33106
33107
33108
33109
33110
33111
33112
33113
33114
33115
33116
33117
33118
33119
33120
33121
33122
33123
33124
33125
33126
33127
33128
33129
33130
33131
33132
33133
33134
33135
33136
33137
33138
33139
33140
33141
33142
33143
33144
33145
33146
33147
33148
33149
33150
33151
33152
33153
33154
33155
33156
33157
33158
33159
33160
33161
33162
33163
33164
33165
33166
33167
33168
33169
33170
33171
33172
33173
33174
33175
33176
33177
33178
33179
33180
33181
33182
33183
33184
33185
33186
33187
33188
33189
33190
33191
33192
33193
33194
33195
33196
33197
33198
33199
33200
33201
33202
33203
33204
33205
33206
33207
33208
33209
33210
33211
33212
33213
33214
33215
33216
33217
33218
33219
33220
33221
33222
33223
33224
33225
33226
33227
33228
33229
33230
33231
33232
33233
33234
33235
33236
33237
33238
33239
33240
33241
33242
33243
33244
33245
33246
33247
33248
33249
33250
33251
33252
33253
33254
33255
33256
33257
33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
33273
33274
33275
33276
33277
33278
33279
33280
33281
33282
33283
33284
33285
33286
33287
33288
33289
33290
33291
33292
33293
33294
33295
33296
33297
33298
33299
33300
33301
33302
33303
33304
33305
33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
33317
33318
33319
33320
33321
33322
33323
33324
33325
33326
33327
33328
33329
33330
33331
33332
33333
33334
33335
33336
33337
33338
33339
33340
33341
33342
33343
33344
33345
33346
33347
33348
33349
33350
33351
33352
33353
33354
33355
33356
33357
33358
33359
33360
33361
33362
33363
33364
33365
33366
33367
33368
33369
33370
33371
33372
33373
33374
33375
33376
33377
33378
33379
33380
33381
33382
33383
33384
33385
33386
33387
33388
33389
33390
33391
33392
33393
33394
33395
33396
33397
33398
33399
33400
33401
33402
33403
33404
33405
33406
33407
33408
33409
33410
33411
33412
33413
33414
33415
33416
33417
33418
33419
33420
33421
33422
33423
33424
33425
33426
33427
33428
33429
33430
33431
33432
33433
33434
33435
33436
33437
33438
33439
33440
33441
33442
33443
33444
33445
33446
33447
33448
33449
33450
33451
33452
33453
33454
33455
33456
33457
33458
33459
33460
33461
33462
33463
33464
33465
33466
33467
33468
33469
33470
33471
33472
33473
33474
33475
33476
33477
33478
33479
33480
33481
33482
33483
33484
33485
33486
33487
33488
33489
33490
33491
33492
33493
33494
33495
33496
33497
33498
33499
33500
33501
33502
33503
33504
33505
33506
33507
33508
33509
33510
33511
33512
33513
33514
33515
33516
33517
33518
33519
33520
33521
33522
33523
33524
33525
33526
33527
33528
33529
33530
33531
33532
33533
33534
33535
33536
33537
33538
33539
33540
33541
33542
33543
33544
33545
33546
33547
33548
33549
33550
33551
33552
33553
33554
33555
33556
33557
33558
33559
33560
33561
33562
33563
33564
33565
33566
33567
33568
33569
33570
33571
33572
33573
33574
33575
33576
33577
33578
33579
33580
33581
33582
33583
33584
33585
33586
33587
33588
33589
33590
33591
33592
33593
33594
33595
33596
33597
33598
33599
33600
33601
33602
33603
33604
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
33624
33625
33626
33627
33628
33629
33630
33631
33632
33633
33634
33635
33636
33637
33638
33639
33640
33641
33642
33643
33644
33645
33646
33647
33648
33649
33650
33651
33652
33653
33654
33655
33656
33657
33658
33659
33660
33661
33662
33663
33664
33665
33666
33667
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
33680
33681
33682
33683
33684
33685
33686
33687
33688
33689
33690
33691
33692
33693
33694
33695
33696
33697
33698
33699
33700
33701
33702
33703
33704
33705
33706
33707
33708
33709
33710
33711
33712
33713
33714
33715
33716
33717
33718
33719
33720
33721
33722
33723
33724
33725
33726
33727
33728
33729
33730
33731
33732
33733
33734
33735
33736
33737
33738
33739
33740
33741
33742
33743
33744
33745
33746
33747
33748
33749
33750
33751
33752
33753
33754
33755
33756
33757
33758
33759
33760
33761
33762
33763
33764
33765
33766
33767
33768
33769
33770
33771
33772
33773
33774
33775
33776
33777
33778
33779
33780
33781
33782
33783
33784
33785
33786
33787
33788
33789
33790
33791
33792
33793
33794
33795
33796
33797
33798
33799
33800
33801
33802
33803
33804
33805
33806
33807
33808
33809
33810
33811
33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
33822
33823
33824
33825
33826
33827
33828
33829
33830
33831
33832
33833
33834
33835
33836
33837
33838
33839
33840
33841
33842
33843
33844
33845
33846
33847
33848
33849
33850
33851
33852
33853
33854
33855
33856
33857
33858
33859
33860
33861
33862
33863
33864
33865
33866
33867
33868
33869
33870
33871
33872
33873
33874
33875
33876
33877
33878
33879
33880
33881
33882
33883
33884
33885
33886
33887
33888
33889
33890
33891
33892
33893
33894
33895
33896
33897
33898
33899
33900
33901
33902
33903
33904
33905
33906
33907
33908
33909
33910
33911
33912
33913
33914
33915
33916
33917
33918
33919
33920
33921
33922
33923
33924
33925
33926
33927
33928
33929
33930
33931
33932
33933
33934
33935
33936
33937
33938
33939
33940
33941
33942
33943
33944
33945
33946
33947
33948
33949
33950
33951
33952
33953
33954
33955
33956
33957
33958
33959
33960
33961
33962
33963
33964
33965
33966
33967
33968
33969
33970
33971
33972
33973
33974
33975
33976
33977
33978
33979
33980
33981
33982
33983
33984
33985
33986
33987
33988
33989
33990
33991
33992
33993
33994
33995
33996
33997
33998
33999
34000
34001
34002
34003
34004
34005
34006
34007
34008
34009
34010
34011
34012
34013
34014
34015
34016
34017
34018
34019
34020
34021
34022
34023
34024
34025
34026
34027
34028
34029
34030
34031
34032
34033
34034
34035
34036
34037
34038
34039
34040
34041
34042
34043
34044
34045
34046
34047
34048
34049
34050
34051
34052
34053
34054
34055
34056
34057
34058
34059
34060
34061
34062
34063
34064
34065
34066
34067
34068
34069
34070
34071
34072
34073
34074
34075
34076
34077
34078
34079
34080
34081
34082
34083
34084
34085
34086
34087
34088
34089
34090
34091
34092
34093
34094
34095
34096
34097
34098
34099
34100
34101
34102
34103
34104
34105
34106
34107
34108
34109
34110
34111
34112
34113
34114
34115
34116
34117
34118
34119
34120
34121
34122
34123
34124
34125
34126
34127
34128
34129
34130
34131
34132
34133
34134
34135
34136
34137
34138
34139
34140
34141
34142
34143
34144
34145
34146
34147
34148
34149
34150
34151
34152
34153
34154
34155
34156
34157
34158
34159
34160
34161
34162
34163
34164
34165
34166
34167
34168
34169
34170
34171
34172
34173
34174
34175
34176
34177
34178
34179
34180
34181
34182
34183
34184
34185
34186
34187
34188
34189
34190
34191
34192
34193
34194
34195
34196
34197
34198
34199
34200
34201
34202
34203
34204
34205
34206
34207
34208
34209
34210
34211
34212
34213
34214
34215
34216
34217
34218
34219
34220
34221
34222
34223
34224
34225
34226
34227
34228
34229
34230
34231
34232
34233
34234
34235
34236
34237
34238
34239
34240
34241
34242
34243
34244
34245
34246
34247
34248
34249
34250
34251
34252
34253
34254
34255
34256
34257
34258
34259
34260
34261
34262
34263
34264
34265
34266
34267
34268
34269
34270
34271
34272
34273
34274
34275
34276
34277
34278
34279
34280
34281
34282
34283
34284
34285
34286
34287
34288
34289
34290
34291
34292
34293
34294
34295
34296
34297
34298
34299
34300
34301
34302
34303
34304
34305
34306
34307
34308
34309
34310
34311
34312
34313
34314
34315
34316
34317
34318
34319
34320
34321
34322
34323
34324
34325
34326
34327
34328
34329
34330
34331
34332
34333
34334
34335
34336
34337
34338
34339
34340
34341
34342
34343
34344
34345
34346
34347
34348
34349
34350
34351
34352
34353
34354
34355
34356
34357
34358
34359
34360
34361
34362
34363
34364
34365
34366
34367
34368
34369
34370
34371
34372
34373
34374
34375
34376
34377
34378
34379
34380
34381
34382
34383
34384
34385
34386
34387
34388
34389
34390
34391
34392
34393
34394
34395
34396
34397
34398
34399
34400
34401
34402
34403
34404
34405
34406
34407
34408
34409
34410
34411
34412
34413
34414
34415
34416
34417
34418
34419
34420
34421
34422
34423
34424
34425
34426
34427
34428
34429
34430
34431
34432
34433
34434
34435
34436
34437
34438
34439
34440
34441
34442
34443
34444
34445
34446
34447
34448
34449
34450
34451
34452
34453
34454
34455
34456
34457
34458
34459
34460
34461
34462
34463
34464
34465
34466
34467
34468
34469
34470
34471
34472
34473
34474
34475
34476
34477
34478
34479
34480
34481
34482
34483
34484
34485
34486
34487
34488
34489
34490
34491
34492
34493
34494
34495
34496
34497
34498
34499
34500
34501
34502
34503
34504
34505
34506
34507
34508
34509
34510
34511
34512
34513
34514
34515
34516
34517
34518
34519
34520
34521
34522
34523
34524
34525
34526
34527
34528
34529
34530
34531
34532
34533
34534
34535
34536
34537
34538
34539
34540
34541
34542
34543
34544
34545
34546
34547
34548
34549
34550
34551
34552
34553
34554
34555
34556
34557
34558
34559
34560
34561
34562
34563
34564
34565
34566
34567
34568
34569
34570
34571
34572
34573
34574
34575
34576
34577
34578
34579
34580
34581
34582
34583
34584
34585
34586
34587
34588
34589
34590
34591
34592
34593
34594
34595
34596
34597
34598
34599
34600
34601
34602
34603
34604
34605
34606
34607
34608
34609
34610
34611
34612
34613
34614
34615
34616
34617
34618
34619
34620
34621
34622
34623
34624
34625
34626
34627
34628
34629
34630
34631
34632
34633
34634
34635
34636
34637
34638
34639
34640
34641
34642
34643
34644
34645
34646
34647
34648
34649
34650
34651
34652
34653
34654
34655
34656
34657
34658
34659
34660
34661
34662
34663
34664
34665
34666
34667
34668
34669
34670
34671
34672
34673
34674
34675
34676
34677
34678
34679
34680
34681
34682
34683
34684
34685
34686
34687
34688
34689
34690
34691
34692
34693
34694
34695
34696
34697
34698
34699
34700
34701
34702
34703
34704
34705
34706
34707
34708
34709
34710
34711
34712
34713
34714
34715
34716
34717
34718
34719
34720
34721
34722
34723
34724
34725
34726
34727
34728
34729
34730
34731
34732
34733
34734
34735
34736
34737
34738
34739
34740
34741
34742
34743
34744
34745
34746
34747
34748
34749
34750
34751
34752
34753
34754
34755
34756
34757
34758
34759
34760
34761
34762
34763
34764
34765
34766
34767
34768
34769
34770
34771
34772
34773
34774
34775
34776
34777
34778
34779
34780
34781
34782
34783
34784
34785
34786
34787
34788
34789
34790
34791
34792
34793
34794
34795
34796
34797
34798
34799
34800
34801
34802
34803
34804
34805
34806
34807
34808
34809
34810
34811
34812
34813
34814
34815
34816
34817
34818
34819
34820
34821
34822
34823
34824
34825
34826
34827
34828
34829
34830
34831
34832
34833
34834
34835
34836
34837
34838
34839
34840
34841
34842
34843
34844
34845
34846
34847
34848
34849
34850
34851
34852
34853
34854
34855
34856
34857
34858
34859
34860
34861
34862
34863
34864
34865
34866
34867
34868
34869
34870
34871
34872
34873
34874
34875
34876
34877
34878
34879
34880
34881
34882
34883
34884
34885
34886
34887
34888
34889
34890
34891
34892
34893
34894
34895
34896
34897
34898
34899
34900
34901
34902
34903
34904
34905
34906
34907
34908
34909
34910
34911
34912
34913
34914
34915
34916
34917
34918
34919
34920
34921
34922
34923
34924
34925
34926
34927
34928
34929
34930
34931
34932
34933
34934
34935
34936
34937
34938
34939
34940
34941
34942
34943
34944
34945
34946
34947
34948
34949
34950
34951
34952
34953
34954
34955
34956
34957
34958
34959
34960
34961
34962
34963
34964
34965
34966
34967
34968
34969
34970
34971
34972
34973
34974
34975
34976
34977
34978
34979
34980
34981
34982
34983
34984
34985
34986
34987
34988
34989
34990
34991
34992
34993
34994
34995
34996
34997
34998
34999
35000
35001
35002
35003
35004
35005
35006
35007
35008
35009
35010
35011
35012
35013
35014
35015
35016
35017
35018
35019
35020
35021
35022
35023
35024
35025
35026
35027
35028
35029
35030
35031
35032
35033
35034
35035
35036
35037
35038
35039
35040
35041
35042
35043
35044
35045
35046
35047
35048
35049
35050
35051
35052
35053
35054
35055
35056
35057
35058
35059
35060
35061
35062
35063
35064
35065
35066
35067
35068
35069
35070
35071
35072
35073
35074
35075
35076
35077
35078
35079
35080
35081
35082
35083
35084
35085
35086
35087
35088
35089
35090
35091
35092
35093
35094
35095
35096
35097
35098
35099
35100
35101
35102
35103
35104
35105
35106
35107
35108
35109
35110
35111
35112
35113
35114
35115
35116
35117
35118
35119
35120
35121
35122
35123
35124
35125
35126
35127
35128
35129
35130
35131
35132
35133
35134
35135
35136
35137
35138
35139
35140
35141
35142
35143
35144
35145
35146
35147
35148
35149
35150
35151
35152
35153
35154
35155
35156
35157
35158
35159
35160
35161
35162
35163
35164
35165
35166
35167
35168
35169
35170
35171
35172
35173
35174
35175
35176
35177
35178
35179
35180
35181
35182
35183
35184
35185
35186
35187
35188
35189
35190
35191
35192
35193
35194
35195
35196
35197
35198
35199
35200
35201
35202
35203
35204
35205
35206
35207
35208
35209
35210
35211
35212
35213
35214
35215
35216
35217
35218
35219
35220
35221
35222
35223
35224
35225
35226
35227
35228
35229
35230
35231
35232
35233
35234
35235
35236
35237
35238
35239
35240
35241
35242
35243
35244
35245
35246
35247
35248
35249
35250
35251
35252
35253
35254
35255
35256
35257
35258
35259
35260
35261
35262
35263
35264
35265
35266
35267
35268
35269
35270
35271
35272
35273
35274
35275
35276
35277
35278
35279
35280
35281
35282
35283
35284
35285
35286
35287
35288
35289
35290
35291
35292
35293
35294
35295
35296
35297
35298
35299
35300
35301
35302
35303
35304
35305
35306
35307
35308
35309
35310
35311
35312
35313
35314
35315
35316
35317
35318
35319
35320
35321
35322
35323
35324
35325
35326
35327
35328
35329
35330
35331
35332
35333
35334
35335
35336
35337
35338
35339
35340
35341
35342
35343
35344
35345
35346
35347
35348
35349
35350
35351
35352
35353
35354
35355
35356
35357
35358
35359
35360
35361
35362
35363
35364
35365
35366
35367
35368
35369
35370
35371
35372
35373
35374
35375
35376
35377
35378
35379
35380
35381
35382
35383
35384
35385
35386
35387
35388
35389
35390
35391
35392
35393
35394
35395
35396
35397
35398
35399
35400
35401
35402
35403
35404
35405
35406
35407
35408
35409
35410
35411
35412
35413
35414
35415
35416
35417
35418
35419
35420
35421
35422
35423
35424
35425
35426
35427
35428
35429
35430
35431
35432
35433
35434
35435
35436
35437
35438
35439
35440
35441
35442
35443
35444
35445
35446
35447
35448
35449
35450
35451
35452
35453
35454
35455
35456
35457
35458
35459
35460
35461
35462
35463
35464
35465
35466
35467
35468
35469
35470
35471
35472
35473
35474
35475
35476
35477
35478
35479
35480
35481
35482
35483
35484
35485
35486
35487
35488
35489
35490
35491
35492
35493
35494
35495
35496
35497
35498
35499
35500
35501
35502
35503
35504
35505
35506
35507
35508
35509
35510
35511
35512
35513
35514
35515
35516
35517
35518
35519
35520
35521
35522
35523
35524
35525
35526
35527
35528
35529
35530
35531
35532
35533
35534
35535
35536
35537
35538
35539
35540
35541
35542
35543
35544
35545
35546
35547
35548
35549
35550
35551
35552
35553
35554
35555
35556
35557
35558
35559
35560
35561
35562
35563
35564
35565
35566
35567
35568
35569
35570
35571
35572
35573
35574
35575
35576
35577
35578
35579
35580
35581
35582
35583
35584
35585
35586
35587
35588
35589
35590
35591
35592
35593
35594
35595
35596
35597
35598
35599
35600
35601
35602
35603
35604
35605
35606
35607
35608
35609
35610
35611
35612
35613
35614
35615
35616
35617
35618
35619
35620
35621
35622
35623
35624
35625
35626
35627
35628
35629
35630
35631
35632
35633
35634
35635
35636
35637
35638
35639
35640
35641
35642
35643
35644
35645
35646
35647
35648
35649
35650
35651
35652
35653
35654
35655
35656
35657
35658
35659
35660
35661
35662
35663
35664
35665
35666
35667
35668
35669
35670
35671
35672
35673
35674
35675
35676
35677
35678
35679
35680
35681
35682
35683
35684
35685
35686
35687
35688
35689
35690
35691
35692
35693
35694
35695
35696
35697
35698
35699
35700
35701
35702
35703
35704
35705
35706
35707
35708
35709
35710
35711
35712
35713
35714
35715
35716
35717
35718
35719
35720
35721
35722
35723
35724
35725
35726
35727
35728
35729
35730
35731
35732
35733
35734
35735
35736
35737
35738
35739
35740
35741
35742
35743
35744
35745
35746
35747
35748
35749
35750
35751
35752
35753
35754
35755
35756
35757
35758
35759
35760
35761
35762
35763
35764
35765
35766
35767
35768
35769
35770
35771
35772
35773
35774
35775
35776
35777
35778
35779
35780
35781
35782
35783
35784
35785
35786
35787
35788
35789
35790
35791
35792
35793
35794
35795
35796
35797
35798
35799
35800
35801
35802
35803
35804
35805
35806
35807
35808
35809
35810
35811
35812
35813
35814
35815
35816
35817
35818
35819
35820
35821
35822
35823
35824
35825
35826
35827
35828
35829
35830
35831
35832
35833
35834
35835
35836
35837
35838
35839
35840
35841
35842
35843
35844
35845
35846
35847
35848
35849
35850
35851
35852
35853
35854
35855
35856
35857
35858
35859
35860
35861
35862
35863
35864
35865
35866
35867
35868
35869
35870
35871
35872
35873
35874
35875
35876
35877
35878
35879
35880
35881
35882
35883
35884
35885
35886
35887
35888
35889
35890
35891
35892
35893
35894
35895
35896
35897
35898
35899
35900
35901
35902
35903
35904
35905
35906
35907
35908
35909
35910
35911
35912
35913
35914
35915
35916
35917
35918
35919
35920
35921
35922
35923
35924
35925
35926
35927
35928
35929
35930
35931
35932
35933
35934
35935
35936
35937
35938
35939
35940
35941
35942
35943
35944
35945
35946
35947
35948
35949
35950
35951
35952
35953
35954
35955
35956
35957
35958
35959
35960
35961
35962
35963
35964
35965
35966
35967
35968
35969
35970
35971
35972
35973
35974
35975
35976
35977
35978
35979
35980
35981
35982
35983
35984
35985
35986
35987
35988
35989
35990
35991
35992
35993
35994
35995
35996
35997
35998
35999
36000
36001
36002
36003
36004
36005
36006
36007
36008
36009
36010
36011
36012
36013
36014
36015
36016
36017
36018
36019
36020
36021
36022
36023
36024
36025
36026
36027
36028
36029
36030
36031
36032
36033
36034
36035
36036
36037
36038
36039
36040
36041
36042
36043
36044
36045
36046
36047
36048
36049
36050
36051
36052
36053
36054
36055
36056
36057
36058
36059
36060
36061
36062
36063
36064
36065
36066
36067
36068
36069
36070
36071
36072
36073
36074
36075
36076
36077
36078
36079
36080
36081
36082
36083
36084
36085
36086
36087
36088
36089
36090
36091
36092
36093
36094
36095
36096
36097
36098
36099
36100
36101
36102
36103
36104
36105
36106
36107
36108
36109
36110
36111
36112
36113
36114
36115
36116
36117
36118
36119
36120
36121
36122
36123
36124
36125
36126
36127
36128
36129
36130
36131
36132
36133
36134
36135
36136
36137
36138
36139
36140
36141
36142
36143
36144
36145
36146
36147
36148
36149
36150
36151
36152
36153
36154
36155
36156
36157
36158
36159
36160
36161
36162
36163
36164
36165
36166
36167
36168
36169
36170
36171
36172
36173
36174
36175
36176
36177
36178
36179
36180
36181
36182
36183
36184
36185
36186
36187
36188
36189
36190
36191
36192
36193
36194
36195
36196
36197
36198
36199
36200
36201
36202
36203
36204
36205
36206
36207
36208
36209
36210
36211
36212
36213
36214
36215
36216
36217
36218
36219
36220
36221
36222
36223
36224
36225
36226
36227
36228
36229
36230
36231
36232
36233
36234
36235
36236
36237
36238
36239
36240
36241
36242
36243
36244
36245
36246
36247
36248
36249
36250
36251
36252
36253
36254
36255
36256
36257
36258
36259
36260
36261
36262
36263
36264
36265
36266
36267
36268
36269
36270
36271
36272
36273
36274
36275
36276
36277
36278
36279
36280
36281
36282
36283
36284
36285
36286
36287
36288
36289
36290
36291
36292
36293
36294
36295
36296
36297
36298
36299
36300
36301
36302
36303
36304
36305
36306
36307
36308
36309
36310
36311
36312
36313
36314
36315
36316
36317
36318
36319
36320
36321
36322
36323
36324
36325
36326
36327
36328
36329
36330
36331
36332
36333
36334
36335
36336
36337
36338
36339
36340
36341
36342
36343
36344
36345
36346
36347
36348
36349
36350
36351
36352
36353
36354
36355
36356
36357
36358
36359
36360
36361
36362
36363
36364
36365
36366
36367
36368
36369
36370
36371
36372
36373
36374
36375
36376
36377
36378
36379
36380
36381
36382
36383
36384
36385
36386
36387
36388
36389
36390
36391
36392
36393
36394
36395
36396
36397
36398
36399
36400
36401
36402
36403
36404
36405
36406
36407
36408
36409
36410
36411
36412
36413
36414
36415
36416
36417
36418
36419
36420
36421
36422
36423
36424
36425
36426
36427
36428
36429
36430
36431
36432
36433
36434
36435
36436
36437
36438
36439
36440
36441
36442
36443
36444
36445
36446
36447
36448
36449
36450
36451
36452
36453
36454
36455
36456
36457
36458
36459
36460
36461
36462
36463
36464
36465
36466
36467
36468
36469
36470
36471
36472
36473
36474
36475
36476
36477
36478
36479
36480
36481
36482
36483
36484
36485
36486
36487
36488
36489
36490
36491
36492
36493
36494
36495
36496
36497
36498
36499
36500
36501
36502
36503
36504
36505
36506
36507
36508
36509
36510
36511
36512
36513
36514
36515
36516
36517
36518
36519
36520
36521
36522
36523
36524
36525
36526
36527
36528
36529
36530
36531
36532
36533
36534
36535
36536
36537
36538
36539
36540
36541
36542
36543
36544
36545
36546
36547
36548
36549
36550
36551
36552
36553
36554
36555
36556
36557
36558
36559
36560
36561
36562
36563
36564
36565
36566
36567
36568
36569
36570
36571
36572
36573
36574
36575
36576
36577
36578
36579
36580
36581
36582
36583
36584
36585
36586
36587
36588
36589
36590
36591
36592
36593
36594
36595
36596
36597
36598
36599
36600
36601
36602
36603
36604
36605
36606
36607
36608
36609
36610
36611
36612
36613
36614
36615
36616
36617
36618
36619
36620
36621
36622
36623
36624
36625
36626
36627
36628
36629
36630
36631
36632
36633
36634
36635
36636
36637
36638
36639
36640
36641
36642
36643
36644
36645
36646
36647
36648
36649
36650
36651
36652
36653
36654
36655
36656
36657
36658
36659
36660
36661
36662
36663
36664
36665
36666
36667
36668
36669
36670
36671
36672
36673
36674
36675
36676
36677
36678
36679
36680
36681
36682
36683
36684
36685
36686
36687
36688
36689
36690
36691
36692
36693
36694
36695
36696
36697
36698
36699
36700
36701
36702
36703
36704
36705
36706
36707
36708
36709
36710
36711
36712
36713
36714
36715
36716
36717
36718
36719
36720
36721
36722
36723
36724
36725
36726
36727
36728
36729
36730
36731
36732
36733
36734
36735
36736
36737
36738
36739
36740
36741
36742
36743
36744
36745
36746
36747
36748
36749
36750
36751
36752
36753
36754
36755
36756
36757
36758
36759
36760
36761
36762
36763
36764
36765
36766
36767
36768
36769
36770
36771
36772
36773
36774
36775
36776
36777
36778
36779
36780
36781
36782
36783
36784
36785
36786
36787
36788
36789
36790
36791
36792
36793
36794
36795
36796
36797
36798
36799
36800
36801
36802
36803
36804
36805
36806
36807
36808
36809
36810
36811
36812
36813
36814
36815
36816
36817
36818
36819
36820
36821
36822
36823
36824
36825
36826
36827
36828
36829
36830
36831
36832
36833
36834
36835
36836
36837
36838
36839
36840
36841
36842
36843
36844
36845
36846
36847
36848
36849
36850
36851
36852
36853
36854
36855
36856
36857
36858
36859
36860
36861
36862
36863
36864
36865
36866
36867
36868
36869
36870
36871
36872
36873
36874
36875
36876
36877
36878
36879
36880
36881
36882
36883
36884
36885
36886
36887
36888
36889
36890
36891
36892
36893
36894
36895
36896
36897
36898
36899
36900
36901
36902
36903
36904
36905
36906
36907
36908
36909
36910
36911
36912
36913
36914
36915
36916
36917
36918
36919
36920
36921
36922
36923
36924
36925
36926
36927
36928
36929
36930
36931
36932
36933
36934
36935
36936
36937
36938
36939
36940
36941
36942
36943
36944
36945
36946
36947
36948
36949
36950
36951
36952
36953
36954
36955
36956
36957
36958
36959
36960
36961
36962
36963
36964
36965
36966
36967
36968
36969
36970
36971
36972
36973
36974
36975
36976
36977
36978
36979
36980
36981
36982
36983
36984
36985
36986
36987
36988
36989
36990
36991
36992
36993
36994
36995
36996
36997
36998
36999
37000
37001
37002
37003
37004
37005
37006
37007
37008
37009
37010
37011
37012
37013
37014
37015
37016
37017
37018
37019
37020
37021
37022
37023
37024
37025
37026
37027
37028
37029
37030
37031
37032
37033
37034
37035
37036
37037
37038
37039
37040
37041
37042
37043
37044
37045
37046
37047
37048
37049
37050
37051
37052
37053
37054
37055
37056
37057
37058
37059
37060
37061
37062
37063
37064
37065
37066
37067
37068
37069
37070
37071
37072
37073
37074
37075
37076
37077
37078
37079
37080
37081
37082
37083
37084
37085
37086
37087
37088
37089
37090
37091
37092
37093
37094
37095
37096
37097
37098
37099
37100
37101
37102
37103
37104
37105
37106
37107
37108
37109
37110
37111
37112
37113
37114
37115
37116
37117
37118
37119
37120
37121
37122
37123
37124
37125
37126
37127
37128
37129
37130
37131
37132
37133
37134
37135
37136
37137
37138
37139
37140
37141
37142
37143
37144
37145
37146
37147
37148
37149
37150
37151
37152
37153
37154
37155
37156
37157
37158
37159
37160
37161
37162
37163
37164
37165
37166
37167
37168
37169
37170
37171
37172
37173
37174
37175
37176
37177
37178
37179
37180
37181
37182
37183
37184
37185
37186
37187
37188
37189
37190
37191
37192
37193
37194
37195
37196
37197
37198
37199
37200
37201
37202
37203
37204
37205
37206
37207
37208
37209
37210
37211
37212
37213
37214
37215
37216
37217
37218
37219
37220
37221
37222
37223
37224
37225
37226
37227
37228
37229
37230
37231
37232
37233
37234
37235
37236
37237
37238
37239
37240
37241
37242
37243
37244
37245
37246
37247
37248
37249
37250
37251
37252
37253
37254
37255
37256
37257
37258
37259
37260
37261
37262
37263
37264
37265
37266
37267
37268
37269
37270
37271
37272
37273
37274
37275
37276
37277
37278
37279
37280
37281
37282
37283
37284
37285
37286
37287
37288
37289
37290
37291
37292
37293
37294
37295
37296
37297
37298
37299
37300
37301
37302
37303
37304
37305
37306
37307
37308
37309
37310
37311
37312
37313
37314
37315
37316
37317
37318
37319
37320
37321
37322
37323
37324
37325
37326
37327
37328
37329
37330
37331
37332
37333
37334
37335
37336
37337
37338
37339
37340
37341
37342
37343
37344
37345
37346
37347
37348
37349
37350
37351
37352
37353
37354
37355
37356
37357
37358
37359
37360
37361
37362
37363
37364
37365
37366
37367
37368
37369
37370
37371
37372
37373
37374
37375
37376
37377
37378
37379
37380
37381
37382
37383
37384
37385
37386
37387
37388
37389
37390
37391
37392
37393
37394
37395
37396
37397
37398
37399
37400
37401
37402
37403
37404
37405
37406
37407
37408
37409
37410
37411
37412
37413
37414
37415
37416
37417
37418
37419
37420
37421
37422
37423
37424
37425
37426
37427
37428
37429
37430
37431
37432
37433
37434
37435
37436
37437
37438
37439
37440
37441
37442
37443
37444
37445
37446
37447
37448
37449
37450
37451
37452
37453
37454
37455
37456
37457
37458
37459
37460
37461
37462
37463
37464
37465
37466
37467
37468
37469
37470
37471
37472
37473
37474
37475
37476
37477
37478
37479
37480
37481
37482
37483
37484
37485
37486
37487
37488
37489
37490
37491
37492
37493
37494
37495
37496
37497
37498
37499
37500
37501
37502
37503
37504
37505
37506
37507
37508
37509
37510
37511
37512
37513
37514
37515
37516
37517
37518
37519
37520
37521
37522
37523
37524
37525
37526
37527
37528
37529
37530
37531
37532
37533
37534
37535
37536
37537
37538
37539
37540
37541
37542
37543
37544
37545
37546
37547
37548
37549
37550
37551
37552
37553
37554
37555
37556
37557
37558
37559
37560
37561
37562
37563
37564
37565
37566
37567
37568
37569
37570
37571
37572
37573
37574
37575
37576
37577
37578
37579
37580
37581
37582
37583
37584
37585
37586
37587
37588
37589
37590
37591
37592
37593
37594
37595
37596
37597
37598
37599
37600
37601
37602
37603
37604
37605
37606
37607
37608
37609
37610
37611
37612
37613
37614
37615
37616
37617
37618
37619
37620
37621
37622
37623
37624
37625
37626
37627
37628
37629
37630
37631
37632
37633
37634
37635
37636
37637
37638
37639
37640
37641
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/Dist
@@ -0,0 +1,29 @@
+bits/mcontext.h
+bits/stat16.h
+fpu.h
+machine/pal.h
+net/ethernet.h
+net/if_arp.h
+net/if_ether.h
+net/if_dl.h
+net/route.h
+nfs/nfs.h
+regdef.h
+sa_len.c
+stat16conv.c
+statfsconv.c
+sys/acl.h
+sys/extattr.h
+sys/io.h
+sys/jail.h
+sys/linker.h
+sys/mount.h
+sys/perm.h
+sys/rfork.h
+sys/rtprio.h
+sys/syslimits.h
+sys/timex.h
+sys/vm86.h
+sys_lseek.S
+sysarch.h
+ucontext_i.h
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/Implies
@@ -0,0 +1,11 @@
+# The kernel include files come from the 'kernel-include' add-on.
+# This is actually added by configure.in.
+#/usr/src/sys/
+
+# One of two possible utmp file formats.
+# This is actually added by configure.in.
+#unix/bsd/bsd4.4/kfreebsd/utmp-xyz
+
+# The gnu subdirectory exists for things common to Linux-based, Hurd-based
+# and kFreeBSD-based GNU systems.
+gnu
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/Makefile
@@ -0,0 +1,138 @@
+# Use bash, not /bin/sh, for executing scripts, because the native
+# FreeBSD /bin/sh does not interpret the  IFS="<tab>" read ...  command
+# in localedata/tst-fmon.sh correctly.
+SHELL = bash
+
+# Additional header files to be installed in $prefix/include:
+
+ifeq ($(subdir),misc)
+sysdep_headers += \
+ kenv.h \
+ bits/os-unistd.h \
+ sys/mount.h \
+ sys/kd.h \
+ sys/rfork.h
+endif
+
+ifeq ($(subdir),stdlib)
+sysdep_headers += \
+ bits/mcontext.h
+endif
+
+# Additional functions, and particular system calls:
+
+ifeq ($(subdir),csu)
+# For <errno.h>.
+sysdep_routines += errno-loc
+endif
+
+ifeq ($(subdir),assert)
+CFLAGS-assert.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>'
+CFLAGS-assert-perr.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>'
+endif
+
+ifeq ($(subdir),io)
+# For <unistd.h>.
+sysdep_routines += sys_access sys_faccessat sys_getcwd
+# For <fcntl.h>.
+sysdep_routines += sys_open sys_openat open_2
+# For <sys/stat.h>.
+sysdep_routines += sys_fstat sys_fstatat sys_lstat sys_mkfifoat sys_mknod sys_mknodat sys_nfstat sys_nlstat sys_nstat sys_stat lchflags
+# For <sys/statfs.h>.
+sysdep_routines += fstatfs64 statfs64 sys_fstatfs sys_statfs
+# For <sys/times.h>.
+sysdep_routines += sys_futimesat
+# Other.
+sysdep_routines += lchmod
+endif
+
+ifeq ($(subdir),dirent)
+# For <dirent.h>.
+sysdep_routines += sys_getdents sys_getdirentries getdirentries getdirentries64
+endif
+
+ifeq ($(subdir),misc)
+# For <kenv.h>.
+sysdep_routines += kenv
+# For <sched.h>.
+sysdep_routines += clone start_thread
+# For <unistd.h>.
+sysdep_routines += getosreldate
+# For <sys/acl.h>.
+sysdep_routines += acl_aclcheck_fd acl_aclcheck_file acl_delete_fd acl_delete_file acl_get_fd acl_get_file acl_set_fd acl_set_file
+# For <sys/extattr.h>.
+sysdep_routines += extattrctl extattr_delete_file extattr_get_file extattr_set_file
+# For <sys/jail.h>.
+sysdep_routines += jail jail_attach jail_remove jail_get jail_set
+# For <sys/ktrace.h>.
+sysdep_routines += ktrace utrace
+# For <sys/linker.h>.
+sysdep_routines += kldfind kldfirstmod kldload kldnext kldstat kldsym kldunload kldunloadf
+# For <sys/mman.h>.
+sysdep_routines += minherit sys_mmap sys_munmap
+# For <sys/mount.h>.
+sysdep_routines += fhopen sys_fhstat sys_fhstatfs fhstat fhstat64 fhstatfs fhstatfs64 getfh getfsstat getfsstat64 sys_getfsstat getmntinfo getmntinfo64 mount nmount unmount
+# For <sys/rfork.h>.
+sysdep_routines += rfork
+# For <sys/rtprio.h>.
+sysdep_routines += rtprio
+# For <sys/socket.h>.
+sysdep_routines += bsd_sendfile
+# For <sys/stat.h>.
+sysdep_routines += devname
+# For <sys/sysctl.h>.
+sysdep_routines += sysctl sysctlbyname sysctlnametomib
+# For <sys/uio.h>.
+sysdep_routines += sys_readv sys_writev
+# Other.
+sysdep_routines += swapon swapoff sys_aio_cancel sys_aio_error sys_aio_read sys_aio_return sys_aio_suspend sys_aio_waitcomplete sys_aio_write sys_lio_listio issetugid modfind modfnext modnext modstat obreak quotactl rfork sysarch undelete yield
+# for INLINE_SYSCALL
+sysdep_routines += sys_fork sys_sigaction sys_close sys_fcntl
+sysdep_routines += sys_clock_getres sys_clock_gettime sys_clock_settime
+sysdep_routines += sys_ktimer_create sys_ktimer_gettime sys_ktimer_settime sys_ktimer_getoverrun sys_ktimer_delete
+sysdep_routines += sys_semctl sys_shmctl sys_msgctl
+endif
+
+ifeq ($(subdir),posix)
+# For <unistd.h>.
+sysdep_routines += sys_getlogin sys_setlogin sys_read sys_write
+# for <sched.h>
+sysdep_routines += sys_cpuset_getaffinity sys_cpuset_setaffinity
+endif
+
+ifeq ($(subdir),inet)
+sysdep_headers += net/ethernet.h net/if_ether.h
+endif
+
+ifeq ($(subdir),time)
+# For <sys/timex.h>.
+sysdep_routines += ntp_adjtime ntp_gettime
+endif
+
+ifeq ($(subdir),socket)
+sysdep_routines += sa_len sys_bind sys_connect sys_sendto
+endif
+
+# Linuxthreads dependencies.
+
+ifeq ($(subdir),posix)
+sysdep_headers += bits/initspin.h
+endif
+
+# Don't compile the ctype glue code, since we have a much better <ctype.h>
+# than the old non-GNU C library.
+inhibit-glue = yes
+
+# Special ELF hacks.
+ifeq ($(subdir),elf)
+sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64
+sysdep_routines += sys_umtx
+endif
+
+ifeq ($(subdir),sunrpc)
+sysdep_headers += nfs/nfs.h
+endif
+
+ifeq ($(subdir),rt)
+librt-routines += sys_shm_open
+endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/Versions
@@ -0,0 +1,129 @@
+libc {
+  # The comment lines with "#errlist-compat" are magic; see errlist-compat.awk.
+  # When you get an error from errlist-compat.awk, you need to add a new
+  # version here.  Don't do this blindly, since this means changing the ABI
+  # for all GNU/kFreeBSD configurations.
+
+  GLIBC_2.2.6 {
+    # c*
+    clone;
+
+    # e*
+    extattrctl; extattr_delete_file; extattr_get_file; extattr_set_file;
+
+    # f*
+    fhopen; fhstat; fhstatfs; futimes;
+
+    # g*
+    getdents; getfh; getfsstat; getfsstat64; getmntinfo; getmntinfo64;
+    getresgid; getresuid;
+
+    # i*
+    issetugid;
+
+    # j*
+    jail;
+
+    # k*
+    kldfind; kldfirstmod; kldload; kldnext; kldstat; kldsym; kldunload; kldunloadf;
+    ktrace;
+
+    # l*
+    lchmod; lutimes;
+
+    # m*
+    minherit; modfind; modfnext; modnext; modstat; mount;
+
+    # n*
+    nmount; ntp_adjtime; ntp_gettime;
+
+    # q*
+    quotactl;
+
+    # r*
+    rfork; rtprio;
+
+    # s*
+    sendfile; setresgid; setresuid; swapoff; swapon; sysarch; sysctl; sysctlbyname;
+
+    # u*
+    undelete; unmount; utrace;
+
+    # see <sys/acl.h>.
+    __acl_aclcheck_fd; __acl_aclcheck_file; __acl_delete_fd; __acl_delete_file;
+    __acl_get_fd; __acl_get_file; __acl_set_fd; __acl_set_file;
+
+    # see <errno.h>.
+    __errno_location;
+
+    # see <sys/sysctl.h>.
+    __sysctl;
+
+    # Questionable system calls. These functions may be removed at any moment.
+    __syscall_aio_cancel; __syscall_aio_error; __syscall_aio_read;
+    __syscall_aio_return; __syscall_aio_suspend; __syscall_aio_waitcomplete;
+    __syscall_aio_write; __syscall_lio_listio;
+    __syscall_obreak;
+    __syscall_yield;
+  }
+  GLIBC_2.3 {
+    #errlist-compat     87
+    _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+  }
+  GLIBC_2.3.4 {
+    # f*
+    fhstat64; fhstatfs64;
+    kqueue; kevent;
+
+    #errlist-compat     93
+    _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+
+    # functions used in inline functions or macros
+    __libc_sa_len;
+  }
+  GLIBC_2.10 {
+    devname;
+    devname_r;
+    kenv;
+    sysctlnametomib;
+  }
+  GLIBC_2.11 {
+    lchflags;
+    #errlist-compat 94
+    _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+  }
+  GLIBC_2.13 {
+    jail_attach;
+    jail_remove;
+    jail_get;
+    jail_set;
+  }
+  GLIBC_2.18 {
+    msgctl;
+    semctl;
+    shmctl;
+    waitid;
+    #errlist-compat 97
+    _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
+  }
+  GLIBC_2.21 {
+    __statfs;
+  }
+  GLIBC_PRIVATE {
+    # needed by libpthread.
+    __clone; __libc_fork; __libc_sigaction; __kernel_getosreldate;
+    # needed by libpthread as INLINE_SYSCALL:
+    __syscall_fork;
+    __syscall_open; __syscall_close;
+    __syscall_read; __syscall_write;
+    __syscall_wait4; __syscall_fcntl;
+    # needed by librt as INLINE_SYSCALL:
+    __syscall_clock_getres; __syscall_clock_gettime; __syscall_clock_settime;
+    __syscall_ktimer_create; __syscall_ktimer_gettime; __syscall_ktimer_settime; __syscall_ktimer_getoverrun; __syscall_ktimer_delete;
+    # misc fixes for FreeBSD:
+    __syscall_connect; __syscall_sendto;
+    __syscall_cpuset_getaffinity ; __syscall_cpuset_setaffinity;
+     # global variable used in brk()
+    _end;
+  }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/_exit.S
@@ -0,0 +1,26 @@
+/* Copyright (C) 1991,92,97,99,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+PSEUDO (_exit, exit, 1)
+	/* Shouldn't get here.  */
+PSEUDO_END(_exit)
+libc_hidden_def (_exit)
+rtld_hidden_def (_exit)
+weak_alias (_exit, _Exit)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/a.out.h
@@ -0,0 +1,140 @@
+#ifndef __A_OUT_GNU_H__
+#define __A_OUT_GNU_H__
+
+#define __GNU_EXEC_MACROS__
+
+struct exec
+{
+  unsigned long a_info;	/* Use macros N_MAGIC, etc for access.  */
+  unsigned int a_text;	/* Length of text, in bytes.  */
+  unsigned int a_data;	/* Length of data, in bytes.  */
+  unsigned int a_bss;	/* Length of uninitialized data area for file, in bytes.  */
+  unsigned int a_syms;	/* Length of symbol table data in file, in bytes.  */
+  unsigned int a_entry;	/* Start address.  */
+  unsigned int a_trsize;/* Length of relocation info for text, in bytes.  */
+  unsigned int a_drsize;/* Length of relocation info for data, in bytes.  */
+};
+
+enum machine_type
+{
+  M_OLDSUN2 = 0,
+  M_68010 = 1,
+  M_68020 = 2,
+  M_SPARC = 3,
+  M_386 = 100,
+  M_MIPS1 = 151,
+  M_MIPS2 = 152
+};
+
+#define N_MAGIC(exec)	((exec).a_info & 0xffff)
+#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
+#define N_FLAGS(exec)	(((exec).a_info >> 24) & 0xff)
+#define N_SET_INFO(exec, magic, type, flags) \
+  ((exec).a_info = ((magic) & 0xffff)					\
+   | (((int)(type) & 0xff) << 16)					\
+   | (((flags) & 0xff) << 24))
+#define N_SET_MAGIC(exec, magic) \
+  ((exec).a_info = ((exec).a_info & 0xffff0000) | ((magic) & 0xffff))
+#define N_SET_MACHTYPE(exec, machtype) \
+  ((exec).a_info =							\
+   ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
+#define N_SET_FLAGS(exec, flags) \
+  ((exec).a_info =							\
+   ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
+
+/* Code indicating object file or impure executable.  */
+#define OMAGIC 0407
+/* Code indicating pure executable.  */
+#define NMAGIC 0410
+/* Code indicating demand-paged executable.  */
+#define ZMAGIC 0413
+/* This indicates a demand-paged executable with the header in the text. 
+   The first page is unmapped to help trap NULL pointer references.  */
+#define QMAGIC 0314
+/* Code indicating core file.  */
+#define CMAGIC 0421
+
+#define N_TRSIZE(a)	((a).a_trsize)
+#define N_DRSIZE(a)	((a).a_drsize)
+#define N_SYMSIZE(a)	((a).a_syms)
+#define N_BADMAG(x) \
+  (N_MAGIC(x) != OMAGIC	&& N_MAGIC(x) != NMAGIC				\
+   && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC)
+#define _N_HDROFF(x)	(1024 - sizeof (struct exec))
+#define N_TXTOFF(x) \
+  (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) :	\
+   (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
+#define N_DATOFF(x)	(N_TXTOFF(x) + (x).a_text)
+#define N_TRELOFF(x)	(N_DATOFF(x) + (x).a_data)
+#define N_DRELOFF(x)	(N_TRELOFF(x) + N_TRSIZE(x))
+#define N_SYMOFF(x)	(N_DRELOFF(x) + N_DRSIZE(x))
+#define N_STROFF(x)	(N_SYMOFF(x) + N_SYMSIZE(x))
+
+/* Address of text segment in memory after it is loaded.  */
+#define N_TXTADDR(x)	(N_MAGIC(x) == QMAGIC ? 4096 : 0)
+
+/* Address of data segment in memory after it is loaded.  */
+#define SEGMENT_SIZE	1024
+
+#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1))
+#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
+
+#define N_DATADDR(x) \
+  (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x))				\
+   : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
+#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+
+#if !defined (N_NLIST_DECLARED)
+struct nlist
+{
+  union 
+  {
+  char *n_name;
+  union
+    {
+      char *n_name;
+      struct nlist *n_next;
+      long n_strx;
+    } n_un;
+  } __attribute__ ((__transparent_union__)); 
+  unsigned char n_type;
+  char n_other;
+  short n_desc;
+  unsigned long n_value;
+};
+#endif /* no N_NLIST_DECLARED.  */
+
+#define N_UNDF	0
+#define N_ABS	2
+#define N_TEXT	4
+#define N_DATA	6
+#define N_BSS	8
+#define N_FN	15
+#define N_EXT	1
+#define N_TYPE	036
+#define N_STAB	0340
+#define N_INDR	0xa
+#define	N_SETA	0x14	/* Absolute set element symbol.  */
+#define	N_SETT	0x16	/* Text set element symbol.  */
+#define	N_SETD	0x18	/* Data set element symbol.  */
+#define	N_SETB	0x1A	/* Bss set element symbol.  */
+#define N_SETV	0x1C	/* Pointer to set vector in data area.  */
+
+#if !defined (N_RELOCATION_INFO_DECLARED)
+/* This structure describes a single relocation to be performed.
+   The text-relocation section of the file is a vector of these structures,
+   all of which apply to the text section.
+   Likewise, the data-relocation section applies to the data section.  */
+
+struct relocation_info
+{
+  int r_address;
+  unsigned int r_symbolnum:24;
+  unsigned int r_pcrel:1;
+  unsigned int r_length:2;
+  unsigned int r_extern:1;
+  unsigned int r_pad:4;
+};
+#endif /* no N_RELOCATION_INFO_DECLARED.  */
+
+#endif /* __A_OUT_GNU_H__ */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/access.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <sysdep.h>
+
+/*
+   The FreeBSD kernel do not test file access correctly when the 
+   process' real user ID is superuser. In particular, they always return
+   zero when testing execute permissions without regard to whether the 
+   file is executable.
+
+   While this behaviour conforms to POSIX.1-2008, it is explicitely 
+   discouraged. This wrapper implements the recommended behaviour.
+ */
+
+extern int __syscall_access (const char *path, int mode);
+libc_hidden_proto (__syscall_access)
+
+int
+__access (const char *path, int mode)
+{
+  struct stat64 stats;
+
+  if ((__getuid() != 0) || !(mode & X_OK))
+    return __syscall_access (path, mode);
+
+  /* Althought the super-user can read and write any file, 
+     the file-system might be i.e. read-only. Do the check. */
+     
+  if (__syscall_access (path, mode))
+    return -1;
+    
+  if (stat64 (path, &stats))
+    return -1;
+
+  /* The super-user can execute any file that anyone can execute. */
+  if (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))
+    return 0;
+
+  __set_errno (EACCES);
+  return -1;
+}
+
+
+/* Test for access to FILE by our real user and group IDs without setting
+   errno.  */
+int
+__access_noerrno (const char *file, int type)
+{
+  int ret;
+  int saved_errno = errno;
+
+  ret = __access (file, type);
+
+  __set_errno(saved_errno);
+  return ret;
+}
+
+weak_alias (__access, access)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/aio_sigqueue.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <aio.h>
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include <aio_misc.h>
+
+int
+internal_function
+__aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
+{
+#if !IS_IN (libc)
+    return sigqueue(caller_pid, sig, val);
+#else
+    return __sigqueue(caller_pid, sig, val);
+#endif    
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bind.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2005.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/socket.h>
+#include <sysdep.h>
+
+/* According to POSIX.1-2004 the len argument specifies the length of
+   the sockaddr structure pointed to by the addrarg argument. However
+   the FreeBSD kernel waits the actual length of the address stored
+   there. The code below emulate this behaviour. */
+
+extern int __libc_sa_len (sa_family_t __af);
+libc_hidden_proto (__libc_sa_len)
+
+extern int __syscall_bind (int fd, __CONST_SOCKADDR_ARG addr,
+			   socklen_t addrlen) __THROW;
+libc_hidden_proto (__syscall_bind)
+
+/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
+   For connectionless socket types, just set the default address to send to
+   and the only address from which to accept transmissions.
+   Return 0 on success, -1 for errors.  */
+
+int
+__bind (int fd, __CONST_SOCKADDR_ARG addr, socklen_t addrlen)
+{
+  socklen_t new_addrlen;
+
+  new_addrlen = __libc_sa_len ((addr.__sockaddr__)->sa_family);
+
+  /* Only allow a smaller size, otherwise it could lead to
+    stack corruption */
+  if ((new_addrlen != 0) && (new_addrlen < addrlen))
+    addrlen = new_addrlen;
+
+  /* We pass 3 arguments.  */
+  return INLINE_SYSCALL (bind, 3, fd, addr.__sockaddr__, addrlen);
+}
+
+weak_alias (__bind, bind)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/auxv.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Legal values for a_type (entry type).  */
+
+#define	AT_NULL		0	/* End of vector */
+#define	AT_IGNORE	1	/* Entry should be ignored */
+#define	AT_EXECFD	2	/* File descriptor of program */
+#define	AT_PHDR		3	/* Program headers for program */
+#define	AT_PHENT	4	/* Size of program header entry */
+#define	AT_PHNUM	5	/* Number of program headers */
+#define	AT_PAGESZ	6	/* System page size */
+#define	AT_BASE		7	/* Base address of interpreter */
+#define	AT_FLAGS	8	/* Flags */
+#define	AT_ENTRY	9	/* Entry point of program */
+#define	AT_NOTELF	10	/* Program is not ELF */
+#define	AT_UID		11	/* Real uid */
+#define	AT_EUID		12	/* Effective uid */
+#define	AT_GID		13	/* Real gid */
+#define	AT_EGID		14	/* Effective gid */
+#define	AT_EXECPATH	15	/* Path to the executable. */
+#define	AT_CANARY	16	/* Canary for SSP. */
+#define	AT_CANARYLEN	17	/* Length of the canary. */
+#define	AT_OSRELDATE	18	/* OSRELDATE. */
+#define	AT_NCPUS	19	/* Number of CPUs. */
+#define	AT_PAGESIZES	20	/* Pagesizes. */
+#define	AT_PAGESIZESLEN	21	/* Number of pagesizes. */
+#define	AT_TIMEKEEP	22	/* Pointer to timehands. */
+#define	AT_STACKPROT	23	/* Initial stack protection. */
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/dirent.h
@@ -0,0 +1,55 @@
+/* Directory entry structure `struct dirent'.  FreeBSD version.
+   Copyright (C) 1996-1998,2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+
+struct dirent
+  {
+    unsigned int d_ino;		/* File serial number.  */
+    unsigned short int d_reclen; /* Length of the whole `struct dirent'.  */
+    unsigned char d_type;	/* File type, possibly unknown.  */
+    unsigned char d_namlen;	/* Length of the file name.  */
+
+    /* Only this member is in the POSIX standard.  */
+    char d_name[256];		/* File name (actually longer).  */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct dirent64
+  {
+    unsigned int d_ino;		/* File serial number.  */
+    unsigned short int d_reclen; /* Length of the whole `struct dirent'.  */
+    unsigned char d_type;	/* File type, possibly unknown.  */
+    unsigned char d_namlen;	/* Length of the file name.  */
+
+    /* Only this member is in the POSIX standard.  */
+    char d_name[256];		/* File name (actually longer).  */
+  };
+#endif
+
+#define d_fileno        d_ino   /* Backwards compatibility.  */
+
+#define _DIRENT_HAVE_D_RECLEN 1
+#define _DIRENT_HAVE_D_NAMLEN 1
+#define _DIRENT_HAVE_D_TYPE 1
+
+/* Inform libc code that these two types are effectively identical.  */
+# define _DIRENT_MATCHES_DIRENT64       1
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/errno.h
@@ -0,0 +1,195 @@
+/*-
+ * Copyright (c) 1982, 1986, 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)errno.h	8.5 (Berkeley) 1/21/94
+ * $FreeBSD$
+ */
+
+#ifdef _ERRNO_H
+
+# undef EDOM
+# undef EILSEQ
+# undef ERANGE
+
+#define	EPERM		1		/* Operation not permitted */
+#define	ENOENT		2		/* No such file or directory */
+#define	ESRCH		3		/* No such process */
+#define	EINTR		4		/* Interrupted system call */
+#define	EIO		5		/* Input/output error */
+#define	ENXIO		6		/* Device not configured */
+#define	E2BIG		7		/* Argument list too long */
+#define	ENOEXEC		8		/* Exec format error */
+#define	EBADF		9		/* Bad file descriptor */
+#define	ECHILD		10		/* No child processes */
+#define	EDEADLK		11		/* Resource deadlock avoided */
+					/* 11 was EAGAIN */
+#define	ENOMEM		12		/* Cannot allocate memory */
+#define	EACCES		13		/* Permission denied */
+#define	EFAULT		14		/* Bad address */
+#define	ENOTBLK		15		/* Block device required */
+#define	EBUSY		16		/* Device busy */
+#define	EEXIST		17		/* File exists */
+#define	EXDEV		18		/* Cross-device link */
+#define	ENODEV		19		/* Operation not supported by device */
+#define	ENOTDIR		20		/* Not a directory */
+#define	EISDIR		21		/* Is a directory */
+#define	EINVAL		22		/* Invalid argument */
+#define	ENFILE		23		/* Too many open files in system */
+#define	EMFILE		24		/* Too many open files */
+#define	ENOTTY		25		/* Inappropriate ioctl for device */
+#define	ETXTBSY		26		/* Text file busy */
+#define	EFBIG		27		/* File too large */
+#define	ENOSPC		28		/* No space left on device */
+#define	ESPIPE		29		/* Illegal seek */
+#define	EROFS		30		/* Read-only filesystem */
+#define	EMLINK		31		/* Too many links */
+#define	EPIPE		32		/* Broken pipe */
+
+/* math software */
+#define	EDOM		33		/* Numerical argument out of domain */
+#define	ERANGE		34		/* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define	EAGAIN		35		/* Resource temporarily unavailable */
+#define	EWOULDBLOCK	EAGAIN		/* Operation would block */
+#define	EINPROGRESS	36		/* Operation now in progress */
+#define	EALREADY	37		/* Operation already in progress */
+
+/* ipc/network software -- argument errors */
+#define	ENOTSOCK	38		/* Socket operation on non-socket */
+#define	EDESTADDRREQ	39		/* Destination address required */
+#define	EMSGSIZE	40		/* Message too long */
+#define	EPROTOTYPE	41		/* Protocol wrong type for socket */
+#define	ENOPROTOOPT	42		/* Protocol not available */
+#define	EPROTONOSUPPORT	43		/* Protocol not supported */
+#define	ESOCKTNOSUPPORT	44		/* Socket type not supported */
+#define	EOPNOTSUPP	45		/* Operation not supported */
+#define	ENOTSUP		EOPNOTSUPP	/* Operation not supported */
+#define	EPFNOSUPPORT	46		/* Protocol family not supported */
+#define	EAFNOSUPPORT	47		/* Address family not supported by protocol family */
+#define	EADDRINUSE	48		/* Address already in use */
+#define	EADDRNOTAVAIL	49		/* Can't assign requested address */
+
+/* ipc/network software -- operational errors */
+#define	ENETDOWN	50		/* Network is down */
+#define	ENETUNREACH	51		/* Network is unreachable */
+#define	ENETRESET	52		/* Network dropped connection on reset */
+#define	ECONNABORTED	53		/* Software caused connection abort */
+#define	ECONNRESET	54		/* Connection reset by peer */
+#define	ENOBUFS		55		/* No buffer space available */
+#define	EISCONN		56		/* Socket is already connected */
+#define	ENOTCONN	57		/* Socket is not connected */
+#define	ESHUTDOWN	58		/* Can't send after socket shutdown */
+#define	ETOOMANYREFS	59		/* Too many references: can't splice */
+#define	ETIMEDOUT	60		/* Operation timed out */
+#define	ECONNREFUSED	61		/* Connection refused */
+
+#define	ELOOP		62		/* Too many levels of symbolic links */
+#define	ENAMETOOLONG	63		/* File name too long */
+
+/* should be rearranged */
+#define	EHOSTDOWN	64		/* Host is down */
+#define	EHOSTUNREACH	65		/* No route to host */
+#define	ENOTEMPTY	66		/* Directory not empty */
+
+/* quotas & mush */
+#define	EPROCLIM	67		/* Too many processes */
+#define	EUSERS		68		/* Too many users */
+#define	EDQUOT		69		/* Disc quota exceeded */
+
+/* Network File System */
+#define	ESTALE		70		/* Stale NFS file handle */
+#define	EREMOTE		71		/* Too many levels of remote in path */
+#define	EBADRPC		72		/* RPC struct is bad */
+#define	ERPCMISMATCH	73		/* RPC version wrong */
+#define	EPROGUNAVAIL	74		/* RPC prog. not avail */
+#define	EPROGMISMATCH	75		/* Program version wrong */
+#define	EPROCUNAVAIL	76		/* Bad procedure for program */
+
+#define	ENOLCK		77		/* No locks available */
+#define	ENOSYS		78		/* Function not implemented */
+
+#define	EFTYPE		79		/* Inappropriate file type or format */
+#define	EAUTH		80		/* Authentication error */
+#define	ENEEDAUTH	81		/* Need authenticator */
+#define	EIDRM		82		/* Identifier removed */
+#define	ENOMSG		83		/* No message of desired type */
+#define	EOVERFLOW	84		/* Value too large to be stored in data type */
+#define	ECANCELED	85		/* Operation canceled */
+#define	EILSEQ		86		/* Illegal byte sequence */
+#define	ENOATTR		87		/* Attribute not found */
+
+#define	EDOOFUS		88		/* Programming error */
+
+#define	EBADMSG		89		/* Bad message */
+#define	EMULTIHOP	90		/* Multihop attempted */
+#define	ENOLINK		91		/* Link has been severed */
+#define	EPROTO		92		/* Protocol error */
+
+#define	ENOTCAPABLE	93		/* Capabilities insufficient */
+#define	ECAPMODE	94		/* Not permitted in capability mode */
+#define	ENOTRECOVERABLE	95		/* State not recoverable */
+#define	EOWNERDEAD	96		/* Previous owner died */
+
+#define	ELAST		96		/* Must be equal largest errno */
+
+#ifdef _KERNEL
+/* pseudo-errors returned inside kernel to modify return to process */
+#define	ERESTART	(-1)		/* restart syscall */
+#define	EJUSTRETURN	(-2)		/* don't modify regs, just return */
+#define	ENOIOCTL	(-3)		/* ioctl not handled by this layer */
+#define	EDIRIOCTL	(-4)		/* do direct ioctl in GEOM */
+#endif
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable.  */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+#  if !defined _LIBC || defined _LIBC_REENTRANT
+/* When using threads, errno is a per-thread value.  */
+#   define errno (*__errno_location ())
+#  endif
+# endif /* !__ASSEMBLER__ */
+#endif /* _ERRNO_H */
+
+#if !defined _ERRNO_H && defined __need_Emath
+/* This is ugly but the kernel header is not clean enough.  We must
+   define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
+   defined.  */
+
+#define	EDOM		33		/* Numerical argument out of domain */
+#define	ERANGE		34		/* Result too large */
+#define	EILSEQ		86		/* Illegal byte sequence */
+
+#endif /* !_ERRNO_H && __need_Emath */
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/fcntl.h
@@ -0,0 +1,233 @@
+/* O_*, F_*, FD_* bit values for FreeBSD.
+   Copyright (C) 1991-1992, 1997-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <sys/types.h>
+#include <bits/wordsize.h>
+#ifdef __USE_GNU
+# include <bits/uio.h>
+#endif
+
+/*
+ * File status flags: these are used by open(2), fcntl(2).
+ * They are also used (indirectly) in the kernel file structure f_flags,
+ * which is a superset of the open/fcntl flags.  Open flags and f_flags
+ * are inter-convertible using OFLAGS(fflags) and FFLAGS(oflags).
+ * Open/fcntl flags begin with O_; kernel-internal flags begin with F.
+ */
+/* open-only flags */
+#define	O_RDONLY	0x0000		/* open for reading only */
+#define	O_WRONLY	0x0001		/* open for writing only */
+#define	O_RDWR		0x0002		/* open for reading and writing */
+#define	O_ACCMODE	0x0003		/* mask for above modes */
+
+/*
+ * Kernel encoding of open mode; separate read and write bits that are
+ * independently testable: 1 greater than the above.
+ */
+ 
+#define	O_NONBLOCK	0x0004		/* no delay */
+#define	O_NDELAY	O_NONBLOCK	/* compat */
+#define	O_APPEND	0x0008		/* set append mode */
+
+#if defined __USE_MISC
+#define	O_SHLOCK	0x0010		/* open with shared file lock */
+#define	O_EXLOCK	0x0020		/* open with exclusive file lock */
+#endif
+
+#define	O_ASYNC		0x0040		/* signal pgrp when data ready */
+#define	O_FSYNC		0x0080		/* synchronous writes */
+#define	O_SYNC		O_FSYNC		/* POSIX synonym for O_FSYNC */
+
+#if defined (__USE_XOPEN2K8) || defined (__USE_MISC)
+#define	O_NOFOLLOW	0x0100		/* don't follow symlinks */
+#endif
+
+#define	O_CREAT		0x0200		/* create if nonexistent */
+#define	O_TRUNC		0x0400		/* truncate to zero length */
+#define	O_EXCL		0x0800		/* error if already exists */
+/* Defined by POSIX 1003.1; BSD default, but must be distinct from O_RDONLY. */
+#define	O_NOCTTY	0x8000		/* don't assign controlling terminal */
+
+#if defined __USE_MISC
+/* Attempt to bypass buffer cache */
+#define	O_DIRECT	0x00010000
+enum { O_NOATIME = 0};          /* Do not set atime.  */
+#endif
+
+/* Defined by POSIX Extended API Set Part 2 */
+#if defined (__USE_XOPEN2K8) || defined (__USE_MISC)
+#define	O_DIRECTORY	0x00020000	/* Fail if not directory */
+#define	O_EXEC		0x00040000	/* Open for execute only */
+#endif
+
+#if defined (__USE_XOPEN2K8) || defined (__USE_MISC)
+/* Defined by POSIX 1003.1-2008; BSD default, but reserve for future use. */
+#define	O_TTY_INIT	0x00080000	/* Restore default termios attributes */
+#define	O_CLOEXEC	0x00100000
+#endif
+
+/* For now FreeBSD has synchronisity options for data and read operations.
+   We define the symbols here but let them do the same as O_SYNC since
+   this is a superset.	*/
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC	O_SYNC	/* Synchronize data.  */
+# define O_RSYNC	O_SYNC	/* Synchronize read operations.	 */
+#endif
+
+/* Since 'off_t' is 64-bit, O_LARGEFILE is a no-op.  */
+#define O_LARGEFILE	0
+
+#ifdef __USE_MISC
+/* Bits in the file status flags returned by F_GETFL.
+   These are all the O_* flags, plus FREAD and FWRITE, which are
+   independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was
+   given to `open'.  */
+#define FREAD		1
+#define	FWRITE		2
+#endif
+
+#ifdef __USE_ATFILE
+# define AT_FDCWD		-100	/* Special value used to indicate
+					   the *at functions should use the
+					   current working directory. */
+# define AT_EACCESS		0x100	/* Test access permitted for
+					   effective IDs, not real IDs.  */
+# define AT_SYMLINK_NOFOLLOW	0x200	/* Do not follow symbolic links.  */
+# define AT_SYMLINK_FOLLOW	0x400	/* Follow symbolic links.  */
+# define AT_REMOVEDIR		0x800	/* Remove directory instead of
+					   unlinking file.  */
+#endif
+
+/*
+ * We are out of bits in f_flag (which is a short).  However,
+ * the flag bits not set in FMASK are only meaningful in the
+ * initial open syscall.  Those bits can thus be given a
+ * different meaning for fcntl(2).
+ */
+#ifdef __USE_MISC
+/*
+ * Set by shm_open(3) to get automatic MAP_ASYNC behavior
+ * for POSIX shared memory objects (which are otherwise
+ * implemented as plain files).
+ */
+#define FRDAHEAD        O_CREAT
+#define FPOSIXSHM	O_NOFOLLOW
+#endif
+
+/* Values for the second argument to `fcntl'.  */
+#define F_DUPFD		0	/* Duplicate file descriptor.  */
+#define F_GETFD		1	/* Get file descriptor flags.  */
+#define F_SETFD		2	/* Set file descriptor flags.  */
+#define F_GETFL		3	/* Get file status flags.  */
+#define F_SETFL		4	/* Set file status flags.  */
+#define F_GETLK		11	/* Get record locking info.  */
+#define F_SETLK		12	/* Set record locking info (non-blocking).  */
+#define F_SETLKW	13	/* Set record locking info (blocking).	*/
+/* Not necessary, we always have 64-bit offsets.  */
+#define F_GETLK64	11	/* Get record locking info.  */
+#define F_SETLK64	12	/* Set record locking info (non-blocking).  */
+#define F_SETLKW64	13	/* Set record locking info (blocking).	*/
+
+#ifdef __USE_XOPEN2K8
+#define	F_DUPFD_CLOEXEC	17	/* Like F_DUPFD, but FD_CLOEXEC is set */
+#endif
+#if defined __USE_MISC
+#define F_DUP2FD_CLOEXEC 18	/* Like F_DUP2FD, but FD_CLOEXEC is set */
+#endif
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
+# define F_GETOWN	5	/* Get owner of socket (receiver of SIGIO).  */
+# define F_SETOWN	6	/* Set owner of socket (receiver of SIGIO).  */
+#endif
+
+/* For F_[GET|SET]FD.  */
+#define FD_CLOEXEC	1	/* actually anything with low bit set goes */
+
+/* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
+#define	F_RDLCK		1		/* shared or read lock */
+#define	F_UNLCK		2		/* unlock */
+#define	F_WRLCK		3		/* exclusive or write lock */
+#if defined __USE_MISC
+#define	F_UNLCKSYS	4		/* purge locks for a given system ID */ 
+#define	F_CANCEL	5		/* cancel an async lock request */
+#endif
+
+#ifdef __USE_MISC
+/* Operations for bsd flock(), also used by the kernel implementation.	*/
+# define LOCK_SH	1	/* shared lock */
+# define LOCK_EX	2	/* exclusive lock */
+# define LOCK_NB	4	/* or'd with one of the above to prevent
+				   blocking */
+# define LOCK_UN	8	/* remove lock */
+#endif
+
+struct flock
+  {
+    __off_t l_start;	/* Offset where the lock begins.  */
+    __off_t l_len;	/* Size of the locked area; zero means until EOF.  */
+    __pid_t l_pid;	/* Process holding the lock.  */
+    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/
+    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
+    int	__l_sysid;	/* remote system id or zero for local */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+  {
+    __off64_t l_start;	/* Offset where the lock begins.  */
+    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
+    __pid_t l_pid;	/* Process holding the lock.  */
+    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/
+    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
+    int	__l_sysid;	/* remote system id or zero for local */
+  };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+   BSD systems which did not managed to hide these kernel macros.  */
+#ifdef	__USE_MISC
+# define FAPPEND	O_APPEND
+# define FFSYNC		O_FSYNC
+# define FASYNC		O_ASYNC
+# define FNONBLOCK	O_NONBLOCK
+# define FNDELAY	O_NDELAY
+
+#define FCREAT		O_CREAT
+#define FEXCL		O_EXCL
+#define FTRUNC		O_TRUNC
+#define FNOCTTY		O_NOCTTY
+#define FSYNC		O_SYNC
+#endif /* Use BSD.  */
+
+
+#ifdef __USE_XOPEN2K
+/*
+ * Advice to posix_fadvise
+ */
+#define	POSIX_FADV_NORMAL	0	/* no special treatment */
+#define	POSIX_FADV_RANDOM	1	/* expect random page references */
+#define	POSIX_FADV_SEQUENTIAL	2	/* expect sequential page references */
+#define	POSIX_FADV_WILLNEED	3	/* will need these pages */
+#define	POSIX_FADV_DONTNEED	4	/* dont need these pages */
+#define	POSIX_FADV_NOREUSE	5	/* access data only once */
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/in.h
@@ -0,0 +1,310 @@
+/* Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* FreeBSD version.  */
+
+#ifndef _NETINET_IN_H
+# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
+#endif
+
+/* This is the FreeBSD version, do not assume a linux-based kernel.  */
+#define __USE_KERNEL_IPV6_DEFS 0
+
+/* Link numbers.  */
+#define	IMPLINK_IP		155
+#define	IMPLINK_LOWEXPER	156
+#define	IMPLINK_HIGHEXPER	158
+
+#define IPPROTO_DIVERT          258             /* divert pseudo-protocol */
+
+/* To select the IP level.  */
+#define SOL_IP	0
+
+/*
+ * Options for use with [gs]etsockopt at the IP level.
+ * First word of comment is data type; bool is stored in int.
+ */
+#define	IP_OPTIONS		1    /* buf/ip_opts; set/get IP options */
+#define	IP_HDRINCL		2    /* int; header is included with data */
+#define	IP_TOS			3    /* int; IP type of service and preced. */
+#define	IP_TTL			4    /* int; IP time to live */
+#define	IP_RECVOPTS		5    /* bool; receive all IP opts w/dgram */
+#define	IP_RECVRETOPTS		6    /* bool; receive IP opts for response */
+#define	IP_RECVDSTADDR		7    /* bool; receive IP dst addr w/dgram */
+#define	IP_SENDSRCADDR		IP_RECVDSTADDR /* cmsg_type to set src addr */
+#define	IP_RETOPTS		8    /* ip_opts; set/get IP options */
+#define	IP_MULTICAST_IF		9    /* struct in_addr *or* struct ip_mreqn;
+				      * set/get IP multicast i/f  */
+#define	IP_MULTICAST_TTL	10   /* u_char; set/get IP multicast ttl */
+#define	IP_MULTICAST_LOOP	11   /* u_char; set/get IP multicast loopback */
+#define	IP_ADD_MEMBERSHIP	12   /* ip_mreq; add an IP group membership */
+#define	IP_DROP_MEMBERSHIP	13   /* ip_mreq; drop an IP group membership */
+#define	IP_MULTICAST_VIF	14   /* set/get IP mcast virt. iface */
+#define	IP_RSVP_ON		15   /* enable RSVP in kernel */
+#define	IP_RSVP_OFF		16   /* disable RSVP in kernel */
+#define	IP_RSVP_VIF_ON		17   /* set RSVP per-vif socket */
+#define	IP_RSVP_VIF_OFF		18   /* unset RSVP per-vif socket */
+#define	IP_PORTRANGE		19   /* int; range to choose for unspec port */
+#define	IP_RECVIF		20   /* bool; receive reception if w/dgram */
+/* for IPSEC */
+#define	IP_IPSEC_POLICY		21   /* int; set/get security policy */
+#define	IP_FAITH		22   /* bool; accept FAITH'ed connections */
+
+#define	IP_ONESBCAST		23   /* bool: send all-ones broadcast */
+#define	IP_NONLOCALOK		24   /* bool: allow bind to spoof non-local addresses;
+					requires kernel compile option IP_NONLOCALBIND */
+
+#define	IP_FW_TABLE_ADD		40   /* add entry */
+#define	IP_FW_TABLE_DEL		41   /* delete entry */
+#define	IP_FW_TABLE_FLUSH	42   /* flush table */
+#define	IP_FW_TABLE_GETSIZE	43   /* get table size */
+#define	IP_FW_TABLE_LIST	44   /* list table contents */
+
+#define	IP_FW_ADD		50   /* add a firewall rule to chain */
+#define	IP_FW_DEL		51   /* delete a firewall rule from chain */
+#define	IP_FW_FLUSH		52   /* flush firewall rule chain */
+#define	IP_FW_ZERO		53   /* clear single/all firewall counter(s) */
+#define	IP_FW_GET		54   /* get entire firewall rule chain */
+#define	IP_FW_RESETLOG		55   /* reset logging counters */
+
+#define IP_FW_NAT_CFG           56   /* add/config a nat rule */
+#define IP_FW_NAT_DEL           57   /* delete a nat rule */
+#define IP_FW_NAT_GET_CONFIG    58   /* get configuration of a nat rule */
+#define IP_FW_NAT_GET_LOG       59   /* get log of a nat rule */
+
+#define	IP_DUMMYNET_CONFIGURE	60   /* add/configure a dummynet pipe */
+#define	IP_DUMMYNET_DEL		61   /* delete a dummynet pipe from chain */
+#define	IP_DUMMYNET_FLUSH	62   /* flush dummynet */
+#define	IP_DUMMYNET_GET		64   /* get entire dummynet pipes */
+
+#define	IP_RECVTTL		65   /* bool; receive IP TTL w/dgram */
+#define	IP_MINTTL		66   /* minimum TTL for packet or drop */
+#define	IP_DONTFRAG		67   /* don't fragment packet */
+
+/* IPv4 Source Filter Multicast API [RFC3678] */
+#define	IP_ADD_SOURCE_MEMBERSHIP	70   /* join a source-specific group */
+#define	IP_DROP_SOURCE_MEMBERSHIP	71   /* drop a single source */
+#define	IP_BLOCK_SOURCE			72   /* block a source */
+#define	IP_UNBLOCK_SOURCE		73   /* unblock a source */
+
+/* The following option is private; do not use it from user applications. */
+#define	IP_MSFILTER			74   /* set/get filter list */
+
+/* Protocol Independent Multicast API [RFC3678] */
+#define	MCAST_JOIN_GROUP		80   /* join an any-source group */
+#define	MCAST_LEAVE_GROUP		81   /* leave all sources for group */
+#define	MCAST_JOIN_SOURCE_GROUP		82   /* join a source-specific group */
+#define	MCAST_LEAVE_SOURCE_GROUP	83   /* leave a single source */
+#define	MCAST_BLOCK_SOURCE		84   /* block a source */
+#define	MCAST_UNBLOCK_SOURCE		85   /* unblock a source */
+
+/*
+ * Defaults and limits for options
+ */
+#define	IP_DEFAULT_MULTICAST_TTL  1	/* normally limit m'casts to 1 hop  */
+#define	IP_DEFAULT_MULTICAST_LOOP 1	/* normally hear sends if a member  */
+
+/*
+ * The imo_membership vector for each socket is now dynamically allocated at
+ * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized
+ * according to a power-of-two increment.
+ */
+#define	IP_MIN_MEMBERSHIPS	31
+#define	IP_MAX_MEMBERSHIPS	4095
+#define	IP_MAX_SOURCE_FILTER	1024	/* # of filters per socket, per group */
+
+/*
+ * Filter modes; also used to represent per-socket filter mode internally.
+ */
+ 
+#define MCAST_UNDEFINED 0       /* fmode: not yet defined */
+#define	MCAST_INCLUDE	1	/* fmode: include these source(s) */
+#define	MCAST_EXCLUDE	2	/* fmode: exclude these source(s) */
+
+/*
+ * Argument for IP_PORTRANGE:
+ * - which range to search when port is unspecified at bind() or connect()
+ */
+#define	IP_PORTRANGE_DEFAULT	0	/* default range */
+#define	IP_PORTRANGE_HIGH	1	/* "high" - request firewall bypass */
+#define	IP_PORTRANGE_LOW	2	/* "low" - vouchsafe security */
+
+/*
+ * Names for IP sysctl objects
+ */
+#define	IPCTL_FORWARDING	1	/* act as router */
+#define	IPCTL_SENDREDIRECTS	2	/* may send redirects when forwarding */
+#define	IPCTL_DEFTTL		3	/* default TTL */
+#ifdef notyet
+#define	IPCTL_DEFMTU		4	/* default MTU */
+#endif
+#define IPCTL_RTEXPIRE		5	/* cloned route expiration time */
+#define IPCTL_RTMINEXPIRE	6	/* min value for expiration time */
+#define IPCTL_RTMAXCACHE	7	/* trigger level for dynamic expire */
+#define	IPCTL_SOURCEROUTE	8	/* may perform source routes */
+#define	IPCTL_DIRECTEDBROADCAST	9	/* may re-broadcast received packets */
+#define IPCTL_INTRQMAXLEN	10	/* max length of netisr queue */
+#define	IPCTL_INTRQDROPS	11	/* number of netisr q drops */
+#define	IPCTL_STATS		12	/* ipstat structure */
+#define	IPCTL_ACCEPTSOURCEROUTE	13	/* may accept source routed packets */
+#define	IPCTL_FASTFORWARDING	14	/* use fast IP forwarding code */
+#define	IPCTL_KEEPFAITH		15	/* FAITH IPv4->IPv6 translater ctl */
+#define	IPCTL_GIF_TTL		16	/* default TTL for gif encap packet */
+#define	IPCTL_MAXID		17
+
+/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
+   The `ip_dst' field is used for the first-hop gateway when using a
+   source route (this gets put into the header proper).  */
+struct ip_opts
+  {
+    struct in_addr ip_dst;	/* First hop; zero without source route.  */
+    char ip_opts[40];		/* Actually variable in size.  */
+  };
+
+/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
+   The first word in the comment at the right is the data type used;
+   "bool" means a boolean value stored in an `int'.  */
+#define IPV6_SOCKOPT_RESERVED1	3  /* reserved for future use */
+#define IPV6_UNICAST_HOPS	4  /* int; IP6 hops */
+#define IPV6_MULTICAST_IF	9  /* u_int; set/get IP6 multicast i/f  */
+#define IPV6_MULTICAST_HOPS	10 /* int; set/get IP6 multicast hops */
+#define IPV6_MULTICAST_LOOP	11 /* u_int; set/get IP6 multicast loopback */
+#define IPV6_JOIN_GROUP		12 /* ip6_mreq; join a group membership */
+#define IPV6_LEAVE_GROUP	13 /* ip6_mreq; leave a group membership */
+#define IPV6_PORTRANGE		14 /* int; range to choose for unspec port */
+#define ICMP6_FILTER		18 /* icmp6_filter; icmp6 filter */
+
+#define IPV6_CHECKSUM		26 /* int; checksum offset for raw socket */
+#define IPV6_V6ONLY		27 /* bool; make AF_INET6 sockets v6 only */
+
+#define IPV6_IPSEC_POLICY	28 /* struct; get/set security policy */
+#define IPV6_FAITH		29 /* bool; accept FAITH'ed connections */
+
+#define IPV6_FW_ADD		30 /* add a firewall rule to chain */
+#define IPV6_FW_DEL		31 /* delete a firewall rule from chain */
+#define IPV6_FW_FLUSH		32 /* flush firewall rule chain */
+#define IPV6_FW_ZERO		33 /* clear single/all firewall counter(s) */
+#define IPV6_FW_GET		34 /* get entire firewall rule chain */
+#define IPV6_RTHDRDSTOPTS	35 /* ip6_dest; send dst option before rthdr */
+
+#define IPV6_RECVPKTINFO	36 /* bool; recv if, dst addr */
+#define IPV6_RECVHOPLIMIT	37 /* bool; recv hop limit */
+#define IPV6_RECVRTHDR		38 /* bool; recv routing header */
+#define IPV6_RECVHOPOPTS	39 /* bool; recv hop-by-hop option */
+#define IPV6_RECVDSTOPTS	40 /* bool; recv dst option after rthdr */
+
+#define IPV6_USE_MIN_MTU	42 /* bool; send packets at the minimum MTU */
+#define IPV6_RECVPATHMTU	43 /* bool; notify an according MTU */
+#define IPV6_PATHMTU		44 /* mtuinfo; get the current path MTU (sopt),
+				      4 bytes int; MTU notification (cmsg) */
+
+#define IPV6_PKTINFO		46 /* in6_pktinfo; send if, src addr */
+#define IPV6_HOPLIMIT		47 /* int; send hop limit */
+#define IPV6_NEXTHOP		48 /* sockaddr; next hop addr */
+#define IPV6_HOPOPTS		49 /* ip6_hbh; send hop-by-hop option */
+#define IPV6_DSTOPTS		50 /* ip6_dest; send dst option befor rthdr */
+#define IPV6_RTHDR		51 /* ip6_rthdr; send routing header */
+
+#define IPV6_RECVTCLASS		57 /* bool; recv traffic class values */
+
+#define IPV6_AUTOFLOWLABEL	59 /* bool; attach flowlabel automagically */
+
+#define IPV6_TCLASS		61 /* int; send traffic class value */
+#define IPV6_DONTFRAG		62 /* bool; disable IPv6 fragmentation */
+
+#define IPV6_PREFER_TEMPADDR	63 /* int; prefer temporary addresses as
+                                    * the source address.
+				    */
+
+/* Obsolete synonyms for the above.  */
+#define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
+#define IPV6_RXHOPOPTS		IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS		IPV6_DSTOPTS
+
+/* Socket level values for IPv6.  */
+#define SOL_IPV6	41
+#define SOL_ICMPV6	58
+
+/*
+ * Defaults and limits for options
+ */
+#define IPV6_DEFAULT_MULTICAST_HOPS 1   /* normally limit m'casts to 1 hop */
+#define IPV6_DEFAULT_MULTICAST_LOOP 1   /* normally hear sends if a member */
+
+/*
+ * Argument for IPV6_PORTRANGE:
+ * - which range to search when port is unspecified at bind() or connect()
+ */
+#define IPV6_PORTRANGE_DEFAULT  0       /* default range */
+#define IPV6_PORTRANGE_HIGH     1       /* "high" - request firewall bypass */
+#define IPV6_PORTRANGE_LOW      2       /* "low" - vouchsafe security */
+
+/* Routing header options for IPv6.  */
+#define IPV6_RTHDR_LOOSE	0	/* Hop doesn't need to be neighbour. */
+#define IPV6_RTHDR_STRICT	1	/* Hop must be a neighbour.  */
+
+#define IPV6_RTHDR_TYPE_0	0	/* IPv6 Routing header type 0.  */
+
+/*
+ * Names for IP sysctl objects
+ */
+#define IPV6CTL_FORWARDING	1	/* act as router */
+#define IPV6CTL_SENDREDIRECTS	2	/* may send redirects when forwarding*/
+#define IPV6CTL_DEFHLIM		3	/* default Hop-Limit */
+#define IPV6CTL_FORWSRCRT	5	/* forward source-routed dgrams */
+#define IPV6CTL_STATS		6	/* stats */
+#define IPV6CTL_MRTSTATS	7	/* multicast forwarding stats */
+#define IPV6CTL_MRTPROTO	8	/* multicast routing protocol */
+#define IPV6CTL_MAXFRAGPACKETS	9	/* max packets reassembly queue */
+#define IPV6CTL_SOURCECHECK	10	/* verify source route and intf */
+#define IPV6CTL_SOURCECHECK_LOGINT 11	/* minimume logging interval */
+#define IPV6CTL_ACCEPT_RTADV	12
+#define IPV6CTL_KEEPFAITH	13
+#define IPV6CTL_LOG_INTERVAL	14
+#define IPV6CTL_HDRNESTLIMIT	15
+#define IPV6CTL_DAD_COUNT	16
+#define IPV6CTL_AUTO_FLOWLABEL	17
+#define IPV6CTL_DEFMCASTHLIM	18
+#define IPV6CTL_GIF_HLIM	19	/* default HLIM for gif encap packet */
+#define IPV6CTL_KAME_VERSION	20
+#define IPV6CTL_USE_DEPRECATED	21	/* use deprecated addr (RFC2462 5.5.4) */
+#define IPV6CTL_RR_PRUNE	22	/* walk timer for router renumbering */
+#define IPV6CTL_V6ONLY		24
+#define IPV6CTL_RTEXPIRE	25	/* cloned route expiration time */
+#define IPV6CTL_RTMINEXPIRE	26	/* min value for expiration time */
+#define IPV6CTL_RTMAXCACHE	27	/* trigger level for dynamic expire */
+
+#define IPV6CTL_USETEMPADDR	32	/* use temporary addresses (RFC3041) */
+#define IPV6CTL_TEMPPLTIME	33	/* preferred lifetime for tmpaddrs */
+#define IPV6CTL_TEMPVLTIME	34	/* valid lifetime for tmpaddrs */
+#define IPV6CTL_AUTO_LINKLOCAL	35	/* automatic link-local addr assign */
+#define IPV6CTL_RIP6STATS	36	/* raw_ip6 stats */
+#define IPV6CTL_PREFER_TEMPADDR	37	/* prefer temporary addr as src */
+#define IPV6CTL_ADDRCTLPOLICY	38	/* get/set address selection policy */
+#define IPV6CTL_USE_DEFAULTZONE	39	/* use default scope zone */
+
+#define IPV6CTL_MAXFRAGS	41	/* max fragments */
+#define IPV6CTL_MCAST_PMTU	44	/* enable pMTU discovery for multicast? */
+
+/* New entries should be added here from current IPV6CTL_MAXID value. */
+/* to define items, should talk with KAME guys first, for *BSD compatibility */
+/* 42-44 is already used in KAME */
+#define IPV6CTL_STEALTH		45
+#define	ICMPV6CTL_ND6_ONLINKNSRFC4861	47
+#define IPV6CTL_MAXID		48
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/ioctl-types.h
@@ -0,0 +1,37 @@
+/* Structure types for pre-termios terminal ioctls.  FreeBSD version.
+   Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Many systems that have TIOCGWINSZ define TIOCGSIZE for source
+   compatibility with Sun; they define `struct ttysize' to have identical
+   layout as `struct winsize' and #define TIOCGSIZE to be TIOCGWINSZ
+   (likewise TIOCSSIZE and TIOCSWINSZ).  */
+/* struct ttysize is in FreeBSD originally defined in <sys/ioctl.h>,
+   which is replaced by GLIBC version -> define here */
+struct ttysize
+{
+  unsigned short int ts_lines;
+  unsigned short int ts_cols;
+  unsigned short int ts_xxx;
+  unsigned short int ts_yyy;
+};
+#define	_IOT_ttysize	_IOT_winsize
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/ioctls.h
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)ioctl.h	8.6 (Berkeley) 3/28/94
+ */
+
+#ifndef	_IOCTLS_H_
+#define	_IOCTLS_H_
+
+#include <sys/ioccom.h>
+
+#include <sys/ttycom.h>
+
+/*
+ *	@(#)ioctl.h	8.6 (Berkeley) 3/28/94
+ */
+
+#define	TIOCGSIZE	TIOCGWINSZ
+#define	TIOCSSIZE	TIOCSWINSZ
+
+#include <sys/filio.h>
+
+#include <sys/sockio.h>
+
+#endif /* !_IOCTLS_H_ */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/ipc.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 1995-1997, 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* create key if key does not exist */
+#define IPC_EXCL	02000		/* fail if key exists */
+#define IPC_NOWAIT	04000		/* return error on wait */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* remove identifier */
+#define IPC_SET		1		/* set `ipc_perm' options */
+#define IPC_STAT	2		/* get `ipc_perm' options */
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* private key */
+
+#ifdef __USE_MISC
+/* Common mode bits.  */
+# define IPC_R		0400		/* read permission, same as S_IRUSR */
+# define IPC_W		0200		/* write permission, same as S_IWUSR */
+# define IPC_M		0x1000		/* control permission */
+#endif
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+{
+    __uid_t		cuid;	/* creator user id */
+    __gid_t		cgid;	/* creator group id */
+    __uid_t		uid;	/* user id */
+    __gid_t		gid;	/* group id */
+    __mode_t		mode;	/* r/w permission */
+    __uint16_t		__seq;	/* sequence # (to generate unique ipcid) */
+    __key_t		__key;	/* user specified msg/sem/shm key */
+};
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/mman.h
@@ -0,0 +1,130 @@
+/* Definitions for POSIX memory map interface.  FreeBSD version.
+   Copyright (C) 1994-1998, 2000-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+#include <features.h>
+#include <stddef.h>
+
+/* Protections are chosen from these bits, OR'd together.  The
+   implementation does not necessarily support PROT_EXEC or PROT_WRITE
+   without PROT_READ.  The only guarantees are that no writing will be
+   allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define	PROT_NONE	 0x00	/* No access.  */
+#define	PROT_READ	 0x01	/* Pages can be read.  */
+#define	PROT_WRITE	 0x02	/* Pages can be written.  */
+#define	PROT_EXEC	 0x04	/* Pages can be executed.  */
+
+/* Flags contain mapping type, sharing type and options.  */
+
+/* Mapping type (must choose one and only one of these).  */
+#ifdef __USE_MISC
+# define MAP_FILE	 0x0000	/* Mapped from a file or device.  */
+# define MAP_ANON	 0x1000	/* Allocated from anonymous virtual memory.  */
+# define MAP_TYPE	 0x1000	/* Mask for type field.  */
+# ifdef __USE_MISC
+#  define MAP_ANONYMOUS  MAP_ANON /* Linux name. */
+# endif
+#endif
+
+/* Sharing types (must choose one and only one of these).  */
+#define	MAP_SHARED	 0x0001	/* Share changes.  */
+#define	MAP_PRIVATE	 0x0002	/* Changes private; copy pages on write.  */
+#ifdef __USE_MISC
+# define MAP_COPY MAP_PRIVATE	/* Virtual copy of region at mapping time.  */
+#endif
+
+/* Other flags.  */
+#define	MAP_FIXED	 0x0010	/* Map address must be exactly as requested. */
+#ifdef __USE_MISC
+#define MAP_RENAME	 0x0020 /* Sun: rename private pages to file */
+#define MAP_NORESERVE	 0x0040 /* Sun: don't reserve needed swap area */
+#define MAP_RESERVED0080 0x0080	/* previously misimplemented MAP_INHERIT */
+#define MAP_RESERVED0100 0x0100	/* previously unimplemented MAP_NOEXTEND */
+# define MAP_HASSEMPHORE 0x0200	/* Region may contain semaphores.  */
+# define MAP_STACK	 0x0400	/* Region grows down, like a stack.  */
+# define MAP_NOSYNC	 0x0800	/* Try to avoid flushing to the disk.  */
+# define MAP_NOCORE	0x20000	/* Don't include these pages in a core dump.  */
+#endif
+
+/* Advice to `madvise'.  */
+#ifdef __USE_MISC
+# define MADV_NORMAL	 0	/* No further special treatment.  */
+# define MADV_RANDOM	 1	/* Expect random page references.  */
+# define MADV_SEQUENTIAL 2	/* Expect sequential page references.  */
+# define MADV_WILLNEED	 3	/* Will need these pages.  */
+# define MADV_DONTNEED	 4	/* Don't need these pages.  */
+# define MADV_FREE	 5	/* Don't need these pages, they contain junk. */
+# define MADV_NOSYNC	 6	/* Try to avoid flushing to the disk.  */
+# define MADV_AUTOSYNC	 7	/* Use the default flushing strategy.  */
+# define MADV_NOCORE	 8	/* Don't include these pages in a core dump.  */
+# define MADV_CORE	 9	/* Include pages in a core dump (default).  */
+# define MADV_PROTECT	10	/* protect process from pageout kill */
+#endif
+
+/* The POSIX people had to invent similar names for the same things.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_MADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_MADV_SEQUENTIAL	2 /* Expect sequential page references.  */
+# define POSIX_MADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_MADV_DONTNEED	4 /* Don't need these pages.  */
+#endif
+
+/* Flags to `msync'.  */
+#define MS_ASYNC	1		/* Sync memory asynchronously.  */
+#define MS_SYNC		0		/* Synchronous memory sync.  */
+#define MS_INVALIDATE	2		/* Invalidate the caches.  */
+
+/* Flags for `mlockall' (can be OR'd together).  */
+#define MCL_CURRENT	1		/* Lock all currently mapped pages.  */
+#define MCL_FUTURE	2		/* Lock all additions to address
+					   space.  */
+
+/* Flags for 'minherit'.  */
+#ifdef __USE_MISC
+# define INHERIT_SHARE	0
+# define INHERIT_COPY	1
+# define INHERIT_NONE	2
+#endif
+
+
+/*
+ * Return bits from mincore
+ */
+#ifdef __USE_MISC
+#define	MINCORE_INCORE	 	 0x1 /* Page is incore */
+#define	MINCORE_REFERENCED	 0x2 /* Page has been referenced by us */
+#define	MINCORE_MODIFIED	 0x4 /* Page has been modified by us */
+#define	MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */
+#define	MINCORE_MODIFIED_OTHER	0x10 /* Page has been modified */
+#endif /* Use MISC */
+
+#ifdef __USE_MISC
+
+__BEGIN_DECLS
+
+extern int minherit (void *__addr, size_t __len, int __inherit);
+
+__END_DECLS
+
+#endif /* Use BSD */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/msq.h
@@ -0,0 +1,65 @@
+/* Copyright (C) 1995, 1997, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MSG_H
+#error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Define options for message queue functions.  */
+#define MSG_NOERROR	010000	/* no error if message is too big */
+
+/* Types used in the structure definition.  */
+typedef unsigned long int msgqnum_t;
+typedef unsigned long int msglen_t;
+
+
+/* Structure of record for one message inside the kernel.
+   The type `struct __msg' is opaque.  */
+struct msqid_ds
+{
+	struct	ipc_perm msg_perm;	/* msg queue permission bits */
+	void *__msg_first;		/* first message in the queue */
+	void *__msg_last;		/* last message in the queue */
+	msglen_t __msg_cbytes;	/* number of bytes in use on the queue */
+	msgqnum_t msg_qnum;	/* number of msgs in the queue */
+	msglen_t msg_qbytes;	/* max # of bytes on the queue */
+	__pid_t	msg_lspid;	/* pid of last msgsnd() */
+	__pid_t	msg_lrpid;	/* pid of last msgrcv() */
+	__time_t msg_stime;	/* time of last msgsnd() */
+	__time_t msg_rtime;	/* time of last msgrcv() */
+	__time_t msg_ctime;	/* time of last msgctl() */
+};
+
+#ifdef __USE_MISC
+
+# define msg_cbytes	__msg_cbytes
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo
+  {
+    int msgmax;
+    int msgmni;
+    int msgmnb;
+    int msgtql;
+    int msgssz;
+    int msgseg;
+  };
+
+#endif /* __USE_MISC */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/os-unistd.h
@@ -0,0 +1,8 @@
+
+__BEGIN_DECLS
+
+/* whether is current process tainted by uid or gid changes */
+extern int issetugid(void) __THROW;
+
+__END_DECLS
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/param.h
@@ -0,0 +1,189 @@
+/* Copyright (C) 1995,1996,1997,2000,2001,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_PARAM_H
+# error "Never use <bits/param.h> directly; include <sys/param.h> instead."
+#endif
+
+#include <limits.h>
+#include <sys/syslimits.h>
+
+/*
+ * __FreeBSD_version numbers are documented in the Porter's Handbook.
+ * If you bump the version for any reason, you should update the documentation
+ * there.
+ * Currently this lives here:
+ *
+ *      doc/en_US.ISO8859-1/books/porters-handbook/book.sgml
+ *
+ * scheme is:  <major><two digit minor><0 if release branch, otherwise 1>xx
+ */
+#include <osreldate.h>
+
+/* Some inet code expects that this file defines the 'u_int32_t' type.  */
+#include <stdint.h>
+
+/* FreeBSD code expects that this file implicitly defines SIG* macros.  */
+#include <signal.h>
+
+/*
+ * Machine-independent constants (some used in following include files).
+ * Redefined constants are from POSIX 1003.1 limits file.
+ *
+ * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
+ * MAXLOGNAME should be == UT_NAMESIZE+1 (see <utmp.h>)
+ */
+
+#define MAXCOMLEN       19              /* max command name remembered */
+#define MAXINTERP       32              /* max interpreter file name length */
+#define MAXLOGNAME      33              /* max login name length (incl. NUL) */
+#define MAXUPRC         CHILD_MAX       /* max simultaneous processes */
+#define NGROUPS         (NGROUPS_MAX+1) /* max number groups */
+#define MAXHOSTNAMELEN  256             /* max hostname size */
+#define SPECNAMELEN     63              /* max length of devicename */
+#define TTY_NAME_MAX	SPECNAMELEN
+
+/* BSD names for some <limits.h> values.  */
+
+#define	MAXSYMLINKS	32
+#define	CANBSIZ		MAX_CANON
+
+/* Machine type dependent parameters. */
+#include <machine/param.h>
+
+#ifndef BLKDEV_IOSIZE
+#define BLKDEV_IOSIZE	PAGE_SIZE        /* default block device I/O size */
+#endif
+#ifndef DFLTPHYS
+#define DFLTPHYS	(64 * 1024)     /* default max raw I/O transfer size */
+#endif
+#ifndef MAXPHYS
+#define MAXPHYS		(128 * 1024)    /* max raw I/O transfer size */
+#endif
+#ifndef MAXDUMPPGS
+#define MAXDUMPPGS	(DFLTPHYS/PAGE_SIZE)
+#endif
+
+/*
+ * Constants related to network buffer management.
+ * MCLBYTES must be no larger than PAGE_SIZE.
+ */
+#ifndef	MSIZE
+#define MSIZE		256		/* size of an mbuf */
+#endif	/* MSIZE */
+
+#ifndef	MCLSHIFT
+#define MCLSHIFT	11		/* convert bytes to mbuf clusters */
+#endif	/* MCLSHIFT */
+
+#define MCLBYTES	(1 << MCLSHIFT)	/* size of an mbuf cluster */
+
+/*
+ * Some macros for units conversion
+ */
+
+/* clicks to bytes */
+#ifndef ctob
+#define ctob(x)	((x)<<PAGE_SHIFT)
+#endif
+
+/* bytes to clicks */
+#ifndef btoc
+#define btoc(x)	(((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT)
+#endif
+
+/*
+ * btodb() is messy and perhaps slow because `bytes' may be an off_t.  We
+ * want to shift an unsigned type to avoid sign extension and we don't
+ * want to widen `bytes' unnecessarily.  Assume that the result fits in
+ * a daddr_t.
+ */
+#ifndef btodb
+#define btodb(bytes)	 		/* calculates (bytes / DEV_BSIZE) */ \
+	(sizeof (bytes) > sizeof(long) \
+	 ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \
+	 : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT))
+#endif
+
+#ifndef dbtob
+#define dbtob(db)			/* calculates (db * DEV_BSIZE) */ \
+	((off_t)(db) << DEV_BSHIFT)
+#endif
+
+#define	PRIMASK	0x0ff
+#define	PCATCH	0x100		/* OR'd with pri for tsleep to check signals */
+#define	PDROP	0x200	/* OR'd with pri to stop re-entry of interlock mutex */
+
+#define	NBPW	sizeof(int)	/* number of bytes per word (integer) */
+
+#define	CMASK	022		/* default file mask: S_IWGRP|S_IWOTH */
+
+#define	NODEV	(dev_t)(-1)	/* non-existent device */
+
+#define	CBLOCK	128		/* Clist block size, must be a power of 2. */
+#define CBQSIZE	(CBLOCK/NBBY)	/* Quote bytes/cblock - can do better. */
+				/* Data chars/clist. */
+#define	CBSIZE	(CBLOCK - sizeof(struct cblock *) - CBQSIZE)
+#define	CROUND	(CBLOCK - 1)	/* Clist rounding. */
+
+/*
+ * File system parameters and macros.
+ *
+ * MAXBSIZE -	Filesystems are made out of blocks of at most MAXBSIZE bytes
+ *		per block.  MAXBSIZE may be made larger without effecting
+ *		any existing filesystems as long as it does not exceed MAXPHYS,
+ *		and may be made smaller at the risk of not being able to use
+ *		filesystems which require a block size exceeding MAXBSIZE.
+ *
+ * BKVASIZE -	Nominal buffer space per buffer, in bytes.  BKVASIZE is the
+ *		minimum KVM memory reservation the kernel is willing to make.
+ *		Filesystems can of course request smaller chunks.  Actual
+ *		backing memory uses a chunk size of a page (PAGE_SIZE).
+ *
+ *		If you make BKVASIZE too small you risk seriously fragmenting
+ *		the buffer KVM map which may slow things down a bit.  If you
+ *		make it too big the kernel will not be able to optimally use
+ *		the KVM memory reserved for the buffer cache and will wind
+ *		up with too-few buffers.
+ *
+ *		The default is 16384, roughly 2x the block size used by a
+ *		normal UFS filesystem.
+ */
+#define MAXBSIZE	65536	/* must be power of 2 */
+#define BKVASIZE	16384	/* must be power of 2 */
+#define BKVAMASK	(BKVASIZE-1)
+
+/*
+ * Scale factor for scaled integers used to count %cpu time and load avgs.
+ *
+ * The number of CPU `tick's that map to a unique `%age' can be expressed
+ * by the formula (1 / (2 ^ (FSHIFT - 11))).  The maximum load average that
+ * can be calculated (assuming 32 bits) can be closely approximated using
+ * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).
+ *
+ * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
+ * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
+ */
+#define	FSHIFT	11		/* bits to right of fixed binary point */
+#define FSCALE	(1<<FSHIFT)
+
+#define dbtoc(db)			/* calculates devblks to pages */ \
+	((db + (ctodb(1) - 1)) >> (PAGE_SHIFT - DEV_BSHIFT))
+
+#define ctodb(db)			/* calculates pages to devblks */ \
+	((db) << (PAGE_SHIFT - DEV_BSHIFT))
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/poll.h
@@ -0,0 +1,62 @@
+/* Copyright (C) 1997, 2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for.  These bits may be set in `events'
+   to indicate the interesting event types; they will appear in `revents'
+   to indicate the status of the file descriptor.  */
+#define POLLIN		0x0001		/* There is data to read.  */
+#define POLLPRI		0x0002		/* There is urgent data to read.  */
+#define POLLOUT		0x0004		/* Writing now will not block.  */
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
+/* These values are defined in XPG4.2.  */
+# define POLLRDNORM	0x0040		/* Normal data may be read.  */
+# define POLLRDBAND	0x0080		/* Priority data may be read.  */
+# define POLLWRNORM	POLLOUT		/* Writing now will not block.  */
+# define POLLWRBAND	0x0100		/* Priority data may be written.  */
+#endif
+
+#ifdef __USE_MISC
+/* General FreeBSD extension (currently only supported for sockets): */
+# define POLLINIGNEOF	0x2000		/* like POLLIN, except ignore EOF */
+#endif
+
+/* Event types always implicitly polled for.  These bits need not be set in
+   `events', but they will appear in `revents' to indicate the status of
+   the file descriptor.  */
+#define POLLERR		0x0008		/* Error condition.  */
+#define POLLHUP		0x0010		/* Hung up.  */
+#define POLLNVAL	0x0020		/* Invalid polling request.  */
+
+#ifdef __USE_MISC
+
+# define POLLSTANDARD	(POLLIN|POLLPRI|POLLOUT|POLLRDNORM|POLLRDBAND|\
+			POLLWRBAND|POLLERR|POLLHUP|POLLNVAL)
+
+/*
+ * Request that poll() wait forever.
+ * XXX in SYSV, this is defined in stropts.h, which is not included
+ * by poll.h.
+ */
+#define INFTIM		(-1)
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/posix_opt.h
@@ -0,0 +1,92 @@
+/* Define POSIX options for FreeBSD.
+   Copyright (C) 1996-1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Never include this file directly; use <unistd.h> instead.
+ */
+
+#ifndef	_BITS_POSIX_OPT_H
+#define	_BITS_POSIX_OPT_H	1
+
+#include <bits/os-unistd.h> 
+
+/* Job control is supported.  */
+#define	_POSIX_JOB_CONTROL	1
+
+/* Processes have a saved set-user-ID and a saved set-group-ID.  */
+#define	_POSIX_SAVED_IDS	1
+
+/* Priority scheduling is supported.  */
+#define	_POSIX_PRIORITY_SCHEDULING	1
+
+/* Synchronizing file data is supported.  */
+#define	_POSIX_SYNCHRONIZED_IO	1
+
+/* The fsync function is present.  */
+#define	_POSIX_FSYNC	1
+
+/* Mapping of files to memory is supported.  */
+#define	_POSIX_MAPPED_FILES	1
+
+/* Locking of all memory is supported.  */
+#define	_POSIX_MEMLOCK	1
+
+/* Locking of ranges of memory is supported.  */
+#define	_POSIX_MEMLOCK_RANGE	1
+
+/* Setting of memory protections is supported.  */
+#define	_POSIX_MEMORY_PROTECTION	1
+
+/* Implementation supports `poll' function.  */
+#define	_POSIX_POLL	1
+
+/* Implementation supports `select' and `pselect' functions.  */
+#define	_POSIX_SELECT	1
+
+/* XPG4.2 shared memory is supported.  */
+#define	_XOPEN_SHM	1
+
+/* X/Open realtime support is available.  */
+#define _XOPEN_REALTIME	1
+
+/* Only root can change owner of file.  */
+#define	_POSIX_CHOWN_RESTRICTED	1
+
+/* `c_cc' member of 'struct termios' structure can be disabled by
+   using the value _POSIX_VDISABLE.  */
+#define	_POSIX_VDISABLE	((unsigned char)'\377')
+
+/* The LFS interface is available, except for the asynchronous I/O.  */
+#define _LFS_LARGEFILE		1
+#define _LFS64_LARGEFILE	1
+#define _LFS64_STDIO		1
+
+/* POSIX timers are available.  */
+#define _POSIX_TIMERS 1
+
+/* GNU libc provides regular expression handling.  */
+#define _POSIX_REGEXP	1
+
+/* We have a POSIX shell.  */
+#define _POSIX_SHELL	1
+
+/* The `spawn' function family is supported.  */
+#define _POSIX_SPAWN	200912L
+
+#endif /* bits/posix_opt.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/resource.h
@@ -0,0 +1,219 @@
+/* Bit values & structures for resource limits.  FreeBSD version.
+   Copyright (C) 1994, 1996-1998, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <sys/_types.h>
+
+/* Transmute defines to enumerations.  The macro re-definitions are
+   necessary because some programs want to test for operating system
+   features with #ifdef RUSAGE_SELF.  In ISO C the reflexive
+   definition is a no-op.
+
+   These are the values for FreeBSD.  Earlier BSD systems have a subset of
+   these kinds of resource limit.  */
+
+/* Kinds of resource limit.  */
+enum __rlimit_resource
+{
+  /* Per-process CPU limit, in seconds.  */
+  RLIMIT_CPU = 0,
+#define	RLIMIT_CPU RLIMIT_CPU
+
+  /* Largest file that can be created, in bytes.  */
+  RLIMIT_FSIZE = 1,
+#define	RLIMIT_FSIZE RLIMIT_FSIZE
+
+  /* Maximum size of data segment, in bytes.  */
+  RLIMIT_DATA = 2,
+#define	RLIMIT_DATA RLIMIT_DATA
+
+  /* Maximum size of stack segment, in bytes.  */
+  RLIMIT_STACK = 3,
+#define	RLIMIT_STACK RLIMIT_STACK
+
+  /* Largest core file that can be created, in bytes.  */
+  RLIMIT_CORE = 4,
+#define	RLIMIT_CORE RLIMIT_CORE
+
+  /* Largest resident set size, in bytes.
+     This affects swapping; processes that are exceeding their
+     resident set size will be more likely to have physical memory
+     taken from them.  */
+  __RLIMIT_RSS = 5,
+#define	RLIMIT_RSS __RLIMIT_RSS
+
+  /* Locked-in-memory address space.  */
+  __RLIMIT_MEMLOCK = 6,
+#define	RLIMIT_MEMLOCK __RLIMIT_MEMLOCK
+
+  /* Number of processes.  */
+  __RLIMIT_NPROC = 7,
+#define	RLIMIT_NPROC __RLIMIT_NPROC
+
+  /* Number of open files.  */
+  RLIMIT_NOFILE = 8,
+#define	RLIMIT_NOFILE RLIMIT_NOFILE
+
+  /* Maximum size of all socket buffers.  */
+  __RLIMIT_SBSIZE = 9,
+#define RLIMIT_SBSIZE __RLIMIT_SBSIZE
+
+  /* Address space limit.  */
+  RLIMIT_AS = 10,
+#define RLIMIT_AS RLIMIT_AS
+  RLIMIT_VMEM = RLIMIT_AS,
+
+  /* Pseudo-terminals.  */
+  RLIMIT_NPTS = 11,
+#define RLIMIT_NPTS RLIMIT_NPTS
+
+  /* Swap used.  */
+  RLIMIT_SWAP = 12,
+#define RLIMIT_SWAP RLIMIT_SWAP
+
+  __RLIMIT_NLIMITS = 13,
+  __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Value to indicate that there is no limit.  */
+#define RLIM_INFINITY 0x7fffffffffffffffLL
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY 0x7fffffffffffffffLL
+#endif
+
+
+/* Type for resource quantity measurement.  */
+typedef __rlim_t rlim_t;
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+struct rlimit
+  {
+    /* The current (soft) limit.  */
+    rlim_t rlim_cur;
+    /* The hard limit.  */
+    rlim_t rlim_max;
+  };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+  {
+    /* The current (soft) limit.  */
+    rlim64_t rlim_cur;
+    /* The hard limit.  */
+    rlim64_t rlim_max;
+ };
+#endif
+
+struct orlimit {
+	__int32_t	rlim_cur;	/* current (soft) limit */
+	__int32_t	rlim_max;	/* maximum value for rlim_cur */
+};
+
+struct loadavg {
+	__fixpt_t	ldavg[3];
+	long		fscale;
+};
+
+#define	CP_USER		0
+#define	CP_NICE		1
+#define	CP_SYS		2
+#define	CP_INTR		3
+#define	CP_IDLE		4
+#define	CPUSTATES	5
+
+/* Whose usage statistics do you want?  */
+enum __rusage_who
+{
+  /* The calling process.  */
+  RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+  /* All of its terminated child processes.  */
+  RUSAGE_CHILDREN = -1
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#include <bits/types/struct_timeval.h>
+
+/* Structure which says how much of each resource has been used.  */
+struct rusage
+  {
+    /* Total amount of user time used.  */
+    struct timeval ru_utime;
+    /* Total amount of system time used.  */
+    struct timeval ru_stime;
+    /* Maximum resident set size (in kilobytes).  */
+    long int ru_maxrss;
+    /* Amount of sharing of text segment memory
+       with other processes (kilobyte-seconds).  */
+    long int ru_ixrss;
+    /* Amount of data segment memory used (kilobyte-seconds).  */
+    long int ru_idrss;
+    /* Amount of stack memory used (kilobyte-seconds).  */
+    long int ru_isrss;
+    /* Number of soft page faults (i.e. those serviced by reclaiming
+       a page from the list of pages awaiting reallocation.  */
+    long int ru_minflt;
+    /* Number of hard page faults (i.e. those that required I/O).  */
+    long int ru_majflt;
+    /* Number of times a process was swapped out of physical memory.  */
+    long int ru_nswap;
+    /* Number of input operations via the file system.  Note: This
+       and `ru_oublock' do not include operations with the cache.  */
+    long int ru_inblock;
+    /* Number of output operations via the file system.  */
+    long int ru_oublock;
+    /* Number of IPC messages sent.  */
+    long int ru_msgsnd;
+    /* Number of IPC messages received.  */
+    long int ru_msgrcv;
+    /* Number of signals delivered.  */
+    long int ru_nsignals;
+    /* Number of voluntary context switches, i.e. because the process
+       gave up the process before it had to (usually to wait for some
+       resource to be available).  */
+    long int ru_nvcsw;
+    /* Number of involuntary context switches, i.e. a higher priority process
+       became runnable or the current process used up its time slice.  */
+    long int ru_nivcsw;
+  };
+
+/* Priority limits.  */
+#define PRIO_MIN	-20	/* Minimum priority a process can have.  */
+#define PRIO_MAX	20	/* Maximum priority a process can have.  */
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+   indicating what flavor of entity the WHO argument specifies.  */
+enum __priority_which
+{
+  PRIO_PROCESS = 0,		/* WHO is a process ID.  */
+#define PRIO_PROCESS PRIO_PROCESS
+  PRIO_PGRP = 1,		/* WHO is a process group ID.  */
+#define PRIO_PGRP PRIO_PGRP
+  PRIO_USER = 2			/* WHO is a user ID.  */
+#define PRIO_USER PRIO_USER
+};
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/sched.h
@@ -0,0 +1,183 @@
+/* Definitions of constants and data structure for POSIX 1003.1b-1993
+   scheduling interface.
+   Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef __need_schedparam
+
+#ifndef _SCHED_H
+# error "Never include <bits/sched.h> directly; use <sched.h> instead."
+#endif
+
+
+/* Scheduling algorithms.  */
+#define SCHED_OTHER	2
+#define SCHED_FIFO	1
+#define SCHED_RR	3
+
+
+#ifdef __USE_MISC
+/* Cloning flags.  */
+# define CSIGNAL       0x000000ff /* Signal mask to be sent at exit.  */
+# define CLONE_VM      0x00000100 /* Set if VM shared between processes.  */
+# define CLONE_FS      0x00000200 /* Set if fs info shared between processes.  */
+# define CLONE_FILES   0x00000400 /* Set if open files shared between processes.  */
+# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared.  */
+# define CLONE_PTRACE  0x00002000 /* Set if tracing continues on the child.  */
+# define CLONE_VFORK   0x00004000 /* Set if the parent wants the child to
+				     wake it up on mm_release.  */
+# define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
+#endif
+
+/* The official definition.  */
+struct sched_param
+  {
+    int __sched_priority;
+  };
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+/* Clone current process.  */
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+		  int __flags, void *__arg) __THROW;
+
+/* Unshare the specified resources.  */
+extern int unshare (int __flags) __THROW;
+
+/* Get index of currently used CPU.  */
+extern int sched_getcpu (void) __THROW;
+#endif
+
+__END_DECLS
+
+#endif	/* need schedparam */
+
+#if !defined __defined_schedparam \
+    && (defined __need_schedparam || defined _SCHED_H)
+# define __defined_schedparam	1
+/* Data structure to describe a process' schedulability.  */
+struct __sched_param
+  {
+    int __sched_priority;
+  };
+# undef __need_schedparam
+#endif
+
+
+#if defined _SCHED_H && !defined __cpu_set_t_defined
+# define __cpu_set_t_defined
+/* Size definition for CPU sets.  */
+# define __CPU_SETSIZE	128
+# define __NCPUBITS	(8 * sizeof (__cpu_mask))
+
+/* Type for array elements in 'cpu_set_t'.  */
+typedef unsigned long int __cpu_mask;
+
+/* Basic access functions.  */
+# define __CPUELT(cpu)	((cpu) / __NCPUBITS)
+# define __CPUMASK(cpu)	((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+
+/* Data structure to describe CPU mask.  */
+typedef struct
+{
+  __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
+} cpu_set_t;
+
+/* Access functions for CPU masks.  */
+# if __GNUC_PREREQ (2, 91)
+#  define __CPU_ZERO_S(setsize, cpusetp) \
+  do __builtin_memset (cpusetp, '\0', setsize); while (0)
+# else
+#  define __CPU_ZERO_S(setsize, cpusetp) \
+  do {									      \
+    size_t __i;								      \
+    size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+    __cpu_mask *__bits = (cpusetp)->__bits;				      \
+    for (__i = 0; __i < __imax; ++__i)					      \
+      __bits[__i] = 0;							      \
+  } while (0)
+# endif
+# define __CPU_SET_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
+	 |= __CPUMASK (__cpu))						      \
+      : 0; }))
+# define __CPU_CLR_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
+	 &= ~__CPUMASK (__cpu))						      \
+      : 0; }))
+# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
+  (__extension__							      \
+   ({ size_t __cpu = (cpu);						      \
+      __cpu < 8 * (setsize)						      \
+      ? ((((__const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]	      \
+	  & __CPUMASK (__cpu))) != 0					      \
+      : 0; }))
+
+# define __CPU_COUNT_S(setsize, cpusetp) \
+  __sched_cpucount (setsize, cpusetp)
+
+# if __GNUC_PREREQ (2, 91)
+#  define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+  (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0)
+# else
+#  define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+  (__extension__							      \
+   ({ __const __cpu_mask *__arr1 = (cpusetp1)->__bits;				      \
+      __const __cpu_mask *__arr2 = (cpusetp2)->__bits;				      \
+      size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+      size_t __i;							      \
+      for (__i = 0; __i < __imax; ++__i)				      \
+	if (__bits[__i] != __bits[__i])					      \
+	  break;							      \
+      __i == __imax; }))
+# endif
+
+# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
+  (__extension__							      \
+   ({ cpu_set_t *__dest = (destset);					      \
+      __const __cpu_mask *__arr1 = (srcset1)->__bits;				      \
+      __const __cpu_mask *__arr2 = (srcset2)->__bits;				      \
+      size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
+      size_t __i;							      \
+      for (__i = 0; __i < __imax; ++__i)				      \
+	((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i];    \
+      __dest; }))
+
+# define __CPU_ALLOC_SIZE(count) \
+  ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask))
+# define __CPU_ALLOC(count) __sched_cpualloc (count)
+# define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
+
+__BEGIN_DECLS
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+  __THROW;
+extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
+extern void __sched_cpufree (cpu_set_t *__set) __THROW;
+
+__END_DECLS
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/sem.h
@@ -0,0 +1,93 @@
+/* Copyright (C) 1995-1998, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		4		/* get sempid */
+#define GETVAL		5		/* get semval */
+#define GETALL		6		/* get all semval's */
+#define GETNCNT		3		/* get semncnt */
+#define GETZCNT		7		/* get semzcnt */
+#define SETVAL		8		/* set semval */
+#define SETALL		9		/* set all semval's */
+
+#ifdef __USE_MISC
+# define SEM_R		IPC_R		/* read permission for user */
+# define SEM_A		IPC_W		/* alter permission for user */
+#endif
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds 
+{
+    struct ipc_perm	sem_perm;	/* operation permission struct */
+    void		*__sem_base;	/* pointer to first semaphore in set */
+    unsigned short	sem_nsems;	/* number of sems in set */
+    __time_t		sem_otime;	/* last operation time */
+    __time_t		sem_ctime;	/* last change time */
+    					/* Times measured in secs since */
+    					/* 00:00:00 GMT, Jan. 1, 1970 */
+};
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
+
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+# define SEM_STAT 10
+# define SEM_INFO 11
+
+/*
+ * semaphore info struct
+ */
+struct seminfo {
+        int     semmap,         /* # of entries in semaphore map */
+                semmni,         /* # of semaphore identifiers */
+                semmns,         /* # of semaphores in system */
+                semmnu,         /* # of undo structures in system */
+                semmsl,         /* max # of semaphores per id */
+                semopm,         /* max # of operations per semop call */
+                semume,         /* max # of undo entries per process */
+                semusz,         /* size in bytes of undo structure */
+                semvmx,         /* semaphore maximum value */
+                semaem;         /* adjust on exit max value */
+};
+
+#endif
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/shm.h
@@ -0,0 +1,89 @@
+/* Copyright (C) 1995-1997, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Permission flag for shmget.  */
+#ifdef __USE_MISC
+# define SHM_R		IPC_R		/* read permission for user */
+# define SHM_W		IPC_W		/* write permission for user */
+#endif
+
+/* Flags for `shmat'.  */
+#define SHM_RDONLY	010000		/* attach read-only else read-write */
+#define SHM_RND		020000		/* round attach address to SHMLBA */
+
+/* Commands for `shmctl'.  */
+#define SHM_LOCK	11		/* lock segment (root only) */
+#define SHM_UNLOCK	12		/* unlock segment (root only) */
+
+__BEGIN_DECLS
+
+/* Segment low boundary address multiple.  */
+#define SHMLBA		(__getpagesize ())
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Type to count number of attaches.  */
+typedef int shmatt_t;
+
+/* Data structure describing a set of semaphores.  */
+struct shmid_ds
+  {
+    struct ipc_perm shm_perm;		/* operation permission struct */
+    size_t shm_segsz;			/* size of segment in bytes */
+    __pid_t shm_lpid;			/* pid of last shmop */
+    __pid_t shm_cpid;			/* pid of creator */
+    shmatt_t shm_nattch;		/* number of current attaches */
+    __time_t shm_atime;			/* time of last shmat() */
+    __time_t shm_dtime;			/* time of last shmdt() */
+    __time_t shm_ctime;			/* time of last change by shmctl() */
+  };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT 	13
+# define SHM_INFO 	14
+
+struct shminfo
+  {
+        int     shmmax,         /* max shared memory segment size (bytes) */
+                shmmin,         /* min shared memory segment size (bytes) */
+                shmmni,         /* max number of shared memory identifiers */
+                shmseg,         /* max shared memory segments per process */
+                shmall;         /* max amount of shared memory (pages) */
+  };
+
+struct shm_info
+  {
+    int used_ids;
+    unsigned long int shm_tot;	/* total allocated shm */
+    unsigned long int shm_rss;	/* total resident shm */
+    unsigned long int shm_swp;	/* total swapped shm */
+    unsigned long int swap_attempts;
+    unsigned long int swap_successes;
+  };
+
+#endif /* __USE_MISC */
+
+__END_DECLS
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/sigaction.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 1991-1992,1996-1998,2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* These definitions match those used by the FreeBSD kernel.  */
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction
+  {
+    /* Signal handler.  */
+#ifdef __USE_POSIX199309
+    union
+      {
+	/* Used if SA_SIGINFO is not set.  */
+	__sighandler_t sa_handler;
+	/* Used if SA_SIGINFO is set.  */
+	void (*sa_sigaction) (int, siginfo_t *, void *);
+      }
+    __sigaction_handler;
+# define sa_handler	__sigaction_handler.sa_handler
+# define sa_sigaction	__sigaction_handler.sa_sigaction
+#else
+    __sighandler_t sa_handler;
+#endif
+
+    /* Special flags.  */
+    int sa_flags;
+
+    /* Additional set of signals to be blocked.  */
+    __sigset_t sa_mask;
+  };
+
+/* Bits in `sa_flags'.  */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK	0x0001	/* Take signal on signal stack.  */
+# define SA_RESTART	0x0002	/* Restart syscall on signal return.  */
+# define SA_RESETHAND	0x0004	/* Reset to SIG_DFL on entry to handler.  */
+# define SA_NODEFER	0x0010	/* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_NOCLDWAIT	0x0020	/* Don't save zombie processes.  */
+# define SA_SIGINFO	0x0040	/* Provide additional info to the handler.  */
+#endif
+#define	SA_NOCLDSTOP	0x0008	/* Don't send SIGCHLD when children stop.  */
+
+#ifdef __USE_MISC
+# define SA_INTERRUPT	0	/* Historical no-op ("not SA_RESTART").  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define	SIG_BLOCK	1	/* Block signals.  */
+#define	SIG_UNBLOCK	2	/* Unblock signals.  */
+#define	SIG_SETMASK	3	/* Set the set of blocked signals.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/siginfo.h
@@ -0,0 +1,282 @@
+/* siginfo_t, sigevent and constants.  FreeBSD version.
+   Copyright (C) 1997-1998, 2000-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t 1
+
+/* Type for data associated with a signal.  */
+typedef union sigval
+  {
+    int sival_int;
+    void *sival_ptr;
+  } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
+
+#include <bits/types.h>		/* __pid_t, __uid_t */
+
+typedef struct siginfo
+  {
+    int si_signo;		/* Signal number.  */
+    int si_errno;		/* If non-zero, an errno value associated with
+				   this signal, as defined in <errno.h>.  */
+    int si_code;		/* Signal code.  */
+    __pid_t si_pid;		/* Sending process ID.  */
+    __uid_t si_uid;		/* Real user ID of sending process.  */
+    int si_status;		/* Exit value or signal.  */
+    void *si_addr;		/* Address of faulting instruction.  */
+    union sigval si_value;	/* Signal value.  */
+    union
+      {
+	struct
+	  {
+	    int     _trapno;	/* machine specific trap code */
+	   } _fault;
+
+	/* POSIX.1b timers.  */
+	struct
+	  {
+	    int     _timerid;
+	    int     _overrun;
+	  } _timer;
+
+	struct
+	  {
+	    int     _mqd;
+	  } _mesgq;
+
+	/* SIGPOLL.  */
+	struct
+	  {
+	    long    _band;	/* band event for SIGPOLL.  */
+	  } _poll;
+
+	struct
+	  {
+	    long    __spare1__;
+	    int     __spare2__[7];
+	  } __spare__;
+	} _reason;
+  } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names.  */
+# define si_int		si_value.sival_int
+# define si_ptr		si_value.sival_ptr
+# define si_trapno	_reason._fault._trapno
+# define si_timerid	_reason._timer._timerid
+# define si_overrun	_reason._timer._overrun
+# define si_mqd		_reason._mesgq._mqd
+# define si_band	_reason._poll._band
+
+
+/* Values for `si_code'.  Positive values are reserved for kernel-generated
+   signals.  */
+enum
+{
+  SI_ASYNCIO = 0x10004,		/* Sent by AIO completion.  */
+# define SI_ASYNCIO	SI_ASYNCIO
+  SI_MESGQ = 0x10005,		/* Sent by real time mesq state change.  */
+# define SI_MESGQ	SI_MESGQ
+  SI_TIMER = 0x10003,		/* Sent by timer expiration.  */
+# define SI_TIMER	SI_TIMER
+  SI_QUEUE = 0x10002,		/* Sent by sigqueue.  */
+# define SI_QUEUE	SI_QUEUE
+  SI_USER = 0x10001,		/* Sent by kill, sigsend, raise.  */
+# define SI_USER	SI_USER
+  SI_KERNEL = 0x10006,
+# define SI_KERNEL	SI_KERNEL
+  SI_LWP = 0x10007,		/* Sent by thr_kill.  */
+# define SI_LWP		SI_LWP
+  SI_UNDEFINED = 0
+# define SI_UNDEFINED	SI_UNDEFINED
+};
+
+/* `si_code' values for SIGILL signal.  */
+enum
+{
+  ILL_ILLOPC = 1,		/* Illegal opcode.  */
+# define ILL_ILLOPC	ILL_ILLOPC
+  ILL_ILLOPN,			/* Illegal operand.  */
+# define ILL_ILLOPN	ILL_ILLOPN
+  ILL_ILLADR,			/* Illegal addressing mode.  */
+# define ILL_ILLADR	ILL_ILLADR
+  ILL_ILLTRP,			/* Illegal trap. */
+# define ILL_ILLTRP	ILL_ILLTRP
+  ILL_PRVOPC,			/* Privileged opcode.  */
+# define ILL_PRVOPC	ILL_PRVOPC
+  ILL_PRVREG,			/* Privileged register.  */
+# define ILL_PRVREG	ILL_PRVREG
+  ILL_COPROC,			/* Coprocessor error.  */
+# define ILL_COPROC	ILL_COPROC
+  ILL_BADSTK			/* Internal stack error.  */
+# define ILL_BADSTK	ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal.  */
+enum
+{
+  FPE_INTOVF = 1,		/* Integer overflow.  */
+# define FPE_INTOVF	FPE_INTOVF
+  FPE_INTDIV,			/* Integer divide by zero.  */
+# define FPE_INTDIV	FPE_INTDIV
+  FPE_FLTDIV,			/* Floating point divide by zero.  */
+# define FPE_FLTDIV	FPE_FLTDIV
+  FPE_FLTOVF,			/* Floating point overflow.  */
+# define FPE_FLTOVF	FPE_FLTOVF
+  FPE_FLTUND,			/* Floating point underflow.  */
+# define FPE_FLTUND	FPE_FLTUND
+  FPE_FLTRES,			/* Floating point inexact result.  */
+# define FPE_FLTRES	FPE_FLTRES
+  FPE_FLTINV,			/* Floating point invalid operation.  */
+# define FPE_FLTINV	FPE_FLTINV
+  FPE_FLTSUB			/* Subscript out of range.  */
+# define FPE_FLTSUB	FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal.  */
+enum
+{
+  SEGV_MAPERR = 1,		/* Address not mapped to object.  */
+# define SEGV_MAPERR	SEGV_MAPERR
+  SEGV_ACCERR			/* Invalid permissions for mapped object.  */
+# define SEGV_ACCERR	SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal.  */
+enum
+{
+  BUS_ADRALN = 1,		/* Invalid address alignment.  */
+# define BUS_ADRALN	BUS_ADRALN
+  BUS_ADRERR,			/* Non-existant physical address.  */
+# define BUS_ADRERR	BUS_ADRERR
+  BUS_OBJERR			/* Object specific hardware error.  */
+# define BUS_OBJERR	BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal.  */
+enum
+{
+  TRAP_BRKPT = 1,		/* Process breakpoint.  */
+# define TRAP_BRKPT	TRAP_BRKPT
+  TRAP_TRACE			/* Process trace trap.  */
+# define TRAP_TRACE	TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal.  */
+/* XXX These are only used by the waitid() function, not by the kernel.  */
+enum
+{
+  CLD_EXITED = 1,		/* Child has exited.  */
+# define CLD_EXITED	CLD_EXITED
+  CLD_KILLED,			/* Child was killed.  */
+# define CLD_KILLED	CLD_KILLED
+  CLD_DUMPED,			/* Child terminated abnormally.  */
+# define CLD_DUMPED	CLD_DUMPED
+  CLD_TRAPPED,			/* Traced child has trapped.  */
+# define CLD_TRAPPED	CLD_TRAPPED
+  CLD_STOPPED,			/* Child has stopped.  */
+# define CLD_STOPPED	CLD_STOPPED
+  CLD_CONTINUED			/* Stopped child has continued.  */
+# define CLD_CONTINUED	CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal.  */
+enum
+{
+  POLL_IN = 1,			/* Data input available.  */
+# define POLL_IN	POLL_IN
+  POLL_OUT,			/* Output buffers available.  */
+# define POLL_OUT	POLL_OUT
+  POLL_MSG,			/* Input message available.   */
+# define POLL_MSG	POLL_MSG
+  POLL_ERR,			/* I/O error.  */
+# define POLL_ERR	POLL_ERR
+  POLL_PRI,			/* High priority input available.  */
+# define POLL_PRI	POLL_PRI
+  POLL_HUP			/* Device disconnected.  */
+# define POLL_HUP	POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
+
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
+# define __have_sigevent_t	1
+
+#include <sys/_types.h>		/* __lwpid_t */
+
+/* Forward declaration.  */
+# ifndef __have_pthread_attr_t
+typedef union pthread_attr_t pthread_attr_t;
+#  define __have_pthread_attr_t 1
+# endif
+
+/* Structure to transport application-defined values with signals.  */
+
+typedef struct sigevent
+  {
+    int sigev_notify;
+    int sigev_signo;
+    sigval_t sigev_value;
+    union
+    {
+      __lwpid_t threadid;
+      struct
+      {
+	void (*_function) (sigval_t);	/* Function to start.  */
+	pthread_attr_t *_attribute;	/* Really pthread_attr_t.  */
+      } _sigev_thread;
+    } _sigev_un;
+  } sigevent_t;
+
+#define sigev_notify_kqueue	sigev_signo
+#define sigev_notify_function   _sigev_un._sigev_thread._function
+#define sigev_notify_attributes	_sigev_un._sigev_thread._attribute
+#define sigev_notify_thread_id	_sigev_un.threadid
+
+/* `sigev_notify' values.  */
+enum
+{
+  SIGEV_SIGNAL = 1,		/* Notify via signal.  */
+# define SIGEV_SIGNAL	SIGEV_SIGNAL
+  SIGEV_NONE = 0,		/* Other notification: meaningless.  */
+# define SIGEV_NONE	SIGEV_NONE
+  /* Not yet supported by the kernel.  */
+  SIGEV_THREAD = 2,		/* Deliver via thread creation.  */
+# define SIGEV_THREAD	SIGEV_THREAD
+  SIGEV_KEVENT = 3,
+# define SIGEV_KEVENT	SIGEV_KEVENT
+  SIGEV_THREAD_ID = 4,
+# define SIGEV_THREAD_ID	SIGEV_THREAD_ID
+};
+
+#endif	/* have _SIGNAL_H.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/signum.h
@@ -0,0 +1,84 @@
+/* Signal number definitions.  FreeBSD version.
+   Copyright (C) 1991-1993, 1996, 1998, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifdef	_SIGNAL_H
+
+/* This file defines the fake signal functions and signal
+   number constants for 4.2 or 4.3 BSD-derived Unix system.  */
+
+/* Fake signal functions.  */
+#define	SIG_ERR	((__sighandler_t) -1) /* Error return.  */
+#define	SIG_DFL	((__sighandler_t) 0) /* Default action.  */
+#define	SIG_IGN	((__sighandler_t) 1) /* Ignore signal.  */
+
+#define	SIG_CATCH ((__sighandler_t) 2) /* FreeBSD specific ? */
+#define	SIG_HOLD  ((__sighandler_t) 3) /* Add signal to hold mask.  */
+
+/* Signals.  */
+#define	SIGHUP		1	/* Hangup (POSIX).  */
+#define	SIGINT		2	/* Interrupt (ANSI).  */
+#define	SIGQUIT		3	/* Quit (POSIX).  */
+#define	SIGILL		4	/* Illegal instruction (ANSI).  */
+#define	SIGABRT		SIGIOT	/* Abort (ANSI).  */
+#define	SIGTRAP		5	/* Trace trap (POSIX).  */
+#define	SIGIOT		6	/* IOT trap (4.2 BSD).  */
+#define	SIGEMT		7	/* EMT trap (4.2 BSD).  */
+#define	SIGFPE		8	/* Floating-point exception (ANSI).  */
+#define	SIGKILL		9	/* Kill, unblockable (POSIX).  */
+#define	SIGBUS		10	/* Bus error (4.2 BSD).  */
+#define	SIGSEGV		11	/* Segmentation violation (ANSI).  */
+#define	SIGSYS		12	/* Bad argument to system call (4.2 BSD).  */
+#define	SIGPIPE		13	/* Broken pipe (POSIX).  */
+#define	SIGALRM		14	/* Alarm clock (POSIX).  */
+#define	SIGTERM		15	/* Termination (ANSI).  */
+#define	SIGURG		16	/* Urgent condition on socket (4.2 BSD).  */
+#define	SIGSTOP		17	/* Stop, unblockable (POSIX).  */
+#define	SIGTSTP		18	/* Keyboard stop (POSIX).  */
+#define	SIGCONT		19	/* Continue (POSIX).  */
+#define	SIGCHLD		20	/* Child status has changed (POSIX).  */
+#define	SIGCLD		SIGCHLD	/* Same as SIGCHLD (System V).  */
+#define	SIGTTIN		21	/* Background read from tty (POSIX).  */
+#define	SIGTTOU		22	/* Background write to tty (POSIX).  */
+#define	SIGIO		23	/* I/O now possible (4.2 BSD).  */
+#define	SIGPOLL		SIGIO	/* Pollable event occurred (System V).  */
+#define	SIGXCPU		24	/* CPU limit exceeded (4.2 BSD).  */
+#define	SIGXFSZ		25	/* File size limit exceeded (4.2 BSD).  */
+#define	SIGVTALRM	26	/* Virtual alarm clock (4.2 BSD).  */
+#define	SIGPROF		27	/* Profiling alarm clock (4.2 BSD).  */
+#define	SIGWINCH	28	/* Window size change (4.3 BSD, Sun).  */
+#define SIGINFO		29	/* Information request (4.4 BSD).  */
+#define	SIGUSR1		30	/* User-defined signal 1 (POSIX).  */
+#define	SIGUSR2		31	/* User-defined signal 2 (POSIX).  */
+/* Signals 32 and 33 are reserved for system libraries. */
+
+/* Signal 34 is used (but not reserved) by thread library.
+   See PTHREAD_SIGBASE in kernel-features.h.  */
+
+#define	_NSIG		129	/* Biggest signal number + 1
+				   (including real-time signals).  */
+
+#define SIGRTMIN	(__libc_current_sigrtmin ())
+#define SIGRTMAX	(__libc_current_sigrtmax ())
+
+/* These are the hard limits of the kernel.  These values should not be
+   used directly at user level.  */
+#define __SIGRTMIN	65	/* be in sync with FreeBSD kernel */
+#define __SIGRTMAX	126	/* be in sync with FreeBSD kernel */
+
+#endif	/* <signal.h> included.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/sigset.h
@@ -0,0 +1,140 @@
+/* __sig_atomic_t, __sigset_t, and related definitions.  FreeBSD version.
+   Copyright (C) 1994-1996, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SIGSET_H_types
+# define _SIGSET_H_types	1
+
+typedef int __sig_atomic_t;
+
+/* A `sigset_t' has a bit for each signal.  */
+__extension__ typedef struct
+  {
+    __extension__ union
+      {
+        unsigned int __sigbits[4];
+        unsigned int __bits[4];
+      };
+  } __sigset_t;
+
+#endif
+
+
+/* We only want to define these functions if <signal.h> was actually
+   included; otherwise we were included just to define the types.  Since we
+   are namespace-clean, it wouldn't hurt to define extra macros.  But
+   trouble can be caused by functions being defined (e.g., any global
+   register vars declared later will cause compilation errors).  */
+
+#if !defined _SIGSET_H_fns && defined _SIGNAL_H
+# define _SIGSET_H_fns 1
+
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE __extern_inline
+# endif
+
+/* Return a mask that includes the bit for SIG only.  */
+# define __sigmask(sig)	((unsigned int) 1 << ((sig) - 1) % 32)
+
+/* Return the word index for SIG.  */
+# define __sigword(sig)	(((sig) - 1) >> 5)
+
+# if defined __GNUC__ && __GNUC__ >= 2
+#  define __sigemptyset(set) \
+  (__extension__ ({ sigset_t *__set = (set);				      \
+		    __set->__sigbits[0] = 0; __set->__sigbits[1] = 0;	      \
+		    __set->__sigbits[2] = 0; __set->__sigbits[3] = 0;	      \
+		    0; }))
+#  define __sigfillset(set) \
+  (__extension__ ({ sigset_t *__set = (set);				      \
+		    __set->__sigbits[0] = ~0; __set->__sigbits[1] = ~0;	      \
+		    __set->__sigbits[2] = ~0; __set->__sigbits[3] = ~0;	      \
+		    0; }))
+
+#  ifdef __USE_GNU
+/* The POSIX does not specify for handling the whole signal set in one
+   command.  This is often wanted and so we define three more functions
+   here.  */
+#   define __sigisemptyset(set) \
+  (__extension__ ({ const sigset_t *__set = (set);			      \
+		    __set->__sigbits[0] == 0				      \
+		    && __set->__sigbits[1] == 0				      \
+		    && __set->__sigbits[2] == 0				      \
+		    && __set->__sigbits[3] == 0; }))
+#   define __sigandset(dest, left, right) \
+  (__extension__ ({ sigset_t *__dest = (dest);				      \
+		    const sigset_t *__left = (left);			      \
+		    const sigset_t *__right = (right);			      \
+		    __dest->__sigbits[0] =				      \
+		      __left->__sigbits[0] & __right->__sigbits[0];	      \
+		    __dest->__sigbits[1] =				      \
+		      __left->__sigbits[1] & __right->__sigbits[1];	      \
+		    __dest->__sigbits[2] =				      \
+		      __left->__sigbits[2] & __right->__sigbits[2];	      \
+		    __dest->__sigbits[3] =				      \
+		      __left->__sigbits[3] & __right->__sigbits[3];	      \
+		    0; }))
+#   define __sigorset(dest, left, right) \
+  (__extension__ ({ sigset_t *__dest = (dest);				      \
+		    const sigset_t *__left = (left);			      \
+		    const sigset_t *__right = (right);			      \
+		    __dest->__sigbits[0] =				      \
+		      __left->__sigbits[0] | __right->__sigbits[0];	      \
+		    __dest->__sigbits[1] =				      \
+		      __left->__sigbits[1] | __right->__sigbits[1];	      \
+		    __dest->__sigbits[2] =				      \
+		      __left->__sigbits[2] | __right->__sigbits[2];	      \
+		    __dest->__sigbits[3] =				      \
+		      __left->__sigbits[3] | __right->__sigbits[3];	      \
+		    0; }))
+#  endif
+# endif
+
+/* These functions needn't check for a bogus signal number -- error
+   checking is done in the non __ versions.  */
+
+extern int __sigismember (__const __sigset_t *, int);
+extern int __sigaddset (__sigset_t *, int);
+extern int __sigdelset (__sigset_t *, int);
+
+# ifdef __USE_EXTERN_INLINES
+
+_EXTERN_INLINE int
+__sigismember (__const __sigset_t *__set, int __sig)
+{
+  return (__set->__sigbits[__sigword (__sig)] & __sigmask (__sig) ? 1 : 0);
+}
+
+_EXTERN_INLINE int
+__sigaddset (__sigset_t *__set, int __sig)
+{
+  __set->__sigbits[__sigword (__sig)] |= __sigmask (__sig);
+  return 0;
+}
+
+_EXTERN_INLINE int
+__sigdelset (__sigset_t *__set, int __sig)
+{
+  __set->__sigbits[__sigword (__sig)] &= ~__sigmask (__sig);
+  return 0;
+}
+
+# endif
+
+
+#endif /* ! _SIGSET_H_fns.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/socket.h
@@ -0,0 +1,431 @@
+/* System-specific socket constants and types.  FreeBSD version.
+   Copyright (C) 1991-1992,1994-1999,2000-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H	1
+
+#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define	__need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>		/* XXX Is this allowed?  */
+#include <bits/types.h>
+
+/* Type for length arguments in socket calls.  */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+
+/* Types of sockets.  */
+enum __socket_type
+{
+  SOCK_STREAM = 1,		/* Sequenced, reliable, connection-based
+				   byte streams.  */
+#define SOCK_STREAM SOCK_STREAM
+  SOCK_DGRAM = 2,		/* Connectionless, unreliable datagrams
+				   of fixed maximum length.  */
+#define SOCK_DGRAM SOCK_DGRAM
+  SOCK_RAW = 3,			/* Raw protocol interface.  */
+#define SOCK_RAW SOCK_RAW
+  SOCK_RDM = 4,			/* Reliably-delivered messages.  */
+#define SOCK_RDM SOCK_RDM
+  SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
+				   datagrams of fixed maximum length.  */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+
+  /* Flags to be ORed into the type parameter of socket and socketpair and
+     used for the flags parameter of paccept.  */
+
+  SOCK_CLOEXEC = 0x10000000,	/* Atomically set close-on-exec flag for the
+				new descriptor(s).  */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+  SOCK_NONBLOCK = 0x20000000	/* Atomically mark descriptor(s) as
+				non-blocking.  */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
+};
+
+/*
+ * Structure used by kernel to pass protocol
+ * information in raw sockets.
+ */
+struct sockproto {
+	unsigned short	sp_family;		/* address family */
+	unsigned short	sp_protocol;		/* protocol */
+};
+
+/* Protocol families.  */
+#define	PF_UNSPEC	0	/* Unspecified.  */
+#define	PF_LOCAL	1	/* Local to host (pipes and file-domain).  */
+#define	PF_UNIX		PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define	PF_FILE		PF_LOCAL /* POSIX name for PF_LOCAL.  */
+#define	PF_INET		2	/* IP protocol family.  */
+#define	PF_IMPLINK	3	/* ARPAnet IMP protocol.  */
+#define	PF_PUP		4	/* PUP protocols.  */
+#define	PF_CHAOS	5	/* MIT Chaos protocols.  */
+#define	PF_NETBIOS	6	/* SMB protocols.  */
+#define	PF_ISO		7	/* ISO protocols.  */
+#define	PF_OSI		PF_ISO
+#define	PF_ECMA		8	/* ECMA protocols.  */
+#define	PF_DATAKIT	9	/* AT&T Datakit protocols.  */
+#define	PF_CCITT	10	/* CCITT protocols (X.25 et al).  */
+#define	PF_SNA		11	/* IBM SNA protocol.  */
+#define	PF_DECnet	12	/* DECnet protocols.  */
+#define	PF_DLI		13	/* Direct data link interface.  */
+#define	PF_LAT		14	/* DEC Local Area Transport protocol.  */
+#define	PF_HYLINK	15	/* NSC Hyperchannel protocol.  */
+#define	PF_APPLETALK	16	/* Don't use this.  */
+#define	PF_ROUTE	17	/* Internal Routing Protocol.  */
+#define	PF_LINK		18	/* Link layer interface.  */
+#define	PF_XTP		19	/* eXpress Transfer Protocol (no AF).  */
+#define	PF_COIP		20	/* Connection-oriented IP, aka ST II.  */
+#define	PF_CNT		21	/* Computer Network Technology.  */
+#define PF_RTIP		22	/* Help Identify RTIP packets.  **/
+#define	PF_IPX		23	/* Novell Internet Protocol.  */
+#define	PF_SIP		24	/* Simple Internet Protocol.  */
+#define PF_PIP		25	/* Help Identify PIP packets.  */
+#define PF_ISDN		26	/* Integrated Services Digital Network.  */
+#define PF_KEY		27	/* Internal key-management function.  */
+#define PF_INET6	28	/* IP version 6.  */
+#define PF_NATM		29	/* Native ATM access.  */
+#define PF_ATM		30	/* ATM.  */
+#define PF_HDRCMPLT	31	/* Used by BPF to not rewrite headers in
+				   interface output routine.  */
+#define PF_NETGRAPH	32	/* Netgraph sockets.  */
+#define	PF_MAX		33
+
+/* Address families.  */
+#define	AF_UNSPEC	PF_UNSPEC
+#define	AF_LOCAL	PF_LOCAL
+#define	AF_UNIX		PF_UNIX
+#define	AF_FILE		PF_FILE
+#define	AF_INET		PF_INET
+#define	AF_IMPLINK	PF_IMPLINK
+#define	AF_PUP		PF_PUP
+#define	AF_CHAOS	PF_CHAOS
+#define	AF_NETBIOS	PF_NETBIOS
+#define	AF_ISO		PF_ISO
+#define	AF_OSI		PF_OSI
+#define	AF_ECMA		PF_ECMA
+#define	AF_DATAKIT	PF_DATAKIT
+#define	AF_CCITT	PF_CCITT
+#define	AF_SNA		PF_SNA
+#define	AF_DECnet	PF_DECnet
+#define	AF_DLI		PF_DLI
+#define	AF_LAT		PF_LAT
+#define	AF_HYLINK	PF_HYLINK
+#define	AF_APPLETALK	PF_APPLETALK
+#define	AF_ROUTE	PF_ROUTE
+#define	AF_LINK		PF_LINK
+#define	pseudo_AF_XTP	PF_XTP
+#define	AF_COIP		PF_COIP
+#define	AF_CNT		PF_CNT
+#define pseudo_AF_RTIP	PF_RTIP
+#define	AF_IPX		PF_IPX
+#define	AF_SIP		PF_SIP
+#define pseudo_AF_PIP	PF_PIP
+#define AF_ISDN		PF_ISDN
+#define AF_E164		AF_ISDN		/* CCITT E.164 recommendation.  */
+#define pseudo_AF_KEY	PF_KEY
+#define AF_INET6	PF_INET6
+#define AF_NATM		PF_NATM
+#define AF_ATM		PF_ATM
+#define pseudo_AF_HDRCMPLT PF_HDRCMPLT
+#define AF_NETGRAPH	PF_NETGRAPH
+#define	AF_MAX		PF_MAX
+
+/* Maximum queue length specifiable by listen.  */
+#define SOMAXCONN	128	/* 5 on the original 4.4 BSD.  */
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address.  */
+struct sockaddr
+  {
+    __SOCKADDR_COMMON (sa_);	/* Common data: address family and length.  */
+    char sa_data[14];		/* Address data.  */
+  };
+
+
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype	__uint64_t
+#else
+# define __ss_aligntype	__uint32_t
+#endif
+#define _SS_PADSIZE \
+  (_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
+    char __ss_padding[_SS_PADSIZE];
+    __ss_aligntype __ss_align;	/* Force desired alignment.  */
+  };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al.  */
+enum
+  {
+    MSG_OOB		= 0x01,	/* Process out-of-band data.  */
+#define MSG_OOB MSG_OOB
+    MSG_PEEK		= 0x02,	/* Peek at incoming messages.  */
+#define MSG_PEEK MSG_PEEK
+    MSG_DONTROUTE	= 0x04,	/* Don't use local routing.  */
+#define MSG_DONTROUTE MSG_DONTROUTE
+    MSG_EOR		= 0x08,	/* Data completes record.  */
+#define MSG_EOR MSG_EOR
+    MSG_TRUNC		= 0x10,	/* Data discarded before delivery.  */
+#define MSG_TRUNC MSG_TRUNC
+    MSG_CTRUNC		= 0x20,	/* Control data lost before delivery.  */
+#define MSG_CTRUNC MSG_CTRUNC
+    MSG_WAITALL		= 0x40,	/* Wait for full request or error.  */
+#define MSG_WAITALL MSG_WAITALL
+    MSG_DONTWAIT	= 0x80,	/* This message should be nonblocking.  */
+#define MSG_DONTWAIT MSG_DONTWAIT
+    MSG_EOF		= 0x100, /* Data completes connection.  */
+#define MSG_EOF MSG_EOF
+    MSG_NOTIFICATION	= 0x2000,/* SCTP notification */
+#define MSG_NOTIFICATION MSG_NOTIFICATION
+    MSG_NBIO		= 0x4000,/*FIONBIO mode, used by fifofs */
+#define MSG_NBIO MSG_NBIO
+    MSG_COMPAT		= 0x8000,/* Used in sendit().  */
+#define MSG_COMPAT MSG_COMPAT
+    MSG_NOSIGNAL	= 0x20000 /* do not generate SIGPIPE on EOF */
+#define MSG_NOSIGNAL MSG_NOSIGNAL
+  };
+
+
+/* Structure describing messages sent by
+   `sendmsg' and received by `recvmsg'.  */
+struct msghdr
+  {
+    void *msg_name;		/* Address to send to/receive from.  */
+    socklen_t msg_namelen;	/* Length of address data.  */
+
+    struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
+    int msg_iovlen;		/* Number of elements in the vector.  */
+
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
+    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+
+    int msg_flags;		/* Flags in received message.  */
+  };
+
+/* Structure used for storage of ancillary data object information.  */
+struct cmsghdr
+  {
+    socklen_t cmsg_len;		/* Length of data in cmsg_data plus length
+				   of cmsghdr structure.  */
+    int cmsg_level;		/* Originating protocol.  */
+    int cmsg_type;		/* Protocol specific type.  */
+#if __glibc_c99_flexarr_available 
+    __extension__ unsigned char __cmsg_data  __flexarr __attribute__ ((aligned (__alignof__(size_t)))); /* Ancillary data.  */
+#endif
+  };
+
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+
+#define CMSG_FIRSTHDR(mhdr) \
+  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+			   & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+/* Ancillary data object manipulation macros.  */
+#if __glibc_c99_flexarr_available 
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) (cmsg) + CMSG_ALIGN(sizeof (struct cmsghdr)))
+#endif
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+				      struct cmsghdr *__cmsg) __THROW;
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE __extern_inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return 0;
+
+  __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+			       + CMSG_ALIGN (__cmsg->cmsg_len));
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+					+ __mhdr->msg_controllen)
+      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+    /* No more entries.  */
+    return 0;
+  return __cmsg;
+}
+#endif	/* Use `extern inline'.  */
+
+/* Socket level message types.  */
+enum
+  {
+    SCM_RIGHTS = 0x01,		/* Access rights (array of int).  */
+#define SCM_RIGHTS SCM_RIGHTS
+    SCM_TIMESTAMP = 0x02,	/* Timestamp (struct timeval).  */
+#define SCM_TIMESTAMP SCM_TIMESTAMP
+    SCM_CREDS = 0x03		/* Process creds (struct cmsgcred).  */
+#define SCM_CREDS SCM_CREDS
+  };
+
+/* Unfortunately, BSD practice dictates this structure be of fixed size.
+   If there are more than CMGROUP_MAX groups, the list is truncated.
+   (On GNU systems, the `cmcred_euid' field is just the first in the
+   list of effective UIDs.)  */
+#define CMGROUP_MAX	16
+
+/* Structure delivered by SCM_CREDS.  This describes the identity of the
+   sender of the data simultaneously received on the socket.  By BSD
+   convention, this is included only when a sender on a AF_LOCAL socket
+   sends cmsg data of this type and size; the sender's structure is
+   ignored, and the system fills in the various IDs of the sender process.  */
+struct cmsgcred
+  {
+    __pid_t cmcred_pid;
+    __uid_t cmcred_uid;
+    __uid_t cmcred_euid;
+    __gid_t cmcred_gid;
+    short cmcred_ngroups;
+    __gid_t cmcred_groups[CMGROUP_MAX];
+  };
+
+/* Protocol number used to manipulate socket-level options
+   with `getsockopt' and `setsockopt'.  */
+#define	SOL_SOCKET	0xffff
+
+/* Socket-level options for `getsockopt' and `setsockopt'.  */
+enum
+  {
+    SO_DEBUG = 0x0001,		/* Record debugging information.  */
+#define SO_DEBUG SO_DEBUG
+    SO_ACCEPTCONN = 0x0002,	/* Accept connections on socket.  */
+#define SO_ACCEPTCONN SO_ACCEPTCONN
+    SO_REUSEADDR = 0x0004,	/* Allow reuse of local addresses.  */
+#define SO_REUSEADDR SO_REUSEADDR
+    SO_KEEPALIVE = 0x0008,	/* Keep connections alive and send
+				   SIGPIPE when they die.  */
+#define SO_KEEPALIVE SO_KEEPALIVE
+    SO_DONTROUTE = 0x0010,	/* Don't do local routing.  */
+#define SO_DONTROUTE SO_DONTROUTE
+    SO_BROADCAST = 0x0020,	/* Allow transmission of
+				   broadcast messages.  */
+#define SO_BROADCAST SO_BROADCAST
+    SO_USELOOPBACK = 0x0040,	/* Use the software loopback to avoid
+				   hardware use when possible.  */
+#define SO_USELOOPBACK SO_USELOOPBACK
+    SO_LINGER = 0x0080,		/* Block on close of a reliable
+				   socket to transmit pending data.  */
+#define SO_LINGER SO_LINGER
+    SO_OOBINLINE = 0x0100,	/* Receive out-of-band data in-band.  */
+#define SO_OOBINLINE SO_OOBINLINE
+    SO_REUSEPORT = 0x0200,	/* Allow local address and port reuse.  */
+#define SO_REUSEPORT SO_REUSEPORT
+    SO_TIMESTAMP = 0x0400,	/* Timestamp received dgram traffic.  */
+#define SO_TIMESTAMP SO_TIMESTAMP
+    SO_SNDBUF = 0x1001,		/* Send buffer size.  */
+#define SO_SNDBUF SO_SNDBUF
+    SO_RCVBUF = 0x1002,		/* Receive buffer.  */
+#define SO_RCVBUF SO_RCVBUF
+    SO_SNDLOWAT = 0x1003,	/* Send low-water mark.  */
+#define SO_SNDLOWAT SO_SNDLOWAT
+    SO_RCVLOWAT = 0x1004,	/* Receive low-water mark.  */
+#define SO_RCVLOWAT SO_RCVLOWAT
+    SO_SNDTIMEO = 0x1005,	/* Send timeout.  */
+#define SO_SNDTIMEO SO_SNDTIMEO
+    SO_RCVTIMEO = 0x1006,	/* Receive timeout.  */
+#define SO_RCVTIMEO SO_RCVTIMEO
+    SO_ERROR = 0x1007,		/* Get and clear error status.  */
+#define SO_ERROR SO_ERROR
+    SO_STYLE = 0x1008,		/* Get socket connection style.  */
+#define SO_STYLE SO_STYLE
+    SO_TYPE = SO_STYLE,		/* Compatible name for SO_STYLE.  */
+#define SO_TYPE SO_TYPE
+    SO_LABEL = 0x1009,
+#define SO_LABEL SO_LABEL
+    SO_PEERLABEL = 0x1010,
+#define SO_PEERLABEL SO_PEERLABEL
+    SO_LISTENQLIMIT = 0x1011,
+#define SO_LISTENQLIMIT SO_LISTENQLIMIT
+    SO_LISTENQLEN = 0x1012,
+#define SO_LISTENQLEN SO_LISTENQLEN
+    SO_LISTENINCQLEN = 0x1013,
+#define SO_LISTENINCQLEN SO_LISTENINCQLEN
+    SO_SETFIB = 0x1014,
+#define SO_SETFIB SO_SETFIB
+    SO_USER_COOKIE = 0x1015,
+#define SO_USER_COOKIE SO_USER_COOKIE
+    SO_PROTOCOL = 0x1016,
+#define SO_PROTOCOL SO_PROTOCOL
+    SO_PROTOTYPE = SO_PROTOCOL
+#define SO_PROTOTYPE SO_PROTOTYPE
+  };
+
+/* Socket options. */
+#define LOCAL_PEERCRED          0x001   /* retrieve peer credentials */
+#define LOCAL_CREDS             0x002   /* pass credentials to receiver */
+#define LOCAL_CONNWAIT          0x004   /* connects block until accepted */
+
+/* Structure used to manipulate the SO_LINGER option.  */
+struct linger
+  {
+    int l_onoff;		/* Nonzero to linger on close.  */
+    int l_linger;		/* Time to linger.  */
+  };
+
+/* Magic IPv4 addresses defined in FreeBSD version of <netinet/in.h>, but not
+   included in Glibc version of the same header. */
+#define	INADDR_ALLRPTS_GROUP	(uint32_t)0xe0000016	/* 224.0.0.22, IGMPv3 */
+#define	INADDR_CARP_GROUP	(uint32_t)0xe0000012	/* 224.0.0.18 */
+#define	INADDR_PFSYNC_GROUP	(uint32_t)0xe00000f0	/* 224.0.0.240 */
+#define	INADDR_ALLMDNS_GROUP	(uint32_t)0xe00000fb	/* 224.0.0.251 */
+
+#ifdef __USE_MISC
+
+struct sf_hdtr;
+
+__BEGIN_DECLS
+
+extern int bsd_sendfile (int __in_fd, int __out_sock,
+			 __off_t __in_offset, size_t __nbytes,
+			 struct sf_hdtr *__hdtr, __off_t *__sockbytes,
+			 int __flags) __THROW;
+
+__END_DECLS
+
+#endif /* Use BSD */
+
+#endif	/* bits/socket.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/stat.h
@@ -0,0 +1,219 @@
+/* Copyright (C) 1992, 1996-1997, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H   1
+
+/* This structure needs to be defined in accordance with the
+   implementation of __stat, __fstat, and __lstat.  */
+
+#include <bits/types.h>
+
+/* Versions of the 'struct stat' data structure.  */
+#define _STAT_VER_ostat	0	/* 'struct ostat' in /usr/src/sys/sys/stat.h */
+#define _STAT_VER_stat	1	/* 'struct stat' in /usr/src/sys/sys/stat.h */
+#define _STAT_VER_nstat	2	/* 'struct nstat' in /usr/src/sys/sys/stat.h */
+#define _STAT_VER_gstat 3	/* glibc's 'struct stat' without LFS */
+/* By default we use _STAT_VER_gstat, but we support also _STAT_VER_stat */
+#define _STAT_VER	_STAT_VER_gstat
+
+/* Structure describing file characteristics.  */
+struct stat
+  {
+    __dev_t st_dev;		/* Device containing the file.  */
+#ifndef __USE_FILE_OFFSET64
+    __ino_t st_ino;		/* File serial number.  */
+#else
+    __ino64_t st_ino;		/* File serial number.	*/
+#endif
+
+    __mode_t st_mode;		/* File mode.  */
+    __mode_t __pad_mode;	/* __mode_t is 16 bit, fill to 32 bit to retain previous ABI */
+    __nlink_t st_nlink;		/* Link count.  */
+    __nlink_t __pad_nlink;	/* __nlink_t is 16 bit, fill to 32 bit to retain previous ABI */
+
+    __uid_t st_uid;		/* User ID of the file's owner.  */
+    __gid_t st_gid;		/* Group ID of the file's group.  */
+
+    __dev_t st_rdev;		/* Device number, if device.  */
+
+#if defined __USE_MISC || defined __USE_XOPEN2K8
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;		/* Time of last access.  */
+    long int st_atimensec;	/* Nanoseconds of last access.  */
+    __time_t st_mtime;		/* Time of last modification.  */
+    long int st_mtimensec;	/* Nanoseconds of last modification.  */
+    __time_t st_ctime;		/* Time of last status change.  */
+    long int st_ctimensec;	/* Nanoseconds of last status change.  */
+#endif
+
+    __off_t st_size;		/* Size of file, in bytes.  */
+
+    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+#define _STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
+
+    __uint32_t st_flags;	/* User defined flags.  */
+
+    __uint32_t st_gen;		/* Generation number.  */
+
+    __uint64_t __unused1[2];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    __dev_t st_dev;		/* Device containing the file.  */
+    __ino64_t st_ino;		/* File serial number.	*/
+
+    __mode_t st_mode;		/* File mode.  */
+    __mode_t __pad_mode;	/* __mode_t is 16 bit, fill to 32 bit to retain previous ABI */
+    __nlink_t st_nlink;		/* Link count.  */
+    __nlink_t __pad_nlink;	/* __nlink_t is 16 bit, fill to 32 bit to retain previous ABI */
+
+    __uid_t st_uid;		/* User ID of the file's owner.  */
+    __gid_t st_gid;		/* Group ID of the file's group.  */
+
+    __dev_t st_rdev;		/* Device number, if device.  */
+
+#if defined __USE_MISC || defined __USE_XOPEN2K8
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;		/* Time of last access.  */
+    long int st_atimensec;	/* Nanoseconds of last access.  */
+    __time_t st_mtime;		/* Time of last modification.  */
+    long int st_mtimensec;	/* Nanoseconds of last modification.  */
+    __time_t st_ctime;		/* Time of last status change.  */
+    long int st_ctimensec;	/* Nanoseconds of last status change.  */
+#endif
+
+    __off_t st_size;		/* Size of file, in bytes.  */
+
+    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+
+    __uint32_t st_flags;	/* User defined flags.  */
+
+    __uint32_t st_gen;		/* Generation number.  */
+
+    __uint64_t __unused1[2];
+  };
+#endif
+
+/* Encoding of the file mode.  These are the standard Unix values,
+   but POSIX.1 does not specify what values should be used.  */
+
+#define __S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define __S_IFDIR	0040000	/* Directory.  */
+#define __S_IFCHR	0020000	/* Character device.  */
+#define __S_IFBLK	0060000	/* Block device.  */
+#define __S_IFREG	0100000	/* Regular file.  */
+#define __S_IFLNK	0120000	/* Symbolic link.  */
+#define __S_IFSOCK	0140000	/* Socket.  */
+#define __S_IFWHT	0160000	/* Whiteout.  */
+#define __S_IFIFO	0010000	/* FIFO.  */
+
+/* POSIX.1b objects.  */
+#define __S_TYPEISMQ(buf) 0
+#define __S_TYPEISSEM(buf) 0
+#define __S_TYPEISSHM(buf) 0
+
+/* Protection bits.  */
+
+#define __S_ISUID	04000	/* Set user ID on execution.  */
+#define __S_ISGID	02000	/* Set group ID on execution.  */
+#define __S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define __S_IREAD	0400	/* Read by owner.  */
+#define __S_IWRITE	0200	/* Write by owner.  */
+#define __S_IEXEC	0100	/* Execute by owner.  */
+
+#ifdef __USE_MISC
+
+/* Definitions of flags stored in file flags word.  */
+
+/* Super-user and owner changeable flags.  */
+# define UF_SETTABLE	0x0000ffff	/* mask of owner changeable flags */
+# define UF_NODUMP	0x00000001	/* do not dump file */
+# define UF_IMMUTABLE	0x00000002	/* file may not be changed */
+# define UF_APPEND	0x00000004	/* writes to file may only append */
+# define UF_OPAQUE	0x00000008	/* directory is opaque wrt. union */
+# define UF_NOUNLINK	0x00000010	/* file may not be removed or renamed */
+
+/* Super-user changeable flags.  */
+# define SF_SETTABLE	0xffff0000	/* mask of superuser changeable flags */
+# define SF_ARCHIVED	0x00010000	/* file is archived */
+# define SF_IMMUTABLE	0x00020000	/* file may not be changed */
+# define SF_APPEND	0x00040000	/* writes to file may only append */
+# define SF_NOUNLINK	0x00100000	/* file may not be removed or renamed */
+# define SF_SNAPSHOT	0x00200000	/* snapshot inode */
+
+__BEGIN_DECLS
+
+/* Set file flags for FILE to FLAGS.  */
+extern int chflags (__const char *__file, unsigned long int __flags) __THROW;
+
+/* Set file flags of the file referred to by FD to FLAGS.  */
+extern int fchflags (int __fd, unsigned long int __flags) __THROW;
+
+/* Set file flags for FILE to FLAGS without following symlinks.  */
+extern int lchflags(__const char *__file, int __flags);
+
+/* Get device name in /dev with a device number of dev and a file type
+   matching the one encoded in type.  */
+extern char *devname(__dev_t dev, __mode_t type) __THROW;
+
+/* Store at most BUFLEN characters of the device name in /dev with a 
+   device number of dev and a file type matching the one encoded in type.  */
+extern char *devname_r(__dev_t dev, __mode_t type, char *buf, int buflen) __THROW;
+
+__END_DECLS
+
+#endif /* __USE_MISC */
+
+#endif /* bits/stat.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/stat16.h
@@ -0,0 +1,56 @@
+/* Copyright (C) 2002, 2006, 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This structure corresponds to the standard FreeBSD 'struct stat'
+   (i.e. _STAT_VER_stat), and is used by the stat() system call family. */
+
+struct stat16
+  {
+    __dev_t st_dev;		/* Device containing the file.  */
+    __ino_t st_ino;		/* File serial number.  */
+
+    __uint16_t st_mode;		/* File mode.  */
+    __uint16_t st_nlink;	/* Link count.  */
+
+    __uid_t st_uid;		/* User ID of the file's owner.  */
+    __gid_t st_gid;		/* Group ID of the file's group.  */
+
+    __dev_t st_rdev;		/* Device number, if device.  */
+
+    struct  timespec st_atimespec;  /* time of last access */
+    struct  timespec st_mtimespec;  /* time of last data modification */
+    struct  timespec st_ctimespec;  /* time of last file status change */
+
+    __off_t st_size;		/* Size of file, in bytes.  */
+
+    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+
+    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
+
+    __uint32_t st_flags;	/* User defined flags.  */
+
+    __uint32_t st_gen;		/* Generation number.  */
+
+    __uint32_t __unused1;
+
+    __time_t st_birthtime;	/* Time of file creation.  */
+    long int st_birthtimensec;	/* Nanoseconds of file creation.  */
+
+#define _BIRTH_PADSIZE     (16 - sizeof(__time_t) - sizeof (long int))
+    char __birth_padding[_BIRTH_PADSIZE];
+  };
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/statfs.h
@@ -0,0 +1,91 @@
+/* Definition of `struct statfs', information about a filesystem.
+   Copyright (C) 1996-1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_STATFS_H
+#define _BITS_STATFS_H	1
+
+#if !defined _SYS_STATFS_H && !defined _SYS_MOUNT_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h>
+
+struct statfs
+  {
+    unsigned long f_version;
+    unsigned long f_bsize;
+    unsigned long f_iosize;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+#endif
+    __fsid_t f_fsid;
+    __uid_t f_owner;
+    int f_type;
+    int f_flags;
+    unsigned long int f_syncwrites;
+    unsigned long int f_asyncwrites;
+    char f_fstypename[16];
+    char f_mntonname[80];
+    unsigned long int f_syncreads;
+    unsigned long int f_asyncreads;
+    unsigned short f_namemax;
+    char f_mntfromname[80];
+    short __unused3;
+    long __unused4[2];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+  {
+    unsigned long f_version;
+    unsigned long f_bsize;
+    unsigned long f_iosize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsid_t f_fsid;
+    __uid_t f_owner;
+    int f_type;
+    int f_flags;
+    unsigned long int f_syncwrites;
+    unsigned long int f_asyncwrites;
+    char f_fstypename[16];
+    char f_mntonname[80];
+    unsigned long int f_syncreads;
+    unsigned long int f_asyncreads;
+    unsigned short f_namemax;
+    char f_mntfromname[80];
+    short __unused3;
+    long __unused4[2];
+  };
+#endif
+
+#endif /* _BITS_STATFS_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/statvfs.h
@@ -0,0 +1,97 @@
+/* Definition of `struct statvfs', information about a filesystem.
+   Copyright (C) 1998, 2000-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_STATVFS_H
+# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
+#endif
+
+#include <bits/types.h>
+
+#if __WORDSIZE == 32
+#define _STATVFSBUF_F_UNUSED
+#endif
+
+struct statvfs
+  {
+    unsigned long int f_bsize;
+    unsigned long int f_frsize;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_bavail;
+    __fsfilcnt_t f_files;
+    __fsfilcnt_t f_ffree;
+    __fsfilcnt_t f_favail;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsfilcnt64_t f_favail;
+#endif
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
+    unsigned long int f_flag;
+    unsigned long int f_namemax;
+    unsigned int f_spare[6];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statvfs64
+  {
+    unsigned long int f_bsize;
+    unsigned long int f_frsize;
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_bavail;
+    __fsfilcnt64_t f_files;
+    __fsfilcnt64_t f_ffree;
+    __fsfilcnt64_t f_favail;
+    unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+    int __f_unused;
+#endif
+    unsigned long int f_flag;
+    unsigned long int f_namemax;
+    unsigned int f_spare[6];
+  };
+#endif
+
+/* Definitions for the flag in `f_flag'.  */
+enum
+{
+  ST_RDONLY = 1,		/* Mount read-only.  */
+#define ST_RDONLY	ST_RDONLY
+  ST_NOSUID = 2			/* Ignore suid and sgid bits.  */
+#define ST_NOSUID	ST_NOSUID
+#ifdef __USE_GNU
+  ,
+  ST_NODEV = 4,			/* Disallow access to device special files.  */
+# define ST_NODEV	ST_NODEV
+  ST_NOEXEC = 8,		/* Disallow program execution.  */
+# define ST_NOEXEC	ST_NOEXEC
+  ST_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
+# define ST_SYNCHRONOUS	ST_SYNCHRONOUS
+  ST_NOATIME = 0x10000000	/* Do not update access times.  */
+# define ST_NOATIME	ST_NOATIME
+#endif	/* Use GNU.  */
+};
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/sys_errlist.h
@@ -0,0 +1,33 @@
+/* Declare sys_errlist and sys_nerr, or don't.  Compatibility (do) version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _STDIO_H
+# error "Never include <bits/sys_errlist.h> directly; use <stdio.h> instead."
+#endif
+
+/* sys_errlist and sys_nerr are deprecated.  Use strerror instead.  */
+
+#ifdef  __USE_MISC
+extern int sys_nerr;
+extern __const char *__const sys_errlist[];
+#endif
+#ifdef  __USE_GNU
+extern int _sys_nerr;
+extern __const char *__const _sys_errlist[];
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/syslog-path.h
@@ -0,0 +1,31 @@
+/* <bits/syslog-path.h> -- _PATH_LOG definition
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_SYSLOG_H
+# error "Never include this file directly.  Use <sys/syslog.h> instead"
+#endif
+
+#ifndef _BITS_SYSLOG_PATH_H
+#define _BITS_SYSLOG_PATH_H 1
+
+/* On kFreeBSD, named pipes are not allowed in /dev (devfs), so we pick this
+   alternate path. */
+#define _PATH_LOG	"/var/run/log"
+
+#endif /* bits/syslog-path.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/sysmacros.h
@@ -0,0 +1,60 @@
+/* Definitions of macros to access `dev_t' values.  FreeBSD version.
+   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_SYSMACROS_H
+#define _BITS_SYSMACROS_H 1
+
+#ifndef _SYS_SYSMACROS_H
+# error "Never include <bits/sysmacros.h> directly; use <sys/sysmacros.h> instead."
+#endif
+
+/* The FreeBSD version of dev_t in glibc is a 32-bit quantity, with 8-bit
+   major and 24-bit minor numbers.  The encoding is mmmmMMmm, where M is a
+   hex digit of the major number and m is a hex digit of the minor number.  */
+
+#define __SYSMACROS_DECLARE_MAJOR(DECL_TEMPL)			\
+  DECL_TEMPL(unsigned int, major, (__dev_t __dev))
+
+#define __SYSMACROS_DEFINE_MAJOR(DECL_TEMPL)			\
+  __SYSMACROS_DECLARE_MAJOR (DECL_TEMPL)			\
+  {								\
+    return ((__dev & (__dev_t) 0x0000ff00u) >> 8);		\
+  }
+
+#define __SYSMACROS_DECLARE_MINOR(DECL_TEMPL)			\
+  DECL_TEMPL(unsigned int, minor, (__dev_t __dev))
+
+#define __SYSMACROS_DEFINE_MINOR(DECL_TEMPL)			\
+  __SYSMACROS_DECLARE_MINOR (DECL_TEMPL)			\
+  {								\
+    return (__dev & (__dev_t) 0xffff00ff);			\
+  }
+
+#define __SYSMACROS_DECLARE_MAKEDEV(DECL_TEMPL)			\
+  DECL_TEMPL(__dev_t, makedev, (unsigned int __major, unsigned int __minor))
+
+#define __SYSMACROS_DEFINE_MAKEDEV(DECL_TEMPL)			\
+  __SYSMACROS_DECLARE_MAKEDEV (DECL_TEMPL)			\
+  {								\
+    __dev_t __dev;						\
+    __dev  = (((__dev_t) (__major & 0x000000ffu)) << 8);	\
+    __dev |= (((__dev_t) (__minor & 0xffff00ffu)) << 0);	\
+    return __dev;						\
+  }
+
+#endif /* bits/sysmacros.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/termios.h
@@ -0,0 +1,245 @@
+/* termios type and macro definitions.  FreeBSD version.
+   Copyright (C) 1993-1994,1996-1997,1999,2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+/* These macros are also defined in some <bits/ioctls.h> files (with
+   numerically identical values), but this serves to shut up cpp's
+   complaining. */
+#ifdef __USE_MISC
+
+# ifdef MDMBUF
+#  undef MDMBUF
+# endif
+# ifdef FLUSHO
+#  undef FLUSHO
+# endif
+# ifdef PENDIN
+#  undef PENDIN
+# endif
+
+#endif /* __USE_MISC */
+
+#ifdef ECHO
+# undef ECHO
+#endif
+#ifdef TOSTOP
+# undef TOSTOP
+#endif
+#ifdef NOFLSH
+# undef NOFLSH
+#endif
+
+
+typedef unsigned char	cc_t;
+typedef unsigned int	speed_t;
+typedef unsigned int	tcflag_t;
+
+#define NCCS 20
+struct termios
+  {
+    tcflag_t c_iflag;		/* input mode flags */
+    tcflag_t c_oflag;		/* output mode flags */
+    tcflag_t c_cflag;		/* control mode flags */
+    tcflag_t c_lflag;		/* local mode flags */
+    cc_t c_cc[NCCS];		/* control characters */
+    speed_t c_ispeed;		/* input speed */
+    speed_t c_ospeed;		/* output speed */
+#define __ispeed c_ispeed
+#define __ospeed c_ospeed
+#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
+#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
+  };
+
+/* c_cc characters */
+#define VEOF 0
+#define VEOL 1
+#define VEOL2 2
+#define VERASE 3
+#define VWERASE 4
+#define VKILL 5
+#define VREPRINT 6
+#ifdef __USE_MISC
+# define VERASE2 7
+#endif
+#define VINTR 8
+#define VQUIT 9
+#define VSUSP 10
+#ifdef __USE_MISC
+# define VDSUSP 11
+#endif
+#define VSTART 12
+#define VSTOP 13
+#define VLNEXT 14
+#define VDISCARD 15
+#define VMIN 16
+#define VTIME 17
+#ifdef __USE_MISC
+# define VSTATUS 18
+#endif
+
+/* c_iflag bits */
+#define IGNBRK	0000001
+#define BRKINT	0000002
+#define IGNPAR	0000004
+#define PARMRK	0000010
+#define INPCK	0000020
+#define ISTRIP	0000040
+#define INLCR	0000100
+#define IGNCR	0000200
+#define ICRNL	0000400
+#define IXON	0001000
+#define IXOFF	0002000
+#define IXANY	0004000
+#define IMAXBEL	0020000
+
+/* c_oflag bits */
+#define	OPOST	(1 << 0)	/* Perform output processing.  */
+#define	ONLCR	(1 << 1)	/* Map NL to CR-NL on output.  */
+#if defined __USE_MISC || defined __USE_XOPEN
+# define TAB0   (0 << 2)	/* no tab delay and expansion */
+# define TAB3   (1 << 2)	/* expand tabs to spaces */
+# define TABDLY	TAB3		/* tab delay mask */
+# define OXTABS	TAB3
+# define XTABS	TAB3
+#endif
+#ifdef	__USE_MISC
+# define ONOEOT	(1 << 3)	/* Discard EOT (^D) on output.  */
+#endif
+#define	OCRNL	(1 << 4)	/* map CR to NL on output */
+#define	ONOCR	(1 << 5)	/* no CR output at column 0 */
+#define	ONLRET	(1 << 6)	/* NL performs CR function */
+
+/* c_cflag bit meaning */
+#ifdef	__USE_MISC
+# define CIGNORE	(1 << 0)	/* Ignore these control flags.  */
+#endif
+#define	CSIZE	(CS5|CS6|CS7|CS8)	/* Number of bits per byte (mask).  */
+#define	CS5	(0 << 8)	/* 5 bits per byte.  */
+#define	CS6	(1 << 8)	/* 6 bits per byte.  */
+#define	CS7	(2 << 8)	/* 7 bits per byte.  */
+#define	CS8	(3 << 8)	/* 8 bits per byte.  */
+#define	CSTOPB	(1 << 10)	/* Two stop bits instead of one.  */
+#define	CREAD	(1 << 11)	/* Enable receiver.  */
+#define	PARENB	(1 << 12)	/* Parity enable.  */
+#define	PARODD	(1 << 13)	/* Odd parity instead of even.  */
+#define	HUPCL	(1 << 14)	/* Hang up on last close.  */
+#define	CLOCAL	(1 << 15)	/* Ignore modem status lines.  */
+#ifdef	__USE_MISC
+# define CCTS_OFLOW	(1 << 16)	/* CTS flow control of output.  */
+# define CRTS_IFLOW	(1 << 17)	/* RTS flow control of input.  */
+# define CRTSCTS	(CCTS_OFLOW|CRTS_IFLOW)	/* CTS/RTS flow control.  */
+# define CDTR_IFLOW	(1 << 18)	/* DTR flow control of input.  */
+# define CDSR_OFLOW	(1 << 19)	/* DSR flow control of output.  */
+# define CCAR_OFLOW	(1 << 20)	/* DCD flow control of output.  */
+# define MDMBUF		(1 << 20)	/* Carrier flow control of output.  */
+#endif
+
+/* c_lflag bits */
+#ifdef	__USE_MISC
+# define ECHOKE	(1 << 0)	/* Visual erase for KILL.  */
+#endif
+#define	ECHOE	(1 << 1)	/* Visual erase for ERASE.  */
+#define	ECHOK	(1 << 2)	/* Echo NL after KILL.  */
+#define	ECHO	(1 << 3)	/* Enable echo.  */
+#define	ECHONL	(1 << 4)	/* Echo NL even if ECHO is off.  */
+#ifdef	__USE_MISC
+# define ECHOPRT	(1 << 5)	/* Hardcopy visual erase.  */
+# define ECHOCTL	(1 << 6)	/* Echo control characters as ^X.  */
+#endif
+#define	ISIG	(1 << 7)	/* Enable signals.  */
+#define	ICANON	(1 << 8)	/* Do erase and kill processing.  */
+#ifdef	__USE_MISC
+# define ALTWERASE (1 << 9)	/* Alternate WERASE algorithm.  */
+#endif
+#define	IEXTEN	(1 << 10)	/* Enable DISCARD and LNEXT.  */
+#ifdef __USE_MISC
+# define EXTPROC (1 << 11)	/* External processing.  */
+#endif
+#define	TOSTOP	(1 << 22)	/* Send SIGTTOU for background output.  */
+#ifdef	__USE_MISC
+# define FLUSHO	(1 << 23)	/* Output being flushed (state).  */
+# define NOKERNINFO (1 << 25)	/* Disable VSTATUS.  */
+# define PENDIN	(1 << 29)	/* Retype pending input (state).  */
+#endif
+#define	NOFLSH	(1 << 31)	/* Disable flush after interrupt.  */
+
+  /* Input and output baud rates.  */
+#define	B0	0		/* Hang up.  */
+#define	B50	50		/* 50 baud.  */
+#define	B75	75		/* 75 baud.  */
+#define	B110	110		/* 110 baud.  */
+#define	B134	134		/* 134.5 baud.  */
+#define	B150	150		/* 150 baud.  */
+#define	B200	200		/* 200 baud.  */
+#define	B300	300		/* 300 baud.  */
+#define	B600	600		/* 600 baud.  */
+#define	B1200	1200		/* 1200 baud.  */
+#define	B1800	1800		/* 1800 baud.  */
+#define	B2400	2400		/* 2400 baud.  */
+#define	B4800	4800		/* 4800 baud.  */
+#define	B9600	9600		/* 9600 baud.  */
+#define	B19200	19200		/* 19200 baud.  */
+#define	B38400	38400		/* 38400 baud.  */
+#define B76800	76800
+#ifdef	__USE_MISC
+# define EXTA	19200
+# define EXTB	38400
+#endif
+#define B7200	7200
+#define B14400	14400
+#define B28800	28800
+#define	B57600	57600
+#define	B115200	115200
+#define	B230400	230400
+#define	B460800	460800
+#define	B500000	500000
+#define	B576000	576000
+#define	B921600	921600
+#define	B1000000 1000000
+#define	B1152000 1152000
+#define	B1500000 1500000
+#define	B2000000 2000000
+#define	B2500000 2500000
+#define	B3000000 3000000
+#define	B3500000 3500000
+#define	B4000000 4000000
+#define	__MAX_BAUD B4000000
+
+/* tcflow() and TCXONC use these */
+#define	TCOOFF		1
+#define	TCOON		2
+#define	TCIOFF		3
+#define	TCION		4
+
+/* tcflush() and TCFLSH use these */
+#define	TCIFLUSH	1
+#define	TCOFLUSH	2
+#define	TCIOFLUSH	3
+
+/* tcsetattr uses these */
+#define	TCSANOW		0
+#define	TCSADRAIN	1
+#define	TCSAFLUSH	2
+#ifdef	__USE_MISC
+# define TCSASOFT	0x10	/* Flag: Don't alter hardware state.  */
+#endif
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/time.h
@@ -0,0 +1,87 @@
+/* System-dependent timing definitions.  FreeBSD version.
+   Copyright (C) 1996-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef _BITS_TIME_H
+#define _BITS_TIME_H	1
+
+#include <bits/types.h>
+
+/* ISO/IEC 9899:1999 7.23.1: Components of time
+   The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is
+   the number per second of the value returned by the `clock' function.  */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+   The value of CLOCKS_PER_SEC is required to be 1 million on all
+   XSI-conformant systems. */
+#define CLOCKS_PER_SEC  ((__clock_t) 1000000)
+
+#if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \
+   && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+   presents the real value for clock ticks per second for the system.  */
+extern long int __sysconf (int);
+# define CLK_TCK ((__clock_t) __sysconf (2))	/* 2 is _SC_CLK_TCK */
+#endif
+
+#ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock.  */
+# define CLOCK_REALTIME			0
+/* Monotonic system-wide clock.  */
+# define CLOCK_MONOTONIC		4
+/* These are BSD specific clocks.  */
+# ifdef __USE_MISC
+#  define CLOCK_VIRTUAL			1
+#  define CLOCK_PROF			2
+#  define CLOCK_UPTIME 			5  /* FreeBSD-specific. */
+#  define CLOCK_UPTIME_PRECISE		7  /* FreeBSD-specific. */
+#  define CLOCK_UPTIME_FAST		8  /* FreeBSD-specific. */
+#  define CLOCK_REALTIME_PRECISE	9  /* FreeBSD-specific. */
+#  define CLOCK_REALTIME_FAST		10 /* FreeBSD-specific. */
+#  define CLOCK_MONOTONIC_PRECISE	11 /* FreeBSD-specific. */
+#  define CLOCK_MONOTONIC_FAST		12 /* FreeBSD-specific. */
+#  define CLOCK_SECOND			13 /* FreeBSD-specific. */
+# endif
+/* Thread-specific CPU-time clock.  */
+# define CLOCK_THREAD_CPUTIME_ID	14
+/* High-resolution timer from the CPU.  */
+# define CLOCK_PROCESS_CPUTIME_ID	15
+# ifdef __USE_MISC
+#  define CPUCLOCK_WHICH_PID		0
+#  define CPUCLOCK_WHICH_TID		1
+# endif
+
+/* Flag to indicate time is absolute.  */
+# define TIMER_RELTIME			0 /* relative timer */
+# define TIMER_ABSTIME			1 /* absolute timer */
+#endif
+
+
+/* Getkerninfo clock information structure */
+struct clockinfo
+  {
+    int hz;		/* clock frequency */
+    int tick;		/* micro-seconds per hz tick */
+    int spare;
+    int stathz;		/* statistics clock frequency */
+    int profhz;		/* profiling clock frequency */
+  };
+
+#endif	/* bits/time.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/types/idtype_t.h
@@ -0,0 +1,39 @@
+#ifndef __idtype_t_defined
+#define __idtype_t_defined
+
+/* The following values are used by the `waitid' function.  */
+typedef enum
+{
+        /*
+         * These names were mostly lifted from Solaris source code and
+         * still use Solaris style naming to avoid breaking any
+         * OpenSolaris code which has been ported to FreeBSD.  There
+         * is no clear FreeBSD counterpart for all of the names, but
+         * some have a clear correspondence to FreeBSD entities.
+         *
+         * The numerical values are kept synchronized with the Solaris
+         * values.
+         */
+        P_PID,                  /* A process identifier. */
+        P_PPID,                 /* A parent process identifier. */
+        P_PGID,                 /* A process group identifier. */
+        P_SID,                  /* A session identifier. */
+        P_CID,                  /* A scheduling class identifier. */
+        P_UID,                  /* A user identifier. */
+        P_GID,                  /* A group identifier. */
+        P_ALL,                  /* All processes. */
+        P_LWPID,                /* An LWP identifier. */
+        P_TASKID,               /* A task identifier. */
+        P_PROJID,               /* A project identifier. */
+        P_POOLID,               /* A pool identifier. */
+        P_JAILID,               /* A zone identifier. */
+        P_CTID,                 /* A (process) contract identifier. */
+        P_CPUID,                /* CPU identifier. */
+        P_PSETID                /* Processor set identifier. */
+} idtype_t;                     /* The type of id_t we are using. */
+
+# if defined __USE_MISC
+#  define P_ZONEID        P_JAILID
+# endif
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/typesizes.h
@@ -0,0 +1,91 @@
+/* bits/typesizes.h -- underlying types for *_t.  kFreeBSD version.
+   Copyright (C) 2002, 2003, 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TYPESIZES_H
+#define	_BITS_TYPESIZES_H	1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+
+#define __DEV_T_TYPE		__U32_TYPE
+#define __UID_T_TYPE		__U32_TYPE
+#define __GID_T_TYPE		__U32_TYPE
+#define __INO_T_TYPE		__U32_TYPE
+#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __MODE_T_TYPE		__U16_TYPE
+#define __NLINK_T_TYPE		__U16_TYPE
+#define __OFF_T_TYPE		__SQUAD_TYPE
+#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __PID_T_TYPE		__S32_TYPE
+#define __RLIM_T_TYPE		__SQUAD_TYPE
+#define __RLIM64_T_TYPE		__SQUAD_TYPE
+#define	__BLKCNT_T_TYPE		__SQUAD_TYPE
+#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__ID_T_TYPE		__U32_TYPE
+#define __CLOCK_T_TYPE		__S32_TYPE
+#define	__FSWORD_T_TYPE		__SWORD_TYPE
+
+/*
+ * This one is a bit tricky.  It needs to match the size
+ * in the sys/${arch}/include/_types.h typedefs.
+ *
+ * However, for i386 and amd64 we started with __SLONGWORD_TYPE
+ * and we need to maintain ABI.  Even if size is the same, using
+ * a different type may affect C++ ABI (this distinction is
+ * necessary to implement function overload), so it must stay
+ * with __SLONGWORD_TYPE.
+ */
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+#define __TIME_T_TYPE		__SLONGWORD_TYPE
+#else
+#define __TIME_T_TYPE		__S64_TYPE
+#endif
+
+#define __USECONDS_T_TYPE	__U32_TYPE
+#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
+#define __DADDR_T_TYPE		__SQUAD_TYPE
+#define __SWBLK_T_TYPE		__S32_TYPE
+#define __KEY_T_TYPE		__SLONGWORD_TYPE
+#define __CLOCKID_T_TYPE	__S32_TYPE
+#define __TIMER_T_TYPE		__S32_TYPE
+#define __BLKSIZE_T_TYPE	__U32_TYPE
+#define __FSID_T_TYPE		union { int __val[2]; int val[2]; }
+#define __SSIZE_T_TYPE		__SWORD_TYPE
+#define __SNSECONDS_T_TYPE	__SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE	__SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
+
+/* Tell the libc code that off_t and off64_t are actually the same type
+   for all ABI purposes, even if possibly expressed as different base types
+   for C type-checking purposes.  */
+#define __OFF_T_MATCHES_OFF64_T 1
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define	__FD_SETSIZE		1024
+
+
+#endif /* bits/typesizes.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/uio.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1996-1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_UIO_H && !defined _FCNTL_H
+# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
+#endif
+
+#ifndef _BITS_UIO_H
+#define _BITS_UIO_H     1
+
+#include <sys/types.h>
+
+
+/* `struct iovec' -- Structure describing a section of memory.  */
+
+struct iovec
+{
+  /* Starting address.  */
+  __ptr_t iov_base;
+  /* Length in bytes.  */
+  size_t iov_len;
+};
+
+/* Maximum number of 'struct iovec's that can be passed to a readv() or
+   writev() system call.  For larger arrays of 'struct iovec', the libc
+   uses a single read() or write() call to guarantee atomicity.  */
+#define UIO_MAXIOV	1024
+
+#ifdef __USE_MISC
+enum    uio_rw { UIO_READ, UIO_WRITE };
+
+/* Segment flag values. */
+enum uio_seg {
+        UIO_USERSPACE,          /* from user data space */
+        UIO_SYSSPACE,           /* from system space */
+        UIO_NOCOPY              /* don't copy, already in object */
+};
+#endif
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/utsname.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
+/* Length of the entries in 'struct utsname' is 32.  */
+#define _UTSNAME_LENGTH 32
+
+/* But the version entry is longer.  */
+#define _UTSNAME_VERSION_LENGTH 256
+
+/* If nonzero, the size of of the `domainname` field in `struct utsname'.
+   This is zero to indicate that there should be no such field at all.  */
+#define _UTSNAME_DOMAIN_LENGTH  0
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/waitflags.h
@@ -0,0 +1,40 @@
+/* Definitions of flag bits for `waitpid' et al.
+   Copyright (C) 1992, 1996-1997, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Bits in the third argument to `waitpid'.  */
+#define	WNOHANG		1	/* Don't block waiting.  */
+#define	WUNTRACED	2	/* Report status of stopped children.  */
+
+/* Bits in the fourth argument to `waitid'.  */
+#define	WSTOPPED	2	/* Report stopped child (same as WUNTRACED). */
+#define	WCONTINUED	4	/* Report continued child.  */
+#define	WNOWAIT		8	/* Poll only. Don't delete the proc entry. */
+#define WEXITED         16      /* Wait for exited processes. */
+#define WTRAPPED        32      /* Wait for a process to hit a trap or
+                                   a breakpoint. */
+                                   
+#define __WCLONE	0x80000000	/* Wait for cloned process.  */
+#ifdef __USE_MISC
+# define WLINUXCLONE	__WCLONE	/* FreeBSD name for __WCLONE.  */
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/bits/waitstatus.h
@@ -0,0 +1,102 @@
+/* Definitions of status bits for `wait' et al.
+   Copyright (C) 1992,1994,1996,1997,2000,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* If WIFEXITED(STATUS), the low-order 8 bits of the status.  */
+#define	__WEXITSTATUS(status)	(((status) & 0xff00) >> 8)
+
+/* If WIFSIGNALED(STATUS), the terminating signal.  */
+#define	__WTERMSIG(status)	((status) & 0x7f)
+
+/* If WIFSTOPPED(STATUS), the signal that stopped the child.  */
+#define	__WSTOPSIG(status)	__WEXITSTATUS(status)
+
+/* Nonzero if STATUS indicates normal termination.  */
+#define	__WIFEXITED(status)	(__WTERMSIG(status) == 0)
+
+/* Nonzero if STATUS indicates the child is stopped.  */
+#define	__WIFSTOPPED(status)	(((status) & 0x7f) == 0x7f)
+
+/* Linux uses 0xffff, BSD uses SIGCONT */
+#define __W_CONTINUED		0x13
+#define	__WCOREFLAG		0x80
+/* Nonzero if STATUS indicates the child continued after a stop. */
+#define __WIFCONTINUED(status)	((status) == __W_CONTINUED)
+
+/* Nonzero if STATUS indicates the child dumped core.  */
+#define	__WCOREDUMP(status)	((status) & __WCOREFLAG)
+
+/* Nonzero if STATUS indicates termination by a signal.  */
+#define __WIFSIGNALED(status) \
+  (!__WIFSTOPPED(status) && !__WIFEXITED(status) && !__WIFCONTINUED(status))
+
+/* Macros for constructing status values.  */
+#define	__W_EXITCODE(ret, sig)	((ret) << 8 | (sig))
+#define	__W_STOPCODE(sig)	((sig) << 8 | 0x7f)
+
+
+
+#ifdef	__USE_MISC
+
+# include <endian.h>
+
+union wait
+  {
+    int w_status;
+    struct
+      {
+# if	__BYTE_ORDER == __LITTLE_ENDIAN
+	unsigned int __w_termsig:7; /* Terminating signal.  */
+	unsigned int __w_coredump:1; /* Set if dumped core.  */
+	unsigned int __w_retcode:8; /* Return code if exited normally.  */
+	unsigned int:16;
+# endif				/* Little endian.  */
+# if	__BYTE_ORDER == __BIG_ENDIAN
+	unsigned int:16;
+	unsigned int __w_retcode:8;
+	unsigned int __w_coredump:1;
+	unsigned int __w_termsig:7;
+# endif				/* Big endian.  */
+      } __wait_terminated;
+    struct
+      {
+# if	__BYTE_ORDER == __LITTLE_ENDIAN
+	unsigned int __w_stopval:8; /* W_STOPPED if stopped.  */
+	unsigned int __w_stopsig:8; /* Stopping signal.  */
+	unsigned int:16;
+# endif				/* Little endian.  */
+# if	__BYTE_ORDER == __BIG_ENDIAN
+	unsigned int:16;
+	unsigned int __w_stopsig:8; /* Stopping signal.  */
+	unsigned int __w_stopval:8; /* W_STOPPED if stopped.  */
+# endif				/* Big endian.  */
+      } __wait_stopped;
+  };
+
+# define w_termsig	__wait_terminated.__w_termsig
+# define w_coredump	__wait_terminated.__w_coredump
+# define w_retcode	__wait_terminated.__w_retcode
+# define w_stopsig	__wait_stopped.__w_stopsig
+# define w_stopval	__wait_stopped.__w_stopval
+
+#endif	/* Use BSD.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/brk.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2004, 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Robert Millan
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sysdep.h>
+
+extern int __syscall_obreak (void *addr);
+libc_hidden_proto (__syscall_obreak)
+
+extern char _end[];
+
+/* sbrk.c expects this.  */
+void *__curbrk = _end;
+
+/* Set the end of the process's data space to ADDR.
+   Return 0 if successful, -1 if not.  */
+int
+__brk (void *addr)
+{
+  if ((char*)addr < _end)
+    return 0;
+
+  if (INLINE_SYSCALL (obreak, 1, addr) == -1)
+    {
+      __set_errno (ENOMEM);
+      return -1;
+    }
+
+  __curbrk = addr;
+  return 0;
+}
+weak_alias (__brk, brk)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/check_fds.c
@@ -0,0 +1 @@
+void __libc_check_standard_fds (void) {;}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/check_native.c
@@ -0,0 +1,42 @@
+/* Determine whether interfaces use native transport.  Dummy version.
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <assert.h>
+#include <errno.h>
+#include <ifaddrs.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <sys/ioctl.h>
+
+#include <not-cancel.h>
+
+
+void
+__check_native (uint32_t a1_index, int *a1_native,
+		uint32_t a2_index, int *a2_native)
+{
+
+#warning __check_native() not yet implemented
+  return;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/check_pf.c
@@ -0,0 +1 @@
+#include <inet/check_pf.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/clock.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991, 1997, 1998, 1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <time.h>
+
+#ifdef	__GNUC__
+__inline
+#endif
+static clock_t
+timeval_to_clock_t (const struct timeval *tv)
+{
+  return (clock_t) ((tv->tv_sec * CLOCKS_PER_SEC) +
+		    (tv->tv_usec * CLOCKS_PER_SEC / 1000000));
+}
+
+/* Return the time used by the program so far (user time + system time).  */
+clock_t
+clock (void)
+{
+  struct rusage usage;
+
+  if (__getrusage (RUSAGE_SELF, &usage) < 0)
+    return (clock_t) -1;
+
+  return (timeval_to_clock_t (&usage.ru_stime) +
+	  timeval_to_clock_t (&usage.ru_utime));
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/clock_getres.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+int __syscall_clock_getres(clockid_t clock_id, struct timespec *tp);
+libc_hidden_proto (__syscall_clock_getres)
+
+# define SYSDEP_GETRES \
+	case CLOCK_REALTIME:		\
+	case CLOCK_VIRTUAL:		\
+	case CLOCK_PROF:		\
+	case CLOCK_MONOTONIC:		\
+	case CLOCK_UPTIME:		\
+	case CLOCK_UPTIME_PRECISE:	\
+	case CLOCK_UPTIME_FAST:		\
+	case CLOCK_REALTIME_PRECISE:	\
+	case CLOCK_REALTIME_FAST:	\
+	case CLOCK_MONOTONIC_PRECISE:	\
+	case CLOCK_MONOTONIC_FAST:	\
+	case CLOCK_SECOND:		\
+    retval = INLINE_SYSCALL (clock_getres, 2, clock_id, res);		      \
+    break
+
+/* We handled the REALTIME clock here.  */
+# define HANDLED_REALTIME	1
+
+#include <sysdeps/posix/clock_getres.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/clock_gettime.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include "kernel-posix-cpu-timers.h"
+
+int __syscall_clock_gettime(clockid_t clock_id, struct timespec *tp);
+libc_hidden_proto (__syscall_clock_gettime)
+
+# define SYSDEP_GETTIME \
+	case CLOCK_REALTIME:		\
+	case CLOCK_VIRTUAL:		\
+	case CLOCK_PROF:		\
+	case CLOCK_MONOTONIC:		\
+	case CLOCK_UPTIME:		\
+	case CLOCK_UPTIME_PRECISE:	\
+	case CLOCK_UPTIME_FAST:		\
+	case CLOCK_REALTIME_PRECISE:	\
+	case CLOCK_REALTIME_FAST:	\
+	case CLOCK_MONOTONIC_PRECISE:	\
+	case CLOCK_MONOTONIC_FAST:	\
+	case CLOCK_SECOND:		\
+    retval = INLINE_SYSCALL (clock_gettime, 2, clock_id, tp);		      \
+    break
+
+/* We handled the REALTIME clock here.  */
+# define HANDLED_REALTIME	1
+#include <sysdeps/unix/clock_gettime.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/clock_settime.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include "kernel-posix-cpu-timers.h"
+
+int __syscall_clock_settime(clockid_t clock_id, const struct timespec *tp);
+libc_hidden_proto (__syscall_clock_settime)
+
+# define SYSDEP_SETTIME \
+  case CLOCK_REALTIME:							      \
+    retval = INLINE_SYSCALL (clock_settime, 2, clock_id, tp);		      \
+    break
+/* We handled the REALTIME clock here.  */
+# define HANDLED_REALTIME	1
+
+#include <sysdeps/unix/clock_settime.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/clone.c
@@ -0,0 +1,122 @@
+/* Create a thread.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define __clone __no_broken_clone_decl
+#include <sched.h>
+#include <sys/rfork.h>
+#include <errno.h>
+#include <signal.h>
+#include <stddef.h>
+#include <getosreldate.h>
+#undef __clone
+
+/* __start_thread (flags, child_stack, fn, arg)
+   is roughly equivalent to
+
+     int retval = __rfork (flags);
+     if (retval == 0)
+       {
+         // Here we are in the child thread.
+         %stackpointer = child_stack;
+         _exit (fn (arg));
+       }
+     return retval;
+
+   but it cannot be done in portable C because it must access fn and arg
+   after having replaced the stack pointer.  */
+
+extern int __start_thread (int flags, void *child_stack,
+			   int (*fn) (void *), void *arg);
+
+int __clone (int (*fn) (void *), void *child_stack, int flags, void *arg)
+{
+  int rfork_flags = RFPROC;
+
+  if (fn == NULL || child_stack == NULL)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  /* This implementation of clone() does not support all Linux flags.  */
+  if (flags & ~(CSIGNAL | CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND
+		| CLONE_VFORK | CLONE_SYSVSEM))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  if ((flags & CSIGNAL) != SIGCHLD)
+  {
+    if (__kernel_getosreldate() >= 802510)
+                /* we slightly cheat here, */
+                /* the 9.x snapshot prior to r223966 does not support it too */
+    {
+      if ((flags & CSIGNAL) & ~RFTSIGMASK)
+	{
+	  __set_errno (EINVAL);
+	  return -1;
+	}
+        rfork_flags |= (RFTSIGZMB | RFTSIGFLAGS(flags & CSIGNAL));
+    }
+    else
+    {
+      if ((flags & CSIGNAL) & ~RFTHPNMASK)
+	{
+	  __set_errno (EINVAL);
+	  return -1;
+	}
+      if ((flags & CSIGNAL) == 0)
+        rfork_flags |= (RFLINUXTHPN | ((SIGCHLD) <<  RFTHPNSHIFT));
+      else
+        rfork_flags |= (RFLINUXTHPN | ((flags & CSIGNAL) <<  RFTHPNSHIFT));
+    }
+  } 
+  if (flags & CLONE_VM)
+    rfork_flags |= RFMEM;
+
+  if (flags & CLONE_FS)
+    /* Sharing the filesystem related info (umask, cwd, root dir)
+       is not supported by rfork.  Ignore this; let's hope programs
+       will set their umask and cwd before spawning threads.  */
+    ;
+
+  if (flags & CLONE_SYSVSEM)
+    /* Ignore this; it has been introduced into linuxthreads in post 2.4 glibc */
+    ;
+
+  if (!(flags & CLONE_FILES))
+    rfork_flags |= RFFDG;
+
+  if (flags & CLONE_SIGHAND)
+    {
+      rfork_flags |= RFSIGSHARE;
+      /* Also set the undocumented flag RFTHREAD.  It has the effect that when
+	 the thread leader exits, all threads belonging to it are killed.  */
+      rfork_flags |= RFTHREAD;
+    }
+
+  if (flags & CLONE_VFORK)
+    rfork_flags |= RFPPWAIT;
+
+  return __start_thread (rfork_flags, child_stack, fn, arg);
+}
+
+weak_alias (__clone, clone)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/configure
@@ -0,0 +1,423 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/bsd/bsd4.4/kfreebsd.
+
+# The kFreeBSD headers can be found in
+#   /usr/src/sys/
+# Check whether this directory is available.
+if test -z "$sysheaders" &&
+   test "x$cross_compiling" = xno &&
+   test -d /usr/src/sys/ ; then
+  sysheaders="/usr/src/sys/"
+  ccheaders=`$CC -print-file-name=include`
+      SYSINCLUDES="-I $sysheaders"
+fi
+
+# Don't bother trying to generate any glue code to be compatible with the
+# existing system library, because we are the only system library.
+inhibit_glue=yes
+
+if test -n "$sysheaders"; then
+  OLD_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking installed kFreeBSD kernel header files" >&5
+$as_echo_n "checking installed kFreeBSD kernel header files... " >&6; }
+if test "${libc_cv_kfreebsd830+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <osreldate.h>
+#if !defined(__FreeBSD_kernel_version) && defined(__FreeBSD_version)
+#define __FreeBSD_kernel_version __FreeBSD_version
+#endif
+#if !defined __FreeBSD_kernel_version || __FreeBSD_kernel_version <  (8 *100000+ 3 *1000+ 0) /* 8.3.0 */
+eat flaming death
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "eat flaming death" >/dev/null 2>&1; then :
+  libc_cv_kfreebsd830='TOO OLD!'
+else
+  libc_cv_kfreebsd830='8.3.0 or later'
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_kfreebsd830" >&5
+$as_echo "$libc_cv_kfreebsd830" >&6; }
+if test "$libc_cv_kfreebsd830" != '8.3.0 or later'; then
+  as_fn_error "GNU libc requires kernel header files from
+kFreeBSD 8.3.0 or later to be installed before configuring.
+The kernel header files are found usually in /usr/src/sys/; make sure
+these directories use files from kFreeBSD 8.3.0 or later.
+This check uses <osreldate.h>, so
+make sure that file was built correctly when installing the kernel header
+files.  To use kernel headers not from /usr/src/sys/, use the
+configure option --with-headers." "$LINENO" 5
+fi
+
+# Check whether --enable-compatible-utmp was given.
+if test "${enable_compatible_utmp+set}" = set; then :
+  enableval=$enable_compatible_utmp; enable_utmp_compat=$enableval
+else
+  enable_utmp_compat=no
+fi
+
+if test "$enable_utmp_compat" = no; then
+  utmp_subdir=utmp-utmpx
+else
+  utmp_subdir=utmp-compat
+fi
+sysnames="$sysnames sysdeps/unix/bsd/bsd4.4/kfreebsd/$utmp_subdir"
+
+# If the user gave a minimal version number test whether the available
+# kernel headers are young enough.  Additionally we have minimal
+# kernel versions for some architectures.  If a previous configure fragment
+# set arch_minimum_kernel already, let that override our defaults here.
+# Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
+# if appropriate too.
+test -n "$arch_minimum_kernel" ||
+case "$machine" in
+  i386*)
+    libc_cv_gcc_unwind_find_fde=yes
+    arch_minimum_kernel=8.3.0
+    ;;
+  x86_64*)
+    arch_minimum_kernel=8.3.0
+    ;;
+  *)
+    arch_minimum_kernel=8.3.0
+    ;;
+esac
+if test -n "$minimum_kernel"; then
+
+  user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
+  arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
+
+  if test $user_version -lt $arch_version; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
+$as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
+    minimum_kernel=$arch_minimum_kernel
+  fi
+else
+  if test $arch_minimum_kernel != '8.3.0'; then
+    minimum_kernel=$arch_minimum_kernel
+  fi
+fi
+
+if test -n "$minimum_kernel"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
+$as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
+  hdrnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 100000 + \2 * 1000 + \3)/'`;
+  decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+  abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <osreldate.h>
+#if !defined(__FreeBSD_kernel_version) && defined(__FreeBSD_version)
+#define __FreeBSD_kernel_version __FreeBSD_version
+#endif
+#if __FreeBSD_kernel_version < $hdrnum
+eat flaming death
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "eat flaming death" >/dev/null 2>&1; then :
+  libc_minimum_kernel='too old!'
+else
+  libc_minimum_kernel=ok
+fi
+rm -f conftest*
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
+$as_echo "$libc_minimum_kernel" >&6; }
+  if test "$libc_minimum_kernel" = ok; then
+    cat >>confdefs.h <<_ACEOF
+#define __KFREEBSD_KERNEL_VERSION $decnum
+_ACEOF
+
+    cat >>confdefs.h <<_ACEOF
+#define __ABI_TAG_VERSION $abinum
+_ACEOF
+
+  else
+    as_fn_error "*** The available kernel headers are older than the requested
+*** compatible kernel version" "$LINENO" 5
+  fi
+fi
+
+if test -n "$sysheaders"; then
+  CPPFLAGS=$OLD_CPPFLAGS
+fi
+# The Linux filesystem standard prescribes where to place "essential"
+# files.  I.e., when the installation prefix is "/usr" we have to place
+# shared library objects and the configuration files on the root partition
+# in /lib and /etc.
+case "$prefix" in
+/usr | /usr/)
+  # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
+  case $machine in
+  sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
+  mips/mips64/n64/* )
+    libc_cv_slibdir="/lib64"
+    if test "$libdir" = '${exec_prefix}/lib'; then
+      libdir='${exec_prefix}/lib64';
+      # Locale data can be shared between 32bit and 64bit libraries
+      libc_cv_complocaledir='${exec_prefix}/lib/locale'
+    fi
+    ;;
+  mips/mips64/n32/* )
+    libc_cv_slibdir="/lib32"
+    if test "$libdir" = '${exec_prefix}/lib'; then
+      libdir='${exec_prefix}/lib32';
+      # Locale data can be shared between 32bit and 64bit libraries
+      libc_cv_complocaledir='${exec_prefix}/lib/locale'
+    fi
+    ;;
+  *)
+    libc_cv_slibdir="/lib"
+    ;;
+  esac
+  # Allow the user to override the path with --sysconfdir
+  if test $sysconfdir = '${prefix}/etc'; then
+    libc_cv_sysconfdir=/etc
+  else
+    libc_cv_sysconfdir=$sysconfdir
+   fi
+  libc_cv_rootsbindir="/sbin"
+  ;;
+esac
+
+
+# Put exception handling support into libc, so that not every shared
+# library needs to include it.
+# FIXME: Does not work yet.
+libc_cv_gcc_unwind_find_fde=no
+
+
+# Under kFreeBSD the FBTL add-on should be available.
+case $add_ons in
+  # It is available.  Good.
+  *fbtl*)
+    fbtl_missing=
+    ;;
+  *)
+    fbtl_missing=yes
+    ;;
+esac
+
+if test "$fbtl_missing"; then
+  if test $enable_sanity = yes; then
+    echo "\
+*** On GNU/kFreeBSD systems it is normal to compile GNU libc with the
+*** \`fbtl' add-on.  Without that, the library will be
+*** incompatible with normal GNU/kFreeBSD systems.
+*** If you really mean to not use this add-on, run configure again
+*** using the extra parameter \`--disable-sanity-checks'."
+    exit 1
+  else
+    echo "\
+*** WARNING: Are you sure you do not want to use the \`fbtl'
+*** add-on?"
+  fi
+fi
+
+if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
+  if test $enable_sanity = yes; then
+    echo "\
+*** On GNU/kFreeBSD systems the GNU C Library should not be installed into
+*** /usr/local since this might make your system totally unusable.
+*** We strongly advise to use a different prefix.  For details read the FAQ.
+*** If you really mean to do this, run configure again using the extra
+*** parameter \`--disable-sanity-checks'."
+    exit 1
+  else
+    echo "\
+*** WARNING: Do you really want to install the GNU C Library into /usr/local?
+*** This might make your system totally unusable, for details read the FAQ."
+  fi
+fi
+
+
+# One kFreeBSD we use ldconfig.
+use_ldconfig=yes
+
+# We need some extensions to the `ldd' script.
+
+case "$machine" in
+  x86_64*)
+    ldd_rewrite_script=$dir/x86_64/ldd-rewrite.sed
+    ;;
+  *)
+    ;;
+esac
+
+
+if test $host = $build; then
+  # If $prefix/include/{net,scsi} are symlinks, make install will
+  # clobber what they're linked to (probably a kernel tree).
+  # test -L ought to work on all Linux boxes.
+  if test "x$prefix" != xNONE; then
+    ac_prefix=$prefix
+  else
+    ac_prefix=$ac_default_prefix
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlinks in ${ac_prefix}/include" >&5
+$as_echo_n "checking for symlinks in ${ac_prefix}/include... " >&6; }
+  ac_message=
+  if test -L ${ac_prefix}/include/net; then
+    ac_message="$ac_message
+   ${ac_prefix}/include/net is a symlink"
+  fi
+  if test -L ${ac_prefix}/include/scsi; then
+    ac_message="$ac_message
+   ${ac_prefix}/include/scsi is a symlink"
+  fi
+  if test -n "$ac_message"; then
+    as_fn_error "$ac_message
+\`make install' will destroy the target of the link(s).
+Delete the links and re-run configure, or better still, move the entire
+${ac_prefix}/include directory out of the way." "$LINENO" 5
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+  fi
+fi
+
+# We support internal syscalls.
+# It is advertised as inlined syscalls availability ...
+$as_echo "#define HAVE_INLINED_SYSCALLS 1" >>confdefs.h
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/configure.in
@@ -0,0 +1,258 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/bsd/bsd4.4/kfreebsd.
+
+# The kFreeBSD headers can be found in
+#   /usr/src/sys/
+# Check whether this directory is available.
+if test -z "$sysheaders" &&
+   test "x$cross_compiling" = xno &&
+   test -d /usr/src/sys/ ; then
+  sysheaders="/usr/src/sys/"
+  ccheaders=`$CC -print-file-name=include`
+  dnl We don't have to use -nostdinc.  We just want one more directory
+  dnl to be used.
+  SYSINCLUDES="-I $sysheaders"
+fi
+
+# Don't bother trying to generate any glue code to be compatible with the
+# existing system library, because we are the only system library.
+inhibit_glue=yes
+
+define([LIBC_KFREEBSD_VERSION],[8.3.0])dnl
+if test -n "$sysheaders"; then
+  OLD_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
+fi
+define([libc_cv_kfreebsdVER], [libc_cv_kfreebsd]patsubst(LIBC_KFREEBSD_VERSION,[\.]))dnl
+AC_CACHE_CHECK(installed kFreeBSD kernel header files, libc_cv_kfreebsdVER, [dnl
+AC_EGREP_CPP([eat flaming death], [#include <osreldate.h>
+#if !defined(__FreeBSD_kernel_version) && defined(__FreeBSD_version)
+#define __FreeBSD_kernel_version __FreeBSD_version
+#endif
+#if !defined __FreeBSD_kernel_version || __FreeBSD_kernel_version < ]dnl
+patsubst(LIBC_KFREEBSD_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
+[ (\1 *100000+ \2 *1000+ \3) /* \1.\2.\3 */])[
+eat flaming death
+#endif],
+	     libc_cv_kfreebsdVER='TOO OLD!',
+	     libc_cv_kfreebsdVER='LIBC_KFREEBSD_VERSION or later')])
+if test "$libc_cv_kfreebsdVER" != 'LIBC_KFREEBSD_VERSION or later'; then
+  AC_MSG_ERROR([GNU libc requires kernel header files from
+kFreeBSD LIBC_KFREEBSD_VERSION or later to be installed before configuring.
+The kernel header files are found usually in /usr/src/sys/; make sure
+these directories use files from kFreeBSD LIBC_KFREEBSD_VERSION or later.
+This check uses <osreldate.h>, so
+make sure that file was built correctly when installing the kernel header
+files.  To use kernel headers not from /usr/src/sys/, use the
+configure option --with-headers.])
+fi
+
+AC_ARG_ENABLE([compatible-utmp],
+	AC_HELP_STRING([--disable-compatible-utmp],
+		[use a struct utmp which is the same as struct utmpx, as on kFreeBSD, but incompatible with FreeBSD]),
+	[enable_utmp_compat=$enableval],
+	[enable_utmp_compat=no])
+if test "$enable_utmp_compat" = no; then
+  utmp_subdir=utmp-utmpx
+else
+  utmp_subdir=utmp-compat
+fi
+sysnames="$sysnames sysdeps/unix/bsd/bsd4.4/kfreebsd/$utmp_subdir"
+
+# If the user gave a minimal version number test whether the available
+# kernel headers are young enough.  Additionally we have minimal
+# kernel versions for some architectures.  If a previous configure fragment
+# set arch_minimum_kernel already, let that override our defaults here.
+# Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
+# if appropriate too.
+test -n "$arch_minimum_kernel" ||
+case "$machine" in
+  i386*)
+    libc_cv_gcc_unwind_find_fde=yes
+    arch_minimum_kernel=8.3.0
+    ;;
+  x86_64*)
+    arch_minimum_kernel=8.3.0
+    ;;
+  *)
+    arch_minimum_kernel=8.3.0
+    ;;
+esac
+if test -n "$minimum_kernel"; then
+  changequote(,)
+  user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
+  arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
+  changequote([,])
+  if test $user_version -lt $arch_version; then
+    AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
+    minimum_kernel=$arch_minimum_kernel
+  fi
+else
+  if test $arch_minimum_kernel != '8.3.0'; then
+    minimum_kernel=$arch_minimum_kernel
+  fi
+fi
+
+if test -n "$minimum_kernel"; then
+  AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
+changequote(,)dnl
+  hdrnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 100000 + \2 * 1000 + \3)/'`;
+  decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+  abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+changequote([,])dnl
+  AC_EGREP_CPP([eat flaming death], [#include <osreldate.h>
+#if !defined(__FreeBSD_kernel_version) && defined(__FreeBSD_version)
+#define __FreeBSD_kernel_version __FreeBSD_version
+#endif
+#if __FreeBSD_kernel_version < $hdrnum
+eat flaming death
+#endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
+  AC_MSG_RESULT($libc_minimum_kernel)
+  if test "$libc_minimum_kernel" = ok; then
+    AC_DEFINE_UNQUOTED(__KFREEBSD_KERNEL_VERSION, $decnum)
+    AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
+  else
+    AC_MSG_ERROR([*** The available kernel headers are older than the requested
+*** compatible kernel version])
+  fi
+fi
+
+if test -n "$sysheaders"; then
+  CPPFLAGS=$OLD_CPPFLAGS
+fi
+# The Linux filesystem standard prescribes where to place "essential"
+# files.  I.e., when the installation prefix is "/usr" we have to place
+# shared library objects and the configuration files on the root partition
+# in /lib and /etc.
+case "$prefix" in
+/usr | /usr/)
+  # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
+  case $machine in
+  sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
+  mips/mips64/n64/* )
+    libc_cv_slibdir="/lib64"
+    if test "$libdir" = '${exec_prefix}/lib'; then
+      libdir='${exec_prefix}/lib64';
+      # Locale data can be shared between 32bit and 64bit libraries
+      libc_cv_localedir='${exec_prefix}/lib/locale'
+    fi
+    ;;
+  mips/mips64/n32/* )
+    libc_cv_slibdir="/lib32"
+    if test "$libdir" = '${exec_prefix}/lib'; then
+      libdir='${exec_prefix}/lib32';
+      # Locale data can be shared between 32bit and 64bit libraries
+      libc_cv_localedir='${exec_prefix}/lib/locale'
+    fi
+    ;;
+  *)
+    libc_cv_slibdir="/lib"
+    ;;
+  esac
+  # Allow the user to override the path with --sysconfdir
+  if test $sysconfdir = '${prefix}/etc'; then
+    libc_cv_sysconfdir=/etc
+  else
+    libc_cv_sysconfdir=$sysconfdir
+   fi
+  libc_cv_rootsbindir="/sbin"
+  ;;
+esac
+
+
+# Put exception handling support into libc, so that not every shared
+# library needs to include it.
+# FIXME: Does not work yet.
+libc_cv_gcc_unwind_find_fde=no
+
+
+# Under kFreeBSD the FBTL add-on should be available.
+case $add_ons in
+  # It is available.  Good.
+  *fbtl*)
+    fbtl_missing=
+    ;;
+  *)
+    fbtl_missing=yes
+    ;;
+esac
+
+if test "$fbtl_missing"; then
+  if test $enable_sanity = yes; then
+    echo "\
+*** On GNU/kFreeBSD systems it is normal to compile GNU libc with the
+*** \`fbtl' add-on.  Without that, the library will be
+*** incompatible with normal GNU/kFreeBSD systems.
+*** If you really mean to not use this add-on, run configure again
+*** using the extra parameter \`--disable-sanity-checks'."
+    exit 1
+  else
+    echo "\
+*** WARNING: Are you sure you do not want to use the \`fbtl'
+*** add-on?"
+  fi
+fi
+
+if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
+  if test $enable_sanity = yes; then
+    echo "\
+*** On GNU/kFreeBSD systems the GNU C Library should not be installed into
+*** /usr/local since this might make your system totally unusable.
+*** We strongly advise to use a different prefix.  For details read the FAQ.
+*** If you really mean to do this, run configure again using the extra
+*** parameter \`--disable-sanity-checks'."
+    exit 1
+  else
+    echo "\
+*** WARNING: Do you really want to install the GNU C Library into /usr/local?
+*** This might make your system totally unusable, for details read the FAQ."
+  fi
+fi
+
+
+# One kFreeBSD we use ldconfig.
+use_ldconfig=yes
+
+# We need some extensions to the `ldd' script.
+changequote(,)
+case "$machine" in
+  x86_64*)
+    ldd_rewrite_script=$dir/x86_64/ldd-rewrite.sed
+    ;;
+  *)
+    ;;
+esac
+changequote([,])
+
+if test $host = $build; then
+  # If $prefix/include/{net,scsi} are symlinks, make install will
+  # clobber what they're linked to (probably a kernel tree).
+  # test -L ought to work on all Linux boxes.
+  if test "x$prefix" != xNONE; then
+    ac_prefix=$prefix
+  else
+    ac_prefix=$ac_default_prefix
+  fi
+  AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
+  ac_message=
+  if test -L ${ac_prefix}/include/net; then
+    ac_message="$ac_message
+   ${ac_prefix}/include/net is a symlink"
+  fi
+  if test -L ${ac_prefix}/include/scsi; then
+    ac_message="$ac_message
+   ${ac_prefix}/include/scsi is a symlink"
+  fi
+  if test -n "$ac_message"; then
+    AC_MSG_ERROR([$ac_message
+\`make install' will destroy the target of the link(s).
+Delete the links and re-run configure, or better still, move the entire
+${ac_prefix}/include directory out of the way.])
+  else
+    AC_MSG_RESULT(ok)
+  fi
+fi
+
+# We support internal syscalls.
+# It is advertised as inlined syscalls availability ...
+AC_DEFINE(HAVE_INLINED_SYSCALLS)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/connect.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2005.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/socket.h>
+#include <sysdep.h>
+#include <sysdep-cancel.h>
+
+/* According to POSIX.1-2004 the len argument specifies the length of
+   the sockaddr structure pointed to by the addrarg argument. However
+   the FreeBSD kernel waits the actual length of the address stored
+   there. The code below emulate this behaviour.  */
+
+extern int __libc_sa_len (sa_family_t __af);
+libc_hidden_proto (__libc_sa_len)
+
+extern int __syscall_connect (int fd, __CONST_SOCKADDR_ARG addr,
+			      socklen_t addrlen);
+libc_hidden_proto (__syscall_connect)
+
+/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
+   For connectionless socket types, just set the default address to send to
+   and the only address from which to accept transmissions.
+   Return 0 on success, -1 for errors.  */
+
+int
+__libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t addrlen)
+{
+  socklen_t new_addrlen;
+
+  new_addrlen = __libc_sa_len ((addr.__sockaddr__)->sa_family);
+
+  /* Only allow a smaller size, otherwise it could lead to
+    stack corruption */
+  if ((new_addrlen != 0) && (new_addrlen < addrlen))
+    addrlen = new_addrlen;
+
+  /* We pass 3 arguments.  */
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (connect, 3, fd, addr.__sockaddr__, addrlen);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+  int result = INLINE_SYSCALL (connect, 3, fd, addr.__sockaddr__, addrlen);
+  LIBC_CANCEL_RESET (oldtype);
+  return result;
+}
+
+weak_alias (__libc_connect, __connect)
+weak_alias (__libc_connect, connect)
+libc_hidden_weak (__connect)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/cpuset-kern.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* From <sys/cpuset.h> */
+
+
+/*
+ * Valid cpulevel_t values.
+ */
+#define	CPU_LEVEL_ROOT		1	/* All system cpus. */
+#define	CPU_LEVEL_CPUSET	2	/* Available cpus for which. */
+#define	CPU_LEVEL_WHICH		3	/* Actual mask/id for which. */
+
+/*
+ * Valid cpuwhich_t values.
+ */
+#define	CPU_WHICH_TID		1	/* Specifies a thread id. */
+#define	CPU_WHICH_PID		2	/* Specifies a process id. */
+#define	CPU_WHICH_CPUSET	3	/* Specifies a set id. */
+#define	CPU_WHICH_IRQ		4	/* Specifies an irq #. */
+#define	CPU_WHICH_JAIL		5	/* Specifies a jail id. */
+
+/*
+ * Reserved cpuset identifiers.
+ */
+#define	CPUSET_INVALID	-1
+#define	CPUSET_DEFAULT	0
+
+extern int __syscall_cpuset_getaffinity(int level, int which, int64_t id,
+					size_t setsize, cpu_set_t *mask);
+libc_hidden_proto(__syscall_cpuset_getaffinity)
+
+
+extern int __syscall_cpuset_setaffinity(int level, int which, int64_t id,
+					size_t setsize, const cpu_set_t *mask);
+libc_hidden_proto(__syscall_cpuset_setaffinity)
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/devname.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+
+char *
+__devname_r(__dev_t dev, __mode_t type, char *buf, int len)
+{
+	int i;
+	size_t j;
+	const char *r;
+
+	if ((type & S_IFMT) == S_IFCHR) {
+		j = len;
+		i = __sysctlbyname("kern.devname", buf, &j, &dev, sizeof (dev));
+		if (i == 0)
+		    return (buf);
+	}
+
+	/* Finally just format it */
+	if (dev == NODEV)
+		r = "#NODEV";
+	else 
+		r = "#%c:%d:0x%x";
+	__snprintf(buf, len, r,
+	    (type & S_IFMT) == S_IFCHR ? 'C' : 'B', major(dev), minor(dev));
+	return (buf);
+}
+
+
+char *
+__devname(__dev_t dev, __mode_t type)
+{
+	static char buf[SPECNAMELEN + 1];
+
+	return(__devname_r(dev, type, buf, sizeof(buf)));
+}
+weak_alias (__devname_r, devname_r)
+weak_alias (__devname, devname)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-execstack.c
@@ -0,0 +1,58 @@
+/* Stack executability handling for GNU dynamic linker.  Linux version.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <ldsodefs.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <libintl.h>
+#include <stdbool.h>
+#include <stackinfo.h>
+#include <caller.h>
+
+
+extern int __stack_prot attribute_relro attribute_hidden;
+
+
+int
+internal_function
+_dl_make_stack_executable (void **stack_endp)
+{
+  /* This gives us the highest/lowest page that needs to be changed.  */
+  uintptr_t page = ((uintptr_t) *stack_endp
+		    & -(intptr_t) GLRO(dl_pagesize));
+
+  /* Challenge the caller.  */
+  if (__builtin_expect (__check_caller (RETURN_ADDRESS (0),
+					allow_ldso|allow_libpthread) != 0, 0)
+      || __builtin_expect (*stack_endp != __libc_stack_end, 0))
+    return EPERM;
+
+  if (__builtin_expect (__mprotect ((void *) page, GLRO(dl_pagesize),
+				    __stack_prot) != 0, 0))
+    return errno;
+
+  /* Clear the address.  */
+  *stack_endp = NULL;
+
+  /* Remember that we changed the permission.  */
+  GL(dl_stack_flags) |= PF_X;
+
+  return 0;
+}
+rtld_hidden_def (_dl_make_stack_executable)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-getcwd.c
@@ -0,0 +1 @@
+#include "getcwd.c"
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-openat64.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gmain.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+extern int __syscall_openat (int fd, const char *path, int flag, mode_t mode);
+libc_hidden_proto (__syscall_openat)
+
+int
+openat64 (int dfd, const char *file, int oflag, ...)
+{
+  assert ((oflag & O_CREAT) == 0);
+
+  return INLINE_SYSCALL (openat, 4, dfd, file, oflag, 0);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-origin.c
@@ -0,0 +1,123 @@
+/* Find path of executable.
+   Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <ldsodefs.h>
+#include <sysdep.h>
+
+#include <dl-dst.h>
+
+const char *_self_program_name_from_auxv attribute_hidden;
+
+static int
+_dl_self_name(char *buf, int buflen)
+{
+  int len, wdlen;
+
+  /* try /proc/self/exe symlink. */  
+  len = __readlink("/proc/self/exe", buf, buflen);
+
+  if (len > 0 && buf[0] == '/')
+    return len;
+
+  if (!_self_program_name_from_auxv)
+    return -1;
+
+  len = strlen(_self_program_name_from_auxv);
+  if (len > 0 && _self_program_name_from_auxv[0] == '/')
+  {
+    /* absolute file name */
+    if (len < buflen)
+    {
+      strcpy(buf, _self_program_name_from_auxv);
+      return len;
+    }
+    memcpy(buf, _self_program_name_from_auxv, buflen);
+    buf[buflen - 1] = 0;
+    return buflen - 1;
+  };
+  
+  /* relative file name, do our best */
+  if (NULL == __getcwd(buf, buflen))
+    return -1;
+  
+  wdlen = strlen(buf);
+  buf[wdlen] = '/';
+  if ((wdlen + len + 1) < buflen)
+  {
+    strcpy(buf + wdlen + 1, _self_program_name_from_auxv);
+    return wdlen + len + 1;
+  }
+  memcpy(buf + wdlen + 1, _self_program_name_from_auxv, buflen - wdlen - 1);  
+  buf[buflen - 1] = 0;
+  return buflen - 1;  
+}
+
+
+
+const char *
+_dl_get_origin (void)
+{
+  char linkval[2*PATH_MAX];
+  char *result;
+  int len;
+
+  len = _dl_self_name(linkval, sizeof(linkval));
+
+  if (len > 0)
+    {
+      /* We can use this value.  */
+      while (len > 1 && linkval[len - 1] != '/')
+	--len;
+      result = (char *) malloc (len + 1);
+      if (result == NULL)
+	result = (char *) -1;
+      else if (len == 1)
+	memcpy (result, "/", 2);
+      else
+	*((char *) __mempcpy (result, linkval, len - 1)) = '\0';
+    }
+  else
+    {
+      result = (char *) -1;
+      /* We use the environment variable LD_ORIGIN_PATH.  If it is set make
+	 a copy and strip out trailing slashes.  */
+      if (GLRO(dl_origin_path) != NULL)
+	{
+	  size_t len = strlen (GLRO(dl_origin_path));
+	  result = (char *) malloc (len + 1);
+	  if (result == NULL)
+	    result = (char *) -1;
+	  else
+	    {
+	      char *cp = __mempcpy (result, GLRO(dl_origin_path), len);
+	      while (cp > result + 1 && cp[-1] == '/')
+		--cp;
+	      *cp = '\0';
+	    }
+	}
+    }
+
+  return result;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-osinfo.h
@@ -0,0 +1,94 @@
+/* Operating system specific code  for generic dynamic loader functions.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <kernel-features.h>
+#include <dl-sysdep.h>
+#include <endian.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <not-cancel.h>
+
+#ifndef MIN
+# define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+#define DL_SYSDEP_OSCHECK(FATAL)					      \
+  do {									      \
+    /* Test whether the kernel is new enough.  This test is only performed    \
+       if the library is not compiled to run on all kernels.  */	      \
+									      \
+    int version = _dl_discover_osversion ();				      \
+    if (__builtin_expect (version >= 0, 1))				      \
+      {									      \
+	if (__builtin_expect (GLRO(dl_osversion) == 0, 1)		      \
+	    || GLRO(dl_osversion) > version)				      \
+	  GLRO(dl_osversion) = version;					      \
+									      \
+	/* Now we can test with the required version.  */		      \
+	if (__KFREEBSD_KERNEL_VERSION > 0 && 				      \
+	    version < __KFREEBSD_KERNEL_VERSION)   			      \
+	  /* Not sufficent.  */						      \
+	  FATAL ("FATAL: kernel too old\n");				      \
+      }									      \
+    else if (__KFREEBSD_KERNEL_VERSION > 0)				      \
+      FATAL ("FATAL: cannot determine kernel version\n");		      \
+  } while (0)
+
+static inline uintptr_t __attribute__ ((always_inline))
+_dl_setup_stack_chk_guard (void *dl_random)
+{
+  union
+  {
+    uintptr_t num;
+    unsigned char bytes[sizeof (uintptr_t)];
+  } ret;
+
+    {
+      const size_t filllen = sizeof (ret.bytes) - 1;
+      ret.num = 0;
+# ifdef ENABLE_STACKGUARD_RANDOMIZE
+      int fd = open_not_cancel_2 ("/dev/urandom", O_RDONLY);
+      if (fd >= 0)
+	{
+	  ssize_t reslen = read_not_cancel (fd, ret.bytes + 1, filllen);
+	  close_not_cancel_no_status (fd);
+	  if (reslen == (ssize_t) filllen)
+	    return ret.num;
+	}
+# endif
+      ret.bytes[filllen] = 255;
+      ret.bytes[filllen - 1] = '\n';
+    }
+  return ret.num;
+}
+
+static inline uintptr_t __attribute__ ((always_inline))
+_dl_setup_pointer_guard (void *dl_random, uintptr_t stack_chk_guard)
+{
+  uintptr_t ret;
+
+  ret = stack_chk_guard;
+# ifndef HP_TIMING_NONAVAIL
+  hp_timing_t now;
+  HP_TIMING_NOW (now);
+  ret ^= now;
+# endif
+  return ret;
+}
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-support.c
@@ -0,0 +1,46 @@
+/* Dynamic linker system dependencies for GNU/kFreeBSD.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <ldsodefs.h>
+#ifdef HAVE_AUX_VECTOR
+#include <bits/auxv.h>
+int _dl_clktck;
+
+void
+internal_function
+_dl_aux_init (ElfW(auxv_t) *av)
+{
+  for (; av->a_type != AT_NULL; ++av)
+    switch (av->a_type)
+      {
+      case AT_PAGESZ:
+	GLRO(dl_pagesize) = av->a_un.a_val;
+	break;
+      case AT_PHDR:
+	GL(dl_phdr) = (void *) av->a_un.a_val;
+	break;
+      case AT_PHNUM:
+	GL(dl_phnum) = av->a_un.a_val;
+	break;
+      }
+}
+#undef HAVE_AUX_VECTOR
+#endif
+
+#include <elf/dl-support.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-sysdep.c
@@ -0,0 +1,316 @@
+/* Operating system support for run-time dynamic linker.  GNU/kFreeBSD version.
+   Copyright (C) 1995-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* We conditionalize the whole of this file rather than simply eliding it
+   from the static build, because other sysdeps/ versions of this file
+   might define things needed by a static build.  */
+
+#include <stdlib.h>
+#include <sys/sysctl.h>
+
+#ifdef SHARED
+
+#include <assert.h>
+#include <elf.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <libintl.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <ldsodefs.h>
+#include <_itoa.h>
+#include <fpu_control.h>
+
+#include <entry.h>
+#include <dl-machine.h>
+#include <dl-procinfo.h>
+#include <dl-osinfo.h>
+#include <hp-timing.h>
+#include <tls.h>
+
+extern char **_environ attribute_hidden;
+extern char _end[] attribute_hidden;
+
+/* Protect SUID program against misuse of file descriptors.  */
+extern void __libc_check_standard_fds (void);
+
+#ifdef NEED_DL_BASE_ADDR
+ElfW(Addr) _dl_base_addr;
+#endif
+int __libc_enable_secure attribute_relro = 0;
+rtld_hidden_data_def (__libc_enable_secure)
+int __libc_multiple_libcs = 0;	/* Defining this here avoids the inclusion
+				   of init-first.  */
+/* This variable contains the lowest stack address ever used.  */
+void *__libc_stack_end attribute_relro = NULL;
+rtld_hidden_data_def(__libc_stack_end)
+void *_dl_random attribute_relro = NULL;
+
+#ifndef DL_FIND_ARG_COMPONENTS
+# define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp)	\
+  do {									      \
+    void **_tmp;							      \
+    (argc) = *(long int *) cookie;					      \
+    (argv) = (char **) ((long int *) cookie + 1);			      \
+    (envp) = (argv) + (argc) + 1;					      \
+    for (_tmp = (void **) (envp); *_tmp; ++_tmp)			      \
+      continue;								      \
+    (auxp) = (void *) ++_tmp;						      \
+  } while (0)
+#endif
+
+#ifndef DL_STACK_END
+# define DL_STACK_END(cookie) ((void *) (cookie))
+#endif
+
+
+extern const char *_self_program_name_from_auxv attribute_hidden;
+
+ElfW(Addr)
+_dl_sysdep_start (void **start_argptr,
+		  void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phnum,
+				   ElfW(Addr) *user_entry, ElfW(auxv_t) *auxv))
+{
+  const ElfW(Phdr) *phdr = NULL;
+  ElfW(Word) phnum = 0;
+  ElfW(Addr) user_entry;
+  ElfW(auxv_t) *av;
+  uid_t uid = 0;
+  gid_t gid = 0;
+#ifdef NEED_DL_SYSINFO
+  uintptr_t new_sysinfo = 0;
+#endif
+
+  __libc_stack_end = DL_STACK_END (start_argptr);
+  DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, _dl_argv, _environ,
+			  GLRO(dl_auxv));
+
+  user_entry = (ElfW(Addr)) ENTRY_POINT;
+  GLRO(dl_platform) = NULL; /* Default to nothing known about the platform.  */
+
+  for (av = GLRO(dl_auxv); av->a_type != AT_NULL; av++)
+    switch (av->a_type)
+      {
+      case AT_PHDR:
+	phdr = (void *) av->a_un.a_val;
+	break;
+      case AT_PHNUM:
+	phnum = av->a_un.a_val;
+	break;
+      case AT_PAGESZ:
+	GLRO(dl_pagesize) = av->a_un.a_val;
+	break;
+      case AT_ENTRY:
+	user_entry = av->a_un.a_val;
+	break;
+      case AT_EXECPATH:
+	_self_program_name_from_auxv = (char *) av->a_un.a_val;
+	break;
+#ifdef NEED_DL_BASE_ADDR
+      case AT_BASE:
+	_dl_base_addr = av->a_un.a_val;
+	break;
+#endif
+      }
+
+    {
+      /* Fill in the values we have not gotten from the kernel through the
+	 auxiliary vector.  */
+#  undef SEE
+#  define SEE(UID, var, uid) \
+   var ^= __get##uid ()
+      SEE (UID, uid, uid);
+      SEE (EUID, uid, euid);
+      SEE (GID, gid, gid);
+      SEE (EGID, gid, egid);
+
+      /* If one of the two pairs of IDs does not match this is a setuid
+	 or setgid run.  */
+      __libc_enable_secure = uid | gid;
+    }
+
+#ifndef HAVE_AUX_PAGESIZE
+  if (GLRO(dl_pagesize) == 0)
+    GLRO(dl_pagesize) = __getpagesize ();
+#endif
+
+#if defined NEED_DL_SYSINFO
+  /* Only set the sysinfo value if we also have the vsyscall DSO.  */
+  if (GLRO(dl_sysinfo_dso) != 0 && new_sysinfo)
+    GLRO(dl_sysinfo) = new_sysinfo;
+#endif
+
+#ifdef DL_SYSDEP_INIT
+  DL_SYSDEP_INIT;
+#endif
+
+#ifdef DL_PLATFORM_INIT
+  DL_PLATFORM_INIT;
+#endif
+
+  /* Determine the length of the platform name.  */
+  if (GLRO(dl_platform) != NULL)
+    GLRO(dl_platformlen) = strlen (GLRO(dl_platform));
+
+  if (__sbrk (0) == _end)
+    /* The dynamic linker was run as a program, and so the initial break
+       starts just after our bss, at &_end.  The malloc in dl-minimal.c
+       will consume the rest of this page, so tell the kernel to move the
+       break up that far.  When the user program examines its break, it
+       will see this new value and not clobber our data.  */
+    __sbrk (GLRO(dl_pagesize)
+	    - ((_end - (char *) 0) & (GLRO(dl_pagesize) - 1)));
+
+  /* If this is a SUID program we make sure that FDs 0, 1, and 2 are
+     allocated.  If necessary we are doing it ourself.  If it is not
+     possible we stop the program.  */
+  if (__builtin_expect (__libc_enable_secure, 0))
+    __libc_check_standard_fds ();
+
+  (*dl_main) (phdr, phnum, &user_entry, GLRO(dl_auxv));
+  return user_entry;
+}
+
+void
+internal_function
+_dl_show_auxv (void)
+{
+  char buf[64];
+  ElfW(auxv_t) *av;
+
+  /* Terminate string.  */
+  buf[63] = '\0';
+
+  /* The following code assumes that the AT_* values are encoded
+     starting from 0 with AT_NULL, 1 for AT_IGNORE, and all other values
+     close by (otherwise the array will be too large).  In case we have
+     to support a platform where these requirements are not fulfilled
+     some alternative implementation has to be used.  */
+  for (av = GLRO(dl_auxv); av->a_type != AT_NULL; ++av)
+    {
+      static const struct
+      {
+	const char label[17];
+	enum { unknown = 0, dec, hex, str, ignore } form : 8;
+      } auxvars[] =
+	{
+	  [AT_EXECFD - 2] =		{ "EXECFD:       ", dec },
+	  [AT_PHDR - 2] =		{ "PHDR:         0x", hex },
+	  [AT_PHENT - 2] =		{ "PHENT:        ", dec },
+	  [AT_PHNUM - 2] =		{ "PHNUM:        ", dec },
+	  [AT_PAGESZ - 2] =		{ "PAGESZ:       ", dec },
+	  [AT_BASE - 2] =		{ "BASE:         0x", hex },
+	  [AT_FLAGS - 2] =		{ "FLAGS:        0x", hex },
+	  [AT_ENTRY - 2] =		{ "ENTRY:        0x", hex },
+#ifndef __powerpc__
+	  /* For some odd reason these are not in sys/powerpc/include/elf.h.  */
+	  [AT_NOTELF - 2] =		{ "NOTELF:       ", hex },
+	  [AT_UID - 2] =		{ "UID:          ", dec },
+	  [AT_EUID - 2] =		{ "EUID:         ", dec },
+	  [AT_GID - 2] =		{ "GID:          ", dec },
+	  [AT_EGID - 2] =		{ "EGID:         ", dec },
+#endif
+	  [AT_EXECPATH - 2] =		{ "EXECPATH:     ", str },
+	  [AT_CANARY - 2] =		{ "CANARY:       0x", hex },
+	  [AT_CANARYLEN - 2] =		{ "CANARYLEN:    ", dec },
+	  [AT_OSRELDATE - 2] =		{ "OSRELDATE:    ", dec },
+	  [AT_NCPUS - 2] =		{ "NCPUS:        ", dec },
+	  [AT_PAGESIZES - 2] =		{ "PAGESIZES:    0x", hex },
+	  [AT_PAGESIZESLEN - 2] =	{ "PAGESIZESLEN: ", dec },
+	  [AT_TIMEKEEP - 2] =		{ "TIMEKEEP:     0x", hex },
+	  [AT_STACKPROT - 2] =		{ "STACKPROT:    0x", hex },
+	};
+      unsigned int idx = (unsigned int) (av->a_type - 2);
+
+      if ((unsigned int) av->a_type < 2u || auxvars[idx].form == ignore)
+	continue;
+
+      assert (AT_NULL == 0);
+      assert (AT_IGNORE == 1);
+
+      if (idx < sizeof (auxvars) / sizeof (auxvars[0])
+	  && auxvars[idx].form != unknown)
+	{
+	  const char *val = (char *) av->a_un.a_val;
+
+	  if (__builtin_expect (auxvars[idx].form, dec) == dec)
+	    val = _itoa ((unsigned long int) av->a_un.a_val,
+			 buf + sizeof buf - 1, 10, 0);
+	  else if (__builtin_expect (auxvars[idx].form, hex) == hex)
+	    val = _itoa ((unsigned long int) av->a_un.a_val,
+			 buf + sizeof buf - 1, 16, 0);
+
+	  _dl_printf ("AT_%s%s\n", auxvars[idx].label, val);
+
+	  continue;
+	}
+
+      /* Unknown value: print a generic line.  */
+      char buf2[17];
+      buf2[sizeof (buf2) - 1] = '\0';
+      const char *val2 = _itoa ((unsigned long int) av->a_un.a_val,
+				buf2 + sizeof buf2 - 1, 16, 0);
+      const char *val =  _itoa ((unsigned long int) av->a_type,
+				buf + sizeof buf - 1, 16, 0);
+      _dl_printf ("AT_??? (0x%s): 0x%s\n", val, val2);
+    }
+}
+void
+internal_function
+_dl_sysdep_start_cleanup (void)
+{
+}
+
+
+#endif
+
+
+int
+attribute_hidden
+_dl_discover_osversion (void)
+{
+  int request[2] = { CTL_KERN, KERN_OSRELDATE };
+  size_t len;
+  int version;
+  int subrelease;
+
+  len = sizeof(version);
+  if (__sysctl (request, 2, &version, &len, NULL, 0) < 0)
+    return -1;
+    
+/*
+ * since 8.0 release
+ * scheme is:  <major><two digit minor>Rxx
+ *              'R' is in the range 0 to 4 if this is a release branch or
+ *              x.0-CURRENT before RELENG_*_0 is created, otherwise 'R' is
+ *              in the range 5 to 9.
+ */
+
+  /* Convert to the GLIBC versioning system */
+  subrelease = version % 1000;
+  if (subrelease >= 500)
+      subrelease -= 300;	/* hopefull 55 values suffice for stable update */
+  if (subrelease > 255)		/* it have to fit into byte */
+      subrelease = 255;
+  return ((version / 100000) << 16)		/* major */
+	 | (((version % 100000) / 1000) << 8)   /* minor 	0 -  99 */
+	 | subrelease;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-sysdep.h
@@ -0,0 +1,26 @@
+/* System-specific settings for dynamic linker code.  Linux version.
+   Copyright (C) 2005, 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include_next <dl-sysdep.h>
+
+#ifndef __ASSEMBLER__
+/* Get version of the OS.  */
+extern int _dl_discover_osversion (void) attribute_hidden;
+# define HAVE_DL_DISCOVER_OSVERSION	1
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/dl-writev.h
@@ -0,0 +1,38 @@
+/* Message-writing for the dynamic linker.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sys/uio.h>
+#include <sysdep.h>
+
+/* This is used from only one place: dl-misc.c:_dl_debug_vdprintf.
+   Hence it's in a header with the expectation it will be inlined.
+
+   This is writev, but with a constraint added and others loosened:
+
+   1. Under RTLD_PRIVATE_ERRNO, it must not clobber the private errno
+      when another thread holds the dl_load_lock.
+   2. It is not obliged to detect and report errors at all.
+   3. It's not really obliged to deliver a single atomic write
+      (though it may be preferable).  */
+
+static inline void
+_dl_writev (int fd, const struct iovec *iov, size_t niov)
+{
+  INTERNAL_SYSCALL_DECL (err);
+  INTERNAL_SYSCALL (writev, err, 3, fd, iov, niov);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/faccessat.c
@@ -0,0 +1,64 @@
+/* Test for access to file, relative to open directory.  Linux version.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <kernel-features.h>
+#include <sysdep.h>
+
+extern int __syscall_faccessat (int fd, const char *path, int mode, int flag);
+libc_hidden_proto (__syscall_faccessat)
+
+/*
+   The FreeBSD kernel do not test file access correctly when the 
+   process' real user ID is superuser. In particular, they always return
+   zero when testing execute permissions without regard to whether the 
+   file is executable.
+
+   While this behaviour conforms to POSIX.1-2008, it is explicitely 
+   discouraged. This wrapper implements the recommended behaviour.
+ */
+
+int
+faccessat (int fd, const char *file, int mode, int flag)
+{
+        int result = INLINE_SYSCALL (faccessat, 4, fd, file, mode, flag);
+        if ((result == 0) && (mode & X_OK))
+        {
+          uid_t uid = (flag & AT_EACCESS) ? __geteuid () : __getuid ();
+          if (uid == 0)
+          {
+            struct stat64 stats;
+            if (fstatat64 (fd, file, &stats, flag & AT_SYMLINK_NOFOLLOW))
+              return -1;
+            if ((stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)
+            {
+              __set_errno (EACCES);
+              return -1;
+	    }
+          }
+	}
+	return result;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/Implies
@@ -0,0 +1 @@
+pthread
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/Makefile
@@ -0,0 +1,62 @@
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+# Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <http://www.gnu.org/licenses/>.
+
+ifeq ($(subdir),fbtl)
+sysdep_routines += register-atfork unregister-atfork libc_pthread_init \
+		   libc_multiple_threads
+
+libpthread-sysdep_routines += pt-fork pthread_mutex_cond_lock
+
+gen-as-const-headers += lowlevelrwlock.sym \
+			unwindbuf.sym \
+ 			structsem.sym
+ 			
+#gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \
+#			lowlevelbarrier.sym unwindbuf.sym \
+#			lowlevelrobustlock.sym pthread-pi-defines.sym \
+#			structsem.sym
+endif
+
+ifeq ($(subdir),fbtl)
+routines += sys_thr_kill sys_thr_self
+routines += sys_sigwaitinfo sys_sigwait sys_sigtimedwait
+libpthread-routines += ptw-sys_sigwaitinfo ptw-sys_sigwait ptw-sys_sigtimedwait
+libpthread-routines += ptw-sys_sigprocmask ptw-sys_umtx
+libpthread-routines += ptw-sys_thr_kill
+libpthread-routines += ptw-sys_thr_kill2
+libpthread-routines += ptw-sys_thr_new
+libpthread-routines += ptw-sys_thr_self
+libpthread-routines += ptw-sys_thr_set_name
+libpthread-routines += ptw-sys_thr_exit
+libpthread-routines += ptw-sigprocmask
+libpthread-routines += ptw-ioctl
+libpthread-routines += ptw-sys_clock_getcpuclockid2
+endif
+
+ifeq ($(subdir),rt)
+sysdep_routines += sys_clock_getcpuclockid2
+endif
+
+ifeq ($(subdir),posix)
+CFLAGS-fork.c = $(libio-mtsafe)
+CFLAGS-getpid.o = -fomit-frame-pointer
+CFLAGS-getpid.os = -fomit-frame-pointer
+endif
+
+# Needed in both the signal and nptl subdir.
+CFLAGS-sigaction.c = -DWRAPPER_INCLUDE='<fbtl/sigaction.c>'
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/Versions
@@ -0,0 +1,18 @@
+libc {
+  GLIBC_2.3.2 {
+    __register_atfork;
+  }
+  GLIBC_PRIVATE {
+    __libc_pthread_init;
+    __libc_current_sigrtmin_private; __libc_current_sigrtmax_private;
+    __libc_allocate_rtsig_private;
+# needed by pthread library
+    __syscall_sigprocmask;
+    __syscall_sigwaitinfo;
+    __syscall_sigsuspend;
+    __syscall_sigaction;
+    __syscall__umtx_op;
+# needed by librt as INLINE_SYSCALL:
+    __syscall_clock_getcpuclockid2;
+  }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/aio_misc.h
@@ -0,0 +1,65 @@
+/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _AIO_MISC_H
+# include_next <aio_misc.h>
+# include <limits.h>
+# include <pthread.h>
+# include <signal.h>
+# include <sysdep.h>
+
+# define aio_start_notify_thread __aio_start_notify_thread
+# define aio_create_helper_thread __aio_create_helper_thread
+
+extern inline void
+__aio_start_notify_thread (void)
+{
+  sigset_t ss;
+  sigemptyset (&ss);
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &ss, NULL);
+}
+
+extern inline int
+__aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
+			    void *arg)
+{
+  pthread_attr_t attr;
+
+  /* Make sure the thread is created detached.  */
+  pthread_attr_init (&attr);
+  pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
+
+  /* The helper thread needs only very little resources.  */
+  (void) pthread_attr_setstacksize (&attr, __pthread_get_minstack (&attr));
+
+  /* Block all signals in the helper thread.  To do this thoroughly we
+     temporarily have to block all signals here.  */
+  sigset_t ss;
+  sigset_t oss;
+  sigfillset (&ss);
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &ss, &oss);
+
+  int ret = pthread_create (threadp, &attr, tf, arg);
+
+  /* Restore the signal mask.  */
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &oss, NULL);
+
+  (void) pthread_attr_destroy (&attr);
+  return ret;
+}
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/allocrtsig.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <signal.h>
+
+
+static int current_rtmin = __SIGRTMIN + 2;
+static int current_rtmax = __SIGRTMAX;
+
+
+/* We reserve __SIGRTMIN for use as the cancelation signal.  This
+   signal is used internally.  */
+int
+__libc_current_sigrtmin (void)
+{
+  return current_rtmin;
+}
+libc_hidden_def (__libc_current_sigrtmin)
+strong_alias (__libc_current_sigrtmin, __libc_current_sigrtmin_private)
+
+
+int
+__libc_current_sigrtmax (void)
+{
+  return current_rtmax;
+}
+libc_hidden_def (__libc_current_sigrtmax)
+strong_alias (__libc_current_sigrtmax, __libc_current_sigrtmax_private)
+
+
+int
+__libc_allocate_rtsig (int high)
+{
+  if (current_rtmin == -1 || current_rtmin > current_rtmax)
+    /* We don't have anymore signal available.  */
+    return -1;
+
+  return high ? current_rtmin++ : current_rtmax--;
+}
+strong_alias (__libc_allocate_rtsig, __libc_allocate_rtsig_private)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/bits/initspin.h
@@ -0,0 +1 @@
+/* No thread support. */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/bits/local_lim.h
@@ -0,0 +1,51 @@
+/* Minimum guaranteed maximum values for system limits.  FreeBSD version.
+   Copyright (C) 1993-1998, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/syslimits.h>
+
+/* The number of data keys per process.  */
+#define _POSIX_THREAD_KEYS_MAX	128
+/* This is the value this implementation supports.  */
+#define PTHREAD_KEYS_MAX	1024
+
+/* Controlling the iterations of destructors for thread-specific data.  */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS	4
+/* Number of iterations this implementation does.  */
+#define PTHREAD_DESTRUCTOR_ITERATIONS	_POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process.  */
+#define _POSIX_THREAD_THREADS_MAX	64
+/* We have no predefined limit on the number of threads.  */
+#undef PTHREAD_THREADS_MAX
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+   priority level.  */
+#define AIO_PRIO_DELTA_MAX	20
+
+/* Minimum size for a thread.  We are free to choose a reasonable value.  */
+#define PTHREAD_STACK_MIN	16384
+
+/* Maximum number of POSIX timers available.  */
+#define TIMER_MAX	256
+
+/* Maximum number of timer expiration overruns.  */
+#define DELAYTIMER_MAX	2147483647
+
+/* Maximum value the semaphore can have.  */
+#define SEM_VALUE_MAX   (2147483647)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/bits/posix_opt.h
@@ -0,0 +1,203 @@
+/* Define POSIX options for FreeBSD.
+   Copyright (C) 1996-1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Never include this file directly; use <unistd.h> instead.
+ */
+
+#ifndef	_BITS_POSIX_OPT_H
+#define	_BITS_POSIX_OPT_H	1
+
+#include <bits/os-unistd.h>
+
+/* Job control is supported.  */
+#define	_POSIX_JOB_CONTROL	1
+
+/* Processes have a saved set-user-ID and a saved set-group-ID.  */
+#define	_POSIX_SAVED_IDS	1
+
+/* Priority scheduling is supported.  */
+#define	_POSIX_PRIORITY_SCHEDULING	200809L
+
+/* Synchronizing file data is supported.  */
+#define	_POSIX_SYNCHRONIZED_IO	200809L
+
+/* The fsync function is present.  */
+#define	_POSIX_FSYNC	200809L
+
+/* Mapping of files to memory is supported.  */
+#define	_POSIX_MAPPED_FILES	200809L
+
+/* Locking of all memory is supported.  */
+#define	_POSIX_MEMLOCK	200809L
+
+/* Locking of ranges of memory is supported.  */
+#define	_POSIX_MEMLOCK_RANGE	200809L
+
+/* Setting of memory protections is supported.  */
+#define	_POSIX_MEMORY_PROTECTION	200809L
+
+/* Only root can change owner of file.  */
+#define	_POSIX_CHOWN_RESTRICTED	1
+
+/* `c_cc' member of 'struct termios' structure can be disabled by
+   using the value _POSIX_VDISABLE.  */
+#define	_POSIX_VDISABLE	((unsigned char)'\377')
+
+/* Filenames are not silently truncated.  */
+#define	_POSIX_NO_TRUNC	1
+
+/* X/Open realtime support is only partially available.  */
+#define _XOPEN_REALTIME	-1
+
+/* X/Open realtime thread support is only partially available.  */
+#define _XOPEN_REALTIME_THREADS	-1
+
+/* Implementation supports `poll' function.  */
+#define	_POSIX_POLL	1
+
+/* Implementation supports `select' and `pselect' functions.  */
+#define	_POSIX_SELECT	1
+
+/* XPG4.2 shared memory is supported.  */
+#define	_XOPEN_SHM	1
+
+/* Tell we have POSIX threads.  */
+#define _POSIX_THREADS	200809L
+
+/* We have the reentrant functions described in POSIX.  */
+#define _POSIX_REENTRANT_FUNCTIONS	1
+#define _POSIX_THREAD_SAFE_FUNCTIONS	200809L
+
+/* We provide priority scheduling for threads.  */
+#define _POSIX_THREAD_PRIORITY_SCHEDULING	200809L
+
+/* We support user-defined stack sizes.  */
+#define _POSIX_THREAD_ATTR_STACKSIZE	200809L
+
+/* We support user-defined stacks.  */
+#define _POSIX_THREAD_ATTR_STACKADDR	200809L
+
+/* We do not support priority inheritence.  */
+#define _POSIX_THREAD_PRIO_INHERIT      -1
+
+/* We do not support priority protection */
+#define _POSIX_THREAD_PRIO_PROTECT      -1
+
+#ifdef __USE_XOPEN2K8
+/* We do not support priority inheritence for robust mutexes.  */
+# define _POSIX_THREAD_ROBUST_PRIO_INHERIT	-1
+
+/* We do not support priority protection for robust mutexes.  */
+# define _POSIX_THREAD_ROBUST_PRIO_PROTECT      -1
+#endif
+
+/* We support POSIX.1b semaphores.  */
+#define _POSIX_SEMAPHORES	200809L
+
+/* Real-time signals are available.  */
+#define _POSIX_REALTIME_SIGNALS	200809L
+
+/* We support asynchronous I/O.  */
+#define _POSIX_ASYNCHRONOUS_IO	200809L
+#define _POSIX_ASYNC_IO		1
+/* Alternative name for Unix98.  */
+#define _LFS_ASYNCHRONOUS_IO	1
+/* Support for prioritization is not available.  */
+#define _POSIX_PRIORITIZED_IO	-1
+
+/* The LFS support in asynchronous I/O is also available.  */
+#define _LFS64_ASYNCHRONOUS_IO	1
+
+/* The rest of the LFS is also available.  */
+#define _LFS_LARGEFILE		1
+#define _LFS64_LARGEFILE	1
+#define _LFS64_STDIO		1
+
+/* POSIX shared memory objects are implemented.  */
+#define _POSIX_SHARED_MEMORY_OBJECTS	200809L
+
+/* CPU-time clocks somewhere supported.  */
+#define _POSIX_CPUTIME	0
+
+/* We support somewhere the clock also in threads.  */
+#define _POSIX_THREAD_CPUTIME	0
+
+/* GNU libc provides regular expression handling.  */
+#define _POSIX_REGEXP	1
+
+/* Reader/Writer locks are available.  */
+#define _POSIX_READER_WRITER_LOCKS	200809L
+
+/* We have a POSIX shell.  */
+#define _POSIX_SHELL	1
+
+/* We support the Timeouts option.  */
+#define _POSIX_TIMEOUTS	200809L
+
+/* We support spinlocks.  */
+#define _POSIX_SPIN_LOCKS	200809L
+
+/* The `spawn' function family is supported.  */
+#define _POSIX_SPAWN	200809L
+
+/* We have POSIX timers.  */
+#define _POSIX_TIMERS	200809L
+
+/* The barrier functions are available.  */
+#define _POSIX_BARRIERS	200809L
+
+/* POSIX message queues are not available.  */
+#define _POSIX_MESSAGE_PASSING	-1
+
+/* Thread process-shared synchronization is supported.  */
+#define _POSIX_THREAD_PROCESS_SHARED	200809L
+
+/* The monotonic clock is available.  */
+#define _POSIX_MONOTONIC_CLOCK	200809L
+
+/* The clock selection interfaces are available.  */
+#define _POSIX_CLOCK_SELECTION	200809L
+
+/* Advisory information interfaces are available.  */
+#define _POSIX_ADVISORY_INFO	200809L
+
+/* IPv6 support is available.  */
+#define _POSIX_IPV6	200809L
+
+/* Raw socket support is available.  */
+#define _POSIX_RAW_SOCKETS	200809L
+
+/* We have at least one terminal.  */
+#define _POSIX2_CHAR_TERM	200809L
+
+/* Neither process nor thread sporadic server interfaces is available.  */
+#define _POSIX_SPORADIC_SERVER	-1
+#define _POSIX_THREAD_SPORADIC_SERVER	-1
+
+/* trace.h is not available.  */
+#define _POSIX_TRACE	-1
+#define _POSIX_TRACE_EVENT_FILTER	-1
+#define _POSIX_TRACE_INHERIT	-1
+#define _POSIX_TRACE_LOG	-1
+
+/* Typed memory objects are not available.  */
+#define _POSIX_TYPED_MEMORY_OBJECTS	-1
+
+#endif /* bits/posix_opt.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/bits/sigthread.h
@@ -0,0 +1,38 @@
+/* Signal handling function for threaded programs.
+   Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_SIGTHREAD_H
+#define _BITS_SIGTHREAD_H	1
+
+#if !defined _SIGNAL_H && !defined _PTHREAD_H
+# error "Never include this file directly.  Use <pthread.h> instead"
+#endif
+
+/* Functions for handling signals. */
+
+/* Modify the signal mask for the calling thread.  The arguments have
+   the same meaning as for sigprocmask(2). */
+extern int pthread_sigmask (int __how,
+			    __const __sigset_t *__restrict __newmask,
+			    __sigset_t *__restrict __oldmask) __THROW;
+
+/* Send signal SIGNO to the given thread. */
+extern int pthread_kill (pthread_t __threadid, int __signo) __THROW;
+
+#endif	/* bits/sigthread.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/bits/typesizes.h
@@ -0,0 +1,91 @@
+/* bits/typesizes.h -- underlying types for *_t.  kFreeBSD version.
+   Copyright (C) 2002, 2003, 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef	_BITS_TYPESIZES_H
+#define	_BITS_TYPESIZES_H	1
+
+/* See <bits/types.h> for the meaning of these macros.  This file exists so
+   that <bits/types.h> need not vary across different GNU platforms.  */
+
+#define __DEV_T_TYPE		__U32_TYPE
+#define __UID_T_TYPE		__U32_TYPE
+#define __GID_T_TYPE		__U32_TYPE
+#define __INO_T_TYPE		__U32_TYPE
+#define __INO64_T_TYPE		__UQUAD_TYPE
+#define __MODE_T_TYPE		__U16_TYPE
+#define __NLINK_T_TYPE		__U16_TYPE
+#define __OFF_T_TYPE		__SQUAD_TYPE
+#define __OFF64_T_TYPE		__SQUAD_TYPE
+#define __PID_T_TYPE		__S32_TYPE
+#define __RLIM_T_TYPE		__SQUAD_TYPE
+#define __RLIM64_T_TYPE		__SQUAD_TYPE
+#define	__BLKCNT_T_TYPE		__SQUAD_TYPE
+#define	__BLKCNT64_T_TYPE	__SQUAD_TYPE
+#define	__FSBLKCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSBLKCNT64_T_TYPE	__UQUAD_TYPE
+#define	__FSFILCNT_T_TYPE	__ULONGWORD_TYPE
+#define	__FSFILCNT64_T_TYPE	__UQUAD_TYPE
+#define	__ID_T_TYPE		__U32_TYPE
+#define __CLOCK_T_TYPE		__S32_TYPE
+#define	__FSWORD_T_TYPE		__SWORD_TYPE
+
+/*
+ * This one is a bit tricky.  It needs to match the size
+ * in the sys/${arch}/include/_types.h typedefs.
+ *
+ * However, for i386 and amd64 we started with __SLONGWORD_TYPE
+ * and we need to maintain ABI.  Even if size is the same, using
+ * a different type may affect C++ ABI (this distinction is
+ * necessary to implement function overload), so it must stay
+ * with __SLONGWORD_TYPE.
+ */
+#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
+#define __TIME_T_TYPE		__SLONGWORD_TYPE
+#else
+#define __TIME_T_TYPE		__S64_TYPE
+#endif
+
+#define __USECONDS_T_TYPE	__U32_TYPE
+#define __SUSECONDS_T_TYPE	__SLONGWORD_TYPE
+#define __DADDR_T_TYPE		__SQUAD_TYPE
+#define __SWBLK_T_TYPE		__S32_TYPE
+#define __KEY_T_TYPE		__SLONGWORD_TYPE
+#define __CLOCKID_T_TYPE	__S32_TYPE
+#define __TIMER_T_TYPE		__S32_TYPE
+#define __BLKSIZE_T_TYPE	__U32_TYPE
+#define __FSID_T_TYPE		union { int __val[2]; int val[2]; }
+#define __SSIZE_T_TYPE		__SWORD_TYPE
+#define __SNSECONDS_T_TYPE	__SLONGWORD_TYPE
+#define __SYSCALL_SLONG_TYPE	__SLONGWORD_TYPE
+#define __SYSCALL_ULONG_TYPE	__ULONGWORD_TYPE
+
+/* Tell the libc code that off_t and off64_t are actually the same type
+   for all ABI purposes, even if possibly expressed as different base types
+   for C type-checking purposes.  */
+#define __OFF_T_MATCHES_OFF64_T 1
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define	__FD_SETSIZE		1024
+
+
+#endif /* bits/typesizes.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/clock_getcpuclockid.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <time.h>
+#include <unistd.h>
+#include <kernel-features.h>
+
+int
+__clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
+{
+   return INLINE_SYSCALL(clock_getcpuclockid2, 3, pid, CPUCLOCK_WHICH_PID, clock_id);
+}
+strong_alias (__clock_getcpuclockid, clock_getcpuclockid)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/clock_getres.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdint.h>
+#include <time.h>
+#include <sys/time.h>
+#include <libc-internal.h>
+#include <ldsodefs.h>
+#include <sysdep.h>
+
+int __syscall_clock_getres(clockid_t clock_id, struct timespec *tp);
+libc_hidden_proto (__syscall_clock_getres)
+
+int __syscall_clock_gettime(clockid_t clock_id, struct timespec *tp);
+libc_hidden_proto (__syscall_clock_gettime)
+
+/* Get resolution of clock.  */
+int
+__clock_getres (clockid_t clock_id, struct timespec *tp)
+{
+  /* we could try to provide fallback
+     via ??? for CLOCK_REALTIME
+     via HP_TIMING for CLOCK_PROCESS_CPUTIME_ID, 
+       CLOCK_THREAD_CPUTIME_ID and related timers
+
+     for now just pass it to kernel       
+   */
+  /* the negative clock_id means a CPU-timer, the resolution is same for all of them
+     the kernel returns resolution regardless whether the timer is accessible,
+     but POSIX/testsuite expects EINVAL
+   */
+   
+  if (clock_id < 0)
+  {
+    int rv;
+    /* we reuse user provided struct timespec */
+    rv = INLINE_SYSCALL (clock_gettime, 2, clock_id, tp);
+    if (rv != 0)
+      return rv;
+    /* valid, now really get the resolution  */
+  }
+
+  return INLINE_SYSCALL (clock_getres, 2, clock_id, tp);
+}
+strong_alias (__clock_getres, clock_getres)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/clock_gettime.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdint.h>
+#include <time.h>
+#include <sys/time.h>
+#include <libc-internal.h>
+#include <ldsodefs.h>
+#include <sysdep.h>
+
+int __syscall_clock_gettime(clockid_t clock_id, struct timespec *tp);
+libc_hidden_proto (__syscall_clock_gettime)
+
+/* Get current value of CLOCK and store it in TP.  */
+int
+__clock_gettime (clockid_t clock_id, struct timespec *tp)
+{
+  /* we could try to provide fallback
+     via gettimeofday for  CLOCK_REALTIME
+     via HP_TIMING for CLOCK_PROCESS_CPUTIME_ID, 
+       CLOCK_THREAD_CPUTIME_ID and related timers
+
+     for now just pass it to kernel       
+   */    
+  return INLINE_SYSCALL (clock_gettime, 2, clock_id, tp);
+}
+weak_alias (__clock_gettime, clock_gettime)
+libc_hidden_def (__clock_gettime)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/clock_nanosleep.c
@@ -0,0 +1,99 @@
+/* High-resolution sleep with the specified clock.
+   Copyright (C) 2000-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <errno.h>
+#include <time.h>
+#include <hp-timing.h>
+#include <sysdep-cancel.h>
+
+
+int __syscall_clock_gettime(clockid_t clock_id, struct timespec *tp);
+libc_hidden_proto (__syscall_clock_gettime)
+
+
+/* This implementation assumes that these is only a `nanosleep' system
+   call.  So we have to remap all other activities.  */
+int
+__clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *req,
+		 struct timespec *rem)
+{
+  struct timespec now;
+
+  if (__builtin_expect (req->tv_nsec, 0) < 0
+      || __builtin_expect (req->tv_nsec, 0) >= 1000000000)
+    return EINVAL;
+
+  if (clock_id == CLOCK_THREAD_CPUTIME_ID)
+    return EINVAL;		/* POSIX specifies EINVAL for this case.  */
+
+  switch(clock_id)
+  {
+	case CLOCK_REALTIME:
+	case CLOCK_MONOTONIC:
+	case CLOCK_UPTIME:
+	case CLOCK_UPTIME_PRECISE:
+	case CLOCK_UPTIME_FAST:
+	case CLOCK_REALTIME_PRECISE:
+	case CLOCK_REALTIME_FAST:
+	case CLOCK_MONOTONIC_PRECISE:
+	case CLOCK_MONOTONIC_FAST:
+	case CLOCK_SECOND:
+	    /* almost realtime clocks */
+        break;
+        
+        default:
+            /* Not supported.  */
+            return ENOTSUP;
+  }         
+
+  /* If we got an absolute time, remap it.  */
+  if (flags == TIMER_ABSTIME)
+    {
+      long int nsec;
+      long int sec;
+
+      /* Make sure we use safe data types.  */
+      assert (sizeof (sec) >= sizeof (now.tv_sec));
+
+      /* Get the current time for this clock.  */
+      if (__builtin_expect (INLINE_SYSCALL (clock_gettime, 2, clock_id, &now), 0) != 0)
+	return errno;
+
+      /* Compute the difference.  */
+      nsec = req->tv_nsec - now.tv_nsec;
+      sec = req->tv_sec - now.tv_sec - (nsec < 0);
+      if (sec < 0)
+	/* The time has already elapsed.  */
+	return 0;
+
+      now.tv_sec = sec;
+      now.tv_nsec = nsec + (nsec < 0 ? 1000000000 : 0);
+
+      /* From now on this is our time.  */
+      req = &now;
+
+      /* Make sure we are not modifying the struct pointed to by REM.  */
+      rem = NULL;
+    }
+  else if (__builtin_expect (flags, 0) != 0)
+    return EINVAL;
+
+  return __builtin_expect (__nanosleep (req, rem), 0) ? errno : 0;
+}
+strong_alias (__clock_nanosleep, clock_nanosleep)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/clock_settime.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdint.h>
+#include <time.h>
+#include <sys/time.h>
+#include <libc-internal.h>
+#include <ldsodefs.h>
+#include <sysdep.h>
+
+int __syscall_clock_settime(clockid_t clock_id, const struct timespec *tp);
+libc_hidden_proto (__syscall_clock_settime)
+
+/* Set CLOCK to value TP.  */
+int
+__clock_settime (clockid_t clock_id, const struct timespec *tp)
+{
+  switch(clock_id)
+  {
+	case CLOCK_MONOTONIC:
+	case CLOCK_MONOTONIC_PRECISE:
+	case CLOCK_MONOTONIC_FAST:
+	    /* almost monotonic clocks */
+            __set_errno (EINVAL); /* per POSIX */
+	    return -1;
+        break;
+        default:;
+  };
+  /* we could try to provide fallback
+     via settimeofday for CLOCK_REALTIME
+     via HP_TIMING for CLOCK_PROCESS_CPUTIME_ID, 
+       CLOCK_THREAD_CPUTIME_ID and related timers
+
+     for now just pass it to kernel       
+   */    
+  
+  return INLINE_SYSCALL (clock_settime, 2, clock_id, tp);
+}
+strong_alias (__clock_settime, clock_settime)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/fatal-prepare.h
@@ -0,0 +1,24 @@
+/* Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <pthread.h>
+
+/* We have to completely disable cancellation.  assert() must not be a
+   cancellation point but the implementation uses write() etc.  */
+#define FATAL_PREPARE \
+  __libc_ptf_call (__pthread_setcancelstate, \
+		   (PTHREAD_CANCEL_DISABLE, NULL), 0)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/fork.c
@@ -0,0 +1,228 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sysdep.h>
+#include <libio/libioP.h>
+#include <tls.h>
+#include "fork.h"
+#include <hp-timing.h>
+#include <ldsodefs.h>
+#include <stdio-lock.h>
+#include <atomic.h>
+#include <pthreadP.h>
+#include <malloc/malloc-internal.h>
+
+
+static void
+fresetlockfiles (void)
+{
+  _IO_ITER i;
+
+  for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i))
+    _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
+}
+
+
+pid_t
+__libc_fork (void)
+{
+  pid_t pid;
+  struct used_handler
+  {
+    struct fork_handler *handler;
+    struct used_handler *next;
+  } *allp = NULL;
+
+  /* Determine if we are running multiple threads.  We skip some fork
+     handlers in the single-thread case, to make fork safer to use in
+     signal handlers.  POSIX requires that fork is async-signal-safe,
+     but our current fork implementation is not.  */
+  bool multiple_threads = THREAD_GETMEM (THREAD_SELF, header.multiple_threads);
+
+  /* Run all the registered preparation handlers.  In reverse order.
+     While doing this we build up a list of all the entries.  */
+  struct fork_handler *runp;
+  while ((runp = __fork_handlers) != NULL)
+    {
+      /* Make sure we read from the current RUNP pointer.  */
+      atomic_full_barrier ();
+
+      unsigned int oldval = runp->refcntr;
+
+      if (oldval == 0)
+	/* This means some other thread removed the list just after
+	   the pointer has been loaded.  Try again.  Either the list
+	   is empty or we can retry it.  */
+	continue;
+
+      /* Bump the reference counter.  */
+      if (atomic_compare_and_exchange_bool_acq (&__fork_handlers->refcntr,
+						oldval + 1, oldval))
+	/* The value changed, try again.  */
+	continue;
+
+      /* We bumped the reference counter for the first entry in the
+	 list.  That means that none of the following entries will
+	 just go away.  The unloading code works in the order of the
+	 list.
+
+	 While executing the registered handlers we are building a
+	 list of all the entries so that we can go backward later on.  */
+      while (1)
+	{
+	  /* Execute the handler if there is one.  */
+	  if (runp->prepare_handler != NULL)
+	    runp->prepare_handler ();
+
+	  /* Create a new element for the list.  */
+	  struct used_handler *newp
+	    = (struct used_handler *) alloca (sizeof (*newp));
+	  newp->handler = runp;
+	  newp->next = allp;
+	  allp = newp;
+
+	  /* Advance to the next handler.  */
+	  runp = runp->next;
+	  if (runp == NULL)
+	    break;
+
+	  /* Bump the reference counter for the next entry.  */
+	  atomic_increment (&runp->refcntr);
+	}
+
+      /* We are done.  */
+      break;
+    }
+
+  /* If we are not running multiple threads, we do not have to
+     preserve lock state.  If fork runs from a signal handler, only
+     async-signal-safe functions can be used in the child.  These data
+     structures are only used by unsafe functions, so their state does
+     not matter if fork was called from a signal handler.  */
+  if (multiple_threads)
+    {
+      _IO_list_lock ();
+
+      /* Acquire malloc locks.  This needs to come last because fork
+	 handlers may use malloc, and the libio list lock has an
+	 indirect malloc dependency as well (via the getdelim
+	 function).  */
+      call_function_static_weak (__malloc_fork_lock_parent);
+    }
+
+#ifdef ARCH_FORK
+  pid = ARCH_FORK ();
+#else
+# warning "ARCH_FORK must be defined so that the CLONE_SETTID flag is used"
+  pid = INLINE_SYSCALL (fork, 0);
+#endif
+
+
+  if (pid == 0)
+    {
+      struct pthread *self = THREAD_SELF;
+
+      INLINE_SYSCALL(thr_self, 1, &(self->ktid));
+
+      if (__fork_generation_pointer != NULL)
+	*__fork_generation_pointer += 4;
+
+#if HP_TIMING_AVAIL
+      /* The CPU clock of the thread and process have to be set to zero.  */
+      hp_timing_t now;
+      HP_TIMING_NOW (now);
+      THREAD_SETMEM (self, cpuclock_offset, now);
+      GL(dl_cpuclock_offset) = now;
+#endif
+
+      /* Reset the lock state in the multi-threaded case.  */
+      if (multiple_threads)
+	{
+	  /* Release malloc locks.  */
+	  call_function_static_weak (__malloc_fork_unlock_child);
+
+	  /* Reset the file list.  These are recursive mutexes.  */
+	  fresetlockfiles ();
+
+	  /* Reset locks in the I/O code.  */
+	  _IO_list_resetlock ();
+	}
+
+      /* Reset the lock the dynamic loader uses to protect its data.  */
+      __rtld_lock_initialize (GL(dl_load_lock));
+
+      /* Run the handlers registered for the child.  */
+      while (allp != NULL)
+	{
+	  if (allp->handler->child_handler != NULL)
+	    allp->handler->child_handler ();
+
+	  /* Note that we do not have to wake any possible waiter.
+	     This is the only thread in the new process.  The count
+	     may have been bumped up by other threads doing a fork.
+	     We reset it to 1, to avoid waiting for non-existing
+	     thread(s) to release the count.  */
+	  allp->handler->refcntr = 1;
+
+	  /* XXX We could at this point look through the object pool
+	     and mark all objects not on the __fork_handlers list as
+	     unused.  This is necessary in case the fork() happened
+	     while another thread called dlclose() and that call had
+	     to create a new list.  */
+
+	  allp = allp->next;
+	}
+
+      /* Initialize the fork lock.  */
+      __fork_lock = LLL_LOCK_INITIALIZER;
+    }
+  else
+    {
+      /* Release acquired locks in the multi-threaded case.  */
+      if (multiple_threads)
+	{
+	  /* Release malloc locks, parent process variant.  */
+	  call_function_static_weak (__malloc_fork_unlock_parent);
+
+	  /* We execute this even if the 'fork' call failed.  */
+	  _IO_list_unlock ();
+	}
+
+      /* Run the handlers registered for the parent.  */
+      while (allp != NULL)
+	{
+	  if (allp->handler->parent_handler != NULL)
+	    allp->handler->parent_handler ();
+
+	  if (atomic_decrement_and_test (&allp->handler->refcntr)
+	      && allp->handler->need_signal)
+	    lll_futex_wake (&allp->handler->refcntr, 1, LLL_PRIVATE);
+
+	  allp = allp->next;
+	}
+    }
+
+  return pid;
+}
+weak_alias (__libc_fork, __fork)
+libc_hidden_def (__fork)
+weak_alias (__libc_fork, fork)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/fork.h
@@ -0,0 +1,59 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <lowlevellock.h>
+
+/* The fork generation counter, defined in libpthread.  */
+extern unsigned long int __fork_generation attribute_hidden;
+
+/* Pointer to the fork generation counter in the thread library.  */
+extern unsigned long int *__fork_generation_pointer attribute_hidden;
+
+/* Lock to protect allocation and deallocation of fork handlers.  */
+extern int __fork_lock attribute_hidden;
+
+/* Elements of the fork handler lists.  */
+struct fork_handler
+{
+  struct fork_handler *next;
+  void (*prepare_handler) (void);
+  void (*parent_handler) (void);
+  void (*child_handler) (void);
+  void *dso_handle;
+  unsigned int refcntr;
+  int need_signal;
+};
+
+/* The single linked list of all currently registered for handlers.  */
+extern struct fork_handler *__fork_handlers attribute_hidden;
+
+
+/* Function to call to unregister fork handlers.  */
+extern void __unregister_atfork (void *dso_handle) attribute_hidden;
+#define UNREGISTER_ATFORK(dso_handle) __unregister_atfork (dso_handle)
+
+
+/* C library side function to register new fork handlers.  */
+extern int __register_atfork (void (*__prepare) (void),
+			      void (*__parent) (void),
+			      void (*__child) (void),
+			      void *dso_handle);
+libc_hidden_proto (__register_atfork)
+
+/* Add a new element to the fork list.  */
+extern void __linkin_atfork (struct fork_handler *newp) attribute_hidden;
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/gai_misc.h
@@ -0,0 +1,120 @@
+/* Copyright (C) 2006-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* We define a special synchronization primitive for AIO.  POSIX
+   conditional variables would be ideal but the pthread_cond_*wait
+   operations do not return on EINTR.  This is a requirement for
+   correct aio_suspend and lio_listio implementations.  */
+
+#include <assert.h>
+#include <signal.h>
+#include <pthreadP.h>
+#include <lowlevellock.h>
+
+#define DONT_NEED_GAI_MISC_COND	1
+
+#define GAI_MISC_NOTIFY(waitlist) \
+  do {									      \
+    if (*waitlist->counterp > 0 && --*waitlist->counterp == 0)		      \
+      lll_futex_wake ((unsigned int *) waitlist->counterp, 1, LLL_PRIVATE);   \
+  } while (0)
+
+#warning have to check sign of return values from futex wait calls
+
+#define GAI_MISC_WAIT(result, futex, timeout, cancel) \
+  do {									      \
+    volatile int *futexaddr = &futex;					      \
+    int oldval = futex;							      \
+									      \
+    if (oldval != 0)							      \
+      {									      \
+	pthread_mutex_unlock (&__gai_requests_mutex);			      \
+									      \
+	int oldtype;							      \
+	if (cancel)							      \
+	  oldtype = LIBC_CANCEL_ASYNC ();				      \
+									      \
+	int status;							      \
+	do								      \
+	  {								      \
+	    status = lll_futex_timed_wait ((unsigned int *) futexaddr, oldval,\
+					   timeout, LLL_PRIVATE);	      \
+	    if (status != EWOULDBLOCK)					      \
+	      break;							      \
+									      \
+	    oldval = *futexaddr;					      \
+	  }								      \
+	while (oldval != 0);						      \
+									      \
+	if (cancel)							      \
+	  LIBC_CANCEL_RESET (oldtype);					      \
+									      \
+	if (status == EINTR)						      \
+	  result = EINTR;						      \
+	else if (status == ETIMEDOUT)					      \
+	  result = EAGAIN;						      \
+	else								      \
+	  assert (status == 0 || status == EWOULDBLOCK);		      \
+									      \
+	pthread_mutex_lock (&__gai_requests_mutex);			      \
+      }									      \
+  } while (0)
+
+
+#define gai_start_notify_thread __gai_start_notify_thread
+#define gai_create_helper_thread __gai_create_helper_thread
+
+extern inline void
+__gai_start_notify_thread (void)
+{
+  sigset_t ss;
+  sigemptyset (&ss);
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &ss, NULL);
+}
+
+extern inline int
+__gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
+			    void *arg)
+{
+  pthread_attr_t attr;
+
+  /* Make sure the thread is created detached.  */
+  pthread_attr_init (&attr);
+  pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
+
+  /* The helper thread needs only very little resources.  */
+  (void) pthread_attr_setstacksize (&attr,
+				    __pthread_get_minstack (&attr)
+				    + 4 * PTHREAD_STACK_MIN);
+
+  /* Block all signals in the helper thread.  To do this thoroughly we
+     temporarily have to block all signals here.  */
+  sigset_t ss;
+  sigset_t oss;
+  sigfillset (&ss);
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &ss, &oss);
+
+  int ret = pthread_create (threadp, &attr, tf, arg);
+
+  /* Restore the signal mask.  */
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &oss, NULL);
+
+  (void) pthread_attr_destroy (&attr);
+  return ret;
+}
+
+#include <resolv/gai_misc.h>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/internaltypes.h
@@ -0,0 +1,169 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _INTERNALTYPES_H
+#define _INTERNALTYPES_H	1
+
+#include <stdint.h>
+
+
+struct pthread_attr
+{
+  /* Scheduler parameters and priority.  */
+  struct sched_param schedparam;
+  int schedpolicy;
+  /* Various flags like detachstate, scope, etc.  */
+  int flags;
+  /* Size of guard area.  */
+  size_t guardsize;
+  /* Stack handling.  */
+  void *stackaddr;
+  size_t stacksize;
+  /* Affinity map.  */
+  cpu_set_t *cpuset;
+  size_t cpusetsize;
+};
+
+#define ATTR_FLAG_DETACHSTATE		0x0001
+#define ATTR_FLAG_NOTINHERITSCHED	0x0002
+#define ATTR_FLAG_SCOPEPROCESS		0x0004
+#define ATTR_FLAG_STACKADDR		0x0008
+#define ATTR_FLAG_OLDATTR		0x0010
+#define ATTR_FLAG_SCHED_SET		0x0020
+#define ATTR_FLAG_POLICY_SET		0x0040
+
+
+/* Mutex attribute data structure.  */
+struct pthread_mutexattr
+{
+  /* Identifier for the kind of mutex.
+
+     Bit 31 is set if the mutex is to be shared between processes.
+
+     Bit 0 to 30 contain one of the PTHREAD_MUTEX_ values to identify
+     the type of the mutex.  */
+  int mutexkind;
+};
+
+
+/* Conditional variable attribute data structure.  */
+struct pthread_condattr
+{
+  /* Combination of values:
+
+     Bit 0  : flag whether coditional variable will be shareable between
+	      processes.
+
+     Bit 1-7: clock ID.  */
+  int value;
+};
+
+
+/* The __NWAITERS field is used as a counter and to house the number
+   of bits for other purposes.  COND_CLOCK_BITS is the number
+   of bits needed to represent the ID of the clock.  COND_NWAITERS_SHIFT
+   is the number of bits reserved for other purposes like the clock.  */
+
+/* Under FreeBSD:
+        #define CLOCK_REALTIME  0
+        #define CLOCK_MONOTONIC 4   
+  
+  we therefore need at least 3 bits
+ */ 
+
+#define COND_CLOCK_BITS		4
+#define COND_NWAITERS_SHIFT	(COND_CLOCK_BITS)
+
+
+/* Read-write lock variable attribute data structure.  */
+struct pthread_rwlockattr
+{
+  int lockkind;
+  int pshared;
+};
+
+
+/* Barrier data structure.  */
+struct pthread_barrier
+{
+  unsigned int curr_event;
+  int lock;
+  unsigned int left;
+  unsigned int init_count;
+  int private;
+};
+
+
+/* Barrier variable attribute data structure.  */
+struct pthread_barrierattr
+{
+  int pshared;
+};
+
+
+/* Thread-local data handling.  */
+struct pthread_key_struct
+{
+  /* Sequence numbers.  Even numbers indicated vacant entries.  Note
+     that zero is even.  We use uintptr_t to not require padding on
+     32- and 64-bit machines.  On 64-bit machines it helps to avoid
+     wrapping, too.  */
+  uintptr_t seq;
+
+  /* Destructor for the data.  */
+  void (*destr) (void *);
+};
+
+/* Check whether an entry is unused.  */
+#define KEY_UNUSED(p) (((p) & 1) == 0)
+/* Check whether a key is usable.  We cannot reuse an allocated key if
+   the sequence counter would overflow after the next destroy call.
+   This would mean that we potentially free memory for a key with the
+   same sequence.  This is *very* unlikely to happen, A program would
+   have to create and destroy a key 2^31 times (on 32-bit platforms,
+   on 64-bit platforms that would be 2^63).  If it should happen we
+   simply don't use this specific key anymore.  */
+#define KEY_USABLE(p) (((uintptr_t) (p)) < ((uintptr_t) ((p) + 2)))
+
+
+/* Handling of read-write lock data.  */
+// XXX For now there is only one flag.  Maybe more in future.
+#define RWLOCK_RECURSIVE(rwlock) ((rwlock)->__data.__flags != 0)
+
+
+/* Semaphore variable structure.  */
+struct new_sem
+{
+  unsigned int value;
+  int private;
+  unsigned long int nwaiters;
+};
+
+struct old_sem
+{
+  unsigned int value;
+};
+
+
+/* Compatibility type for old conditional variable interfaces.  */
+typedef struct
+{
+  pthread_cond_t *cond;
+} pthread_cond_2_0_t;
+
+#endif	/* internaltypes.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/jmp-unwind.c
@@ -0,0 +1,38 @@
+/* Clean up stack frames unwound by longjmp.  Linux version.
+   Copyright (C) 1995-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <setjmp.h>
+#include <stddef.h>
+#include <pthreadP.h>
+
+extern void __pthread_cleanup_upto (__jmp_buf env, char *targetframe);
+#pragma weak __pthread_cleanup_upto
+
+
+void
+_longjmp_unwind (jmp_buf env, int val)
+{
+#ifdef SHARED
+  if (__libc_pthread_functions_init)
+    PTHFCT_CALL (ptr___pthread_cleanup_upto, (env->__jmpbuf,
+					      CURRENT_STACK_FRAME));
+#else
+  if (__pthread_cleanup_upto != NULL)
+    __pthread_cleanup_upto (env->__jmpbuf, CURRENT_STACK_FRAME);
+#endif
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/kernel-posix-timers.h
@@ -0,0 +1,138 @@
+/* Copyright (C) 2003, 2007, 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <pthread.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <sys/types.h>
+
+
+/* Nonzero if the system calls are not available.  */
+extern int __no_posix_timers attribute_hidden;
+
+/* Callback to start helper thread.  */
+extern void __start_helper_thread (void) attribute_hidden;
+
+/* Control variable for helper thread creation.  */
+extern pthread_once_t __helper_once attribute_hidden;
+
+/* TID of the helper thread.  */
+extern pid_t __helper_tid attribute_hidden;
+
+/* List of active SIGEV_THREAD timers.  */
+extern struct timer *__active_timer_sigev_thread attribute_hidden;
+/* Lock for the __active_timer_sigev_thread.  */
+extern pthread_mutex_t __active_timer_sigev_thread_lock attribute_hidden;
+
+
+/* Type of timers in the kernel.  */
+typedef int kernel_timer_t;
+
+
+/* Internal representation of timer.  */
+struct timer
+{
+  /* Notification mechanism.  */
+  int sigev_notify;
+
+  /* Timer ID returned by the kernel.  */
+  kernel_timer_t ktimerid;
+
+  /* All new elements must be added after ktimerid.  And if the thrfunc
+     element is not the third element anymore the memory allocation in
+     timer_create needs to be changed.  */
+
+  /* Parameters for the thread to be started for SIGEV_THREAD.  */
+  void (*thrfunc) (sigval_t);
+  sigval_t sival;
+  pthread_attr_t attr;
+
+  /* Next element in list of active SIGEV_THREAD timers.  */
+  struct timer *next;
+};
+
+extern struct timer *__all_timers[TIMER_MAX];
+
+static inline struct timer *
+__kfreebsd_timer_alloc (void)
+{
+  unsigned int i;
+  struct timer *timer = malloc (sizeof (struct timer));
+  
+  if (timer == NULL)
+      goto fail;
+
+  /* Find a free slot (and reserve it atomically).  */
+  for (i = 0; i < TIMER_MAX; i++)
+    if (atomic_compare_and_exchange_val_acq (&__all_timers[i],
+					     timer, NULL) == NULL)
+      return timer;
+      
+  free (timer);    
+
+fail:
+  errno = EAGAIN;
+  return NULL;
+}
+
+static inline struct timer *
+__kfreebsd_timer_id2ptr (timer_t id)
+{
+  void *ret = NULL;
+
+  if (id >= 0 && id < TIMER_MAX)
+    ret = __all_timers[id];
+
+  if (! ret)
+    errno = EINVAL;
+
+  return ret;
+}
+
+static inline timer_t
+__kfreebsd_timer_ptr2id (struct timer *ptr)
+{
+  unsigned int i;
+  for (i = 0; i < TIMER_MAX; i++)
+    if (__all_timers[i] == ptr)
+      return i;
+
+  return -1;
+}
+
+void static inline
+__kfreebsd_timer_free (struct timer *ptr)
+{
+  __all_timers[__kfreebsd_timer_ptr2id (ptr)] = NULL;
+  free (ptr);
+}
+
+/* used syscalls */
+
+int __syscall_ktimer_create (clockid_t clockid, struct sigevent *evp, kernel_timer_t *timerid);
+int __syscall_ktimer_delete (kernel_timer_t timerid);
+int __syscall_ktimer_getoverrun (kernel_timer_t timerid);
+int __syscall_ktimer_gettime (kernel_timer_t timerid, struct itimerspec *value);
+int __syscall_ktimer_settime (kernel_timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue);
+
+libc_hidden_proto (__syscall_ktimer_create)
+libc_hidden_proto (__syscall_ktimer_delete)
+libc_hidden_proto (__syscall_ktimer_getoverrun)
+libc_hidden_proto (__syscall_ktimer_gettime)
+libc_hidden_proto (__syscall_ktimer_settime)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/libc-lowlevellock.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* No difference to lowlevellock.c, except we lose a couple of functions.  */
+#include <lowlevellock.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/libc_multiple_threads.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <pthreadP.h>
+
+#if IS_IN (libc)
+# ifndef TLS_MULTIPLE_THREADS_IN_TCB
+/* Variable set to a nonzero value either if more than one thread runs or ran,
+   or if a single-threaded process is trying to cancel itself.  See
+   nptl/descr.h for more context on the single-threaded process case.  */
+int __libc_multiple_threads attribute_hidden;
+# endif
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/libc_pthread_init.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <unistd.h>
+#include <list.h>
+#include <fork.h>
+#include <dl-sysdep.h>
+#include <tls.h>
+#include <string.h>
+#include <pthreadP.h>
+#include <libc-lock.h>
+#include <sysdep.h>
+#include <ldsodefs.h>
+
+
+unsigned long int *__fork_generation_pointer;
+
+
+#ifdef TLS_MULTIPLE_THREADS_IN_TCB
+void
+#else
+extern int __libc_multiple_threads attribute_hidden;
+
+int *
+#endif
+internal_function
+__libc_pthread_init (unsigned long int *ptr, void (*reclaim) (void),
+		     const struct pthread_functions *functions)
+{
+  /* Remember the pointer to the generation counter in libpthread.  */
+  __fork_generation_pointer = ptr;
+
+  /* Called by a child after fork.  */
+  __register_atfork (NULL, NULL, reclaim, NULL);
+
+#ifdef SHARED
+  /* Copy the function pointers into an array in libc.  This enables
+     access with just one memory reference but moreso, it prevents
+     hijacking the function pointers with just one pointer change.  We
+     "encrypt" the function pointers since we cannot write-protect the
+     array easily enough.  */
+  union ptrhack
+  {
+    struct pthread_functions pf;
+# define NPTRS (sizeof (struct pthread_functions) / sizeof (void *))
+    void *parr[NPTRS];
+  } __attribute__ ((may_alias)) const *src;
+  union ptrhack *dest;
+
+  src = (const void *) functions;
+  dest = (void *) &__libc_pthread_functions;
+
+  for (size_t cnt = 0; cnt < NPTRS; ++cnt)
+    {
+      void *p = src->parr[cnt];
+      PTR_MANGLE (p);
+      dest->parr[cnt] = p;
+    }
+  __libc_pthread_functions_init = 1;
+#endif
+
+#ifndef TLS_MULTIPLE_THREADS_IN_TCB
+  return &__libc_multiple_threads;
+#endif
+}
+
+#ifdef SHARED
+libc_freeres_fn (freeres_libptread)
+{
+  if (__libc_pthread_functions_init)
+    PTHFCT_CALL (ptr_freeres, ());
+}
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/lowlevellock.c
@@ -0,0 +1,129 @@
+/* low level locking for pthread library.  Generic futex-using version.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sysdep.h>
+#include <lowlevellock.h>
+#include <sys/time.h>
+
+void
+__lll_lock_wait_private (int *futex)
+{
+  do
+    {
+      int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
+      if (oldval != 0)
+	lll_futex_wait (futex, 2, LLL_PRIVATE);
+    }
+  while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
+}
+
+
+/* These functions don't get included in libc.so  */
+#if IS_IN (libpthread)
+void
+__lll_lock_wait_shared (int *futex)
+{
+  do
+    {
+      int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
+      if (oldval != 0)
+	lll_futex_wait (futex, 2, LLL_SHARED);
+    }
+  while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
+}
+
+
+int
+__lll_timedlock_wait (int *futex, const struct timespec *abstime, int private)
+{
+  struct timespec rt;
+
+  /* Reject invalid timeouts.  */
+  if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
+    return EINVAL;
+
+  /* Upgrade the lock.  */
+  if (atomic_exchange_acq (futex, 2) == 0)
+    return 0;
+
+  do
+    {
+      struct timeval tv;
+
+      /* Get the current time.  */
+      (void) __gettimeofday (&tv, NULL);
+
+      /* Compute relative timeout.  */
+      rt.tv_sec = abstime->tv_sec - tv.tv_sec;
+      rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
+      if (rt.tv_nsec < 0)
+	{
+	  rt.tv_nsec += 1000000000;
+	  --rt.tv_sec;
+	}
+
+      /* Already timed out?  */
+      if (rt.tv_sec < 0)
+	return ETIMEDOUT;
+
+      // XYZ: Lost the lock to check whether it was private.
+      lll_futex_timed_wait (futex, 2, &rt, private);
+    }
+  while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
+
+  return 0;
+}
+
+int
+__lll_timedwait_tid (long *tidp, const struct timespec *abstime)
+{
+  long tid;
+
+  if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
+    return EINVAL;
+
+  /* Repeat until thread terminated.  */
+  while ((tid = *tidp) != KTID_TERMINATED)
+    {
+      struct timeval tv;
+      struct timespec rt;
+
+      /* Get the current time.  */
+      (void) __gettimeofday (&tv, NULL);
+
+      /* Compute relative timeout.  */
+      rt.tv_sec = abstime->tv_sec - tv.tv_sec;
+      rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
+      if (rt.tv_nsec < 0)
+	{
+	  rt.tv_nsec += 1000000000;
+	  --rt.tv_sec;
+	}
+
+      /* Already timed out?  */
+      if (rt.tv_sec < 0)
+	return ETIMEDOUT;
+
+      /* Wait until thread terminates.  */
+      lll_umtx_long_wait_shared (tidp, tid, &rt);
+    }
+
+  return 0;
+}
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/lowlevellock.h
@@ -0,0 +1,168 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LOWLEVELLOCK_H
+#define _LOWLEVELLOCK_H	1
+
+/* Values for 'private' parameter of locking macros.  Yes, the
+   definition seems to be backwards.  But it is not.  
+   They are the same as linux one's
+ */  
+
+#define FUTEX_PRIVATE_FLAG 128
+
+#define LLL_PRIVATE	0
+#define LLL_SHARED	FUTEX_PRIVATE_FLAG
+#define KTID_TERMINATED 1
+#include <stap-probe.h>
+
+#ifndef __ASSEMBLER__
+
+#include <time.h>
+#include <sys/param.h>
+#include <bits/pthreadtypes.h>
+#include <kernel-features.h>
+#include <tcb-offsets.h>
+#include <atomic.h>
+#include <lowlevelumtx.h>
+
+/* Initializer for lock.  */
+#define LLL_LOCK_INITIALIZER		(0)
+#define LLL_LOCK_INITIALIZER_LOCKED	(1)
+#define LLL_LOCK_INITIALIZER_WAITERS	(2)
+
+#define lll_futex_wait(futex, val, private) \
+  lll_futex_timed_wait(futex, val, NULL, private)
+
+#define lll_futex_timed_wait(futex, val, timeout, private) 		\
+  ({									\
+      int __status;							\
+      if ((private) == LLL_PRIVATE)					\
+          __status = lll_umtx_int_wait_private (futex, val, timeout);	\
+      else     								\
+          __status = lll_umtx_int_wait_shared (futex, val, timeout);	\
+    __status;								\
+  })
+
+#define lll_futex_wake(futex, nr, private) \
+  ({									\
+      int __status;							\
+      if ((private) == LLL_PRIVATE)					\
+          __status = lll_umtx_int_wake_private (futex, nr);		\
+      else     								\
+          __status = lll_umtx_int_wake_shared (futex, nr);		\
+    __status;								\
+  })
+
+#define lll_trylock(lock)	\
+  atomic_compare_and_exchange_val_acq(&(lock), 1, 0)
+
+#define lll_cond_trylock(lock)	\
+  atomic_compare_and_exchange_val_acq(&(lock), 2, 0)
+
+extern void __lll_lock_wait_private (int *futex) attribute_hidden;
+extern void __lll_lock_wait_shared  (int *futex) attribute_hidden;
+
+#define __lll_lock_wait(futex, private)				\
+  ((void) ({								\
+	if ((private) == LLL_PRIVATE)	      				\
+	  __lll_lock_wait_private (futex);				\
+	else								\
+	  __lll_lock_wait_shared  (futex);				\
+  }))
+
+#define __lll_lock(futex, private)					\
+  ((void) ({								      \
+    int *__futex = (futex);						      \
+    if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex,       \
+								1, 0), 0))    \
+      {									      \
+	  __lll_lock_wait (__futex, private);				      \
+      }									      \
+  }))
+
+#define lll_lock(futex, private) __lll_lock (&(futex), private)
+
+
+#define __lll_cond_lock(futex, private)					      \
+  ((void) ({								      \
+    int *__futex = (futex);						      \
+    if (__builtin_expect (atomic_exchange_acq (__futex, 2), 0))		      \
+      __lll_lock_wait (__futex, private);				      \
+  }))
+  
+#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
+
+
+extern int __lll_timedlock_wait (int *futex, const struct timespec *,
+				 int private) attribute_hidden;
+
+#define __lll_timedlock(futex, abstime, private)			      \
+  ({									      \
+     int *__futex = (futex);						      \
+     int __val = 0;							      \
+									      \
+     if (__builtin_expect (atomic_exchange_acq (__futex, 1), 0))	      \
+       __val = __lll_timedlock_wait (__futex, abstime, private);	      \
+     __val;								      \
+  })
+  
+#define lll_timedlock(futex, abstime, private) \
+  __lll_timedlock (&(futex), abstime, private)
+
+
+#define __lll_unlock(futex, private) \
+  (void)							\
+    ({ int *__futex = (futex);					\
+       int __private = (private);				\
+       int __oldval = atomic_exchange_rel (__futex, 0);		\
+       if (__builtin_expect (__oldval > 1, 0))			\
+	 lll_futex_wake (__futex, 1, __private);		\
+    })
+    
+#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
+
+
+#define lll_islocked(futex) \
+  (futex != 0)
+
+
+/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex
+   wakeup when the clone terminates.  The memory location contains the
+   thread ID while the clone is running and is reset to one (not zero as on linux)
+   afterwards.	*/
+#define lll_wait_tid(tid) \
+  do {					\
+    __typeof (tid) __tid;		\
+    while ((__tid = (tid)) != KTID_TERMINATED)	\
+      lll_umtx_long_wait_shared (&(tid), __tid, NULL);\
+  } while (0)
+
+extern int __lll_timedwait_tid (long *, const struct timespec *)
+     attribute_hidden;
+
+#define lll_timedwait_tid(tid, abstime) \
+  ({							\
+    int __res = 0;					\
+    if ((tid) != KTID_TERMINATED)			\
+      __res = __lll_timedwait_tid (&(tid), (abstime));	\
+    __res;						\
+  })
+  
+#endif  /* !__ASSEMBLER__ */
+
+#endif	/* lowlevellock.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/lowlevelrwlock.sym
@@ -0,0 +1,16 @@
+#include <stddef.h>
+#include <stdio.h>
+#include <bits/pthreadtypes.h>
+#include <bits/wordsize.h>
+
+--
+
+MUTEX		offsetof (pthread_rwlock_t, __data.__lock)
+NR_READERS	offsetof (pthread_rwlock_t, __data.__nr_readers)
+READERS_WAKEUP	offsetof (pthread_rwlock_t, __data.__readers_wakeup)
+WRITERS_WAKEUP	offsetof (pthread_rwlock_t, __data.__writer_wakeup)
+READERS_QUEUED	offsetof (pthread_rwlock_t, __data.__nr_readers_queued)
+WRITERS_QUEUED	offsetof (pthread_rwlock_t, __data.__nr_writers_queued)
+FLAGS		offsetof (pthread_rwlock_t, __data.__flags)
+WRITER		offsetof (pthread_rwlock_t, __data.__writer)
+PSHARED		offsetof (pthread_rwlock_t, __data.__shared)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pt-fork.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <unistd.h>
+
+
+pid_t
+__fork (void)
+{
+  return __libc_fork ();
+}
+strong_alias (__fork, fork)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pt-raise.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/raise.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_attr_getaffinity.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <errno.h>
+#include <pthreadP.h>
+#include <string.h>
+#include <sysdep.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
+
+int
+__pthread_attr_getaffinity_new (const pthread_attr_t *attr, size_t cpusetsize,
+				cpu_set_t *cpuset)
+{
+  const struct pthread_attr *iattr;
+
+  assert (sizeof (*attr) >= sizeof (struct pthread_attr));
+  iattr = (const struct pthread_attr *) attr;
+
+  if (iattr->cpuset != NULL)
+    {
+      /* Check whether there are any bits set beyond the limits
+	 the user requested.  */
+      for (size_t cnt = cpusetsize; cnt < iattr->cpusetsize; ++cnt)
+	if (((char *) iattr->cpuset)[cnt] != 0)
+	  return EINVAL;
+
+      /* Copy over the cpuset from the thread attribute object.  Limit the copy
+	 to the minimum of the source and destination sizes to prevent a buffer
+	 overrun.  If the destination is larger, fill the remaining space with
+	 zeroes.  */
+      void *p = mempcpy (cpuset, iattr->cpuset,
+			 MIN (iattr->cpusetsize, cpusetsize));
+      if (cpusetsize > iattr->cpusetsize)
+	memset (p, '\0', cpusetsize - iattr->cpusetsize);
+    }
+  else
+    /* We have no information.  */
+    memset (cpuset, -1, cpusetsize);
+
+  return 0;
+}
+versioned_symbol (libpthread, __pthread_attr_getaffinity_new,
+		  pthread_attr_getaffinity_np, GLIBC_2_3_4);
+
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
+/* The old interface have not been really exposed  */
+strong_alias (__pthread_attr_getaffinity_new, __pthread_attr_getaffinity_old)
+compat_symbol (libpthread, __pthread_attr_getaffinity_old,
+	       pthread_attr_getaffinity_np, GLIBC_2_3_3);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_attr_setaffinity.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#include <pthreadP.h>
+#include <shlib-compat.h>
+
+
+
+
+int
+__pthread_attr_setaffinity_new (pthread_attr_t *attr, size_t cpusetsize,
+				const cpu_set_t *cpuset)
+{
+  struct pthread_attr *iattr;
+
+  assert (sizeof (*attr) >= sizeof (struct pthread_attr));
+  iattr = (struct pthread_attr *) attr;
+
+  if (cpuset == NULL || cpusetsize == 0)
+    {
+      free (iattr->cpuset);
+      iattr->cpuset = NULL;
+      iattr->cpusetsize = 0;
+    }
+  else
+    {
+      int ret = check_cpuset_attr (cpuset, cpusetsize);
+
+      if (ret)
+        return ret;
+
+      if (iattr->cpusetsize != cpusetsize)
+	{
+	  void *newp = (cpu_set_t *) realloc (iattr->cpuset, cpusetsize);
+	  if (newp == NULL)
+	    return ENOMEM;
+
+	  iattr->cpuset = newp;
+	  iattr->cpusetsize = cpusetsize;
+	}
+
+      memcpy (iattr->cpuset, cpuset, cpusetsize);
+    }
+
+  return 0;
+}
+versioned_symbol (libpthread, __pthread_attr_setaffinity_new,
+		  pthread_attr_setaffinity_np, GLIBC_2_3_4);
+
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
+/* The old interface have not been really exposed  */
+strong_alias (__pthread_attr_setaffinity_new, __pthread_attr_setaffinity_old)
+compat_symbol (libpthread, __pthread_attr_setaffinity_old,
+	       pthread_attr_setaffinity_np, GLIBC_2_3_3);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_getaffinity.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <limits.h>
+#include <pthreadP.h>
+#include <string.h>
+#include <sysdep.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
+#include "../cpuset-kern.h"
+
+int
+__pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset)
+{
+  const struct pthread *pd = (const struct pthread *) th;
+  int64_t id = pd->tid;
+  int res;
+  
+  if (cpusetsize > sizeof(cpu_set_t))
+    {
+      /* Clean the rest of the memory the kernel won't do.  */
+      memset ((char *) cpuset + sizeof(cpu_set_t), '\0', cpusetsize - sizeof(cpu_set_t));
+
+      cpusetsize = sizeof(cpu_set_t);
+    }
+
+  res = INLINE_SYSCALL (cpuset_getaffinity, 5, CPU_LEVEL_WHICH,
+			CPU_WHICH_TID, id, cpusetsize, cpuset);
+
+  if (res == 0)
+      return 0;
+      
+  if (errno == ERANGE)
+    {
+      return EINVAL;
+    }
+  
+  return errno;
+}
+strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_np)
+versioned_symbol (libpthread, __pthread_getaffinity_new,
+		  pthread_getaffinity_np, GLIBC_2_3_4);
+
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
+/* The old interface have not been really exposed  */
+strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_old)
+compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np,
+	       GLIBC_2_3_3);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_getcpuclockid.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <time.h>
+#include <unistd.h>
+#include <kernel-features.h>
+#include <pthreadP.h>
+#include <tls.h>
+
+int
+pthread_getcpuclockid (pthread_t threadid, clockid_t *clockid)
+{
+  struct pthread *pd = (struct pthread *) threadid;
+
+  /* Make sure the descriptor is valid.  */
+  if (INVALID_TD_P (pd))
+    /* Not a valid thread handle.  */
+    return ESRCH;
+
+  return INLINE_SYSCALL(clock_getcpuclockid2, 3, pd->tid, CPUCLOCK_WHICH_TID, clockid);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_getname.c
@@ -0,0 +1,47 @@
+/* pthread_getname_np -- Get  thread name.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <pthreadP.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/ptrace.h>
+
+int
+pthread_getname_np (pthread_t th, char *buf, size_t len)
+{
+  const struct pthread *pd = (const struct pthread *) th;
+  struct ptrace_lwpinfo ti;
+  int res;
+  
+  ti.pl_tdname[0] = 0;
+  res = ptrace(PT_LWPINFO, pd->tid, (caddr_t)&ti, sizeof(struct ptrace_lwpinfo));
+
+  if (res != 0)
+      return errno;
+
+  res = strlen(ti.pl_tdname);
+
+  if (len < (res+1))
+      return ERANGE;
+      
+  memcpy(buf, ti.pl_tdname, res+1);
+  return 0;    
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_getschedparam.c
@@ -0,0 +1,77 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <string.h>
+#include "pthreadP.h"
+#include <lowlevellock.h>
+
+
+int
+__pthread_getschedparam (pthread_t threadid, int *policy,
+			 struct sched_param *param)
+{
+  struct pthread *pd = (struct pthread *) threadid;
+
+  /* Make sure the descriptor is valid.  */
+  if (INVALID_TD_P (pd))
+    /* Not a valid thread handle.  */
+    return ESRCH;
+
+  int result = 0;
+#if 1
+#warning TODO scheduling 
+  *policy = SCHED_OTHER;
+  param->__sched_priority = 0;
+#else
+  
+  lll_lock (pd->lock, LLL_PRIVATE);
+
+  /* The library is responsible for maintaining the values at all
+     times.  If the user uses a interface other than
+     pthread_setschedparam to modify the scheduler setting it is not
+     the library's problem.  In case the descriptor's values have
+     not yet been retrieved do it now.  */
+  if ((pd->flags & ATTR_FLAG_SCHED_SET) == 0)
+    {
+      if (__sched_getparam (pd->tid, &pd->schedparam) != 0)
+	result = 1;
+      else
+	pd->flags |= ATTR_FLAG_SCHED_SET;
+    }
+
+  if ((pd->flags & ATTR_FLAG_POLICY_SET) == 0)
+    {
+      pd->schedpolicy = __sched_getscheduler (pd->tid);
+      if (pd->schedpolicy == -1)
+	result = 1;
+      else
+	pd->flags |= ATTR_FLAG_POLICY_SET;
+    }
+
+  if (result == 0)
+    {
+      *policy = pd->schedpolicy;
+      memcpy (param, &pd->schedparam, sizeof (struct sched_param));
+    }
+
+  lll_unlock (pd->lock, LLL_PRIVATE);
+#endif
+  return result;
+}
+strong_alias (__pthread_getschedparam, pthread_getschedparam)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_kill.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <signal.h>
+#include <pthreadP.h>
+#include <tls.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+
+
+int
+__pthread_kill (pthread_t threadid, int signo)
+{
+  struct pthread *pd = (struct pthread *) threadid;
+
+  /* Make sure the descriptor is valid.  */
+  if (DEBUGGING_P && INVALID_TD_P (pd))
+    /* Not a valid thread handle.  */
+    return ESRCH;
+
+  /* Force load of pd->tid into local variable or register.  Otherwise
+     if a thread exits between ESRCH test and tgkill, we might return
+     EINVAL, because pd->tid would be cleared by the kernel.  */
+  pid_t tid = atomic_forced_read (pd->tid);
+  if (__builtin_expect (tid <= KTID_TERMINATED, 0))
+    /* Not a valid thread handle.  */
+    return ESRCH;
+
+  /* Disallow sending the signal we use for cancellation, timers,
+     for the setxid implementation.  */
+  if (signo == SIGCANCEL || signo == SIGTIMER || signo == SIGSETXID)
+    return EINVAL;
+    
+  /* We have a special syscall to do the work.  */
+
+  /* the KTID field in the TCB can be wrong under FreeBSD
+     a) before __pthread_initialize_minimal is finished (with libpthread)
+     b) in child just after fork
+     c) in single threaded program (no libpthread at all) 
+
+     In these situations no other thread can exist.
+   */
+  return INLINE_SYSCALL(thr_kill, 2, tid, signo);
+}
+strong_alias (__pthread_kill, pthread_kill)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_mutex_cond_lock.c
@@ -0,0 +1,14 @@
+#include <pthreadP.h>
+
+#define LLL_MUTEX_LOCK(mutex) \
+  lll_cond_lock ((mutex)->__data.__lock, PTHREAD_MUTEX_PSHARED (mutex))
+#define LLL_MUTEX_TRYLOCK(mutex) \
+  lll_cond_trylock ((mutex)->__data.__lock)
+#define LLL_ROBUST_MUTEX_LOCK(mutex, id) \
+  lll_robust_cond_lock ((mutex)->__data.__lock, id, \
+			PTHREAD_ROBUST_MUTEX_PSHARED (mutex))
+#define __pthread_mutex_lock internal_function __pthread_mutex_cond_lock
+#define __pthread_mutex_lock_full __pthread_mutex_cond_lock_full
+#define NO_INCR
+
+#include <fbtl/pthread_mutex_lock.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_once.c
@@ -0,0 +1,129 @@
+/* Copyright (C) 2003-2014 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "pthreadP.h"
+#include <lowlevellock.h>
+#include <atomic.h>
+
+
+unsigned long int __fork_generation attribute_hidden;
+
+
+static void
+clear_once_control (void *arg)
+{
+  pthread_once_t *once_control = (pthread_once_t *) arg;
+
+  /* Reset to the uninitialized state here.  We don't need a stronger memory
+     order because we do not need to make any other of our writes visible to
+     other threads that see this value: This function will be called if we
+     get interrupted (see __pthread_once), so all we need to relay to other
+     threads is the state being reset again.  */
+  *once_control = 0;
+  lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
+}
+
+
+/* This is similar to a lock implementation, but we distinguish between three
+   states: not yet initialized (0), initialization finished (2), and
+   initialization in progress (__fork_generation | 1).  If in the first state,
+   threads will try to run the initialization by moving to the second state;
+   the first thread to do so via a CAS on once_control runs init_routine,
+   other threads block.
+   When forking the process, some threads can be interrupted during the second
+   state; they won't be present in the forked child, so we need to restart
+   initialization in the child.  To distinguish an in-progress initialization
+   from an interrupted initialization (in which case we need to reclaim the
+   lock), we look at the fork generation that's part of the second state: We
+   can reclaim iff it differs from the current fork generation.
+   XXX: This algorithm has an ABA issue on the fork generation: If an
+   initialization is interrupted, we then fork 2^30 times (30 bits of
+   once_control are used for the fork generation), and try to initialize
+   again, we can deadlock because we can't distinguish the in-progress and
+   interrupted cases anymore.  */
+int
+__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
+{
+  while (1)
+    {
+      int oldval, val, newval;
+
+      /* We need acquire memory order for this load because if the value
+         signals that initialization has finished, we need to be see any
+         data modifications done during initialization.  */
+      val = *once_control;
+      atomic_read_barrier();
+      do
+	{
+	  /* Check if the initialization has already been done.  */
+	  if (__glibc_likely ((val & 2) != 0))
+	    return 0;
+
+	  oldval = val;
+	  /* We try to set the state to in-progress and having the current
+	     fork generation.  We don't need atomic accesses for the fork
+	     generation because it's immutable in a particular process, and
+	     forked child processes start with a single thread that modified
+	     the generation.  */
+	  newval = __fork_generation | 1;
+	  /* We need acquire memory order here for the same reason as for the
+	     load from once_control above.  */
+	  val = atomic_compare_and_exchange_val_acq (once_control, newval,
+						     oldval);
+	}
+      while (__glibc_unlikely (val != oldval));
+
+      /* Check if another thread already runs the initializer.	*/
+      if ((oldval & 1) != 0)
+	{
+	  /* Check whether the initializer execution was interrupted by a
+	     fork.  We know that for both values, bit 0 is set and bit 1 is
+	     not.  */
+	  if (oldval == newval)
+	    {
+	      /* Same generation, some other thread was faster. Wait.  */
+	      lll_futex_wait (once_control, newval, LLL_PRIVATE);
+	      continue;
+	    }
+	}
+
+      /* This thread is the first here.  Do the initialization.
+	 Register a cleanup handler so that in case the thread gets
+	 interrupted the initialization can be restarted.  */
+      pthread_cleanup_push (clear_once_control, once_control);
+
+      init_routine ();
+
+      pthread_cleanup_pop (0);
+
+
+      /* Mark *once_control as having finished the initialization.  We need
+         release memory order here because we need to synchronize with other
+         threads that want to use the initialized data.  */
+      atomic_write_barrier();
+      *once_control = 2;
+
+      /* Wake up all other threads.  */
+      lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
+      break;
+    }
+
+  return 0;
+}
+weak_alias (__pthread_once, pthread_once)
+hidden_def (__pthread_once)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_setaffinity.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <alloca.h>
+#include <errno.h>
+#include <pthreadP.h>
+#include <sysdep.h>
+#include <sys/types.h>
+#include <shlib-compat.h>
+
+#include "../cpuset-kern.h"
+
+
+size_t __kernel_cpumask_size attribute_hidden;
+
+/* Determine the current affinity.  As a side affect we learn
+   about the size of the cpumask_t in the kernel.  */
+int
+__determine_cpumask_size (pid_t tid)
+{
+  /* not yet dynamical */
+  __kernel_cpumask_size = sizeof(cpu_set_t);
+  return 0;
+}
+
+int
+__pthread_setaffinity_new (pthread_t th, size_t cpusetsize,
+			   const cpu_set_t *cpuset)
+{
+  const struct pthread *pd = (const struct pthread *) th;
+  int64_t id = pd->tid;
+  int res;
+
+  res = INLINE_SYSCALL (cpuset_setaffinity, 5, CPU_LEVEL_WHICH,
+			CPU_WHICH_TID, id, cpusetsize, cpuset);
+
+  if (res == 0)
+      return 0;
+      
+  if ((errno == ERANGE) || (errno == EDEADLK))
+    {
+      return EINVAL;
+    }
+  
+  return errno;
+}
+versioned_symbol (libpthread, __pthread_setaffinity_new,
+		  pthread_setaffinity_np, GLIBC_2_3_4);
+
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4)
+/* The old interface have not been really exposed  */
+strong_alias (__pthread_setaffinity_new, __pthread_setaffinity_old)
+compat_symbol (libpthread, __pthread_setaffinity_old, pthread_setaffinity_np,
+	       GLIBC_2_3_3);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_setname.c
@@ -0,0 +1,32 @@
+/* pthread_setname_np -- Set  thread name
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <pthreadP.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+int
+pthread_setname_np (pthread_t th, const char *name)
+{
+  const struct pthread *pd = (const struct pthread *) th;
+
+  return INLINE_SYSCALL(thr_set_name, 2, pd->tid, name);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_setschedparam.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sched.h>
+#include <string.h>
+#include "pthreadP.h"
+#include <lowlevellock.h>
+
+
+int
+__pthread_setschedparam (pthread_t threadid, int policy,
+			 const struct sched_param *param)
+{
+  struct pthread *pd = (struct pthread *) threadid;
+
+  /* Make sure the descriptor is valid.  */
+  if (INVALID_TD_P (pd))
+    /* Not a valid thread handle.  */
+    return ESRCH;
+
+#if 1
+#warning TODO scheduling
+  return ENOSYS;
+#else
+  int result = 0;
+
+  lll_lock (pd->lock, LLL_PRIVATE);
+
+  struct sched_param p;
+  const struct sched_param *orig_param = param;
+
+  /* If the thread should have higher priority because of some
+     PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority.  */
+  if (__builtin_expect (pd->tpp != NULL, 0)
+      && pd->tpp->priomax > param->sched_priority)
+    {
+      p = *param;
+      p.sched_priority = pd->tpp->priomax;
+      param = &p;
+    }
+
+  /* Try to set the scheduler information.  */
+  if (__builtin_expect (__sched_setscheduler (pd->tid, policy,
+					      param) == -1, 0))
+    result = errno;
+  else
+    {
+      /* We succeeded changing the kernel information.  Reflect this
+	 change in the thread descriptor.  */
+      pd->schedpolicy = policy;
+      memcpy (&pd->schedparam, orig_param, sizeof (struct sched_param));
+      pd->flags |= ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET;
+    }
+
+  lll_unlock (pd->lock, LLL_PRIVATE);
+
+  return result;
+#endif
+}
+strong_alias (__pthread_setschedparam, pthread_setschedparam)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_setschedprio.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sched.h>
+#include <string.h>
+#include <sched.h>
+#include "pthreadP.h"
+#include <lowlevellock.h>
+
+
+int
+pthread_setschedprio (pthread_t threadid, int prio)
+{
+  struct pthread *pd = (struct pthread *) threadid;
+
+  /* Make sure the descriptor is valid.  */
+  if (INVALID_TD_P (pd))
+    /* Not a valid thread handle.  */
+    return ESRCH;
+
+#if 1
+#warning TODO scheduling
+  return ENOSYS;
+#else
+  int result = 0;
+  struct sched_param param;
+  param.sched_priority = prio;
+
+  lll_lock (pd->lock, LLL_PRIVATE);
+
+  /* If the thread should have higher priority because of some
+     PTHREAD_PRIO_PROTECT mutexes it holds, adjust the priority.  */
+  if (__builtin_expect (pd->tpp != NULL, 0) && pd->tpp->priomax > prio)
+    param.sched_priority = pd->tpp->priomax;
+
+  /* Try to set the scheduler information.  */
+  if (__builtin_expect (sched_setparam (pd->tid, &param) == -1, 0))
+    result = errno;
+  else
+    {
+      /* We succeeded changing the kernel information.  Reflect this
+	 change in the thread descriptor.  */
+      param.sched_priority = prio;
+      memcpy (&pd->schedparam, &param, sizeof (struct sched_param));
+      pd->flags |= ATTR_FLAG_SCHED_SET;
+    }
+
+  lll_unlock (pd->lock, LLL_PRIVATE);
+
+  return result;
+#endif  
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_sigmask.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define BUILD_AS_pthread_sigmask
+#include "sigprocmask.c"
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/pthread_yield.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <pthread.h>
+#include <sched.h>
+
+
+/* With the 1-on-1 model we implement this function is equivalent to
+   the 'sched_yield' function.  */
+int
+pthread_yield (void)
+{
+  return sched_yield ();
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/raise.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <limits.h>
+#include <signal.h>
+#include <sysdep.h>
+#include <fbtl/pthreadP.h>
+#include <kernel-features.h>
+
+
+int
+raise (int sig)
+{
+  long ktid;
+  INLINE_SYSCALL(thr_self, 1, &ktid);
+  return INLINE_SYSCALL(thr_kill, 2, ktid, sig);
+}
+libc_hidden_def (raise)
+weak_alias (raise, gsignal)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/register-atfork.c
@@ -0,0 +1,144 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fork.h>
+#include <atomic.h>
+
+
+struct fork_handler *__fork_handlers;
+
+/* Lock to protect allocation and deallocation of fork handlers.  */
+int __fork_lock = LLL_LOCK_INITIALIZER;
+
+
+/* Number of pre-allocated handler entries.  */
+#define NHANDLER 48
+
+/* Memory pool for fork handler structures.  */
+static struct fork_handler_pool
+{
+  struct fork_handler_pool *next;
+  struct fork_handler mem[NHANDLER];
+} fork_handler_pool;
+
+
+static struct fork_handler *
+fork_handler_alloc (void)
+{
+  struct fork_handler_pool *runp = &fork_handler_pool;
+  struct fork_handler *result = NULL;
+  unsigned int i;
+
+  do
+    {
+      /* Search for an empty entry.  */
+      for (i = 0; i < NHANDLER; ++i)
+	if (runp->mem[i].refcntr == 0)
+	  goto found;
+    }
+  while ((runp = runp->next) != NULL);
+
+  /* We have to allocate a new entry.  */
+  runp = (struct fork_handler_pool *) calloc (1, sizeof (*runp));
+  if (runp != NULL)
+    {
+      /* Enqueue the new memory pool into the list.  */
+      runp->next = fork_handler_pool.next;
+      fork_handler_pool.next = runp;
+
+      /* We use the last entry on the page.  This means when we start
+	 searching from the front the next time we will find the first
+	 entry unused.  */
+      i = NHANDLER - 1;
+
+    found:
+      result = &runp->mem[i];
+      result->refcntr = 1;
+      result->need_signal = 0;
+    }
+
+  return result;
+}
+
+
+int
+__register_atfork (void (*prepare) (void), void (*parent) (void),
+		   void (*child) (void), void *dso_handle)
+{
+  /* Get the lock to not conflict with other allocations.  */
+  lll_lock (__fork_lock, LLL_PRIVATE);
+
+  struct fork_handler *newp = fork_handler_alloc ();
+
+  if (newp != NULL)
+    {
+      /* Initialize the new record.  */
+      newp->prepare_handler = prepare;
+      newp->parent_handler = parent;
+      newp->child_handler = child;
+      newp->dso_handle = dso_handle;
+
+      __linkin_atfork (newp);
+    }
+
+  /* Release the lock.  */
+  lll_unlock (__fork_lock, LLL_PRIVATE);
+
+  return newp == NULL ? ENOMEM : 0;
+}
+libc_hidden_def (__register_atfork)
+
+
+void
+attribute_hidden
+__linkin_atfork (struct fork_handler *newp)
+{
+  do
+    newp->next = __fork_handlers;
+  while (catomic_compare_and_exchange_bool_acq (&__fork_handlers,
+						newp, newp->next) != 0);
+}
+
+
+libc_freeres_fn (free_mem)
+{
+  /* Get the lock to not conflict with running forks.  */
+  lll_lock (__fork_lock, LLL_PRIVATE);
+
+  /* No more fork handlers.  */
+  __fork_handlers = NULL;
+
+  /* Free eventually alloated memory blocks for the object pool.  */
+  struct fork_handler_pool *runp = fork_handler_pool.next;
+
+  memset (&fork_handler_pool, '\0', sizeof (fork_handler_pool));
+
+  /* Release the lock.  */
+  lll_unlock (__fork_lock, LLL_PRIVATE);
+
+  /* We can free the memory after releasing the lock.  */
+  while (runp != NULL)
+    {
+      struct fork_handler_pool *oldp = runp;
+      runp = runp->next;
+      free (oldp);
+    }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sem_post.c
@@ -0,0 +1,79 @@
+/* sem_post -- post to a POSIX semaphore.  Generic futex-using version.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <atomic.h>
+#include <errno.h>
+#include <sysdep.h>
+#include <lowlevellock.h>
+#include <internaltypes.h>
+#include <semaphore.h>
+
+#include <shlib-compat.h>
+
+int
+__new_sem_post (sem_t *sem)
+{
+  struct new_sem *isem = (struct new_sem *) sem;
+
+  __typeof (isem->value) cur = atomic_load_relaxed(&isem->value);
+  do
+    {
+      if (cur == SEM_VALUE_MAX)
+	{
+	  __set_errno (EOVERFLOW);
+	  return -1;
+	}
+    }
+  while (!atomic_compare_exchange_weak_release(&isem->value, &cur, cur + 1));
+
+  atomic_full_barrier ();
+  if (isem->nwaiters > 0)
+    {
+      int err = lll_futex_wake (&isem->value, 1,
+				isem->private ^ FUTEX_PRIVATE_FLAG);
+      if (__builtin_expect (err, 0) != 0)
+	{
+	  __set_errno (err);
+	  return -1;
+	}
+    }
+  return 0;
+}
+versioned_symbol (libpthread, __new_sem_post, sem_post, GLIBC_2_1);
+
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)
+int
+attribute_compat_text_section
+__old_sem_post (sem_t *sem)
+{
+  int *futex = (int *) sem;
+
+  (void) atomic_increment_val (futex);
+  /* We always have to assume it is a shared semaphore.  */
+  int err = lll_futex_wake (futex, 1, LLL_SHARED);
+  if (__builtin_expect (err, 0) != 0)
+    {
+      __set_errno (err);
+      return -1;
+    }
+  return 0;
+}
+compat_symbol (libpthread, __old_sem_post, sem_post, GLIBC_2_0);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sem_timedwait.c
@@ -0,0 +1,116 @@
+/* sem_timedwait -- wait on a semaphore.  Generic futex-using version.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sysdep.h>
+#include <lowlevellock.h>
+#include <internaltypes.h>
+#include <semaphore.h>
+
+#include <pthreadP.h>
+#include <shlib-compat.h>
+#include <sys/time.h>
+
+extern void __sem_wait_cleanup (void *arg) attribute_hidden;
+
+/* This is in a seperate function in order to make sure gcc
+   puts the call site into an exception region, and thus the
+   cleanups get properly run.  */
+static int
+__attribute__ ((noinline))
+do_futex_timed_wait (struct new_sem *isem, struct timespec *rt)
+{
+  int err, oldtype = __pthread_enable_asynccancel ();
+
+  err = lll_futex_timed_wait (&isem->value, 0, rt,
+			      isem->private ^ FUTEX_PRIVATE_FLAG);
+
+  __pthread_disable_asynccancel (oldtype);
+  return err;
+}
+
+int
+sem_timedwait (sem_t *sem, const struct timespec *abstime)
+{
+  struct new_sem *isem = (struct new_sem *) sem;
+  int err;
+
+  if (atomic_decrement_if_positive (&isem->value) > 0)
+    return 0;
+
+  if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  atomic_increment (&isem->nwaiters);
+
+  pthread_cleanup_push (__sem_wait_cleanup, isem);
+
+  while (1)
+    {
+      struct timeval tv;
+      struct timespec rt;
+      int sec, nsec;
+
+      /* Get the current time.  */
+      __gettimeofday (&tv, NULL);
+
+      /* Compute relative timeout.  */
+      sec = abstime->tv_sec - tv.tv_sec;
+      nsec = abstime->tv_nsec - tv.tv_usec * 1000;
+      if (nsec < 0)
+	{
+	  nsec += 1000000000;
+	  --sec;
+	}
+
+      /* Already timed out?  */
+      if (sec < 0)
+	{
+	  __set_errno (ETIMEDOUT);
+	  err = -1;
+	  break;
+	}
+
+      /* Do wait.  */
+      rt.tv_sec = sec;
+      rt.tv_nsec = nsec;
+      err = do_futex_timed_wait(isem, &rt);
+      if (err != 0 && err != EWOULDBLOCK)
+	{
+	  __set_errno (err);
+	  err = -1;
+	  break;
+	}
+
+      if (atomic_decrement_if_positive (&isem->value) > 0)
+	{
+	  err = 0;
+	  break;
+	}
+    }
+
+  pthread_cleanup_pop (0);
+
+  atomic_decrement (&isem->nwaiters);
+
+  return err;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sem_trywait.c
@@ -0,0 +1,49 @@
+/* sem_trywait -- wait on a semaphore.  Generic futex-using version.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sysdep.h>
+#include <lowlevellock.h>
+#include <internaltypes.h>
+#include <semaphore.h>
+
+#include <shlib-compat.h>
+
+
+int
+__new_sem_trywait (sem_t *sem)
+{
+  int *futex = (int *) sem;
+  int val;
+
+  if (*futex > 0)
+    {
+      val = atomic_decrement_if_positive (futex);
+      if (val > 0)
+	return 0;
+    }
+
+  __set_errno (EAGAIN);
+  return -1;
+}
+versioned_symbol (libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1);
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)
+strong_alias (__new_sem_trywait, __old_sem_trywait)
+compat_symbol (libpthread, __old_sem_trywait, sem_trywait, GLIBC_2_0);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sem_wait.c
@@ -0,0 +1,122 @@
+/* sem_wait -- wait on a semaphore.  Generic futex-using version.
+   Copyright (C) 2003-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sysdep.h>
+#include <lowlevellock.h>
+#include <internaltypes.h>
+#include <semaphore.h>
+
+#include <pthreadP.h>
+#include <shlib-compat.h>
+
+
+void
+attribute_hidden
+__sem_wait_cleanup (void *arg)
+{
+  struct new_sem *isem = (struct new_sem *) arg;
+
+  atomic_decrement (&isem->nwaiters);
+}
+
+/* This is in a seperate function in order to make sure gcc
+   puts the call site into an exception region, and thus the
+   cleanups get properly run.  */
+static int
+__attribute__ ((noinline))
+do_futex_wait (struct new_sem *isem)
+{
+  int err, oldtype = __pthread_enable_asynccancel ();
+
+  err = lll_futex_wait (&isem->value, 0, isem->private ^ FUTEX_PRIVATE_FLAG);
+
+  __pthread_disable_asynccancel (oldtype);
+  return err;
+}
+
+int
+__new_sem_wait (sem_t *sem)
+{
+  struct new_sem *isem = (struct new_sem *) sem;
+  int err;
+
+  if (atomic_decrement_if_positive (&isem->value) > 0)
+    return 0;
+
+  atomic_increment (&isem->nwaiters);
+
+  pthread_cleanup_push (__sem_wait_cleanup, isem);
+
+  while (1)
+    {
+      err = do_futex_wait(isem);
+      if (err != 0 && err != EWOULDBLOCK)
+	{
+	  __set_errno (err);
+	  err = -1;
+	  break;
+	}
+
+      if (atomic_decrement_if_positive (&isem->value) > 0)
+	{
+	  err = 0;
+	  break;
+	}
+    }
+
+  pthread_cleanup_pop (0);
+
+  atomic_decrement (&isem->nwaiters);
+
+  return err;
+}
+versioned_symbol (libpthread, __new_sem_wait, sem_wait, GLIBC_2_1);
+
+
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)
+int
+attribute_compat_text_section
+__old_sem_wait (sem_t *sem)
+{
+  int *futex = (int *) sem;
+  int err;
+
+  do
+    {
+      if (atomic_decrement_if_positive (futex) > 0)
+	return 0;
+
+      /* Enable asynchronous cancellation.  Required by the standard.  */
+      int oldtype = __pthread_enable_asynccancel ();
+
+      /* Always assume the semaphore is shared.  */
+      err = lll_futex_wait (futex, 0, LLL_SHARED);
+
+      /* Disable asynchronous cancellation.  */
+      __pthread_disable_asynccancel (oldtype);
+    }
+  while (err == 0 || err == EWOULDBLOCK);
+
+  __set_errno (err);
+  return -1;
+}
+
+compat_symbol (libpthread, __old_sem_wait, sem_wait, GLIBC_2_0);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sigprocmask.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 1997-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include <kernel-features.h>
+
+#include <pthreadP.h>
+
+/* Get and/or change the set of blocked signals.  */
+int
+#ifdef BUILD_AS_pthread_sigmask
+pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
+#else
+__sigprocmask (int how, const sigset_t *set, sigset_t *oset)
+#endif
+{
+  sigset_t local_newmask;
+  int rv;
+
+  /* The only thing we have to make sure here is that SIGCANCEL and
+     SIGSETXID are not blocked.  */
+  if (set != NULL
+      && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+	  || __builtin_expect (__sigismember (set, SIGSETXID), 0)
+	  ))
+    {
+      local_newmask = *set;
+      __sigdelset (&local_newmask, SIGCANCEL);
+      __sigdelset (&local_newmask, SIGSETXID);
+      set = &local_newmask;
+    }
+
+  rv = INLINE_SYSCALL (sigprocmask, 3, how, set, oset);
+#ifdef BUILD_AS_pthread_sigmask
+  return rv;
+}  
+#else
+  if (rv)
+  {
+      errno = rv;
+      return -1;
+  }
+  return 0;        
+}
+weak_alias (__sigprocmask, sigprocmask)
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sigtimedwait.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 1997-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <fbtl/pthreadP.h>
+
+static int
+do_sigtimedwait (const sigset_t *set, siginfo_t *info,
+		 const struct timespec *timeout)
+{
+#ifdef SIGCANCEL
+  sigset_t tmpset;
+  if (set != NULL
+      && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+	  || __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+	  ))
+    {
+      /* Create a temporary mask without the bit for SIGCANCEL set.  */
+      tmpset = *set;
+      __sigdelset (&tmpset, SIGCANCEL);
+# ifdef SIGSETXID
+      __sigdelset (&tmpset, SIGSETXID);
+# endif
+      set = &tmpset;
+    }
+#endif
+
+  return INLINE_SYSCALL (sigtimedwait, 3, set, info, timeout);
+}
+
+
+/* Return any pending signal or wait for one for the given time.  */
+int
+__sigtimedwait (const sigset_t *set, siginfo_t *info,
+		const struct timespec *timeout)
+{
+  if (SINGLE_THREAD_P)
+    return do_sigtimedwait (set, info, timeout);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = do_sigtimedwait (set, info, timeout);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+libc_hidden_def (__sigtimedwait)
+weak_alias (__sigtimedwait, sigtimedwait)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sigwait.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 1997-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <signal.h>
+#define __need_NULL
+#include <stddef.h>
+#include <string.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <fbtl/pthreadP.h>
+
+
+/* Return any pending signal or wait for one for the given time.  */
+static int
+do_sigwait (const sigset_t *set, int *sig)
+{
+  int ret;
+
+#ifdef SIGCANCEL
+  sigset_t tmpset;
+  if (set != NULL
+      && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+	  || __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+	  ))
+    {
+      /* Create a temporary mask without the bit for SIGCANCEL set.  */
+      tmpset = *set;
+      __sigdelset (&tmpset, SIGCANCEL);
+# ifdef SIGSETXID
+      __sigdelset (&tmpset, SIGSETXID);
+# endif
+      set = &tmpset;
+    }
+#endif
+  do {
+      ret = INLINE_SYSCALL (sigwait, 2, set, sig);
+  } while (ret == EINTR);
+  
+  return ret;
+}
+
+int
+__sigwait (const sigset_t *set, int *sig)
+{
+  if (SINGLE_THREAD_P)
+    return do_sigwait (set, sig);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = do_sigwait (set, sig);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+libc_hidden_def (__sigwait)
+weak_alias (__sigwait, sigwait)
+strong_alias (__sigwait, __libc_sigwait)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sigwaitinfo.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 1997-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <signal.h>
+#define __need_NULL
+#include <stddef.h>
+#include <string.h>
+
+#include <sysdep-cancel.h>
+#include <sys/syscall.h>
+#include <fbtl/pthreadP.h>
+
+
+static int
+do_sigwaitinfo (const sigset_t *set, siginfo_t *info)
+{
+#ifdef SIGCANCEL
+  sigset_t tmpset;
+  if (set != NULL
+      && (__builtin_expect (__sigismember (set, SIGCANCEL), 0)
+# ifdef SIGSETXID
+	  || __builtin_expect (__sigismember (set, SIGSETXID), 0)
+# endif
+	  ))
+    {
+      /* Create a temporary mask without the bit for SIGCANCEL set.  */
+      tmpset = *set;
+      __sigdelset (&tmpset, SIGCANCEL);
+# ifdef SIGSETXID
+      __sigdelset (&tmpset, SIGSETXID);
+# endif
+      set = &tmpset;
+    }
+#endif
+
+  return INLINE_SYSCALL (sigwaitinfo, 2, set, info);
+}
+
+
+/* Return any pending signal or wait for one for the given time.  */
+int
+__sigwaitinfo (const sigset_t *set, siginfo_t *info)
+{
+  if (SINGLE_THREAD_P)
+    return do_sigwaitinfo (set, info);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = do_sigwaitinfo (set, info);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+libc_hidden_def (__sigwaitinfo)
+weak_alias (__sigwaitinfo, sigwaitinfo)
+strong_alias (__sigwaitinfo, __libc_sigwaitinfo)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sleep.c
@@ -0,0 +1,2 @@
+#include <pthreadP.h>
+#include "../sleep.c"
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/smp.h
@@ -0,0 +1,36 @@
+/* Determine whether the host has multiple processors.  FreeBSD version.
+   Copyright (C) 1996, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <sys/sysctl.h>
+
+/* Test whether the machine has more than one processor.  */
+static inline int
+is_smp_system (void)
+{
+  /* Fetch sysctl value of "hw.ncpu".  */
+  int request[] = { CTL_HW, HW_NCPU };
+  int result;
+  size_t result_len = sizeof (result);
+
+  if (__sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
+    /* Dummy result.  */
+    return 0;
+
+  return (result > 1);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/structsem.sym
@@ -0,0 +1,12 @@
+#include <limits.h>
+#include <stddef.h>
+#include <sched.h>
+#include <bits/pthreadtypes.h>
+#include "internaltypes.h"
+
+--
+
+VALUE		offsetof (struct new_sem, value)
+PRIVATE		offsetof (struct new_sem, private)
+NWAITERS	offsetof (struct new_sem, nwaiters)
+SEM_VALUE_MAX	SEM_VALUE_MAX
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/sysconf.c
@@ -0,0 +1,70 @@
+/* Get file-specific information about a file.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sysdep.h>
+#include <time.h>
+#include <unistd.h>
+#include <hp-timing.h>
+#include <sys/sysctl.h>
+
+static long int posix_sysconf (int name);
+
+/* Get the value of the system variable NAME.  */
+long int
+__sysconf (int name)
+{
+  int request[2];
+  int value;
+  size_t len = sizeof(value);
+
+  switch(name)
+    {
+      case _SC_CPUTIME:
+      case _SC_THREAD_CPUTIME:
+      {
+        clockid_t clock_id;
+        /* try whether we have a syscall available */ 
+        if ( ENOSYS != INLINE_SYSCALL(clock_getcpuclockid2, 3, 0, CPUCLOCK_WHICH_TID, &clock_id))
+	  return 200809L;
+	else
+	  return -1;
+      }  
+      case _SC_NGROUPS_MAX:
+	request[0] = CTL_KERN;
+	request[1] = KERN_NGROUPS;
+	if (__sysctl(request, 2, &value, &len, NULL, 0) == -1)
+	    return NGROUPS_MAX;
+	return (long)value;
+      case _SC_ARG_MAX:
+	request[0] = CTL_KERN;
+	request[1] = KERN_ARGMAX;
+	if (__sysctl(request, 2, &value, &len, NULL, 0) == -1)
+	    return ARG_MAX;
+	return (long)value;
+    }
+  return posix_sysconf (name);
+}
+
+/* Now the POSIX version.  */
+#undef __sysconf
+#define __sysconf static posix_sysconf
+#include <sysdeps/posix/sysconf.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/timer_create.c
@@ -0,0 +1,165 @@
+/* Copyright (C) 2003,2004, 2007, 2009, 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+#include <internaltypes.h>
+#include <fbtl/pthreadP.h>
+#include "kernel-posix-timers.h"
+#include "kernel-posix-cpu-timers.h"
+
+
+int
+timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
+{
+    {
+      /* If the user wants notification via a thread we need to handle
+	 this special.  */
+      if (evp == NULL
+	  || __builtin_expect (evp->sigev_notify != SIGEV_THREAD, 1))
+	{
+	  struct sigevent local_evp;
+
+	  struct timer *newp = __kfreebsd_timer_alloc ();
+
+	  if (newp == NULL)
+	    /* No more memory.  */
+	    return -1;
+
+	  if (evp == NULL)
+	    {
+	      /* The kernel has to pass up the timer ID which is a
+		 userlevel object.  Therefore we cannot leave it up to
+		 the kernel to determine it.  */
+	      local_evp.sigev_notify = SIGEV_SIGNAL;
+	      local_evp.sigev_signo = SIGALRM;
+	      local_evp.sigev_value.sival_int = __kfreebsd_timer_ptr2id (newp);
+
+	      evp = &local_evp;
+	    }
+
+	  kernel_timer_t ktimerid;
+	  int retval = INLINE_SYSCALL (ktimer_create, 3, clock_id, evp,
+				       &ktimerid);
+
+	    {
+
+	      if (retval != -1)
+		{
+		  newp->sigev_notify = (evp != NULL
+					? evp->sigev_notify : SIGEV_SIGNAL);
+		  newp->ktimerid = ktimerid;
+
+		  *timerid = __kfreebsd_timer_ptr2id (newp);
+		}
+	      else
+		{
+		  /* Cannot allocate the timer, fail.  */
+		  __kfreebsd_timer_free (newp);
+		  retval = -1;
+		}
+
+	      return retval;
+	    }
+	}
+      else
+	{
+	    {
+	      /* Create the helper thread.  */
+	      pthread_once (&__helper_once, __start_helper_thread);
+	      if (__helper_tid == 0)
+		{
+		  /* No resources to start the helper thread.  */
+		  __set_errno (EAGAIN);
+		  return -1;
+		}
+
+	      struct timer *newp;
+	      newp = __kfreebsd_timer_alloc ();
+	      if (newp == NULL)
+		return -1;
+
+	      /* Copy the thread parameters the user provided.  */
+	      newp->sival = evp->sigev_value;
+	      newp->thrfunc = evp->sigev_notify_function;
+	      newp->sigev_notify = SIGEV_THREAD;
+
+	      /* We cannot simply copy the thread attributes since the
+		 implementation might keep internal information for
+		 each instance.  */
+	      (void) pthread_attr_init (&newp->attr);
+	      if (evp->sigev_notify_attributes != NULL)
+		{
+		  struct pthread_attr *nattr;
+		  struct pthread_attr *oattr;
+
+		  nattr = (struct pthread_attr *) &newp->attr;
+		  oattr = (struct pthread_attr *) evp->sigev_notify_attributes;
+
+		  nattr->schedparam = oattr->schedparam;
+		  nattr->schedpolicy = oattr->schedpolicy;
+		  nattr->flags = oattr->flags;
+		  nattr->guardsize = oattr->guardsize;
+		  nattr->stackaddr = oattr->stackaddr;
+		  nattr->stacksize = oattr->stacksize;
+		}
+
+	      /* In any case set the detach flag.  */
+	      (void) pthread_attr_setdetachstate (&newp->attr,
+						  PTHREAD_CREATE_DETACHED);
+
+	      /* Create the event structure for the kernel timer.  */
+	      struct sigevent sev =
+		{ .sigev_value.sival_ptr = newp,
+		  .sigev_signo = SIGTIMER,
+		  .sigev_notify = SIGEV_THREAD_ID,
+		  .sigev_notify_thread_id = __helper_tid,
+		};
+
+	      /* Create the timer.  */
+	      int res;
+	      res = INLINE_SYSCALL (ktimer_create, 3,
+				      clock_id, &sev, &newp->ktimerid);
+	      if (res != -1)
+		{
+		  /* Add to the queue of active timers with thread
+		     delivery.  */
+		  pthread_mutex_lock (&__active_timer_sigev_thread_lock);
+		  newp->next = __active_timer_sigev_thread;
+		  __active_timer_sigev_thread = newp;
+		  pthread_mutex_unlock (&__active_timer_sigev_thread_lock);
+
+		  *timerid = __kfreebsd_timer_ptr2id (newp);
+		  return 0;
+		}
+
+	      /* Free the resources.  */
+	      __kfreebsd_timer_free (newp);
+
+	      return -1;
+	    }
+	}
+    }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/timer_delete.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2003, 2007, 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+#include "kernel-posix-timers.h"
+
+
+int
+timer_delete (timer_t timerid)
+{
+      struct timer *kt = __kfreebsd_timer_id2ptr (timerid);
+      if (! kt)
+	return -1;
+
+      /* Delete the kernel timer object.  */
+      int res = INLINE_SYSCALL (ktimer_delete, 1, kt->ktimerid);
+
+      if (res == 0)
+	{
+	  if (kt->sigev_notify == SIGEV_THREAD)
+	    {
+	      /* Remove the timer from the list.  */
+	      pthread_mutex_lock (&__active_timer_sigev_thread_lock);
+	      if (__active_timer_sigev_thread == kt)
+		__active_timer_sigev_thread = kt->next;
+	      else
+		{
+		  struct timer *prevp = __active_timer_sigev_thread;
+		  while (prevp->next != NULL)
+		    if (prevp->next == kt)
+		      {
+			prevp->next = kt->next;
+			break;
+		      }
+		    else
+		      prevp = prevp->next;
+		}
+	      pthread_mutex_unlock (&__active_timer_sigev_thread_lock);
+	    }
+
+	  /* Free the memory.  */
+	  (void) __kfreebsd_timer_free (kt);
+
+	  return 0;
+	}
+
+      /* The kernel timer is not known or something else bad happened.
+	 Return the error.  */
+	  return -1;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/timer_getoverr.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2003, 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <time.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+#include "kernel-posix-timers.h"
+
+
+int
+timer_getoverrun (timer_t timerid)
+{
+      struct timer *kt = __kfreebsd_timer_id2ptr (timerid);
+      if (! kt)
+	return -1;
+
+      /* Get the information from the kernel.  */
+      return INLINE_SYSCALL (ktimer_getoverrun, 1, kt->ktimerid);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/timer_gettime.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2003, 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+#include "kernel-posix-timers.h"
+
+
+int
+timer_gettime (timer_t timerid, struct itimerspec *value)
+{
+      struct timer *kt = __kfreebsd_timer_id2ptr (timerid);
+      if (! kt)
+	return -1;
+
+      /* Delete the kernel timer object.  */
+      return INLINE_SYSCALL (ktimer_gettime, 2, kt->ktimerid, value);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/timer_routines.c
@@ -0,0 +1,201 @@
+/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+#include <fbtl/pthreadP.h>
+#include "kernel-posix-timers.h"
+
+/* NPTL/Linux simply casts "timer_t" to "struct timer *", but on
+   kFreeBSD timer_t may not be large enough to hold a pointer.
+   So we store the pointers here... (sigh) */
+struct timer *__all_timers[TIMER_MAX];
+
+/* List of active SIGEV_THREAD timers.  */
+struct timer *__active_timer_sigev_thread;
+/* Lock for the __active_timer_sigev_thread.  */
+pthread_mutex_t __active_timer_sigev_thread_lock = PTHREAD_MUTEX_INITIALIZER;
+
+
+struct thread_start_data
+{
+  void (*thrfunc) (sigval_t);
+  sigval_t sival;
+};
+
+
+/* Helper thread to call the user-provided function.  */
+static void *
+timer_sigev_thread (void *arg)
+{
+  /* The parent thread has all signals blocked.  This is a bit
+     surprising for user code, although valid.  We unblock all
+     signals.  */
+  sigset_t ss;
+  sigemptyset (&ss);
+
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &ss, NULL);
+
+  struct thread_start_data *td = (struct thread_start_data *) arg;
+
+  void (*thrfunc) (sigval_t) = td->thrfunc;
+  sigval_t sival = td->sival;
+
+  /* The TD object was allocated in timer_helper_thread.  */
+  free (td);
+
+  /* Call the user-provided function.  */
+  thrfunc (sival);
+
+  return NULL;
+}
+
+
+/* Helper function to support starting threads for SIGEV_THREAD.  */
+static void *
+timer_helper_thread (void *arg)
+{
+  /* Wait for the SIGTIMER signal, allowing the setXid signal, and
+     none else.  */
+  sigset_t ss;
+  sigemptyset (&ss);
+  __sigaddset (&ss, SIGTIMER);
+
+  /* Endless loop of waiting for signals.  The loop is only ended when
+     the thread is canceled.  */
+  while (1)
+    {
+      siginfo_t si;
+
+      /* sigwaitinfo cannot be used here, since it deletes
+	 SIGCANCEL == SIGTIMER from the set.  */
+      /* but direct interface to kernel does not do such things */
+
+      int oldtype = LIBC_CANCEL_ASYNC ();
+
+      int result = INLINE_SYSCALL (sigwaitinfo, 2, &ss, &si);
+
+      LIBC_CANCEL_RESET (oldtype);
+
+      if (result > 0)
+	{
+	  if (si.si_code == SI_TIMER)
+	    {
+	      struct timer *tk = (struct timer *) si.si_value.sival_ptr;
+
+	      /* Check the timer is still used and will not go away
+		 while we are reading the values here.  */
+	      pthread_mutex_lock (&__active_timer_sigev_thread_lock);
+
+	      struct timer *runp = __active_timer_sigev_thread;
+	      while (runp != NULL)
+		if (runp == tk)
+		  break;
+		else
+		  runp = runp->next;
+
+	      if (runp != NULL)
+		{
+		  struct thread_start_data *td = malloc (sizeof (*td));
+
+		  /* There is not much we can do if the allocation fails.  */
+		  if (td != NULL)
+		    {
+		      /* This is the signal we are waiting for.  */
+		      td->thrfunc = tk->thrfunc;
+		      td->sival = tk->sival;
+
+		      pthread_t th;
+		      (void) pthread_create (&th, &tk->attr,
+					     timer_sigev_thread, td);
+		    }
+		}
+
+	      pthread_mutex_unlock (&__active_timer_sigev_thread_lock);
+	    }
+	  else if (si.si_code == SI_LWP
+		   /* Backward compatibility (see rev 211732 in -CURRENT).  */
+		   || si.si_code == SI_USER)
+	    /* The thread is canceled.  */
+	    pthread_exit (NULL);
+	}
+    }
+}
+
+
+/* Control variable for helper thread creation.  */
+pthread_once_t __helper_once attribute_hidden;
+
+
+/* TID of the helper thread.  */
+pid_t __helper_tid attribute_hidden;
+
+
+/* Reset variables so that after a fork a new helper thread gets started.  */
+static void
+reset_helper_control (void)
+{
+  __helper_once = PTHREAD_ONCE_INIT;
+  __helper_tid = 0;
+}
+
+
+void
+attribute_hidden
+__start_helper_thread (void)
+{
+  /* The helper thread needs only very little resources
+     and should go away automatically when canceled.  */
+  pthread_attr_t attr;
+  (void) pthread_attr_init (&attr);
+  (void) pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
+
+  /* Block all signals in the helper thread but SIGSETXID.  To do this
+     thoroughly we temporarily have to block all signals here.  The
+     helper can lose wakeups if SIGCANCEL is not blocked throughout,
+     but sigfillset omits it SIGSETXID.  So, we add SIGCANCEL back
+     explicitly here.  */
+  sigset_t ss;
+  sigset_t oss;
+  sigfillset (&ss);
+  __sigaddset (&ss, SIGCANCEL);
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &ss, &oss);
+
+
+  /* Create the helper thread for this timer.  */
+  pthread_t th;
+  int res = pthread_create (&th, &attr, timer_helper_thread, NULL);
+  if (res == 0)
+    /* We managed to start the helper thread.  */
+    __helper_tid = ((struct pthread *) th)->tid;
+
+  /* Restore the signal mask.  */
+  INLINE_SYSCALL (sigprocmask, 3, SIG_SETMASK, &oss, NULL);
+
+  /* No need for the attribute anymore.  */
+  (void) pthread_attr_destroy (&attr);
+
+  /* We have to make sure that after fork()ing a new helper thread can
+     be created.  */
+  pthread_atfork (NULL, NULL, reset_helper_control);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/timer_settime.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2003, 2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+#include "kernel-posix-timers.h"
+
+int
+timer_settime (timer_t timerid, int flags, const struct itimerspec *value,
+	       struct itimerspec *ovalue)
+{
+      struct timer *kt = __kfreebsd_timer_id2ptr (timerid);
+      if (! kt)
+	return -1;
+
+      /* Set the kernel timer object.  */
+      return INLINE_SYSCALL (ktimer_settime, 4, kt->ktimerid, flags,
+				value, ovalue);
+
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/unregister-atfork.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <fork.h>
+#include <atomic.h>
+
+
+void
+__unregister_atfork (void *dso_handle)
+{
+  /* Check whether there is any entry in the list which we have to
+     remove.  It is likely that this is not the case so don't bother
+     getting the lock.
+
+     We do not worry about other threads adding entries for this DSO
+     right this moment.  If this happens this is a race and we can do
+     whatever we please.  The program will crash anyway seen.  */
+  struct fork_handler *runp = __fork_handlers;
+  struct fork_handler *lastp = NULL;
+
+  while (runp != NULL)
+    if (runp->dso_handle == dso_handle)
+      break;
+    else
+      {
+	lastp = runp;
+	runp = runp->next;
+      }
+
+  if (runp == NULL)
+    /* Nothing to do.  */
+    return;
+
+  /* Get the lock to not conflict with additions or deletions.  Note
+     that there couldn't have been another thread deleting something.
+     The __unregister_atfork function is only called from the
+     dlclose() code which itself serializes the operations.  */
+  lll_lock (__fork_lock, LLL_PRIVATE);
+
+  /* We have to create a new list with all the entries we don't remove.  */
+  struct deleted_handler
+  {
+    struct fork_handler *handler;
+    struct deleted_handler *next;
+  } *deleted = NULL;
+
+  /* Remove the entries for the DSO which is unloaded from the list.
+     It's a single linked list so readers are.  */
+  do
+    {
+    again:
+      if (runp->dso_handle == dso_handle)
+	{
+	  if (lastp == NULL)
+	    {
+	      /* We have to use an atomic operation here because
+		 __linkin_atfork also uses one.  */
+	      if (catomic_compare_and_exchange_bool_acq (&__fork_handlers,
+							 runp->next, runp)
+		  != 0)
+		{
+		  runp = __fork_handlers;
+		  goto again;
+		}
+	    }
+	  else
+	    lastp->next = runp->next;
+
+	  /* We cannot overwrite the ->next element now.  Put the deleted
+	     entries in a separate list.  */
+	  struct deleted_handler *newp = alloca (sizeof (*newp));
+	  newp->handler = runp;
+	  newp->next = deleted;
+	  deleted = newp;
+	}
+      else
+	lastp = runp;
+
+      runp = runp->next;
+    }
+  while (runp != NULL);
+
+  /* Release the lock.  */
+  lll_unlock (__fork_lock, LLL_PRIVATE);
+
+  /* Walk the list of all entries which have to be deleted.  */
+  while (deleted != NULL)
+    {
+      /* We need to be informed by possible current users.  */
+      deleted->handler->need_signal = 1;
+      /* Make sure this gets written out first.  */
+      atomic_write_barrier ();
+
+      /* Decrement the reference counter.  If it does not reach zero
+	 wait for the last user.  */
+      atomic_decrement (&deleted->handler->refcntr);
+      unsigned int val;
+      while ((val = deleted->handler->refcntr) != 0)
+	lll_futex_wait (&deleted->handler->refcntr, val, LLL_PRIVATE);
+
+      deleted = deleted->next;
+    }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fbtl/unwindbuf.sym
@@ -0,0 +1,7 @@
+#include <pthread.h>
+#include <stddef.h>
+
+--
+
+UNWINDBUFSIZE	sizeof (__pthread_unwind_buf_t)
+UWJMPBUF	offsetof (__pthread_unwind_buf_t, __cancel_jmp_buf)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fcntl.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <assert.h>
+#include <errno.h>
+#include <sysdep-cancel.h>	/* Must come before <fcntl.h>.  */
+#include <fcntl.h>
+#include <stdarg.h>
+
+#include <sys/syscall.h>
+
+
+#ifndef NO_CANCELLATION
+int
+__fcntl_nocancel (int fd, int cmd, ...)
+{
+  va_list ap;
+  void *arg;
+
+  va_start (ap, cmd);
+  arg = va_arg (ap, void *);
+  va_end (ap);
+
+  return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+}
+#endif
+
+
+int
+__libc_fcntl (int fd, int cmd, ...)
+{
+  va_list ap;
+  void *arg;
+
+  va_start (ap, cmd);
+  arg = va_arg (ap, void *);
+  va_end (ap);
+
+  if (SINGLE_THREAD_P || cmd != F_SETLKW)
+    return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+libc_hidden_def (__libc_fcntl)
+
+weak_alias (__libc_fcntl, __fcntl)
+libc_hidden_weak (__fcntl)
+weak_alias (__libc_fcntl, fcntl)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fdatasync.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <unistd.h>
+#include <sysdep-cancel.h>
+
+int __libc_fsync (int fd);
+libc_hidden_proto (__libc_fsync)
+
+/* Synchronize at least the data part of a file with the underlying
+   media.  */
+int
+fdatasync (int fildes)
+{
+  return __libc_fsync (fildes);
+}
+
+LIBC_CANCEL_HANDLED ();         /* fsync handles our cancellation.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fhstat.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sysdep.h>
+
+#include "stat16conv.c"
+
+int
+__fhstat (const fhandle_t *fhp, struct stat *buf)
+{
+  struct stat16 buf16;
+
+  if (__syscall_fhstat (fhp, &buf16) < 0)
+    return -1;
+
+  /* Convert a 'struct stat16' to 'struct stat'.  */
+  stat16_to_stat (&buf16, buf);
+
+  return 0;
+}
+
+weak_alias (__fhstat, fhstat)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fhstat64.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sysdep.h>
+
+#include "stat16conv.c"
+
+int
+fhstat64 (const fhandle_t *fhp, struct stat64 *buf)
+{
+  struct stat16 buf16;
+
+  if (__syscall_fhstat (fhp, &buf16) < 0)
+    return -1;
+
+  /* Convert a 'struct stat16' to 'struct stat64'.  */
+  stat16_to_stat64 (&buf16, buf);
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fhstatfs.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mount.h>
+
+#include "statfsconv.c"
+
+int
+fhstatfs (const fhandle_t *fhp, struct statfs *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_fhstatfs (fhp, &kbuf) < 0)
+    return -1;
+
+  statfs5_to_statfs (&kbuf, buf);
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fhstatfs64.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mount.h>
+
+#include "statfsconv.c"
+
+int
+fhstatfs64 (const fhandle_t *fhp, struct statfs64 *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_fhstatfs (fhp, &kbuf) < 0)
+    return -1;
+
+  /* Convert a 'struct statfs' to 'struct statfs64'.  */
+  statfs5_to_statfs64 (&kbuf, buf);
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fstatfs.c
@@ -0,0 +1,38 @@
+/* Return information about the filesystem on which FD resides.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/statfs.h>
+
+#include "statfsconv.c"
+
+/* Return information about the filesystem on which FD resides.  */
+int
+__fstatfs (int fd, struct statfs *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_fstatfs (fd, &kbuf) < 0)
+    return -1;
+
+  statfs5_to_statfs (&kbuf, buf);
+
+  return 0;
+}
+weak_alias (__fstatfs, fstatfs)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fstatfs64.c
@@ -0,0 +1,40 @@
+/* Return information about the filesystem on which FD resides.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/statfs.h>
+
+#include "statfsconv.c"
+
+/* Return information about the filesystem on which FD resides.  */
+int
+__fstatfs64 (int fd, struct statfs64 *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_fstatfs (fd, &kbuf) < 0)
+    return -1;
+
+  /* Convert a 'struct statfs' to 'struct statfs64'.  */
+  statfs5_to_statfs64 (&kbuf, buf);
+
+  return 0;
+}
+
+weak_alias (__fstatfs64, fstatfs64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fstatvfs.c
@@ -0,0 +1,40 @@
+/* Return information about the filesystem on which FD resides.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/statvfs.h>
+#include <sys/statfs.h>
+
+#include "statfsconv.c"
+
+/* Return information about the filesystem on which FD resides.  */
+int
+fstatvfs (int fd, struct statvfs *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_fstatfs (fd, &kbuf) < 0)
+    return -1;
+
+  /* Convert a 'struct statfs' to 'struct statvfs'.  */
+  statfs5_to_statvfs (&kbuf, buf);
+
+  return 0;
+}
+libc_hidden_def (fstatvfs)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fstatvfs64.c
@@ -0,0 +1,41 @@
+/* Return information about the filesystem on which FD resides.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/statvfs.h>
+#include <sys/statfs.h>
+
+#include "statfsconv.c"
+
+/* Return information about the filesystem on which FD resides.  */
+int
+__fstatvfs64 (int fd, struct statvfs64 *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_fstatfs (fd, &kbuf) < 0)
+    return -1;
+
+  /* Convert a 'struct statfs' to 'struct statvfs64'.  */
+  statfs5_to_statvfs64 (&kbuf, buf);
+
+  return 0;
+}
+
+weak_alias (__fstatvfs64, fstatvfs64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ftruncate64.c
@@ -0,0 +1 @@
+/* 'ftruncate64' is the same as 'ftruncate', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/futimesat.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysdep.h>
+#include <sys/time.h>
+#include <sys/user.h>
+#include <kernel-features.h>
+
+extern int __syscall_futimesat (int fd, const char *path,
+				const struct timeval *times);
+libc_hidden_proto (__syscall_futimesat)
+
+/* Change the access time of FILE relative to FD to TVP[0] and
+   the modification time of FILE to TVP[1].  */
+int
+futimesat (int fd, const char *file, const struct timeval tvp[2])
+{
+      if (file == NULL)
+	return __futimes (fd, tvp);
+
+      return INLINE_SYSCALL (futimesat, 3, fd, file, tvp);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fxstat.c
@@ -0,0 +1,47 @@
+/* fxstat using FreeBSD fstat, nfstat system calls.
+   Copyright (C) 1991,1995-1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include "stat16conv.c"
+
+int
+__fxstat (int vers, int fd, struct stat *buf)
+{
+  if (__builtin_expect (vers == _STAT_VER, 1))
+    {
+      struct stat16 buf16;
+      int result = __syscall_fstat (fd, &buf16);
+      if (result == 0)
+	stat16_to_stat (&buf16, buf);
+      return result;
+    }
+  else if (__builtin_expect (vers == _STAT_VER_stat, 1))
+    return __syscall_fstat (fd, (struct stat16 *) buf);
+  else
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+}
+hidden_def (__fxstat)
+
+weak_alias (__fxstat, _fxstat)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fxstat64.c
@@ -0,0 +1,43 @@
+/* fxstat using FreeBSD fstat, nfstat system calls.
+   Copyright (C) 1991,1995-1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include "stat16conv.c"
+
+int
+__fxstat64 (int vers, int fd, struct stat64 *buf)
+{
+  if (__builtin_expect (vers == _STAT_VER, 1))
+    {
+      struct stat16 buf16;
+      int result = __syscall_fstat (fd, &buf16);
+      if (result == 0)
+	stat16_to_stat64 (&buf16, buf);
+      return result;
+    }
+  else
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+}
+hidden_def (__fxstat64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fxstatat.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysdep.h>
+#include <sys/stat.h>
+#include <sys/user.h>
+#include <kernel-features.h>
+
+#include "stat16conv.c"
+
+extern int __syscall_fstatat (int fd, const char *path,
+			      struct stat16 *buf, int flag);
+libc_hidden_proto (__syscall_fstatat)
+
+/* Get information about the file NAME relative to FD in ST.  */
+int
+__fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
+{
+      int result;
+
+      if (__builtin_expect (vers == _STAT_VER, 1))
+	{
+	  struct stat16 buf16;
+	  result =
+	    INLINE_SYSCALL (fstatat, 4, fd, file,
+			    &buf16, flag);
+	  if (result == 0)
+	    stat16_to_stat (&buf16, st);
+	}
+      else if (__builtin_expect (vers == _STAT_VER_stat, 1))
+	{
+	  result =
+	    INLINE_SYSCALL (fstatat, 4, fd, file,
+			    (struct stat16 *) st, flag);
+	}
+      else
+	{
+	  __set_errno (EINVAL);
+	  return -1;
+	}
+	return result;
+}
+
+libc_hidden_def (__fxstatat)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/fxstatat64.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysdep.h>
+#include <sys/stat.h>
+#include <sys/user.h>
+#include <kernel-features.h>
+
+#include "stat16conv.c"
+
+extern int __syscall_fstatat (int fd, const char *path,
+			      struct stat16 *buf, int flag);
+libc_hidden_proto (__syscall_fstatat)
+
+/* Get information about the file NAME relative to FD in ST.  */
+int
+__fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
+{
+      int result;
+
+      if (__builtin_expect (vers == _STAT_VER, 1))
+	{
+	  struct stat16 buf16;
+	  result =
+	    INLINE_SYSCALL (fstatat, 4, fd, file,
+			    &buf16, flag);
+	  if (result == 0)
+	    stat16_to_stat64 (&buf16, st);
+	}
+      else
+	{
+	  __set_errno (EINVAL);
+	  return -1;
+	}
+	return result;
+}
+
+libc_hidden_def (__fxstatat64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/gai_sigqueue.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <netdb.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+
+#include <gai_misc.h>
+
+int
+internal_function
+__gai_sigqueue (int sig, const union sigval val, pid_t caller_pid)
+{
+#if !IS_IN(libc)
+    return sigqueue(caller_pid, sig, val);
+#else
+    return __sigqueue(caller_pid, sig, val);
+#endif    
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getcwd.c
@@ -0,0 +1,103 @@
+/* Determine current working directory.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+
+/* If we compile the file for use in ld.so we don't need the feature
+   that getcwd() allocates the buffers itself.  */
+#if IS_IN (rtld)
+# define NO_ALLOCATION  1
+#endif
+
+/* The system calls only makes a lookup in the VFS cache, which can easily
+   fail.  Therefore we use the generic version as a fallback.  */
+extern int __syscall_getcwd (char *buf, unsigned int size);
+libc_hidden_proto (__syscall_getcwd)
+
+static char *generic_getcwd (char *buf, size_t size) internal_function;
+
+char *
+__getcwd (char *buf, size_t size)
+{
+  char tmpbuf[PATH_MAX];
+
+  if (INLINE_SYSCALL (getcwd, 2, tmpbuf, PATH_MAX) >= 0)
+    {
+      size_t len = strlen (tmpbuf) + 1;
+
+      if (size == 0)
+	{
+	  if (__builtin_expect (buf != NULL, 0))
+	    {
+	      __set_errno (EINVAL);
+	      return NULL;
+	    }
+#ifdef NO_ALLOCATION
+          buf = NULL;
+#else
+	  buf = (char *) malloc (len);
+#endif
+	  if (__builtin_expect (buf == NULL, 0))
+	    {
+	      __set_errno (ENOMEM);
+	      return NULL;
+	    }
+	}
+      else
+	{
+	  if (size < len)
+	    {
+	      __set_errno (ERANGE);
+	      return NULL;
+	    }
+
+	  if (buf == NULL)
+	    {
+#ifdef NO_ALLOCATION
+              buf = NULL;
+#else
+	      buf = (char *) malloc (size);
+#endif
+	      if (__builtin_expect (buf == NULL, 0))
+		{
+		  __set_errno (ENOMEM);
+		  return NULL;
+		}
+	    }
+	}
+
+      memcpy (buf, tmpbuf, len);
+      return buf;
+    }
+  return generic_getcwd (buf, size);
+}
+
+weak_alias (__getcwd, getcwd)
+
+/* Get the code for the generic version.  */
+#define GETCWD_RETURN_TYPE	static char * internal_function
+#define __getcwd		generic_getcwd
+#include <sysdeps/posix/getcwd.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getdents.c
@@ -0,0 +1,43 @@
+/* Read directory entries, 3 argument function.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <dirent.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <sysdep.h>
+
+/* Use the 3-argument system call.  */
+
+extern int __syscall_getdents (int fd, char *buf, size_t nbytes);
+libc_hidden_proto (__syscall_getdents)
+
+/* Read directory entries from FD into BUF, reading at most NBYTES.
+   Returns the number of bytes read; zero when at end of directory; or
+   -1 for errors.  */
+ssize_t
+internal_function
+__getdents (int fd, char *buf, size_t nbytes)
+{
+  return __syscall_getdents (fd, buf, nbytes);
+}
+
+/* Since 'struct dirent64' == 'struct dirent', the functions '__getdents64'
+   and '__getdents' are equal.  */
+strong_alias (__getdents, __getdents64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getdents64.c
@@ -0,0 +1 @@
+/* We have the function getdirentries64 in file getdirentries64.c.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getdirentries.c
@@ -0,0 +1,100 @@
+/* Read directory entries, 4 argument function.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef GETDIRENTRIES
+# define GETDIRENTRIES getdirentries
+# define OFF_T off_t
+#endif
+
+#include <dirent.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sysdep.h>
+
+#if 1
+
+/* Use the 4-argument system call.  */
+
+extern int __syscall_getdirentries (int fd, char *buf, unsigned int nbytes,
+				    long *basep);
+
+/* Read directory entries from FD into BUF, reading at most NBYTES.
+   Reading starts at offset *BASEP, and *BASEP is updated with the new
+   position after reading.  Returns the number of bytes read; zero when at
+   end of directory; or -1 for errors.  */
+/* FIXME: This is not what this function does.  It starts reading at the
+   current position of FD, not at *BASEP.  */
+ssize_t
+GETDIRENTRIES (int fd, char *buf, size_t nbytes, OFF_T *basep)
+{
+  /* On 32-bit platforms, the system call differs from this function because
+     it takes a 'long *', not an 'OFF_T *'.  On 64-bit platforms, the system
+     call differs from this function because it takes an 'unsigned int', not
+     a 'size_t'.  */
+  unsigned int nbytes32;
+
+  nbytes32 = nbytes;
+  if (nbytes32 == nbytes)
+    {
+      long base;
+      int result = __syscall_getdirentries (fd, buf, nbytes32, &base);
+
+      if (result >= 0 && basep != NULL)
+	*basep = base;
+      return result;
+    }
+  else
+    {
+      /* NBYTES is too large.  */
+      __set_errno (EINVAL);
+      return -1;
+    }
+}
+
+#else
+
+/* Use the 3-argument system call.  */
+
+extern int __syscall_getdents (int fd, char *buf, size_t nbytes);
+
+/* Read directory entries from FD into BUF, reading at most NBYTES.
+   Reading starts at offset *BASEP, and *BASEP is updated with the new
+   position after reading.  Returns the number of bytes read; zero when at
+   end of directory; or -1 for errors.  */
+/* FIXME: This is not what this function does.  It starts reading at the
+   current position of FD, not at *BASEP.  */
+ssize_t
+GETDIRENTRIES (int fd, char *buf, size_t nbytes, OFF_T *basep)
+{
+  OFF_T base = 0;
+  ssize_t result;
+
+  if (basep)
+    base = __lseek (fd, (off_t) 0, SEEK_CUR);
+
+  result = __syscall_getdents (fd, buf, nbytes);
+
+  if (basep && result >= 0)
+    *basep = base;
+  return result;
+}
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getdirentries64.c
@@ -0,0 +1,5 @@
+/* Since 'struct dirent64' == 'struct dirent', the functions 'getdirentries64'
+   and 'getdirentries' differ only in the type of the BASEP argument.  */
+#define GETDIRENTRIES getdirentries64
+#define OFF_T off64_t
+#include <getdirentries.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getdomain.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sys/sysctl.h>
+#include <errno.h>
+
+/* Put the name of the current domain in no more than LEN bytes of NAME.
+   The result is null-terminated if LEN is large enough for the full
+   name and the terminator.  */
+
+int
+getdomainname (char *name, size_t len)
+{
+  /* Fetch the "kern.domainname" sysctl value.  */
+  int request[2] = { CTL_KERN, KERN_NISDOMAINNAME };
+  size_t result_len = len;
+
+  if (__sysctl (request, 2, name, &result_len, NULL, 0) < 0)
+    {
+      if (errno == ENOMEM)
+	__set_errno (ENAMETOOLONG);
+      return -1;
+    }
+
+  if (result_len >= len)
+    {
+      __set_errno (ENAMETOOLONG);
+      return -1;
+    }
+
+  name[result_len] = '\0';
+  return 0;
+}
+libc_hidden_def (getdomainname)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getfsstat.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mount.h>
+#include <alloca.h>
+
+#include "statfsconv.c"
+
+int
+__getfsstat (struct statfs *buf, long bufsize, int flags)
+{
+  long bufcount;
+  struct statfs_fbsd5 *tmpbuf;
+  int count, i;
+
+  if (bufsize < 0)
+    bufsize = 0;
+  bufcount = bufsize / sizeof (struct statfs);
+
+  if ((bufcount == 0) || (buf == NULL))
+    tmpbuf = NULL;
+  else
+    tmpbuf = alloca(bufcount * sizeof (struct statfs_fbsd5));
+
+  count = __syscall_getfsstat (tmpbuf, bufcount * sizeof (struct statfs_fbsd5), flags);
+  if (tmpbuf && count > 0)
+    for (i = count - 1; i >= 0; i--)
+      statfs5_to_statfs (&tmpbuf[i], &buf[i]);
+
+  return count;
+}
+
+weak_alias (__getfsstat, getfsstat)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getfsstat64.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mount.h>
+#include <alloca.h>
+
+#include "statfsconv.c"
+
+int
+__getfsstat64 (struct statfs64 *buf, long bufsize, int flags)
+{
+  long bufcount;
+  struct statfs_fbsd5 *tmpbuf;
+  int count, i;
+
+  if (bufsize < 0)
+    bufsize = 0;
+  bufcount = bufsize / sizeof (struct statfs64);
+
+  if ((bufcount == 0) || (buf == NULL))
+    tmpbuf = NULL;
+  else
+    tmpbuf = alloca(bufcount * sizeof (struct statfs_fbsd5));
+
+  count = __syscall_getfsstat (tmpbuf, bufcount * sizeof (struct statfs_fbsd5), flags);
+  if (tmpbuf && count > 0)
+    for (i = count - 1; i >= 0; i--)
+      statfs5_to_statfs64 (&tmpbuf[i], &buf[i]);
+
+  return count;
+}
+
+weak_alias (__getfsstat64, getfsstat64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/gethostid.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sys/sysctl.h>
+
+/* Return the current machine's Internet number.  */
+long int
+gethostid (void)
+{
+  /* Fetch sysctl value of "kern.hostid".  */
+  int request[2] = { CTL_KERN, KERN_HOSTID };
+  int result;
+  size_t result_len = sizeof (result);
+
+  if (__sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
+    /* Dummy result.  */
+    return 0;
+
+  return result;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/gethostname.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sys/sysctl.h>
+#include <errno.h>
+
+/* Put the name of the current host in no more than LEN bytes of NAME.
+   The result is null-terminated if LEN is large enough for the full
+   name and the terminator.  */
+
+int
+__gethostname (char *name, size_t len)
+{
+  /* Fetch the "kern.hostname" sysctl value.  */
+  int request[2] = { CTL_KERN, KERN_HOSTNAME };
+  size_t result_len = len;
+
+  if (__sysctl (request, 2, name, &result_len, NULL, 0) < 0)
+    {
+      if (errno == ENOMEM)
+	__set_errno (ENAMETOOLONG);
+      return -1;
+    }
+
+  if (result_len >= len)
+    {
+      __set_errno (ENAMETOOLONG);
+      return -1;
+    }
+
+  name[result_len] = '\0';
+  return 0;
+}
+
+weak_alias (__gethostname, gethostname)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getloadavg.c
@@ -0,0 +1,53 @@
+/* Get system load averages.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdlib.h>
+#include <sys/sysctl.h>
+
+struct loadavg
+  {
+    unsigned int ldavg[3];
+    long fscale;
+  };
+
+/* Put the 1 minute, 5 minute and 15 minute load averages into the first
+   NELEM elements of LOADAVG.  Return the number written (never more than
+   three, but may be less than NELEM), or -1 if an error occurred.  */
+int
+getloadavg (double loadavg[], int nelem)
+{
+  if (nelem > 3)
+    nelem = 3;
+  if (nelem > 0)
+    {
+      /* Fetch the "vm.loadavg" sysctl value.  */
+      int request[2] = { CTL_VM, VM_LOADAVG };
+      struct loadavg result;
+      size_t result_len = sizeof (result);
+      int i;
+
+      if (__sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
+	return -1;
+
+      for (i = 0; i < nelem; i++)
+	loadavg[i] = (double) result.ldavg[i] / (double) result.fscale;
+    }
+  return nelem;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getlogin.c
@@ -0,0 +1,50 @@
+/* Non-reentrant function to return the current login name.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sysdep.h>
+
+/* Defined in getlogin_r.c.  */
+extern char *__getlogin_cache;
+extern char __getlogin_cache_room[MAXLOGNAME];
+
+extern int __syscall_getlogin (char *__name, size_t __name_len);
+libc_hidden_proto (__syscall_getlogin)
+
+/* Return the login name of the user, or NULL if it can't be determined.
+   The returned pointer, if not NULL, is good only until the next call.  */
+
+char *
+getlogin (void)
+{
+  if (__getlogin_cache == NULL)
+    {
+      if (INLINE_SYSCALL (getlogin, 2, __getlogin_cache_room, MAXLOGNAME) < 0)
+	return NULL;
+      /* The system call should return a NULL terminated name.  */
+      if (__memchr (__getlogin_cache_room, '\0', MAXLOGNAME) == NULL)
+	abort ();
+      __getlogin_cache = __getlogin_cache_room;
+    }
+  return (__getlogin_cache[0] ? __getlogin_cache : NULL);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getlogin_r.c
@@ -0,0 +1,73 @@
+/* Reentrant function to return the current login name.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sysdep.h>
+
+/* Cache the system call's return value.  */
+char *__getlogin_cache;
+/* The kernel never returns more than MAXLOGNAME bytes, therefore we don't
+   need more than that either.  */
+char __getlogin_cache_room[MAXLOGNAME];
+
+extern int __syscall_getlogin (char *__name, size_t __name_len);
+libc_hidden_proto (__syscall_getlogin)
+
+/* Return at most NAME_LEN characters of the login name of the user in NAME.
+   If it cannot be determined or some other error occurred, return the error
+   code.  Otherwise return 0.
+   Note that the getlogin_r function in FreeBSD libc returns a 'char *',
+   but SUSV2 wants a return type of 'int'.  */
+
+int
+__getlogin_r (char *name, size_t name_len)
+{
+  size_t len;
+
+  if (__getlogin_cache == NULL)
+    {
+      if (INLINE_SYSCALL (getlogin, 2, __getlogin_cache_room, MAXLOGNAME) < 0)
+	return errno;
+      /* The system call should return a NULL terminated name.  */
+      if (__memchr (__getlogin_cache_room, '\0', MAXLOGNAME) == NULL)
+	abort ();
+      __getlogin_cache = __getlogin_cache_room;
+    }
+
+  len = strlen (__getlogin_cache);
+  if (__builtin_expect (len < name_len, 1))
+    {
+      memcpy (name, __getlogin_cache, len + 1);
+      return 0;
+    }
+  else
+    {
+      __set_errno (ERANGE);
+      return ERANGE;
+    }
+}
+libc_hidden_def (__getlogin_r)
+weak_alias (__getlogin_r, getlogin_r)
+libc_hidden_weak (getlogin_r)
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getmntinfo.c
@@ -0,0 +1,80 @@
+/* Return list of mounted filesystems.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mount.h>
+#include <stdlib.h>
+#include <errno.h>
+
+static int mntbufsize;
+static struct statfs *mntbuf;
+
+/* Return list of mounted filesystems.
+   Inherently not multithread-safe.  */
+int
+__getmntinfo (struct statfs **mntbufp, int flags)
+{
+  for (;;)
+    {
+      int count = __getfsstat (NULL, 0, flags);
+      int count2;
+
+      if (count < 0)
+	return 0;
+
+      if (count == 0)
+	{
+	  __set_errno (0);
+	  return 0;
+	}
+
+      if (count > mntbufsize)
+	{
+	  if (mntbuf != NULL)
+	    free (mntbuf);
+	  mntbufsize = 0;
+	  mntbuf = (struct statfs *) malloc (count * sizeof (struct statfs));
+	  if (mntbuf == NULL)
+	    {
+	      __set_errno (ENOMEM);
+	      return 0;
+	    }
+	  mntbufsize = count;
+	}
+
+      count2 = __getfsstat (mntbuf, count * sizeof (struct statfs), flags);
+
+      if (count2 < 0)
+	return 0;
+
+      if (count2 == 0)
+	{
+	  __set_errno (0);
+	  return 0;
+	}
+
+      if (count2 <= count)
+	{
+	  *mntbufp = mntbuf;
+	  return count2;
+	}
+    }
+}
+
+weak_alias (__getmntinfo, getmntinfo)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getmntinfo64.c
@@ -0,0 +1,78 @@
+/* Return list of mounted filesystems.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mount.h>
+#include <stdlib.h>
+#include <errno.h>
+
+static int mntbufsize;
+static struct statfs64 *mntbuf;
+
+/* Return list of mounted filesystems.
+   Inherently not multithread-safe.  */
+int
+getmntinfo64 (struct statfs64 **mntbufp, int flags)
+{
+  for (;;)
+    {
+      int count = __getfsstat64 (NULL, 0, flags);
+      int count2;
+
+      if (count < 0)
+	return 0;
+
+      if (count == 0)
+	{
+	  __set_errno (0);
+	  return 0;
+	}
+
+      if (count > mntbufsize)
+	{
+	  if (mntbuf != NULL)
+	    free (mntbuf);
+	  mntbufsize = 0;
+	  mntbuf = (struct statfs64 *) malloc (count * sizeof (struct statfs64));
+	  if (mntbuf == NULL)
+	    {
+	      __set_errno (ENOMEM);
+	      return 0;
+	    }
+	  mntbufsize = count;
+	}
+
+      count2 = __getfsstat64 (mntbuf, count * sizeof (struct statfs64), flags);
+
+      if (count2 < 0)
+	return 0;
+
+      if (count2 == 0)
+	{
+	  __set_errno (0);
+	  return 0;
+	}
+
+      if (count2 <= count)
+	{
+	  *mntbufp = mntbuf;
+	  return count2;
+	}
+    }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getosreldate.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stddef.h>
+#include <sys/sysctl.h>
+#include <stdlib.h>
+#include <getosreldate.h>
+
+int
+__kernel_getosreldate(void)
+{
+    static int osreldate;
+
+    int mib[2];
+    size_t size;
+
+    if (osreldate == 0)
+    {
+	mib[0] = CTL_KERN;
+	mib[1] = KERN_OSRELDATE;
+	size = sizeof osreldate;
+	if (__sysctl(mib, 2, &osreldate, &size, NULL, 0) == -1)
+		return (-1);
+    }		
+    return (osreldate);
+}
+
+int
+__getosreldate(void)
+{
+    static int osreldate;
+
+    char *temp;
+
+    if (osreldate == 0)
+    {
+	if ((temp = getenv("OSVERSION"))) {
+		osreldate = atoi(temp);
+		return (osreldate);
+	}
+
+	osreldate = __kernel_getosreldate ();
+    }		
+    return (osreldate);
+}
+libc_hidden_def (__kernel_getosreldate)
+libc_hidden_def (__getosreldate)
+weak_alias (__getosreldate, getosreldate)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getosreldate.h
@@ -0,0 +1,4 @@
+int __kernel_getosreldate (void);
+int __getosreldate (void);
+libc_hidden_proto (__kernel_getosreldate)
+libc_hidden_proto (__getosreldate)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getpagesize.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sys/sysctl.h>
+
+/* Return the system page size.  */
+int
+__getpagesize (void)
+{
+  static int cached_pagesize /* = 0 */;
+
+  if (cached_pagesize == 0)
+    {
+      /* Fetch sysctl value of "hw.pagesize".  */
+      int request[2] = { CTL_HW, HW_PAGESIZE };
+      size_t result_len = sizeof (cached_pagesize);
+
+      if (__sysctl (request, 2, &cached_pagesize, &result_len, NULL, 0) < 0)
+	return -1;
+    }
+  return cached_pagesize;
+}
+libc_hidden_def (__getpagesize)
+
+weak_alias (__getpagesize, getpagesize)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getpt.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 1998-1999, 2000-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sysdep.h>
+
+/* The system call does not change the controlling terminal, so we have
+ * to do it ourselves.  */
+extern int __syscall_posix_openpt (int oflag);
+libc_hidden_proto (__syscall_posix_openpt)
+
+int
+__posix_openpt (int oflag)
+{
+  int fd = INLINE_SYSCALL (posix_openpt, 1, oflag);
+  if (fd >= 0)
+  {
+      if (!(oflag & O_NOCTTY))
+        __ioctl (fd, TIOCSCTTY, NULL);
+  }
+  return fd;
+}
+
+weak_alias (__posix_openpt, posix_openpt)
+
+int
+__getpt (void)
+{
+  return __posix_openpt (O_RDWR | O_NOCTTY);
+}
+
+weak_alias (__getpt, getpt)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getrlimit64.c
@@ -0,0 +1 @@
+/* 'getrlimit64' is the same as 'getrlimit', because __rlim64_t == __rlim_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getsysstats.c
@@ -0,0 +1,109 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/sysctl.h>
+#include <unistd.h>
+#include <stddef.h>
+
+
+int
+__get_nprocs (void)
+{
+  /* Fetch sysctl value of "hw.ncpu".  */
+  int request[2] = { CTL_HW, HW_NCPU };
+  int result;
+  size_t result_len = sizeof (result);
+
+  if (__sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
+    /* Dummy result.  */
+    return 1;
+
+  return result;
+}
+
+weak_alias (__get_nprocs, get_nprocs)
+
+
+int
+__get_nprocs_conf (void)
+{
+  /* We don't know how to distinguish between configured and active CPUs.  */
+  return __get_nprocs ();
+}
+
+weak_alias (__get_nprocs_conf, get_nprocs_conf)
+
+
+long int
+__get_phys_pages (void)
+{
+  /* Fetch sysctl value of "hw.physmem".  This is a little smaller than
+     the real installed memory size, but so what.  */
+  int request[2] = { CTL_HW, HW_PHYSMEM };
+  unsigned long int result;
+  size_t result_len = sizeof (result);
+
+  if (__sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
+    return -1;
+
+  return result / __getpagesize();
+}
+
+weak_alias (__get_phys_pages, get_phys_pages)
+
+
+long int
+__get_avphys_pages (void)
+{
+#if 1
+  int result1;
+  int result2;
+  {
+    /* Fetch sysctl value of "vm.stats.vm.v_inactive_count".  */
+    size_t result_len = sizeof (result1);
+
+    if (__sysctlbyname ("vm.stats.vm.v_inactive_count", &result1, &result_len,
+			NULL, 0) < 0)
+      return -1;
+  }
+  {
+    /* Fetch sysctl value of "vm.stats.vm.v_free_count".  */
+    size_t result_len = sizeof (result2);
+
+    if (__sysctlbyname ("vm.stats.vm.v_free_count", &result2, &result_len,
+			NULL, 0) < 0)
+      return -1;
+  }
+
+  return result1 + result2;
+#else
+  /* This does not appear to work.  */
+  /* Fetch v_inactive_count field of sysctl value of "vm.vmmeter".  */
+  int request[2] = { CTL_VM, VM_METER };
+  struct vmmeter result;
+  size_t result_len = sizeof (result);
+
+  if (__sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
+    return -1;
+
+  return result.v_inactive_count;
+#endif
+}
+
+weak_alias (__get_avphys_pages, get_avphys_pages)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/getvfsbyname.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 1995
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stddef.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * Given a filesystem name, determine if it is resident in the kernel,
+ * and if it is resident, return its xvfsconf structure.
+ */
+int
+__getvfsbyname(const char *fsnamen, struct xvfsconf *vfcp)
+{
+	struct xvfsconf *xvfsp;
+	size_t buflen;
+	int cnt, i;
+
+	if (sysctlbyname("vfs.conflist", NULL, &buflen, NULL, 0) < 0)
+		return (-1);
+	xvfsp = malloc(buflen);
+	if (xvfsp == NULL)
+		return (-1);
+	if (sysctlbyname("vfs.conflist", xvfsp, &buflen, NULL, 0) < 0) {
+		free(xvfsp);
+		return (-1);
+	}
+	cnt = buflen / sizeof(struct xvfsconf);
+	for (i = 0; i < cnt; i++) {
+		if (strcmp(fsname, xvfsp[i].vfc_name) == 0) {
+			memcpy(vfcp, xvfsp + i, sizeof(struct xvfsconf));
+			free(xvfsp);
+			return (0);
+		}
+	}
+	free(xvfsp);
+	__set_errno (ENOENT);
+	return (-1);
+}
+weak_alias (__getvfsbyname, getvfsbyname)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/glob.c
@@ -0,0 +1,3 @@
+/* 'glob64' is different from 'glob', because
+   'struct stat64' != 'struct stat'.  */
+#include <posix/glob.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/glob64.c
@@ -0,0 +1,3 @@
+/* 'glob64' is different from 'glob', because
+   'struct stat64' != 'struct stat'.  */
+#include <sysdeps/gnu/glob64.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/globfree.c
@@ -0,0 +1,3 @@
+/* 'globfree64' is different from 'globfree', because
+   'struct stat64' != 'struct stat'.  */
+#include <posix/globfree.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/globfree64.c
@@ -0,0 +1,3 @@
+/* 'globfree64' is different from 'globfree', because
+   'struct stat64' != 'struct stat'.  */
+#include <sysdeps/gnu/globfree64.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/grantpt.c
@@ -0,0 +1,36 @@
+#include <assert.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <not-cancel.h>
+
+#include "pty-private.h"
+
+int __syscall_closefrom(int fd);
+libc_hidden_proto (__syscall_closefrom)
+
+/* Close all file descriptors except the one specified.  */
+static void
+close_all_fds (void)
+{
+    int i;
+
+    for (i = 0 ; i < PTY_FILENO; i++)
+        close_not_cancel_no_status (i);
+        
+    INLINE_SYSCALL(closefrom, 1, PTY_FILENO + 1L);
+
+    int nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_RDONLY);
+    assert (nullfd == STDIN_FILENO);
+    nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_WRONLY);
+    assert (nullfd == STDOUT_FILENO);
+    __dup2 (STDOUT_FILENO, STDERR_FILENO);
+}
+#define CLOSE_ALL_FDS() close_all_fds()
+
+#include <sysdeps/unix/grantpt.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/gtty.c
@@ -0,0 +1,2 @@
+/* use stub only variant */
+#include <misc/gtty.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/Implies
@@ -0,0 +1 @@
+unix/bsd/bsd4.4/kfreebsd/x86
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/Makefile
@@ -0,0 +1,27 @@
+# The default ABI is 32.
+default-abi := 32
+
+# Additional header files to be installed in $prefix/include:
+
+ifeq ($(subdir),misc)
+sysdep_headers += \
+ sys/io.h \
+ sys/perm.h \
+ sys/vm86.h
+endif
+
+# Additional functions, and particular system calls:
+
+ifeq ($(subdir),misc)
+# For <sys/io.h> and <sys/perm.h>.
+sysdep_routines += i386_get_ioperm i386_set_ioperm iopl
+# For <sys/vm86.h>.
+sysdep_routines += i386_vm86
+# For <machine/sysarch.h>.
+sysdep_routines += i386_get_ldt i386_set_ldt
+endif
+
+# special flag to avoid usage of xmm registers in ld.so
+ifeq ($(subdir),io)
+CFLAGS-rtld-fxstat64.os += -mno-sse -mno-mmx
+endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/Versions
@@ -0,0 +1,7 @@
+libc {
+  GLIBC_2.2.6 {
+    i386_get_ioperm; i386_set_ioperm; i386_vm86;
+    ioperm; iopl;
+    i386_get_ldt; i386_set_ldt;
+  }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/____longjmp_chk.S
@@ -0,0 +1,7 @@
+/* Jump to the position specified by ENV, causing the
+   setjmp call there to return VAL, or 1 if VAL is 0.
+   void __longjmp (__jmp_buf env, int val).  */
+      
+#warning longjmp_chk unimplemented
+#define __longjmp ____longjmp_chk
+#include<__longjmp.S>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/bits/mcontext.h
@@ -0,0 +1,111 @@
+/* Machine-dependent processor state structure for FreeBSD.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.  i386 version.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_UCONTEXT_H
+# error "Never use <bits/mcontext.h> directly; include <sys/ucontext.h> instead."
+#endif
+
+/*-
+ * Copyright (c) 1999 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * based on $FreeBSD: src/sys/i386/include/ucontext.h,v 1.10 2002/12/02 19:58:55 deischen Exp $
+ */
+
+/* Whole processor state.  */
+typedef struct
+  {
+    /*
+     * The first 20 fields must match the definition of
+     * sigcontext. So that we can support sigcontext
+     * and ucontext_t at the same time.
+     */
+
+    int mc_onstack;		/* Nonzero if running on sigstack.  */
+
+    /* Segment registers.  */
+    int mc_gs;
+    int mc_fs;
+    int mc_es;
+    int mc_ds;
+
+    /* "General" registers.  These members are in the order that the i386
+       `pusha' and `popa' instructions use (`popa' ignores %esp).  */
+    int mc_edi;
+    int mc_esi;
+    int mc_ebp;
+    int mc_isp;			/* Not used; sc_esp is used instead.  */
+    int mc_ebx;
+    int mc_edx;
+    int mc_ecx;
+    int mc_eax;
+
+    int mc_trapno;
+    int mc_err;
+
+    int mc_eip;			/* Instruction pointer.  */
+    int mc_cs;			/* Code segment register.  */
+
+    int mc_efl;			/* Processor flags.  */
+
+    int mc_esp;			/* This stack pointer is used.  */
+    int mc_ss;			/* Stack segment register.  */
+
+    int mc_len;			/* sizeof(mcontext_t) */
+#define	_MC_FPFMT_NODEV		0x10000	/* device not present or configured */
+#define	_MC_FPFMT_387		0x10001
+#define	_MC_FPFMT_XMM		0x10002
+    int mc_fpformat;
+#define	_MC_FPOWNED_NONE	0x20000	/* FP state not used */
+#define	_MC_FPOWNED_FPU		0x20001	/* FP state came from FPU */
+#define	_MC_FPOWNED_PCB		0x20002	/* FP state came from PCB */
+    int mc_ownedfp;
+    int mc_spare1[1];		/* align next field to 16 bytes */
+    /*
+     * See <machine/npx.h> for the internals of mc_fpstate[].
+     */
+    int mc_fpstate[128] __attribute__((aligned(16)));
+    int mc_spare2[8];
+  } mcontext_t;
+
+/* Traditional BSD names for some members.  */
+#define mc_eflags	mc_efl
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/bits/sigcontext.h
@@ -0,0 +1,97 @@
+/* Machine-dependent signal context structure for FreeBSD.  i386 version.
+   Copyright (C) 1991-1992,1994,1997,2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H  1
+
+/* State of this thread when the signal was taken.
+   The unions below are for compatibility with Linux (whose sigcontext
+   components don't have sc_ prefix) */
+__extension__ struct sigcontext
+  {
+    __sigset_t 	sc_mask;		/* Blocked signals to restore.  */
+    int 	sc_onstack;		/* Nonzero if running on sigstack.  */
+
+    /* Segment registers.  */
+    union { int sc_gs; int gs; };
+    union { int sc_fs; int fs; };
+    union { int sc_es; int es; };
+    union { int sc_ds; int ds; };
+
+    /* "General" registers.  These members are in the order that the i386
+       `pusha' and `popa' instructions use (`popa' ignores %esp).  */
+    union { int sc_edi; int edi; };
+    union { int sc_esi; int esi; };
+    union { int sc_ebp; int ebp; };
+    union { int sc_isp; int isp; };		/* Not used; sc_esp is used instead.  */
+    union { int sc_ebx; int ebx; };
+    union { int sc_edx; int edx; };
+    union { int sc_ecx; int ecx; };
+    union { int sc_eax; int eax; };
+
+    union { int sc_trapno; int trapno; };
+    union { int sc_err; int err; };
+
+    union { int sc_eip; int eip; };		/* Instruction pointer.  */
+    union { int sc_cs; int cs; };		/* Code segment register.  */
+
+    union { int sc_efl; int eflags; }; 		/* Processor flags.  */
+
+    union { int sc_esp; int esp; };		/* This stack pointer is used.  */
+    union { int sc_ss; int ss; };		/* Stack segment register.  */
+
+    int     sc_len;                 /* sizeof(mcontext_t) */
+    /*
+     * XXX - See <machine/ucontext.h> and <machine/npx.h> for
+     *       the following fields.
+     */
+    int     sc_fpformat;
+    int     sc_ownedfp;
+    int     sc_spare1[1];
+    int     sc_fpstate[128] __attribute__((aligned(16)));
+    int     sc_spare2[8];
+  };
+
+/* Traditional BSD names for some members.  */
+#define sc_sp		sc_esp		/* Stack pointer.  */
+#define sc_fp		sc_ebp		/* Frame pointer.  */
+#define sc_pc		sc_eip		/* Process counter.  */
+#define sc_ps		sc_efl
+#define sc_eflags	sc_efl
+
+#if 1 /* FIXME: These need verification.  */
+
+/* Codes for SIGILL.  */
+#define ILL_PRIVIN_FAULT	1
+#define ILL_ALIGN_FAULT		14
+#define ILL_FPOP_FAULT		24
+
+/* Codes for SIGBUS.  */
+#define BUS_PAGE_FAULT		12
+#define BUS_SEGNP_FAULT		26
+#define BUS_STK_FAULT		27
+#define BUS_SEGM_FAULT		29
+
+#endif
+
+#endif /* _BITS_SIGCONTEXT_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:x
+blksize_t:j
+caddr_t:Pc
+clockid_t:i
+clock_t:i
+daddr_t:x
+dev_t:j
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:j
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:l
+loff_t:x
+mode_t:t
+nlink_t:t
+off64_t:x
+off_t:x
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:x
+rlim_t:x
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/dl-machine.h
@@ -0,0 +1,80 @@
+/* Machine-dependent ELF dynamic relocation inline functions.
+   FreeBSD i386 specific version of dl_platform_init()
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+
+/* For FreeBSD we redefine an initialization function.
+   This is called very early in dl_sysdep_start.  */
+
+#if 0
+Under FreeBSD:
+#define AT_EXECPATH     15      /* Path to the executable. */
+
+Under Linux:
+#define AT_PLATFORM     15      /* String identifying platform.  */
+
+Filled entries from kernel:
+
+        if (args->execfd != -1)
+                AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
+        AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);    
+        AUXARGS_ENTRY(pos, AT_PHENT, args->phent);  
+        AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum);  
+        AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz);
+        AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
+        AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
+        AUXARGS_ENTRY(pos, AT_BASE, args->base);
+        if (imgp->execpathp != 0)
+                AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp);
+        AUXARGS_ENTRY(pos, AT_NULL, 0);
+                                                                                                                
+#endif
+
+#include_next <dl-machine.h>
+
+#ifndef _DL_MACHINE_KFREEBSD
+#define _DL_MACHINE_KFREEBSD
+
+static inline void __attribute__ ((unused))
+dl_platform_kfreebsd_i386_init (void)
+{
+	/* This calls cpuid and and fills dl_x86_cpu_features */
+	DL_PLATFORM_INIT;
+
+	/* we don't have reasonable AT_PLATFORM from kernel
+	   try to use cpuid to get one, also guess AT_HWCAP */
+	GLRO(dl_hwcap) = GLRO(dl_x86_cpu_features).cpuid[COMMON_CPUID_INDEX_1].edx;
+	switch (GLRO(dl_hwcap) & 0xf00)
+	{
+	case 0x400: /* 486 */
+		GLRO(dl_platform) = GLRO(dl_x86_platforms)[1];
+	break;
+	case 0x500: /* 586 */
+		GLRO(dl_platform) = GLRO(dl_x86_platforms)[2];
+	break;
+	default:    /* 686 */
+		GLRO(dl_platform) = GLRO(dl_x86_platforms)[3];
+	}
+}
+
+#undef  DL_PLATFORM_INIT
+#define DL_PLATFORM_INIT dl_platform_kfreebsd_i386_init ()
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/dl-procinfo.h
@@ -0,0 +1 @@
+#include <sysdeps/i386/dl-procinfo.h>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/exit-thread.h
@@ -0,0 +1,49 @@
+/* Call to terminate the current thread.  GNU/kFreeBSD i386 version
+   Copyright (C) 2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* This causes the current thread to exit, without affecting other
+   threads in the process if there are any.  If there are no other
+   threads left, then this has the effect of _exit (0).  */
+
+static inline void __attribute__ ((noreturn, always_inline, unused))
+__exit_thread (void)
+{
+  /* Doing this in a loop is mostly just to satisfy the compiler that the
+     function really qualifies as noreturn.  It also means that in some
+     pathological situation where the system call does not get made or does
+     not work, the thread will simply spin rather than running off the end
+     of the caller and doing unexpectedly strange things.  */
+  while (1)
+    {
+      asm volatile (
+	  "movl %%gs:0, %%edx\n\t"
+	  "addl %0, %%edx\n\t"    /* should be KTID, but they are at the same place anyway */
+	  "movl %%edx, 4(%%esp)\n\t"
+	  "movl %1, %%eax\n\t"
+	  "int $0x80\n\t"
+	  /* It does return only for last thread of process */
+	  "movl %2, %%eax\n\t"
+	  "movl $0, 4(%%esp)\n\t"
+	  "int $0x80\n\t"
+	  :
+	  : "i" (TID), "i" (SYS_ify(thr_exit)), "i" (SYS_ify(exit))
+	  : "memory", "cc");
+    }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/fbtl/Implies
@@ -0,0 +1 @@
+unix/bsd/bsd4.4/kfreebsd/x86/fbtl
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/fbtl/sysdep-cancel.h
@@ -0,0 +1,108 @@
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
+   Modification for FreeBSD by Petr Salinger, 2005.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <tls.h>
+#ifndef __ASSEMBLER__
+# include <fbtl/pthreadP.h>
+#endif
+
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
+
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args)				      \
+  .text;								      \
+  ENTRY (name)								      \
+    cmpl $0, %gs:MULTIPLE_THREADS_OFFSET;				      \
+    jne L(pseudo_cancel);						      \
+  .type __##syscall_name##_nocancel,@function;				      \
+  .globl __##syscall_name##_nocancel;					      \
+  __##syscall_name##_nocancel:						      \
+    DO_CALL (syscall_name, args);					      \
+    jb SYSCALL_ERROR_LABEL;						      \
+    ret;								      \
+  .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	      \
+  L(pseudo_cancel):							      \
+    CENABLE								      \
+    movl %eax, %ecx;							      \
+    movl $SYS_ify (syscall_name), %eax;					      \
+    int $0x80;								      \
+    PUSHRESULT;							      	      \
+    movl %ecx, %eax; 							      \
+    CDISABLE;							 	      \
+    POPRESULT;							      	      \
+    jb SYSCALL_ERROR_LABEL;						      \
+  L(pseudo_end):
+
+/*
+  on FreeBSD some syscalls return result in pair edx+eax,
+  therefore proper way would be
+
+# define PUSHRESULT	pushl %edx; pushl %eax; pushfl
+# define POPRESULT	popfl; popl %eax; popl %edx
+
+  for FreeBSD 5.4 affected syscalls are
+
+	lseek()
+	fork()
+	vfork()
+	rfork()
+	pipe()
+
+   none of them is cancelable, therefore
+*/
+
+# define PUSHRESULT	pushl %eax; cfi_adjust_cfa_offset (4);  pushfl;    cfi_adjust_cfa_offset (4)
+# define POPRESULT	popfl;      cfi_adjust_cfa_offset (-4); popl %eax; cfi_adjust_cfa_offset (-4)
+
+# if IS_IN (libpthread)
+#  define CENABLE	call __pthread_enable_asynccancel;
+#  define CDISABLE	call __pthread_disable_asynccancel
+# elif IS_IN (libc)
+#  define CENABLE	call __libc_enable_asynccancel;
+#  define CDISABLE	call __libc_disable_asynccancel
+# elif IS_IN (librt)
+#  define CENABLE	call __librt_enable_asynccancel;
+#  define CDISABLE	call __librt_disable_asynccancel
+# else
+#  error Unsupported library
+# endif
+
+
+# ifndef __ASSEMBLER__
+#  define SINGLE_THREAD_P \
+  __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+				   header.multiple_threads) == 0, 1)
+# else
+#  define SINGLE_THREAD_P cmpl $0, %gs:MULTIPLE_THREADS_OFFSET
+# endif
+
+#elif !defined __ASSEMBLER__
+
+# define SINGLE_THREAD_P (1)
+# define NO_CANCELLATION 1
+
+#endif
+
+#ifndef __ASSEMBLER__
+# define RTLD_SINGLE_THREAD_P \
+  __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+				   header.multiple_threads) == 0, 1)
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/fbtl/tls.h
@@ -0,0 +1,100 @@
+/* Definition for thread-local data handling.  fbtl/i386 version.
+   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _FREEBSD_TLS_H
+#define _FREEBSD_TLS_H
+
+#include <fbtl/sysdeps/i386/tls.h>
+
+# ifndef __ASSEMBLER__
+
+#undef TLS_INIT_TP
+#undef TLS_SETUP_GS_SEGMENT
+#undef TLS_GET_GS
+#undef TLS_SET_GS       
+#undef __NR_set_thread_area
+
+#include <sysarch.h>
+#include <sys/syscall.h>
+
+
+/* Code to initially initialize the thread pointer.  This might need
+   special attention since 'errno' is not yet available and if the
+   operation can cause a failure 'errno' must not be touched. */
+
+#  define TLS_DO_SET_GSBASE(descr)		\
+({                                      	\
+  long base = (long) descr;             	\
+  int result;                           	\
+  asm volatile (                        	\
+                "pushl %3\n\t"          	\
+                "pushl %2\n\t"          	\
+                "pushl %1\n\t"       		\
+                "int $0x80\n\t"         	\
+                "popl %3\n\t"        		\
+                "popl %3\n\t"        		\
+                "popl %3\n\t"        		\
+                : "=a" (result)         	\
+                : "0" (SYS_sysarch),     	\
+                  "i" (I386_SET_GSBASE),       	\
+                  "d" (&base)			\
+                : "memory", "cc" );    		\
+  result;                                       \
+})
+
+#   define TLS_SETUP_GS_SEGMENT(descr, secondcall)                            \
+  (TLS_DO_SET_GSBASE(descr)                                                   \
+   ? "set_thread_area failed when setting up thread-local storage\n" : NULL)
+
+/*   The value of this macro is null if successful, or an error string.  */
+
+#  define TLS_INIT_TP(descr)						      \
+  ({									      \
+    void *_descr = (descr);						      \
+    tcbhead_t *head = _descr;						      \
+									      \
+    head->tcb = _descr;							      \
+    /* For now the thread descriptor is at the same address.  */	      \
+    head->self = _descr;						      \
+									      \
+    INIT_SYSINFO;							      \
+    TLS_SETUP_GS_SEGMENT (_descr, secondcall);				      \
+  })
+
+#if 0
+/* in Linux one; */
+/* Magic for libthread_db to know how to do THREAD_SELF.  */
+# define DB_THREAD_SELF \
+  REGISTER_THREAD_AREA (32, offsetof (struct user_regs_struct, xgs), 3) \
+  REGISTER_THREAD_AREA (64, 26 * 8, 3) /* x86-64's user_regs_struct->gs */
+#else
+/* # warning proper variant needed */
+# undef DB_THREAD_SELF_INCLUDE
+# undef DB_THREAD_SELF
+# define DB_THREAD_SELF \
+  REGISTER_THREAD_AREA (32, 10 * 4, 3) /* offsetof (struct user_regs_struct, xgs) */ \
+  REGISTER_THREAD_AREA (64, 26 * 8, 3) /* x86-64's user_regs_struct->gs */
+#endif
+
+/* in fact this is OS-specific, but we do not have better header for it */
+#define NEED_STACK_SIZE_FOR_PTH_CREATE 1
+ 
+#endif /* __ASSEMBLER__ */
+
+#endif	/* tls.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/get_clockfreq.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/get_clockfreq.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/getcontext.S
@@ -0,0 +1,38 @@
+/* Save current context.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text
+ENTRY(__getcontext)
+        clc
+        movl 0(%esp), %ecx	/* save the return PC value */
+
+        DO_CALL (getcontext, 1)
+        jb SYSCALL_ERROR_LABEL
+
+        addl $4, %esp		/* remove stale return address */
+        jmp  *%ecx
+
+L(pseudo_end):
+	ret
+
+PSEUDO_END(__getcontext)
+
+weak_alias(__getcontext, getcontext)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i386_get_ioperm.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/perm.h>
+#include <sysarch.h>
+
+int
+i386_get_ioperm (unsigned long int from, unsigned long int *num, int *turned_on)
+{
+  struct i386_ioperm_args args;
+
+  args.start = from;
+
+  if (__sysarch (I386_GET_IOPERM, &args) < 0)
+    return -1;
+
+  *num = args.length;
+  *turned_on = args.enable;
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i386_get_ldt.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   Contributed by Robert Millan  <robertmh@gnu.org>
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/cdefs.h>
+#include <machine/segments.h>
+#include <sysarch.h>
+
+int
+i386_get_ldt (int from, union descriptor *descs, int num)
+{
+  struct i386_ldt_args args;
+
+  args.start = from;
+  args.descs = descs;
+  args.num = num;
+
+  if (__sysarch (I386_GET_LDT, &args) < 0)
+    return -1;
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i386_set_ioperm.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/perm.h>
+#include <sysarch.h>
+
+int
+i386_set_ioperm (unsigned long int from, unsigned long int num, int turn_on)
+{
+  struct i386_ioperm_args args;
+
+  args.start = from;
+  args.length = num;
+  args.enable = turn_on;
+
+  return __sysarch (I386_SET_IOPERM, &args);
+}
+
+strong_alias (i386_set_ioperm, ioperm)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i386_set_ldt.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   Contributed by Robert Millan  <robertmh@gnu.org>
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/cdefs.h>
+#include <machine/segments.h>
+#include <sysarch.h>
+
+int
+i386_set_ldt (int from, union descriptor *descs, int num)
+{
+  struct i386_ldt_args args;
+
+  args.start = from;
+  args.descs = descs;
+  args.num = num;
+
+  if (__sysarch (I386_SET_LDT, &args) < 0)
+    return -1;
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i386_vm86.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/vm86.h>
+#include <sysarch.h>
+
+int
+i386_vm86 (int cmd, void *arg)
+{
+  struct i386_vm86_args args;
+
+  args.sub_op = cmd;
+  args.sub_args = arg;
+
+  return __sysarch (I386_VM86, &args);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i486/linuxthreads/pt-machine.h
@@ -0,0 +1,8 @@
+
+/* i486+ is almost same as plain i386 version */
+#include_next <pt-machine.h>
+
+/* but compare-and-swap is always available  */
+
+#undef TEST_FOR_COMPARE_AND_SWAP
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i586/linuxthreads/pt-machine.h
@@ -0,0 +1,8 @@
+
+/* i486+ is almost same as plain i386 version */
+#include_next <pt-machine.h>
+
+/* but compare-and-swap is always available  */
+
+#undef TEST_FOR_COMPARE_AND_SWAP
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i686/fbtl/tls.h
@@ -0,0 +1,2 @@
+/* no special TLS_GET_GS and TLS_SET_GS, as we do not define them at all */
+#include <sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/fbtl/tls.h>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/i686/linuxthreads/pt-machine.h
@@ -0,0 +1,8 @@
+
+/* i486+ is almost same as plain i386 version */
+#include_next <pt-machine.h>
+
+/* but compare-and-swap is always available  */
+
+#undef TEST_FOR_COMPARE_AND_SWAP
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/iopl.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Robert Millan <robertmh@gnu.org>
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>	/* open */
+#include <unistd.h>	/* close */
+
+static int __iopl_fd = -1;
+
+int
+iopl (int level)
+  {
+    switch (level)
+      {
+        case 3:
+          if (__iopl_fd != -1)
+            return 0;
+
+          __iopl_fd = __open ("/dev/io", O_RDWR);
+          if (__iopl_fd == -1)
+            {
+              if (errno == EACCES)
+                __set_errno (EPERM);
+              return -1;
+            }
+          return 0;
+
+        case 0:
+          if (__iopl_fd != -1)
+            if (__close (__iopl_fd) == -1)
+              return 1;
+          return 0;
+
+        default:
+          __set_errno (EINVAL);
+          return -1;
+      }
+  }
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/ld.abilist
@@ -0,0 +1,11 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 ___tls_get_addr F
+GLIBC_2.3 __libc_stack_end D 0x4
+GLIBC_2.3 __tls_get_addr F
+GLIBC_2.3 _dl_mcount F
+GLIBC_2.3 _r_debug D 0x14
+GLIBC_2.3 calloc F
+GLIBC_2.3 free F
+GLIBC_2.3 malloc F
+GLIBC_2.3 realloc F
+GLIBC_2.4 GLIBC_2.4 A
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/ldconfig.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdeps/generic/ldconfig.h>
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES \
+  { "/lib/ld.so.1", FLAG_ELF_LIBC6 },				\
+  { "/libexec/ld-elf.so.1", FLAG_ELF_LIBC5 },
+
+#define SYSDEP_KNOWN_LIBRARY_NAMES \
+  { "libc.so.0.1", FLAG_ELF_LIBC6 },				\
+  { "libm.so.1", FLAG_ELF_LIBC6 },				\
+  { "libc.so.4", FLAG_ELF_LIBC5 },				\
+  { "libm.so.4", FLAG_ELF_LIBC5 },				\
+  { "libc.so.5", FLAG_ELF_LIBC5 },				\
+  { "libm.so.5", FLAG_ELF_LIBC5 },				\
+  { "libc.so.6", FLAG_ELF_LIBC5 },				\
+  { "libm.so.6", FLAG_ELF_LIBC5 },				\
+  { "libc.so.7", FLAG_ELF_LIBC5 },				\
+  { "libm.so.7", FLAG_ELF_LIBC5 },				\
+  { "libc.so.8", FLAG_ELF_LIBC5 },				\
+  { "libm.so.8", FLAG_ELF_LIBC5 },
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libBrokenLocale.abilist
@@ -0,0 +1,2 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 __ctype_get_mb_cur_max F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libanl.abilist
@@ -0,0 +1,5 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 gai_cancel F
+GLIBC_2.3 gai_error F
+GLIBC_2.3 gai_suspend F
+GLIBC_2.3 getaddrinfo_a F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libc.abilist
@@ -0,0 +1,2207 @@
+GLIBC_2.10 GLIBC_2.10 A
+GLIBC_2.10 __cxa_at_quick_exit F
+GLIBC_2.10 __posix_getopt F
+GLIBC_2.10 accept4 F
+GLIBC_2.10 devname F
+GLIBC_2.10 devname_r F
+GLIBC_2.10 endsgent F
+GLIBC_2.10 fgetsgent F
+GLIBC_2.10 fgetsgent_r F
+GLIBC_2.10 getsgent F
+GLIBC_2.10 getsgent_r F
+GLIBC_2.10 getsgnam F
+GLIBC_2.10 getsgnam_r F
+GLIBC_2.10 kenv F
+GLIBC_2.10 malloc_info F
+GLIBC_2.10 preadv F
+GLIBC_2.10 preadv64 F
+GLIBC_2.10 psiginfo F
+GLIBC_2.10 putsgent F
+GLIBC_2.10 pwritev F
+GLIBC_2.10 pwritev64 F
+GLIBC_2.10 quick_exit F
+GLIBC_2.10 register_printf_modifier F
+GLIBC_2.10 register_printf_specifier F
+GLIBC_2.10 register_printf_type F
+GLIBC_2.10 setsgent F
+GLIBC_2.10 sgetsgent F
+GLIBC_2.10 sgetsgent_r F
+GLIBC_2.10 sysctlnametomib F
+GLIBC_2.11 GLIBC_2.11 A
+GLIBC_2.11 __longjmp_chk F
+GLIBC_2.11 _sys_errlist D 0x178
+GLIBC_2.11 _sys_nerr D 0x4
+GLIBC_2.11 execvpe F
+GLIBC_2.11 lchflags F
+GLIBC_2.11 mkostemps F
+GLIBC_2.11 mkostemps64 F
+GLIBC_2.11 mkstemps F
+GLIBC_2.11 mkstemps64 F
+GLIBC_2.11 sys_errlist D 0x178
+GLIBC_2.11 sys_nerr D 0x4
+GLIBC_2.13 GLIBC_2.13 A
+GLIBC_2.13 __fentry__ F
+GLIBC_2.13 jail_attach F
+GLIBC_2.13 jail_get F
+GLIBC_2.13 jail_remove F
+GLIBC_2.13 jail_set F
+GLIBC_2.14 GLIBC_2.14 A
+GLIBC_2.14 syncfs F
+GLIBC_2.15 GLIBC_2.15 A
+GLIBC_2.15 __fdelt_chk F
+GLIBC_2.15 __fdelt_warn F
+GLIBC_2.15 posix_spawn F
+GLIBC_2.15 posix_spawnp F
+GLIBC_2.15 scandirat F
+GLIBC_2.15 scandirat64 F
+GLIBC_2.16 GLIBC_2.16 A
+GLIBC_2.16 __getauxval F
+GLIBC_2.16 __poll_chk F
+GLIBC_2.16 __ppoll_chk F
+GLIBC_2.16 aligned_alloc F
+GLIBC_2.16 c16rtomb F
+GLIBC_2.16 c32rtomb F
+GLIBC_2.16 getauxval F
+GLIBC_2.16 mbrtoc16 F
+GLIBC_2.16 mbrtoc32 F
+GLIBC_2.16 timespec_get F
+GLIBC_2.17 GLIBC_2.17 A
+GLIBC_2.17 clock_getcpuclockid F
+GLIBC_2.17 clock_getres F
+GLIBC_2.17 clock_gettime F
+GLIBC_2.17 clock_nanosleep F
+GLIBC_2.17 clock_settime F
+GLIBC_2.17 recvmmsg F
+GLIBC_2.17 secure_getenv F
+GLIBC_2.17 sendmmsg F
+GLIBC_2.18 GLIBC_2.18 A
+GLIBC_2.18 __cxa_thread_atexit_impl F
+GLIBC_2.18 _sys_errlist D 0x184
+GLIBC_2.18 _sys_nerr D 0x4
+GLIBC_2.18 msgctl F
+GLIBC_2.18 semctl F
+GLIBC_2.18 shmctl F
+GLIBC_2.18 sys_errlist D 0x184
+GLIBC_2.18 sys_nerr D 0x4
+GLIBC_2.18 waitid F
+GLIBC_2.21 GLIBC_2.21 A
+GLIBC_2.21 __statfs F
+GLIBC_2.22 GLIBC_2.22 A
+GLIBC_2.22 fmemopen F
+GLIBC_2.23 GLIBC_2.23 A
+GLIBC_2.23 fts64_children F
+GLIBC_2.23 fts64_close F
+GLIBC_2.23 fts64_open F
+GLIBC_2.23 fts64_read F
+GLIBC_2.23 fts64_set F
+GLIBC_2.24 GLIBC_2.24 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 gnu_dev_major F
+GLIBC_2.25 gnu_dev_makedev F
+GLIBC_2.25 gnu_dev_minor F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 _Exit F
+GLIBC_2.3 _IO_2_1_stderr_ D 0x9c
+GLIBC_2.3 _IO_2_1_stdin_ D 0x9c
+GLIBC_2.3 _IO_2_1_stdout_ D 0x9c
+GLIBC_2.3 _IO_adjust_column F
+GLIBC_2.3 _IO_adjust_wcolumn F
+GLIBC_2.3 _IO_default_doallocate F
+GLIBC_2.3 _IO_default_finish F
+GLIBC_2.3 _IO_default_pbackfail F
+GLIBC_2.3 _IO_default_uflow F
+GLIBC_2.3 _IO_default_xsgetn F
+GLIBC_2.3 _IO_default_xsputn F
+GLIBC_2.3 _IO_do_write F
+GLIBC_2.3 _IO_doallocbuf F
+GLIBC_2.3 _IO_fclose F
+GLIBC_2.3 _IO_fdopen F
+GLIBC_2.3 _IO_feof F
+GLIBC_2.3 _IO_ferror F
+GLIBC_2.3 _IO_fflush F
+GLIBC_2.3 _IO_fgetpos F
+GLIBC_2.3 _IO_fgetpos64 F
+GLIBC_2.3 _IO_fgets F
+GLIBC_2.3 _IO_file_attach F
+GLIBC_2.3 _IO_file_close F
+GLIBC_2.3 _IO_file_close_it F
+GLIBC_2.3 _IO_file_doallocate F
+GLIBC_2.3 _IO_file_finish F
+GLIBC_2.3 _IO_file_fopen F
+GLIBC_2.3 _IO_file_init F
+GLIBC_2.3 _IO_file_jumps D 0x54
+GLIBC_2.3 _IO_file_open F
+GLIBC_2.3 _IO_file_overflow F
+GLIBC_2.3 _IO_file_read F
+GLIBC_2.3 _IO_file_seek F
+GLIBC_2.3 _IO_file_seekoff F
+GLIBC_2.3 _IO_file_setbuf F
+GLIBC_2.3 _IO_file_stat F
+GLIBC_2.3 _IO_file_sync F
+GLIBC_2.3 _IO_file_underflow F
+GLIBC_2.3 _IO_file_write F
+GLIBC_2.3 _IO_file_xsputn F
+GLIBC_2.3 _IO_flockfile F
+GLIBC_2.3 _IO_flush_all F
+GLIBC_2.3 _IO_flush_all_linebuffered F
+GLIBC_2.3 _IO_fopen F
+GLIBC_2.3 _IO_fprintf F
+GLIBC_2.3 _IO_fputs F
+GLIBC_2.3 _IO_fread F
+GLIBC_2.3 _IO_free_backup_area F
+GLIBC_2.3 _IO_free_wbackup_area F
+GLIBC_2.3 _IO_fsetpos F
+GLIBC_2.3 _IO_fsetpos64 F
+GLIBC_2.3 _IO_ftell F
+GLIBC_2.3 _IO_ftrylockfile F
+GLIBC_2.3 _IO_funlockfile F
+GLIBC_2.3 _IO_fwrite F
+GLIBC_2.3 _IO_getc F
+GLIBC_2.3 _IO_getline F
+GLIBC_2.3 _IO_getline_info F
+GLIBC_2.3 _IO_gets F
+GLIBC_2.3 _IO_init F
+GLIBC_2.3 _IO_init_marker F
+GLIBC_2.3 _IO_init_wmarker F
+GLIBC_2.3 _IO_iter_begin F
+GLIBC_2.3 _IO_iter_end F
+GLIBC_2.3 _IO_iter_file F
+GLIBC_2.3 _IO_iter_next F
+GLIBC_2.3 _IO_least_wmarker F
+GLIBC_2.3 _IO_link_in F
+GLIBC_2.3 _IO_list_all D 0x4
+GLIBC_2.3 _IO_list_lock F
+GLIBC_2.3 _IO_list_resetlock F
+GLIBC_2.3 _IO_list_unlock F
+GLIBC_2.3 _IO_marker_delta F
+GLIBC_2.3 _IO_marker_difference F
+GLIBC_2.3 _IO_padn F
+GLIBC_2.3 _IO_peekc_locked F
+GLIBC_2.3 _IO_popen F
+GLIBC_2.3 _IO_printf F
+GLIBC_2.3 _IO_proc_close F
+GLIBC_2.3 _IO_proc_open F
+GLIBC_2.3 _IO_putc F
+GLIBC_2.3 _IO_puts F
+GLIBC_2.3 _IO_remove_marker F
+GLIBC_2.3 _IO_seekmark F
+GLIBC_2.3 _IO_seekoff F
+GLIBC_2.3 _IO_seekpos F
+GLIBC_2.3 _IO_seekwmark F
+GLIBC_2.3 _IO_setb F
+GLIBC_2.3 _IO_setbuffer F
+GLIBC_2.3 _IO_setvbuf F
+GLIBC_2.3 _IO_sgetn F
+GLIBC_2.3 _IO_sprintf F
+GLIBC_2.3 _IO_sputbackc F
+GLIBC_2.3 _IO_sputbackwc F
+GLIBC_2.3 _IO_sscanf F
+GLIBC_2.3 _IO_str_init_readonly F
+GLIBC_2.3 _IO_str_init_static F
+GLIBC_2.3 _IO_str_overflow F
+GLIBC_2.3 _IO_str_pbackfail F
+GLIBC_2.3 _IO_str_seekoff F
+GLIBC_2.3 _IO_str_underflow F
+GLIBC_2.3 _IO_sungetc F
+GLIBC_2.3 _IO_sungetwc F
+GLIBC_2.3 _IO_switch_to_get_mode F
+GLIBC_2.3 _IO_switch_to_main_wget_area F
+GLIBC_2.3 _IO_switch_to_wbackup_area F
+GLIBC_2.3 _IO_switch_to_wget_mode F
+GLIBC_2.3 _IO_un_link F
+GLIBC_2.3 _IO_ungetc F
+GLIBC_2.3 _IO_unsave_markers F
+GLIBC_2.3 _IO_unsave_wmarkers F
+GLIBC_2.3 _IO_vfprintf F
+GLIBC_2.3 _IO_vfscanf F
+GLIBC_2.3 _IO_vsprintf F
+GLIBC_2.3 _IO_wdefault_doallocate F
+GLIBC_2.3 _IO_wdefault_finish F
+GLIBC_2.3 _IO_wdefault_pbackfail F
+GLIBC_2.3 _IO_wdefault_uflow F
+GLIBC_2.3 _IO_wdefault_xsgetn F
+GLIBC_2.3 _IO_wdefault_xsputn F
+GLIBC_2.3 _IO_wdo_write F
+GLIBC_2.3 _IO_wdoallocbuf F
+GLIBC_2.3 _IO_wfile_jumps D 0x54
+GLIBC_2.3 _IO_wfile_overflow F
+GLIBC_2.3 _IO_wfile_seekoff F
+GLIBC_2.3 _IO_wfile_sync F
+GLIBC_2.3 _IO_wfile_underflow F
+GLIBC_2.3 _IO_wfile_xsputn F
+GLIBC_2.3 _IO_wmarker_delta F
+GLIBC_2.3 _IO_wsetb F
+GLIBC_2.3 __acl_aclcheck_fd F
+GLIBC_2.3 __acl_aclcheck_file F
+GLIBC_2.3 __acl_delete_fd F
+GLIBC_2.3 __acl_delete_file F
+GLIBC_2.3 __acl_get_fd F
+GLIBC_2.3 __acl_get_file F
+GLIBC_2.3 __acl_set_fd F
+GLIBC_2.3 __acl_set_file F
+GLIBC_2.3 __after_morecore_hook D 0x4
+GLIBC_2.3 __argz_count F
+GLIBC_2.3 __argz_next F
+GLIBC_2.3 __argz_stringify F
+GLIBC_2.3 __asprintf F
+GLIBC_2.3 __assert F
+GLIBC_2.3 __assert_fail F
+GLIBC_2.3 __assert_perror_fail F
+GLIBC_2.3 __backtrace F
+GLIBC_2.3 __backtrace_symbols F
+GLIBC_2.3 __backtrace_symbols_fd F
+GLIBC_2.3 __bsd_getpgrp F
+GLIBC_2.3 __bzero F
+GLIBC_2.3 __check_rhosts_file D 0x4
+GLIBC_2.3 __close F
+GLIBC_2.3 __cmsg_nxthdr F
+GLIBC_2.3 __connect F
+GLIBC_2.3 __ctype_b_loc F
+GLIBC_2.3 __ctype_get_mb_cur_max F
+GLIBC_2.3 __ctype_tolower_loc F
+GLIBC_2.3 __ctype_toupper_loc F
+GLIBC_2.3 __curbrk D 0x4
+GLIBC_2.3 __cxa_atexit F
+GLIBC_2.3 __cxa_finalize F
+GLIBC_2.3 __cyg_profile_func_enter F
+GLIBC_2.3 __cyg_profile_func_exit F
+GLIBC_2.3 __daylight D 0x4
+GLIBC_2.3 __dcgettext F
+GLIBC_2.3 __default_morecore F
+GLIBC_2.3 __dgettext F
+GLIBC_2.3 __divdi3 F
+GLIBC_2.3 __dup2 F
+GLIBC_2.3 __duplocale F
+GLIBC_2.3 __environ D 0x4
+GLIBC_2.3 __errno_location F
+GLIBC_2.3 __fbufsize F
+GLIBC_2.3 __fcntl F
+GLIBC_2.3 __ffs F
+GLIBC_2.3 __finite F
+GLIBC_2.3 __finitef F
+GLIBC_2.3 __finitel F
+GLIBC_2.3 __flbf F
+GLIBC_2.3 __fork F
+GLIBC_2.3 __fpending F
+GLIBC_2.3 __fpu_control D 0x2
+GLIBC_2.3 __fpurge F
+GLIBC_2.3 __freadable F
+GLIBC_2.3 __freading F
+GLIBC_2.3 __free_hook D 0x4
+GLIBC_2.3 __freelocale F
+GLIBC_2.3 __fsetlocking F
+GLIBC_2.3 __fwritable F
+GLIBC_2.3 __fwriting F
+GLIBC_2.3 __fxstat F
+GLIBC_2.3 __fxstat64 F
+GLIBC_2.3 __getdelim F
+GLIBC_2.3 __getpagesize F
+GLIBC_2.3 __getpgid F
+GLIBC_2.3 __getpid F
+GLIBC_2.3 __gettimeofday F
+GLIBC_2.3 __gmtime_r F
+GLIBC_2.3 __h_errno_location F
+GLIBC_2.3 __isalnum_l F
+GLIBC_2.3 __isalpha_l F
+GLIBC_2.3 __isascii_l F
+GLIBC_2.3 __isblank_l F
+GLIBC_2.3 __iscntrl_l F
+GLIBC_2.3 __isctype F
+GLIBC_2.3 __isdigit_l F
+GLIBC_2.3 __isgraph_l F
+GLIBC_2.3 __isinf F
+GLIBC_2.3 __isinff F
+GLIBC_2.3 __isinfl F
+GLIBC_2.3 __islower_l F
+GLIBC_2.3 __isnan F
+GLIBC_2.3 __isnanf F
+GLIBC_2.3 __isnanl F
+GLIBC_2.3 __isprint_l F
+GLIBC_2.3 __ispunct_l F
+GLIBC_2.3 __isspace_l F
+GLIBC_2.3 __isupper_l F
+GLIBC_2.3 __iswalnum_l F
+GLIBC_2.3 __iswalpha_l F
+GLIBC_2.3 __iswblank_l F
+GLIBC_2.3 __iswcntrl_l F
+GLIBC_2.3 __iswctype F
+GLIBC_2.3 __iswctype_l F
+GLIBC_2.3 __iswdigit_l F
+GLIBC_2.3 __iswgraph_l F
+GLIBC_2.3 __iswlower_l F
+GLIBC_2.3 __iswprint_l F
+GLIBC_2.3 __iswpunct_l F
+GLIBC_2.3 __iswspace_l F
+GLIBC_2.3 __iswupper_l F
+GLIBC_2.3 __iswxdigit_l F
+GLIBC_2.3 __isxdigit_l F
+GLIBC_2.3 __ivaliduser F
+GLIBC_2.3 __key_decryptsession_pk_LOCAL D 0x4
+GLIBC_2.3 __key_encryptsession_pk_LOCAL D 0x4
+GLIBC_2.3 __key_gendes_LOCAL D 0x4
+GLIBC_2.3 __libc_allocate_rtsig F
+GLIBC_2.3 __libc_calloc F
+GLIBC_2.3 __libc_current_sigrtmax F
+GLIBC_2.3 __libc_current_sigrtmin F
+GLIBC_2.3 __libc_free F
+GLIBC_2.3 __libc_freeres F
+GLIBC_2.3 __libc_init_first F
+GLIBC_2.3 __libc_mallinfo F
+GLIBC_2.3 __libc_malloc F
+GLIBC_2.3 __libc_mallopt F
+GLIBC_2.3 __libc_memalign F
+GLIBC_2.3 __libc_pvalloc F
+GLIBC_2.3 __libc_realloc F
+GLIBC_2.3 __libc_start_main F
+GLIBC_2.3 __libc_valloc F
+GLIBC_2.3 __lseek F
+GLIBC_2.3 __lxstat F
+GLIBC_2.3 __lxstat64 F
+GLIBC_2.3 __malloc_hook D 0x4
+GLIBC_2.3 __malloc_initialize_hook D 0x4
+GLIBC_2.3 __mbrlen F
+GLIBC_2.3 __mbrtowc F
+GLIBC_2.3 __memalign_hook D 0x4
+GLIBC_2.3 __memcpy_by2 F
+GLIBC_2.3 __memcpy_by4 F
+GLIBC_2.3 __memcpy_c F
+GLIBC_2.3 __memcpy_g F
+GLIBC_2.3 __mempcpy F
+GLIBC_2.3 __mempcpy_by2 F
+GLIBC_2.3 __mempcpy_by4 F
+GLIBC_2.3 __mempcpy_byn F
+GLIBC_2.3 __mempcpy_small F
+GLIBC_2.3 __memset_cc F
+GLIBC_2.3 __memset_ccn_by2 F
+GLIBC_2.3 __memset_ccn_by4 F
+GLIBC_2.3 __memset_cg F
+GLIBC_2.3 __memset_gcn_by2 F
+GLIBC_2.3 __memset_gcn_by4 F
+GLIBC_2.3 __memset_gg F
+GLIBC_2.3 __moddi3 F
+GLIBC_2.3 __monstartup F
+GLIBC_2.3 __morecore D 0x4
+GLIBC_2.3 __nanosleep F
+GLIBC_2.3 __newlocale F
+GLIBC_2.3 __nl_langinfo_l F
+GLIBC_2.3 __nss_configure_lookup F
+GLIBC_2.3 __nss_database_lookup F
+GLIBC_2.3 __nss_group_lookup F
+GLIBC_2.3 __nss_hostname_digits_dots F
+GLIBC_2.3 __nss_hosts_lookup F
+GLIBC_2.3 __nss_next F
+GLIBC_2.3 __nss_passwd_lookup F
+GLIBC_2.3 __open F
+GLIBC_2.3 __overflow F
+GLIBC_2.3 __pipe F
+GLIBC_2.3 __poll F
+GLIBC_2.3 __pread64 F
+GLIBC_2.3 __printf_fp F
+GLIBC_2.3 __profile_frequency F
+GLIBC_2.3 __progname D 0x4
+GLIBC_2.3 __progname_full D 0x4
+GLIBC_2.3 __pwrite64 F
+GLIBC_2.3 __rawmemchr F
+GLIBC_2.3 __rcmd_errstr D 0x4
+GLIBC_2.3 __read F
+GLIBC_2.3 __realloc_hook D 0x4
+GLIBC_2.3 __res_init F
+GLIBC_2.3 __res_nclose F
+GLIBC_2.3 __res_ninit F
+GLIBC_2.3 __res_randomid F
+GLIBC_2.3 __res_state F
+GLIBC_2.3 __rpc_thread_createerr F
+GLIBC_2.3 __rpc_thread_svc_fdset F
+GLIBC_2.3 __rpc_thread_svc_max_pollfd F
+GLIBC_2.3 __rpc_thread_svc_pollfd F
+GLIBC_2.3 __sbrk F
+GLIBC_2.3 __sched_get_priority_max F
+GLIBC_2.3 __sched_get_priority_min F
+GLIBC_2.3 __sched_getparam F
+GLIBC_2.3 __sched_getscheduler F
+GLIBC_2.3 __sched_setscheduler F
+GLIBC_2.3 __sched_yield F
+GLIBC_2.3 __secure_getenv F
+GLIBC_2.3 __select F
+GLIBC_2.3 __send F
+GLIBC_2.3 __setpgid F
+GLIBC_2.3 __sigaction F
+GLIBC_2.3 __sigaddset F
+GLIBC_2.3 __sigdelset F
+GLIBC_2.3 __sigismember F
+GLIBC_2.3 __signbit F
+GLIBC_2.3 __signbitf F
+GLIBC_2.3 __signbitl F
+GLIBC_2.3 __sigpause F
+GLIBC_2.3 __sigsetjmp F
+GLIBC_2.3 __sigsuspend F
+GLIBC_2.3 __stpcpy F
+GLIBC_2.3 __stpcpy_g F
+GLIBC_2.3 __stpcpy_small F
+GLIBC_2.3 __stpncpy F
+GLIBC_2.3 __strcasecmp F
+GLIBC_2.3 __strcasecmp_l F
+GLIBC_2.3 __strcasestr F
+GLIBC_2.3 __strcat_c F
+GLIBC_2.3 __strcat_g F
+GLIBC_2.3 __strchr_c F
+GLIBC_2.3 __strchr_g F
+GLIBC_2.3 __strchrnul_c F
+GLIBC_2.3 __strchrnul_g F
+GLIBC_2.3 __strcmp_gg F
+GLIBC_2.3 __strcoll_l F
+GLIBC_2.3 __strcpy_g F
+GLIBC_2.3 __strcpy_small F
+GLIBC_2.3 __strcspn_c1 F
+GLIBC_2.3 __strcspn_c2 F
+GLIBC_2.3 __strcspn_c3 F
+GLIBC_2.3 __strcspn_cg F
+GLIBC_2.3 __strcspn_g F
+GLIBC_2.3 __strdup F
+GLIBC_2.3 __strerror_r F
+GLIBC_2.3 __strfmon_l F
+GLIBC_2.3 __strftime_l F
+GLIBC_2.3 __strlen_g F
+GLIBC_2.3 __strncasecmp_l F
+GLIBC_2.3 __strncat_g F
+GLIBC_2.3 __strncmp_g F
+GLIBC_2.3 __strncpy_by2 F
+GLIBC_2.3 __strncpy_by4 F
+GLIBC_2.3 __strncpy_byn F
+GLIBC_2.3 __strncpy_gg F
+GLIBC_2.3 __strndup F
+GLIBC_2.3 __strpbrk_c2 F
+GLIBC_2.3 __strpbrk_c3 F
+GLIBC_2.3 __strpbrk_cg F
+GLIBC_2.3 __strpbrk_g F
+GLIBC_2.3 __strrchr_c F
+GLIBC_2.3 __strrchr_g F
+GLIBC_2.3 __strsep_1c F
+GLIBC_2.3 __strsep_2c F
+GLIBC_2.3 __strsep_3c F
+GLIBC_2.3 __strsep_g F
+GLIBC_2.3 __strspn_c1 F
+GLIBC_2.3 __strspn_c2 F
+GLIBC_2.3 __strspn_c3 F
+GLIBC_2.3 __strspn_cg F
+GLIBC_2.3 __strspn_g F
+GLIBC_2.3 __strstr_cg F
+GLIBC_2.3 __strstr_g F
+GLIBC_2.3 __strtod_internal F
+GLIBC_2.3 __strtod_l F
+GLIBC_2.3 __strtof_internal F
+GLIBC_2.3 __strtof_l F
+GLIBC_2.3 __strtok_r F
+GLIBC_2.3 __strtok_r_1c F
+GLIBC_2.3 __strtol_internal F
+GLIBC_2.3 __strtol_l F
+GLIBC_2.3 __strtold_internal F
+GLIBC_2.3 __strtold_l F
+GLIBC_2.3 __strtoll_internal F
+GLIBC_2.3 __strtoll_l F
+GLIBC_2.3 __strtoul_internal F
+GLIBC_2.3 __strtoul_l F
+GLIBC_2.3 __strtoull_internal F
+GLIBC_2.3 __strtoull_l F
+GLIBC_2.3 __strverscmp F
+GLIBC_2.3 __strxfrm_l F
+GLIBC_2.3 __syscall_aio_cancel F
+GLIBC_2.3 __syscall_aio_error F
+GLIBC_2.3 __syscall_aio_read F
+GLIBC_2.3 __syscall_aio_return F
+GLIBC_2.3 __syscall_aio_suspend F
+GLIBC_2.3 __syscall_aio_waitcomplete F
+GLIBC_2.3 __syscall_aio_write F
+GLIBC_2.3 __syscall_lio_listio F
+GLIBC_2.3 __syscall_obreak F
+GLIBC_2.3 __syscall_yield F
+GLIBC_2.3 __sysconf F
+GLIBC_2.3 __sysctl F
+GLIBC_2.3 __sysv_signal F
+GLIBC_2.3 __timezone D 0x4
+GLIBC_2.3 __toascii_l F
+GLIBC_2.3 __tolower_l F
+GLIBC_2.3 __toupper_l F
+GLIBC_2.3 __towctrans F
+GLIBC_2.3 __towctrans_l F
+GLIBC_2.3 __towlower_l F
+GLIBC_2.3 __towupper_l F
+GLIBC_2.3 __tzname D 0x8
+GLIBC_2.3 __udivdi3 F
+GLIBC_2.3 __uflow F
+GLIBC_2.3 __umoddi3 F
+GLIBC_2.3 __underflow F
+GLIBC_2.3 __uselocale F
+GLIBC_2.3 __vfork F
+GLIBC_2.3 __vfscanf F
+GLIBC_2.3 __vsnprintf F
+GLIBC_2.3 __vsscanf F
+GLIBC_2.3 __wait F
+GLIBC_2.3 __waitpid F
+GLIBC_2.3 __wcscasecmp_l F
+GLIBC_2.3 __wcscoll_l F
+GLIBC_2.3 __wcsftime_l F
+GLIBC_2.3 __wcsncasecmp_l F
+GLIBC_2.3 __wcstod_internal F
+GLIBC_2.3 __wcstod_l F
+GLIBC_2.3 __wcstof_internal F
+GLIBC_2.3 __wcstof_l F
+GLIBC_2.3 __wcstol_internal F
+GLIBC_2.3 __wcstol_l F
+GLIBC_2.3 __wcstold_internal F
+GLIBC_2.3 __wcstold_l F
+GLIBC_2.3 __wcstoll_internal F
+GLIBC_2.3 __wcstoll_l F
+GLIBC_2.3 __wcstoul_internal F
+GLIBC_2.3 __wcstoul_l F
+GLIBC_2.3 __wcstoull_internal F
+GLIBC_2.3 __wcstoull_l F
+GLIBC_2.3 __wcsxfrm_l F
+GLIBC_2.3 __wctrans_l F
+GLIBC_2.3 __wctype_l F
+GLIBC_2.3 __woverflow F
+GLIBC_2.3 __write F
+GLIBC_2.3 __wuflow F
+GLIBC_2.3 __wunderflow F
+GLIBC_2.3 __xmknod F
+GLIBC_2.3 __xpg_basename F
+GLIBC_2.3 __xpg_sigpause F
+GLIBC_2.3 __xstat F
+GLIBC_2.3 __xstat64 F
+GLIBC_2.3 _authenticate F
+GLIBC_2.3 _dl_mcount_wrapper F
+GLIBC_2.3 _dl_mcount_wrapper_check F
+GLIBC_2.3 _environ D 0x4
+GLIBC_2.3 _exit F
+GLIBC_2.3 _flushlbf F
+GLIBC_2.3 _libc_intl_domainname D 0x5
+GLIBC_2.3 _longjmp F
+GLIBC_2.3 _mcleanup F
+GLIBC_2.3 _mcount F
+GLIBC_2.3 _nl_default_dirname D 0x12
+GLIBC_2.3 _nl_domain_bindings D 0x4
+GLIBC_2.3 _nl_msg_cat_cntr D 0x4
+GLIBC_2.3 _null_auth D 0xc
+GLIBC_2.3 _obstack D 0x4
+GLIBC_2.3 _obstack_allocated_p F
+GLIBC_2.3 _obstack_begin F
+GLIBC_2.3 _obstack_begin_1 F
+GLIBC_2.3 _obstack_free F
+GLIBC_2.3 _obstack_memory_used F
+GLIBC_2.3 _obstack_newchunk F
+GLIBC_2.3 _res D 0x200
+GLIBC_2.3 _res_hconf D 0x30
+GLIBC_2.3 _rpc_dtablesize F
+GLIBC_2.3 _seterr_reply F
+GLIBC_2.3 _setjmp F
+GLIBC_2.3 _sys_errlist D 0x15c
+GLIBC_2.3 _sys_nerr D 0x4
+GLIBC_2.3 _sys_siglist D 0x204
+GLIBC_2.3 _tolower F
+GLIBC_2.3 _toupper F
+GLIBC_2.3 a64l F
+GLIBC_2.3 abort F
+GLIBC_2.3 abs F
+GLIBC_2.3 accept F
+GLIBC_2.3 access F
+GLIBC_2.3 acct F
+GLIBC_2.3 addmntent F
+GLIBC_2.3 addseverity F
+GLIBC_2.3 adjtime F
+GLIBC_2.3 advance F
+GLIBC_2.3 alarm F
+GLIBC_2.3 alphasort F
+GLIBC_2.3 alphasort64 F
+GLIBC_2.3 argp_err_exit_status D 0x4
+GLIBC_2.3 argp_error F
+GLIBC_2.3 argp_failure F
+GLIBC_2.3 argp_help F
+GLIBC_2.3 argp_parse F
+GLIBC_2.3 argp_program_bug_address D 0x4
+GLIBC_2.3 argp_program_version D 0x4
+GLIBC_2.3 argp_program_version_hook D 0x4
+GLIBC_2.3 argp_state_help F
+GLIBC_2.3 argp_usage F
+GLIBC_2.3 argz_add F
+GLIBC_2.3 argz_add_sep F
+GLIBC_2.3 argz_append F
+GLIBC_2.3 argz_count F
+GLIBC_2.3 argz_create F
+GLIBC_2.3 argz_create_sep F
+GLIBC_2.3 argz_delete F
+GLIBC_2.3 argz_extract F
+GLIBC_2.3 argz_insert F
+GLIBC_2.3 argz_next F
+GLIBC_2.3 argz_replace F
+GLIBC_2.3 argz_stringify F
+GLIBC_2.3 asctime F
+GLIBC_2.3 asctime_r F
+GLIBC_2.3 asprintf F
+GLIBC_2.3 atof F
+GLIBC_2.3 atoi F
+GLIBC_2.3 atol F
+GLIBC_2.3 atoll F
+GLIBC_2.3 authdes_create F
+GLIBC_2.3 authdes_getucred F
+GLIBC_2.3 authdes_pk_create F
+GLIBC_2.3 authnone_create F
+GLIBC_2.3 authunix_create F
+GLIBC_2.3 authunix_create_default F
+GLIBC_2.3 backtrace F
+GLIBC_2.3 backtrace_symbols F
+GLIBC_2.3 backtrace_symbols_fd F
+GLIBC_2.3 basename F
+GLIBC_2.3 bcmp F
+GLIBC_2.3 bcopy F
+GLIBC_2.3 bind F
+GLIBC_2.3 bind_textdomain_codeset F
+GLIBC_2.3 bindresvport F
+GLIBC_2.3 bindtextdomain F
+GLIBC_2.3 brk F
+GLIBC_2.3 bsd_signal F
+GLIBC_2.3 bsearch F
+GLIBC_2.3 btowc F
+GLIBC_2.3 bzero F
+GLIBC_2.3 calloc F
+GLIBC_2.3 callrpc F
+GLIBC_2.3 canonicalize_file_name F
+GLIBC_2.3 catclose F
+GLIBC_2.3 catgets F
+GLIBC_2.3 catopen F
+GLIBC_2.3 cbc_crypt F
+GLIBC_2.3 cfgetispeed F
+GLIBC_2.3 cfgetospeed F
+GLIBC_2.3 cfmakeraw F
+GLIBC_2.3 cfree F
+GLIBC_2.3 cfsetispeed F
+GLIBC_2.3 cfsetospeed F
+GLIBC_2.3 cfsetspeed F
+GLIBC_2.3 chdir F
+GLIBC_2.3 chflags F
+GLIBC_2.3 chmod F
+GLIBC_2.3 chown F
+GLIBC_2.3 chroot F
+GLIBC_2.3 clearenv F
+GLIBC_2.3 clearerr F
+GLIBC_2.3 clearerr_unlocked F
+GLIBC_2.3 clnt_broadcast F
+GLIBC_2.3 clnt_create F
+GLIBC_2.3 clnt_pcreateerror F
+GLIBC_2.3 clnt_perrno F
+GLIBC_2.3 clnt_perror F
+GLIBC_2.3 clnt_spcreateerror F
+GLIBC_2.3 clnt_sperrno F
+GLIBC_2.3 clnt_sperror F
+GLIBC_2.3 clntraw_create F
+GLIBC_2.3 clnttcp_create F
+GLIBC_2.3 clntudp_bufcreate F
+GLIBC_2.3 clntudp_create F
+GLIBC_2.3 clntunix_create F
+GLIBC_2.3 clock F
+GLIBC_2.3 clone F
+GLIBC_2.3 close F
+GLIBC_2.3 closedir F
+GLIBC_2.3 closelog F
+GLIBC_2.3 confstr F
+GLIBC_2.3 connect F
+GLIBC_2.3 copysign F
+GLIBC_2.3 copysignf F
+GLIBC_2.3 copysignl F
+GLIBC_2.3 creat F
+GLIBC_2.3 creat64 F
+GLIBC_2.3 ctermid F
+GLIBC_2.3 ctime F
+GLIBC_2.3 ctime_r F
+GLIBC_2.3 cuserid F
+GLIBC_2.3 daemon F
+GLIBC_2.3 daylight D 0x4
+GLIBC_2.3 dcgettext F
+GLIBC_2.3 dcngettext F
+GLIBC_2.3 des_setparity F
+GLIBC_2.3 dgettext F
+GLIBC_2.3 difftime F
+GLIBC_2.3 dirfd F
+GLIBC_2.3 dirname F
+GLIBC_2.3 div F
+GLIBC_2.3 dl_iterate_phdr F
+GLIBC_2.3 dngettext F
+GLIBC_2.3 dprintf F
+GLIBC_2.3 drand48 F
+GLIBC_2.3 drand48_r F
+GLIBC_2.3 dup F
+GLIBC_2.3 dup2 F
+GLIBC_2.3 duplocale F
+GLIBC_2.3 dysize F
+GLIBC_2.3 ecb_crypt F
+GLIBC_2.3 ecvt F
+GLIBC_2.3 ecvt_r F
+GLIBC_2.3 endaliasent F
+GLIBC_2.3 endfsent F
+GLIBC_2.3 endgrent F
+GLIBC_2.3 endhostent F
+GLIBC_2.3 endmntent F
+GLIBC_2.3 endnetent F
+GLIBC_2.3 endnetgrent F
+GLIBC_2.3 endprotoent F
+GLIBC_2.3 endpwent F
+GLIBC_2.3 endrpcent F
+GLIBC_2.3 endservent F
+GLIBC_2.3 endspent F
+GLIBC_2.3 endttyent F
+GLIBC_2.3 endusershell F
+GLIBC_2.3 endutent F
+GLIBC_2.3 endutxent F
+GLIBC_2.3 environ D 0x4
+GLIBC_2.3 envz_add F
+GLIBC_2.3 envz_entry F
+GLIBC_2.3 envz_get F
+GLIBC_2.3 envz_merge F
+GLIBC_2.3 envz_remove F
+GLIBC_2.3 envz_strip F
+GLIBC_2.3 erand48 F
+GLIBC_2.3 erand48_r F
+GLIBC_2.3 err F
+GLIBC_2.3 error F
+GLIBC_2.3 error_at_line F
+GLIBC_2.3 error_message_count D 0x4
+GLIBC_2.3 error_one_per_line D 0x4
+GLIBC_2.3 error_print_progname D 0x4
+GLIBC_2.3 errx F
+GLIBC_2.3 ether_aton F
+GLIBC_2.3 ether_aton_r F
+GLIBC_2.3 ether_hostton F
+GLIBC_2.3 ether_line F
+GLIBC_2.3 ether_ntoa F
+GLIBC_2.3 ether_ntoa_r F
+GLIBC_2.3 ether_ntohost F
+GLIBC_2.3 euidaccess F
+GLIBC_2.3 execl F
+GLIBC_2.3 execle F
+GLIBC_2.3 execlp F
+GLIBC_2.3 execv F
+GLIBC_2.3 execve F
+GLIBC_2.3 execvp F
+GLIBC_2.3 exit F
+GLIBC_2.3 extattr_delete_file F
+GLIBC_2.3 extattr_get_file F
+GLIBC_2.3 extattr_set_file F
+GLIBC_2.3 extattrctl F
+GLIBC_2.3 fattach F
+GLIBC_2.3 fchdir F
+GLIBC_2.3 fchflags F
+GLIBC_2.3 fchmod F
+GLIBC_2.3 fchown F
+GLIBC_2.3 fclose F
+GLIBC_2.3 fcloseall F
+GLIBC_2.3 fcntl F
+GLIBC_2.3 fcvt F
+GLIBC_2.3 fcvt_r F
+GLIBC_2.3 fdatasync F
+GLIBC_2.3 fdetach F
+GLIBC_2.3 fdopen F
+GLIBC_2.3 feof F
+GLIBC_2.3 feof_unlocked F
+GLIBC_2.3 ferror F
+GLIBC_2.3 ferror_unlocked F
+GLIBC_2.3 fexecve F
+GLIBC_2.3 fflush F
+GLIBC_2.3 fflush_unlocked F
+GLIBC_2.3 ffs F
+GLIBC_2.3 ffsl F
+GLIBC_2.3 ffsll F
+GLIBC_2.3 fgetc F
+GLIBC_2.3 fgetc_unlocked F
+GLIBC_2.3 fgetgrent F
+GLIBC_2.3 fgetgrent_r F
+GLIBC_2.3 fgetpos F
+GLIBC_2.3 fgetpos64 F
+GLIBC_2.3 fgetpwent F
+GLIBC_2.3 fgetpwent_r F
+GLIBC_2.3 fgets F
+GLIBC_2.3 fgets_unlocked F
+GLIBC_2.3 fgetspent F
+GLIBC_2.3 fgetspent_r F
+GLIBC_2.3 fgetwc F
+GLIBC_2.3 fgetwc_unlocked F
+GLIBC_2.3 fgetws F
+GLIBC_2.3 fgetws_unlocked F
+GLIBC_2.3 fgetxattr F
+GLIBC_2.3 fhopen F
+GLIBC_2.3 fhstat F
+GLIBC_2.3 fhstatfs F
+GLIBC_2.3 fileno F
+GLIBC_2.3 fileno_unlocked F
+GLIBC_2.3 finite F
+GLIBC_2.3 finitef F
+GLIBC_2.3 finitel F
+GLIBC_2.3 flistxattr F
+GLIBC_2.3 flock F
+GLIBC_2.3 flockfile F
+GLIBC_2.3 fmemopen F
+GLIBC_2.3 fmtmsg F
+GLIBC_2.3 fnmatch F
+GLIBC_2.3 fopen F
+GLIBC_2.3 fopen64 F
+GLIBC_2.3 fopencookie F
+GLIBC_2.3 fork F
+GLIBC_2.3 fpathconf F
+GLIBC_2.3 fprintf F
+GLIBC_2.3 fputc F
+GLIBC_2.3 fputc_unlocked F
+GLIBC_2.3 fputs F
+GLIBC_2.3 fputs_unlocked F
+GLIBC_2.3 fputwc F
+GLIBC_2.3 fputwc_unlocked F
+GLIBC_2.3 fputws F
+GLIBC_2.3 fputws_unlocked F
+GLIBC_2.3 fread F
+GLIBC_2.3 fread_unlocked F
+GLIBC_2.3 free F
+GLIBC_2.3 freeaddrinfo F
+GLIBC_2.3 freeifaddrs F
+GLIBC_2.3 freelocale F
+GLIBC_2.3 fremovexattr F
+GLIBC_2.3 freopen F
+GLIBC_2.3 freopen64 F
+GLIBC_2.3 frexp F
+GLIBC_2.3 frexpf F
+GLIBC_2.3 frexpl F
+GLIBC_2.3 fscanf F
+GLIBC_2.3 fseek F
+GLIBC_2.3 fseeko F
+GLIBC_2.3 fseeko64 F
+GLIBC_2.3 fsetpos F
+GLIBC_2.3 fsetpos64 F
+GLIBC_2.3 fsetxattr F
+GLIBC_2.3 fstatfs F
+GLIBC_2.3 fstatfs64 F
+GLIBC_2.3 fstatvfs F
+GLIBC_2.3 fstatvfs64 F
+GLIBC_2.3 fsync F
+GLIBC_2.3 ftell F
+GLIBC_2.3 ftello F
+GLIBC_2.3 ftello64 F
+GLIBC_2.3 ftime F
+GLIBC_2.3 ftok F
+GLIBC_2.3 ftruncate F
+GLIBC_2.3 ftruncate64 F
+GLIBC_2.3 ftrylockfile F
+GLIBC_2.3 fts_children F
+GLIBC_2.3 fts_close F
+GLIBC_2.3 fts_open F
+GLIBC_2.3 fts_read F
+GLIBC_2.3 fts_set F
+GLIBC_2.3 ftw F
+GLIBC_2.3 ftw64 F
+GLIBC_2.3 funlockfile F
+GLIBC_2.3 futimes F
+GLIBC_2.3 fwide F
+GLIBC_2.3 fwprintf F
+GLIBC_2.3 fwrite F
+GLIBC_2.3 fwrite_unlocked F
+GLIBC_2.3 fwscanf F
+GLIBC_2.3 gai_strerror F
+GLIBC_2.3 gcvt F
+GLIBC_2.3 get_avphys_pages F
+GLIBC_2.3 get_current_dir_name F
+GLIBC_2.3 get_myaddress F
+GLIBC_2.3 get_nprocs F
+GLIBC_2.3 get_nprocs_conf F
+GLIBC_2.3 get_phys_pages F
+GLIBC_2.3 getaddrinfo F
+GLIBC_2.3 getaliasbyname F
+GLIBC_2.3 getaliasbyname_r F
+GLIBC_2.3 getaliasent F
+GLIBC_2.3 getaliasent_r F
+GLIBC_2.3 getc F
+GLIBC_2.3 getc_unlocked F
+GLIBC_2.3 getchar F
+GLIBC_2.3 getchar_unlocked F
+GLIBC_2.3 getcontext F
+GLIBC_2.3 getcwd F
+GLIBC_2.3 getdate F
+GLIBC_2.3 getdate_err D 0x4
+GLIBC_2.3 getdate_r F
+GLIBC_2.3 getdelim F
+GLIBC_2.3 getdents F
+GLIBC_2.3 getdirentries F
+GLIBC_2.3 getdirentries64 F
+GLIBC_2.3 getdomainname F
+GLIBC_2.3 getdtablesize F
+GLIBC_2.3 getegid F
+GLIBC_2.3 getenv F
+GLIBC_2.3 geteuid F
+GLIBC_2.3 getfh F
+GLIBC_2.3 getfsent F
+GLIBC_2.3 getfsfile F
+GLIBC_2.3 getfsspec F
+GLIBC_2.3 getfsstat F
+GLIBC_2.3 getfsstat64 F
+GLIBC_2.3 getgid F
+GLIBC_2.3 getgrent F
+GLIBC_2.3 getgrent_r F
+GLIBC_2.3 getgrgid F
+GLIBC_2.3 getgrgid_r F
+GLIBC_2.3 getgrnam F
+GLIBC_2.3 getgrnam_r F
+GLIBC_2.3 getgrouplist F
+GLIBC_2.3 getgroups F
+GLIBC_2.3 gethostbyaddr F
+GLIBC_2.3 gethostbyaddr_r F
+GLIBC_2.3 gethostbyname F
+GLIBC_2.3 gethostbyname2 F
+GLIBC_2.3 gethostbyname2_r F
+GLIBC_2.3 gethostbyname_r F
+GLIBC_2.3 gethostent F
+GLIBC_2.3 gethostent_r F
+GLIBC_2.3 gethostid F
+GLIBC_2.3 gethostname F
+GLIBC_2.3 getifaddrs F
+GLIBC_2.3 getitimer F
+GLIBC_2.3 getline F
+GLIBC_2.3 getloadavg F
+GLIBC_2.3 getlogin F
+GLIBC_2.3 getlogin_r F
+GLIBC_2.3 getmntent F
+GLIBC_2.3 getmntent_r F
+GLIBC_2.3 getmntinfo F
+GLIBC_2.3 getmntinfo64 F
+GLIBC_2.3 getmsg F
+GLIBC_2.3 getnameinfo F
+GLIBC_2.3 getnetbyaddr F
+GLIBC_2.3 getnetbyaddr_r F
+GLIBC_2.3 getnetbyname F
+GLIBC_2.3 getnetbyname_r F
+GLIBC_2.3 getnetent F
+GLIBC_2.3 getnetent_r F
+GLIBC_2.3 getnetgrent F
+GLIBC_2.3 getnetgrent_r F
+GLIBC_2.3 getnetname F
+GLIBC_2.3 getopt F
+GLIBC_2.3 getopt_long F
+GLIBC_2.3 getopt_long_only F
+GLIBC_2.3 getpagesize F
+GLIBC_2.3 getpass F
+GLIBC_2.3 getpeername F
+GLIBC_2.3 getpgid F
+GLIBC_2.3 getpgrp F
+GLIBC_2.3 getpid F
+GLIBC_2.3 getpmsg F
+GLIBC_2.3 getppid F
+GLIBC_2.3 getpriority F
+GLIBC_2.3 getprotobyname F
+GLIBC_2.3 getprotobyname_r F
+GLIBC_2.3 getprotobynumber F
+GLIBC_2.3 getprotobynumber_r F
+GLIBC_2.3 getprotoent F
+GLIBC_2.3 getprotoent_r F
+GLIBC_2.3 getpt F
+GLIBC_2.3 getpublickey F
+GLIBC_2.3 getpw F
+GLIBC_2.3 getpwent F
+GLIBC_2.3 getpwent_r F
+GLIBC_2.3 getpwnam F
+GLIBC_2.3 getpwnam_r F
+GLIBC_2.3 getpwuid F
+GLIBC_2.3 getpwuid_r F
+GLIBC_2.3 getresgid F
+GLIBC_2.3 getresuid F
+GLIBC_2.3 getrlimit F
+GLIBC_2.3 getrlimit64 F
+GLIBC_2.3 getrpcbyname F
+GLIBC_2.3 getrpcbyname_r F
+GLIBC_2.3 getrpcbynumber F
+GLIBC_2.3 getrpcbynumber_r F
+GLIBC_2.3 getrpcent F
+GLIBC_2.3 getrpcent_r F
+GLIBC_2.3 getrpcport F
+GLIBC_2.3 getrusage F
+GLIBC_2.3 gets F
+GLIBC_2.3 getsecretkey F
+GLIBC_2.3 getservbyname F
+GLIBC_2.3 getservbyname_r F
+GLIBC_2.3 getservbyport F
+GLIBC_2.3 getservbyport_r F
+GLIBC_2.3 getservent F
+GLIBC_2.3 getservent_r F
+GLIBC_2.3 getsid F
+GLIBC_2.3 getsockname F
+GLIBC_2.3 getsockopt F
+GLIBC_2.3 getspent F
+GLIBC_2.3 getspent_r F
+GLIBC_2.3 getspnam F
+GLIBC_2.3 getspnam_r F
+GLIBC_2.3 getsubopt F
+GLIBC_2.3 gettext F
+GLIBC_2.3 gettimeofday F
+GLIBC_2.3 getttyent F
+GLIBC_2.3 getttynam F
+GLIBC_2.3 getuid F
+GLIBC_2.3 getusershell F
+GLIBC_2.3 getutent F
+GLIBC_2.3 getutent_r F
+GLIBC_2.3 getutid F
+GLIBC_2.3 getutid_r F
+GLIBC_2.3 getutline F
+GLIBC_2.3 getutline_r F
+GLIBC_2.3 getutmp F
+GLIBC_2.3 getutmpx F
+GLIBC_2.3 getutxent F
+GLIBC_2.3 getutxid F
+GLIBC_2.3 getutxline F
+GLIBC_2.3 getw F
+GLIBC_2.3 getwc F
+GLIBC_2.3 getwc_unlocked F
+GLIBC_2.3 getwchar F
+GLIBC_2.3 getwchar_unlocked F
+GLIBC_2.3 getwd F
+GLIBC_2.3 getxattr F
+GLIBC_2.3 glob F
+GLIBC_2.3 glob64 F
+GLIBC_2.3 glob_pattern_p F
+GLIBC_2.3 globfree F
+GLIBC_2.3 globfree64 F
+GLIBC_2.3 gmtime F
+GLIBC_2.3 gmtime_r F
+GLIBC_2.3 gnu_get_libc_release F
+GLIBC_2.3 gnu_get_libc_version F
+GLIBC_2.3 grantpt F
+GLIBC_2.3 group_member F
+GLIBC_2.3 gsignal F
+GLIBC_2.3 gtty F
+GLIBC_2.3 h_errlist D 0x14
+GLIBC_2.3 h_nerr D 0x4
+GLIBC_2.3 hasmntopt F
+GLIBC_2.3 hcreate F
+GLIBC_2.3 hcreate_r F
+GLIBC_2.3 hdestroy F
+GLIBC_2.3 hdestroy_r F
+GLIBC_2.3 herror F
+GLIBC_2.3 host2netname F
+GLIBC_2.3 hsearch F
+GLIBC_2.3 hsearch_r F
+GLIBC_2.3 hstrerror F
+GLIBC_2.3 htonl F
+GLIBC_2.3 htons F
+GLIBC_2.3 i386_get_ioperm F
+GLIBC_2.3 i386_get_ldt F
+GLIBC_2.3 i386_set_ioperm F
+GLIBC_2.3 i386_set_ldt F
+GLIBC_2.3 i386_vm86 F
+GLIBC_2.3 iconv F
+GLIBC_2.3 iconv_close F
+GLIBC_2.3 iconv_open F
+GLIBC_2.3 if_freenameindex F
+GLIBC_2.3 if_indextoname F
+GLIBC_2.3 if_nameindex F
+GLIBC_2.3 if_nametoindex F
+GLIBC_2.3 imaxabs F
+GLIBC_2.3 imaxdiv F
+GLIBC_2.3 in6addr_any D 0x10
+GLIBC_2.3 in6addr_loopback D 0x10
+GLIBC_2.3 index F
+GLIBC_2.3 inet_addr F
+GLIBC_2.3 inet_aton F
+GLIBC_2.3 inet_lnaof F
+GLIBC_2.3 inet_makeaddr F
+GLIBC_2.3 inet_netof F
+GLIBC_2.3 inet_network F
+GLIBC_2.3 inet_nsap_addr F
+GLIBC_2.3 inet_nsap_ntoa F
+GLIBC_2.3 inet_ntoa F
+GLIBC_2.3 inet_ntop F
+GLIBC_2.3 inet_pton F
+GLIBC_2.3 initgroups F
+GLIBC_2.3 initstate F
+GLIBC_2.3 initstate_r F
+GLIBC_2.3 innetgr F
+GLIBC_2.3 insque F
+GLIBC_2.3 ioctl F
+GLIBC_2.3 ioperm F
+GLIBC_2.3 iopl F
+GLIBC_2.3 iruserok F
+GLIBC_2.3 iruserok_af F
+GLIBC_2.3 isalnum F
+GLIBC_2.3 isalnum_l F
+GLIBC_2.3 isalpha F
+GLIBC_2.3 isalpha_l F
+GLIBC_2.3 isascii F
+GLIBC_2.3 isastream F
+GLIBC_2.3 isatty F
+GLIBC_2.3 isblank F
+GLIBC_2.3 isblank_l F
+GLIBC_2.3 iscntrl F
+GLIBC_2.3 iscntrl_l F
+GLIBC_2.3 isctype F
+GLIBC_2.3 isdigit F
+GLIBC_2.3 isdigit_l F
+GLIBC_2.3 isfdtype F
+GLIBC_2.3 isgraph F
+GLIBC_2.3 isgraph_l F
+GLIBC_2.3 isinf F
+GLIBC_2.3 isinff F
+GLIBC_2.3 isinfl F
+GLIBC_2.3 islower F
+GLIBC_2.3 islower_l F
+GLIBC_2.3 isnan F
+GLIBC_2.3 isnanf F
+GLIBC_2.3 isnanl F
+GLIBC_2.3 isprint F
+GLIBC_2.3 isprint_l F
+GLIBC_2.3 ispunct F
+GLIBC_2.3 ispunct_l F
+GLIBC_2.3 issetugid F
+GLIBC_2.3 isspace F
+GLIBC_2.3 isspace_l F
+GLIBC_2.3 isupper F
+GLIBC_2.3 isupper_l F
+GLIBC_2.3 iswalnum F
+GLIBC_2.3 iswalnum_l F
+GLIBC_2.3 iswalpha F
+GLIBC_2.3 iswalpha_l F
+GLIBC_2.3 iswblank F
+GLIBC_2.3 iswblank_l F
+GLIBC_2.3 iswcntrl F
+GLIBC_2.3 iswcntrl_l F
+GLIBC_2.3 iswctype F
+GLIBC_2.3 iswctype_l F
+GLIBC_2.3 iswdigit F
+GLIBC_2.3 iswdigit_l F
+GLIBC_2.3 iswgraph F
+GLIBC_2.3 iswgraph_l F
+GLIBC_2.3 iswlower F
+GLIBC_2.3 iswlower_l F
+GLIBC_2.3 iswprint F
+GLIBC_2.3 iswprint_l F
+GLIBC_2.3 iswpunct F
+GLIBC_2.3 iswpunct_l F
+GLIBC_2.3 iswspace F
+GLIBC_2.3 iswspace_l F
+GLIBC_2.3 iswupper F
+GLIBC_2.3 iswupper_l F
+GLIBC_2.3 iswxdigit F
+GLIBC_2.3 iswxdigit_l F
+GLIBC_2.3 isxdigit F
+GLIBC_2.3 isxdigit_l F
+GLIBC_2.3 jail F
+GLIBC_2.3 jrand48 F
+GLIBC_2.3 jrand48_r F
+GLIBC_2.3 key_decryptsession F
+GLIBC_2.3 key_decryptsession_pk F
+GLIBC_2.3 key_encryptsession F
+GLIBC_2.3 key_encryptsession_pk F
+GLIBC_2.3 key_gendes F
+GLIBC_2.3 key_get_conv F
+GLIBC_2.3 key_secretkey_is_set F
+GLIBC_2.3 key_setnet F
+GLIBC_2.3 key_setsecret F
+GLIBC_2.3 kill F
+GLIBC_2.3 killpg F
+GLIBC_2.3 kldfind F
+GLIBC_2.3 kldfirstmod F
+GLIBC_2.3 kldload F
+GLIBC_2.3 kldnext F
+GLIBC_2.3 kldstat F
+GLIBC_2.3 kldsym F
+GLIBC_2.3 kldunload F
+GLIBC_2.3 kldunloadf F
+GLIBC_2.3 ktrace F
+GLIBC_2.3 l64a F
+GLIBC_2.3 labs F
+GLIBC_2.3 lchmod F
+GLIBC_2.3 lchown F
+GLIBC_2.3 lckpwdf F
+GLIBC_2.3 lcong48 F
+GLIBC_2.3 lcong48_r F
+GLIBC_2.3 ldexp F
+GLIBC_2.3 ldexpf F
+GLIBC_2.3 ldexpl F
+GLIBC_2.3 ldiv F
+GLIBC_2.3 lfind F
+GLIBC_2.3 lgetxattr F
+GLIBC_2.3 link F
+GLIBC_2.3 listen F
+GLIBC_2.3 listxattr F
+GLIBC_2.3 llabs F
+GLIBC_2.3 lldiv F
+GLIBC_2.3 llistxattr F
+GLIBC_2.3 loc1 D 0x4
+GLIBC_2.3 loc2 D 0x4
+GLIBC_2.3 localeconv F
+GLIBC_2.3 localtime F
+GLIBC_2.3 localtime_r F
+GLIBC_2.3 lockf F
+GLIBC_2.3 lockf64 F
+GLIBC_2.3 locs D 0x4
+GLIBC_2.3 longjmp F
+GLIBC_2.3 lrand48 F
+GLIBC_2.3 lrand48_r F
+GLIBC_2.3 lremovexattr F
+GLIBC_2.3 lsearch F
+GLIBC_2.3 lseek F
+GLIBC_2.3 lseek64 F
+GLIBC_2.3 lsetxattr F
+GLIBC_2.3 lutimes F
+GLIBC_2.3 madvise F
+GLIBC_2.3 makecontext F
+GLIBC_2.3 mallinfo F
+GLIBC_2.3 malloc F
+GLIBC_2.3 malloc_get_state F
+GLIBC_2.3 malloc_set_state F
+GLIBC_2.3 malloc_stats F
+GLIBC_2.3 malloc_trim F
+GLIBC_2.3 malloc_usable_size F
+GLIBC_2.3 mallopt F
+GLIBC_2.3 mallwatch D 0x4
+GLIBC_2.3 mblen F
+GLIBC_2.3 mbrlen F
+GLIBC_2.3 mbrtowc F
+GLIBC_2.3 mbsinit F
+GLIBC_2.3 mbsnrtowcs F
+GLIBC_2.3 mbsrtowcs F
+GLIBC_2.3 mbstowcs F
+GLIBC_2.3 mbtowc F
+GLIBC_2.3 mcheck F
+GLIBC_2.3 mcheck_check_all F
+GLIBC_2.3 mcheck_pedantic F
+GLIBC_2.3 mcount F
+GLIBC_2.3 memalign F
+GLIBC_2.3 memccpy F
+GLIBC_2.3 memchr F
+GLIBC_2.3 memcmp F
+GLIBC_2.3 memcpy F
+GLIBC_2.3 memfrob F
+GLIBC_2.3 memmem F
+GLIBC_2.3 memmove F
+GLIBC_2.3 mempcpy F
+GLIBC_2.3 memrchr F
+GLIBC_2.3 memset F
+GLIBC_2.3 mincore F
+GLIBC_2.3 minherit F
+GLIBC_2.3 mkdir F
+GLIBC_2.3 mkdtemp F
+GLIBC_2.3 mkfifo F
+GLIBC_2.3 mkstemp F
+GLIBC_2.3 mkstemp64 F
+GLIBC_2.3 mktemp F
+GLIBC_2.3 mktime F
+GLIBC_2.3 mlock F
+GLIBC_2.3 mlockall F
+GLIBC_2.3 mmap F
+GLIBC_2.3 mmap64 F
+GLIBC_2.3 modf F
+GLIBC_2.3 modff F
+GLIBC_2.3 modfind F
+GLIBC_2.3 modfl F
+GLIBC_2.3 modfnext F
+GLIBC_2.3 modnext F
+GLIBC_2.3 modstat F
+GLIBC_2.3 moncontrol F
+GLIBC_2.3 monstartup F
+GLIBC_2.3 mount F
+GLIBC_2.3 mprobe F
+GLIBC_2.3 mprotect F
+GLIBC_2.3 mrand48 F
+GLIBC_2.3 mrand48_r F
+GLIBC_2.3 msgctl F
+GLIBC_2.3 msgget F
+GLIBC_2.3 msgrcv F
+GLIBC_2.3 msgsnd F
+GLIBC_2.3 msync F
+GLIBC_2.3 mtrace F
+GLIBC_2.3 munlock F
+GLIBC_2.3 munlockall F
+GLIBC_2.3 munmap F
+GLIBC_2.3 muntrace F
+GLIBC_2.3 nanosleep F
+GLIBC_2.3 netname2host F
+GLIBC_2.3 netname2user F
+GLIBC_2.3 newlocale F
+GLIBC_2.3 nftw F
+GLIBC_2.3 nftw64 F
+GLIBC_2.3 ngettext F
+GLIBC_2.3 nice F
+GLIBC_2.3 nl_langinfo F
+GLIBC_2.3 nl_langinfo_l F
+GLIBC_2.3 nmount F
+GLIBC_2.3 nrand48 F
+GLIBC_2.3 nrand48_r F
+GLIBC_2.3 ntohl F
+GLIBC_2.3 ntohs F
+GLIBC_2.3 ntp_adjtime F
+GLIBC_2.3 ntp_gettime F
+GLIBC_2.3 obstack_alloc_failed_handler D 0x4
+GLIBC_2.3 obstack_exit_failure D 0x4
+GLIBC_2.3 obstack_free F
+GLIBC_2.3 obstack_printf F
+GLIBC_2.3 obstack_vprintf F
+GLIBC_2.3 on_exit F
+GLIBC_2.3 open F
+GLIBC_2.3 open64 F
+GLIBC_2.3 open_memstream F
+GLIBC_2.3 opendir F
+GLIBC_2.3 openlog F
+GLIBC_2.3 optarg D 0x4
+GLIBC_2.3 opterr D 0x4
+GLIBC_2.3 optind D 0x4
+GLIBC_2.3 optopt D 0x4
+GLIBC_2.3 parse_printf_format F
+GLIBC_2.3 passwd2des F
+GLIBC_2.3 pathconf F
+GLIBC_2.3 pause F
+GLIBC_2.3 pclose F
+GLIBC_2.3 perror F
+GLIBC_2.3 pipe F
+GLIBC_2.3 pmap_getmaps F
+GLIBC_2.3 pmap_getport F
+GLIBC_2.3 pmap_rmtcall F
+GLIBC_2.3 pmap_set F
+GLIBC_2.3 pmap_unset F
+GLIBC_2.3 poll F
+GLIBC_2.3 popen F
+GLIBC_2.3 posix_fadvise F
+GLIBC_2.3 posix_fadvise64 F
+GLIBC_2.3 posix_fallocate F
+GLIBC_2.3 posix_fallocate64 F
+GLIBC_2.3 posix_madvise F
+GLIBC_2.3 posix_memalign F
+GLIBC_2.3 posix_openpt F
+GLIBC_2.3 posix_spawn F
+GLIBC_2.3 posix_spawn_file_actions_addclose F
+GLIBC_2.3 posix_spawn_file_actions_adddup2 F
+GLIBC_2.3 posix_spawn_file_actions_addopen F
+GLIBC_2.3 posix_spawn_file_actions_destroy F
+GLIBC_2.3 posix_spawn_file_actions_init F
+GLIBC_2.3 posix_spawnattr_destroy F
+GLIBC_2.3 posix_spawnattr_getflags F
+GLIBC_2.3 posix_spawnattr_getpgroup F
+GLIBC_2.3 posix_spawnattr_getschedparam F
+GLIBC_2.3 posix_spawnattr_getschedpolicy F
+GLIBC_2.3 posix_spawnattr_getsigdefault F
+GLIBC_2.3 posix_spawnattr_getsigmask F
+GLIBC_2.3 posix_spawnattr_init F
+GLIBC_2.3 posix_spawnattr_setflags F
+GLIBC_2.3 posix_spawnattr_setpgroup F
+GLIBC_2.3 posix_spawnattr_setschedparam F
+GLIBC_2.3 posix_spawnattr_setschedpolicy F
+GLIBC_2.3 posix_spawnattr_setsigdefault F
+GLIBC_2.3 posix_spawnattr_setsigmask F
+GLIBC_2.3 posix_spawnp F
+GLIBC_2.3 pread F
+GLIBC_2.3 pread64 F
+GLIBC_2.3 printf F
+GLIBC_2.3 printf_size F
+GLIBC_2.3 printf_size_info F
+GLIBC_2.3 profil F
+GLIBC_2.3 program_invocation_name D 0x4
+GLIBC_2.3 program_invocation_short_name D 0x4
+GLIBC_2.3 pselect F
+GLIBC_2.3 psignal F
+GLIBC_2.3 pthread_attr_destroy F
+GLIBC_2.3 pthread_attr_getdetachstate F
+GLIBC_2.3 pthread_attr_getinheritsched F
+GLIBC_2.3 pthread_attr_getschedparam F
+GLIBC_2.3 pthread_attr_getschedpolicy F
+GLIBC_2.3 pthread_attr_getscope F
+GLIBC_2.3 pthread_attr_init F
+GLIBC_2.3 pthread_attr_setdetachstate F
+GLIBC_2.3 pthread_attr_setinheritsched F
+GLIBC_2.3 pthread_attr_setschedparam F
+GLIBC_2.3 pthread_attr_setschedpolicy F
+GLIBC_2.3 pthread_attr_setscope F
+GLIBC_2.3 pthread_cond_broadcast F
+GLIBC_2.3 pthread_cond_destroy F
+GLIBC_2.3 pthread_cond_init F
+GLIBC_2.3 pthread_cond_signal F
+GLIBC_2.3 pthread_cond_timedwait F
+GLIBC_2.3 pthread_cond_wait F
+GLIBC_2.3 pthread_condattr_destroy F
+GLIBC_2.3 pthread_condattr_init F
+GLIBC_2.3 pthread_equal F
+GLIBC_2.3 pthread_exit F
+GLIBC_2.3 pthread_getschedparam F
+GLIBC_2.3 pthread_mutex_destroy F
+GLIBC_2.3 pthread_mutex_init F
+GLIBC_2.3 pthread_mutex_lock F
+GLIBC_2.3 pthread_mutex_unlock F
+GLIBC_2.3 pthread_self F
+GLIBC_2.3 pthread_setcancelstate F
+GLIBC_2.3 pthread_setcanceltype F
+GLIBC_2.3 pthread_setschedparam F
+GLIBC_2.3 ptrace F
+GLIBC_2.3 ptsname F
+GLIBC_2.3 ptsname_r F
+GLIBC_2.3 putc F
+GLIBC_2.3 putc_unlocked F
+GLIBC_2.3 putchar F
+GLIBC_2.3 putchar_unlocked F
+GLIBC_2.3 putenv F
+GLIBC_2.3 putgrent F
+GLIBC_2.3 putmsg F
+GLIBC_2.3 putpmsg F
+GLIBC_2.3 putpwent F
+GLIBC_2.3 puts F
+GLIBC_2.3 putspent F
+GLIBC_2.3 pututline F
+GLIBC_2.3 pututxline F
+GLIBC_2.3 putw F
+GLIBC_2.3 putwc F
+GLIBC_2.3 putwc_unlocked F
+GLIBC_2.3 putwchar F
+GLIBC_2.3 putwchar_unlocked F
+GLIBC_2.3 pvalloc F
+GLIBC_2.3 pwrite F
+GLIBC_2.3 pwrite64 F
+GLIBC_2.3 qecvt F
+GLIBC_2.3 qecvt_r F
+GLIBC_2.3 qfcvt F
+GLIBC_2.3 qfcvt_r F
+GLIBC_2.3 qgcvt F
+GLIBC_2.3 qsort F
+GLIBC_2.3 quotactl F
+GLIBC_2.3 raise F
+GLIBC_2.3 rand F
+GLIBC_2.3 rand_r F
+GLIBC_2.3 random F
+GLIBC_2.3 random_r F
+GLIBC_2.3 rawmemchr F
+GLIBC_2.3 rcmd F
+GLIBC_2.3 rcmd_af F
+GLIBC_2.3 re_comp F
+GLIBC_2.3 re_compile_fastmap F
+GLIBC_2.3 re_compile_pattern F
+GLIBC_2.3 re_exec F
+GLIBC_2.3 re_match F
+GLIBC_2.3 re_match_2 F
+GLIBC_2.3 re_search F
+GLIBC_2.3 re_search_2 F
+GLIBC_2.3 re_set_registers F
+GLIBC_2.3 re_set_syntax F
+GLIBC_2.3 re_syntax_options D 0x4
+GLIBC_2.3 read F
+GLIBC_2.3 readdir F
+GLIBC_2.3 readdir64 F
+GLIBC_2.3 readdir64_r F
+GLIBC_2.3 readdir_r F
+GLIBC_2.3 readlink F
+GLIBC_2.3 readv F
+GLIBC_2.3 realloc F
+GLIBC_2.3 realpath F
+GLIBC_2.3 reboot F
+GLIBC_2.3 recv F
+GLIBC_2.3 recvfrom F
+GLIBC_2.3 recvmsg F
+GLIBC_2.3 regcomp F
+GLIBC_2.3 regerror F
+GLIBC_2.3 regexec F
+GLIBC_2.3 regfree F
+GLIBC_2.3 register_printf_function F
+GLIBC_2.3 registerrpc F
+GLIBC_2.3 remove F
+GLIBC_2.3 removexattr F
+GLIBC_2.3 remque F
+GLIBC_2.3 rename F
+GLIBC_2.3 revoke F
+GLIBC_2.3 rewind F
+GLIBC_2.3 rewinddir F
+GLIBC_2.3 rexec F
+GLIBC_2.3 rexec_af F
+GLIBC_2.3 rexecoptions D 0x4
+GLIBC_2.3 rfork F
+GLIBC_2.3 rindex F
+GLIBC_2.3 rmdir F
+GLIBC_2.3 rpc_createerr D 0x10
+GLIBC_2.3 rpmatch F
+GLIBC_2.3 rresvport F
+GLIBC_2.3 rresvport_af F
+GLIBC_2.3 rtime F
+GLIBC_2.3 rtprio F
+GLIBC_2.3 ruserok F
+GLIBC_2.3 ruserok_af F
+GLIBC_2.3 ruserpass F
+GLIBC_2.3 sbrk F
+GLIBC_2.3 scalbln F
+GLIBC_2.3 scalblnf F
+GLIBC_2.3 scalblnl F
+GLIBC_2.3 scalbn F
+GLIBC_2.3 scalbnf F
+GLIBC_2.3 scalbnl F
+GLIBC_2.3 scandir F
+GLIBC_2.3 scandir64 F
+GLIBC_2.3 scanf F
+GLIBC_2.3 sched_get_priority_max F
+GLIBC_2.3 sched_get_priority_min F
+GLIBC_2.3 sched_getparam F
+GLIBC_2.3 sched_getscheduler F
+GLIBC_2.3 sched_rr_get_interval F
+GLIBC_2.3 sched_setparam F
+GLIBC_2.3 sched_setscheduler F
+GLIBC_2.3 sched_yield F
+GLIBC_2.3 seed48 F
+GLIBC_2.3 seed48_r F
+GLIBC_2.3 seekdir F
+GLIBC_2.3 select F
+GLIBC_2.3 semctl F
+GLIBC_2.3 semget F
+GLIBC_2.3 semop F
+GLIBC_2.3 send F
+GLIBC_2.3 sendfile F
+GLIBC_2.3 sendfile64 F
+GLIBC_2.3 sendmsg F
+GLIBC_2.3 sendto F
+GLIBC_2.3 setaliasent F
+GLIBC_2.3 setbuf F
+GLIBC_2.3 setbuffer F
+GLIBC_2.3 setcontext F
+GLIBC_2.3 setdomainname F
+GLIBC_2.3 setegid F
+GLIBC_2.3 setenv F
+GLIBC_2.3 seteuid F
+GLIBC_2.3 setfsent F
+GLIBC_2.3 setgid F
+GLIBC_2.3 setgrent F
+GLIBC_2.3 setgroups F
+GLIBC_2.3 sethostent F
+GLIBC_2.3 sethostid F
+GLIBC_2.3 sethostname F
+GLIBC_2.3 setitimer F
+GLIBC_2.3 setjmp F
+GLIBC_2.3 setlinebuf F
+GLIBC_2.3 setlocale F
+GLIBC_2.3 setlogin F
+GLIBC_2.3 setlogmask F
+GLIBC_2.3 setmntent F
+GLIBC_2.3 setnetent F
+GLIBC_2.3 setnetgrent F
+GLIBC_2.3 setpgid F
+GLIBC_2.3 setpgrp F
+GLIBC_2.3 setpriority F
+GLIBC_2.3 setprotoent F
+GLIBC_2.3 setpwent F
+GLIBC_2.3 setregid F
+GLIBC_2.3 setresgid F
+GLIBC_2.3 setresuid F
+GLIBC_2.3 setreuid F
+GLIBC_2.3 setrlimit F
+GLIBC_2.3 setrlimit64 F
+GLIBC_2.3 setrpcent F
+GLIBC_2.3 setservent F
+GLIBC_2.3 setsid F
+GLIBC_2.3 setsockopt F
+GLIBC_2.3 setspent F
+GLIBC_2.3 setstate F
+GLIBC_2.3 setstate_r F
+GLIBC_2.3 settimeofday F
+GLIBC_2.3 setttyent F
+GLIBC_2.3 setuid F
+GLIBC_2.3 setusershell F
+GLIBC_2.3 setutent F
+GLIBC_2.3 setutxent F
+GLIBC_2.3 setvbuf F
+GLIBC_2.3 setxattr F
+GLIBC_2.3 sgetspent F
+GLIBC_2.3 sgetspent_r F
+GLIBC_2.3 shmat F
+GLIBC_2.3 shmctl F
+GLIBC_2.3 shmdt F
+GLIBC_2.3 shmget F
+GLIBC_2.3 shutdown F
+GLIBC_2.3 sigaction F
+GLIBC_2.3 sigaddset F
+GLIBC_2.3 sigaltstack F
+GLIBC_2.3 sigandset F
+GLIBC_2.3 sigblock F
+GLIBC_2.3 sigdelset F
+GLIBC_2.3 sigemptyset F
+GLIBC_2.3 sigfillset F
+GLIBC_2.3 siggetmask F
+GLIBC_2.3 sighold F
+GLIBC_2.3 sigignore F
+GLIBC_2.3 siginterrupt F
+GLIBC_2.3 sigisemptyset F
+GLIBC_2.3 sigismember F
+GLIBC_2.3 siglongjmp F
+GLIBC_2.3 signal F
+GLIBC_2.3 sigorset F
+GLIBC_2.3 sigpause F
+GLIBC_2.3 sigpending F
+GLIBC_2.3 sigprocmask F
+GLIBC_2.3 sigqueue F
+GLIBC_2.3 sigrelse F
+GLIBC_2.3 sigreturn F
+GLIBC_2.3 sigset F
+GLIBC_2.3 sigsetmask F
+GLIBC_2.3 sigstack F
+GLIBC_2.3 sigsuspend F
+GLIBC_2.3 sigtimedwait F
+GLIBC_2.3 sigvec F
+GLIBC_2.3 sigwait F
+GLIBC_2.3 sigwaitinfo F
+GLIBC_2.3 sleep F
+GLIBC_2.3 snprintf F
+GLIBC_2.3 sockatmark F
+GLIBC_2.3 socket F
+GLIBC_2.3 socketpair F
+GLIBC_2.3 sprintf F
+GLIBC_2.3 sprofil F
+GLIBC_2.3 srand F
+GLIBC_2.3 srand48 F
+GLIBC_2.3 srand48_r F
+GLIBC_2.3 srandom F
+GLIBC_2.3 srandom_r F
+GLIBC_2.3 sscanf F
+GLIBC_2.3 ssignal F
+GLIBC_2.3 sstk F
+GLIBC_2.3 statfs F
+GLIBC_2.3 statfs64 F
+GLIBC_2.3 statvfs F
+GLIBC_2.3 statvfs64 F
+GLIBC_2.3 stderr D 0x4
+GLIBC_2.3 stdin D 0x4
+GLIBC_2.3 stdout D 0x4
+GLIBC_2.3 step F
+GLIBC_2.3 stime F
+GLIBC_2.3 stpcpy F
+GLIBC_2.3 stpncpy F
+GLIBC_2.3 strcasecmp F
+GLIBC_2.3 strcasecmp_l F
+GLIBC_2.3 strcasestr F
+GLIBC_2.3 strcat F
+GLIBC_2.3 strchr F
+GLIBC_2.3 strchrnul F
+GLIBC_2.3 strcmp F
+GLIBC_2.3 strcoll F
+GLIBC_2.3 strcoll_l F
+GLIBC_2.3 strcpy F
+GLIBC_2.3 strcspn F
+GLIBC_2.3 strdup F
+GLIBC_2.3 strerror F
+GLIBC_2.3 strerror_r F
+GLIBC_2.3 strfmon F
+GLIBC_2.3 strfmon_l F
+GLIBC_2.3 strfry F
+GLIBC_2.3 strftime F
+GLIBC_2.3 strftime_l F
+GLIBC_2.3 strlen F
+GLIBC_2.3 strncasecmp F
+GLIBC_2.3 strncasecmp_l F
+GLIBC_2.3 strncat F
+GLIBC_2.3 strncmp F
+GLIBC_2.3 strncpy F
+GLIBC_2.3 strndup F
+GLIBC_2.3 strnlen F
+GLIBC_2.3 strpbrk F
+GLIBC_2.3 strptime F
+GLIBC_2.3 strrchr F
+GLIBC_2.3 strsep F
+GLIBC_2.3 strsignal F
+GLIBC_2.3 strspn F
+GLIBC_2.3 strstr F
+GLIBC_2.3 strtod F
+GLIBC_2.3 strtod_l F
+GLIBC_2.3 strtof F
+GLIBC_2.3 strtof_l F
+GLIBC_2.3 strtoimax F
+GLIBC_2.3 strtok F
+GLIBC_2.3 strtok_r F
+GLIBC_2.3 strtol F
+GLIBC_2.3 strtol_l F
+GLIBC_2.3 strtold F
+GLIBC_2.3 strtold_l F
+GLIBC_2.3 strtoll F
+GLIBC_2.3 strtoll_l F
+GLIBC_2.3 strtoq F
+GLIBC_2.3 strtoul F
+GLIBC_2.3 strtoul_l F
+GLIBC_2.3 strtoull F
+GLIBC_2.3 strtoull_l F
+GLIBC_2.3 strtoumax F
+GLIBC_2.3 strtouq F
+GLIBC_2.3 strverscmp F
+GLIBC_2.3 strxfrm F
+GLIBC_2.3 strxfrm_l F
+GLIBC_2.3 stty F
+GLIBC_2.3 svc_exit F
+GLIBC_2.3 svc_fdset D 0x80
+GLIBC_2.3 svc_getreq F
+GLIBC_2.3 svc_getreq_common F
+GLIBC_2.3 svc_getreq_poll F
+GLIBC_2.3 svc_getreqset F
+GLIBC_2.3 svc_max_pollfd D 0x4
+GLIBC_2.3 svc_pollfd D 0x4
+GLIBC_2.3 svc_register F
+GLIBC_2.3 svc_run F
+GLIBC_2.3 svc_sendreply F
+GLIBC_2.3 svc_unregister F
+GLIBC_2.3 svcauthdes_stats D 0xc
+GLIBC_2.3 svcerr_auth F
+GLIBC_2.3 svcerr_decode F
+GLIBC_2.3 svcerr_noproc F
+GLIBC_2.3 svcerr_noprog F
+GLIBC_2.3 svcerr_progvers F
+GLIBC_2.3 svcerr_systemerr F
+GLIBC_2.3 svcerr_weakauth F
+GLIBC_2.3 svcfd_create F
+GLIBC_2.3 svcraw_create F
+GLIBC_2.3 svctcp_create F
+GLIBC_2.3 svcudp_bufcreate F
+GLIBC_2.3 svcudp_create F
+GLIBC_2.3 svcudp_enablecache F
+GLIBC_2.3 svcunix_create F
+GLIBC_2.3 svcunixfd_create F
+GLIBC_2.3 swab F
+GLIBC_2.3 swapcontext F
+GLIBC_2.3 swapoff F
+GLIBC_2.3 swapon F
+GLIBC_2.3 swprintf F
+GLIBC_2.3 swscanf F
+GLIBC_2.3 symlink F
+GLIBC_2.3 sync F
+GLIBC_2.3 sys_errlist D 0x15c
+GLIBC_2.3 sys_nerr D 0x4
+GLIBC_2.3 sys_sigabbrev D 0x204
+GLIBC_2.3 sys_siglist D 0x204
+GLIBC_2.3 sysarch F
+GLIBC_2.3 syscall F
+GLIBC_2.3 sysconf F
+GLIBC_2.3 sysctl F
+GLIBC_2.3 sysctlbyname F
+GLIBC_2.3 syslog F
+GLIBC_2.3 system F
+GLIBC_2.3 sysv_signal F
+GLIBC_2.3 tcdrain F
+GLIBC_2.3 tcflow F
+GLIBC_2.3 tcflush F
+GLIBC_2.3 tcgetattr F
+GLIBC_2.3 tcgetpgrp F
+GLIBC_2.3 tcgetsid F
+GLIBC_2.3 tcsendbreak F
+GLIBC_2.3 tcsetattr F
+GLIBC_2.3 tcsetpgrp F
+GLIBC_2.3 tdelete F
+GLIBC_2.3 tdestroy F
+GLIBC_2.3 telldir F
+GLIBC_2.3 tempnam F
+GLIBC_2.3 textdomain F
+GLIBC_2.3 tfind F
+GLIBC_2.3 time F
+GLIBC_2.3 timegm F
+GLIBC_2.3 timelocal F
+GLIBC_2.3 times F
+GLIBC_2.3 timezone D 0x4
+GLIBC_2.3 tmpfile F
+GLIBC_2.3 tmpfile64 F
+GLIBC_2.3 tmpnam F
+GLIBC_2.3 tmpnam_r F
+GLIBC_2.3 toascii F
+GLIBC_2.3 tolower F
+GLIBC_2.3 tolower_l F
+GLIBC_2.3 toupper F
+GLIBC_2.3 toupper_l F
+GLIBC_2.3 towctrans F
+GLIBC_2.3 towctrans_l F
+GLIBC_2.3 towlower F
+GLIBC_2.3 towlower_l F
+GLIBC_2.3 towupper F
+GLIBC_2.3 towupper_l F
+GLIBC_2.3 tr_break F
+GLIBC_2.3 truncate F
+GLIBC_2.3 truncate64 F
+GLIBC_2.3 tsearch F
+GLIBC_2.3 ttyname F
+GLIBC_2.3 ttyname_r F
+GLIBC_2.3 ttyslot F
+GLIBC_2.3 twalk F
+GLIBC_2.3 tzname D 0x8
+GLIBC_2.3 tzset F
+GLIBC_2.3 ualarm F
+GLIBC_2.3 ulckpwdf F
+GLIBC_2.3 ulimit F
+GLIBC_2.3 umask F
+GLIBC_2.3 uname F
+GLIBC_2.3 undelete F
+GLIBC_2.3 ungetc F
+GLIBC_2.3 ungetwc F
+GLIBC_2.3 unlink F
+GLIBC_2.3 unlockpt F
+GLIBC_2.3 unmount F
+GLIBC_2.3 unsetenv F
+GLIBC_2.3 updwtmp F
+GLIBC_2.3 updwtmpx F
+GLIBC_2.3 uselocale F
+GLIBC_2.3 user2netname F
+GLIBC_2.3 usleep F
+GLIBC_2.3 ustat F
+GLIBC_2.3 utime F
+GLIBC_2.3 utimes F
+GLIBC_2.3 utmpname F
+GLIBC_2.3 utmpxname F
+GLIBC_2.3 utrace F
+GLIBC_2.3 valloc F
+GLIBC_2.3 vasprintf F
+GLIBC_2.3 vdprintf F
+GLIBC_2.3 verr F
+GLIBC_2.3 verrx F
+GLIBC_2.3 versionsort F
+GLIBC_2.3 versionsort64 F
+GLIBC_2.3 vfork F
+GLIBC_2.3 vfprintf F
+GLIBC_2.3 vfscanf F
+GLIBC_2.3 vfwprintf F
+GLIBC_2.3 vfwscanf F
+GLIBC_2.3 vhangup F
+GLIBC_2.3 vlimit F
+GLIBC_2.3 vprintf F
+GLIBC_2.3 vscanf F
+GLIBC_2.3 vsnprintf F
+GLIBC_2.3 vsprintf F
+GLIBC_2.3 vsscanf F
+GLIBC_2.3 vswprintf F
+GLIBC_2.3 vswscanf F
+GLIBC_2.3 vsyslog F
+GLIBC_2.3 vtimes F
+GLIBC_2.3 vwarn F
+GLIBC_2.3 vwarnx F
+GLIBC_2.3 vwprintf F
+GLIBC_2.3 vwscanf F
+GLIBC_2.3 wait F
+GLIBC_2.3 wait3 F
+GLIBC_2.3 wait4 F
+GLIBC_2.3 waitid F
+GLIBC_2.3 waitpid F
+GLIBC_2.3 warn F
+GLIBC_2.3 warnx F
+GLIBC_2.3 wcpcpy F
+GLIBC_2.3 wcpncpy F
+GLIBC_2.3 wcrtomb F
+GLIBC_2.3 wcscasecmp F
+GLIBC_2.3 wcscasecmp_l F
+GLIBC_2.3 wcscat F
+GLIBC_2.3 wcschr F
+GLIBC_2.3 wcschrnul F
+GLIBC_2.3 wcscmp F
+GLIBC_2.3 wcscoll F
+GLIBC_2.3 wcscoll_l F
+GLIBC_2.3 wcscpy F
+GLIBC_2.3 wcscspn F
+GLIBC_2.3 wcsdup F
+GLIBC_2.3 wcsftime F
+GLIBC_2.3 wcsftime_l F
+GLIBC_2.3 wcslen F
+GLIBC_2.3 wcsncasecmp F
+GLIBC_2.3 wcsncasecmp_l F
+GLIBC_2.3 wcsncat F
+GLIBC_2.3 wcsncmp F
+GLIBC_2.3 wcsncpy F
+GLIBC_2.3 wcsnlen F
+GLIBC_2.3 wcsnrtombs F
+GLIBC_2.3 wcspbrk F
+GLIBC_2.3 wcsrchr F
+GLIBC_2.3 wcsrtombs F
+GLIBC_2.3 wcsspn F
+GLIBC_2.3 wcsstr F
+GLIBC_2.3 wcstod F
+GLIBC_2.3 wcstod_l F
+GLIBC_2.3 wcstof F
+GLIBC_2.3 wcstof_l F
+GLIBC_2.3 wcstoimax F
+GLIBC_2.3 wcstok F
+GLIBC_2.3 wcstol F
+GLIBC_2.3 wcstol_l F
+GLIBC_2.3 wcstold F
+GLIBC_2.3 wcstold_l F
+GLIBC_2.3 wcstoll F
+GLIBC_2.3 wcstoll_l F
+GLIBC_2.3 wcstombs F
+GLIBC_2.3 wcstoq F
+GLIBC_2.3 wcstoul F
+GLIBC_2.3 wcstoul_l F
+GLIBC_2.3 wcstoull F
+GLIBC_2.3 wcstoull_l F
+GLIBC_2.3 wcstoumax F
+GLIBC_2.3 wcstouq F
+GLIBC_2.3 wcswcs F
+GLIBC_2.3 wcswidth F
+GLIBC_2.3 wcsxfrm F
+GLIBC_2.3 wcsxfrm_l F
+GLIBC_2.3 wctob F
+GLIBC_2.3 wctomb F
+GLIBC_2.3 wctrans F
+GLIBC_2.3 wctrans_l F
+GLIBC_2.3 wctype F
+GLIBC_2.3 wctype_l F
+GLIBC_2.3 wcwidth F
+GLIBC_2.3 wmemchr F
+GLIBC_2.3 wmemcmp F
+GLIBC_2.3 wmemcpy F
+GLIBC_2.3 wmemmove F
+GLIBC_2.3 wmempcpy F
+GLIBC_2.3 wmemset F
+GLIBC_2.3 wordexp F
+GLIBC_2.3 wordfree F
+GLIBC_2.3 wprintf F
+GLIBC_2.3 write F
+GLIBC_2.3 writev F
+GLIBC_2.3 wscanf F
+GLIBC_2.3 xdecrypt F
+GLIBC_2.3 xdr_accepted_reply F
+GLIBC_2.3 xdr_array F
+GLIBC_2.3 xdr_authdes_cred F
+GLIBC_2.3 xdr_authdes_verf F
+GLIBC_2.3 xdr_authunix_parms F
+GLIBC_2.3 xdr_bool F
+GLIBC_2.3 xdr_bytes F
+GLIBC_2.3 xdr_callhdr F
+GLIBC_2.3 xdr_callmsg F
+GLIBC_2.3 xdr_char F
+GLIBC_2.3 xdr_cryptkeyarg F
+GLIBC_2.3 xdr_cryptkeyarg2 F
+GLIBC_2.3 xdr_cryptkeyres F
+GLIBC_2.3 xdr_des_block F
+GLIBC_2.3 xdr_double F
+GLIBC_2.3 xdr_enum F
+GLIBC_2.3 xdr_float F
+GLIBC_2.3 xdr_free F
+GLIBC_2.3 xdr_getcredres F
+GLIBC_2.3 xdr_hyper F
+GLIBC_2.3 xdr_int F
+GLIBC_2.3 xdr_int16_t F
+GLIBC_2.3 xdr_int32_t F
+GLIBC_2.3 xdr_int64_t F
+GLIBC_2.3 xdr_int8_t F
+GLIBC_2.3 xdr_key_netstarg F
+GLIBC_2.3 xdr_key_netstres F
+GLIBC_2.3 xdr_keybuf F
+GLIBC_2.3 xdr_keystatus F
+GLIBC_2.3 xdr_long F
+GLIBC_2.3 xdr_longlong_t F
+GLIBC_2.3 xdr_netnamestr F
+GLIBC_2.3 xdr_netobj F
+GLIBC_2.3 xdr_opaque F
+GLIBC_2.3 xdr_opaque_auth F
+GLIBC_2.3 xdr_pmap F
+GLIBC_2.3 xdr_pmaplist F
+GLIBC_2.3 xdr_pointer F
+GLIBC_2.3 xdr_reference F
+GLIBC_2.3 xdr_rejected_reply F
+GLIBC_2.3 xdr_replymsg F
+GLIBC_2.3 xdr_rmtcall_args F
+GLIBC_2.3 xdr_rmtcallres F
+GLIBC_2.3 xdr_short F
+GLIBC_2.3 xdr_sizeof F
+GLIBC_2.3 xdr_string F
+GLIBC_2.3 xdr_u_char F
+GLIBC_2.3 xdr_u_hyper F
+GLIBC_2.3 xdr_u_int F
+GLIBC_2.3 xdr_u_long F
+GLIBC_2.3 xdr_u_longlong_t F
+GLIBC_2.3 xdr_u_short F
+GLIBC_2.3 xdr_uint16_t F
+GLIBC_2.3 xdr_uint32_t F
+GLIBC_2.3 xdr_uint64_t F
+GLIBC_2.3 xdr_uint8_t F
+GLIBC_2.3 xdr_union F
+GLIBC_2.3 xdr_unixcred F
+GLIBC_2.3 xdr_vector F
+GLIBC_2.3 xdr_void F
+GLIBC_2.3 xdr_wrapstring F
+GLIBC_2.3 xdrmem_create F
+GLIBC_2.3 xdrrec_create F
+GLIBC_2.3 xdrrec_endofrecord F
+GLIBC_2.3 xdrrec_eof F
+GLIBC_2.3 xdrrec_skiprecord F
+GLIBC_2.3 xdrstdio_create F
+GLIBC_2.3 xencrypt F
+GLIBC_2.3 xprt_register F
+GLIBC_2.3 xprt_unregister F
+GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.3.2 __register_atfork F
+GLIBC_2.3.2 pthread_cond_broadcast F
+GLIBC_2.3.2 pthread_cond_destroy F
+GLIBC_2.3.2 pthread_cond_init F
+GLIBC_2.3.2 pthread_cond_signal F
+GLIBC_2.3.2 pthread_cond_timedwait F
+GLIBC_2.3.2 pthread_cond_wait F
+GLIBC_2.3.2 strptime_l F
+GLIBC_2.3.3 GLIBC_2.3.3 A
+GLIBC_2.3.3 inet6_option_alloc F
+GLIBC_2.3.3 inet6_option_append F
+GLIBC_2.3.3 inet6_option_find F
+GLIBC_2.3.3 inet6_option_init F
+GLIBC_2.3.3 inet6_option_next F
+GLIBC_2.3.3 inet6_option_space F
+GLIBC_2.3.3 nftw F
+GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 posix_fallocate64 F
+GLIBC_2.3.3 remap_file_pages F
+GLIBC_2.3.3 sched_getaffinity F
+GLIBC_2.3.3 sched_setaffinity F
+GLIBC_2.3.3 semtimedop F
+GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.3.4 __chk_fail F
+GLIBC_2.3.4 __fprintf_chk F
+GLIBC_2.3.4 __gets_chk F
+GLIBC_2.3.4 __libc_sa_len F
+GLIBC_2.3.4 __memcpy_chk F
+GLIBC_2.3.4 __memmove_chk F
+GLIBC_2.3.4 __mempcpy_chk F
+GLIBC_2.3.4 __memset_chk F
+GLIBC_2.3.4 __printf_chk F
+GLIBC_2.3.4 __snprintf_chk F
+GLIBC_2.3.4 __sprintf_chk F
+GLIBC_2.3.4 __stpcpy_chk F
+GLIBC_2.3.4 __strcat_chk F
+GLIBC_2.3.4 __strcpy_chk F
+GLIBC_2.3.4 __strncat_chk F
+GLIBC_2.3.4 __strncpy_chk F
+GLIBC_2.3.4 __vfprintf_chk F
+GLIBC_2.3.4 __vprintf_chk F
+GLIBC_2.3.4 __vsnprintf_chk F
+GLIBC_2.3.4 __vsprintf_chk F
+GLIBC_2.3.4 __xpg_strerror_r F
+GLIBC_2.3.4 _sys_errlist D 0x174
+GLIBC_2.3.4 _sys_nerr D 0x4
+GLIBC_2.3.4 fhstat64 F
+GLIBC_2.3.4 fhstatfs64 F
+GLIBC_2.3.4 getipv4sourcefilter F
+GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 kevent F
+GLIBC_2.3.4 kqueue F
+GLIBC_2.3.4 regexec F
+GLIBC_2.3.4 setipv4sourcefilter F
+GLIBC_2.3.4 setsourcefilter F
+GLIBC_2.3.4 sys_errlist D 0x174
+GLIBC_2.3.4 sys_nerr D 0x4
+GLIBC_2.3.4 xdr_quad_t F
+GLIBC_2.3.4 xdr_u_quad_t F
+GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.4 __confstr_chk F
+GLIBC_2.4 __fgets_chk F
+GLIBC_2.4 __fgets_unlocked_chk F
+GLIBC_2.4 __fgetws_chk F
+GLIBC_2.4 __fgetws_unlocked_chk F
+GLIBC_2.4 __fwprintf_chk F
+GLIBC_2.4 __fxstatat F
+GLIBC_2.4 __fxstatat64 F
+GLIBC_2.4 __getcwd_chk F
+GLIBC_2.4 __getdomainname_chk F
+GLIBC_2.4 __getgroups_chk F
+GLIBC_2.4 __gethostname_chk F
+GLIBC_2.4 __getlogin_r_chk F
+GLIBC_2.4 __getwd_chk F
+GLIBC_2.4 __mbsnrtowcs_chk F
+GLIBC_2.4 __mbsrtowcs_chk F
+GLIBC_2.4 __mbstowcs_chk F
+GLIBC_2.4 __pread64_chk F
+GLIBC_2.4 __pread_chk F
+GLIBC_2.4 __ptsname_r_chk F
+GLIBC_2.4 __read_chk F
+GLIBC_2.4 __readlink_chk F
+GLIBC_2.4 __realpath_chk F
+GLIBC_2.4 __recv_chk F
+GLIBC_2.4 __recvfrom_chk F
+GLIBC_2.4 __stack_chk_fail F
+GLIBC_2.4 __stpncpy_chk F
+GLIBC_2.4 __swprintf_chk F
+GLIBC_2.4 __syslog_chk F
+GLIBC_2.4 __ttyname_r_chk F
+GLIBC_2.4 __vfwprintf_chk F
+GLIBC_2.4 __vswprintf_chk F
+GLIBC_2.4 __vsyslog_chk F
+GLIBC_2.4 __vwprintf_chk F
+GLIBC_2.4 __wcpcpy_chk F
+GLIBC_2.4 __wcpncpy_chk F
+GLIBC_2.4 __wcrtomb_chk F
+GLIBC_2.4 __wcscat_chk F
+GLIBC_2.4 __wcscpy_chk F
+GLIBC_2.4 __wcsncat_chk F
+GLIBC_2.4 __wcsncpy_chk F
+GLIBC_2.4 __wcsnrtombs_chk F
+GLIBC_2.4 __wcsrtombs_chk F
+GLIBC_2.4 __wcstombs_chk F
+GLIBC_2.4 __wctomb_chk F
+GLIBC_2.4 __wmemcpy_chk F
+GLIBC_2.4 __wmemmove_chk F
+GLIBC_2.4 __wmempcpy_chk F
+GLIBC_2.4 __wmemset_chk F
+GLIBC_2.4 __wprintf_chk F
+GLIBC_2.4 __xmknodat F
+GLIBC_2.4 eaccess F
+GLIBC_2.4 faccessat F
+GLIBC_2.4 fchmodat F
+GLIBC_2.4 fchownat F
+GLIBC_2.4 fdopendir F
+GLIBC_2.4 futimesat F
+GLIBC_2.4 linkat F
+GLIBC_2.4 mkdirat F
+GLIBC_2.4 mkfifoat F
+GLIBC_2.4 open_wmemstream F
+GLIBC_2.4 openat F
+GLIBC_2.4 openat64 F
+GLIBC_2.4 ppoll F
+GLIBC_2.4 readlinkat F
+GLIBC_2.4 renameat F
+GLIBC_2.4 symlinkat F
+GLIBC_2.4 unlinkat F
+GLIBC_2.5 GLIBC_2.5 A
+GLIBC_2.5 __readlinkat_chk F
+GLIBC_2.5 inet6_opt_append F
+GLIBC_2.5 inet6_opt_find F
+GLIBC_2.5 inet6_opt_finish F
+GLIBC_2.5 inet6_opt_get_val F
+GLIBC_2.5 inet6_opt_init F
+GLIBC_2.5 inet6_opt_next F
+GLIBC_2.5 inet6_opt_set_val F
+GLIBC_2.5 inet6_rth_add F
+GLIBC_2.5 inet6_rth_getaddr F
+GLIBC_2.5 inet6_rth_init F
+GLIBC_2.5 inet6_rth_reverse F
+GLIBC_2.5 inet6_rth_segments F
+GLIBC_2.5 inet6_rth_space F
+GLIBC_2.6 GLIBC_2.6 A
+GLIBC_2.6 __sched_cpucount F
+GLIBC_2.6 futimens F
+GLIBC_2.6 strerror_l F
+GLIBC_2.6 utimensat F
+GLIBC_2.7 GLIBC_2.7 A
+GLIBC_2.7 __fread_chk F
+GLIBC_2.7 __fread_unlocked_chk F
+GLIBC_2.7 __isoc99_fscanf F
+GLIBC_2.7 __isoc99_fwscanf F
+GLIBC_2.7 __isoc99_scanf F
+GLIBC_2.7 __isoc99_sscanf F
+GLIBC_2.7 __isoc99_swscanf F
+GLIBC_2.7 __isoc99_vfscanf F
+GLIBC_2.7 __isoc99_vfwscanf F
+GLIBC_2.7 __isoc99_vscanf F
+GLIBC_2.7 __isoc99_vsscanf F
+GLIBC_2.7 __isoc99_vswscanf F
+GLIBC_2.7 __isoc99_vwscanf F
+GLIBC_2.7 __isoc99_wscanf F
+GLIBC_2.7 __open64_2 F
+GLIBC_2.7 __open_2 F
+GLIBC_2.7 __openat64_2 F
+GLIBC_2.7 __openat_2 F
+GLIBC_2.7 __sched_cpualloc F
+GLIBC_2.7 __sched_cpufree F
+GLIBC_2.7 mkostemp F
+GLIBC_2.7 mkostemp64 F
+GLIBC_2.8 GLIBC_2.8 A
+GLIBC_2.8 __asprintf_chk F
+GLIBC_2.8 __dprintf_chk F
+GLIBC_2.8 __obstack_printf_chk F
+GLIBC_2.8 __obstack_vprintf_chk F
+GLIBC_2.8 __vasprintf_chk F
+GLIBC_2.8 __vdprintf_chk F
+GLIBC_2.8 qsort_r F
+GLIBC_2.9 GLIBC_2.9 A
+GLIBC_2.9 dup3 F
+GLIBC_2.9 pipe2 F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libcrypt.abilist
@@ -0,0 +1,8 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 crypt F
+GLIBC_2.3 crypt_r F
+GLIBC_2.3 encrypt F
+GLIBC_2.3 encrypt_r F
+GLIBC_2.3 fcrypt F
+GLIBC_2.3 setkey F
+GLIBC_2.3 setkey_r F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libdl.abilist
@@ -0,0 +1,12 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 dladdr F
+GLIBC_2.3 dlclose F
+GLIBC_2.3 dlerror F
+GLIBC_2.3 dlopen F
+GLIBC_2.3 dlsym F
+GLIBC_2.3 dlvsym F
+GLIBC_2.3.3 GLIBC_2.3.3 A
+GLIBC_2.3.3 dladdr1 F
+GLIBC_2.3.3 dlinfo F
+GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.3.4 dlmopen F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libm.abilist
@@ -0,0 +1,467 @@
+GLIBC_2.15 GLIBC_2.15 A
+GLIBC_2.15 __acos_finite F
+GLIBC_2.15 __acosf_finite F
+GLIBC_2.15 __acosh_finite F
+GLIBC_2.15 __acoshf_finite F
+GLIBC_2.15 __acoshl_finite F
+GLIBC_2.15 __acosl_finite F
+GLIBC_2.15 __asin_finite F
+GLIBC_2.15 __asinf_finite F
+GLIBC_2.15 __asinl_finite F
+GLIBC_2.15 __atan2_finite F
+GLIBC_2.15 __atan2f_finite F
+GLIBC_2.15 __atan2l_finite F
+GLIBC_2.15 __atanh_finite F
+GLIBC_2.15 __atanhf_finite F
+GLIBC_2.15 __atanhl_finite F
+GLIBC_2.15 __cosh_finite F
+GLIBC_2.15 __coshf_finite F
+GLIBC_2.15 __coshl_finite F
+GLIBC_2.15 __exp10_finite F
+GLIBC_2.15 __exp10f_finite F
+GLIBC_2.15 __exp10l_finite F
+GLIBC_2.15 __exp2_finite F
+GLIBC_2.15 __exp2f_finite F
+GLIBC_2.15 __exp2l_finite F
+GLIBC_2.15 __exp_finite F
+GLIBC_2.15 __expf_finite F
+GLIBC_2.15 __expl_finite F
+GLIBC_2.15 __fmod_finite F
+GLIBC_2.15 __fmodf_finite F
+GLIBC_2.15 __fmodl_finite F
+GLIBC_2.15 __gamma_r_finite F
+GLIBC_2.15 __gammaf_r_finite F
+GLIBC_2.15 __gammal_r_finite F
+GLIBC_2.15 __hypot_finite F
+GLIBC_2.15 __hypotf_finite F
+GLIBC_2.15 __hypotl_finite F
+GLIBC_2.15 __j0_finite F
+GLIBC_2.15 __j0f_finite F
+GLIBC_2.15 __j0l_finite F
+GLIBC_2.15 __j1_finite F
+GLIBC_2.15 __j1f_finite F
+GLIBC_2.15 __j1l_finite F
+GLIBC_2.15 __jn_finite F
+GLIBC_2.15 __jnf_finite F
+GLIBC_2.15 __jnl_finite F
+GLIBC_2.15 __lgamma_r_finite F
+GLIBC_2.15 __lgammaf_r_finite F
+GLIBC_2.15 __lgammal_r_finite F
+GLIBC_2.15 __log10_finite F
+GLIBC_2.15 __log10f_finite F
+GLIBC_2.15 __log10l_finite F
+GLIBC_2.15 __log2_finite F
+GLIBC_2.15 __log2f_finite F
+GLIBC_2.15 __log2l_finite F
+GLIBC_2.15 __log_finite F
+GLIBC_2.15 __logf_finite F
+GLIBC_2.15 __logl_finite F
+GLIBC_2.15 __pow_finite F
+GLIBC_2.15 __powf_finite F
+GLIBC_2.15 __powl_finite F
+GLIBC_2.15 __remainder_finite F
+GLIBC_2.15 __remainderf_finite F
+GLIBC_2.15 __remainderl_finite F
+GLIBC_2.15 __scalb_finite F
+GLIBC_2.15 __scalbf_finite F
+GLIBC_2.15 __scalbl_finite F
+GLIBC_2.15 __sinh_finite F
+GLIBC_2.15 __sinhf_finite F
+GLIBC_2.15 __sinhl_finite F
+GLIBC_2.15 __sqrt_finite F
+GLIBC_2.15 __sqrtf_finite F
+GLIBC_2.15 __sqrtl_finite F
+GLIBC_2.15 __y0_finite F
+GLIBC_2.15 __y0f_finite F
+GLIBC_2.15 __y0l_finite F
+GLIBC_2.15 __y1_finite F
+GLIBC_2.15 __y1f_finite F
+GLIBC_2.15 __y1l_finite F
+GLIBC_2.15 __yn_finite F
+GLIBC_2.15 __ynf_finite F
+GLIBC_2.15 __ynl_finite F
+GLIBC_2.18 GLIBC_2.18 A
+GLIBC_2.18 __issignaling F
+GLIBC_2.18 __issignalingf F
+GLIBC_2.18 __issignalingl F
+GLIBC_2.23 GLIBC_2.23 A
+GLIBC_2.23 __signgam D 0x4
+GLIBC_2.23 lgamma F
+GLIBC_2.23 lgammaf F
+GLIBC_2.23 lgammal F
+GLIBC_2.24 GLIBC_2.24 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
+GLIBC_2.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 _LIB_VERSION D 0x4
+GLIBC_2.3 __clog10 F
+GLIBC_2.3 __clog10f F
+GLIBC_2.3 __clog10l F
+GLIBC_2.3 __expl F
+GLIBC_2.3 __expm1l F
+GLIBC_2.3 __finite F
+GLIBC_2.3 __finitef F
+GLIBC_2.3 __finitel F
+GLIBC_2.3 __fpclassify F
+GLIBC_2.3 __fpclassifyf F
+GLIBC_2.3 __fpclassifyl F
+GLIBC_2.3 __signbit F
+GLIBC_2.3 __signbitf F
+GLIBC_2.3 __signbitl F
+GLIBC_2.3 acos F
+GLIBC_2.3 acosf F
+GLIBC_2.3 acosh F
+GLIBC_2.3 acoshf F
+GLIBC_2.3 acoshl F
+GLIBC_2.3 acosl F
+GLIBC_2.3 asin F
+GLIBC_2.3 asinf F
+GLIBC_2.3 asinh F
+GLIBC_2.3 asinhf F
+GLIBC_2.3 asinhl F
+GLIBC_2.3 asinl F
+GLIBC_2.3 atan F
+GLIBC_2.3 atan2 F
+GLIBC_2.3 atan2f F
+GLIBC_2.3 atan2l F
+GLIBC_2.3 atanf F
+GLIBC_2.3 atanh F
+GLIBC_2.3 atanhf F
+GLIBC_2.3 atanhl F
+GLIBC_2.3 atanl F
+GLIBC_2.3 cabs F
+GLIBC_2.3 cabsf F
+GLIBC_2.3 cabsl F
+GLIBC_2.3 cacos F
+GLIBC_2.3 cacosf F
+GLIBC_2.3 cacosh F
+GLIBC_2.3 cacoshf F
+GLIBC_2.3 cacoshl F
+GLIBC_2.3 cacosl F
+GLIBC_2.3 carg F
+GLIBC_2.3 cargf F
+GLIBC_2.3 cargl F
+GLIBC_2.3 casin F
+GLIBC_2.3 casinf F
+GLIBC_2.3 casinh F
+GLIBC_2.3 casinhf F
+GLIBC_2.3 casinhl F
+GLIBC_2.3 casinl F
+GLIBC_2.3 catan F
+GLIBC_2.3 catanf F
+GLIBC_2.3 catanh F
+GLIBC_2.3 catanhf F
+GLIBC_2.3 catanhl F
+GLIBC_2.3 catanl F
+GLIBC_2.3 cbrt F
+GLIBC_2.3 cbrtf F
+GLIBC_2.3 cbrtl F
+GLIBC_2.3 ccos F
+GLIBC_2.3 ccosf F
+GLIBC_2.3 ccosh F
+GLIBC_2.3 ccoshf F
+GLIBC_2.3 ccoshl F
+GLIBC_2.3 ccosl F
+GLIBC_2.3 ceil F
+GLIBC_2.3 ceilf F
+GLIBC_2.3 ceill F
+GLIBC_2.3 cexp F
+GLIBC_2.3 cexpf F
+GLIBC_2.3 cexpl F
+GLIBC_2.3 cimag F
+GLIBC_2.3 cimagf F
+GLIBC_2.3 cimagl F
+GLIBC_2.3 clog F
+GLIBC_2.3 clog10 F
+GLIBC_2.3 clog10f F
+GLIBC_2.3 clog10l F
+GLIBC_2.3 clogf F
+GLIBC_2.3 clogl F
+GLIBC_2.3 conj F
+GLIBC_2.3 conjf F
+GLIBC_2.3 conjl F
+GLIBC_2.3 copysign F
+GLIBC_2.3 copysignf F
+GLIBC_2.3 copysignl F
+GLIBC_2.3 cos F
+GLIBC_2.3 cosf F
+GLIBC_2.3 cosh F
+GLIBC_2.3 coshf F
+GLIBC_2.3 coshl F
+GLIBC_2.3 cosl F
+GLIBC_2.3 cpow F
+GLIBC_2.3 cpowf F
+GLIBC_2.3 cpowl F
+GLIBC_2.3 cproj F
+GLIBC_2.3 cprojf F
+GLIBC_2.3 cprojl F
+GLIBC_2.3 creal F
+GLIBC_2.3 crealf F
+GLIBC_2.3 creall F
+GLIBC_2.3 csin F
+GLIBC_2.3 csinf F
+GLIBC_2.3 csinh F
+GLIBC_2.3 csinhf F
+GLIBC_2.3 csinhl F
+GLIBC_2.3 csinl F
+GLIBC_2.3 csqrt F
+GLIBC_2.3 csqrtf F
+GLIBC_2.3 csqrtl F
+GLIBC_2.3 ctan F
+GLIBC_2.3 ctanf F
+GLIBC_2.3 ctanh F
+GLIBC_2.3 ctanhf F
+GLIBC_2.3 ctanhl F
+GLIBC_2.3 ctanl F
+GLIBC_2.3 drem F
+GLIBC_2.3 dremf F
+GLIBC_2.3 dreml F
+GLIBC_2.3 erf F
+GLIBC_2.3 erfc F
+GLIBC_2.3 erfcf F
+GLIBC_2.3 erfcl F
+GLIBC_2.3 erff F
+GLIBC_2.3 erfl F
+GLIBC_2.3 exp F
+GLIBC_2.3 exp10 F
+GLIBC_2.3 exp10f F
+GLIBC_2.3 exp10l F
+GLIBC_2.3 exp2 F
+GLIBC_2.3 exp2f F
+GLIBC_2.3 exp2l F
+GLIBC_2.3 expf F
+GLIBC_2.3 expl F
+GLIBC_2.3 expm1 F
+GLIBC_2.3 expm1f F
+GLIBC_2.3 expm1l F
+GLIBC_2.3 fabs F
+GLIBC_2.3 fabsf F
+GLIBC_2.3 fabsl F
+GLIBC_2.3 fdim F
+GLIBC_2.3 fdimf F
+GLIBC_2.3 fdiml F
+GLIBC_2.3 feclearexcept F
+GLIBC_2.3 fedisableexcept F
+GLIBC_2.3 feenableexcept F
+GLIBC_2.3 fegetenv F
+GLIBC_2.3 fegetexcept F
+GLIBC_2.3 fegetexceptflag F
+GLIBC_2.3 fegetround F
+GLIBC_2.3 feholdexcept F
+GLIBC_2.3 feraiseexcept F
+GLIBC_2.3 fesetenv F
+GLIBC_2.3 fesetexceptflag F
+GLIBC_2.3 fesetround F
+GLIBC_2.3 fetestexcept F
+GLIBC_2.3 feupdateenv F
+GLIBC_2.3 finite F
+GLIBC_2.3 finitef F
+GLIBC_2.3 finitel F
+GLIBC_2.3 floor F
+GLIBC_2.3 floorf F
+GLIBC_2.3 floorl F
+GLIBC_2.3 fma F
+GLIBC_2.3 fmaf F
+GLIBC_2.3 fmal F
+GLIBC_2.3 fmax F
+GLIBC_2.3 fmaxf F
+GLIBC_2.3 fmaxl F
+GLIBC_2.3 fmin F
+GLIBC_2.3 fminf F
+GLIBC_2.3 fminl F
+GLIBC_2.3 fmod F
+GLIBC_2.3 fmodf F
+GLIBC_2.3 fmodl F
+GLIBC_2.3 frexp F
+GLIBC_2.3 frexpf F
+GLIBC_2.3 frexpl F
+GLIBC_2.3 gamma F
+GLIBC_2.3 gammaf F
+GLIBC_2.3 gammal F
+GLIBC_2.3 hypot F
+GLIBC_2.3 hypotf F
+GLIBC_2.3 hypotl F
+GLIBC_2.3 ilogb F
+GLIBC_2.3 ilogbf F
+GLIBC_2.3 ilogbl F
+GLIBC_2.3 j0 F
+GLIBC_2.3 j0f F
+GLIBC_2.3 j0l F
+GLIBC_2.3 j1 F
+GLIBC_2.3 j1f F
+GLIBC_2.3 j1l F
+GLIBC_2.3 jn F
+GLIBC_2.3 jnf F
+GLIBC_2.3 jnl F
+GLIBC_2.3 ldexp F
+GLIBC_2.3 ldexpf F
+GLIBC_2.3 ldexpl F
+GLIBC_2.3 lgamma F
+GLIBC_2.3 lgamma_r F
+GLIBC_2.3 lgammaf F
+GLIBC_2.3 lgammaf_r F
+GLIBC_2.3 lgammal F
+GLIBC_2.3 lgammal_r F
+GLIBC_2.3 llrint F
+GLIBC_2.3 llrintf F
+GLIBC_2.3 llrintl F
+GLIBC_2.3 llround F
+GLIBC_2.3 llroundf F
+GLIBC_2.3 llroundl F
+GLIBC_2.3 log F
+GLIBC_2.3 log10 F
+GLIBC_2.3 log10f F
+GLIBC_2.3 log10l F
+GLIBC_2.3 log1p F
+GLIBC_2.3 log1pf F
+GLIBC_2.3 log1pl F
+GLIBC_2.3 log2 F
+GLIBC_2.3 log2f F
+GLIBC_2.3 log2l F
+GLIBC_2.3 logb F
+GLIBC_2.3 logbf F
+GLIBC_2.3 logbl F
+GLIBC_2.3 logf F
+GLIBC_2.3 logl F
+GLIBC_2.3 lrint F
+GLIBC_2.3 lrintf F
+GLIBC_2.3 lrintl F
+GLIBC_2.3 lround F
+GLIBC_2.3 lroundf F
+GLIBC_2.3 lroundl F
+GLIBC_2.3 matherr F
+GLIBC_2.3 modf F
+GLIBC_2.3 modff F
+GLIBC_2.3 modfl F
+GLIBC_2.3 nan F
+GLIBC_2.3 nanf F
+GLIBC_2.3 nanl F
+GLIBC_2.3 nearbyint F
+GLIBC_2.3 nearbyintf F
+GLIBC_2.3 nearbyintl F
+GLIBC_2.3 nextafter F
+GLIBC_2.3 nextafterf F
+GLIBC_2.3 nextafterl F
+GLIBC_2.3 nexttoward F
+GLIBC_2.3 nexttowardf F
+GLIBC_2.3 nexttowardl F
+GLIBC_2.3 pow F
+GLIBC_2.3 pow10 F
+GLIBC_2.3 pow10f F
+GLIBC_2.3 pow10l F
+GLIBC_2.3 powf F
+GLIBC_2.3 powl F
+GLIBC_2.3 remainder F
+GLIBC_2.3 remainderf F
+GLIBC_2.3 remainderl F
+GLIBC_2.3 remquo F
+GLIBC_2.3 remquof F
+GLIBC_2.3 remquol F
+GLIBC_2.3 rint F
+GLIBC_2.3 rintf F
+GLIBC_2.3 rintl F
+GLIBC_2.3 round F
+GLIBC_2.3 roundf F
+GLIBC_2.3 roundl F
+GLIBC_2.3 scalb F
+GLIBC_2.3 scalbf F
+GLIBC_2.3 scalbl F
+GLIBC_2.3 scalbln F
+GLIBC_2.3 scalblnf F
+GLIBC_2.3 scalblnl F
+GLIBC_2.3 scalbn F
+GLIBC_2.3 scalbnf F
+GLIBC_2.3 scalbnl F
+GLIBC_2.3 signgam D 0x4
+GLIBC_2.3 significand F
+GLIBC_2.3 significandf F
+GLIBC_2.3 significandl F
+GLIBC_2.3 sin F
+GLIBC_2.3 sincos F
+GLIBC_2.3 sincosf F
+GLIBC_2.3 sincosl F
+GLIBC_2.3 sinf F
+GLIBC_2.3 sinh F
+GLIBC_2.3 sinhf F
+GLIBC_2.3 sinhl F
+GLIBC_2.3 sinl F
+GLIBC_2.3 sqrt F
+GLIBC_2.3 sqrtf F
+GLIBC_2.3 sqrtl F
+GLIBC_2.3 tan F
+GLIBC_2.3 tanf F
+GLIBC_2.3 tanh F
+GLIBC_2.3 tanhf F
+GLIBC_2.3 tanhl F
+GLIBC_2.3 tanl F
+GLIBC_2.3 tgamma F
+GLIBC_2.3 tgammaf F
+GLIBC_2.3 tgammal F
+GLIBC_2.3 trunc F
+GLIBC_2.3 truncf F
+GLIBC_2.3 truncl F
+GLIBC_2.3 y0 F
+GLIBC_2.3 y0f F
+GLIBC_2.3 y0l F
+GLIBC_2.3 y1 F
+GLIBC_2.3 y1f F
+GLIBC_2.3 y1l F
+GLIBC_2.3 yn F
+GLIBC_2.3 ynf F
+GLIBC_2.3 ynl F
+GLIBC_2.4 GLIBC_2.4 A
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libnsl.abilist
@@ -0,0 +1,122 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 __free_fdresult F
+GLIBC_2.3 __nis_default_access F
+GLIBC_2.3 __nis_default_group F
+GLIBC_2.3 __nis_default_owner F
+GLIBC_2.3 __nis_default_ttl F
+GLIBC_2.3 __nis_finddirectory F
+GLIBC_2.3 __nis_hash F
+GLIBC_2.3 __nisbind_connect F
+GLIBC_2.3 __nisbind_create F
+GLIBC_2.3 __nisbind_destroy F
+GLIBC_2.3 __nisbind_next F
+GLIBC_2.3 __yp_check F
+GLIBC_2.3 nis_add F
+GLIBC_2.3 nis_add_entry F
+GLIBC_2.3 nis_addmember F
+GLIBC_2.3 nis_checkpoint F
+GLIBC_2.3 nis_clone_directory F
+GLIBC_2.3 nis_clone_object F
+GLIBC_2.3 nis_clone_result F
+GLIBC_2.3 nis_creategroup F
+GLIBC_2.3 nis_destroy_object F
+GLIBC_2.3 nis_destroygroup F
+GLIBC_2.3 nis_dir_cmp F
+GLIBC_2.3 nis_domain_of F
+GLIBC_2.3 nis_domain_of_r F
+GLIBC_2.3 nis_first_entry F
+GLIBC_2.3 nis_free_directory F
+GLIBC_2.3 nis_free_object F
+GLIBC_2.3 nis_free_request F
+GLIBC_2.3 nis_freenames F
+GLIBC_2.3 nis_freeresult F
+GLIBC_2.3 nis_freeservlist F
+GLIBC_2.3 nis_freetags F
+GLIBC_2.3 nis_getnames F
+GLIBC_2.3 nis_getservlist F
+GLIBC_2.3 nis_ismember F
+GLIBC_2.3 nis_leaf_of F
+GLIBC_2.3 nis_leaf_of_r F
+GLIBC_2.3 nis_lerror F
+GLIBC_2.3 nis_list F
+GLIBC_2.3 nis_local_directory F
+GLIBC_2.3 nis_local_group F
+GLIBC_2.3 nis_local_host F
+GLIBC_2.3 nis_local_principal F
+GLIBC_2.3 nis_lookup F
+GLIBC_2.3 nis_mkdir F
+GLIBC_2.3 nis_modify F
+GLIBC_2.3 nis_modify_entry F
+GLIBC_2.3 nis_name_of F
+GLIBC_2.3 nis_name_of_r F
+GLIBC_2.3 nis_next_entry F
+GLIBC_2.3 nis_perror F
+GLIBC_2.3 nis_ping F
+GLIBC_2.3 nis_print_directory F
+GLIBC_2.3 nis_print_entry F
+GLIBC_2.3 nis_print_group F
+GLIBC_2.3 nis_print_group_entry F
+GLIBC_2.3 nis_print_link F
+GLIBC_2.3 nis_print_object F
+GLIBC_2.3 nis_print_result F
+GLIBC_2.3 nis_print_rights F
+GLIBC_2.3 nis_print_table F
+GLIBC_2.3 nis_read_obj F
+GLIBC_2.3 nis_remove F
+GLIBC_2.3 nis_remove_entry F
+GLIBC_2.3 nis_removemember F
+GLIBC_2.3 nis_rmdir F
+GLIBC_2.3 nis_servstate F
+GLIBC_2.3 nis_sperrno F
+GLIBC_2.3 nis_sperror F
+GLIBC_2.3 nis_sperror_r F
+GLIBC_2.3 nis_stats F
+GLIBC_2.3 nis_verifygroup F
+GLIBC_2.3 nis_write_obj F
+GLIBC_2.3 readColdStartFile F
+GLIBC_2.3 writeColdStartFile F
+GLIBC_2.3 xdr_cback_data F
+GLIBC_2.3 xdr_domainname F
+GLIBC_2.3 xdr_keydat F
+GLIBC_2.3 xdr_mapname F
+GLIBC_2.3 xdr_obj_p F
+GLIBC_2.3 xdr_peername F
+GLIBC_2.3 xdr_valdat F
+GLIBC_2.3 xdr_yp_buf F
+GLIBC_2.3 xdr_ypall F
+GLIBC_2.3 xdr_ypbind_binding F
+GLIBC_2.3 xdr_ypbind_resp F
+GLIBC_2.3 xdr_ypbind_resptype F
+GLIBC_2.3 xdr_ypbind_setdom F
+GLIBC_2.3 xdr_ypdelete_args F
+GLIBC_2.3 xdr_ypmap_parms F
+GLIBC_2.3 xdr_ypmaplist F
+GLIBC_2.3 xdr_yppush_status F
+GLIBC_2.3 xdr_yppushresp_xfr F
+GLIBC_2.3 xdr_ypreq_key F
+GLIBC_2.3 xdr_ypreq_nokey F
+GLIBC_2.3 xdr_ypreq_xfr F
+GLIBC_2.3 xdr_ypresp_all F
+GLIBC_2.3 xdr_ypresp_key_val F
+GLIBC_2.3 xdr_ypresp_maplist F
+GLIBC_2.3 xdr_ypresp_master F
+GLIBC_2.3 xdr_ypresp_order F
+GLIBC_2.3 xdr_ypresp_val F
+GLIBC_2.3 xdr_ypresp_xfr F
+GLIBC_2.3 xdr_ypstat F
+GLIBC_2.3 xdr_ypupdate_args F
+GLIBC_2.3 xdr_ypxfrstat F
+GLIBC_2.3 yp_all F
+GLIBC_2.3 yp_bind F
+GLIBC_2.3 yp_first F
+GLIBC_2.3 yp_get_default_domain F
+GLIBC_2.3 yp_maplist F
+GLIBC_2.3 yp_master F
+GLIBC_2.3 yp_match F
+GLIBC_2.3 yp_next F
+GLIBC_2.3 yp_order F
+GLIBC_2.3 yp_unbind F
+GLIBC_2.3 yp_update F
+GLIBC_2.3 ypbinderr_string F
+GLIBC_2.3 yperr_string F
+GLIBC_2.3 ypprot_err F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libpthread.abilist
@@ -0,0 +1,227 @@
+GLIBC_2.12 GLIBC_2.12 A
+GLIBC_2.12 pthread_getname_np F
+GLIBC_2.12 pthread_setname_np F
+GLIBC_2.18 GLIBC_2.18 A
+GLIBC_2.18 pthread_getattr_default_np F
+GLIBC_2.18 pthread_setattr_default_np F
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 _IO_flockfile F
+GLIBC_2.3 _IO_ftrylockfile F
+GLIBC_2.3 _IO_funlockfile F
+GLIBC_2.3 __close F
+GLIBC_2.3 __connect F
+GLIBC_2.3 __errno_location F
+GLIBC_2.3 __fcntl F
+GLIBC_2.3 __fork F
+GLIBC_2.3 __h_errno_location F
+GLIBC_2.3 __libc_allocate_rtsig F
+GLIBC_2.3 __libc_current_sigrtmax F
+GLIBC_2.3 __libc_current_sigrtmin F
+GLIBC_2.3 __lseek F
+GLIBC_2.3 __nanosleep F
+GLIBC_2.3 __open F
+GLIBC_2.3 __open64 F
+GLIBC_2.3 __pread64 F
+GLIBC_2.3 __pthread_getspecific F
+GLIBC_2.3 __pthread_key_create F
+GLIBC_2.3 __pthread_mutex_destroy F
+GLIBC_2.3 __pthread_mutex_init F
+GLIBC_2.3 __pthread_mutex_lock F
+GLIBC_2.3 __pthread_mutex_trylock F
+GLIBC_2.3 __pthread_mutex_unlock F
+GLIBC_2.3 __pthread_mutexattr_destroy F
+GLIBC_2.3 __pthread_mutexattr_init F
+GLIBC_2.3 __pthread_mutexattr_settype F
+GLIBC_2.3 __pthread_once F
+GLIBC_2.3 __pthread_rwlock_destroy F
+GLIBC_2.3 __pthread_rwlock_init F
+GLIBC_2.3 __pthread_rwlock_rdlock F
+GLIBC_2.3 __pthread_rwlock_tryrdlock F
+GLIBC_2.3 __pthread_rwlock_trywrlock F
+GLIBC_2.3 __pthread_rwlock_unlock F
+GLIBC_2.3 __pthread_rwlock_wrlock F
+GLIBC_2.3 __pthread_setspecific F
+GLIBC_2.3 __pwrite64 F
+GLIBC_2.3 __read F
+GLIBC_2.3 __res_state F
+GLIBC_2.3 __send F
+GLIBC_2.3 __sigaction F
+GLIBC_2.3 __vfork F
+GLIBC_2.3 __wait F
+GLIBC_2.3 __write F
+GLIBC_2.3 _pthread_cleanup_pop F
+GLIBC_2.3 _pthread_cleanup_pop_restore F
+GLIBC_2.3 _pthread_cleanup_push F
+GLIBC_2.3 _pthread_cleanup_push_defer F
+GLIBC_2.3 accept F
+GLIBC_2.3 close F
+GLIBC_2.3 connect F
+GLIBC_2.3 fcntl F
+GLIBC_2.3 flockfile F
+GLIBC_2.3 fork F
+GLIBC_2.3 fsync F
+GLIBC_2.3 ftrylockfile F
+GLIBC_2.3 funlockfile F
+GLIBC_2.3 longjmp F
+GLIBC_2.3 lseek F
+GLIBC_2.3 lseek64 F
+GLIBC_2.3 msync F
+GLIBC_2.3 nanosleep F
+GLIBC_2.3 open F
+GLIBC_2.3 open64 F
+GLIBC_2.3 pause F
+GLIBC_2.3 pread F
+GLIBC_2.3 pread64 F
+GLIBC_2.3 pthread_atfork F
+GLIBC_2.3 pthread_attr_destroy F
+GLIBC_2.3 pthread_attr_getdetachstate F
+GLIBC_2.3 pthread_attr_getguardsize F
+GLIBC_2.3 pthread_attr_getinheritsched F
+GLIBC_2.3 pthread_attr_getschedparam F
+GLIBC_2.3 pthread_attr_getschedpolicy F
+GLIBC_2.3 pthread_attr_getscope F
+GLIBC_2.3 pthread_attr_getstack F
+GLIBC_2.3 pthread_attr_getstackaddr F
+GLIBC_2.3 pthread_attr_getstacksize F
+GLIBC_2.3 pthread_attr_init F
+GLIBC_2.3 pthread_attr_setdetachstate F
+GLIBC_2.3 pthread_attr_setguardsize F
+GLIBC_2.3 pthread_attr_setinheritsched F
+GLIBC_2.3 pthread_attr_setschedparam F
+GLIBC_2.3 pthread_attr_setschedpolicy F
+GLIBC_2.3 pthread_attr_setscope F
+GLIBC_2.3 pthread_attr_setstack F
+GLIBC_2.3 pthread_attr_setstackaddr F
+GLIBC_2.3 pthread_attr_setstacksize F
+GLIBC_2.3 pthread_barrier_destroy F
+GLIBC_2.3 pthread_barrier_init F
+GLIBC_2.3 pthread_barrier_wait F
+GLIBC_2.3 pthread_barrierattr_destroy F
+GLIBC_2.3 pthread_barrierattr_init F
+GLIBC_2.3 pthread_barrierattr_setpshared F
+GLIBC_2.3 pthread_cancel F
+GLIBC_2.3 pthread_cond_broadcast F
+GLIBC_2.3 pthread_cond_destroy F
+GLIBC_2.3 pthread_cond_init F
+GLIBC_2.3 pthread_cond_signal F
+GLIBC_2.3 pthread_cond_timedwait F
+GLIBC_2.3 pthread_cond_wait F
+GLIBC_2.3 pthread_condattr_destroy F
+GLIBC_2.3 pthread_condattr_getpshared F
+GLIBC_2.3 pthread_condattr_init F
+GLIBC_2.3 pthread_condattr_setpshared F
+GLIBC_2.3 pthread_create F
+GLIBC_2.3 pthread_detach F
+GLIBC_2.3 pthread_equal F
+GLIBC_2.3 pthread_exit F
+GLIBC_2.3 pthread_getattr_np F
+GLIBC_2.3 pthread_getconcurrency F
+GLIBC_2.3 pthread_getcpuclockid F
+GLIBC_2.3 pthread_getschedparam F
+GLIBC_2.3 pthread_getspecific F
+GLIBC_2.3 pthread_join F
+GLIBC_2.3 pthread_key_create F
+GLIBC_2.3 pthread_key_delete F
+GLIBC_2.3 pthread_kill F
+GLIBC_2.3 pthread_kill_other_threads_np F
+GLIBC_2.3 pthread_mutex_destroy F
+GLIBC_2.3 pthread_mutex_init F
+GLIBC_2.3 pthread_mutex_lock F
+GLIBC_2.3 pthread_mutex_timedlock F
+GLIBC_2.3 pthread_mutex_trylock F
+GLIBC_2.3 pthread_mutex_unlock F
+GLIBC_2.3 pthread_mutexattr_destroy F
+GLIBC_2.3 pthread_mutexattr_getkind_np F
+GLIBC_2.3 pthread_mutexattr_getpshared F
+GLIBC_2.3 pthread_mutexattr_gettype F
+GLIBC_2.3 pthread_mutexattr_init F
+GLIBC_2.3 pthread_mutexattr_setkind_np F
+GLIBC_2.3 pthread_mutexattr_setpshared F
+GLIBC_2.3 pthread_mutexattr_settype F
+GLIBC_2.3 pthread_once F
+GLIBC_2.3 pthread_rwlock_destroy F
+GLIBC_2.3 pthread_rwlock_init F
+GLIBC_2.3 pthread_rwlock_rdlock F
+GLIBC_2.3 pthread_rwlock_timedrdlock F
+GLIBC_2.3 pthread_rwlock_timedwrlock F
+GLIBC_2.3 pthread_rwlock_tryrdlock F
+GLIBC_2.3 pthread_rwlock_trywrlock F
+GLIBC_2.3 pthread_rwlock_unlock F
+GLIBC_2.3 pthread_rwlock_wrlock F
+GLIBC_2.3 pthread_rwlockattr_destroy F
+GLIBC_2.3 pthread_rwlockattr_getkind_np F
+GLIBC_2.3 pthread_rwlockattr_getpshared F
+GLIBC_2.3 pthread_rwlockattr_init F
+GLIBC_2.3 pthread_rwlockattr_setkind_np F
+GLIBC_2.3 pthread_rwlockattr_setpshared F
+GLIBC_2.3 pthread_self F
+GLIBC_2.3 pthread_setcancelstate F
+GLIBC_2.3 pthread_setcanceltype F
+GLIBC_2.3 pthread_setconcurrency F
+GLIBC_2.3 pthread_setschedparam F
+GLIBC_2.3 pthread_setspecific F
+GLIBC_2.3 pthread_sigmask F
+GLIBC_2.3 pthread_spin_destroy F
+GLIBC_2.3 pthread_spin_init F
+GLIBC_2.3 pthread_spin_lock F
+GLIBC_2.3 pthread_spin_trylock F
+GLIBC_2.3 pthread_spin_unlock F
+GLIBC_2.3 pthread_testcancel F
+GLIBC_2.3 pthread_yield F
+GLIBC_2.3 pwrite F
+GLIBC_2.3 pwrite64 F
+GLIBC_2.3 raise F
+GLIBC_2.3 read F
+GLIBC_2.3 recv F
+GLIBC_2.3 recvfrom F
+GLIBC_2.3 recvmsg F
+GLIBC_2.3 sem_close F
+GLIBC_2.3 sem_destroy F
+GLIBC_2.3 sem_getvalue F
+GLIBC_2.3 sem_init F
+GLIBC_2.3 sem_open F
+GLIBC_2.3 sem_post F
+GLIBC_2.3 sem_timedwait F
+GLIBC_2.3 sem_trywait F
+GLIBC_2.3 sem_unlink F
+GLIBC_2.3 sem_wait F
+GLIBC_2.3 send F
+GLIBC_2.3 sendmsg F
+GLIBC_2.3 sendto F
+GLIBC_2.3 sigaction F
+GLIBC_2.3 siglongjmp F
+GLIBC_2.3 sigwait F
+GLIBC_2.3 system F
+GLIBC_2.3 tcdrain F
+GLIBC_2.3 vfork F
+GLIBC_2.3 wait F
+GLIBC_2.3 waitpid F
+GLIBC_2.3 write F
+GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.3.2 pthread_cond_broadcast F
+GLIBC_2.3.2 pthread_cond_destroy F
+GLIBC_2.3.2 pthread_cond_init F
+GLIBC_2.3.2 pthread_cond_signal F
+GLIBC_2.3.2 pthread_cond_timedwait F
+GLIBC_2.3.2 pthread_cond_wait F
+GLIBC_2.3.3 GLIBC_2.3.3 A
+GLIBC_2.3.3 __pthread_cleanup_routine F
+GLIBC_2.3.3 __pthread_register_cancel F
+GLIBC_2.3.3 __pthread_register_cancel_defer F
+GLIBC_2.3.3 __pthread_unregister_cancel F
+GLIBC_2.3.3 __pthread_unregister_cancel_restore F
+GLIBC_2.3.3 __pthread_unwind_next F
+GLIBC_2.3.3 pthread_attr_getaffinity_np F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_barrierattr_getpshared F
+GLIBC_2.3.3 pthread_condattr_getclock F
+GLIBC_2.3.3 pthread_condattr_setclock F
+GLIBC_2.3.3 pthread_getaffinity_np F
+GLIBC_2.3.3 pthread_setaffinity_np F
+GLIBC_2.3.3 pthread_timedjoin_np F
+GLIBC_2.3.3 pthread_tryjoin_np F
+GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.3.4 pthread_attr_getaffinity_np F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
+GLIBC_2.3.4 pthread_setaffinity_np F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libresolv.abilist
@@ -0,0 +1,94 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 __b64_ntop F
+GLIBC_2.3 __b64_pton F
+GLIBC_2.3 __dn_comp F
+GLIBC_2.3 __dn_count_labels F
+GLIBC_2.3 __dn_expand F
+GLIBC_2.3 __dn_skipname F
+GLIBC_2.3 __fp_nquery F
+GLIBC_2.3 __fp_query F
+GLIBC_2.3 __fp_resstat F
+GLIBC_2.3 __hostalias F
+GLIBC_2.3 __loc_aton F
+GLIBC_2.3 __loc_ntoa F
+GLIBC_2.3 __p_cdname F
+GLIBC_2.3 __p_cdnname F
+GLIBC_2.3 __p_class F
+GLIBC_2.3 __p_class_syms D 0x54
+GLIBC_2.3 __p_fqname F
+GLIBC_2.3 __p_fqnname F
+GLIBC_2.3 __p_option F
+GLIBC_2.3 __p_query F
+GLIBC_2.3 __p_secstodate F
+GLIBC_2.3 __p_time F
+GLIBC_2.3 __p_type F
+GLIBC_2.3 __p_type_syms D 0x228
+GLIBC_2.3 __putlong F
+GLIBC_2.3 __putshort F
+GLIBC_2.3 __res_close F
+GLIBC_2.3 __res_dnok F
+GLIBC_2.3 __res_hnok F
+GLIBC_2.3 __res_hostalias F
+GLIBC_2.3 __res_isourserver F
+GLIBC_2.3 __res_mailok F
+GLIBC_2.3 __res_mkquery F
+GLIBC_2.3 __res_nameinquery F
+GLIBC_2.3 __res_nmkquery F
+GLIBC_2.3 __res_nquery F
+GLIBC_2.3 __res_nquerydomain F
+GLIBC_2.3 __res_nsearch F
+GLIBC_2.3 __res_nsend F
+GLIBC_2.3 __res_ownok F
+GLIBC_2.3 __res_queriesmatch F
+GLIBC_2.3 __res_query F
+GLIBC_2.3 __res_querydomain F
+GLIBC_2.3 __res_search F
+GLIBC_2.3 __res_send F
+GLIBC_2.3 __sym_ntop F
+GLIBC_2.3 __sym_ntos F
+GLIBC_2.3 __sym_ston F
+GLIBC_2.3 _gethtbyaddr F
+GLIBC_2.3 _gethtbyname F
+GLIBC_2.3 _gethtbyname2 F
+GLIBC_2.3 _gethtent F
+GLIBC_2.3 _getlong F
+GLIBC_2.3 _getshort F
+GLIBC_2.3 _res_opcodes D 0x40
+GLIBC_2.3 _sethtent F
+GLIBC_2.3 inet_net_ntop F
+GLIBC_2.3 inet_net_pton F
+GLIBC_2.3 inet_neta F
+GLIBC_2.3 res_gethostbyaddr F
+GLIBC_2.3 res_gethostbyname F
+GLIBC_2.3 res_gethostbyname2 F
+GLIBC_2.3 res_send_setqhook F
+GLIBC_2.3 res_send_setrhook F
+GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.3.2 __p_rcode F
+GLIBC_2.9 GLIBC_2.9 A
+GLIBC_2.9 ns_datetosecs F
+GLIBC_2.9 ns_format_ttl F
+GLIBC_2.9 ns_get16 F
+GLIBC_2.9 ns_get32 F
+GLIBC_2.9 ns_initparse F
+GLIBC_2.9 ns_makecanon F
+GLIBC_2.9 ns_msg_getflag F
+GLIBC_2.9 ns_name_compress F
+GLIBC_2.9 ns_name_ntol F
+GLIBC_2.9 ns_name_ntop F
+GLIBC_2.9 ns_name_pack F
+GLIBC_2.9 ns_name_pton F
+GLIBC_2.9 ns_name_rollback F
+GLIBC_2.9 ns_name_skip F
+GLIBC_2.9 ns_name_uncompress F
+GLIBC_2.9 ns_name_unpack F
+GLIBC_2.9 ns_parse_ttl F
+GLIBC_2.9 ns_parserr F
+GLIBC_2.9 ns_put16 F
+GLIBC_2.9 ns_put32 F
+GLIBC_2.9 ns_samedomain F
+GLIBC_2.9 ns_samename F
+GLIBC_2.9 ns_skiprr F
+GLIBC_2.9 ns_sprintrr F
+GLIBC_2.9 ns_sprintrrf F
+GLIBC_2.9 ns_subdomain F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/librt.abilist
@@ -0,0 +1,46 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 aio_cancel F
+GLIBC_2.3 aio_cancel64 F
+GLIBC_2.3 aio_error F
+GLIBC_2.3 aio_error64 F
+GLIBC_2.3 aio_fsync F
+GLIBC_2.3 aio_fsync64 F
+GLIBC_2.3 aio_init F
+GLIBC_2.3 aio_read F
+GLIBC_2.3 aio_read64 F
+GLIBC_2.3 aio_return F
+GLIBC_2.3 aio_return64 F
+GLIBC_2.3 aio_suspend F
+GLIBC_2.3 aio_suspend64 F
+GLIBC_2.3 aio_write F
+GLIBC_2.3 aio_write64 F
+GLIBC_2.3 clock_getcpuclockid F
+GLIBC_2.3 clock_getres F
+GLIBC_2.3 clock_gettime F
+GLIBC_2.3 clock_nanosleep F
+GLIBC_2.3 clock_settime F
+GLIBC_2.3 lio_listio F
+GLIBC_2.3 lio_listio64 F
+GLIBC_2.3 shm_open F
+GLIBC_2.3 shm_unlink F
+GLIBC_2.3 timer_create F
+GLIBC_2.3 timer_delete F
+GLIBC_2.3 timer_getoverrun F
+GLIBC_2.3 timer_gettime F
+GLIBC_2.3 timer_settime F
+GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.3.4 mq_close F
+GLIBC_2.3.4 mq_getattr F
+GLIBC_2.3.4 mq_notify F
+GLIBC_2.3.4 mq_open F
+GLIBC_2.3.4 mq_receive F
+GLIBC_2.3.4 mq_send F
+GLIBC_2.3.4 mq_setattr F
+GLIBC_2.3.4 mq_timedreceive F
+GLIBC_2.3.4 mq_timedsend F
+GLIBC_2.3.4 mq_unlink F
+GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.4 lio_listio F
+GLIBC_2.4 lio_listio64 F
+GLIBC_2.7 GLIBC_2.7 A
+GLIBC_2.7 __mq_open_2 F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libthread_db.abilist
@@ -0,0 +1,42 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 td_init F
+GLIBC_2.3 td_log F
+GLIBC_2.3 td_symbol_list F
+GLIBC_2.3 td_ta_clear_event F
+GLIBC_2.3 td_ta_delete F
+GLIBC_2.3 td_ta_enable_stats F
+GLIBC_2.3 td_ta_event_addr F
+GLIBC_2.3 td_ta_event_getmsg F
+GLIBC_2.3 td_ta_get_nthreads F
+GLIBC_2.3 td_ta_get_ph F
+GLIBC_2.3 td_ta_get_stats F
+GLIBC_2.3 td_ta_map_id2thr F
+GLIBC_2.3 td_ta_map_lwp2thr F
+GLIBC_2.3 td_ta_new F
+GLIBC_2.3 td_ta_reset_stats F
+GLIBC_2.3 td_ta_set_event F
+GLIBC_2.3 td_ta_setconcurrency F
+GLIBC_2.3 td_ta_thr_iter F
+GLIBC_2.3 td_ta_tsd_iter F
+GLIBC_2.3 td_thr_clear_event F
+GLIBC_2.3 td_thr_dbresume F
+GLIBC_2.3 td_thr_dbsuspend F
+GLIBC_2.3 td_thr_event_enable F
+GLIBC_2.3 td_thr_event_getmsg F
+GLIBC_2.3 td_thr_get_info F
+GLIBC_2.3 td_thr_getfpregs F
+GLIBC_2.3 td_thr_getgregs F
+GLIBC_2.3 td_thr_getxregs F
+GLIBC_2.3 td_thr_getxregsize F
+GLIBC_2.3 td_thr_set_event F
+GLIBC_2.3 td_thr_setfpregs F
+GLIBC_2.3 td_thr_setgregs F
+GLIBC_2.3 td_thr_setprio F
+GLIBC_2.3 td_thr_setsigpending F
+GLIBC_2.3 td_thr_setxregs F
+GLIBC_2.3 td_thr_sigsetmask F
+GLIBC_2.3 td_thr_tls_get_addr F
+GLIBC_2.3 td_thr_tsd F
+GLIBC_2.3 td_thr_validate F
+GLIBC_2.3.3 GLIBC_2.3.3 A
+GLIBC_2.3.3 td_thr_tlsbase F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/libutil.abilist
@@ -0,0 +1,7 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 forkpty F
+GLIBC_2.3 login F
+GLIBC_2.3 login_tty F
+GLIBC_2.3 logout F
+GLIBC_2.3 logwtmp F
+GLIBC_2.3 openpty F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/localplt.data
@@ -0,0 +1,20 @@
+# See scripts/check-localplt.awk for how this file is processed.
+# PLT use is required for the malloc family and for matherr because
+# users can define their own functions and have library internals call them.
+# Linker in binutils 2.26 and newer consolidates R_386_JUMP_SLOT
+# relocation with R_386_GLOB_DAT relocation against the same symbol.
+libc.so: calloc
+libc.so: free + REL R_386_GLOB_DAT
+libc.so: malloc + REL R_386_GLOB_DAT
+libc.so: memalign
+libc.so: realloc
+libm.so: matherr
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free + REL R_386_GLOB_DAT
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error + REL R_386_GLOB_DAT
+ld.so: _dl_catch_error + REL R_386_GLOB_DAT
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/lseek.S
@@ -0,0 +1,53 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+/* lseek returns a 64-bit result in %eax, %edx.  This means that in the
+   error case we have to set both %eax and %edx to -1.  */
+
+PSEUDO_NOERRNO(__lseek, lseek, 3)
+        jnb L(no_error)
+	call SYSCALL_ERROR_LABEL;
+	orl $-1, %edx;
+L(pseudo_end):
+L(no_error):
+	ret
+PSEUDO_END(__lseek)
+libc_hidden_def (__lseek)
+
+strong_alias (__lseek, __libc_lseek)
+libc_hidden_def (__libc_lseek)
+
+strong_alias (__lseek, __libc_lseek64)
+libc_hidden_def (__libc_lseek64)
+
+strong_alias (__lseek, __lseek64)
+libc_hidden_def (__lseek64)
+
+strong_alias (__lseek, __llseek)
+libc_hidden_def (__llseek)
+
+weak_alias (__lseek, lseek)
+libc_hidden_weak (lseek)
+
+weak_alias (__lseek, lseek64)
+libc_hidden_weak (lseek64)
+
+weak_alias (__lseek, llseek)
+libc_hidden_weak (llseek)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/makecontext.S
@@ -0,0 +1,120 @@
+/* Create new context.
+   Copyright (C) 2001,02 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+#include <ucontext_i.h>
+
+
+ENTRY(__makecontext)
+	movl	4(%esp), %eax
+
+	/* Load the address of the function we are supposed to run.  */
+	movl	8(%esp), %ecx
+
+	/* Compute the address of the stack.  The information comes from
+	   to us_stack element.  */
+	movl	oSS_SP(%eax), %edx
+	movl	%ecx, oEIP(%eax)
+	addl	oSS_SIZE(%eax), %edx
+
+	/* Put the next context on the new stack (from the uc_link
+	   element).  */
+	movl	oLINK(%eax), %ecx
+	movl	%ecx, -4(%edx)
+
+	/* Remember the number of parameters for the exit handler since
+	   it has to remove them.  We store the number in the EBX register
+	   which the function we will call must preserve.  */
+	movl	12(%esp), %ecx
+	movl	%ecx, oEBX(%eax)
+
+	/* Make room on the new stack for the parameters.  */
+	negl	%ecx
+	leal	-8(%edx,%ecx,4), %edx
+	negl	%ecx
+	/* Store the future stack pointer.  */
+	movl	%edx, oESP(%eax)
+
+	/* Copy all the parameters.  */
+	jecxz	2f
+1:	movl	12(%esp,%ecx,4), %eax
+	movl	%eax, (%edx,%ecx,4)
+	decl	%ecx
+	jnz	1b
+2:
+
+	/* If the function we call returns we must continue with the
+	   context which is given in the uc_link element.  To do this
+	   set the return address for the function the user provides
+	   to a little bit of helper code which does the magic (see
+	   below).  */
+#ifdef PIC
+	call	1f
+	cfi_adjust_cfa_offset (4)
+1:	popl	%ecx
+	cfi_adjust_cfa_offset (-4)
+	addl	$L(exitcode)-1b, %ecx
+	movl	%ecx, (%edx)
+#else
+	movl	$L(exitcode), (%edx)
+#endif
+	/* We need to terminate the FDE here instead of after ret because
+	   the unwinder looks at ra-1 for unwind information.  */
+	cfi_endproc
+
+	/* 'makecontext' returns no value.  */
+	ret
+
+	/* This is the helper code which gets called if a function which
+	   is registered with 'makecontext' returns.  In this case we
+	   have to install the context listed in the uc_link element of
+	   the context 'makecontext' manipulated at the time of the
+	   'makecontext' call.  If the pointer is NULL the process must
+	   terminate.  */
+L(exitcode):
+	/* This removes the parameters passed to the function given to
+	   'makecontext' from the stack.  EBX contains the number of
+	   parameters (see above).  */
+	leal	(%esp,%ebx,4), %esp
+
+#ifdef	PIC
+	call	1f
+1:	popl	%ebx
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+#endif
+	popl	%eax			/* This is the next context.  */
+	testl	%eax, %eax
+	je	2f			/* If it is zero exit.  */
+
+	pushl	%eax
+	call	JUMPTARGET(__setcontext)
+	/* If this returns (which can happen if the syscall fails) we'll
+	   exit the program with the return error value (-1).  */
+
+2:	pushl	%eax
+	call	HIDDEN_JUMPTARGET(exit)
+	/* The 'exit' call should never return.  In case it does cause
+	   the process to terminate.  */
+	hlt
+	cfi_startproc
+END(__makecontext)
+
+weak_alias(__makecontext, makecontext)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/pipe.S
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991,92,93,95,97,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+SYSCALL__ (pipe, 1)
+	movl 4(%esp), scratch
+	movl %eax, (scratch)
+	movl r1, 4(scratch)
+	xorl %eax, %eax
+	ret
+PSEUDO_END (__pipe)
+
+libc_hidden_def (__pipe)
+weak_alias (__pipe, pipe)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/pt-vfork.S
@@ -0,0 +1 @@
+#include <sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/vfork.S>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/rfork.S
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991-1992, 1994-1995, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text;
+ENTRY (__rfork)
+	/* save the return PC value into ECX,
+	   preserve stack frame with argument  */
+	movl 0(%esp), %ecx;
+	DO_CALL (rfork, 1)
+	jb SYSCALL_ERROR_LABEL;
+	/* R1 is now 0 for the parent and 1 for the child.  Decrement it to
+	   make it -1 (all bits set) for the parent, and 0 (no bits set)
+	   for the child.  Then AND it with R0, so the parent gets
+	   R0&-1==R0, and the child gets R0&0==0.  */
+	decl %edx
+	andl %edx, %eax
+
+	popl %edx
+	cfi_adjust_cfa_offset(-4)
+	jmp  *%ecx
+
+L(pseudo_end):
+	ret
+PSEUDO_END (__rfork)
+
+weak_alias (__rfork, rfork)
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/shlib-versions
@@ -0,0 +1 @@
+ld=ld.so.1
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/sigcontextinfo.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+native FreeBSD:
+        sighandler(int signum, int code,       struct sigcontext * sg, void * fault_ip)
+posix like:
+        sighandler(int signum, siginfo_t * si, struct sigcontext * sg, void * fault_ip)
+*/
+
+#define SIGCONTEXT long _code, struct sigcontext * _sg, void *
+#define SIGCONTEXT_EXTRA_ARGS _code, _sg,
+
+/* really, really, rest of glibc expects that struct sigcontext is the last argument */
+#define GET_PC(ctx)	((void *) (_sg)->sc_eip)
+#define GET_FRAME(ctx)	((void *) (_sg)->sc_ebp)
+#define GET_STACK(ctx)	((void *) (_sg)->sc_esp)
+
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/start.S
@@ -0,0 +1,151 @@
+/* Startup code compliant to the ELF i386 ABI.
+   Copyright (C) 1995-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  The SVR4/i386 ABI (pages 3-31, 3-32) says that when the entry
+   point runs, most registers' values are unspecified, except for:
+
+   %edx		Contains a function pointer to be registered with `atexit'.
+		This is how the dynamic linker arranges to have DT_FINI
+		functions called for shared libraries that have been loaded
+		before this code runs.
+
+   %esp		The stack contains the arguments and environment:
+		0(%esp)			argc
+		4(%esp)			argv[0]
+		...
+		(4*argc)(%esp)		NULL
+		(4*(argc+1))(%esp)	envp[0]
+		...
+					NULL
+*/
+
+#include <libc-symbols.h>
+
+	weak_extern (_end)
+
+	.text
+	.globl _start
+	.type _start,@function
+_start:
+	/* Clear the frame pointer.  The ABI suggests this be done, to mark
+	   the outermost frame obviously.  */
+	xorl %ebp, %ebp
+
+	/* Extract the arguments as encoded on the stack and set up
+	   the arguments for `main': argc, argv.  envp will be determined
+	   later in __libc_start_main.  */
+	popl %esi		/* Pop the argument count.  */
+	movl %esp, %ecx		/* argv starts just at the current stack top.*/
+
+	/* Before pushing the arguments align the stack to a 16-byte
+	(SSE needs 16-byte alignment) boundary to avoid penalties from
+	misaligned accesses.  Thanks to Edward Seidl <seidl@janed.com>
+	for pointing this out.  */
+	andl $0xfffffff0, %esp
+	pushl %eax		/* Push garbage because we allocate
+				   28 more bytes.  */
+
+	/* Provide the highest stack address to the user code (for stacks
+	   which grow downwards).  */
+	pushl %esp
+
+	pushl %edx		/* Push address of the shared library
+				   termination function.  */
+
+#ifdef SHARED
+	/* Load PIC register.  */
+	call 1f
+	addl $_GLOBAL_OFFSET_TABLE_, %ebx
+
+	/* Push address of our own entry points to .fini and .init.  */
+	leal __libc_csu_fini@GOTOFF(%ebx), %eax
+	pushl %eax
+	leal __libc_csu_init@GOTOFF(%ebx), %eax
+	pushl %eax
+
+	pushl %ecx		/* Push second argument: argv.  */
+	pushl %esi		/* Push first argument: argc.  */
+
+	pushl main@GOT(%ebx)
+
+	/* Call the user's main function, and exit with its value.
+	   But let the libc call main.    */
+	call __libc_start_main@PLT
+#else
+	/* Push address of our own entry points to .fini and .init.  */
+	pushl $__libc_csu_fini
+	pushl $__libc_csu_init
+
+	pushl %ecx		/* Push second argument: argv.  */
+	pushl %esi		/* Push first argument: argc.  */
+
+	pushl $main
+
+	/* Call the user's main function, and exit with its value.
+	   But let the libc call main.    */
+	call __libc_start_main
+#endif
+
+	hlt			/* Crash if somehow `exit' does return.  */
+
+#ifdef SHARED
+1:	movl	(%esp), %ebx
+	ret
+#endif
+	/* just reference _end, 
+	   it is needed as global symbol for brk() usage,
+	   it is a dead code on purpose.  */
+#ifdef SHARED
+	leal _end@GOTOFF(%ebx), %eax
+#else
+	mov $_end, %eax
+#endif
+
+/* To fulfill the System V/i386 ABI we need this symbol.  Yuck, it's so
+   meaningless since we don't support machines < 80386.  */
+	.section .rodata
+	.globl _fp_hw
+_fp_hw:	.long 3
+	.size _fp_hw, 4
+	.type _fp_hw,@object
+
+/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.long 0
+	.weak data_start
+	data_start = __data_start
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/start_thread.S
@@ -0,0 +1,207 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* __start_thread (flags, stack, func, arg)
+   calls __rfork (flags), and in the child sets the stack pointer and then
+   calls _exit (func (arg)).
+   It cannot be done in portable C.  */
+
+#include <sysdep.h>
+#include <asm-syntax.h>
+#define SIG_SETMASK	3
+
+	.text
+ENTRY (__start_thread)
+	/* End FDE now, because in the child the unwind info will be
+	   wrong.  */
+	cfi_endproc
+
+	/* There is a window of a few instructions, right after the rfork
+	   system call, where the handling of a signal would write garbage
+	   into the stack shared by the parent and the child (assuming
+	   RFMEM is set in flags).  To solve this: 1. We block all signals
+	   around the rfork system call and unblock them afterwards in
+	   the parent and in the child (but only after changing the stack
+	   pointer).  2. The child accesses only values passed in registers
+	   and on its own stack.  This way, if the parent is scheduled to
+	   run first, and handles a signal, it will not affect the child;
+	   and if the child runs first, and handles a signal, it will use
+	   the child's stack and not affect the parent.
+	   We need to pass 7 words of info to the child: stack, func, arg,
+	   and the signal mask to restore.  Since we have only 4 call-saved
+	   registers available (%ebx, %esi, %edi, %ebp), we pass only the
+	   stack pointer in a register, and the rest through the child's
+	   stack.  */
+	pushl	%ebp
+	movl	%esp, %ebp
+	subl	$36, %esp
+	movl	%ebx, 32(%esp)
+
+	movl	8(%ebp), %eax	/* flags */
+	testl	$32, %eax	/* flags & RFMEM */
+	jz	L(simple)
+
+	/* Block all signals.  */
+	movl	$-1, %eax
+	movl	%eax, 16(%esp)
+	movl	%eax, 20(%esp)
+	movl	%eax, 24(%esp)
+	movl	%eax, 28(%esp)
+	leal	16(%esp), %eax
+	movl	$SIG_SETMASK, 4(%esp)
+	movl	%eax, 8(%esp)
+	movl	%eax, 12(%esp)
+	DO_CALL (sigprocmask, 3)
+	jb	L(error)
+
+	/* Copy all info to the child's stack.  */
+	movl	12(%ebp), %ebx	/* stack */
+	subl	$32, %ebx	/* room for func, arg, sigset_t */
+	andl	$-16, %ebx	/* make it 16-bytes aligned */
+	movl	16(%ebp), %eax	/* func */
+	movl	20(%ebp), %edx	/* arg */
+	movl	%eax, 4(%ebx)
+	movl	%edx, (%ebx)
+	movl	16(%esp), %eax	/* sigset_t word 0 */
+	movl	20(%esp), %edx	/* sigset_t word 1 */
+	movl	%eax, 16(%ebx)
+	movl	%edx, 20(%ebx)
+	movl	24(%esp), %eax	/* sigset_t word 2 */
+	movl	28(%esp), %edx	/* sigset_t word 3 */
+	movl	%eax, 24(%ebx)
+	movl	%edx, 28(%ebx)
+
+	/* Perform the rfork system call.  */
+	movl	8(%ebp), %eax	/* flags */
+	movl	%eax, 4(%esp)
+	DO_CALL (rfork, 1)
+	jb	L(error_unmask)
+
+	/* %edx is now 0 for the parent and 1 for the child.  */
+	testl	%edx, %edx
+	jnz	L(child)
+
+	/* Save the child pid, currently in %eax.  */
+	movl	%eax, %ebx
+
+	/* Restore the previous signal mask.  */
+	leal	16(%esp), %eax
+	movl	$SIG_SETMASK, 4(%esp)
+	movl	%eax, 8(%esp)
+	movl	$0, 12(%esp)
+	DO_CALL (sigprocmask, 3)
+
+	/* Return the child pid, currently in %ebx.  */
+	movl	%ebx, %eax
+	addl	$32, %esp
+	popl	%ebx
+	popl	%ebp
+	ret
+
+L(child):/* Here we are in the child thread.  */
+
+	/* Set the stack pointer.  */
+	movl	%ebx, %esp
+	/* Terminate the stack frame.  */
+	subl	%ebp, %ebp
+
+	movl	4(%esp), %edi
+
+	/* Restore the previous signal mask.  */
+	leal	16(%esp), %eax
+	movl	$SIG_SETMASK, 4(%esp)
+	movl	%eax, 8(%esp)
+	movl	$0, 12(%esp)
+	DO_CALL (sigprocmask, 3)
+
+L(child1):
+	/* Call func (arg).  */
+	call	*%edi
+
+	/* Call _exit.  */
+#ifdef PIC
+	call	L(here)
+L(here):
+	popl	%ebx
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebx
+#endif
+	pushl	%eax
+	call	HIDDEN_JUMPTARGET (_exit)
+
+L(simple):/* Simple case without signal mask handling.  */
+
+	/* Copy all info to the child's stack.  */
+	movl	12(%ebp), %ebx	/* stack */
+	subl	$8, %ebx	/* room for func, arg */
+	andl	$-16, %ebx	/* make it 16-bytes aligned */
+	movl	16(%ebp), %eax	/* func */
+	movl	20(%ebp), %edx	/* arg */
+	movl	%eax, 4(%ebx)
+	movl	%edx, (%ebx)
+
+	/* Perform the rfork system call.  */
+	movl	8(%ebp), %eax	/* flags */
+	movl	%eax, 4(%esp)
+	DO_CALL (rfork, 1)
+	jb	L(error)
+
+	/* %edx is now 0 for the parent and 1 for the child.  */
+	testl	%edx, %edx
+	jnz	L(simple_child)
+
+	/* Return the child pid, currently in %eax.  */
+	addl	$32, %esp
+	popl	%ebx
+	popl	%ebp
+L(pseudo_end):
+	ret
+
+L(simple_child):/* Here we are in the child thread.  */
+
+	/* Set the stack pointer.  */
+	movl	%ebx, %esp
+	/* Terminate the stack frame.  */
+	subl	%ebp, %ebp
+
+	movl	4(%esp), %edi
+
+	jmp	L(child1)
+
+L(error_unmask):
+
+	/* Save the error code, currently in %eax.  */
+	movl	%eax, %ebx
+
+	/* Restore the previous signal mask.  */
+	leal	16(%esp), %eax
+	movl	$SIG_SETMASK, 4(%esp)
+	movl	%eax, 8(%esp)
+	movl	$0, 12(%esp)
+	DO_CALL (sigprocmask, 3)
+
+	/* load saved error code */
+	movl	%ebx, %eax
+
+L(error):
+	addl	$32, %esp
+	popl	%ebx
+	popl	%ebp
+	jmp	SYSCALL_ERROR_LABEL
+	cfi_startproc
+PSEUDO_END (__start_thread)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/swapcontext.S
@@ -0,0 +1,32 @@
+/* swap current context.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text
+ENTRY(__swapcontext)
+        clc
+        DO_CALL (swapcontext, 2)
+        jb SYSCALL_ERROR_LABEL
+L(pseudo_end):
+	ret
+
+PSEUDO_END(__swapcontext)
+
+weak_alias(__swapcontext, swapcontext)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/sys/io.h
@@ -0,0 +1,184 @@
+/* Copyright (C) 1996, 2000, 2002, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_IO_H
+#define	_SYS_IO_H	1
+
+#ifdef _MACHINE_CPUFUNC_H_
+#error "This header must not be used in combination with <machine/cpufunc.h>."
+#endif
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* If TURN_ON is TRUE, request for permission to do direct i/o on the
+   port numbers in the range [FROM,FROM+NUM-1].  Otherwise, turn I/O
+   permission off for that range.  This call requires root privileges.
+
+   Portability note: not all kFreeBSD platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however. */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+                   int __turn_on) __THROW;
+
+/* Set the I/O privilege level to LEVEL.  If LEVEL>3, permission to
+   access any I/O port is granted.  This call requires root
+   privileges. */
+extern int iopl (int __level) __THROW;
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+static __inline unsigned char
+inb (unsigned short int port)
+{
+  unsigned char _v;
+
+  __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned char
+inb_p (unsigned short int port)
+{
+  unsigned char _v;
+
+  __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned short int
+inw (unsigned short int port)
+{
+  unsigned short _v;
+
+  __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned short int
+inw_p (unsigned short int port)
+{
+  unsigned short int _v;
+
+  __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned int
+inl (unsigned short int port)
+{
+  unsigned int _v;
+
+  __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned int
+inl_p (unsigned short int port)
+{
+  unsigned int _v;
+  __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline void
+outb (unsigned char value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outb_p (unsigned char value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+outw (unsigned short int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
+
+}
+
+static __inline void
+outw_p (unsigned short int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+outl (unsigned int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outl_p (unsigned int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+insb (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insw (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insl (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsb (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsw (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsl (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+#endif	/* GNU C */
+
+__END_DECLS
+#endif /* _SYS_IO_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/sys/perm.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1996, 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_PERM_H
+#define _SYS_PERM_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Set port input/output permissions.  */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+		   int __turn_on) __THROW;
+
+
+/* Change I/O privilege level.  */
+extern int iopl (int __level) __THROW;
+
+extern int i386_set_ioperm (unsigned long int __from, unsigned long int __num,
+			    int __turn_on) __THROW;
+
+/* Retrieve a contiguous range of port input/output permissions.  */
+extern int i386_get_ioperm (unsigned long int __from, unsigned long int *__num,
+			    int *__turned_on) __THROW;
+
+__END_DECLS
+
+#endif	/* _SYS_PERM_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/sys/vm86.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_VM86_H
+#define _SYS_VM86_H	1
+
+#include <features.h>
+
+/* Possible values for the 'cmd' argument to i386_vm86.  */
+enum
+  {
+    VM86_INIT = 1,
+#define VM86_INIT VM86_INIT
+    VM86_GET_VME = 3
+#define VM86_GET_VME VM86_GET_VME
+  };
+
+/* Argument structure for VM86_INIT.  */
+struct vm86_init_args
+  {
+    int debug;
+    int cpu_type;
+    unsigned char int_map[32];
+  };
+
+/* Argument structure for VM86_GET_VME.  */
+struct vm86_vme_args
+  {
+    int state;
+  };
+
+__BEGIN_DECLS
+
+extern int i386_vm86 (int __cmd, void *__arg);
+
+__END_DECLS
+
+#endif	/* _SYS_VM86_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/sys_fork.S
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991-1992, 1994-1995, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text;
+ENTRY (__syscall_fork)
+	DO_CALL (fork, 0)
+	jb SYSCALL_ERROR_LABEL;
+	/* R1 is now 0 for the parent and 1 for the child.  Decrement it to
+	   make it -1 (all bits set) for the parent, and 0 (no bits set)
+	   for the child.  Then AND it with R0, so the parent gets
+	   R0&-1==R0, and the child gets R0&0==0.  */
+	decl r1
+	andl r1, r0
+L(pseudo_end):
+	ret
+PSEUDO_END (__syscall_fork)
+libc_hidden_def (__syscall_fork)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/sysarch.h
@@ -0,0 +1,81 @@
+/* Parameters for the architecture specific system call.  i386 version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYSARCH_H
+#define _SYSARCH_H	1
+
+#include <features.h>
+
+/* Function that can be used as first argument to 'sysarch'.  */
+enum
+  {
+    I386_GET_LDT = 0,
+#define I386_GET_LDT I386_GET_LDT
+    I386_SET_LDT = 1,
+#define I386_SET_LDT I386_SET_LDT
+    I386_GET_IOPERM = 3,
+#define I386_GET_IOPERM I386_GET_IOPERM
+    I386_SET_IOPERM = 4,
+#define I386_SET_IOPERM I386_SET_IOPERM
+    I386_VM86 = 6,
+#define I386_VM86 I386_VM86
+    I386_GET_FSBASE = 7,
+#define I386_GET_FSBASE I386_GET_FSBASE
+    I386_SET_FSBASE = 8,
+#define I386_SET_FSBASE I386_SET_FSBASE
+    I386_GET_GSBASE = 9,
+#define I386_GET_GSBASE I386_GET_GSBASE
+    I386_SET_GSBASE = 10
+#define I386_SET_GSBASE I386_SET_GSBASE
+  };
+
+/* Argument struct for I386_GET_LDT and I386_SET_LDT.  */
+struct i386_ldt_args
+  {
+    int start;
+    union descriptor *descs;
+    int num;
+  };
+
+/* Argument struct for I386_GET_IOPERM and I386_SET_IOPERM.  */
+struct i386_ioperm_args
+  {
+    unsigned int start;
+    unsigned int length;
+    int enable;
+  };
+
+/* Argument struct for I386_VM86.  */
+struct i386_vm86_args
+  {
+    int sub_op;
+    void *sub_args;
+  };
+
+__BEGIN_DECLS
+
+extern int sysarch (int __cmd, void *__arg);
+
+#ifdef _LIBC
+extern int __sysarch (int __cmd, void *__arg);
+#endif
+
+__END_DECLS
+
+#endif /* _SYSARCH_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/syscall.S
@@ -0,0 +1,34 @@
+/* Copyright (C) 1993, 1995-1998, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+	  .text;
+ENTRY (__syscall)
+	popl %ecx		/* Pop return address into %ecx.  */
+	cfi_adjust_cfa_offset (-4)
+	movl 0(%esp), %eax	/* Load syscall number into %eax. */
+	int $0x80		/* Do the system call.  */
+	pushl %ecx		/* Push back return address.  */
+	cfi_adjust_cfa_offset (4)
+	jb SYSCALL_ERROR_LABEL;	/* Jump to error handler if error.  */
+
+L(pseudo_end):
+	ret			/* Return to caller.  */
+PSEUDO_END (__syscall)
+weak_alias (__syscall, syscall)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/syscalls-internal.h
@@ -0,0 +1,157 @@
+/* generally used "internal syscalls"
+   Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef KFREEBSD_INTERNAL_SYSCALLS_H
+#define KFREEBSD_INTERNAL_SYSCALLS_H
+
+#include <sys/syscall.h>
+
+/* 
+   for now, we do not care whether syscall succeeded,
+   we do not have defined 
+   INTERNAL_SYSCALL_ERROR_P and INTERNAL_SYSCALL_ERRNO
+   we do not store errno at all
+   to be sure, we return void
+*/
+
+#undef INTERNAL_SYSCALL_DECL
+#undef INTERNAL_SYSCALL_NCS
+#undef INTERNAL_SYSCALL
+#undef INTERNAL_SYSCALL_ERROR_P
+#undef INTERNAL_SYSCALL_ERRNO
+
+#define INTERNAL_SYSCALL_DECL(err)		\
+  do { } while (0)
+
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+  INTERNAL_SYSCALL_##name(name, err, nr, ##args)
+
+
+#define INTERNAL_SYSCALL_clock_gettime(name, err, nr, clkid, ts) \
+(void)({                                        \
+  register long int _a1 = (long int) (clkid);	\
+  register long int _a2 = (long int) (ts);	\
+  register long int result;			\
+  register long int _trash;			\
+  asm volatile (                                \
+                "pushl %4\n\t"                  \
+                "pushl %3\n\t"                  \
+                "pushl %2\n\t"                  \
+                "int $0x80\n\t"                 \
+                "addl $12,%%esp\n\t"		\
+                : "=a" (result),		\
+                  "=d" (_trash)                 \
+                : "0" ((long int) SYS_##name),	\
+                  "ri" (_a1),			\
+                  "ri" (_a2)			\
+                : "memory", "cc" );             \
+  result;                                       \
+})
+
+#define INTERNAL_SYSCALL_close(name, err, nr, fd) \
+(void)({                                        \
+  register long int _a1 = (long int) (fd);	\
+  register long int result;			\
+  asm volatile (                                \
+                "pushl %2\n\t"                  \
+                "pushl %1\n\t"                  \
+                "int $0x80\n\t"                 \
+                "popl %2\n\t"                   \
+                "popl %2\n\t"                   \
+                : "=a" (result)                 \
+                : "0" ((long int) SYS_##name),	\
+                  "d" (_a1)                   	\
+                : "memory", "cc" );             \
+  result;                                       \
+})
+
+#define INTERNAL_SYSCALL_kill(name, err, nr, pid, sig) \
+(void)({                                        \
+  register long int _a1 = (long int) (pid);	\
+  register long int _a2 = (long int) (sig);	\
+  register long int result;			\
+  register long int _trash;			\
+  asm volatile (                                \
+                "pushl %4\n\t"                  \
+                "pushl %3\n\t"                  \
+                "pushl %2\n\t"                  \
+                "int $0x80\n\t"                 \
+                "addl $12,%%esp\n\t"		\
+                : "=a" (result),		\
+                  "=d" (_trash)                 \
+                : "0" ((long int) SYS_##name),	\
+                  "ri" (_a1),			\
+                  "ri" (_a2)			\
+                : "memory", "cc" );             \
+  result;                                       \
+})
+
+#define INTERNAL_SYSCALL_write(name, err, nr, fd, buf, cnt) \
+(void)({                                        \
+  register long int _a1 = (long int) (fd);	\
+  register long int _a2 = (long int) (buf);	\
+  register long int _a3 = (long int) (cnt);	\
+  register long int result;			\
+  register long int _trash;			\
+  asm volatile (                                \
+                "pushl %5\n\t"                  \
+                "pushl %4\n\t"                  \
+                "pushl %3\n\t"                  \
+                "pushl %2\n\t"                  \
+                "int $0x80\n\t"                 \
+                "addl $16,%%esp\n\t"		\
+                : "=a" (result),		\
+                  "=d" (_trash)                 \
+                : "0" ((long int) SYS_##name),	\
+                  "ri" (_a1),			\
+                  "ri" (_a2),			\
+                  "ri" (_a3)			\
+              /*   may be even "g" constraint could be used */ \
+              /*   but we have to worry about esp register and esp based address */ \
+                : "memory", "cc" );             \
+  result;                                       \
+})
+
+#define INTERNAL_SYSCALL_writev(name, err, nr, fd, iov, cnt) \
+(void)({                                        \
+  register long int _a1 = (long int) (fd);	\
+  register long int _a2 = (long int) (iov);	\
+  register long int _a3 = (long int) (cnt);	\
+  register long int result;			\
+  register long int _trash;			\
+  asm volatile (                                \
+                "pushl %5\n\t"                  \
+                "pushl %4\n\t"                  \
+                "pushl %3\n\t"                  \
+                "pushl %2\n\t"                  \
+                "int $0x80\n\t"                 \
+                "addl $16,%%esp\n\t"		\
+                : "=a" (result),		\
+                  "=d" (_trash)                 \
+                : "0" ((long int) SYS_##name),	\
+                  "ri" (_a1),			\
+                  "ri" (_a2),			\
+                  "ri" (_a3)			\
+              /*   may be even "g" constraint could be used */ \
+              /*   but we have to worry about esp register and esp based address */ \
+                : "memory", "cc" );             \
+  result;                                       \
+})
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/sysdep.S
@@ -0,0 +1,38 @@
+/* Copyright (C) 1995-1998, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+/* The following code is only used in the shared library when we
+   compile the reentrant version.  Otherwise each system call defines
+   its own version.  */
+
+#ifndef PIC
+
+/* The syscall stubs jump here when they detect an error.
+   The code for FreeBSD is identical to the canonical Unix/i386 code.  */
+
+#undef CALL_MCOUNT
+#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %eax.  */
+
+	.text
+ENTRY (__syscall_error)
+#define __syscall_error __syscall_error_1
+#include <sysdeps/unix/i386/sysdep.S>
+
+#endif	/* !PIC */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/sysdep.h
@@ -0,0 +1,200 @@
+/* Copyright (C) 1992,1993,1995-2000,2002,2003,2004
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _FREEBSD_I386_SYSDEP_H
+#define _FREEBSD_I386_SYSDEP_H 1
+
+/* There is some commonality.  */
+#include <sysdeps/unix/i386/sysdep.h>
+/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
+#include <dl-sysdep.h>
+#include <tls.h>
+
+#ifdef __ASSEMBLER__
+
+/* We don't want the label for the error handle to be global when we define
+   it here.  */
+#ifdef PIC
+# define SYSCALL_ERROR_LABEL 0f
+#else
+# define SYSCALL_ERROR_LABEL syscall_error
+#endif
+
+#undef	PSEUDO
+#define	PSEUDO(name, syscall_name, args)				      \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args);					      \
+    jb SYSCALL_ERROR_LABEL;						      \
+  L(pseudo_end):
+
+#undef	PSEUDO_END
+#define	PSEUDO_END(name)						      \
+  SYSCALL_ERROR_HANDLER							      \
+  END (name)
+
+#undef	PSEUDO_NOERRNO
+#define	PSEUDO_NOERRNO(name, syscall_name, args)			      \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args)
+
+#undef	PSEUDO_END_NOERRNO
+#define	PSEUDO_END_NOERRNO(name)					      \
+  END (name)
+
+#define ret_NOERRNO ret
+
+/* The function has to return the error code.  */
+#undef	PSEUDO_ERRVAL
+#define	PSEUDO_ERRVAL(name, syscall_name, args) \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args);					      \
+
+#undef	PSEUDO_END_ERRVAL
+#define	PSEUDO_END_ERRVAL(name) \
+  END (name)
+
+#define ret_ERRVAL ret
+
+#ifndef PIC
+# define SYSCALL_ERROR_HANDLER	/* Nothing here; code in sysdep.S is used.  */
+#else
+
+# if RTLD_PRIVATE_ERRNO
+#  define SYSCALL_ERROR_HANDLER						      \
+0:SETUP_PIC_REG(cx);							      \
+  addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
+  movl %eax, rtld_errno@GOTOFF(%ecx);					      \
+  orl $-1, %eax;							      \
+  jmp L(pseudo_end);
+
+# elif defined _LIBC_REENTRANT
+
+#  if IS_IN (libc)
+#   define SYSCALL_ERROR_ERRNO __libc_errno
+#  else
+#   define SYSCALL_ERROR_ERRNO errno
+#  endif
+#  define SYSCALL_ERROR_HANDLER					      \
+0:SETUP_PIC_REG (cx);							      \
+  addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
+  movl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%ecx), %ecx;			      \
+  SYSCALL_ERROR_HANDLER_TLS_STORE (%eax, %ecx);				      \
+  orl $-1, %eax;							      \
+  jmp L(pseudo_end);
+#  ifndef NO_TLS_DIRECT_SEG_REFS
+#   define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
+  movl src, %gs:(destoff)
+#  else
+#   define SYSCALL_ERROR_HANDLER_TLS_STORE(src, destoff)		      \
+  addl %gs:0, destoff;							      \
+  movl src, (destoff)
+#  endif
+# else
+/* Store (%eax) into errno through the GOT.  */
+#  define SYSCALL_ERROR_HANDLER						      \
+0:SETUP_PIC_REG(cx);							      \
+  addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
+  movl errno@GOT(%ecx), %ecx;						      \
+  movl %eax, (%ecx);							      \
+  orl $-1, %eax;							      \
+  jmp L(pseudo_end);
+# endif	/* _LIBC_REENTRANT */
+#endif	/* PIC */
+
+/*
+    FreeBSD expects the system call arguments on the stack,
+   syscall number is in %eax.
+   return value is in %eax + %edx
+   error is signaled via cflags.
+   all other data registers are preserved
+
+	syscall number	%eax	     call-clobbered
+
+   The stack layout upon entering the function is:
+
+	20(%esp)	Arg# 5
+	16(%esp)	Arg# 4
+	12(%esp)	Arg# 3
+	 8(%esp)	Arg# 2
+	 4(%esp)	Arg# 1
+	  (%esp)	Return address
+
+   (Of course a function with say 3 arguments does not have entries for
+   arguments 4 and 5.)
+
+*/
+
+#undef	DO_CALL
+#define DO_CALL(syscall_name, args)			      		      \
+    movl $SYS_ify (syscall_name), %eax;					      \
+    int $0x80								      \
+
+#else	/* !__ASSEMBLER__ */
+
+#include <syscalls-inline.h>
+
+/* Consistency check for position-independent code.  */
+#if defined __PIC__ && !__GNUC_PREREQ (5,0)
+# define check_consistency()						      \
+  ({ int __res;								      \
+     __asm__ __volatile__						      \
+       (LOAD_PIC_REG_STR (cx) ";"					      \
+	"subl %%ebx, %%ecx;"						      \
+	"je 1f;"							      \
+	"ud2;"								      \
+	"1:\n"								      \
+	: "=c" (__res));						      \
+     __res; })
+#endif
+
+#endif	/* __ASSEMBLER__ */
+
+
+/* Pointer mangling support.  */
+#if IS_IN (rtld)
+/* We cannot use the thread descriptor because in ld.so we use setjmp
+   earlier than the descriptor is initialized.  Using a global variable
+   is too complicated here since we have no PC-relative addressing mode.  */
+#else
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(reg)	xorl %gs:POINTER_GUARD, reg;		      \
+				roll $9, reg
+#  define PTR_DEMANGLE(reg)	rorl $9, reg;				      \
+				xorl %gs:POINTER_GUARD, reg
+# else
+#  define PTR_MANGLE(var)	asm ("xorl %%gs:%c2, %0\n"		      \
+				     "roll $9, %0"			      \
+				     : "=r" (var)			      \
+				     : "0" (var),			      \
+				       "i" (offsetof (tcbhead_t,	      \
+						      pointer_guard)))
+#  define PTR_DEMANGLE(var)	asm ("rorl $9, %0\n"			      \
+				     "xorl %%gs:%c2, %0"		      \
+				     : "=r" (var)			      \
+				     : "0" (var),			      \
+				       "i" (offsetof (tcbhead_t,	      \
+						      pointer_guard)))
+# endif
+#endif
+
+#endif /* _FREEBSD_I386_SYSDEP_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/ucontext_i.h
@@ -0,0 +1,38 @@
+/* Offsets and other constants needed in the *context() function
+   implementation.
+   Copyright (C) 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Offsets of the fields in the ucontext_t structure.  */
+#define oSIGMASK	0
+#define oGS		20
+#define oFS		24
+#define oEDI		36
+#define oESI		40
+#define oEBP		44
+#define oEBX		52
+#define oEDX		56
+#define oECX		60
+#define oEAX		64
+
+#define oEIP		76
+#define oESP		88
+
+#define oLINK		656
+#define oSS_SP		660
+#define oSS_SIZE	664
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/vfork.S
@@ -0,0 +1,59 @@
+/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+/* Clone the calling process, but without copying the whole address space.
+   The calling process is suspended until the new process exits or is
+   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.  */
+
+ENTRY (__vfork)
+
+	/* Pop the return PC value into ECX.  */
+	popl	%ecx
+	cfi_adjust_cfa_offset(-4)
+	cfi_register (%eip, %ecx)
+
+	/* Perform the system call.  */
+	DO_CALL (vfork, 0)
+	jb	L(error)	/* Branch forward if it failed.  */
+
+	/* In the parent process, %edx == 0, %eax == child pid.  */
+	/* In the child process, %edx == 1, %eax == parent pid.  */
+
+	/* Change %eax to be 0 in the child process.  */
+	decl	%edx
+	andl	%edx, %eax
+
+	/* Jump to the return PC.  */
+	jmp	*%ecx
+
+L(error):
+	/* Push back the return PC.  */
+	pushl	%ecx
+	cfi_adjust_cfa_offset(4)
+
+	/* Branch to the error handler, hidden in PSEUDO_END.  */
+	jmp	SYSCALL_ERROR_LABEL
+L(pseudo_end):
+	ret
+PSEUDO_END (__vfork)
+libc_hidden_def (__vfork)
+
+weak_alias (__vfork, vfork)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/if_index.c
@@ -0,0 +1,317 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <net/if.h>
+#include <sys/sysctl.h>
+#include <sys/socket.h>
+#include <net/route.h>
+#include <net/if_dl.h>
+#include <alloca.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+
+typedef int (*if_fn) (void *private, unsigned int index, const char *name);
+
+/* Iterate through all present interfaces.
+   Call FN once for every interface, returning immediately if FN returns
+   a nonzero value.  */
+static void
+if_iterate (if_fn fn, void *private)
+{
+  int request[6] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
+  char *buf;
+  size_t bufsize = 512;
+  char *bufend;
+  char *p;
+
+  /* Call the kernel function sysctl_iflist() in /usr/src/sys/net/rtsock.c.  */
+  for (;;)
+    {
+      buf = alloca (bufsize);
+      if (__sysctl (request, 6, buf, &bufsize, NULL, 0) >= 0)
+	break;
+      if (errno != ENOMEM)
+	return;
+      bufsize *= 2;
+    }
+
+  bufend = buf + bufsize;
+  for (p = buf; p < bufend; )
+    {
+      struct if_msghdr *msg = (struct if_msghdr *) p;
+
+      if (msg->ifm_version != RTM_VERSION)
+	abort ();
+
+      switch (msg->ifm_type)
+	{
+	case RTM_IFINFO:
+	  if (msg->ifm_addrs & RTA_IFP)
+	    {
+	      unsigned int index;
+	      struct sockaddr_dl *sdl;
+	      char namebuf[IFNAMSIZ + 1];
+	      size_t namelen;
+
+	      index = msg->ifm_index;
+	      if (index == 0)
+		abort ();
+
+	      /* FIXME: 'struct if_msghdr' contains a 'struct if_data' which in turns
+	         contains 'unsigned long' values. Their size therefore depends on
+		 the running kernel (32 or 64 bits). This should be fixed in the
+		 compat layer of the kernel. Meanwhile just workaround the bug here/ */
+#if 0
+	      sdl = (struct sockaddr_dl *) (msg + 1);
+#else
+	      sdl = (struct sockaddr_dl *) (p + msg->ifm_msglen - sizeof(struct sockaddr_dl) - 2);
+#endif
+	      namelen = sdl->sdl_nlen;
+	      /* Avoid overflowing namebuf[].  */
+	      if (namelen > IFNAMSIZ)
+		namelen = IFNAMSIZ;
+	      memcpy (namebuf, sdl->sdl_data, namelen);
+	      namebuf[namelen] = '\0';
+
+	      /* Call FN now.  */
+	      if (fn (private, index, namebuf))
+		return;
+	    }
+	  break;
+
+	case RTM_NEWADDR:
+	  break;
+
+	default:
+	  abort ();
+	}
+
+      p += msg->ifm_msglen;
+    }
+}
+
+/* ------------------------------------------------------------------------- */
+
+struct nametoindex_locals
+  {
+    const char *name;
+    unsigned int index;
+  };
+
+static int
+nametoindex_aux (void *private, unsigned int index, const char *name)
+{
+  struct nametoindex_locals *l = (struct nametoindex_locals *) private;
+  if (strcmp (name, l->name) == 0)
+    {
+      l->index = index;
+      return 1;
+    }
+  return 0;
+}
+
+/* Return the index of an interface given by name.  */
+unsigned int
+__if_nametoindex (const char *ifname)
+{
+  struct nametoindex_locals l;
+
+  l.name = ifname;
+  l.index = 0;
+  if_iterate (nametoindex_aux, &l);
+
+  return l.index;
+}
+libc_hidden_def (__if_nametoindex)
+weak_alias (__if_nametoindex, if_nametoindex)
+libc_hidden_weak (if_nametoindex)
+
+/* ------------------------------------------------------------------------- */
+
+struct indextoname_locals
+  {
+    unsigned int index;
+    char *name;
+    char *retval;
+  };
+
+static int
+indextoname_aux (void *private, unsigned int index, const char *name)
+{
+  struct indextoname_locals *l = (struct indextoname_locals *) private;
+  if (index == l->index)
+    {
+      strncpy (l->name, name, IF_NAMESIZE);
+      l->retval = l->name;
+      return 1;
+    }
+  __set_errno (ENXIO);
+  return 0;
+}
+
+/* Return the name of an interface given by name.  */
+char *
+__if_indextoname (unsigned int ifindex, char *ifname)
+{
+  struct indextoname_locals l;
+
+  l.index = ifindex;
+  l.name = ifname;
+  l.retval = NULL;
+  if_iterate (indextoname_aux, &l);
+  return l.retval;
+}
+weak_alias (__if_indextoname, if_indextoname)
+libc_hidden_weak (if_indextoname)
+
+/* ------------------------------------------------------------------------- */
+
+struct nameindex_locals
+  {
+    /* Resizable array of 'struct if_nameindex'.  */
+    struct if_nameindex *s_array;
+    size_t s_len;
+    size_t s_allocated;
+    /* Resizable array of char.  */
+    char *c_array;
+    size_t c_len;
+    size_t c_allocated;
+    /* Out-of-memory indicator.  */
+    int oom;
+  };
+
+static void
+add_s (struct nameindex_locals *l, unsigned int index, char *name)
+{
+  if (l->s_len == l->s_allocated)
+    {
+      size_t new_allocated = 2 * l->s_allocated + 1;
+      struct if_nameindex *new_array =
+	(struct if_nameindex *)
+	realloc (l->s_array, new_allocated * sizeof (struct if_nameindex));
+      if (new_array == NULL)
+	{
+	  l->oom = 1;
+	  return;
+	}
+      l->s_array = new_array;
+      l->s_allocated = new_allocated;
+    }
+  /* Now l->s_len < l->s_allocated.  */
+  l->s_array[l->s_len].if_index = index;
+  l->s_array[l->s_len].if_name = name;
+  l->s_len++;
+}
+
+static __inline size_t
+add_c (struct nameindex_locals *l, const char *name)
+{
+  size_t n = strlen (name) + 1;
+  size_t result_offset;
+  if (l->c_len + n > l->c_allocated)
+    {
+      size_t new_allocated =
+	(l->c_len + n < 2 * l->c_allocated + 1
+	 ? 2 * l->c_allocated + 1
+	 : l->c_len + n);
+      char *new_array = (char *) realloc (l->c_array, new_allocated);
+      if (new_array == NULL)
+	{
+	  l->oom = 1;
+	  return 0;
+	}
+      l->c_array = new_array;
+      l->c_allocated = new_allocated;
+    }
+  /* Now l->c_len + n <= l->c_allocated.  */
+  result_offset = l->c_len;
+  memcpy (l->c_array + l->c_len, name, n);
+  l->c_len += n;
+  return result_offset;
+}
+
+static int
+nameindex_aux (void *private, unsigned int index, const char *name)
+{
+  struct nameindex_locals *l = (struct nameindex_locals *) private;
+
+  size_t name_offset = add_c (l, name);
+  if (!l->oom)
+    {
+      add_s (l, index, (char *) NULL + name_offset);
+      if (!l->oom)
+	return 0;
+    }
+  return 1;
+}
+
+/* Return an array of 'struct if_nameindex', one for each present
+   interface.  */
+struct if_nameindex *
+__if_nameindex (void)
+{
+  struct nameindex_locals l;
+
+  l.s_array = NULL; l.s_len = 0; l.s_allocated = 0;
+  l.c_array = NULL; l.c_len = 0; l.c_allocated = 0;
+  l.oom = 0;
+  if_iterate (nameindex_aux, &l);
+  if (!l.oom)
+    {
+      /* Convert all offsets to real pointers.  */
+      struct if_nameindex *p;
+      struct if_nameindex *p_end;
+
+      for (p = l.s_array, p_end = p + l.s_len; p < p_end; p++)
+	p->if_name = l.c_array + (p->if_name - (char *) NULL);
+
+      /* Add a terminating entry.  */
+      add_s (&l, 0, NULL);
+    }
+  if (l.oom)
+    {
+      free (l.s_array);
+      free (l.c_array);
+      __set_errno (ENOMEM);
+      return NULL;
+    }
+  return l.s_array;
+}
+weak_alias (__if_nameindex, if_nameindex)
+libc_hidden_weak (if_nameindex)
+
+/* ------------------------------------------------------------------------- */
+
+/* Free an array returned by if_nameindex().  */
+void
+__if_freenameindex (struct if_nameindex *ifn)
+{
+  if (ifn != NULL)
+    {
+      /* Free c_array.  */
+      free (ifn[0].if_name);
+      /* Free s_array.  */
+      free (ifn);
+    }
+}
+libc_hidden_def (__if_freenameindex)
+weak_alias (__if_freenameindex, if_freenameindex)
+libc_hidden_weak (if_freenameindex)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ifaddrs.c
@@ -0,0 +1,382 @@
+/*	$KAME: getifaddrs.c,v 1.9 2001/08/20 02:31:20 itojun Exp $	*/
+
+/*
+ * Copyright (c) 1995, 1999
+ *	Berkeley Software Design, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	BSDI getifaddrs.c,v 2.12 2000/02/23 14:51:59 dab Exp
+ */
+
+#include <sys/cdefs.h>
+
+ /*
+__FBSDID("$FreeBSD: src/lib/libc/net/getifaddrs.c,v 1.6 2002/07/25 08:08:30 ume Exp $");
+ */
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <net/if.h>
+
+#ifdef	NET_RT_IFLIST
+#include <sys/param.h>
+#include <net/route.h>
+#include <sys/sysctl.h>
+#include <net/if_dl.h>
+#else
+#error NET_RT_IFLIST is required
+#endif
+
+#include <errno.h>
+#include <ifaddrs.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if !defined(AF_LINK)
+#define	SA_LEN(sa)	sizeof(struct sockaddr)
+#endif
+
+#if !defined(SA_LEN)
+#define	SA_LEN(sa)	(sa)->sa_len
+#endif
+
+#define	SALIGN	(sizeof(long) - 1)
+#define	SA_RLEN(sa)	((sa)->sa_len ? (((sa)->sa_len + SALIGN) & ~SALIGN) : (SALIGN + 1))
+
+#ifndef	ALIGNBYTES
+/*
+ * On systems with a routing socket, ALIGNBYTES should match the value
+ * that the kernel uses when building the messages.
+ */
+#define	ALIGNBYTES	XXX
+#endif
+#ifndef	ALIGN
+#define	ALIGN(p)	(((u_long)(p) + ALIGNBYTES) &~ ALIGNBYTES)
+#endif
+
+#define	HAVE_IFM_DATA
+#define MAX_SYSCTL_TRY 5
+
+int
+__getifaddrs(struct ifaddrs **pif)
+{
+	int icnt = 1;
+	int dcnt = 0;
+	int ncnt = 0;
+#ifdef	NET_RT_IFLIST
+	int ntry = 0;
+	int mib[6];
+	size_t needed;
+	char *buf;
+	char *next;
+	struct ifaddrs *cif = 0;
+	char *p, *p0;
+	struct rt_msghdr *rtm;
+	struct if_msghdr *ifm;
+	struct ifa_msghdr *ifam;
+	struct sockaddr_dl *dl;
+	struct sockaddr *sa;
+	struct ifaddrs *ifa, *ift;
+	u_short idx = 0;
+#else	/* NET_RT_IFLIST */
+#endif	/* NET_RT_IFLIST */
+	int i;
+	size_t len, alen;
+	char *data;
+	char *names;
+
+#ifdef	NET_RT_IFLIST
+	mib[0] = CTL_NET;
+	mib[1] = PF_ROUTE;
+	mib[2] = 0;             /* protocol */
+	mib[3] = 0;             /* wildcard address family */
+	mib[4] = NET_RT_IFLIST;
+	mib[5] = 0;             /* no flags */
+	do {
+		/*
+		 * We'll try to get addresses several times in case that
+		 * the number of addresses is unexpectedly increased during
+		 * the two sysctl calls.  This should rarely happen, but we'll
+		 * try to do our best for applications that assume success of
+		 * this library (which should usually be the case).
+		 * Portability note: since FreeBSD does not add margin of
+		 * memory at the first sysctl, the possibility of failure on
+		 * the second sysctl call is a bit higher.
+		 */
+
+		if (__sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
+			return (-1);
+		if ((buf = malloc(needed)) == NULL)
+			return (-1);
+		if (__sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
+			if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) {
+				free(buf);
+				return (-1);
+			}
+			free(buf);
+			buf = NULL;
+		}
+	} while (buf == NULL);
+
+	for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
+		rtm = (struct rt_msghdr *)(void *)next;
+		if (rtm->rtm_version != RTM_VERSION)
+			continue;
+		switch (rtm->rtm_type) {
+		case RTM_IFINFO:
+			ifm = (struct if_msghdr *)(void *)rtm;
+			if (ifm->ifm_addrs & RTA_IFP) {
+				idx = ifm->ifm_index;
+				++icnt;
+				dl = (struct sockaddr_dl *)(void *)(ifm + 1);
+				/* XXX: smooth over a kfreebsd 9.0->10.1 ABI break */
+				if (rtm->rtm_msglen == 152) {
+					/* on kfreebsd-i386 9.0, struct rt_msghdr is 96 bytes */
+					dl = (struct sockaddr_dl *)((char *)ifm + 96);
+				}
+				if (rtm->rtm_msglen == 156) {
+					/* on kfreebsd-i386 10.1, struct rt_msghdr is 100 bytes */
+					dl = (struct sockaddr_dl *)((char *)ifm + 100);
+				}
+				dcnt += SA_RLEN((struct sockaddr *)(void*)dl) +
+				    ALIGNBYTES;
+#ifdef	HAVE_IFM_DATA
+				dcnt += sizeof(ifm->ifm_data);
+#endif	/* HAVE_IFM_DATA */
+				ncnt += dl->sdl_nlen + 1;
+			} else
+				idx = 0;
+			break;
+
+		case RTM_NEWADDR:
+			ifam = (struct ifa_msghdr *)(void *)rtm;
+			if (idx && ifam->ifam_index != idx)
+			{
+				errno = EINVAL;		/* this cannot happen */
+				return -1;
+			};
+#define	RTA_MASKS	(RTA_NETMASK | RTA_IFA | RTA_BRD)
+			if (idx == 0 || (ifam->ifam_addrs & RTA_MASKS) == 0)
+				break;
+			p = (char *)(void *)(ifam + 1);
+			++icnt;
+#ifdef	HAVE_IFAM_DATA
+			dcnt += sizeof(ifam->ifam_data) + ALIGNBYTES;
+#endif	/* HAVE_IFAM_DATA */
+			/* Scan to look for length of address */
+			alen = 0;
+			for (p0 = p, i = 0; i < RTAX_MAX; i++) {
+				if ((RTA_MASKS & ifam->ifam_addrs & (1 << i))
+				    == 0)
+					continue;
+				sa = (struct sockaddr *)(void *)p;
+				len = SA_RLEN(sa);
+				if (i == RTAX_IFA) {
+					alen = len;
+					break;
+				}
+				p += len;
+			}
+			for (p = p0, i = 0; i < RTAX_MAX; i++) {
+				if ((RTA_MASKS & ifam->ifam_addrs & (1 << i))
+				    == 0)
+					continue;
+				sa = (struct sockaddr *)(void *)p;
+				len = SA_RLEN(sa);
+				if (i == RTAX_NETMASK && SA_LEN(sa) == 0)
+					dcnt += alen;
+				else
+					dcnt += len;
+				p += len;
+			}
+			break;
+		}
+	}
+#else	/* NET_RT_IFLIST */
+#endif	/* NET_RT_IFLIST */
+
+	if (icnt + dcnt + ncnt == 1) {
+		*pif = NULL;
+		free(buf);
+		return (0);
+	}
+	data = malloc(sizeof(struct ifaddrs) * icnt + dcnt + ncnt);
+	if (data == NULL) {
+		free(buf);
+		return(-1);
+	}
+
+	ifa = (struct ifaddrs *)(void *)data;
+	data += sizeof(struct ifaddrs) * icnt;
+	names = data + dcnt;
+
+	memset(ifa, 0, sizeof(struct ifaddrs) * icnt);
+	ift = ifa;
+
+#ifdef	NET_RT_IFLIST
+	idx = 0;
+	for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
+		rtm = (struct rt_msghdr *)(void *)next;
+		if (rtm->rtm_version != RTM_VERSION)
+			continue;
+		switch (rtm->rtm_type) {
+		case RTM_IFINFO:
+			ifm = (struct if_msghdr *)(void *)rtm;
+			if (ifm->ifm_addrs & RTA_IFP) {
+				idx = ifm->ifm_index;
+				dl = (struct sockaddr_dl *)(void *)(ifm + 1);
+				/* XXX: smooth over a kfreebsd 9.0->10.1 ABI break */
+				if (rtm->rtm_msglen == 152) {
+					/* on kfreebsd-i386 9.0, struct rt_msghdr is 96 bytes */
+					dl = (struct sockaddr_dl *)((char *)ifm + 96);
+				}
+				if (rtm->rtm_msglen == 156) {
+					/* on kfreebsd-i386 10.1, struct rt_msghdr is 100 bytes */
+					dl = (struct sockaddr_dl *)((char *)ifm + 100);
+				}
+
+				cif = ift;
+				ift->ifa_name = names;
+				ift->ifa_flags = (int)ifm->ifm_flags;
+				memcpy(names, dl->sdl_data,
+				    (size_t)dl->sdl_nlen);
+				names[dl->sdl_nlen] = 0;
+				names += dl->sdl_nlen + 1;
+
+				ift->ifa_addr = (struct sockaddr *)(void *)data;
+				memcpy(data, dl,
+				    (size_t)SA_LEN((struct sockaddr *)
+				    (void *)dl));
+				data += SA_RLEN((struct sockaddr *)(void *)dl);
+
+#ifdef	HAVE_IFM_DATA
+				/* ifm_data needs to be aligned */
+				ift->ifa_data = data = (void *)ALIGN(data);
+				memcpy(data, &ifm->ifm_data, sizeof(ifm->ifm_data));
+ 				data += sizeof(ifm->ifm_data);
+#else	/* HAVE_IFM_DATA */
+				ift->ifa_data = NULL;
+#endif	/* HAVE_IFM_DATA */
+
+				ift = (ift->ifa_next = ift + 1);
+			} else
+				idx = 0;
+			break;
+
+		case RTM_NEWADDR:
+			ifam = (struct ifa_msghdr *)(void *)rtm;
+			if (idx && ifam->ifam_index != idx)
+			{
+				errno = EINVAL;		/* this cannot happen */
+				return -1;
+			};
+			if (idx == 0 || (ifam->ifam_addrs & RTA_MASKS) == 0)
+				break;
+			ift->ifa_name = cif->ifa_name;
+			ift->ifa_flags = cif->ifa_flags;
+			ift->ifa_data = NULL;
+			p = (char *)(void *)(ifam + 1);
+			/* Scan to look for length of address */
+			alen = 0;
+			for (p0 = p, i = 0; i < RTAX_MAX; i++) {
+				if ((RTA_MASKS & ifam->ifam_addrs & (1 << i))
+				    == 0)
+					continue;
+				sa = (struct sockaddr *)(void *)p;
+				len = SA_RLEN(sa);
+				if (i == RTAX_IFA) {
+					alen = len;
+					break;
+				}
+				p += len;
+			}
+			for (p = p0, i = 0; i < RTAX_MAX; i++) {
+				if ((RTA_MASKS & ifam->ifam_addrs & (1 << i))
+				    == 0)
+					continue;
+				sa = (struct sockaddr *)(void *)p;
+				len = SA_RLEN(sa);
+				switch (i) {
+				case RTAX_IFA:
+					ift->ifa_addr =
+					    (struct sockaddr *)(void *)data;
+					memcpy(data, p, len);
+					data += len;
+					break;
+
+				case RTAX_NETMASK:
+					ift->ifa_netmask =
+					    (struct sockaddr *)(void *)data;
+					if (SA_LEN(sa) == 0) {
+						memset(data, 0, alen);
+						data += alen;
+						break;
+					}
+					memcpy(data, p, len);
+					data += len;
+					break;
+
+				case RTAX_BRD:
+					ift->ifa_broadaddr =
+					    (struct sockaddr *)(void *)data;
+					memcpy(data, p, len);
+					data += len;
+					break;
+				}
+				p += len;
+			}
+
+#ifdef	HAVE_IFAM_DATA
+			/* ifam_data needs to be aligned */
+			ift->ifa_data = data = (void *)ALIGN(data);
+			memcpy(data, &ifam->ifam_data, sizeof(ifam->ifam_data));
+			data += sizeof(ifam->ifam_data);
+#endif	/* HAVE_IFAM_DATA */
+
+			ift = (ift->ifa_next = ift + 1);
+			break;
+		}
+	}
+
+	free(buf);
+#else	/* NET_RT_IFLIST */
+#endif	/* NET_RT_IFLIST */
+	if (--ift >= ifa) {
+		ift->ifa_next = NULL;
+		*pif = ifa;
+	} else {
+		*pif = NULL;
+		free(ifa);
+	}
+	return (0);
+}
+weak_alias (__getifaddrs, getifaddrs)
+libc_hidden_weak (getifaddrs)
+
+void
+__freeifaddrs(struct ifaddrs *ifp)
+{
+
+	free(ifp);
+}
+weak_alias (__freeifaddrs, freeifaddrs)
+libc_hidden_weak (freeifaddrs)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ifreq.c
@@ -0,0 +1,93 @@
+/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <net/if.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+
+#include <ifreq.h>
+
+/* The FreeBSD ioctl SIOCGIFCONF returns the list if interfaces as a
+   concatenation of records of different size, each having at least
+   sizeof (struct ifreq) bytes.  */
+
+
+void
+__ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
+{
+  int fd = sockfd;
+  struct ifconf ifc;
+  int rq_len;
+  int nifs;
+  char *ifstart;
+  char *ifend;
+  struct ifreq *ifr;
+  /* FreeBSD has many interfaces, many of them are usually down.  */
+# define RQ_IFS	16
+  /* We have to assume all records are of limited size, so that we know
+     when we can stop enlarging the buffer.  */
+# define RQ_MAXSIZE 256
+
+  if (fd < 0)
+    fd = __opensock ();
+  if (fd < 0)
+    {
+      *num_ifs = 0;
+      *ifreqs = NULL;
+      return;
+    }
+
+  ifc.ifc_buf = NULL;
+  rq_len = RQ_IFS * sizeof (struct ifreq) + RQ_MAXSIZE;
+  for (;;)
+    {
+      ifc.ifc_len = rq_len;
+      ifc.ifc_buf = realloc (ifc.ifc_buf, ifc.ifc_len);
+      if (ifc.ifc_buf == NULL || __ioctl (fd, SIOCGIFCONF, &ifc) < 0)
+	{
+	  if (ifc.ifc_buf)
+	    free (ifc.ifc_buf);
+
+	  if (fd != sockfd)
+	    __close (fd);
+	  *num_ifs = 0;
+	  *ifreqs = NULL;
+	  return;
+	}
+      if (ifc.ifc_len + RQ_MAXSIZE <= rq_len)
+	break;
+      rq_len *= 2;
+    }
+
+  nifs = 0;
+  ifstart = (char *) ifc.ifc_buf;
+  ifend = ifstart + ifc.ifc_len;
+  for (ifr = (struct ifreq *) ifstart;
+       (char *) ifr < ifend;
+       ifr = __if_nextreq (ifr))
+    nifs++;
+
+  if (fd != sockfd)
+    __close (fd);
+
+  *num_ifs = nifs;
+  *ifreqs = realloc (ifc.ifc_buf, ifc.ifc_len);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/init-first.c
@@ -0,0 +1,139 @@
+/* Initialization code run first thing by the ELF startup code.
+   Copyright (C) 1995-2004, 2005, 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sysdep.h>
+#include <signal.h>
+#include <fpu_control.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <libc-internal.h>
+
+#include <ldsodefs.h>
+
+extern int __syscall_sigaction (int __sig,  const struct sigaction *__act, struct sigaction *__oact) __THROW;
+libc_hidden_proto (__syscall_sigaction)
+
+/* Set nonzero if we have to be prepared for more then one libc being
+   used in the process.  Safe assumption if initializer never runs.  */
+int __libc_multiple_libcs attribute_hidden = 1;
+
+/* Remember the command line argument and enviroment contents for
+   later calls of initializers for dynamic libraries.  */
+int __libc_argc attribute_hidden;
+char **__libc_argv attribute_hidden;
+
+
+void
+__libc_init_first (int argc, char **argv, char **envp)
+{
+#ifdef SHARED
+  /* For DSOs we do not need __libc_init_first but instead _init.  */
+}
+
+void
+attribute_hidden
+_init (int argc, char **argv, char **envp)
+{
+#endif
+#ifdef USE_NONOPTION_FLAGS
+  extern void __getopt_clean_environment (char **);
+#endif
+
+  __libc_multiple_libcs = &_dl_starting_up && !_dl_starting_up;
+
+  /* Make sure we don't initialize twice.  */
+  if (!__libc_multiple_libcs)
+    {
+      /* Set the FPU control word to the proper default value if the
+	 kernel would use a different value.  (In a static program we
+	 don't have this information.)  */
+#if 0
+      /* at least on kFreeBSD set it even if SHARED,
+      fixes "make check" failures like math/test-fpucw.out */
+#ifdef SHARED
+      if (__fpu_control != GLRO(dl_fpu_control))
+#endif
+#endif
+	__setfpucw (__fpu_control);
+    }
+
+  /* By default on kFreeBSD when a call to non existing syscall is
+     made, the program is terminated. As we want to be able to detect
+     missing syscalls and provide a fallback code, we ignore the SIGSYS
+     signal. */
+  {
+    struct sigaction act;
+    
+    act.sa_handler = SIG_IGN;
+    __sigemptyset (&act.sa_mask);
+    act.sa_flags = 0;
+    
+    INLINE_SYSCALL (sigaction, 3, SIGSYS, &act, NULL); 
+  }  
+
+  /* Save the command-line arguments.  */
+  __libc_argc = argc;
+  __libc_argv = argv;
+  __environ = envp;
+
+#ifndef SHARED
+  __libc_init_secure ();
+
+  /* First the initialization which normally would be done by the
+     dynamic linker.  */
+  _dl_non_dynamic_init ();
+#endif
+
+#ifdef VDSO_SETUP
+  VDSO_SETUP ();
+#endif
+
+  __init_misc (argc, argv, envp);
+
+#ifdef USE_NONOPTION_FLAGS
+  /* This is a hack to make the special getopt in GNU libc working.  */
+  __getopt_clean_environment (envp);
+#endif
+
+  /* Initialize ctype data.  */
+  __ctype_init ();
+
+#if defined SHARED && !defined NO_CTORS_DTORS_SECTIONS
+  __libc_global_ctors ();
+#endif
+}
+
+
+/* This function is defined here so that if this file ever gets into
+   ld.so we will get a link error.  Having this file silently included
+   in ld.so causes disaster, because the _init definition above will
+   cause ld.so to gain an init function, which is not a cool thing. */
+
+extern void _dl_start (void) __attribute__ ((noreturn));
+
+void
+_dl_start (void)
+{
+  abort ();
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/init-posix.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1991, 94, 95, 97, 98, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stddef.h>
+#include <time.h>
+
+/* This must be initialized data or its presence will not be sufficient to
+   merit linkage of this file, which is necessary for the real
+   initialization function below to be called.  */
+time_t _posix_start_time = -1;
+
+void
+__init_posix (void)
+{
+  _posix_start_time = time ((time_t *) NULL);
+}
+
+text_set_element(__libc_subinit, __init_posix);
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ipc_priv.h
@@ -0,0 +1,53 @@
+/* 
+   Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+struct ipc_perm_old
+  {
+    __uint16_t /* yuck! */ cuid;	/* creator's user ID */
+    __uint16_t /* yuck! */ cgid;	/* creator's group ID */
+    __uint16_t /* yuck! */ uid;		/* owner's user ID */
+    __uint16_t /* yuck! */ gid;		/* owner's group ID */
+    __mode_t mode;			/* read/write permission */
+    __uint16_t __seq;
+    __key_t __key;
+  };
+
+static inline void
+ipc_perm_old2new(const struct ipc_perm_old *in, struct ipc_perm *out)
+{
+  out->cuid  = in->cuid;
+  out->cgid  = in->cgid;
+  out->uid   = in->uid;
+  out->gid   = in->gid;
+  out->mode  = in->mode;
+  out->__seq = in->__seq;
+  out->__key = in->__key;
+}
+
+static inline void
+ipc_perm_new2old(const struct ipc_perm *in, struct ipc_perm_old *out)
+{
+  out->cuid  = in->cuid;
+  out->cgid  = in->cgid;
+  out->uid   = in->uid;
+  out->gid   = in->gid;
+  out->mode  = in->mode;
+  out->__seq = in->__seq;
+  out->__key = in->__key;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/kenv.h
@@ -0,0 +1,39 @@
+/*-
+ * Copyright (c) 2002 Maxime Henrion <mux@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/include/kenv.h,v 1.2.8.1 2009/04/15 03:14:26 kensmith Exp $
+ */
+
+#ifndef _KENV_H_
+#define _KENV_H 	1
+
+#include <sys/cdefs.h>
+#include <sys/kenv.h>
+
+__BEGIN_DECLS
+int kenv(int action, const char *name, char *value, int len);
+__END_DECLS
+
+#endif /* !_KENV_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/kernel-features.h
@@ -0,0 +1,93 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef __KFREEBSD_KERNEL_VERSION
+/* We assume the worst; all kernels should be supported.  */
+# define __KFREEBSD_KERNEL_VERSION	0
+#endif
+
+/* The encoding for __KFREEBSD_KERNEL_VERSION is defined the following
+   way: the major, minor, and subminor all get a byte with the major
+   number being in the highest byte.  This means we can do numeric
+   comparisons.
+
+   In the following we will define certain symbols depending on
+   whether the describes kernel feature is available in the kernel
+   version given by __KFREEBSD_KERNEL_VERSION.  We are not always exactly
+   recording the correct versions in which the features were
+   introduced.  If somebody cares these values can afterwards be
+   corrected.  */
+
+/* 
+   The used encoding corresponds to the following in elf/dl-load.c:
+
+            osversion = (abi_note[5] & 0xff) * 65536
+                        + (abi_note[6] & 0xff) * 256
+                        + (abi_note[7] & 0xff);
+            if (abi_note[4] != __ABI_TAG_OS
+                || (GLRO(dl_osversion) && GLRO(dl_osversion) < osversion))
+            
+   Therefore, the __KFREEBSD_KERNEL_VERSION have different value compared to
+   __FreeBSD_version/__FreeBSD_kernel__version. 
+   The transformation is not just prepend 0x to __FreeBSD_kernel_version.
+
+   For changes see i.e.
+   http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html
+*/
+
+/* Real-time signals introduced in FreeBSD 7.x.  */
+# define __ASSUME_REALTIME_SIGNALS	1
+
+/* Use signals #32, #33, #34 for internal linuxthreads communication */
+#define PTHREAD_SIGBASE 32
+
+/* The `ftruncate' syscall was introduced in kFreeBSD 7.0. */
+# define __ASSUME_TRUNCATE_SYSCALL	1
+
+/* The `lseek' syscall was introduced in kFreeBSD 7.0. */
+# define __ASSUME_LSEEK_SYSCALL		1
+
+/* The `mmap' syscall was introduced in kFreeBSD 7.0. */
+# define __ASSUME_MMAP_SYSCALL		1
+
+/* The `pread' and `pwrite' syscalls were introduced in kFreeBSD 7.0. */
+# define __ASSUME_PREAD_PWRITE_SYSCALLS	1
+
+/* The `shm_*' syscalls were introduced in kFreeBSD 8.0 */
+# define __ASSUME_SHMFCTS		1
+
+/* The `*at' syscalls were introduced in kFreeBSD 8.0. */
+# define __ASSUME_ATFCTS		1
+
+/* The pselect syscall was introduced in kFreeBSD 8.1. */
+# define __ASSUME_PSELECT		1
+
+/* The posix_fallocate syscall was introduced in kFreeBSD 8.3. */
+#if __KFREEBSD_KERNEL_VERSION >= 0x80300
+# define __ASSUME_FALLOCATE		1
+#endif
+
+/* The wait6 syscall was introduced in kFreeBSD 9.2. */
+#if __KFREEBSD_KERNEL_VERSION >= 0x90200
+# define __ASSUME_WAIT6			1
+#endif
+
+/* Support for private "futexes" was added before we start with fbtl. */
+# define __ASSUME_PRIVATE_FUTEX		1
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/kernel-posix-cpu-timers.h
@@ -0,0 +1,5 @@
+/* Parameters for the FreeBSD kernel ABI for CPU clocks.  */
+
+#define CPUCLOCK_WHICH(clock)   ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK)
+#define CPUCLOCK_CLOCK_MASK     15
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ldsodefs.h
@@ -0,0 +1,58 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_LDSODEFS_H
+
+/* FreeBSD puts some extra information into an auxiliary vector when it
+   execs ELF executables.  Note that it uses AT_* values of 10 and 11
+   to denote something different than AT_NOTELF and AT_UID, but this is
+   not a problem since elf/dl-support.c ignores these AT_* values.  */
+#define HAVE_AUX_VECTOR
+
+/* Get the real definitions.  */
+#include_next <ldsodefs.h>
+
+/* Used by static binaries to check the auxiliary vector.  */
+extern void _dl_aux_init (ElfW(auxv_t) *av) internal_function;
+
+/* Initialization which is normally done by the dynamic linker.  */
+extern void _dl_non_dynamic_init (void) internal_function;
+
+/* Contrary to most kernels which use ELFOSABI_SYSV aka ELFOSABI_NONE,
+   FreeBSD uses ELFOSABI_FREEBSD for the OSABI field. */
+#undef VALID_ELF_HEADER
+#define VALID_ELF_HEADER(hdr,exp,size)	(memcmp (hdr, expected2, size) == 0)
+#undef VALID_ELF_OSABI
+#define VALID_ELF_OSABI(osabi)		(osabi == ELFOSABI_FREEBSD)
+#undef MORE_ELF_HEADER_DATA
+#define MORE_ELF_HEADER_DATA \
+  static const unsigned char expected2[EI_PAD] =	\
+  {							\
+    [EI_MAG0] = ELFMAG0,				\
+    [EI_MAG1] = ELFMAG1,				\
+    [EI_MAG2] = ELFMAG2,				\
+    [EI_MAG3] = ELFMAG3,				\
+    [EI_CLASS] = ELFW(CLASS),				\
+    [EI_DATA] = byteorder,				\
+    [EI_VERSION] = EV_CURRENT,				\
+    [EI_OSABI] = ELFOSABI_FREEBSD,			\
+    [EI_ABIVERSION] = 0					\
+  }
+
+#endif /* ldsodefs.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/llseek.c
@@ -0,0 +1,6 @@
+/* We don't need a definition since the lseek64 function is what we need.  */
+/* llseek doesn't have a prototype.  Since the second parameter is a
+   64bit type, this results in wrong behaviour if no prototype is
+   provided.  */
+link_warning (llseek, "\
+the `llseek' function may be dangerous; use `lseek64' instead.")
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/lowlevelumtx.h
@@ -0,0 +1,131 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LOWLEVELUMTX_H
+#define _LOWLEVELUMTX_H	1
+
+#include <kernel-features.h>
+#include <sysdep.h>
+#include <atomic.h>
+
+/* from <sys/umtx.h> */
+/* op code for _umtx_op */
+#define	UMTX_OP_WAIT		2
+#define	UMTX_OP_WAKE		3
+#define	UMTX_OP_WAIT_UINT	11
+#define	UMTX_OP_WAIT_UINT_PRIVATE	15
+#define	UMTX_OP_WAKE_PRIVATE	16
+
+int __syscall__umtx_op(void *, int, long, void*, void*);
+libc_hidden_proto (__syscall__umtx_op)
+
+#define UMTX_SYSCALL __syscall__umtx_op
+
+/*
+ * 
+   we provide set of functions
+   lll_umtx_{int,long}_{wait,wake}_{private,shared}
+ *  
+ */
+
+/*******************************************************/
+
+#define lll_umtx_int_wait_private(addr, val, timeout)	\
+  ({							\
+    UMTX_SYSCALL(					\
+        addr,						\
+        UMTX_OP_WAIT_UINT_PRIVATE, 			\
+        (long)((unsigned int)(val)),			\
+        NULL,						\
+        timeout);					\
+   })
+
+#define lll_umtx_int_wait_shared(addr, val, timeout)	\
+  ({							\
+    UMTX_SYSCALL(					\
+        addr,						\
+        UMTX_OP_WAIT_UINT,	 			\
+        (long)((unsigned int)(val)),			\
+        NULL,						\
+        timeout);					\
+   })
+
+#define lll_umtx_long_wait_private(addr, val, timeout)	\
+  ({							\
+    UMTX_SYSCALL(					\
+        addr,						\
+        UMTX_OP_WAIT,  /* only autoshare available */	\
+        val,						\
+        NULL,						\
+        timeout);					\
+   })
+
+#define lll_umtx_long_wait_shared(addr, val, timeout)	\
+  ({							\
+    UMTX_SYSCALL(					\
+        addr,						\
+        UMTX_OP_WAIT,  /* only autoshare available */	\
+        val,						\
+        NULL,						\
+        timeout);					\
+   })
+
+/*******************************************************/
+
+#define lll_umtx_int_wake_private(addr, num)  		\
+  ({							\
+    UMTX_SYSCALL(					\
+        addr,						\
+        UMTX_OP_WAKE_PRIVATE,	 			\
+        num,						\
+        NULL,						\
+        NULL);						\
+   })
+
+#define lll_umtx_int_wake_shared(addr, num)  		\
+  ({							\
+    UMTX_SYSCALL(					\
+        addr,						\
+        UMTX_OP_WAKE,		 			\
+        num,						\
+        NULL,						\
+        NULL);						\
+   })
+
+#define lll_umtx_long_wake_private(addr, num) 		\
+  ({							\
+    UMTX_SYSCALL(					\
+        addr,						\
+        UMTX_OP_WAKE_PRIVATE,	 			\
+        num,						\
+        NULL,						\
+        NULL);						\
+   })
+
+#define lll_umtx_long_wake_shared(addr, num)  		\
+  ({							\
+    UMTX_SYSCALL(					\
+        addr,						\
+        UMTX_OP_WAKE,		 			\
+        num,						\
+        NULL,						\
+        NULL);						\
+   })
+
+/*******************************************************/
+
+#endif	/* _LOWLEVELUMTX_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/lseek64.c
@@ -0,0 +1 @@
+/* 'lseek64' is the same as 'lseek', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/lxstat.c
@@ -0,0 +1,47 @@
+/* lxstat using FreeBSD lstat, nlstat system calls.
+   Copyright (C) 1991,1995-1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include "stat16conv.c"
+
+int
+__lxstat (int vers, const char *file, struct stat *buf)
+{
+  if (__builtin_expect (vers == _STAT_VER, 1))
+    {
+      struct stat16 buf16;
+      int result = __syscall_lstat (file, &buf16);
+      if (result == 0)
+	stat16_to_stat (&buf16, buf);
+      return result;
+    }
+  else if (__builtin_expect (vers == _STAT_VER_stat, 1))
+    return __syscall_lstat (file, (struct stat16 *) buf);
+  else
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+}
+hidden_def (__lxstat)
+
+weak_alias (__lxstat, _lxstat)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/lxstat64.c
@@ -0,0 +1,43 @@
+/* lxstat using FreeBSD lstat, nlstat system calls.
+   Copyright (C) 1991,1995-1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include "stat16conv.c"
+
+int
+__lxstat64 (int vers, const char *file, struct stat64 *buf)
+{
+  if (__builtin_expect (vers == _STAT_VER, 1))
+    {
+      struct stat16 buf16;
+      int result = __syscall_lstat (file, &buf16);
+      if (result == 0)
+	stat16_to_stat64 (&buf16, buf);
+      return result;
+    }
+  else
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+}
+hidden_def (__lxstat64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/____longjmp_chk.c
@@ -0,0 +1,7 @@
+/* Jump to the position specified by ENV, causing the
+   setjmp call there to return VAL, or 1 if VAL is 0.
+   void __longjmp (__jmp_buf env, int val).  */
+      
+#warning longjmp_chk unimplemented
+#define __longjmp ____longjmp_chk
+#include <__longjmp.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/dl-machine.h
@@ -0,0 +1,97 @@
+/* Machine-dependent ELF dynamic relocation inline functions.  MIPS version.
+   Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
+   Port to kFreeBSD (kernel of FreeBSD) by Robert Millan.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include_next <dl-machine.h>
+
+/* kFreeBSD puts arguments in a different location (see start.S).  */
+#undef RTLD_START
+#define RTLD_START asm (\
+	".text\n\
+	" _RTLD_PROLOGUE(ENTRY_POINT) "\
+	" STRINGXV(SETUP_GPX($25)) "\n\
+	" STRINGXV(SETUP_GPX64($18,$25)) "\n\
+	# i386 ABI book says that the first entry of GOT holds\n\
+	# the address of the dynamic structure. Though MIPS ABI\n\
+	# doesn't say nothing about this, I emulate this here.\n\
+	" STRINGXP(PTR_LA) " $9, _DYNAMIC\n\
+	# Subtract OFFSET_GP_GOT\n\
+	" STRINGXP(PTR_S) " $9, -0x7ff0($28)\n\
+	move $9, $29\n\
+	" STRINGXP(PTR_SUBIU) " $29, 16\n\
+	\n\
+	" STRINGXP(PTR_LA) " $8, .Lcoff\n\
+	bltzal $8, .Lcoff\n\
+.Lcoff:	" STRINGXP(PTR_SUBU) " $8, $31, $8\n\
+	\n\
+	" STRINGXP(PTR_LA) " $25, _dl_start\n\
+	" STRINGXP(PTR_ADDU) " $25, $8\n\
+	jalr $25\n\
+	\n\
+	" STRINGXP(PTR_ADDIU) " $29, 16\n\
+	# Get the value of label '_dl_start_user' in t9 ($25).\n\
+	" STRINGXP(PTR_LA) " $25, _dl_start_user\n\
+	" _RTLD_EPILOGUE(ENTRY_POINT) "\
+	\n\
+	\n\
+	" _RTLD_PROLOGUE(_dl_start_user) "\
+	" STRINGXP(SETUP_GP) "\n\
+	" STRINGXV(SETUP_GP64($18,_dl_start_user)) "\n\
+	move $16, $28\n\
+	# Save the user entry point address in a saved register.\n\
+	move $17, $2\n\
+	# See if we were run as a command with the executable file\n\
+	# name as an extra leading argument.\n\
+	lw $2, _dl_skip_args\n\
+	beq $2, $0, 1f\n\
+	# Load the original argument count.\n\
+	" STRINGXP(PTR_L) " $10, 0($4)\n\
+	# Subtract _dl_skip_args from it.\n\
+	subu $10, $2\n\
+	# FIXME: unnecessary? Adjust the stack pointer to skip _dl_skip_args words.\n\
+	sll $2, " STRINGXP (PTRLOG) "\n\
+	" STRINGXP(PTR_ADDU) " $29, $2\n\
+	# Save back the modified argument count.\n\
+	" STRINGXP(PTR_S) " $10, 0($4)\n\
+1:	# Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env) \n\
+	" STRINGXP(PTR_L) /* or lw???  fixme */ " $5, 0($4)\n\
+	" STRINGXP(PTR_LA) " $6, " STRINGXP (PTRSIZE) "($4)\n\
+	" STRINGXP(PTR_L) " $4, _rtld_local\n\
+	sll $7, $5, " STRINGXP (PTRLOG) "\n\
+	" STRINGXP(PTR_ADDU) " $7, $7, $6\n\
+	" STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\
+	# Make sure the stack pointer is aligned for _dl_init.\n\
+	and $2, $29, -2 * " STRINGXP(SZREG) "\n\
+	" STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\
+	" STRINGXP(PTR_SUBIU) " $29, $2, 32\n\
+	" STRINGXP(SAVE_GP(16)) "\n\
+	# Call the function to run the initializers.\n\
+	jal _dl_init\n\
+	# Restore the stack pointer for _start.\n\
+	" STRINGXP(PTR_L)  " $29, 32-" STRINGXP(SZREG) "($29)\n\
+	# Pass our finalizer function to the user in $2 as per ELF ABI.\n\
+	" STRINGXP(PTR_LA) " $2, _dl_fini\n\
+	# Jump to the user entry point.\n\
+	move $25, $17\n\
+	jr $25\n\t"\
+	_RTLD_EPILOGUE(_dl_start_user)\
+	".previous"\
+);
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/entry.h
@@ -0,0 +1,7 @@
+/* http://sources.redhat.com/bugzilla/show_bug.cgi?id=12297 */
+
+#ifndef __ASSEMBLY__
+extern void __start (void);
+#endif
+
+#define ENTRY_POINT __start
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/mips32/Makefile
@@ -0,0 +1,2 @@
+# pull in __syscall_error routine (needed by sysdep.h in this directory)
+libpthread-routines += sysdep
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/mips32/bits/mcontext.h
@@ -0,0 +1,116 @@
+/* Machine-dependent processor state structure for kFreeBSD.
+   Copyright (C) 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.  mips version.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_UCONTEXT_H
+# error "Never use <bits/mcontext.h> directly; include <sys/ucontext.h> instead."
+#endif
+
+/*
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)ucontext.h	8.1 (Berkeley) 6/10/93
+ *	JNPR: ucontext.h,v 1.2 2007/08/09 11:23:32 katta
+ * $FreeBSD$
+ */
+
+typedef struct	__mcontext {
+	/*
+	 * These fields must match the corresponding fields in struct 
+	 * sigcontext which follow 'sc_mask'. That way we can support
+	 * struct sigcontext and ucontext_t at the same time.
+	 */
+	int		mc_onstack;	/* sigstack state to restore */
+	int	mc_pc;		/* pc at time of signal */
+	int	mc_regs[32];	/* processor regs 0 to 31 */
+        int      sr;             /* status register */
+        int	mullo, mulhi;	/* mullo and mulhi registers... */
+	int		mc_fpused;	/* fp has been used */
+	int	mc_fpregs[33];	/* fp regs 0 to 31 and csr */
+	int	mc_fpc_eir;	/* fp exception instruction reg */
+	int	__spare__[8];	/* XXX reserved */ 
+} mcontext_t;
+
+#define	SZREG		4
+
+/* offsets into mcontext_t */
+#define	UCTX_REG(x)	(8 + (x)*SZREG)
+
+#define	UCR_ZERO	UCTX_REG(0)
+#define	UCR_AT		UCTX_REG(1)
+#define	UCR_V0		UCTX_REG(2)
+#define	UCR_V1		UCTX_REG(3)
+#define	UCR_A0		UCTX_REG(4)
+#define	UCR_A1		UCTX_REG(5)
+#define	UCR_A2		UCTX_REG(6)
+#define	UCR_A3		UCTX_REG(7)
+#define	UCR_T0		UCTX_REG(8)
+#define	UCR_T1		UCTX_REG(9)
+#define	UCR_T2		UCTX_REG(10)
+#define	UCR_T3		UCTX_REG(11)
+#define	UCR_T4		UCTX_REG(12)
+#define	UCR_T5		UCTX_REG(13)
+#define	UCR_T6		UCTX_REG(14)
+#define	UCR_T7		UCTX_REG(15)
+#define	UCR_S0		UCTX_REG(16)
+#define	UCR_S1		UCTX_REG(17)
+#define	UCR_S2		UCTX_REG(18)
+#define	UCR_S3		UCTX_REG(19)
+#define	UCR_S4		UCTX_REG(20)
+#define	UCR_S5		UCTX_REG(21)
+#define	UCR_S6		UCTX_REG(22)
+#define	UCR_S7		UCTX_REG(23)
+#define	UCR_T8		UCTX_REG(24)
+#define	UCR_T9		UCTX_REG(25)
+#define	UCR_K0		UCTX_REG(26)
+#define	UCR_K1		UCTX_REG(27)
+#define	UCR_GP		UCTX_REG(28)
+#define	UCR_SP		UCTX_REG(29)
+#define	UCR_S8		UCTX_REG(30)
+#define	UCR_RA		UCTX_REG(31)
+#define UCR_SR          UCTX_REG(32)
+#define	UCR_MDLO	UCTX_REG(33)
+#define	UCR_MDHI	UCTX_REG(34)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/mips32/bits/sigcontext.h
@@ -0,0 +1,92 @@
+/* Machine-dependent signal context structure for kFreeBSD.  mips version.
+   Copyright (C) 1991-1992,1994,1997,2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H  1
+
+/*	$OpenBSD: signal.h,v 1.2 1999/01/27 04:10:03 imp Exp $	*/
+
+/*
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)signal.h	8.1 (Berkeley) 6/10/93
+ *	JNPR: signal.h,v 1.4 2007/01/08 04:58:37 katta
+ * $FreeBSD$
+ */
+
+/*
+ * Information pushed on stack when a signal is delivered.
+ * This is used by the kernel to restore state following
+ * execution of the signal handler.  It is also made available
+ * to the handler to allow it to restore state properly if
+ * a non-standard exit is performed.
+ */
+
+__extension__ struct sigcontext {
+	/*
+	 * The fields following 'sc_mask' must match the definition
+	 * of struct __mcontext. That way we can support
+	 * struct sigcontext and ucontext_t at the same
+	 * time.
+	 */
+	__sigset_t	sc_mask;	/* signal mask to restore */
+	int		sc_onstack;	/* sigstack state to restore */
+	int	sc_pc;		/* pc at time of signal */
+	int	sc_regs[32];	/* processor regs 0 to 31 */
+	int	mullo, mulhi;	/* mullo and mulhi registers... */
+	int		sc_fpused;	/* fp has been used */
+	int	sc_fpregs[33];	/* fp regs 0 to 31 and csr */
+	int	sc_fpc_eir;	/* fp exception instruction reg */
+	int		xxx[8];		/* XXX reserved */ 
+};
+
+#endif /* _BITS_SIGCONTEXT_H */
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/mips32/sysdep.h
@@ -0,0 +1,49 @@
+/* Copyright (C) 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Robert Millan.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _KFREEBSD_MIPS_SYSDEP_H
+#define _KFREEBSD_MIPS_SYSDEP_H 1
+
+/* This drags in __syscall_error, keep in sync with Makefile in
+   this directory.  */
+#include <sysdeps/unix/sysv/linux/mips/mips32/sysdep.h>
+
+/* Default INLINE_SYSCALL works but is buggy for 64-bit arguments
+   (breaks mmap, lseek...).  */
+#undef INLINE_SYSCALL
+#define INLINE_SYSCALL(name, nr, args...) __syscall_##name(args)
+
+/* Revert Linux kludge.  */
+#undef SYS_ify
+#ifdef __STDC__
+# define SYS_ify(syscall_name)  SYS_##syscall_name
+#else
+# define SYS_ify(syscall_name)  SYS_/**/syscall_name
+#endif
+
+/* Workaround for http://sources.redhat.com/bugzilla/show_bug.cgi?id=12301 */
+#ifdef __ASSEMBLER__
+/* We don't want the label for the error handler to be visible in the symbol
+   table when we define it here.  */
+#ifdef __PIC__
+# define SYSCALL_ERROR_LABEL 99b
+#endif
+#endif   /* ! __ASSEMBLER__ */
+
+#endif /* _KFREEBSD_MIPS_SYSDEP_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/mips64/bits/mcontext.h
@@ -0,0 +1,116 @@
+/* Machine-dependent processor state structure for kFreeBSD.
+   Copyright (C) 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.  mips version.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_UCONTEXT_H
+# error "Never use <bits/mcontext.h> directly; include <sys/ucontext.h> instead."
+#endif
+
+/*
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)ucontext.h	8.1 (Berkeley) 6/10/93
+ *	JNPR: ucontext.h,v 1.2 2007/08/09 11:23:32 katta
+ * $FreeBSD$
+ */
+
+typedef struct	__mcontext {
+	/*
+	 * These fields must match the corresponding fields in struct 
+	 * sigcontext which follow 'sc_mask'. That way we can support
+	 * struct sigcontext and ucontext_t at the same time.
+	 */
+	int		mc_onstack;	/* sigstack state to restore */
+	long int	mc_pc;		/* pc at time of signal */
+	long int	mc_regs[32];	/* processor regs 0 to 31 */
+        long int      sr;             /* status register */
+        long int	mullo, mulhi;	/* mullo and mulhi registers... */
+	int		mc_fpused;	/* fp has been used */
+	long int	mc_fpregs[33];	/* fp regs 0 to 31 and csr */
+	long int	mc_fpc_eir;	/* fp exception instruction reg */
+	int	__spare__[8];	/* XXX reserved */ 
+} mcontext_t;
+
+#define	SZREG		4
+
+/* offsets into mcontext_t */
+#define	UCTX_REG(x)	(8 + (x)*SZREG)
+
+#define	UCR_ZERO	UCTX_REG(0)
+#define	UCR_AT		UCTX_REG(1)
+#define	UCR_V0		UCTX_REG(2)
+#define	UCR_V1		UCTX_REG(3)
+#define	UCR_A0		UCTX_REG(4)
+#define	UCR_A1		UCTX_REG(5)
+#define	UCR_A2		UCTX_REG(6)
+#define	UCR_A3		UCTX_REG(7)
+#define	UCR_T0		UCTX_REG(8)
+#define	UCR_T1		UCTX_REG(9)
+#define	UCR_T2		UCTX_REG(10)
+#define	UCR_T3		UCTX_REG(11)
+#define	UCR_T4		UCTX_REG(12)
+#define	UCR_T5		UCTX_REG(13)
+#define	UCR_T6		UCTX_REG(14)
+#define	UCR_T7		UCTX_REG(15)
+#define	UCR_S0		UCTX_REG(16)
+#define	UCR_S1		UCTX_REG(17)
+#define	UCR_S2		UCTX_REG(18)
+#define	UCR_S3		UCTX_REG(19)
+#define	UCR_S4		UCTX_REG(20)
+#define	UCR_S5		UCTX_REG(21)
+#define	UCR_S6		UCTX_REG(22)
+#define	UCR_S7		UCTX_REG(23)
+#define	UCR_T8		UCTX_REG(24)
+#define	UCR_T9		UCTX_REG(25)
+#define	UCR_K0		UCTX_REG(26)
+#define	UCR_K1		UCTX_REG(27)
+#define	UCR_GP		UCTX_REG(28)
+#define	UCR_SP		UCTX_REG(29)
+#define	UCR_S8		UCTX_REG(30)
+#define	UCR_RA		UCTX_REG(31)
+#define UCR_SR          UCTX_REG(32)
+#define	UCR_MDLO	UCTX_REG(33)
+#define	UCR_MDHI	UCTX_REG(34)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/mips64/bits/sigcontext.h
@@ -0,0 +1,92 @@
+/* Machine-dependent signal context structure for kFreeBSD.  mips version.
+   Copyright (C) 1991-1992,1994,1997,2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H  1
+
+/*	$OpenBSD: signal.h,v 1.2 1999/01/27 04:10:03 imp Exp $	*/
+
+/*
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Ralph Campbell.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)signal.h	8.1 (Berkeley) 6/10/93
+ *	JNPR: signal.h,v 1.4 2007/01/08 04:58:37 katta
+ * $FreeBSD$
+ */
+
+/*
+ * Information pushed on stack when a signal is delivered.
+ * This is used by the kernel to restore state following
+ * execution of the signal handler.  It is also made available
+ * to the handler to allow it to restore state properly if
+ * a non-standard exit is performed.
+ */
+
+__extension__ struct sigcontext {
+	/*
+	 * The fields following 'sc_mask' must match the definition
+	 * of struct __mcontext. That way we can support
+	 * struct sigcontext and ucontext_t at the same
+	 * time.
+	 */
+	__sigset_t	sc_mask;	/* signal mask to restore */
+	int		sc_onstack;	/* sigstack state to restore */
+	long int	sc_pc;		/* pc at time of signal */
+	long int	sc_regs[32];	/* processor regs 0 to 31 */
+	long int	mullo, mulhi;	/* mullo and mulhi registers... */
+	int		sc_fpused;	/* fp has been used */
+	long int	sc_fpregs[33];	/* fp regs 0 to 31 and csr */
+	long int	sc_fpc_eir;	/* fp exception instruction reg */
+	int		xxx[8];		/* XXX reserved */ 
+};
+
+#endif /* _BITS_SIGCONTEXT_H */
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/start.S
@@ -0,0 +1,121 @@
+/* Startup code compliant to the ELF Mips ABI.
+   Copyright (C) 1995, 1997, 2000, 2001, 2002, 2003, 2004, 2010
+	Free Software Foundation, Inc.
+   Port to kFreeBSD (kernel of FreeBSD) by Robert Millan.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define __ASSEMBLY__ 1
+#include <entry.h>
+#include <sgidefs.h>
+#include <sys/asm.h>
+
+#ifndef ENTRY_POINT
+#error ENTRY_POINT needs to be defined for start.S on MIPS/ELF.
+#endif
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  The SVR4/Mips ABI (pages 3-31, 3-32) says that when the entry
+   point runs, most registers' values are unspecified, except for:
+
+   v0 ($2)	Contains a function pointer to be registered with `atexit'.
+		This is how the dynamic linker arranges to have DT_FINI
+		functions called for shared libraries that have been loaded
+		before this code runs.
+
+   a0 ($4)	Contains a pointer to the arguments and environment:
+		0(a0)			argc
+		4(a0)			argv[0]
+		...
+		(4*argc)(a0)		NULL
+		(4*(argc+1))(a0)	envp[0]
+		...
+					NULL
+   ra ($31)	The return address register is set to zero so that programs
+		that search backword through stack frames recognize the last
+		stack frame.
+*/
+
+
+/* We need to call:
+   __libc_start_main (int (*main) (int, char **, char **), int argc,
+		      char **argv, void (*init) (void), void (*fini) (void),
+		      void (*rtld_fini) (void), void *stack_end)
+*/
+	
+	.text
+	.globl ENTRY_POINT
+	.type ENTRY_POINT,@function
+ENTRY_POINT:
+#ifdef __PIC__
+	SETUP_GPX($0)
+	SETUP_GPX64($25,$0)
+#else
+	PTR_LA $28, _gp		/* Setup GP correctly if we're non-PIC.  */
+	move $31, $0
+#endif
+
+	PTR_L $5, 0($4)			/* argc */
+	PTR_ADDIU $6, $4, PTRSIZE	/* argv  */
+	PTR_LA $4, main		/* main */
+	
+	/* Allocate space on the stack for seven arguments (o32 only)
+	   and make sure the stack is aligned to double words (8 bytes) 
+	   on o32 and quad words (16 bytes) on n32 and n64.  */
+	
+	and $29, -2 * SZREG
+#if _MIPS_SIM == _ABIO32
+	PTR_SUBIU $29, 32
+#endif
+	PTR_LA $7, __libc_csu_init		/* init */
+	PTR_LA $8, __libc_csu_fini
+#if _MIPS_SIM == _ABIO32
+	PTR_S $8, 16($29)		/* fini */
+	PTR_S $2, 20($29)		/* rtld_fini */
+	PTR_S $29, 24($29)		/* stack_end */
+#else
+	move $9, $2		/* rtld_fini */
+	move $10, $29		/* stack_end */
+#endif
+	jal __libc_start_main
+hlt:	b hlt			/* Crash if somehow it does return.  */
+
+/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.long 0
+	.weak data_start
+	data_start = __data_start
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/start_thread.S
@@ -0,0 +1,56 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+   Modification for amd64 contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* __start_thread (flags, stack, func, arg)
+   calls __rfork (flags), and in the child sets the stack pointer and then
+   calls _exit (func (arg)).
+   It cannot be done in portable C.  */
+
+/*
+   The parameters are passed in registers:
+   rdi: flags for rfork
+   rsi: child_stack
+   rdx: func
+   rcx: arg
+*/
+
+#include <sysdep.h>
+#include <asm-syntax.h>
+
+#define SIG_SETMASK	3
+
+/* There is a window of a few instructions, right after the rfork
+   system call, where the handling of a signal would write garbage
+   into the stack shared by the parent and the child (assuming
+   RFMEM is set in flags).  To solve this: 1. We block all signals
+   around the rfork system call and unblock them afterwards in
+   the parent and in the child (but only after changing the stack
+   pointer).  2. The child accesses only values passed in registers
+   and on its own stack.  This way, if the parent is scheduled to
+   run first, and handles a signal, it will not affect the child;
+   and if the child runs first, and handles a signal, it will use
+   the child's stack and not affect the parent.
+*/
+
+/* FIXME */
+
+	.text
+ENTRY (__start_thread)
+PSEUDO_END (__start_thread)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mips/sys/tas.h
@@ -0,0 +1,2 @@
+/* workaround for http://sources.redhat.com/bugzilla/show_bug.cgi?id=12298 */
+#include <sysdeps/unix/sysv/linux/mips/sys/tas.h>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mmap.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sysdep.h>
+
+extern void *__syscall_mmap (void *__addr, size_t __len, int __prot,
+			     int __flags, int __fd, __off_t __offset) __THROW;
+libc_hidden_proto (__syscall_mmap)
+
+void *
+__mmap (void *addr, size_t len, int prot, int flags, int fd, __off_t offset)
+{
+  /* Validity checks not done by the kernel.  */
+  if (offset != 0)
+    {
+      int pagesize = __getpagesize ();
+      if ((__builtin_expect (pagesize & (pagesize - 1), 0)
+        ? offset % pagesize
+	: offset & (pagesize - 1)))
+	{
+	  __set_errno (EINVAL);
+	  return (void *) (-1);
+	}
+    }
+
+  /* for ANON mapping we must pass -1 in place of fd */
+  if (flags & MAP_ANON)
+    fd = -1;
+
+  return INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
+}
+
+weak_alias (__mmap, mmap)
+
+/* 'mmap64' is the same as 'mmap', because __off64_t == __off_t.  */
+strong_alias (__mmap, __mmap64)
+weak_alias (__mmap64, mmap64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/mmap64.c
@@ -0,0 +1 @@
+/* 'mmap64' is the same as 'mmap', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/msgctl.c
@@ -0,0 +1,104 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sys/msg.h>
+#include <ipc_priv.h>
+
+#include <sysdep.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <bits/wordsize.h>
+#include <shlib-compat.h>
+
+#include <kernel-features.h>
+
+/* Provide operations to control over shared memory segments.  */
+
+extern int __syscall_msgctl(int msqid, int cmd, struct msqid_ds *buf);
+libc_hidden_proto (__syscall_msgctl)
+
+int
+__new_msgctl(int msqid, int cmd, struct msqid_ds *buf)
+{
+  return INLINE_SYSCALL (msgctl, 3, msqid, cmd, buf);
+}
+versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_18);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_18)
+struct msqid_ds_old
+{
+  struct ipc_perm_old msg_perm;	/* structure describing operation permission */
+  void *__msg_first;
+  void *__msg_last;
+  msglen_t __msg_cbytes;	/* current number of bytes on queue */
+  msgqnum_t msg_qnum;		/* number of messages currently on queue */
+  msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
+  __pid_t msg_lspid;		/* pid of last msgsnd() */
+  __pid_t msg_lrpid;		/* pid of last msgrcv() */
+  __time_t msg_stime;		/* time of last msgsnd command */
+  long __unused1;
+  __time_t msg_rtime;		/* time of last msgrcv command */
+  long __unused2;
+  __time_t msg_ctime;		/* time of last change */
+  long __unused3;
+  long __unused4[4];
+};
+
+int
+attribute_compat_text_section
+__old_msgctl(int msqid, int cmd, struct msqid_ds_old *buf)
+{
+    struct msqid_ds newbuf;
+    int rv;
+    
+    if (cmd == IPC_SET)
+    {
+        ipc_perm_old2new(&(buf->msg_perm), &(newbuf.msg_perm));
+        newbuf.__msg_first   = buf->__msg_first;
+        newbuf.__msg_last    = buf->__msg_first;
+        newbuf.__msg_cbytes  = buf->__msg_cbytes;
+        newbuf.msg_qnum      = buf->msg_qnum;
+        newbuf.msg_qbytes    = buf->msg_qbytes;
+        newbuf.msg_lspid     = buf->msg_lspid;
+        newbuf.msg_lrpid     = buf->msg_lrpid;
+        newbuf.msg_stime     = buf->msg_stime;
+        newbuf.msg_rtime     = buf->msg_rtime;
+        newbuf.msg_ctime     = buf->msg_ctime;
+    }
+    
+    rv = __new_msgctl (msqid, cmd, &newbuf);
+    
+    if ((rv != -1) && (cmd == IPC_STAT))
+    {
+        ipc_perm_new2old(&(newbuf.msg_perm), &(buf->msg_perm));
+        buf->__msg_first   = newbuf.__msg_first;
+        buf->__msg_last    = newbuf.__msg_first;
+        buf->__msg_cbytes  = newbuf.__msg_cbytes;
+        buf->msg_qnum      = newbuf.msg_qnum;
+        buf->msg_qbytes    = newbuf.msg_qbytes;
+        buf->msg_lspid     = newbuf.msg_lspid;
+        buf->msg_lrpid     = newbuf.msg_lrpid;
+        buf->msg_stime     = newbuf.msg_stime;
+        buf->msg_rtime     = newbuf.msg_rtime;
+        buf->msg_ctime     = newbuf.msg_ctime;   
+    }
+        
+    return rv;
+}
+compat_symbol (libc, __old_msgctl, msgctl, GLIBC_2_0);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/munmap.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sysdep.h>
+
+extern int __syscall_munmap (void *__addr, size_t __len) __THROW;
+libc_hidden_proto (__syscall_munmap)
+
+int
+__munmap (void *addr, size_t len)
+{
+    int pagesize = __getpagesize ();
+    if ((unsigned long) addr & (pagesize - 1))
+    {
+	__set_errno (EINVAL);
+	return -1;
+    }
+  return INLINE_SYSCALL (munmap, 2, addr, len);
+}
+
+weak_alias (__munmap, munmap)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/net/ethernet.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1997, 1999, 2001, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Based on the FreeBSD version of this file. Curiously, that file
+   lacks a copyright in the header. */
+
+#ifndef __NET_ETHERNET_H
+#define __NET_ETHERNET_H 1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <net/if_ether.h>     /* IEEE 802.3 Ethernet constants */
+
+__BEGIN_DECLS
+
+/* This is a name for the 48 bit ethernet address available on many
+   systems.  */
+struct ether_addr
+{
+  u_int8_t octet[ETH_ALEN];
+#define ether_addr_octet octet  
+} __attribute__ ((__packed__));
+
+/* 10Mb/s ethernet header */
+struct ether_header
+{
+  u_int8_t  ether_dhost[ETH_ALEN];	/* destination eth addr	*/
+  u_int8_t  ether_shost[ETH_ALEN];	/* source ether addr	*/
+  u_int16_t ether_type;		        /* packet type ID field	*/
+} __attribute__ ((__packed__));
+
+/* Ethernet protocol ID's */
+#define	ETHERTYPE_PUP		0x0200          /* Xerox PUP */
+#define	ETHERTYPE_IP		0x0800		/* IP */
+#define	ETHERTYPE_ARP		0x0806		/* Address resolution */
+#define	ETHERTYPE_REVARP	0x8035		/* Reverse ARP */
+
+#define	ETHER_ADDR_LEN	ETH_ALEN                 /* size of ethernet addr */
+#define	ETHER_TYPE_LEN	2                        /* bytes in type field */
+#define	ETHER_CRC_LEN	4                        /* bytes in CRC field */
+#define	ETHER_HDR_LEN	ETH_HLEN                 /* total octets in header */
+#define	ETHER_MIN_LEN	(ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */
+#define	ETHER_MAX_LEN	(ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */
+
+/* make sure ethenet length is valid */
+#define	ETHER_IS_VALID_LEN(foo)	\
+	((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
+
+/*
+ * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
+ * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
+ * by an ETHER type (as given above) and then the (variable-length) header.
+ */
+#define	ETHERTYPE_TRAIL		0x1000		/* Trailer packet */
+#define	ETHERTYPE_NTRAILER	16
+
+#define	ETHERMTU	ETH_DATA_LEN
+#define	ETHERMIN	(ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
+
+__END_DECLS
+
+#endif	/* net/ethernet.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/net/if.h
@@ -0,0 +1,444 @@
+/*-
+ * Copyright (c) 1982, 1986, 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)if.h	8.1 (Berkeley) 6/10/93
+ * $FreeBSD: src/sys/net/if.h,v 1.108 2007/06/11 20:08:11 andre Exp $
+ */
+
+#ifndef _NET_IF_H_
+#define	_NET_IF_H_
+
+#include <sys/cdefs.h>
+
+#include <features.h>
+
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+struct ifnet;
+
+/*
+ * Length of interface external name, including terminating '\0'.
+ * Note: this is the same size as a generic device's external name.
+ */
+#define		IF_NAMESIZE	16
+#define		IFNAMSIZ	IF_NAMESIZE
+#define		IF_MAXUNIT	0x7fff	/* historical value */
+
+/*
+ * Structure used to query names of interface cloners.
+ */
+
+struct if_clonereq {
+	int	ifcr_total;		/* total cloners (out) */
+	int	ifcr_count;		/* room for this many in user buffer */
+	char	*ifcr_buffer;		/* buffer for cloner names */
+};
+
+/*
+ * Structure describing information about an interface
+ * which may be of interest to management entities.
+ */
+struct if_data {
+	/* generic interface information */
+	unsigned char	ifi_type;		/* ethernet, tokenring, etc */
+	unsigned char	ifi_physical;		/* e.g., AUI, Thinnet, 10base-T, etc */
+	unsigned char	ifi_addrlen;		/* media address length */
+	unsigned char	ifi_hdrlen;		/* media header length */
+	unsigned char	ifi_link_state;		/* current link state */
+	unsigned char	ifi_vhid;		/* carp vhid */
+	unsigned char	ifi_baudrate_pf;	/* baudrate power factor */
+	unsigned char	ifi_datalen;		/* length of this data struct */
+	unsigned long	ifi_mtu;		/* maximum transmission unit */
+	unsigned long	ifi_metric;		/* routing metric (external only) */
+	unsigned long	ifi_baudrate;		/* linespeed */
+	/* volatile statistics */
+	unsigned long	ifi_ipackets;		/* packets received on interface */
+	unsigned long	ifi_ierrors;		/* input errors on interface */
+	unsigned long	ifi_opackets;		/* packets sent on interface */
+	unsigned long	ifi_oerrors;		/* output errors on interface */
+	unsigned long	ifi_collisions;		/* collisions on csma interfaces */
+	unsigned long	ifi_ibytes;		/* total number of octets received */
+	unsigned long	ifi_obytes;		/* total number of octets sent */
+	unsigned long	ifi_imcasts;		/* packets received via multicast */
+	unsigned long	ifi_omcasts;		/* packets sent via multicast */
+	unsigned long	ifi_iqdrops;		/* dropped on input, this interface */
+	unsigned long	ifi_noproto;		/* destined for unsupported protocol */
+	unsigned long	ifi_hwassist;		/* HW offload capabilities, see IFCAP */
+	time_t	ifi_epoch;		/* uptime at attach or stat reset */
+	struct	timeval ifi_lastchange;	/* time of last administrative change */
+#ifdef _IFI_OQDROPS
+	unsigned long	ifi_oqdrops;		/* dropped on output */
+#endif
+};
+
+/*-
+ * Interface flags are of two types: network stack owned flags, and driver
+ * owned flags.  Historically, these values were stored in the same ifnet
+ * flags field, but with the advent of fine-grained locking, they have been
+ * broken out such that the network stack is responsible for synchronizing
+ * the stack-owned fields, and the device driver the device-owned fields.
+ * Both halves can perform lockless reads of the other half's field, subject
+ * to accepting the involved races.
+ *
+ * Both sets of flags come from the same number space, and should not be
+ * permitted to conflict, as they are exposed to user space via a single
+ * field.
+ *
+ * The following symbols identify read and write requirements for fields:
+ *
+ * (i) if_flags field set by device driver before attach, read-only there
+ *     after.
+ * (n) if_flags field written only by the network stack, read by either the
+ *     stack or driver.
+ * (d) if_drv_flags field written only by the device driver, read by either
+ *     the stack or driver.
+ */
+#define	IFF_UP		0x1		/* (n) interface is up */
+#define	IFF_BROADCAST	0x2		/* (i) broadcast address valid */
+#define	IFF_DEBUG	0x4		/* (n) turn on debugging */
+#define	IFF_LOOPBACK	0x8		/* (i) is a loopback net */
+#define	IFF_POINTOPOINT	0x10		/* (i) is a point-to-point link */
+#define	IFF_SMART	0x20		/* (i) interface manages own routes */
+#define	IFF_DRV_RUNNING	0x40		/* (d) resources allocated */
+#define	IFF_NOARP	0x80		/* (n) no address resolution protocol */
+#define	IFF_PROMISC	0x100		/* (n) receive all packets */
+#define	IFF_ALLMULTI	0x200		/* (n) receive all multicast packets */
+#define	IFF_DRV_OACTIVE	0x400		/* (d) tx hardware queue is full */
+#define	IFF_SIMPLEX	0x800		/* (i) can't hear own transmissions */
+#define	IFF_LINK0	0x1000		/* per link layer defined bit */
+#define	IFF_LINK1	0x2000		/* per link layer defined bit */
+#define	IFF_LINK2	0x4000		/* per link layer defined bit */
+#define	IFF_ALTPHYS	IFF_LINK2	/* use alternate physical connection */
+#define	IFF_MULTICAST	0x8000		/* (i) supports multicast */
+#define	IFF_CANTCONFIG	0x10000		/* (i) unconfigurable using ioctl(2) */
+#define	IFF_PPROMISC	0x20000		/* (n) user-requested promisc mode */
+#define	IFF_MONITOR	0x40000		/* (n) user-requested monitor mode */
+#define	IFF_STATICARP	0x80000		/* (n) static ARP */
+#define	IFF_NEEDSGIANT	0x100000	/* (i) hold Giant over if_start calls */
+#define IFF_DYING       0x200000        /* (n) interface is winding down */
+#define	IFF_RENAMING    0x400000        /* (n) interface is being renamed */
+
+/*
+ * Old names for driver flags so that user space tools can continue to use
+ * the old (portable) names.
+ */
+#ifndef _KERNEL
+#define	IFF_RUNNING	IFF_DRV_RUNNING
+#define	IFF_OACTIVE	IFF_DRV_OACTIVE
+#endif
+
+/* flags set internally only: */
+#define	IFF_CANTCHANGE \
+	(IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\
+	    IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\
+	    IFF_DYING|IFF_CANTCONFIG)
+
+/*
+ * Values for if_link_state.
+ */
+#define	LINK_STATE_UNKNOWN	0	/* link invalid/unknown */
+#define	LINK_STATE_DOWN		1	/* link is down */
+#define	LINK_STATE_UP		2	/* link is up */
+
+/*
+ * Some convenience macros used for setting ifi_baudrate.
+ * XXX 1000 vs. 1024? --thorpej@netbsd.org
+ */
+#define	IF_Kbps(x)	((x) * 1000)		/* kilobits/sec. */
+#define	IF_Mbps(x)	(IF_Kbps((x) * 1000))	/* megabits/sec. */
+#define	IF_Gbps(x)	(IF_Mbps((x) * 1000))	/* gigabits/sec. */
+
+/*
+ * Capabilities that interfaces can advertise.
+ *
+ * struct ifnet.if_capabilities
+ *   contains the optional features & capabilities a particular interface
+ *   supports (not only the driver but also the detected hw revision).
+ *   Capabilities are defined by IFCAP_* below.
+ * struct ifnet.if_capenable
+ *   contains the enabled (either by default or through ifconfig) optional
+ *   features & capabilities on this interface.
+ *   Capabilities are defined by IFCAP_* below.
+ * struct if_data.ifi_hwassist in mbuf CSUM_ flag form, controlled by above
+ *   contains the enabled optional feature & capabilites that can be used
+ *   individually per packet and are specified in the mbuf pkthdr.csum_flags
+ *   field.  IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
+ *   more detailed or differenciated than IFCAP_*.
+ *   Hwassist features are defined CSUM_* in sys/mbuf.h
+ */
+#define	IFCAP_RXCSUM		0x00001  /* can offload checksum on RX */
+#define	IFCAP_TXCSUM		0x00002  /* can offload checksum on TX */
+#define	IFCAP_NETCONS		0x00004  /* can be a network console */
+#define	IFCAP_VLAN_MTU		0x00008	/* VLAN-compatible MTU */
+#define	IFCAP_VLAN_HWTAGGING	0x00010	/* hardware VLAN tag support */
+#define	IFCAP_JUMBO_MTU		0x00020	/* 9000 byte MTU supported */
+#define	IFCAP_POLLING		0x00040	/* driver supports polling */
+#define	IFCAP_VLAN_HWCSUM	0x00080	/* can do IFCAP_HWCSUM on VLANs */
+#define	IFCAP_TSO4		0x00100	/* can do TCP Segmentation Offload */
+#define	IFCAP_TSO6		0x00200	/* can do TCP6 Segmentation Offload */
+#define	IFCAP_LRO		0x00400	/* can do Large Receive Offload */
+#define	IFCAP_WOL_UCAST		0x00800	/* wake on any unicast frame */
+#define	IFCAP_WOL_MCAST		0x01000	/* wake on any multicast frame */
+#define	IFCAP_WOL_MAGIC		0x02000	/* wake on any Magic Packet */
+#define	IFCAP_TOE4		0x04000	/* interface can offload TCP */
+#define	IFCAP_TOE6		0x08000	/* interface can offload TCP6 */
+#define	IFCAP_VLAN_HWFILTER	0x10000 /* interface hw can filter vlan tag */
+#define IFCAP_POLLING_NOCOUNT   0x20000 /* polling ticks cannot be fragmented */
+#define	IFCAP_VLAN_HWTSO        0x40000 /* can do IFCAP_TSO on VLANs */
+#define	IFCAP_LINKSTATE         0x80000 /* the runtime link state is dynamic */
+#define	IFCAP_NETMAP		0x100000 /* netmap mode supported/enabled */
+#define	IFCAP_RXCSUM_IPV6	0x200000  /* can offload checksum on IPv6 RX */
+#define	IFCAP_TXCSUM_IPV6	0x400000  /* can offload checksum on IPv6 TX */
+
+#define	IFCAP_HWCSUM_IPV6	(IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)
+
+#define	IFCAP_HWCSUM		(IFCAP_RXCSUM | IFCAP_TXCSUM)
+#define	IFCAP_TSO		(IFCAP_TSO4 | IFCAP_TSO6)
+#define	IFCAP_WOL		(IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
+#define	IFCAP_TOE		(IFCAP_TOE4 | IFCAP_TOE6)
+
+#define	IFCAP_CANTCHANGE	(IFCAP_NETMAP)
+
+#define	IFQ_MAXLEN	50
+#define	IFNET_SLOWHZ	1		/* granularity is 1 second */
+
+/*
+ * Message format for use in obtaining information about interfaces
+ * from getkerninfo and the routing socket
+ */
+struct if_msghdr {
+	unsigned short	ifm_msglen;	/* to skip over non-understood messages */
+	unsigned char	ifm_version;	/* future binary compatibility */
+	unsigned char	ifm_type;	/* message type */
+	int	ifm_addrs;	/* like rtm_addrs */
+	int	ifm_flags;	/* value of if_flags */
+	unsigned short	ifm_index;	/* index for associated ifp */
+	struct	if_data ifm_data;/* statistics and other data about if */
+};
+
+/*
+ * Message format for use in obtaining information about interface addresses
+ * from getkerninfo and the routing socket
+ */
+struct ifa_msghdr {
+	unsigned short	ifam_msglen;	/* to skip over non-understood messages */
+	unsigned char	ifam_version;	/* future binary compatibility */
+	unsigned char	ifam_type;	/* message type */
+	int	ifam_addrs;	/* like rtm_addrs */
+	int	ifam_flags;	/* value of ifa_flags */
+	unsigned short	ifam_index;	/* index for associated ifp */
+	int	ifam_metric;	/* value of ifa_metric */
+};
+
+/*
+ * Message format for use in obtaining information about multicast addresses
+ * from the routing socket
+ */
+struct ifma_msghdr {
+	unsigned short	ifmam_msglen;	/* to skip over non-understood messages */
+	unsigned char	ifmam_version;	/* future binary compatibility */
+	unsigned char	ifmam_type;	/* message type */
+	int	ifmam_addrs;	/* like rtm_addrs */
+	int	ifmam_flags;	/* value of ifa_flags */
+	unsigned short	ifmam_index;	/* index for associated ifp */
+};
+
+/*
+ * Message format announcing the arrival or departure of a network interface.
+ */
+struct if_announcemsghdr {
+	unsigned short	ifan_msglen;	/* to skip over non-understood messages */
+	unsigned char	ifan_version;	/* future binary compatibility */
+	unsigned char	ifan_type;	/* message type */
+	unsigned short	ifan_index;	/* index for associated ifp */
+	char	ifan_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+	unsigned short	ifan_what;	/* what type of announcement */
+};
+
+#define	IFAN_ARRIVAL	0	/* interface arrival */
+#define	IFAN_DEPARTURE	1	/* interface departure */
+
+/*
+ * Buffer with length to be used in SIOCGIFDESCR/SIOCSIFDESCR requests
+ */
+struct ifreq_buffer {
+	size_t  length;
+	void    *buffer;
+};
+ 
+/*
+ * Interface request structure used for socket
+ * ioctl's.  All interface ioctl's must have parameter
+ * definitions which begin with ifr_name.  The
+ * remainder may be interface specific.
+ */
+struct	ifreq {
+	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
+	union {
+		struct	sockaddr ifru_addr;
+		struct	sockaddr ifru_dstaddr;
+		struct	sockaddr ifru_broadaddr;
+		struct	sockaddr ifru_netmask;
+		struct  ifreq_buffer ifru_buffer;
+		short	ifru_flags[2];
+		short	ifru_index;
+		int	ifru_jid;
+		int	ifru_metric;
+		int	ifru_mtu;
+		int	ifru_phys;
+		int	ifru_media;
+		char *	ifru_data;
+		int	ifru_cap[2];
+		unsigned int ifru_fib;
+	} ifr_ifru;
+#define	ifr_addr	ifr_ifru.ifru_addr	/* address */
+#define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-to-p link */
+#define	ifr_broadaddr	ifr_ifru.ifru_broadaddr	/* broadcast address */
+#define	ifr_netmask	ifr_ifru.ifru_netmask	/* interface net mask */
+#define	ifr_buffer      ifr_ifru.ifru_buffer    /* user supplied buffer with its length */
+#define	ifr_flags	ifr_ifru.ifru_flags[0]	/* flags (low 16 bits) */
+#define	ifr_flagshigh	ifr_ifru.ifru_flags[1]	/* flags (high 16 bits) */
+#define ifr_jid         ifr_ifru.ifru_jid       /* jail/vnet */
+#define	ifr_metric	ifr_ifru.ifru_metric	/* metric */
+#define	ifr_mtu		ifr_ifru.ifru_mtu	/* mtu */
+#define ifr_phys	ifr_ifru.ifru_phys	/* physical wire */
+#define ifr_media	ifr_ifru.ifru_media	/* physical media */
+#define	ifr_data	ifr_ifru.ifru_data	/* for use by interface */
+#define	ifr_reqcap	ifr_ifru.ifru_cap[0]	/* requested capabilities */
+#define	ifr_curcap	ifr_ifru.ifru_cap[1]	/* current capabilities */
+#define	ifr_index	ifr_ifru.ifru_index	/* interface index */
+#define	ifr_fib		ifr_ifru.ifru_fib	/* interface fib */
+};
+
+#define	_SIZEOF_ADDR_IFREQ(ifr) \
+	((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? \
+	 (sizeof(struct ifreq) - sizeof(struct sockaddr) + \
+	  (ifr).ifr_addr.sa_len) : sizeof(struct ifreq))
+
+#include <sys/kglue/net/if.h>
+
+/*
+ * Structure used to retrieve aux status data from interfaces.
+ * Kernel suppliers to this interface should respect the formatting
+ * needed by ifconfig(8): each line starts with a TAB and ends with
+ * a newline.  The canonical example to copy and paste is in if_tun.c.
+ */
+
+#define	IFSTATMAX	800		/* 10 lines of text */
+struct ifstat {
+	char	ifs_name[IFNAMSIZ];	/* if name, e.g. "en0" */
+	char	ascii[IFSTATMAX + 1];
+};
+
+/*
+ * Structure used in SIOCGIFCONF request.
+ * Used to retrieve interface configuration
+ * for machine (useful for programs which
+ * must know all networks accessible).
+ */
+struct	ifconf {
+	int	ifc_len;		/* size of associated buffer */
+	union {
+		char    *ifcu_buf;
+		struct	ifreq *ifcu_req;
+	} ifc_ifcu;
+#define	ifc_buf	ifc_ifcu.ifcu_buf	/* buffer address */
+#define	ifc_req	ifc_ifcu.ifcu_req	/* array of structures returned */
+};
+
+/*
+ * interface groups
+ */
+
+#define	IFG_ALL		"all"		/* group contains all interfaces */
+/* XXX: will we implement this? */
+#define	IFG_EGRESS	"egress"	/* if(s) default route(s) point to */
+
+struct ifg_req {
+	union {
+		char			 ifgrqu_group[IFNAMSIZ];
+		char			 ifgrqu_member[IFNAMSIZ];
+	} ifgrq_ifgrqu;
+#define	ifgrq_group	ifgrq_ifgrqu.ifgrqu_group
+#define	ifgrq_member	ifgrq_ifgrqu.ifgrqu_member
+};
+
+/*
+ * Used to lookup groups for an interface
+ */
+struct ifgroupreq {
+	char	ifgr_name[IFNAMSIZ];
+	unsigned int	ifgr_len;
+	union {
+		char	ifgru_group[IFNAMSIZ];
+		struct	ifg_req *ifgru_groups;
+	} ifgr_ifgru;
+#define ifgr_group	ifgr_ifgru.ifgru_group
+#define ifgr_groups	ifgr_ifgru.ifgru_groups
+};
+
+/*
+ * Structure for SIOC[AGD]LIFADDR
+ */
+struct if_laddrreq {
+	char	iflr_name[IFNAMSIZ];
+	unsigned int	flags;
+#define	IFLR_PREFIX	0x8000  /* in: prefix given  out: kernel fills id */
+	unsigned int	prefixlen;         /* in/out */
+	struct	sockaddr_storage addr;   /* in/out */
+	struct	sockaddr_storage dstaddr; /* out */
+};
+
+/*
+ * Structure used to request i2c data
+ * from interface transceivers.
+ */
+struct ifi2creq {
+	unsigned char	dev_addr;	/* i2c address (0xA0, 0xA2) */
+	unsigned char	offset;		/* read offset */
+	unsigned char	len;		/* read length */
+	unsigned char	spare0;
+	unsigned int	spare1;
+	unsigned char	data[8];	/* read buffer */
+}; 
+
+struct if_nameindex {
+	unsigned int	if_index;	/* 1, 2, ... */
+	char		*if_name;	/* null terminated name: "le0", ... */
+};
+
+__BEGIN_DECLS
+void			 if_freenameindex(struct if_nameindex *);
+char			*if_indextoname(unsigned int, char *);
+struct if_nameindex	*if_nameindex(void);
+unsigned int		 if_nametoindex(const char *);
+__END_DECLS
+
+#endif /* !_NET_IF_H_ */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/net/if_ether.h
@@ -0,0 +1,104 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _NET_IF_ETHER_H
+#define _NET_IF_ETHER_H	1
+
+/*
+ *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble
+ *	and FCS/CRC (frame check sequence).
+ */
+
+#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
+#define ETH_HLEN	14		/* Total octets in header.	 */
+#define ETH_ZLEN	60		/* Min. octets in frame sans FCS */
+#define ETH_DATA_LEN	1500		/* Max. octets in payload	 */
+#define ETH_FRAME_LEN	1514		/* Max. octets in frame sans FCS */
+
+/*
+ *	These are the defined Ethernet Protocol ID's.
+ */
+
+#define ETH_P_LOOP	0x0060		/* Ethernet Loopback packet	*/
+#define ETH_P_PUP	0x0200		/* Xerox PUP packet		*/
+#define ETH_P_PUPAT	0x0201		/* Xerox PUP Addr Trans packet	*/
+#define ETH_P_IP	0x0800		/* Internet Protocol packet	*/
+#define ETH_P_X25	0x0805		/* CCITT X.25			*/
+#define ETH_P_ARP	0x0806		/* Address Resolution packet	*/
+#define	ETH_P_BPQ	0x08FF		/* G8BPQ AX.25 Ethernet Packet	[ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_IEEEPUP	0x0a00		/* Xerox IEEE802.3 PUP packet */
+#define ETH_P_IEEEPUPAT	0x0a01		/* Xerox IEEE802.3 PUP Addr Trans packet */
+#define ETH_P_DEC       0x6000          /* DEC Assigned proto           */
+#define ETH_P_DNA_DL    0x6001          /* DEC DNA Dump/Load            */
+#define ETH_P_DNA_RC    0x6002          /* DEC DNA Remote Console       */
+#define ETH_P_DNA_RT    0x6003          /* DEC DNA Routing              */
+#define ETH_P_LAT       0x6004          /* DEC LAT                      */
+#define ETH_P_DIAG      0x6005          /* DEC Diagnostics              */
+#define ETH_P_CUST      0x6006          /* DEC Customer use             */
+#define ETH_P_SCA       0x6007          /* DEC Systems Comms Arch       */
+#define ETH_P_RARP      0x8035		/* Reverse Addr Res packet	*/
+#define ETH_P_ATALK	0x809B		/* Appletalk DDP		*/
+#define ETH_P_AARP	0x80F3		/* Appletalk AARP		*/
+#define ETH_P_8021Q	0x8100          /* 802.1Q VLAN Extended Header  */
+#define ETH_P_IPX	0x8137		/* IPX over DIX			*/
+#define ETH_P_IPV6	0x86DD		/* IPv6 over bluebook		*/
+#define ETH_P_WCCP	0x883E		/* Web-cache coordination protocol
+					 * defined in draft-wilson-wrec-wccp-v2-00.txt */
+#define ETH_P_PPP_DISC	0x8863		/* PPPoE discovery messages     */
+#define ETH_P_PPP_SES	0x8864		/* PPPoE session messages	*/
+#define ETH_P_MPLS_UC	0x8847		/* MPLS Unicast traffic		*/
+#define ETH_P_MPLS_MC	0x8848		/* MPLS Multicast traffic	*/
+#define ETH_P_ATMMPOA	0x884c		/* MultiProtocol Over ATM	*/
+#define ETH_P_ATMFATE	0x8884		/* Frame-based ATM Transport
+					 * over Ethernet
+					 */
+#define ETH_P_AOE	0x88A2		/* ATA over Ethernet		*/
+
+/*
+ *	Non DIX types. Won't clash for 1500 types.
+ */
+
+#define ETH_P_802_3	0x0001		/* Dummy type for 802.3 frames  */
+#define ETH_P_AX25	0x0002		/* Dummy protocol id for AX.25  */
+#define ETH_P_ALL	0x0003		/* Every packet (be careful!!!) */
+#define ETH_P_802_2	0x0004		/* 802.2 frames 		*/
+#define ETH_P_SNAP	0x0005		/* Internal only		*/
+#define ETH_P_DDCMP     0x0006          /* DEC DDCMP: Internal only     */
+#define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
+#define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
+#define ETH_P_LOCALTALK 0x0009		/* Localtalk pseudo type 	*/
+#define ETH_P_PPPTALK	0x0010		/* Dummy type for Atalk over PPP*/
+#define ETH_P_TR_802_2	0x0011		/* 802.2 frames 		*/
+#define ETH_P_MOBITEX	0x0015		/* Mobitex (kaz@cafe.net)	*/
+#define ETH_P_CONTROL	0x0016		/* Card specific control frames */
+#define ETH_P_IRDA	0x0017		/* Linux-IrDA			*/
+#define ETH_P_ECONET	0x0018		/* Acorn Econet			*/
+#define ETH_P_HDLC	0x0019		/* HDLC frames			*/
+#define ETH_P_ARCNET	0x001A		/* 1A for ArcNet :-)            */
+
+/*
+ *	This is an Ethernet frame header.
+ */
+
+struct ethhdr {
+	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
+	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
+	unsigned short	h_proto;		/* packet type ID field	*/
+} __attribute__((packed));
+
+#endif	/* net/if_ether.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/netinet/icmp6.h
@@ -0,0 +1,561 @@
+/* Copyright (C) 1991-1997,2000,2006,2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _NETINET_ICMP6_H
+#define _NETINET_ICMP6_H 1
+
+#include <inttypes.h>
+#include <string.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+#define ICMP6_FILTER 18
+
+#define ICMP6_FILTER_BLOCK		1
+#define ICMP6_FILTER_PASS		2
+#define ICMP6_FILTER_BLOCKOTHERS	3
+#define ICMP6_FILTER_PASSONLY		4
+
+#define ICMPV6_PLD_MAXLEN	1232	/* IPV6_MMTU - sizeof(struct ip6_hdr)
+					   - sizeof(struct icmp6_hdr) */
+
+struct icmp6_filter
+  {
+    uint32_t icmp6_filt[8];
+  } __attribute__ ((__packed__));
+
+struct icmp6_hdr
+  {
+    uint8_t     icmp6_type;   /* type field */
+    uint8_t     icmp6_code;   /* code field */
+    uint16_t    icmp6_cksum;  /* checksum field */
+    union
+      {
+	uint32_t  icmp6_un_data32[1]; /* type-specific field */
+	uint16_t  icmp6_un_data16[2]; /* type-specific field */
+	uint8_t   icmp6_un_data8[4];  /* type-specific field */
+      } icmp6_dataun;
+  } __attribute__ ((__packed__));
+
+#define icmp6_data32    icmp6_dataun.icmp6_un_data32
+#define icmp6_data16    icmp6_dataun.icmp6_un_data16
+#define icmp6_data8     icmp6_dataun.icmp6_un_data8
+#define icmp6_pptr      icmp6_data32[0]  /* parameter prob */
+#define icmp6_mtu       icmp6_data32[0]  /* packet too big */
+#define icmp6_id        icmp6_data16[0]  /* echo request/reply */
+#define icmp6_seq       icmp6_data16[1]  /* echo request/reply */
+#define icmp6_maxdelay  icmp6_data16[0]  /* mcast group membership */
+
+#define ICMP6_DST_UNREACH             1
+#define ICMP6_PACKET_TOO_BIG          2
+#define ICMP6_TIME_EXCEEDED           3
+#define ICMP6_PARAM_PROB              4
+
+#define ICMP6_INFOMSG_MASK  0x80    /* all informational messages */
+
+#define ICMP6_NI_SUBJ_IPV6            0 /* Query Subject is an IPv6 address */
+#define ICMP6_NI_SUBJ_FQDN            1 /* Query Subject is a Domain name */
+#define ICMP6_NI_SUBJ_IPV4            2 /* Query Subject is an IPv4 address */
+
+#define ICMP6_NI_SUCCESS              0 /* node information successful reply */
+#define ICMP6_NI_REFUSED              1 /* node information request is refused */
+#define ICMP6_NI_UNKNOWN              2 /* unknown Qtype */
+
+#define ICMP6_ECHO_REQUEST          128
+#define ICMP6_ECHO_REPLY            129
+#define MLD_LISTENER_QUERY          130
+#define MLD_LISTENER_REPORT         131
+#define MLD_LISTENER_DONE           132
+#define MLD_LISTENER_REDUCTION      MLD_LISTENER_DONE
+
+/* RFC2292 decls */
+#define ICMP6_MEMBERSHIP_QUERY      130 /* group membership query */
+#define ICMP6_MEMBERSHIP_REPORT     131 /* group membership report */
+#define ICMP6_MEMBERSHIP_REDUCTION  132 /* group membership termination */
+/* the followings are for backward compatibility to old KAME apps. */
+#define MLD6_LISTENER_QUERY         MLD_LISTENER_QUERY
+#define MLD6_LISTENER_REPORT        MLD_LISTENER_REPORT
+#define MLD6_LISTENER_DONE          MLD_LISTENER_DONE
+
+
+#define ICMP6_DST_UNREACH_NOROUTE     0 /* no route to destination */
+#define ICMP6_DST_UNREACH_ADMIN       1 /* communication with destination */
+                                        /* administratively prohibited */
+#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
+#define ICMP6_DST_UNREACH_ADDR        3 /* address unreachable */
+#define ICMP6_DST_UNREACH_NOPORT      4 /* bad port */
+
+#define ICMP6_TIME_EXCEED_TRANSIT     0 /* Hop Limit == 0 in transit */
+#define ICMP6_TIME_EXCEED_REASSEMBLY  1 /* Reassembly time out */
+
+#define ICMP6_PARAMPROB_HEADER        0 /* erroneous header field */
+#define ICMP6_PARAMPROB_NEXTHEADER    1 /* unrecognized Next Header */
+#define ICMP6_PARAMPROB_OPTION        2 /* unrecognized IPv6 option */
+
+#define ICMP6_FILTER_WILLPASS(type, filterp) \
+	((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
+
+#define ICMP6_FILTER_WILLBLOCK(type, filterp) \
+	((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
+
+#define ICMP6_FILTER_SETPASS(type, filterp) \
+	((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))))
+
+#define ICMP6_FILTER_SETBLOCK(type, filterp) \
+	((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))))
+
+#define ICMP6_FILTER_SETPASSALL(filterp) \
+	memset (filterp, 0xFF, sizeof (struct icmp6_filter));
+
+#define ICMP6_FILTER_SETBLOCKALL(filterp) \
+	memset (filterp, 0, sizeof (struct icmp6_filter));
+
+#define ND_ROUTER_SOLICIT           133
+#define ND_ROUTER_ADVERT            134
+#define ND_NEIGHBOR_SOLICIT         135
+#define ND_NEIGHBOR_ADVERT          136
+#define ND_REDIRECT                 137
+
+struct nd_router_solicit      /* router solicitation */
+  {
+    struct icmp6_hdr  nd_rs_hdr;
+    /* could be followed by options */
+  } __attribute__ ((__packed__));
+
+#define nd_rs_type               nd_rs_hdr.icmp6_type
+#define nd_rs_code               nd_rs_hdr.icmp6_code
+#define nd_rs_cksum              nd_rs_hdr.icmp6_cksum
+#define nd_rs_reserved           nd_rs_hdr.icmp6_data32[0]
+
+struct nd_router_advert       /* router advertisement */
+  {
+    struct icmp6_hdr  nd_ra_hdr;
+    uint32_t   nd_ra_reachable;   /* reachable time */
+    uint32_t   nd_ra_retransmit;  /* retransmit timer */
+    /* could be followed by options */
+  } __attribute__ ((__packed__));
+
+#define nd_ra_type               nd_ra_hdr.icmp6_type
+#define nd_ra_code               nd_ra_hdr.icmp6_code
+#define nd_ra_cksum              nd_ra_hdr.icmp6_cksum
+#define nd_ra_curhoplimit        nd_ra_hdr.icmp6_data8[0]
+#define nd_ra_flags_reserved     nd_ra_hdr.icmp6_data8[1]
+#define ND_RA_FLAG_MANAGED       0x80
+#define ND_RA_FLAG_OTHER         0x40
+#define ND_RA_FLAG_HOME_AGENT    0x20
+#define nd_ra_router_lifetime    nd_ra_hdr.icmp6_data16[1]
+
+struct nd_neighbor_solicit    /* neighbor solicitation */
+  {
+    struct icmp6_hdr  nd_ns_hdr;
+    struct in6_addr   nd_ns_target; /* target address */
+    /* could be followed by options */
+  } __attribute__ ((__packed__));
+
+#define nd_ns_type               nd_ns_hdr.icmp6_type
+#define nd_ns_code               nd_ns_hdr.icmp6_code
+#define nd_ns_cksum              nd_ns_hdr.icmp6_cksum
+#define nd_ns_reserved           nd_ns_hdr.icmp6_data32[0]
+
+struct nd_neighbor_advert     /* neighbor advertisement */
+  {
+    struct icmp6_hdr  nd_na_hdr;
+    struct in6_addr   nd_na_target; /* target address */
+    /* could be followed by options */
+  } __attribute__ ((__packed__));
+
+#define nd_na_type               nd_na_hdr.icmp6_type
+#define nd_na_code               nd_na_hdr.icmp6_code
+#define nd_na_cksum              nd_na_hdr.icmp6_cksum
+#define nd_na_flags_reserved     nd_na_hdr.icmp6_data32[0]
+#if     BYTE_ORDER == BIG_ENDIAN
+#define ND_NA_FLAG_ROUTER        0x80000000
+#define ND_NA_FLAG_SOLICITED     0x40000000
+#define ND_NA_FLAG_OVERRIDE      0x20000000
+#else   /* BYTE_ORDER == LITTLE_ENDIAN */
+#define ND_NA_FLAG_ROUTER        0x00000080
+#define ND_NA_FLAG_SOLICITED     0x00000040
+#define ND_NA_FLAG_OVERRIDE      0x00000020
+#endif
+
+struct nd_redirect            /* redirect */
+  {
+    struct icmp6_hdr  nd_rd_hdr;
+    struct in6_addr   nd_rd_target; /* target address */
+    struct in6_addr   nd_rd_dst;    /* destination address */
+    /* could be followed by options */
+  } __attribute__ ((__packed__));;
+
+#define nd_rd_type               nd_rd_hdr.icmp6_type
+#define nd_rd_code               nd_rd_hdr.icmp6_code
+#define nd_rd_cksum              nd_rd_hdr.icmp6_cksum
+#define nd_rd_reserved           nd_rd_hdr.icmp6_data32[0]
+
+struct nd_opt_hdr             /* Neighbor discovery option header */
+  {
+    uint8_t  nd_opt_type;
+    uint8_t  nd_opt_len;        /* in units of 8 octets */
+    /* followed by option specific data */
+  } __attribute__ ((__packed__));
+
+#define ND_OPT_SOURCE_LINKADDR		1
+#define ND_OPT_TARGET_LINKADDR		2
+#define ND_OPT_PREFIX_INFORMATION	3
+#define ND_OPT_REDIRECTED_HEADER	4
+#define ND_OPT_MTU			5
+#define ND_OPT_RTR_ADV_INTERVAL		7
+#define ND_OPT_HOME_AGENT_INFO		8
+
+struct nd_opt_prefix_info     /* prefix information */
+  {
+    uint8_t   nd_opt_pi_type;
+    uint8_t   nd_opt_pi_len;
+    uint8_t   nd_opt_pi_prefix_len;
+    uint8_t   nd_opt_pi_flags_reserved;
+    uint32_t  nd_opt_pi_valid_time;
+    uint32_t  nd_opt_pi_preferred_time;
+    uint32_t  nd_opt_pi_reserved2;
+    struct in6_addr  nd_opt_pi_prefix;
+  } __attribute__ ((__packed__));
+
+#define ND_OPT_PI_FLAG_ONLINK	0x80
+#define ND_OPT_PI_FLAG_AUTO	0x40
+#define ND_OPT_PI_FLAG_RADDR	0x20
+
+struct nd_opt_rd_hdr          /* redirected header */
+  {
+    uint8_t   nd_opt_rh_type;
+    uint8_t   nd_opt_rh_len;
+    uint16_t  nd_opt_rh_reserved1;
+    uint32_t  nd_opt_rh_reserved2;
+    /* followed by IP header and data */
+  } __attribute__ ((__packed__));
+
+struct nd_opt_mtu             /* MTU option */
+  {
+    uint8_t   nd_opt_mtu_type;
+    uint8_t   nd_opt_mtu_len;
+    uint16_t  nd_opt_mtu_reserved;
+    uint32_t  nd_opt_mtu_mtu;
+  } __attribute__ ((__packed__));
+
+struct mld_hdr
+  {
+    struct icmp6_hdr    mld_icmp6_hdr;
+    struct in6_addr     mld_addr; /* multicast address */
+  } __attribute__ ((__packed__));
+
+#define mld_type        mld_icmp6_hdr.icmp6_type
+#define mld_code        mld_icmp6_hdr.icmp6_code
+#define mld_cksum       mld_icmp6_hdr.icmp6_cksum
+#define mld_maxdelay    mld_icmp6_hdr.icmp6_data16[0]
+#define mld_reserved    mld_icmp6_hdr.icmp6_data16[1]
+
+/* definitions to provide backward compatibility to old KAME applications */
+#define mld6_hdr        mld_hdr
+#define mld6_type       mld_type
+#define mld6_code       mld_code
+#define mld6_cksum      mld_cksum
+#define mld6_maxdelay   mld_maxdelay
+#define mld6_reserved   mld_reserved
+#define mld6_addr       mld_addr
+
+#define ICMP6_ROUTER_RENUMBERING    138
+
+#define ICMP6_ROUTER_RENUMBERING_COMMAND  0 /* rr command */
+#define ICMP6_ROUTER_RENUMBERING_RESULT   1 /* rr result */
+#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET   255 /* rr seq num reset */
+
+struct icmp6_router_renum    /* router renumbering header */
+  {
+    struct icmp6_hdr    rr_hdr;
+    uint8_t             rr_segnum;
+    uint8_t             rr_flags;
+    uint16_t            rr_maxdelay;
+    uint32_t            rr_reserved;
+  } __attribute__ ((__packed__));
+
+#define rr_type		rr_hdr.icmp6_type
+#define rr_code         rr_hdr.icmp6_code
+#define rr_cksum        rr_hdr.icmp6_cksum
+#define rr_seqnum       rr_hdr.icmp6_data32[0]
+
+/* Router renumbering flags */
+#define ICMP6_RR_FLAGS_TEST             0x80
+#define ICMP6_RR_FLAGS_REQRESULT        0x40
+#define ICMP6_RR_FLAGS_FORCEAPPLY       0x20
+#define ICMP6_RR_FLAGS_SPECSITE         0x10
+#define ICMP6_RR_FLAGS_PREVDONE         0x08
+
+#define ICMP6_WRUREQUEST                139     /* who are you request */
+#define ICMP6_WRUREPLY                  140     /* who are you reply */
+#define ICMP6_FQDN_QUERY                139     /* FQDN query */
+#define ICMP6_FQDN_REPLY                140     /* FQDN reply */
+#define ICMP6_NI_QUERY                  139     /* node information request */
+#define ICMP6_NI_REPLY                  140     /* node information reply */
+#define MLDV2_LISTENER_REPORT		143	/* RFC3810 listener report */
+
+/* The definitions below are experimental. TBA */
+#define MLD_MTRACE_RESP			200	/* mtrace resp (to sender) */
+#define MLD_MTRACE			201	/* mtrace messages */
+
+#define ICMP6_DST_UNREACH_NOROUTE	0	/* no route to destination */
+#define ICMP6_DST_UNREACH_ADMIN	 	1	/* administratively prohibited */
+#define ICMP6_DST_UNREACH_NOTNEIGHBOR	2	/* not a neighbor(obsolete) */
+#define ICMP6_DST_UNREACH_BEYONDSCOPE	2	/* beyond scope of source address */
+#define ICMP6_DST_UNREACH_ADDR		3	/* address unreachable */
+#define ICMP6_DST_UNREACH_NOPORT	4	/* port unreachable */
+
+#define ICMP6_TIME_EXCEED_TRANSIT 	0	/* ttl==0 in transit */
+#define ICMP6_TIME_EXCEED_REASSEMBLY	1	/* ttl==0 in reass */
+
+#define ICMP6_PARAMPROB_HEADER 	 	0	/* erroneous header field */
+#define ICMP6_PARAMPROB_NEXTHEADER	1	/* unrecognized next header */
+#define ICMP6_PARAMPROB_OPTION		2	/* unrecognized option */
+
+#define ICMP6_INFOMSG_MASK		0x80	/* all informational messages */
+
+#define ICMP6_NI_SUBJ_IPV6	0	/* Query Subject is an IPv6 address */
+#define ICMP6_NI_SUBJ_FQDN	1	/* Query Subject is a Domain name */
+#define ICMP6_NI_SUBJ_IPV4	2	/* Query Subject is an IPv4 address */
+
+#define ICMP6_NI_SUCCESS	0	/* node information successful reply */
+#define ICMP6_NI_REFUSED	1	/* node information request is refused */
+#define ICMP6_NI_UNKNOWN	2	/* unknown Qtype */
+
+#define ICMP6_ROUTER_RENUMBERING_COMMAND  0	/* rr command */
+#define ICMP6_ROUTER_RENUMBERING_RESULT   1	/* rr result */
+#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET   255	/* rr seq num reset */
+
+#define ND_REDIRECT_ONLINK	0	/* redirect to an on-link node */
+#define ND_REDIRECT_ROUTER	1	/* redirect to a better router */
+
+struct rr_pco_match    /* match prefix part */
+  {
+    uint8_t             rpm_code;
+    uint8_t             rpm_len;
+    uint8_t             rpm_ordinal;
+    uint8_t             rpm_matchlen;
+    uint8_t             rpm_minlen;
+    uint8_t             rpm_maxlen;
+    uint16_t            rpm_reserved;
+    struct in6_addr     rpm_prefix;
+  } __attribute__ ((__packed__));
+
+/* PCO code values */
+#define RPM_PCO_ADD             1
+#define RPM_PCO_CHANGE          2
+#define RPM_PCO_SETGLOBAL       3
+#define RPM_PCO_MAX             4
+
+struct rr_pco_use      /* use prefix part */
+  {
+    uint8_t             rpu_uselen;
+    uint8_t             rpu_keeplen;
+    uint8_t             rpu_ramask;
+    uint8_t             rpu_raflags;
+    uint32_t            rpu_vltime;
+    uint32_t            rpu_pltime;
+    uint32_t            rpu_flags;
+    struct in6_addr     rpu_prefix;
+  } __attribute__ ((__packed__));
+
+#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK  0x80
+#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO    0x40
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000
+# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
+# define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
+#endif
+
+struct rr_result       /* router renumbering result message */
+  {
+    uint16_t            rrr_flags;
+    uint8_t             rrr_ordinal;
+    uint8_t             rrr_matchedlen;
+    uint32_t            rrr_ifid;
+    struct in6_addr     rrr_prefix;
+  } __attribute__ ((__packed__));
+
+#if BYTE_ORDER == BIG_ENDIAN
+# define ICMP6_RR_RESULT_FLAGS_OOB       0x0002
+# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001
+#elif BYTE_ORDER == LITTLE_ENDIAN
+# define ICMP6_RR_RESULT_FLAGS_OOB       0x0200
+# define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
+#endif
+
+/* Mobile IPv6 extension: Advertisement Interval.  */
+struct nd_opt_adv_interval
+  {
+    uint8_t   nd_opt_adv_interval_type;
+    uint8_t   nd_opt_adv_interval_len;
+    uint16_t  nd_opt_adv_interval_reserved;
+    uint32_t  nd_opt_adv_interval_ival;
+  };
+
+/* Mobile IPv6 extension: Home Agent Info.  */
+struct nd_opt_home_agent_info
+  {
+    uint8_t   nd_opt_home_agent_info_type;
+    uint8_t   nd_opt_home_agent_info_len;
+    uint16_t  nd_opt_home_agent_info_reserved;
+    uint16_t  nd_opt_home_agent_info_preference;
+    uint16_t  nd_opt_home_agent_info_lifetime;
+  };
+
+/*-
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)ip_icmp.h	8.1 (Berkeley) 6/10/93
+ */
+
+/*
+ * IP6 route structure
+ */
+
+struct route_in6 {
+        struct  rtentry *ro_rt;
+        struct  llentry *ro_lle;
+        struct  sockaddr_in6 ro_dst;
+};
+
+/*
+ * Variables related to this implementation
+ * of the internet control message protocol version 6.
+ */
+struct icmp6errstat {
+	u_quad_t icp6errs_dst_unreach_noroute;
+	u_quad_t icp6errs_dst_unreach_admin;
+	u_quad_t icp6errs_dst_unreach_beyondscope;
+	u_quad_t icp6errs_dst_unreach_addr;
+	u_quad_t icp6errs_dst_unreach_noport;
+	u_quad_t icp6errs_packet_too_big;
+	u_quad_t icp6errs_time_exceed_transit;
+	u_quad_t icp6errs_time_exceed_reassembly;
+	u_quad_t icp6errs_paramprob_header;
+	u_quad_t icp6errs_paramprob_nextheader;
+	u_quad_t icp6errs_paramprob_option;
+	u_quad_t icp6errs_redirect; /* we regard redirect as an error here */
+	u_quad_t icp6errs_unknown;
+};
+
+struct icmp6stat {
+/* statistics related to icmp6 packets generated */
+	u_quad_t icp6s_error;		/* # of calls to icmp6_error */
+	u_quad_t icp6s_canterror;	/* no error 'cuz old was icmp */
+	u_quad_t icp6s_toofreq;		/* no error 'cuz rate limitation */
+	u_quad_t icp6s_outhist[256];
+/* statistics related to input message processed */
+	u_quad_t icp6s_badcode;		/* icmp6_code out of range */
+	u_quad_t icp6s_tooshort;	/* packet < sizeof(struct icmp6_hdr) */
+	u_quad_t icp6s_checksum;	/* bad checksum */
+	u_quad_t icp6s_badlen;		/* calculated bound mismatch */
+	/*
+	 * number of responses: this member is inherited from netinet code, but
+	 * for netinet6 code, it is already available in icp6s_outhist[].
+	 */
+	u_quad_t icp6s_reflect;
+	u_quad_t icp6s_inhist[256];	
+	u_quad_t icp6s_nd_toomanyopt;	/* too many ND options */
+	struct icmp6errstat icp6s_outerrhist;
+#define icp6s_odst_unreach_noroute \
+	icp6s_outerrhist.icp6errs_dst_unreach_noroute
+#define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin
+#define icp6s_odst_unreach_beyondscope \
+	icp6s_outerrhist.icp6errs_dst_unreach_beyondscope
+#define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr
+#define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport
+#define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big
+#define icp6s_otime_exceed_transit \
+	icp6s_outerrhist.icp6errs_time_exceed_transit
+#define icp6s_otime_exceed_reassembly \
+	icp6s_outerrhist.icp6errs_time_exceed_reassembly
+#define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header
+#define icp6s_oparamprob_nextheader \
+	icp6s_outerrhist.icp6errs_paramprob_nextheader
+#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
+#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
+#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
+	u_quad_t icp6s_pmtuchg;		/* path MTU changes */
+	u_quad_t icp6s_nd_badopt;	/* bad ND options */
+	u_quad_t icp6s_badns;		/* bad neighbor solicitation */
+	u_quad_t icp6s_badna;		/* bad neighbor advertisement */
+	u_quad_t icp6s_badrs;		/* bad router advertisement */
+	u_quad_t icp6s_badra;		/* bad router advertisement */
+	u_quad_t icp6s_badredirect;	/* bad redirect message */
+};
+
+#endif /* netinet/icmpv6.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/netinet/if_ether.h
@@ -0,0 +1,139 @@
+/* Copyright (C) 1996, 1997, 1999, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef __NETINET_IF_ETHER_H
+
+#define __NETINET_IF_ETHER_H	1
+#include <features.h>
+#include <sys/types.h>
+
+#include <sys/kglue/sys/types.h>
+#include <net/if_ether.h>
+
+#ifdef __USE_MISC
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)if_ether.h	8.3 (Berkeley) 5/2/95
+ *	$FreeBSD$
+ */
+
+#include <net/ethernet.h>
+#include <net/if_arp.h>
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+/*
+ * Ethernet Address Resolution Protocol.
+ *
+ * See RFC 826 for protocol description.  Structure below is adapted
+ * to resolving internet addresses.  Field names used correspond to
+ * RFC 826.
+ */
+struct	ether_arp {
+	struct	arphdr ea_hdr;		/* fixed-size header */
+	u_int8_t arp_sha[ETH_ALEN];	/* sender hardware address */
+	u_int8_t arp_spa[4];		/* sender protocol address */
+	u_int8_t arp_tha[ETH_ALEN];	/* target hardware address */
+	u_int8_t arp_tpa[4];		/* target protocol address */
+};
+#define	arp_hrd	ea_hdr.ar_hrd
+#define	arp_pro	ea_hdr.ar_pro
+#define	arp_hln	ea_hdr.ar_hln
+#define	arp_pln	ea_hdr.ar_pln
+#define	arp_op	ea_hdr.ar_op
+
+struct sockaddr_inarp {
+	__SOCKADDR_COMMON (sin_);
+	in_port_t sin_port;                 /* Port number.  */
+	struct in_addr sin_addr;            /* Internet address.  */
+	struct in_addr sin_srcaddr;
+	unsigned short sin_tos;
+	unsigned short sin_other;
+#define SIN_PROXY 1
+};
+
+/*
+ * IP and ethernet specific routing flags
+ */
+#define	RTF_USETRAILERS	RTF_PROTO1	/* use trailers */
+#define RTF_ANNOUNCE	RTF_PROTO2	/* announce new arp entry */
+
+/*
+ * Macro to map an IP multicast address to an Ethernet multicast address.
+ * The high-order 25 bits of the Ethernet address are statically assigned,
+ * and the low-order 23 bits are taken from the low end of the IP address.
+ */
+#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
+	/* struct in_addr *ipaddr; */ \
+	/* u_char enaddr[ETH_ALEN];	   */ \
+{ \
+	(enaddr)[0] = 0x01; \
+	(enaddr)[1] = 0x00; \
+	(enaddr)[2] = 0x5e; \
+	(enaddr)[3] = ((u_int8_t *)ipaddr)[1] & 0x7f; \
+	(enaddr)[4] = ((u_int8_t *)ipaddr)[2]; \
+	(enaddr)[5] = ((u_int8_t *)ipaddr)[3]; \
+}
+
+/*
+ * Macro to map an IP6 multicast address to an Ethernet multicast address.
+ * The high-order 16 bits of the Ethernet address are statically assigned,
+ * and the low-order 32 bits are taken from the low end of the IP6 address.
+ */
+#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr)			\
+/* struct	in6_addr *ip6addr; */					\
+/* u_char	enaddr[ETH_ALEN]; */				\
+{                                                                       \
+	(enaddr)[0] = 0x33;						\
+	(enaddr)[1] = 0x33;						\
+	(enaddr)[2] = ((u_int8_t *)ip6addr)[12];				\
+	(enaddr)[3] = ((u_int8_t *)ip6addr)[13];				\
+	(enaddr)[4] = ((u_int8_t *)ip6addr)[14];				\
+	(enaddr)[5] = ((u_int8_t *)ip6addr)[15];				\
+}
+
+__END_DECLS
+#endif /* __USE_MISC */
+
+#endif /* netinet/if_ether.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/netinet/ip_icmp.h
@@ -0,0 +1,296 @@
+/* Copyright (C) 1991-1993, 1995-1997, 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef __NETINET_IP_ICMP_H
+#define __NETINET_IP_ICMP_H    1
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+struct icmphdr
+{
+  u_int8_t type;		/* message type */
+  u_int8_t code;		/* type sub-code */
+  u_int16_t checksum;
+  union
+  {
+    struct
+    {
+      u_int16_t	id;
+      u_int16_t	sequence;
+    } echo;			/* echo datagram */
+    u_int32_t	gateway;	/* gateway address */
+    struct
+    {
+      u_int16_t	__unused;
+      u_int16_t	mtu;
+    } frag;			/* path mtu discovery */
+  } un;
+};
+
+#define ICMP_ECHOREPLY		0	/* Echo Reply			*/
+#define ICMP_DEST_UNREACH	3	/* Destination Unreachable	*/
+#define ICMP_SOURCE_QUENCH	4	/* Source Quench		*/
+#define ICMP_REDIRECT		5	/* Redirect (change route)	*/
+#define ICMP_ECHO		8	/* Echo Request			*/
+#define ICMP_TIME_EXCEEDED	11	/* Time Exceeded		*/
+#define ICMP_PARAMETERPROB	12	/* Parameter Problem		*/
+#define ICMP_TIMESTAMP		13	/* Timestamp Request		*/
+#define ICMP_TIMESTAMPREPLY	14	/* Timestamp Reply		*/
+#define ICMP_INFO_REQUEST	15	/* Information Request		*/
+#define ICMP_INFO_REPLY		16	/* Information Reply		*/
+#define ICMP_ADDRESS		17	/* Address Mask Request		*/
+#define ICMP_ADDRESSREPLY	18	/* Address Mask Reply		*/
+#define NR_ICMP_TYPES		18
+
+
+/* Codes for UNREACH. */
+#define ICMP_NET_UNREACH	0	/* Network Unreachable		*/
+#define ICMP_HOST_UNREACH	1	/* Host Unreachable		*/
+#define ICMP_PROT_UNREACH	2	/* Protocol Unreachable		*/
+#define ICMP_PORT_UNREACH	3	/* Port Unreachable		*/
+#define ICMP_FRAG_NEEDED	4	/* Fragmentation Needed/DF set	*/
+#define ICMP_SR_FAILED		5	/* Source Route failed		*/
+#define ICMP_NET_UNKNOWN	6
+#define ICMP_HOST_UNKNOWN	7
+#define ICMP_HOST_ISOLATED	8
+#define ICMP_NET_ANO		9
+#define ICMP_HOST_ANO		10
+#define ICMP_NET_UNR_TOS	11
+#define ICMP_HOST_UNR_TOS	12
+#define ICMP_PKT_FILTERED	13	/* Packet filtered */
+#define ICMP_PREC_VIOLATION	14	/* Precedence violation */
+#define ICMP_PREC_CUTOFF	15	/* Precedence cut off */
+#define NR_ICMP_UNREACH		15	/* instead of hardcoding immediate value */
+
+/* Codes for REDIRECT. */
+#define ICMP_REDIR_NET		0	/* Redirect Net			*/
+#define ICMP_REDIR_HOST		1	/* Redirect Host		*/
+#define ICMP_REDIR_NETTOS	2	/* Redirect Net for TOS		*/
+#define ICMP_REDIR_HOSTTOS	3	/* Redirect Host for TOS	*/
+
+/* Codes for TIME_EXCEEDED. */
+#define ICMP_EXC_TTL		0	/* TTL count exceeded		*/
+#define ICMP_EXC_FRAGTIME	1	/* Fragment Reass time exceeded	*/
+
+
+#ifdef __USE_MISC
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)ip_icmp.h	8.1 (Berkeley) 6/10/93
+ */
+
+#include <netinet/in.h>
+#include <netinet/ip.h>
+
+/*
+ * Internal of an ICMP Router Advertisement
+ */
+struct icmp_ra_addr
+{
+  u_int32_t ira_addr;
+  u_int32_t ira_preference;
+};
+
+struct icmp
+{
+  u_int8_t  icmp_type;	/* type of message, see below */
+  u_int8_t  icmp_code;	/* type sub code */
+  u_int16_t icmp_cksum;	/* ones complement checksum of struct */
+  union
+  {
+    u_char ih_pptr;		/* ICMP_PARAMPROB */
+    struct in_addr ih_gwaddr;	/* gateway address */
+    struct ih_idseq		/* echo datagram */
+    {
+      u_int16_t icd_id;
+      u_int16_t icd_seq;
+    } ih_idseq;
+    u_int32_t ih_void;
+
+    /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
+    struct ih_pmtu
+    {
+      u_int16_t ipm_void;
+      u_int16_t ipm_nextmtu;
+    } ih_pmtu;
+
+    struct ih_rtradv
+    {
+      u_int8_t irt_num_addrs;
+      u_int8_t irt_wpa;
+      u_int16_t irt_lifetime;
+    } ih_rtradv;
+  } icmp_hun;
+#define	icmp_pptr	icmp_hun.ih_pptr
+#define	icmp_gwaddr	icmp_hun.ih_gwaddr
+#define	icmp_id		icmp_hun.ih_idseq.icd_id
+#define	icmp_seq	icmp_hun.ih_idseq.icd_seq
+#define	icmp_void	icmp_hun.ih_void
+#define	icmp_pmvoid	icmp_hun.ih_pmtu.ipm_void
+#define	icmp_nextmtu	icmp_hun.ih_pmtu.ipm_nextmtu
+#define	icmp_num_addrs	icmp_hun.ih_rtradv.irt_num_addrs
+#define	icmp_wpa	icmp_hun.ih_rtradv.irt_wpa
+#define	icmp_lifetime	icmp_hun.ih_rtradv.irt_lifetime
+  union
+  {
+    struct
+    {
+      u_int32_t its_otime;
+      u_int32_t its_rtime;
+      u_int32_t its_ttime;
+    } id_ts;
+    struct
+    {
+      struct ip idi_ip;
+      /* options and then 64 bits of data */
+    } id_ip;
+    struct icmp_ra_addr id_radv;
+    u_int32_t   id_mask;
+    u_int8_t    id_data[1];
+  } icmp_dun;
+#define	icmp_otime	icmp_dun.id_ts.its_otime
+#define	icmp_rtime	icmp_dun.id_ts.its_rtime
+#define	icmp_ttime	icmp_dun.id_ts.its_ttime
+#define	icmp_ip		icmp_dun.id_ip.idi_ip
+#define	icmp_radv	icmp_dun.id_radv
+#define	icmp_mask	icmp_dun.id_mask
+#define	icmp_data	icmp_dun.id_data
+};
+
+/*
+ * Lower bounds on packet lengths for various types.
+ * For the error advice packets must first insure that the
+ * packet is large enough to contain the returned ip header.
+ * Only then can we do the check to see if 64 bits of packet
+ * data have been returned, since we need to check the returned
+ * ip header length.
+ */
+#define	ICMP_MINLEN	8				/* abs minimum */
+#define	ICMP_TSLEN	(8 + 3 * sizeof (n_time))	/* timestamp */
+#define	ICMP_MASKLEN	12				/* address mask */
+#define	ICMP_ADVLENMIN	(8 + sizeof (struct ip) + 8)	/* min */
+#ifndef _IP_VHL
+#define	ICMP_ADVLEN(p)	(8 + ((p)->icmp_ip.ip_hl << 2) + 8)
+	/* N.B.: must separately check that ip_hl >= 5 */
+#else
+#define	ICMP_ADVLEN(p)	(8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
+	/* N.B.: must separately check that header length >= 5 */
+#endif
+
+/*
+ * Definition of type and code field values.
+ */
+#define	ICMP_ECHOREPLY		0		/* echo reply */
+#define	ICMP_UNREACH		3		/* dest unreachable, codes: */
+#define		ICMP_UNREACH_NET	0		/* bad net */
+#define		ICMP_UNREACH_HOST	1		/* bad host */
+#define		ICMP_UNREACH_PROTOCOL	2		/* bad protocol */
+#define		ICMP_UNREACH_PORT	3		/* bad port */
+#define		ICMP_UNREACH_NEEDFRAG	4		/* IP_DF caused drop */
+#define		ICMP_UNREACH_SRCFAIL	5		/* src route failed */
+#define		ICMP_UNREACH_NET_UNKNOWN 6		/* unknown net */
+#define		ICMP_UNREACH_HOST_UNKNOWN 7		/* unknown host */
+#define		ICMP_UNREACH_ISOLATED	8		/* src host isolated */
+#define		ICMP_UNREACH_NET_PROHIB	9		/* prohibited access */
+#define		ICMP_UNREACH_HOST_PROHIB 10		/* ditto */
+#define		ICMP_UNREACH_TOSNET	11		/* bad tos for net */
+#define		ICMP_UNREACH_TOSHOST	12		/* bad tos for host */
+#define		ICMP_UNREACH_FILTER_PROHIB 13		/* admin prohib */
+#define		ICMP_UNREACH_HOST_PRECEDENCE 14		/* host prec vio. */
+#define		ICMP_UNREACH_PRECEDENCE_CUTOFF 15	/* prec cutoff */
+#define	ICMP_SOURCEQUENCH	4		/* packet lost, slow down */
+#define	ICMP_REDIRECT		5		/* shorter route, codes: */
+#define		ICMP_REDIRECT_NET	0		/* for network */
+#define		ICMP_REDIRECT_HOST	1		/* for host */
+#define		ICMP_REDIRECT_TOSNET	2		/* for tos and net */
+#define		ICMP_REDIRECT_TOSHOST	3		/* for tos and host */
+#define	ICMP_ALTHOSTADDR	6		/* alternate host address */
+#define	ICMP_ECHO		8		/* echo service */
+#define	ICMP_ROUTERADVERT	9		/* router advertisement */
+#define		ICMP_ROUTERADVERT_NORMAL		0	/* normal advertisement */
+#define		ICMP_ROUTERADVERT_NOROUTE_COMMON	16	/* selective routing */
+#define	ICMP_ROUTERSOLICIT	10		/* router solicitation */
+#define	ICMP_TIMXCEED		11		/* time exceeded, code: */
+#define		ICMP_TIMXCEED_INTRANS	0		/* ttl==0 in transit */
+#define		ICMP_TIMXCEED_REASS	1		/* ttl==0 in reass */
+#define	ICMP_PARAMPROB		12		/* ip header bad */
+#define		ICMP_PARAMPROB_ERRATPTR 0		/* error at param ptr */
+#define		ICMP_PARAMPROB_OPTABSENT 1		/* req. opt. absent */
+#define		ICMP_PARAMPROB_LENGTH 2			/* bad length */
+#define	ICMP_TSTAMP		13		/* timestamp request */
+#define	ICMP_TSTAMPREPLY	14		/* timestamp reply */
+#define	ICMP_IREQ		15		/* information request */
+#define	ICMP_IREQREPLY		16		/* information reply */
+#define	ICMP_MASKREQ		17		/* address mask request */
+#define	ICMP_MASKREPLY		18		/* address mask reply */
+#define	ICMP_TRACEROUTE		30		/* traceroute */
+#define	ICMP_DATACONVERR	31		/* data conversion error */
+#define	ICMP_MOBILE_REDIRECT	32		/* mobile host redirect */
+#define	ICMP_IPV6_WHEREAREYOU	33		/* IPv6 where-are-you */
+#define	ICMP_IPV6_IAMHERE	34		/* IPv6 i-am-here */
+#define	ICMP_MOBILE_REGREQUEST	35		/* mobile registration req */
+#define	ICMP_MOBILE_REGREPLY	36		/* mobile registration reply */
+#define	ICMP_SKIP		39		/* SKIP */
+#define	ICMP_PHOTURIS		40		/* Photuris */
+#define		ICMP_PHOTURIS_UNKNOWN_INDEX	1	/* unknown sec index */
+#define		ICMP_PHOTURIS_AUTH_FAILED	2	/* auth failed */
+#define		ICMP_PHOTURIS_DECRYPT_FAILED	3	/* decrypt failed */
+
+#define	ICMP_MAXTYPE		40
+
+#define	ICMP_INFOTYPE(type) \
+	((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
+	(type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
+	(type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
+	(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
+	(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
+
+#endif /* __USE_MISC */
+
+__END_DECLS
+
+#endif /* netinet/ip_icmp.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/netinet/tcp.h
@@ -0,0 +1,278 @@
+/* netinet/tcp.h
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)tcp.h	8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_TCP_H
+#define _NETINET_TCP_H	1
+
+#include <features.h>
+#include <sys/queue.h>
+
+/*
+ * User-settable options (used with setsockopt).
+ */
+#define TCP_NODELAY	 1	/* Don't delay send to coalesce packets  */
+#define TCP_MAXSEG	 2	/* Set maximum segment size  */
+#define TCP_NOPUSH	 4	/* Don't push last block of write  */
+#define TCP_NOOPT	 8	/* Don't use TCP options  */
+#define TCP_MD5SIG	16	/* use MD5 digests (RFC2385) */
+#define TCP_INFO	32	/* retrieve tcp_info structure */
+#define TCP_CONGESTION	64	/* get/set congestion control algorithm */
+#define TCP_CCALGOOPT	65	/* get/set cc algorithm specific options */
+#define TCP_KEEPINIT	128	/* N, time to establish connection */
+#define TCP_KEEPIDLE	256	/* L,N,X start keeplives after this period */
+#define TCP_KEEPINTVL	512	/* L,N interval between keepalives */
+#define TCP_KEEPCNT	1024	/* L,N number of keepalives before close */
+#define TCP_FASTOPEN	1025	/* enable TFO / was created via TFO */
+#define TCP_PCAP_OUT	2048	/* number of output packets to keep */
+#define TCP_PCAP_IN	4096	/* number of input packets to keep */
+#define TCP_FUNCTION_BLK 8192	/* Set the tcp function pointers to the specified stack */
+
+#ifdef __USE_MISC
+# include <sys/types.h>
+
+typedef	u_int32_t tcp_seq;
+typedef	u_int32_t tcp_cc;	/* connection count, per RFC 1644 */
+
+/* Miscellaneous constants */
+#define MAX_SACK_BLKS   6       /* Max # SACK blocks stored at receiver side */   
+#define TCP_MAX_SACK    4       /* MAX # SACKs sent in any segment */
+
+/*
+ * TCP header.
+ * Per RFC 793, September, 1981.
+ */
+struct tcphdr
+  {
+    __extension__ union
+    {
+      struct
+      {
+    u_int16_t th_sport;		/* source port */
+    u_int16_t th_dport;		/* destination port */
+    tcp_seq th_seq;		/* sequence number */
+    tcp_seq th_ack;		/* acknowledgement number */
+#  if __BYTE_ORDER == __LITTLE_ENDIAN
+    u_int8_t th_x2:4;		/* (unused) */
+    u_int8_t th_off:4;		/* data offset */
+#  endif
+#  if __BYTE_ORDER == __BIG_ENDIAN
+    u_int8_t th_off:4;		/* data offset */
+    u_int8_t th_x2:4;		/* (unused) */
+#  endif
+    u_int8_t th_flags;
+#  define TH_FIN	0x01
+#  define TH_SYN	0x02
+#  define TH_RST	0x04
+#  define TH_PUSH	0x08
+#  define TH_ACK	0x10
+#  define TH_URG	0x20
+    u_int16_t th_win;		/* window */
+    u_int16_t th_sum;		/* checksum */
+    u_int16_t th_urp;		/* urgent pointer */
+};
+      struct
+      {
+    u_int16_t source;
+    u_int16_t dest;
+    u_int32_t seq;
+    u_int32_t ack_seq;
+#  if __BYTE_ORDER == __LITTLE_ENDIAN
+    u_int16_t res1:4;
+    u_int16_t doff:4;
+    u_int16_t fin:1;
+    u_int16_t syn:1;
+    u_int16_t rst:1;
+    u_int16_t psh:1;
+    u_int16_t ack:1;
+    u_int16_t urg:1;
+    u_int16_t res2:2;
+#  elif __BYTE_ORDER == __BIG_ENDIAN
+    u_int16_t doff:4;
+    u_int16_t res1:4;
+    u_int16_t res2:2;
+    u_int16_t urg:1;
+    u_int16_t ack:1;
+    u_int16_t psh:1;
+    u_int16_t rst:1;
+    u_int16_t syn:1;
+    u_int16_t fin:1;
+#  else
+#   error "Adjust your <bits/endian.h> defines"
+#  endif
+    u_int16_t window;
+    u_int16_t check;
+    u_int16_t urg_ptr;
+};
+    };
+};
+
+enum
+{
+  TCP_ESTABLISHED = 1,
+  TCP_SYN_SENT,
+  TCP_SYN_RECV,
+  TCP_FIN_WAIT1,
+  TCP_FIN_WAIT2,
+  TCP_TIME_WAIT,
+  TCP_CLOSE,
+  TCP_CLOSE_WAIT,
+  TCP_LAST_ACK,
+  TCP_LISTEN,
+  TCP_CLOSING   /* now a valid state */
+};
+
+# define TCPOPT_EOL		0
+# define TCPOPT_NOP		1
+# define TCPOPT_MAXSEG		2
+# define    TCPOLEN_MAXSEG		4
+# define TCPOPT_WINDOW		3
+# define    TCPOLEN_WINDOW		3
+# define TCPOPT_SACK_PERMITTED	4		/* Experimental */
+# define    TCPOLEN_SACK_PERMITTED	2
+# define TCPOPT_SACK		5		/* Experimental */
+# define TCPOPT_TIMESTAMP	8
+# define    TCPOLEN_TIMESTAMP	10
+# define    TCPOLEN_TSTAMP_APPA	(TCPOLEN_TIMESTAMP+2) /* appendix A */
+# define    TCPOPT_TSTAMP_HDR	\
+    (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
+#define	TCPOPT_CC		11		/* CC options: RFC-1644 */
+#define TCPOPT_CCNEW		12
+#define TCPOPT_CCECHO		13
+#define	   TCPOLEN_CC			6
+#define	   TCPOLEN_CC_APPA		(TCPOLEN_CC+2)
+#define	   TCPOPT_CC_HDR(ccopt)		\
+    (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
+
+/*
+ * Default maximum segment size for TCP.
+ * With an IP MSS of 576, this is 536,
+ * but 512 is probably more convenient.
+ * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
+ */
+# define TCP_MSS	512
+
+/*
+ * Default maximum segment size for TCP6.
+ * With an IP MSS of 1280, this is 1220,
+ * but 1024 is probably more convenient.
+ * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr)).
+ */
+# define TCP6_MSS	1024
+
+# define TCP_MAXWIN	65535	/* largest value for (unscaled) window */
+# define TTCP_CLIENT_SND_WND 4096 /* default send window for T/TCP client */
+
+# define TCP_MAX_WINSHIFT	14	/* maximum window shift */
+
+#define TCP_MAXBURST		4	/* maximum segments in a burst */
+
+#define TCP_MAXHLEN	(0xf<<2)	/* max length of header in bytes */
+#define TCP_MAXOLEN	(TCP_MAXHLEN - sizeof (struct tcphdr))
+					/* max space left for options */
+
+# define SOL_TCP		6	/* TCP level */
+
+
+# define TCPI_OPT_TIMESTAMPS	1
+# define TCPI_OPT_SACK		2
+# define TCPI_OPT_WSCALE	4
+# define TCPI_OPT_ECN		8
+
+/* Values for tcpi_state.  */
+enum tcp_ca_state
+{
+  TCP_CA_Open = 0,
+  TCP_CA_Disorder = 1,
+  TCP_CA_CWR = 2,
+  TCP_CA_Recovery = 3,
+  TCP_CA_Loss = 4
+};
+
+struct tcp_info
+{
+  u_int8_t	tcpi_state;
+  u_int8_t	tcpi_ca_state;
+  u_int8_t	tcpi_retransmits;
+  u_int8_t	tcpi_probes;
+  u_int8_t	tcpi_backoff;
+  u_int8_t	tcpi_options;
+  u_int8_t	tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+  u_int32_t	tcpi_rto;
+  u_int32_t	tcpi_ato;
+  u_int32_t	tcpi_snd_mss;
+  u_int32_t	tcpi_rcv_mss;
+
+  u_int32_t	tcpi_unacked;
+  u_int32_t	tcpi_sacked;
+  u_int32_t	tcpi_lost;
+  u_int32_t	tcpi_retrans;
+  u_int32_t	tcpi_fackets;
+
+  /* Times. */
+  u_int32_t	tcpi_last_data_sent;
+  u_int32_t	tcpi_last_ack_sent;	/* Not remembered, sorry.  */
+  u_int32_t	tcpi_last_data_recv;
+  u_int32_t	tcpi_last_ack_recv;
+
+  /* Metrics. */
+  u_int32_t	tcpi_pmtu;
+  u_int32_t	tcpi_rcv_ssthresh;
+  u_int32_t	tcpi_rtt;
+  u_int32_t	tcpi_rttvar;
+  u_int32_t	tcpi_snd_ssthresh;
+  u_int32_t	tcpi_snd_cwnd;
+  u_int32_t	tcpi_advmss;
+  u_int32_t	tcpi_reordering;
+};
+
+#endif /* Misc.  */
+
+#endif /* netinet/tcp.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/nfs/nfs.h
@@ -0,0 +1,3 @@
+#include <stdint.h>
+#include <sys/mount.h>
+#include <nfs/nfsproto.h>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/not-cancel.h
@@ -0,0 +1,91 @@
+/* Uncancelable versions of cancelable interfaces.  kFreeBSD version.
+   Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/types.h>
+#include <sysdep.h>
+
+/* Uncancelable open.  */
+#define open_not_cancel(name, flags, mode) \
+   INLINE_SYSCALL (open, 3, (const char *) (name), (flags), (mode))
+#define open_not_cancel_2(name, flags) \
+   INLINE_SYSCALL (open, 2, (const char *) (name), (flags))
+
+/* Uncancelable openat.  */
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
+extern int __openat_nocancel (int fd, const char *fname, int oflag,
+			      mode_t mode) attribute_hidden;
+extern int __openat64_nocancel (int fd, const char *fname, int oflag,
+				mode_t mode) attribute_hidden;
+#else
+# define __openat_nocancel(fd, fname, oflag, mode) \
+  openat (fd, fname, oflag, mode)
+# define __openat64_nocancel(fd, fname, oflag, mode) \
+  openat64 (fd, fname, oflag, mode)
+#endif
+
+#define openat_not_cancel(fd, fname, oflag, mode) \
+  __openat_nocancel (fd, fname, oflag, mode)
+#define openat_not_cancel_3(fd, fname, oflag) \
+  __openat_nocancel (fd, fname, oflag, 0)
+#define openat64_not_cancel(fd, fname, oflag, mode) \
+  __openat64_nocancel (fd, fname, oflag, mode)
+#define openat64_not_cancel_3(fd, fname, oflag) \
+  __openat64_nocancel (fd, fname, oflag, 0)
+
+/* Uncancelable close.  */
+#define close_not_cancel(fd) \
+  INLINE_SYSCALL (close, 1, fd)
+
+#define close_not_cancel_no_status(fd) \
+  (void) ({ INTERNAL_SYSCALL_DECL (err); \
+	    INTERNAL_SYSCALL (close, err, 1, (fd)); })
+
+/* Uncancelable read.  */
+#define read_not_cancel(fd, buf, n) \
+  INLINE_SYSCALL (read, 3, (fd), (buf), (n))
+
+/* Uncancelable write.  */
+#define write_not_cancel(fd, buf, n) \
+  INLINE_SYSCALL (write, 3, (fd), (buf), (n))
+
+/* Uncancelable writev.  */
+#define writev_not_cancel_no_status(fd, iov, n) \
+  (void) ({ INTERNAL_SYSCALL_DECL (err); \
+	    INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); })
+
+/* Uncancelable fcntl.  */
+#define fcntl_not_cancel(fd, cmd, val) \
+  __fcntl_nocancel (fd, cmd, val)
+
+/* Uncancelable waitpid.  */
+# define waitpid_not_cancel(pid, stat_loc, options) \
+  INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
+
+/* Uncancelable pause.  */
+# define pause_not_cancel() \
+  __pause_nocancel ()
+
+/* Uncancelable nanosleep.  */
+# define nanosleep_not_cancel(requested_time, remaining) \
+  INLINE_SYSCALL (nanosleep, 2, requested_time, remaining)
+
+/* Uncancelable sigsuspend.  */
+#define sigsuspend_not_cancel(set) \
+  INLINE_SYSCALL (sigsuspend, 1, set)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/open.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <fcntl.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <sysdep.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sysdep-cancel.h>
+
+int
+__libc_open (const char *file, int oflag, ...)
+{
+  int mode = 0;
+  int fd;
+
+  if (__OPEN_NEEDS_MODE (oflag))
+    {
+      va_list arg;
+      va_start (arg, oflag);
+      mode = va_arg (arg, int);
+      va_end (arg);
+    }
+
+  if (SINGLE_THREAD_P)
+  {
+    fd = INLINE_SYSCALL (open, 3, file, oflag, mode);
+  }
+  else
+  {
+    int oldtype = LIBC_CANCEL_ASYNC ();
+    fd = INLINE_SYSCALL (open, 3, file, oflag, mode);
+    LIBC_CANCEL_RESET (oldtype);
+  }
+  return fd;
+}
+libc_hidden_def (__libc_open)
+
+weak_alias (__libc_open, __open)
+libc_hidden_weak (__open)
+
+weak_alias (__libc_open, open)
+
+strong_alias (__libc_open, __libc_open64)
+weak_alias (__libc_open64, __open64)
+weak_alias (__libc_open64, open64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/open64.c
@@ -0,0 +1,2 @@
+/* 'open64' is the same as 'open', because __off64_t == __off_t and
+   O_LARGEFILE == 0.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/openat.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sysdep.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/user.h>
+#include <kernel-features.h>
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+extern int __syscall_openat (int fd, const char *path, int flag, mode_t mode);
+libc_hidden_proto (__syscall_openat)
+
+/* Open FILE with access OFLAG.  Interpret relative paths relative to
+   the directory associated with FD.  If OFLAG includes O_CREAT, a
+   third argument is the file protection.  */
+int
+__openat (int fd, const char *file, int oflag, ...)
+{
+  int mode = 0;
+  int result;
+
+  if (__OPEN_NEEDS_MODE (oflag))
+    {
+      va_list arg;
+      va_start (arg, oflag);
+      mode = va_arg (arg, int);
+      va_end (arg);
+    }
+  
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (openat, 4, fd, file, oflag, mode);
+  else
+    {
+      int oldtype = LIBC_CANCEL_ASYNC ();
+      result = INLINE_SYSCALL (openat, 4, fd, file, oflag, mode);
+      LIBC_CANCEL_RESET (oldtype);
+    }
+  return result;
+}
+
+libc_hidden_def (__openat)
+weak_alias (__openat, openat)
+
+/* 'openat64' is the same as 'openat', because __off64_t == __off_t.  */
+strong_alias (__openat, __openat64)
+libc_hidden_def (__openat64)
+weak_alias (__openat64, openat64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/openat64.c
@@ -0,0 +1,2 @@
+/* 'openat64' is the same as 'openat', because __off64_t == __off_t and
+   O_LARGEFILE == 0.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/paths.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)paths.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PATHS_H_
+#define	_PATHS_H_
+
+/* Default search path. */
+#define	_PATH_DEFPATH	"/usr/bin:/bin"
+/* All standard utilities path. */
+#define	_PATH_STDPATH \
+	"/usr/bin:/bin:/usr/sbin:/sbin"
+
+#define	_PATH_BSHELL	"/bin/sh"
+#define	_PATH_CONSOLE	"/dev/console"
+#define	_PATH_CSHELL	"/bin/csh"
+#define	_PATH_DEVDB	"/var/run/dev.db"
+#define	_PATH_DEVNULL	"/dev/null"
+#define	_PATH_DRUM	"/dev/drum"
+#define	_PATH_KLOG	"/dev/klog"
+#define	_PATH_KMEM	"/dev/kmem"
+#define	_PATH_LASTLOG	"/var/log/lastlog"
+#define	_PATH_MAILDIR	"/var/mail"
+#define	_PATH_MAN	"/usr/share/man"
+#define	_PATH_MEM	"/dev/mem"
+#define	_PATH_MNTTAB	"/etc/fstab"
+#define	_PATH_MOUNTED	"/etc/mtab"
+#define	_PATH_NOLOGIN	"/etc/nologin"
+#define	_PATH_PRESERVE	"/var/lib"
+#define	_PATH_RWHODIR	"/var/spool/rwho"
+#define	_PATH_SENDMAIL	"/usr/sbin/sendmail"
+#define	_PATH_SHADOW	"/etc/shadow"
+#define	_PATH_SHELLS	"/etc/shells"
+#define	_PATH_TTY	"/dev/tty"
+#define	_PATH_UNIX	"/kernel"
+#define _PATH_UTMP	"/var/run/utmp"
+#define	_PATH_VI	"/usr/bin/vi"
+#define _PATH_WTMP	"/var/log/wtmp"
+
+/* Provide trailing slash, since mostly used for building pathnames. */
+#define	_PATH_DEV	"/dev/"
+#define	_PATH_TMP	"/tmp/"
+#define	_PATH_VARDB	"/var/lib/misc/"
+#define	_PATH_VARRUN	"/var/run/"
+#define	_PATH_VARTMP	"/var/tmp/"
+
+#endif /* !_PATHS_H_ */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/posix_fadvise.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysdep.h>
+#include <sys/stat.h>
+#include <sys/user.h>
+#include <kernel-features.h>
+
+extern int __syscall_posix_fadvise(int fd, off_t offset, off_t len, int advice);
+libc_hidden_proto (__syscall_posix_fadvise)
+
+/* the syscall is available in 8.x since 8.3 and in 9.1 and above */
+/* i.e. it is not supported in 9.0 kernel */
+
+int
+posix_fadvise(int fd, off_t offset, off_t len, int advice)
+{
+    int rv;
+    rv = INLINE_SYSCALL (posix_fadvise, 4, fd, offset, len, advice);
+    if (rv == -1)
+    {
+        if (errno == ENOSYS)	/* cheat under old kernels as successfull */
+            return 0;
+        return errno;
+    }
+    return rv;
+}
+
+weak_alias (posix_fadvise, posix_fadvise64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/posix_fadvise64.c
@@ -0,0 +1 @@
+/* 'posix_fadvise64' is the same as 'posix_fadvise', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/posix_fallocate.c
@@ -0,0 +1,81 @@
+/* Copyright (C) 2007-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fcntl.h>
+#include <kernel-features.h>
+#include <sysdep.h>
+
+extern int __syscall_posix_fallocate(int fd, off_t offset, off_t len);
+libc_hidden_proto (__syscall_posix_fallocate)
+
+#define posix_fallocate static internal_fallocate
+#include <sysdeps/posix/posix_fallocate.c>
+#undef posix_fallocate
+
+#if !defined __ASSUME_FALLOCATE
+static int __have_fallocate;
+#endif
+
+
+/* Reserve storage for the data of the file associated with FD.  */
+int
+__posix_fallocate (int fd, __off_t offset, __off_t len)
+{
+#ifndef __ASSUME_FALLOCATE
+    if (__have_fallocate >= 0)
+#endif
+    {
+        int res = INLINE_SYSCALL (posix_fallocate, 3, fd, offset, len);
+      
+        if (res == -1)
+            res = errno;
+#ifndef __ASSUME_FALLOCATE
+        if (res == ENOSYS)
+        {
+            __have_fallocate = -1;
+        }
+        else
+#endif
+        {
+            if (res != EOPNOTSUPP)
+                return res;
+        }
+    }      
+    return internal_fallocate (fd, offset, len);
+}
+strong_alias (__posix_fallocate, posix_fallocate)
+
+/* 'posix_fallocate64' is the same as 'posix_fallocate', because __off64_t == __off_t.  */
+/*  but previous prototype have different size of len parameter */
+
+#include <shlib-compat.h>
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32 && SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
+
+int
+attribute_compat_text_section
+__posix_fallocate64_l32 (int fd, off64_t offset, size_t len)
+{
+  return __posix_fallocate (fd, offset, len);
+}
+
+versioned_symbol (libc, __posix_fallocate, posix_fallocate64, GLIBC_2_3_3);
+compat_symbol (libc, __posix_fallocate64_l32, posix_fallocate64, GLIBC_2_2);
+#else
+weak_alias (__posix_fallocate, posix_fallocate64)
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/posix_fallocate64.c
@@ -0,0 +1 @@
+/* 'posix_fallocate64' is the same as 'posix_fallocate', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/powerpc/bits/elf.h
@@ -0,0 +1,39 @@
+/* This file defines standard ELF types, structures, and macros.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _BITS_ELF_H
+#define _BITS_ELF_H
+
+__BEGIN_DECLS
+
+#define	AT_DCACHEBSIZE	10	/* Data cache block size for the processor. */
+#define	AT_ICACHEBSIZE	11	/* Instruction cache block size for the uP. */
+#define	AT_UCACHEBSIZE	12	/* Cache block size, or `0' if cache not unified. */
+#define	AT_EXECPATH	13	/* Path to the executable. */
+#define	AT_CANARY	14	/* Canary for SSP */
+#define	AT_CANARYLEN	15	/* Length of the canary. */
+#define	AT_OSRELDATE	16	/* OSRELDATE. */
+#define	AT_NCPUS	17	/* Number of CPUs. */
+#define	AT_PAGESIZES	18	/* Pagesizes. */
+#define	AT_PAGESIZESLEN	19	/* Number of pagesizes. */
+#define	AT_STACKPROT	21	/* Initial stack protection. */
+
+__END_DECLS
+
+#endif	/* elf.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/pread64.c
@@ -0,0 +1 @@
+/* 'pread64' is the same as 'pread', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/preadv64.c
@@ -0,0 +1 @@
+/* 'preadv64' is the same as 'preadv', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/prof-freq.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <libc-internal.h>
+#include <stddef.h>
+#include <sys/sysctl.h>
+
+int
+__profile_frequency (void)
+{
+  /* Fetch the "kern.clockrate" sysctl value.  */
+  int request[2] = { CTL_KERN, KERN_CLOCKRATE };
+  struct clockinfo result;
+  size_t result_len = sizeof (result);
+
+  if (__sysctl (request, 2, &result, &result_len, NULL, 0) < 0)
+    /* Dummy result.  */
+    return 1;
+
+  /* Yes, hz, not profhz.  On i386, the value is 100, not 1024.  */
+  return result.hz;
+}
+libc_hidden_def (__profile_frequency)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ptsname.c
@@ -0,0 +1,110 @@
+/* Copyright (C) 1998-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <paths.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#include <termios.h>
+#include <unistd.h>
+
+
+/* Directory where we can find the slave pty nodes.  */
+#define _PATH_DEVPTS "/dev/pts/"
+
+/* Static buffer for `ptsname'.  */
+static char buffer[sizeof (_PATH_DEVPTS) + 20];
+
+
+/* Return the pathname of the pseudo terminal slave associated with
+   the master FD is open on, or NULL on errors.
+   The returned storage is good until the next call to this function.  */
+char *
+ptsname (int fd)
+{
+  return __ptsname_r (fd, buffer, sizeof (buffer)) != 0 ? NULL : buffer;
+}
+
+
+int
+__isptymaster(int fd)
+{
+  if (0 == __ioctl(fd, TIOCPTMASTER))
+    return 0;
+
+  if (errno != EBADF)
+    __set_errno (EINVAL);
+
+  return -1;
+}
+
+
+int
+__ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
+{
+  struct fiodgname_arg fiodgname;
+  char *p;
+  if (buf == NULL)
+    {
+      __set_errno (EINVAL);
+      return EINVAL;
+    }
+    
+  /* Check if FD really is a master pseudo terminal.  */
+  if (0 != __isptymaster(fd))
+  {
+      __set_errno (ENOTTY);
+      return ENOTTY;
+  }
+
+  if (buflen < sizeof (_PATH_DEV) + 5) /* "/dev/" + "pts/"   */
+  {
+      __set_errno (ERANGE);
+      return ERANGE;
+  }
+
+  /* Construct the slave's pathname.  */
+  /* instead of strlen(_PATH_DEV) we use (sizeof (_PATH_DEV) - 1)  */
+  p = __mempcpy (buf, _PATH_DEV, sizeof (_PATH_DEV) - 1);
+  buflen -= (sizeof (_PATH_DEV) - 1);
+
+  fiodgname.buf = p;
+  fiodgname.len = buflen;
+
+  if (0 != __ioctl(fd, FIODGNAME, &fiodgname))
+    return errno;
+
+  if (__xstat64 (_STAT_VER, buf, stp) < 0)
+    return errno;
+
+  return 0;
+}
+
+
+/* Store at most BUFLEN characters of the pathname of the slave pseudo
+   terminal associated with the master FD is open on in BUF.
+   Return 0 on success, otherwise an error number.  */
+int
+__ptsname_r (int fd, char *buf, size_t buflen)
+{
+  struct stat64 st;
+  return __ptsname_internal (fd, buf, buflen, &st);
+}
+weak_alias (__ptsname_r, ptsname_r)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/pwrite64.c
@@ -0,0 +1 @@
+/* 'pwrite64' is the same as 'pwrite', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/pwritev64.c
@@ -0,0 +1 @@
+/* 'pwritev64' is the same as 'pwritev', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/readdir.c
@@ -0,0 +1,11 @@
+/* 'readdir64' is the same as 'readdir', because
+   struct dirent64 == struct dirent.  */
+
+#define readdir64 __no_readdir64_decl
+#define __readdir64 __no___readdir64_decl
+#include <sysdeps/posix/readdir.c>
+#undef __readdir64
+#undef readdir64
+
+strong_alias (__readdir, __readdir64)
+weak_alias (__readdir64, readdir64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/readdir64.c
@@ -0,0 +1,2 @@
+/* 'readdir64' is the same as 'readdir', because
+   struct dirent64 == struct dirent.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/readdir64_r.c
@@ -0,0 +1,2 @@
+/* 'readdir64_r' is the same as 'readdir_r', because
+   struct dirent64 == struct dirent.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/readdir_r.c
@@ -0,0 +1,11 @@
+/* 'readdir64_r' is the same as 'readdir_r', because
+   struct dirent64 == struct dirent.  */
+
+#define readdir64_r __no_readdir64_r_decl
+#define __readdir64_r __no___readdir64_r_decl
+#include <sysdeps/posix/readdir_r.c>
+#undef __readdir64_r
+#undef readdir64_r
+
+strong_alias (__readdir_r, __readdir64_r)
+weak_alias (__readdir64_r, readdir64_r)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/readonly-area.c
@@ -0,0 +1,96 @@
+/* Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
+#include "libio/libioP.h"
+
+/* Return 1 if the whole area PTR .. PTR+SIZE is not writable.
+   Return -1 if it is writable.  */
+
+int
+__readonly_area (const char *ptr, size_t size)
+{
+  const void *ptr_end = ptr + size;
+
+  int mib[4];
+  size_t kve_len = 0;
+  char *kve_buf, *kve_bufp;
+
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PROC;
+  mib[2] = KERN_PROC_VMMAP;
+  mib[3] = __getpid ();
+
+  if (__sysctl (mib, 4, NULL, &kve_len, NULL, 0) != 0)
+    {
+      __set_errno (ENOSYS);
+      return 1;
+    }
+
+  kve_buf = alloca (kve_len);
+  if (__sysctl (mib, 4, kve_buf, &kve_len, NULL, 0) != 0)
+    {
+      __set_errno (ENOSYS);
+      return 1;
+    }
+
+  kve_bufp = kve_buf;
+  while (kve_bufp < kve_buf + kve_len)
+    {
+      struct kinfo_vmentry *kve = (struct kinfo_vmentry *) (uintptr_t) kve_bufp;
+      kve_bufp += kve->kve_structsize;
+
+      uintptr_t from = kve->kve_start;
+      uintptr_t to = kve->kve_end;
+
+      if (from < (uintptr_t) ptr_end && to > (uintptr_t) ptr)
+	{
+	  /* Found an entry that at least partially covers the area.  */
+	  if (!(kve->kve_protection & KVME_PROT_READ)
+	      || (kve->kve_protection & KVME_PROT_WRITE))
+	    break;
+
+	  if (from <= (uintptr_t) ptr && to >= (uintptr_t) ptr_end)
+	    {
+	      size = 0;
+	      break;
+	    }
+	  else if (from <= (uintptr_t) ptr)
+	    size -= to - (uintptr_t) ptr;
+	  else if (to >= (uintptr_t) ptr_end)
+	    size -= (uintptr_t) ptr_end - from;
+	  else
+	    size -= to - from;
+
+	  if (!size)
+	    break;
+	}
+    }
+
+  /* If the whole area between ptr and ptr_end is covered by read-only
+     VMAs, return 1.  Otherwise return -1.  */
+  return size == 0 ? 1 : -1;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/readv.c
@@ -0,0 +1,57 @@
+/* readv for FreeBSD.
+   Copyright (C) 1997-1998, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/param.h>
+#include <sys/uio.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+extern ssize_t __syscall_readv (int, __const struct iovec *, int);
+libc_hidden_proto(__syscall_readv)
+
+static ssize_t __atomic_readv_replacement (int, __const struct iovec *,
+					   int) internal_function;
+
+ssize_t
+__readv (int fd, const struct iovec *vector, int count)
+{
+  if (count <= UIO_MAXIOV)
+  {
+    if (SINGLE_THREAD_P)
+      return INLINE_SYSCALL (readv, 3, fd, vector, count);
+
+    int oldtype = LIBC_CANCEL_ASYNC ();
+    ssize_t result = INLINE_SYSCALL (readv, 3, fd, vector, count);
+    LIBC_CANCEL_RESET (oldtype);
+    return result;
+
+  }
+  else
+    return __atomic_readv_replacement (fd, vector, count);
+}
+weak_alias (__readv, readv)
+
+#undef weak_alias
+#define weak_alias(a,b)
+#define __readv static internal_function __atomic_readv_replacement
+#include <sysdeps/posix/readv.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/recv.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/socket.h>
+#include <sysdep.h>
+#include <sysdep-cancel.h>
+
+/* The real syscall's name.  See sysdeps/unix/inet/syscalls.list.  */
+#define __syscall_recvfrom __libc_recvfrom
+ssize_t __libc_recvfrom(int s, void *buf, size_t len, int flags,
+                        struct sockaddr *from, socklen_t *fromlen);
+libc_hidden_proto (__libc_recvfrom)
+
+/* Read N bytes into BUF from socket FD.
+   Return the number of bytes read or -1 for error.  */
+
+ssize_t
+__libc_recv (int fd, void *buf, size_t n, int flags)
+{
+  return INLINE_SYSCALL (recvfrom, 6, fd, buf, n, flags, NULL, NULL);
+}
+
+weak_alias (__libc_recv, __recv)
+weak_alias (__libc_recv, recv)
+
+LIBC_CANCEL_HANDLED (); /* in __libc_recvfrom */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/remove.c
@@ -0,0 +1,39 @@
+/* ANSI C `remove' function to delete a file or directory.  POSIX.1 version.
+   Copyright (C) 1995,96,97,2002,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+
+int
+remove (const char *file)
+{
+  /* First try to unlink since this is more frequently the necessary action. */
+  if (__unlink (file) != 0
+      /* If it is indeed a directory...  */
+      /* Linux returns EISDIR, POSIX mandates EPERM */
+      && (((errno != EISDIR) && (errno != EPERM))
+	  /* ...try to remove it.  */
+	  || __rmdir (file) != 0))
+    /* Cannot remove the object for whatever reason.  */
+    return -1;
+
+  return 0;
+}
+libc_hidden_def (remove)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/rtld-lowlevel.h
@@ -0,0 +1,131 @@
+/* Definitions for lowlevel handling in ld.so, FreeBSD variant
+   Copyright (C) 2006-2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _RTLD_LOWLEVEL_H
+#define  _RTLD_LOWLEVEL_H 1
+
+#include <atomic.h>
+#include <lowlevellock.h>
+
+/* Special multi-reader lock used in ld.so.  */
+#define __RTLD_MRLOCK_WRITER 1
+#define __RTLD_MRLOCK_RWAIT 2
+#define __RTLD_MRLOCK_WWAIT 4
+#define __RTLD_MRLOCK_RBITS \
+  ~(__RTLD_MRLOCK_WRITER | __RTLD_MRLOCK_RWAIT | __RTLD_MRLOCK_WWAIT)
+#define __RTLD_MRLOCK_INC 8
+#define __RTLD_MRLOCK_TRIES 5
+
+#define __rtld_mrlock_define(CLASS,NAME) \
+  CLASS __rtld_mrlock_t NAME;
+
+
+#define _RTLD_MRLOCK_INITIALIZER 0
+#define __rtld_mrlock_initialize(NAME) \
+  (void) ((NAME).lv = 0)
+
+
+#define __rtld_mrlock_lock(lock) \
+  do {									      \
+    __label__ out;							      \
+    while (1)								      \
+      {									      \
+	int oldval;							      \
+	for (int tries = 0; tries < __RTLD_MRLOCK_TRIES; ++tries)	      \
+	  {								      \
+	    oldval = (lock).iv;						      \
+	    while (__builtin_expect ((oldval				      \
+				      & (__RTLD_MRLOCK_WRITER		      \
+					 | __RTLD_MRLOCK_WWAIT))	      \
+				     == 0, 1))				      \
+	      {								      \
+		int newval = ((oldval & __RTLD_MRLOCK_RBITS)		      \
+			      + __RTLD_MRLOCK_INC);			      \
+		int ret = atomic_compare_and_exchange_val_acq (&(lock.iv),	      \
+							       newval,	      \
+							       oldval);	      \
+		if (__builtin_expect (ret == oldval, 1))		      \
+		  goto out;						      \
+		oldval = ret;						      \
+	      }								      \
+	    atomic_delay ();						      \
+	  }								      \
+	if ((oldval & __RTLD_MRLOCK_RWAIT) == 0)			      \
+	  {								      \
+	    atomic_or (&(lock.iv), __RTLD_MRLOCK_RWAIT);			      \
+	    oldval |= __RTLD_MRLOCK_RWAIT;				      \
+	  }								      \
+	lll_futex_wait (&(lock), oldval);					      \
+      }									      \
+  out:;									      \
+  } while (0)
+
+
+#define __rtld_mrlock_unlock(lock) \
+  do {									      \
+    int oldval = atomic_exchange_and_add (&(lock.iv), -__RTLD_MRLOCK_INC);	      \
+    if (__builtin_expect ((oldval					      \
+			   & (__RTLD_MRLOCK_RBITS | __RTLD_MRLOCK_WWAIT))     \
+			  == (__RTLD_MRLOCK_INC | __RTLD_MRLOCK_WWAIT), 0))   \
+      /* We have to wake all threads since there might be some queued	      \
+	 readers already.  */						      \
+      lll_futex_wake (&(lock), 0x7fffffff);				      \
+  } while (0)
+
+
+/* There can only ever be one thread trying to get the exclusive lock.  */
+#define __rtld_mrlock_change(lock) \
+  do {									      \
+    __label__ out;							      \
+    while (1)								      \
+      {									      \
+	int oldval;							      \
+	for (int tries = 0; tries < __RTLD_MRLOCK_TRIES; ++tries)	      \
+	  {								      \
+	    oldval = lock.iv;						      \
+	    while (__builtin_expect ((oldval & __RTLD_MRLOCK_RBITS) == 0, 1)) \
+	      {								      \
+		int newval = ((oldval & __RTLD_MRLOCK_RWAIT)		      \
+			      + __RTLD_MRLOCK_WRITER);			      \
+		int ret = atomic_compare_and_exchange_val_acq (&(lock.iv),	      \
+							       newval,	      \
+							       oldval);	      \
+		if (__builtin_expect (ret == oldval, 1))		      \
+		  goto out;						      \
+		oldval = ret;						      \
+	      }								      \
+	    atomic_delay ();						      \
+	  }								      \
+	atomic_or (&(lock.iv), __RTLD_MRLOCK_WWAIT);			      \
+	oldval |= __RTLD_MRLOCK_WWAIT;					      \
+	lll_futex_wait (&(lock), oldval);					      \
+      }									      \
+  out:;									      \
+  } while (0)
+
+
+#define __rtld_mrlock_done(lock) \
+  do {				 \
+    int oldval = atomic_exchange_and_add (&(lock.iv), -__RTLD_MRLOCK_WRITER);    \
+    if (__builtin_expect ((oldval & __RTLD_MRLOCK_RWAIT) != 0, 0))	      \
+      lll_futex_wake (&(lock), 0x7fffffff);				      \
+  } while (0)
+
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sa_len.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/socket.h>
+
+#include <netatalk/at.h>
+#include <netinet/in.h>
+#include <netipx/ipx.h>
+#include <sys/un.h>
+
+extern int __libc_sa_len (sa_family_t __af);
+libc_hidden_proto (__libc_sa_len)
+
+int
+__libc_sa_len (sa_family_t af)
+{
+  switch (af)
+    {
+    case AF_APPLETALK:
+      return sizeof (struct sockaddr_at);
+    case AF_INET:
+      return sizeof (struct sockaddr_in);
+    case AF_INET6:
+      return sizeof (struct sockaddr_in6);
+    case AF_IPX:
+      return sizeof (struct sockaddr_ipx);
+    case AF_LOCAL:
+      return __SOCKADDR_COMMON_SIZE + sizeof(((struct sockaddr_un *) 0)->sun_path);
+    }
+  return 0;
+}
+libc_hidden_def (__libc_sa_len)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sbrk.c
@@ -0,0 +1 @@
+#include <misc/sbrk.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sched_getaffinity.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <sched.h>
+#include <string.h>
+#include <sysdep.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include "cpuset-kern.h"
+
+int
+__libc_sched_getaffinity (pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
+{
+  int res;
+  int64_t id;
+
+  if (pid < 0)
+    {
+      __set_errno(ESRCH);
+      return -1;
+    }
+
+  if (pid == 0)		// user   level "self"
+      id = -1;		// kernel level "self"
+  else
+      id = pid;
+
+  if (cpusetsize > sizeof(cpu_set_t))
+    {
+      /* Clean the rest of the memory the kernel won't do.  */
+      memset ((char *) cpuset + sizeof(cpu_set_t), '\0', cpusetsize - sizeof(cpu_set_t));
+
+      cpusetsize = sizeof(cpu_set_t);
+    }
+
+  res = INLINE_SYSCALL (cpuset_getaffinity, 5, CPU_LEVEL_WHICH,
+			CPU_WHICH_PID, id, cpusetsize, cpuset);
+
+  if (errno == ERANGE)
+    {
+      __set_errno(EINVAL);
+    }
+
+  return res;
+}
+
+strong_alias (__libc_sched_getaffinity, __sched_getaffinity)
+weak_alias (__sched_getaffinity, sched_getaffinity)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sched_getp.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sched.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <sys/rtprio.h>
+
+/* Retrieve scheduling parameters for a particular process.  */
+int
+__sched_getparam (pid_t pid, struct sched_param *param)
+{
+  /* kFreeBSD return bogus values for SYS_sched_param (see PR kern/76485);
+     fortunately the same information can be retrieved through the rtprio()
+     system call.  */
+  struct rtprio rtp;
+
+  if (__rtprio (RTP_LOOKUP, pid, &rtp) >= 0)
+    {
+      if (RTP_PRIO_IS_REALTIME (rtp.type))
+        param->sched_priority = RTP_PRIO_MAX - rtp.prio;
+      else
+        param->sched_priority = 0;
+    }
+
+  return 0;
+}
+
+weak_alias (__sched_getparam, sched_getparam)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sched_setaffinity.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <sched.h>
+#include <string.h>
+#include <sysdep.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include "cpuset-kern.h"
+
+int
+__libc_sched_setaffinity (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
+{
+  int res;
+  int64_t id;
+
+  if (pid < 0)
+    {
+      __set_errno(ESRCH);
+      return -1;
+    }
+
+  if (pid == 0)		// user   level "self"
+      id = -1;		// kernel level "self"
+  else
+      id = pid;
+
+  res = INLINE_SYSCALL (cpuset_setaffinity, 5, CPU_LEVEL_WHICH,
+			CPU_WHICH_PID, id, cpusetsize, cpuset);
+
+  if (errno == ERANGE || errno == EDEADLK)
+    {
+      __set_errno(EINVAL);
+    }
+
+  return res;
+}
+
+strong_alias (__libc_sched_setaffinity, __sched_setaffinity)
+weak_alias (__sched_setaffinity, sched_setaffinity)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/seekdir.c
@@ -0,0 +1,2 @@
+/* Avoid <sysdeps/unix/bsd/telldir.c>, which doesn't pass the testsuite.  */
+#include <sysdeps/posix/seekdir.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/semctl.c
@@ -0,0 +1,175 @@
+/* Copyright (C) 2004, 2010 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Robert Millan
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*-
+ * Copyright (c) 2002 Doug Rabson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <sysdep.h>
+#include <sys/sem.h>
+#include <stdarg.h> /* va_list */
+#include <stdlib.h> /* NULL */
+#include <unistd.h>
+#include <ipc_priv.h>
+
+#include <sysdep.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <bits/wordsize.h>
+#include <shlib-compat.h>
+
+
+/* union semun from FreeBSD <sys/sem.h> */
+/*
+ * semctl's arg parameter structure
+ */
+union semun
+{
+  int val;			/* value for SETVAL */
+  struct semid_ds *buf;		/* buffer for IPC_STAT & IPC_SET */
+  struct semid_ds_old *oldbuf;	/* buffer for IPC_STAT & IPC_SET */
+  unsigned short *array;	/* array for GETALL & SETALL */
+};
+
+extern int __syscall_semctl (int semid, int semnum,
+                             int cmd, union semun *arg);
+libc_hidden_proto (__syscall_semctl)
+
+int
+__new_semctl (int semid, int semnum, int cmd, ...)
+{
+    va_list ap;
+    union semun semun;
+    union semun *semun_ptr;
+
+    va_start (ap, cmd);
+    switch (cmd) 
+    {
+        case SEM_STAT:
+        case IPC_SET: 
+        case IPC_STAT: 
+        case GETALL:
+        case SETVAL:  
+        case SETALL:
+            semun = va_arg (ap, union semun);
+            semun_ptr = &semun;
+        break;
+        default:                                                  
+            semun_ptr = NULL;
+    }
+    va_end (ap);
+    return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd, semun_ptr);
+}
+versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_18);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_18)
+
+struct semid_ds_old
+{
+  struct ipc_perm_old sem_perm;		/* operation permission struct */
+  void *__sem_base;
+  unsigned short int sem_nsems;		/* number of semaphores in set */
+  __time_t sem_otime;			/* last semop() time */
+  long __unused1;
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  long __unused2;
+  long __unused3[4];
+};
+
+int
+attribute_compat_text_section
+__old_semctl (int semid, int semnum, int cmd, ...)
+{
+    struct semid_ds newbuf;
+    struct semid_ds_old *buf;
+    int rv;
+
+    va_list ap;
+    union semun semun;
+    union semun *semun_ptr;
+
+    va_start (ap, cmd);
+    switch (cmd) 
+    {
+        case SEM_STAT:
+        case IPC_SET: 
+        case IPC_STAT:
+            semun = va_arg (ap, union semun);
+            buf = semun.oldbuf;
+            semun.buf = &newbuf;
+	    semun_ptr = &semun;
+	break;
+        case GETALL:
+        case SETVAL:  
+        case SETALL:
+            semun = va_arg (ap, union semun);
+	    semun_ptr = &semun;
+        break;
+        default:                                                  
+            semun_ptr = NULL;
+    }
+    va_end (ap);
+  
+    if (cmd == IPC_SET)
+    {
+        ipc_perm_old2new(&(buf->sem_perm), &(newbuf.sem_perm));
+        newbuf.__sem_base = buf->__sem_base;
+        newbuf.sem_nsems  = buf->sem_nsems;
+        newbuf.sem_otime  = buf->sem_otime;
+        newbuf.sem_ctime  = buf->sem_ctime;
+    }
+    
+    rv = INLINE_SYSCALL (semctl, 4, semid, semnum, cmd, semun_ptr);
+    
+    if ((rv != -1) && ((cmd == IPC_STAT) || (cmd == SEM_STAT)))
+    {
+        ipc_perm_new2old(&(newbuf.sem_perm), &(buf->sem_perm));
+        buf->__sem_base = newbuf.__sem_base;
+        buf->sem_nsems  = newbuf.sem_nsems;
+        buf->sem_otime  = newbuf.sem_otime;
+        buf->sem_ctime  = newbuf.sem_ctime;
+    }
+        
+    return rv;
+}
+compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/send.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/socket.h>
+#include <sysdep.h>
+#include <sysdep-cancel.h>
+
+extern ssize_t __syscall_sendto (int fd, __const __ptr_t buf,
+		                 size_t n, int flags,
+				 __CONST_SOCKADDR_ARG addr,
+				 socklen_t addrlen);
+libc_hidden_proto (__syscall_sendto)
+
+/* Send N bytes of BUF to socket FD.
+   Return the number of bytes sent or -1.  */
+
+ssize_t
+__libc_send (int fd, const void *buf, size_t n, int flags)
+{
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (sendto, 6, fd, buf, n, flags, NULL, 0);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+  int result = INLINE_SYSCALL (sendto, 6, fd, buf, n, flags, NULL, 0);
+  LIBC_CANCEL_RESET (oldtype);
+  return result;
+}
+
+weak_alias (__libc_send, __send)
+libc_hidden_weak (__send)
+
+weak_alias (__send, send)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sendto.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2005.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/socket.h>
+#include <sysdep.h>
+#include <sysdep-cancel.h>
+
+/* According to POSIX.1-2004 the len argument specifies the length of
+   the sockaddr structure pointed to by the addrarg argument. However
+   the FreeBSD kernel waits the actual length of the address stored
+   there. The code below emulate this behaviour.  */
+
+extern int __libc_sa_len (sa_family_t __af);
+libc_hidden_proto (__libc_sa_len)
+
+extern ssize_t __syscall_sendto (int fd, __const void * buf,
+		                 size_t n, int flags,
+				 __CONST_SOCKADDR_ARG addr,
+				 socklen_t addrlen);
+libc_hidden_proto (__syscall_sendto)
+
+/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
+ *    ADDR_LEN bytes long).  Returns the number sent, or -1 for errors.  */
+
+
+ssize_t
+__libc_sendto (int fd, __const void * buf, size_t n, int flags,
+	       __CONST_SOCKADDR_ARG addr, socklen_t addrlen)
+{
+  socklen_t new_addrlen;
+
+  if (addr.__sockaddr__)
+    {
+      new_addrlen = __libc_sa_len ((addr.__sockaddr__)->sa_family);
+
+      /* Only allow a smaller size, otherwise it could lead to
+        stack corruption */
+      if ((new_addrlen != 0) && (new_addrlen < addrlen))
+	addrlen = new_addrlen;
+    }
+
+  /* We pass 6 arguments.  */
+  if (SINGLE_THREAD_P)
+    return INLINE_SYSCALL (sendto, 6, fd, buf, n, flags, addr.__sockaddr__, addrlen);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+  int result = INLINE_SYSCALL (sendto, 6, fd, buf, n, flags, addr.__sockaddr__, addrlen);
+  LIBC_CANCEL_RESET (oldtype);
+  return result;
+}
+
+weak_alias (__libc_sendto, __sendto)
+weak_alias (__libc_sendto, sendto)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/setdomain.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sys/sysctl.h>
+
+/* Set the name of the current domain to NAME, which is LEN bytes long
+   (excluding a possible trailing NUL byte).  This call is restricted to
+   the super-user.  */
+
+int
+setdomainname (const char *name, size_t len)
+{
+  /* Set the "kern.domainname" sysctl value.  */
+  int request[2] = { CTL_KERN, KERN_NISDOMAINNAME };
+
+  if (__sysctl (request, 2, NULL, NULL, (void *) name, len) < 0)
+    return -1;
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sethostid.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sys/sysctl.h>
+
+/* Set the current machine's Internet number to ID.
+   This call is restricted to the super-user.  */
+
+int
+sethostid (long int id)
+{
+  /* Set the "kern.hostid" sysctl value.  */
+  int value = id;
+  int request[2] = { CTL_KERN, KERN_HOSTID };
+
+  if (__sysctl (request, 2, NULL, NULL, &value, sizeof (value)) < 0)
+    return -1;
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sethostname.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sys/sysctl.h>
+
+/* Set the name of the current host to NAME, which is LEN bytes long
+   (excluding a possible trailing NUL byte).  This call is restricted to
+   the super-user.  */
+
+int
+sethostname (const char *name, size_t len)
+{
+  /* Set the "kern.hostname" sysctl value.  */
+  int request[2] = { CTL_KERN, KERN_HOSTNAME };
+
+  if (__sysctl (request, 2, NULL, NULL, (void *) name, len) < 0)
+    return -1;
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/setlogin.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <unistd.h>
+#include <sysdep.h>
+
+/* Defined in getlogin_r.c.  */
+extern char *__getlogin_cache;
+
+extern int __syscall_setlogin (const char *__name);
+
+int
+setlogin (const char *name)
+{
+  /* FIXME: Not multithread-safe.  */
+  __getlogin_cache = NULL;
+  return INLINE_SYSCALL (setlogin, 1, name);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/setrlimit64.c
@@ -0,0 +1 @@
+/* 'setrlimit64' is the same as 'setrlimit', because __rlim64_t == __rlim_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/shlib-versions
@@ -0,0 +1,5 @@
+# DEFAULT			Earliest symbol set
+# ---------------		------------------------------
+DEFAULT				GLIBC_2.3
+libc=0.1       
+libm=1
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/shm-directory.c
@@ -0,0 +1,102 @@
+/* Determine directory for shm/sem files.  GNU/kFreeBSD version.
+   Copyright (C) 2000-2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "shm-directory.h"
+
+#include <errno.h>
+#include <mntent.h>
+#include <paths.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/statfs.h>
+#include <libc-lock.h>
+
+/* Mount point of the shared memory filesystem.  */
+static struct
+{
+  char *dir;
+  size_t dirlen;
+} mountpoint;
+
+/* This is the default directory.  */
+static const char defaultdir[] = "/dev/shm/";
+
+/* This is the alternate debian directory.  */
+static const char alternatedir[] = "/run/shm";
+
+/* Protect the `mountpoint' variable above.  */
+__libc_once_define (static, once);
+
+
+/* Determine where the shmfs is mounted (if at all).  */
+static void
+where_is_shmfs (void)
+{
+  struct statfs f;
+
+  /* The canonical place is /dev/shm.  This is at least what the
+     documentation tells everybody to do.  */
+  if (__statfs (defaultdir, &f) == 0)
+    {
+      /* It is in the normal place.  */
+      mountpoint.dir = (char *) defaultdir;
+      mountpoint.dirlen = sizeof (defaultdir) - 1;
+
+      return;
+    }
+
+  /* The alternate place is /run/shm.  */
+  if (__statfs (alternatedir, &f) == 0)
+    {
+      /* It is in the normal place.  */
+      mountpoint.dir = (char *) alternatedir;
+      mountpoint.dirlen = sizeof (alternatedir) - 1;
+
+      return;
+    }
+}
+
+
+const char *
+__shm_directory (size_t *len)
+{
+  /* Determine where the shmfs is mounted.  */
+  __libc_once (once, where_is_shmfs);
+
+  /* If we don't know the mount points there is nothing we can do.  Ever.  */
+  if (__glibc_unlikely (mountpoint.dir == NULL))
+    {
+      __set_errno (ENOSYS);
+      return NULL;
+    }
+
+  *len = mountpoint.dirlen;
+  return mountpoint.dir;
+}
+#if IS_IN (libpthread)
+hidden_def (__shm_directory)
+#endif
+
+
+/* Make sure the table is freed if we want to free everything before
+   exiting.  */
+libc_freeres_fn (freeit)
+{
+  if (mountpoint.dir != defaultdir)
+    free (mountpoint.dir);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/shm_open.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <sysdep.h>
+
+extern int __syscall_shm_open (const char *name, int flag, mode_t mode);
+libc_hidden_proto (__syscall_shm_open)
+
+int
+shm_open (const char *name, int flag, mode_t mode)
+{
+  /*
+   * O_CLOEXEC never has any effect on shm_open(). However, old kernel
+   * versions (prior to rev 261138 in HEAD) return EINVAL when this
+   * (otherwise harmless) flag is used.
+   */
+  flag &= ~O_CLOEXEC;
+
+  return INLINE_SYSCALL (shm_open, 3, name, flag, mode);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/shmctl.c
@@ -0,0 +1,91 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sys/shm.h>
+#include <ipc_priv.h>
+
+#include <sysdep.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <bits/wordsize.h>
+#include <shlib-compat.h>
+
+#include <kernel-features.h>
+
+/* Provide operations to control over shared memory segments.  */
+extern int __syscall_shmctl (int shmid, int cmd, struct shmid_ds *buf);
+libc_hidden_proto (__syscall_shmctl)
+
+
+int
+__new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
+{
+  return INLINE_SYSCALL (shmctl, 3, shmid, cmd, buf);
+}
+versioned_symbol (libc, __new_shmctl, shmctl, GLIBC_2_18);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_18)
+struct shmid_ds_old {
+        struct ipc_perm_old shm_perm;   /* operation permission structure */
+        int             shm_segsz;      /* size of segment in bytes */
+        pid_t           shm_lpid;   /* process ID of last shared memory op */
+        pid_t           shm_cpid;       /* process ID of creator */
+        unsigned short  shm_nattch;     /* number of current attaches */
+        time_t          shm_atime;      /* time of last shmat() */
+        time_t          shm_dtime;      /* time of last shmdt() */
+        time_t          shm_ctime;      /* time of last change by shmctl() */
+        void           *shm_internal;   /* sysv stupidity */
+};
+
+int
+attribute_compat_text_section
+__old_shmctl (int shmid, int cmd, struct shmid_ds_old *buf)
+{
+    struct shmid_ds newbuf;
+    int rv;
+    
+    if (cmd == IPC_SET)
+    {
+        ipc_perm_old2new(&(buf->shm_perm), &(newbuf.shm_perm));
+        newbuf.shm_segsz = buf->shm_segsz;
+        newbuf.shm_lpid  = buf->shm_lpid;
+        newbuf.shm_cpid  = buf->shm_cpid;
+        newbuf.shm_nattch= buf->shm_nattch;
+        newbuf.shm_atime = buf->shm_atime;
+        newbuf.shm_dtime = buf->shm_dtime;
+        newbuf.shm_ctime = buf->shm_ctime;
+    }
+    
+    rv = __new_shmctl (shmid, cmd, &newbuf);
+    
+    if ((rv != -1) && (cmd == IPC_STAT))
+    {
+        ipc_perm_new2old(&(newbuf.shm_perm), &(buf->shm_perm));
+        buf->shm_segsz = newbuf.shm_segsz;
+        buf->shm_lpid  = newbuf.shm_lpid;
+        buf->shm_cpid  = newbuf.shm_cpid;
+        buf->shm_nattch= newbuf.shm_nattch;
+        buf->shm_atime = newbuf.shm_atime;
+        buf->shm_dtime = newbuf.shm_dtime;
+        buf->shm_ctime = newbuf.shm_ctime;
+    }
+        
+    return rv;
+}
+compat_symbol (libc, __old_shmctl, shmctl, GLIBC_2_0);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sigaction.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1991,1995,1996,1997,2002,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <errno.h>
+#include <stddef.h>
+#include <signal.h>
+
+extern int __syscall_sigaction (int __sig,  const struct sigaction *__act, struct sigaction *__oact) __THROW;
+libc_hidden_proto (__syscall_sigaction)
+
+int
+__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
+{
+  if (sig <= 0 || sig >= NSIG)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  return INLINE_SYSCALL (sigaction, 3, sig, act, oact);
+}
+libc_hidden_def (__libc_sigaction)
+
+#ifdef WRAPPER_INCLUDE
+# include WRAPPER_INCLUDE
+#endif
+
+#ifndef LIBC_SIGACTION
+weak_alias (__libc_sigaction, __sigaction)
+libc_hidden_weak (__sigaction)
+weak_alias (__libc_sigaction, sigaction)
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sigreturn.c
@@ -0,0 +1,3 @@
+/* The sigreturn syscall cannot be explicitly called on FreeBSD, only
+   implicitly by returning from a signal handler.  */
+#include <signal/sigreturn.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sigset-cvt-mask.h
@@ -0,0 +1,36 @@
+/* Convert between lowlevel sigmask and libc representation of sigset_t.
+   FreeBSD version.
+   Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+static inline int __attribute__ ((unused))
+sigset_set_old_mask (sigset_t *set, int mask)
+{
+  set->__sigbits[0] = (unsigned int) mask;
+  set->__sigbits[1] = 0;
+  set->__sigbits[2] = 0;
+  set->__sigbits[3] = 0;
+
+  return 0;
+}
+
+static inline int __attribute__ ((unused))
+sigset_get_old_mask (const sigset_t *set)
+{
+  return (unsigned int) set->__sigbits[0];
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sigstack.c
@@ -0,0 +1,3 @@
+/* We can reuse the Linux implementation with some tricks.  */
+#define __NR_sigaltstack 1
+#include <sysdeps/unix/sysv/linux/sigstack.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sleep.c
@@ -0,0 +1,49 @@
+/* Implementation of the POSIX sleep function using nanosleep.
+   Copyright (C) 1996-1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <time.h>
+
+/* The default implementation of sleep() in sysdeps/posix/sleep.c, based on
+   SIGALRM, does not mix well with threads.  Therefore we use the nanosleep()
+   system call.  */
+unsigned int
+__sleep (unsigned int seconds)
+{
+  struct timespec ts = { tv_sec: seconds, tv_nsec: 0 };
+  int ret;
+
+  /* This is not necessary but some buggy programs depend on this.  */
+  if (__builtin_expect (seconds == 0, 0))
+    {
+#ifdef CANCELLATION_P
+      CANCELLATION_P (THREAD_SELF);
+#endif
+      return 0;
+    }
+                        
+  ret = __nanosleep (&ts, &ts);
+
+  if (ret == 0)
+    return 0;
+
+  /* Round remaining time.  */
+  return (unsigned int) ts.tv_sec + (ts.tv_nsec >= 500000000L);
+}
+
+weak_alias (__sleep, sleep)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/socket/sys/un.h
@@ -0,0 +1,2 @@
+/* kludge to satisfy $SRC/include/sys/un.h */
+#include <kfreebsd/sys/un.h>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/stat16conv.c
@@ -0,0 +1,84 @@
+/* Convert between different 'struct stat' formats.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <string.h>
+#include <sys/mount.h>
+#include <bits/stat16.h>
+
+extern int __syscall_fhstat (const fhandle_t *fhp, struct stat16 *buf);
+extern int __syscall_fstat (int, struct stat16 *);
+extern int __syscall_lstat (const char *, struct stat16 *);
+extern int __syscall_stat (const char *, struct stat16 *);
+libc_hidden_proto (__syscall_fhstat)
+libc_hidden_proto (__syscall_fstat)
+libc_hidden_proto (__syscall_lstat)
+libc_hidden_proto (__syscall_stat)
+
+/* Convert a 'struct stat16' to 'struct stat'.  */
+static inline void
+stat16_to_stat (const struct stat16 *p16, struct stat *q)
+{
+  q->st_dev = p16->st_dev;
+  q->st_ino = p16->st_ino;
+  q->st_mode = p16->st_mode;
+  q->__pad_mode = 0;
+  q->st_nlink = p16->st_nlink;
+  q->__pad_nlink = 0;
+  q->st_uid = p16->st_uid;
+  q->st_gid = p16->st_gid;
+  q->st_rdev = p16->st_rdev;
+  q->st_atim = p16->st_atimespec;
+  q->st_mtim = p16->st_mtimespec;
+  q->st_ctim = p16->st_ctimespec;
+  q->st_size = p16->st_size;
+  q->st_blocks = p16->st_blocks;
+  q->st_blksize = p16->st_blksize;
+  q->st_flags = p16->st_flags;
+  q->st_gen = p16->st_gen;
+#if 0
+  memcpy (q->__unused1, p16->__unused2, sizeof (p16->__unused2));
+#endif
+}
+
+/* Convert a 'struct stat16' to 'struct stat64'.  */
+static inline void
+stat16_to_stat64 (const struct stat16 *p16, struct stat64 *q)
+{
+  q->st_dev = p16->st_dev;
+  q->st_ino = p16->st_ino;
+  q->st_mode = p16->st_mode;
+  q->__pad_mode = 0;
+  q->st_nlink = p16->st_nlink;
+  q->__pad_nlink = 0;
+  q->st_uid = p16->st_uid;
+  q->st_gid = p16->st_gid;
+  q->st_rdev = p16->st_rdev;
+  q->st_atim = p16->st_atimespec;
+  q->st_mtim = p16->st_mtimespec;
+  q->st_ctim = p16->st_ctimespec;
+  q->st_size = p16->st_size;
+  q->st_blocks = p16->st_blocks;
+  q->st_blksize = p16->st_blksize;
+  q->st_flags = p16->st_flags;
+  q->st_gen = p16->st_gen;
+#if 0
+  memcpy (q->__unused1, p16->__unused2, sizeof (p16->__unused2));
+#endif
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/statfs.c
@@ -0,0 +1,40 @@
+/* Return information about the filesystem on which FILE resides.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/statfs.h>
+
+#include "statfsconv.c"
+
+/* Return information about the filesystem on which FILE resides.  */
+int
+__statfs (const char *file, struct statfs *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_statfs (file, &kbuf) < 0)
+    return -1;
+
+  /* Convert a 'struct statfs' to 'struct statvfs'.  */
+  statfs5_to_statfs (&kbuf, buf);
+
+  return 0;
+}
+libc_hidden_def (__statfs)
+weak_alias (__statfs, statfs)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/statfs64.c
@@ -0,0 +1,37 @@
+/* Return information about the filesystem on which FILE resides.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/statfs.h>
+
+#include "statfsconv.c"
+
+/* Return information about the filesystem on which FILE resides.  */
+int
+statfs64 (const char *file, struct statfs64 *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_statfs (file, &kbuf) < 0)
+    return -1;
+
+  statfs5_to_statfs64 (&kbuf, buf);
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/statfsconv.c
@@ -0,0 +1,203 @@
+/* Convert between different 'struct statfs' and 'struct statvfs' formats.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+
+#include <stdint.h>
+#include <string.h>
+#include <sys/mount.h>
+#include <sys/syslimits.h>
+#include <sys/statvfs.h>
+#include <sys/statfs.h>
+
+/*
+ * filesystem statistics
+ */
+
+#define MFSNAMELEN	16		/* length of type name including null */
+#define MNAMELEN	88		/* size of on/from name bufs */
+
+struct statfs_fbsd5 {
+	uint32_t f_version;		/* structure version number */
+	uint32_t f_type;		/* type of filesystem */
+	uint64_t f_flags;		/* copy of mount exported flags */
+	uint64_t f_bsize;		/* filesystem fragment size */
+	uint64_t f_iosize;		/* optimal transfer block size */
+	uint64_t f_blocks;		/* total data blocks in filesystem */
+	uint64_t f_bfree;		/* free blocks in filesystem */
+	int64_t	 f_bavail;		/* free blocks avail to non-superuser */
+	uint64_t f_files;		/* total file nodes in filesystem */
+	int64_t	 f_ffree;		/* free nodes avail to non-superuser */
+	uint64_t f_syncwrites;		/* count of sync writes since mount */
+	uint64_t f_asyncwrites;		/* count of async writes since mount */
+	uint64_t f_syncreads;		/* count of sync reads since mount */
+	uint64_t f_asyncreads;		/* count of async reads since mount */
+	uint64_t f_spare[10];		/* unused spare */
+	uint32_t f_namemax;		/* maximum filename length */
+	__uid_t	 f_owner;		/* user that mounted the filesystem */
+	__fsid_t f_fsid;		/* filesystem id */
+	char	 f_charspare[80];	   /* spare string space */
+	char	 f_fstypename[MFSNAMELEN]; /* filesystem type name */
+	char	 f_mntfromname[MNAMELEN];  /* mounted filesystem */
+	char	 f_mntonname[MNAMELEN];	   /* directory on which mounted */
+};
+
+extern int __syscall_getfsstat(struct statfs_fbsd5 *buf, long bufsize, int flags);
+extern int __syscall_statfs(const char *path, struct statfs_fbsd5 *buf);
+extern int __syscall_fstatfs(int fd, struct statfs_fbsd5 *buf);
+extern int __syscall_fhstatfs(const struct fhandle *u_fhp, struct statfs_fbsd5 *buf);
+
+
+/*
+ * Convert a FreeBSD 5.x format statfs structure to an glibc format statfs structure.
+ */
+
+static inline void
+statfs5_to_statfs(const struct statfs_fbsd5 *pk, struct statfs *p32)
+{
+  memset(p32, 0, sizeof(*p32));
+
+  p32->f_version	= pk->f_version;
+  p32->f_bsize		= MIN(pk->f_bsize,  ULONG_MAX);
+  p32->f_iosize		= MIN(pk->f_iosize, ULONG_MAX);
+
+  p32->f_blocks		= MIN(pk->f_blocks, ULONG_MAX);
+  p32->f_bfree		= MIN(pk->f_bfree,  ULONG_MAX);
+  p32->f_bavail		= MIN(pk->f_bavail, ULONG_MAX);
+  p32->f_files		= MIN(pk->f_files,  ULONG_MAX);
+  p32->f_ffree		= MIN(pk->f_ffree,  ULONG_MAX);
+
+  p32->f_fsid		= pk->f_fsid;
+  p32->f_owner		= pk->f_owner;
+  p32->f_type		= pk->f_type;
+  p32->f_flags		= pk->f_flags;
+
+  p32->f_syncwrites	= MIN(pk->f_syncwrites,	 ULONG_MAX);
+  p32->f_asyncwrites	= MIN(pk->f_asyncwrites, ULONG_MAX);
+  p32->f_syncreads	= MIN(pk->f_syncreads,	 ULONG_MAX);
+  p32->f_asyncreads	= MIN(pk->f_asyncreads,	 ULONG_MAX);
+
+  p32->f_namemax	= MIN(pk->f_namemax, USHRT_MAX);
+
+  memcpy(p32->f_fstypename, pk->f_fstypename, sizeof (p32->f_fstypename));
+  memcpy(p32->f_mntonname,  pk->f_mntonname,  sizeof (p32->f_mntonname));
+  memcpy(p32->f_mntfromname,pk->f_mntfromname,sizeof (p32->f_mntfromname));
+}
+
+
+/*
+ * Convert a FreeBSD 5.x format statfs structure to an glibc format statfs64 structure.
+ */
+
+static inline void
+statfs5_to_statfs64(const struct statfs_fbsd5 *pk, struct statfs64 *p64)
+{
+  memset(p64, 0, sizeof(*p64));
+
+  p64->f_version	= pk->f_version;
+  p64->f_bsize		= MIN(pk->f_bsize,  ULONG_MAX);
+  p64->f_iosize		= MIN(pk->f_iosize, ULONG_MAX);
+
+  p64->f_blocks		= pk->f_blocks;
+  p64->f_bfree		= pk->f_bfree;
+  p64->f_bavail		= pk->f_bavail;
+  p64->f_files		= pk->f_files;
+  p64->f_ffree		= pk->f_ffree;
+
+  p64->f_fsid		= pk->f_fsid;
+  p64->f_owner		= pk->f_owner;
+  p64->f_type		= pk->f_type;
+  p64->f_flags		= pk->f_flags;
+
+  p64->f_syncwrites	= MIN(pk->f_syncwrites,	 ULONG_MAX);
+  p64->f_asyncwrites	= MIN(pk->f_asyncwrites, ULONG_MAX);
+  p64->f_syncreads	= MIN(pk->f_syncreads,	 ULONG_MAX);
+  p64->f_asyncreads	= MIN(pk->f_asyncreads,	 ULONG_MAX);
+
+  p64->f_namemax	= MIN(pk->f_namemax, USHRT_MAX);
+
+  memcpy(p64->f_fstypename, pk->f_fstypename, sizeof (p64->f_fstypename));
+  memcpy(p64->f_mntonname,  pk->f_mntonname,  sizeof (p64->f_mntonname));
+  memcpy(p64->f_mntfromname,pk->f_mntfromname,sizeof (p64->f_mntfromname));
+}
+
+
+/*
+ * Convert a FreeBSD 5.x format statfs structure to an glibc format statvfs structure.
+ */
+
+static inline void
+statfs5_to_statvfs (const struct statfs_fbsd5 *pk, struct statvfs *p32)
+{
+  /* FIXME: What is the difference between f_bsize and f_frsize ? */
+  p32->f_bsize		= MIN(pk->f_bsize,  ULONG_MAX);
+  p32->f_frsize		= MIN(pk->f_bsize,  ULONG_MAX);
+
+  p32->f_blocks		= MIN(pk->f_blocks, ULONG_MAX);
+  p32->f_bfree		= MIN(pk->f_bfree,  ULONG_MAX);
+  p32->f_bavail		= MIN(pk->f_bavail, ULONG_MAX);
+  p32->f_files		= MIN(pk->f_files,  ULONG_MAX);
+  p32->f_ffree		= MIN(pk->f_ffree,  ULONG_MAX);
+  p32->f_favail		= MIN(pk->f_ffree,  ULONG_MAX); /* Hmm.	 May be filesystem dependent.  */
+
+  memcpy(&(p32->f_fsid), &(pk->f_fsid), sizeof(__fsid_t));
+
+  p32->f_flag		=
+      (pk->f_flags & MNT_RDONLY ? ST_RDONLY : 0)
+    | (pk->f_flags & MNT_NOSUID ? ST_NOSUID : 0)
+    | (pk->f_flags & MNT_NOEXEC ? ST_NOEXEC : 0)
+    | (pk->f_flags & MNT_SYNCHRONOUS ? ST_SYNCHRONOUS : 0)
+    | (pk->f_flags & MNT_NOATIME ? ST_NOATIME : 0);
+  p32->f_namemax	= pk->f_namemax;
+
+  memset (p32->f_spare, '\0', sizeof (p32->f_spare));
+}
+
+
+/*
+ * Convert a FreeBSD 5.x format statfs structure to an glibc format statvfs64 structure.
+ */
+
+static inline void
+statfs5_to_statvfs64 (const struct statfs_fbsd5 *pk, struct statvfs64 *p64)
+{
+  /* FIXME: What is the difference between f_bsize and f_frsize ? */
+  p64->f_bsize		= MIN(pk->f_bsize,  ULONG_MAX);
+  p64->f_frsize		= MIN(pk->f_bsize,  ULONG_MAX);
+
+  p64->f_blocks		= pk->f_blocks;
+  p64->f_bfree		= pk->f_bfree;
+  p64->f_bavail		= pk->f_bavail;
+  p64->f_files		= pk->f_files;
+  p64->f_ffree		= pk->f_ffree;
+  p64->f_favail		= pk->f_ffree; /* Hmm.	May be filesystem dependent.  */
+
+  memcpy(&(p64->f_fsid), &(pk->f_fsid), sizeof(__fsid_t));
+
+  p64->f_flag		=
+      (pk->f_flags & MNT_RDONLY ? ST_RDONLY : 0)
+    | (pk->f_flags & MNT_NOSUID ? ST_NOSUID : 0)
+    | (pk->f_flags & MNT_NOEXEC ? ST_NOEXEC : 0)
+    | (pk->f_flags & MNT_SYNCHRONOUS ? ST_SYNCHRONOUS : 0)
+    | (pk->f_flags & MNT_NOATIME ? ST_NOATIME : 0);
+  p64->f_namemax	= pk->f_namemax;
+
+  memset (p64->f_spare, '\0', sizeof (p64->f_spare));
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/statvfs.c
@@ -0,0 +1,40 @@
+/* Return information about the filesystem on which FILE resides.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/statvfs.h>
+#include <sys/statfs.h>
+
+#include "statfsconv.c"
+
+/* Return information about the filesystem on which FILE resides.  */
+int
+statvfs (const char *file, struct statvfs *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_statfs (file, &kbuf) < 0)
+    return -1;
+
+  /* Convert a 'struct statfs' to 'struct statvfs'.  */
+  statfs5_to_statvfs (&kbuf, buf);
+
+  return 0;
+}
+libc_hidden_weak (statvfs)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/statvfs64.c
@@ -0,0 +1,41 @@
+/* Return information about the filesystem on which FILE resides.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/statvfs.h>
+#include <sys/statfs.h>
+
+#include "statfsconv.c"
+
+/* Return information about the filesystem on which FILE resides.  */
+int
+__statvfs64 (const char *file, struct statvfs64 *buf)
+{
+  struct statfs_fbsd5 kbuf;
+
+  if (__syscall_statfs (file, &kbuf) < 0)
+    return -1;
+
+  /* Convert a 'struct statfs' to 'struct statvfs64'.  */
+  statfs5_to_statvfs64 (&kbuf, buf);
+
+  return 0;
+}
+
+weak_alias (__statvfs64, statvfs64)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/stty.c
@@ -0,0 +1,2 @@
+/* use stub only variant */
+#include <misc/stty.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/kd.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_KD_H
+#define _SYS_KD_H	1
+
+#include <sys/consio.h>
+#include <sys/kbio.h>
+
+#endif	/* sys/kd.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/mount.h
@@ -0,0 +1,521 @@
+/* Header file for handling mounted filesystems.  FreeBSD version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_MOUNT_H
+#define _SYS_MOUNT_H	1
+
+#include <features.h>
+
+/* Retrieving the list of mounted filesystems.  */
+
+#include <sys/stat.h>
+#include <sys/statfs.h>
+#include <sys/ucred.h>
+#include <sys/queue.h>
+
+/* For getvfsbyname.  */
+#include <stddef.h>
+#include <sys/mount.h>
+#include <sys/sysctl.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * File identifier.
+ * These are unique per filesystem on a single machine.
+ */
+#define	MAXFIDSZ	16
+
+struct fid {
+	__u_short	fid_len;		/* length of data in bytes */
+	__u_short	fid_reserved;		/* force longword alignment */
+	char		fid_data[MAXFIDSZ];	/* data (variable length) */
+};
+
+/*
+ * filesystem statistics
+ */
+#define	MFSNAMELEN	16		/* length of type name including null */
+#define	MNAMELEN	88		/* size of on/from name bufs */
+#define	STATFS_VERSION	0x20030518	/* current version number */
+
+
+/*
+ * User specifiable flags.
+ */
+#define	MNT_RDONLY	0x0000000000000001ULL /* read only filesystem */
+#define	MNT_SYNCHRONOUS	0x0000000000000002ULL /* fs written synchronously */
+#define	MNT_NOEXEC	0x0000000000000004ULL /* can't exec from filesystem */
+#define	MNT_NOSUID	0x0000000000000008ULL /* don't honor setuid fs bits */
+#define	MNT_NFS4ACLS	0x0000000000000010ULL /* enable NFS version 4 ACLs */
+#define	MNT_UNION	0x0000000000000020ULL /* union with underlying fs */
+#define	MNT_ASYNC	0x0000000000000040ULL /* fs written asynchronously */
+#define	MNT_SUIDDIR	0x0000000000100000ULL /* special SUID dir handling */
+#define	MNT_SOFTDEP	0x0000000000200000ULL /* using soft updates */
+#define	MNT_NOSYMFOLLOW	0x0000000000400000ULL /* do not follow symlinks */
+#define	MNT_GJOURNAL	0x0000000002000000ULL /* GEOM journal support enabled */
+#define	MNT_MULTILABEL	0x0000000004000000ULL /* MAC support for objects */
+#define	MNT_ACLS	0x0000000008000000ULL /* ACL support enabled */
+#define	MNT_NOATIME	0x0000000010000000ULL /* dont update file access time */
+#define	MNT_NOCLUSTERR	0x0000000040000000ULL /* disable cluster read */
+#define	MNT_NOCLUSTERW	0x0000000080000000ULL /* disable cluster write */
+#define	MNT_SUJ		0x0000000100000000ULL /* using journaled soft updates */
+
+/*
+ * NFS export related mount flags.
+ */
+#define	MNT_EXRDONLY	0x0000000000000080ULL	/* exported read only */
+#define	MNT_EXPORTED	0x0000000000000100ULL	/* filesystem is exported */
+#define	MNT_DEFEXPORTED	0x0000000000000200ULL	/* exported to the world */
+#define	MNT_EXPORTANON	0x0000000000000400ULL	/* anon uid mapping for all */
+#define	MNT_EXKERB	0x0000000000000800ULL	/* exported with Kerberos */
+#define	MNT_EXPUBLIC	0x0000000020000000ULL	/* public export (WebNFS) */
+
+/*
+ * Flags set by internal operations,
+ * but visible to the user.
+ * XXX some of these are not quite right.. (I've never seen the root flag set)
+ */
+#define	MNT_LOCAL	0x0000000000001000ULL /* filesystem is stored locally */
+#define	MNT_QUOTA	0x0000000000002000ULL /* quotas are enabled on fs */
+#define	MNT_ROOTFS	0x0000000000004000ULL /* identifies the root fs */
+#define	MNT_USER	0x0000000000008000ULL /* mounted by a user */
+#define	MNT_IGNORE	0x0000000000800000ULL /* do not show entry in df */
+
+/*
+ * Mask of flags that are visible to statfs().
+ * XXX I think that this could now become (~(MNT_CMDFLAGS))
+ * but the 'mount' program may need changing to handle this.
+ */
+#define	MNT_VISFLAGMASK	(MNT_RDONLY	| MNT_SYNCHRONOUS | MNT_NOEXEC	| \
+			MNT_NOSUID	| MNT_UNION	| MNT_SUJ	| \
+			MNT_ASYNC	| MNT_EXRDONLY	| MNT_EXPORTED	| \
+			MNT_DEFEXPORTED	| MNT_EXPORTANON| MNT_EXKERB	| \
+			MNT_LOCAL	| MNT_USER	| MNT_QUOTA	| \
+			MNT_ROOTFS	| MNT_NOATIME	| MNT_NOCLUSTERR| \
+			MNT_NOCLUSTERW	| MNT_SUIDDIR	| MNT_SOFTDEP	| \
+			MNT_IGNORE	| MNT_EXPUBLIC	| MNT_NOSYMFOLLOW | \
+			MNT_GJOURNAL	| MNT_MULTILABEL | MNT_ACLS	| \
+			MNT_NFS4ACLS)
+
+/* Mask of flags that can be updated. */
+#define	MNT_UPDATEMASK (MNT_NOSUID	| MNT_NOEXEC	| \
+			MNT_SYNCHRONOUS	| MNT_UNION	| MNT_ASYNC	| \
+			MNT_NOATIME | \
+			MNT_NOSYMFOLLOW	| MNT_IGNORE	| \
+			MNT_NOCLUSTERR	| MNT_NOCLUSTERW | MNT_SUIDDIR	| \
+			MNT_ACLS	| MNT_USER | MNT_NFS4ACLS)
+
+/*
+ * External filesystem command modifier flags.
+ * Unmount can use the MNT_FORCE flag.
+ * XXX These are not STATES and really should be somewhere else.
+ */
+#define	MNT_UPDATE	0x00010000	/* not a real mount, just an update */
+#define	MNT_DELEXPORT	0x00020000	/* delete export host lists */
+#define	MNT_RELOAD	0x00040000	/* reload filesystem data */
+#define	MNT_FORCE	0x00080000	/* force unmount or readonly change */
+#define	MNT_SNAPSHOT	0x01000000	/* snapshot the filesystem */
+#define	MNT_BYFSID	0x08000000	/* specify filesystem by ID. */
+#define MNT_CMDFLAGS   (MNT_UPDATE	| MNT_DELEXPORT	| MNT_RELOAD	| \
+			MNT_FORCE	| MNT_SNAPSHOT	| MNT_BYFSID)
+/*
+ * Internal filesystem control flags stored in mnt_kern_flag.
+ *
+ * MNTK_UNMOUNT locks the mount entry so that name lookup cannot proceed
+ * past the mount point.  This keeps the subtree stable during mounts
+ * and unmounts.
+ *
+ * MNTK_UNMOUNTF permits filesystems to detect a forced unmount while
+ * dounmount() is still waiting to lock the mountpoint. This allows
+ * the filesystem to cancel operations that might otherwise deadlock
+ * with the unmount attempt (used by NFS).
+ */
+#define MNTK_UNMOUNTF	0x00000001	/* forced unmount in progress */
+#define MNTK_ASYNC      0x00000002      /* filtered async flag */
+#define MNTK_SOFTDEP    0x00000004      /* async disabled by softdep */
+#define MNTK_NOINSMNTQ  0x00000008      /* insmntque is not allowed */
+#define MNTK_UNMOUNT	0x01000000	/* unmount in progress */
+#define	MNTK_MWAIT	0x02000000	/* waiting for unmount to finish */
+#define MNTK_WANTRDWR	0x04000000	/* upgrade to read/write requested */
+#define MNTK_SUSPEND2   0x04000000      /* block secondary writes */
+#define	MNTK_SUSPEND	0x08000000	/* request write suspension */
+#define	MNTK_SUSPENDED	0x10000000	/* write operations are suspended */
+#define MNTK_MPSAFE     0x20000000      /* Filesystem is MPSAFE. */
+#define MNTK_NOKNOTE    0x80000000      /* Don't send KNOTEs from VOP hooks */
+#define MNTK_LOOKUP_SHARED      0x40000000 /* FS supports shared lock lookups */
+
+/*
+ * Sysctl CTL_VFS definitions.
+ *
+ * Second level identifier specifies which filesystem. Second level
+ * identifier VFS_VFSCONF returns information about all filesystems.
+ * Second level identifier VFS_GENERIC is non-terminal.
+ */
+#define	VFS_VFSCONF		0	/* get configured filesystems */
+#define	VFS_GENERIC		0	/* generic filesystem information */
+/*
+ * Third level identifiers for VFS_GENERIC are given below; third
+ * level identifiers for specific filesystems are given in their
+ * mount specific header files.
+ */
+#define VFS_MAXTYPENUM	1	/* int: highest defined filesystem type */
+#define VFS_CONF	2	/* struct: vfsconf for filesystem given
+				   as next argument */
+
+/*
+ * Flags for various system call interfaces.
+ *
+ * waitfor flags to vfs_sync() and getfsstat()
+ */
+#define MNT_WAIT	1	/* synchronously wait for I/O to complete */
+#define MNT_NOWAIT	2	/* start all I/O, but do not wait for it */
+#define MNT_LAZY	3	/* push data not written by filesystem syncer */
+#define	MNT_SUSPEND	4	/* Suspend file system after sync */
+
+/*
+ * Generic file handle
+ */
+struct fhandle {
+	__fsid_t	fh_fsid;	/* Filesystem id of mount point */
+	struct		fid fh_fid;	/* Filesys specific id */
+};
+typedef struct fhandle	fhandle_t;
+
+/*
+ * Old export arguments without security flavor list
+ */
+struct oexport_args {
+	int	ex_flags;		/* export related flags */
+	uid_t	ex_root;		/* mapping for root uid */
+	struct	xucred ex_anon;		/* mapping for anonymous user */
+	struct	sockaddr *ex_addr;	/* net address to which exported */
+	__u_char ex_addrlen;		/* and the net address length */
+	struct	sockaddr *ex_mask;	/* mask of valid bits in saddr */
+	__u_char ex_masklen;		/* and the smask length */
+	char	*ex_indexfile;		/* index file for WebNFS URLs */
+};
+
+/*
+ * Export arguments for local filesystem mount calls.
+ */
+#define	MAXSECFLAVORS	5
+struct export_args {
+	int		ex_flags;		/* export related flags */
+	uid_t		ex_root;		/* mapping for root uid */
+	struct		xucred ex_anon;		/* mapping for anonymous user */
+	struct		sockaddr *ex_addr;	/* net address to which exported */
+	__u_char	ex_addrlen;		/* and the net address length */
+	struct		sockaddr *ex_mask;	/* mask of valid bits in saddr */
+	__u_char	ex_masklen;		/* and the smask length */
+	char		*ex_indexfile;		/* index file for WebNFS URLs */
+	int		ex_numsecflavors;	/* security flavor count */
+	int		ex_secflavors[MAXSECFLAVORS]; /* list of security flavors */
+};
+
+/*
+ * Structure holding information for a publicly exported filesystem
+ * (WebNFS). Currently the specs allow just for one such filesystem.
+ */
+struct nfs_public {
+	int		np_valid;	/* Do we hold valid information */
+	fhandle_t	np_handle;	/* Filehandle for pub fs (internal) */
+	struct mount	*np_mount;	/* Mountpoint of exported fs */
+	char		*np_index;	/* Index file */
+};
+
+/*
+ * Filesystem configuration information. One of these exists for each
+ * type of filesystem supported by the kernel. These are searched at
+ * mount time to identify the requested filesystem.
+ *
+ * XXX: Never change the first two arguments!
+ */
+struct vfsconf {
+	__u_int	vfc_version;		/* ABI version number */
+	char	vfc_name[MFSNAMELEN];	/* filesystem type name */
+	struct	vfsops *vfc_vfsops;	/* filesystem operations vector */
+	int	vfc_typenum;		/* historic filesystem type number */
+	int	vfc_refcount;		/* number mounted of this type */
+	int	vfc_flags;		/* permanent flags */
+	struct	vfsoptdecl *vfc_opts;	/* mount options */
+	TAILQ_ENTRY(vfsconf) vfc_list;	/* list of vfscons */
+};
+
+/* Userland version of the struct vfsconf. */
+struct xvfsconf {
+	struct	vfsops *vfc_vfsops;	/* filesystem operations vector */
+	char	vfc_name[MFSNAMELEN];	/* filesystem type name */
+	int	vfc_typenum;		/* historic filesystem type number */
+	int	vfc_refcount;		/* number mounted of this type */
+	int	vfc_flags;		/* permanent flags */
+	struct	vfsconf *vfc_next;	/* next in list */
+};
+
+#ifndef BURN_BRIDGES
+struct ovfsconf {
+	void	*vfc_vfsops;
+	char	vfc_name[32];
+	int	vfc_index;
+	int	vfc_refcount;
+	int	vfc_flags;
+};
+#endif
+
+/*
+ * NB: these flags refer to IMPLEMENTATION properties, not properties of
+ * any actual mounts; i.e., it does not make sense to change the flags.
+ */
+#define	VFCF_STATIC	0x00010000	/* statically compiled into kernel */
+#define	VFCF_NETWORK	0x00020000	/* may get data over the network */
+#define	VFCF_READONLY	0x00040000	/* writes are not implemented */
+#define VFCF_SYNTHETIC	0x00080000	/* data does not represent real files */
+#define	VFCF_LOOPBACK	0x00100000	/* aliases some other mounted FS */
+#define	VFCF_UNICODE	0x00200000	/* stores file names as Unicode*/
+#define VFCF_JAIL       0x00400000      /* can be mounted from within a jail */
+
+typedef u_int32_t fsctlop_t;
+
+struct vfsidctl {
+	int		vc_vers;	/* should be VFSIDCTL_VERS1 (below) */
+	__fsid_t	vc_fsid;	/* fsid to operate on. */
+	char		vc_fstypename[MFSNAMELEN];
+					/* type of fs 'nfs' or '*' */
+	fsctlop_t	vc_op;		/* operation VFS_CTL_* (below) */
+	void		*vc_ptr;	/* pointer to data structure. */
+	size_t		vc_len;		/* sizeof said structure. */
+	u_int32_t	vc_spare[12];	/* spare (must be zero). */
+};
+
+/* vfsidctl API version. */
+#define VFS_CTL_VERS1	0x01
+
+/*
+ * New style VFS sysctls, do not reuse/conflict with the namespace for
+ * private sysctls.
+ * All "global" sysctl ops have the 33rd bit set:
+ * 0x...1....
+ * Private sysctl ops should have the 33rd bit unset.
+ */
+#define VFS_CTL_QUERY	0x00010001	/* anything wrong? (vfsquery) */
+#define VFS_CTL_TIMEO	0x00010002	/* set timeout for vfs notification */
+#define VFS_CTL_NOLOCKS	0x00010003	/* disable file locking */
+
+struct vfsquery {
+	u_int32_t	vq_flags;
+	u_int32_t	vq_spare[31];
+};
+
+/* vfsquery flags */
+#define VQ_NOTRESP	0x0001	/* server down */
+#define VQ_NEEDAUTH	0x0002	/* server bad auth */
+#define VQ_LOWDISK	0x0004	/* we're low on space */
+#define VQ_MOUNT	0x0008	/* new filesystem arrived */
+#define VQ_UNMOUNT	0x0010	/* filesystem has left */
+#define VQ_DEAD		0x0020	/* filesystem is dead, needs force unmount */
+#define VQ_ASSIST	0x0040	/* filesystem needs assistance from external
+				   program */
+#define VQ_NOTRESPLOCK	0x0080	/* server lockd down */
+#define VQ_FLAG0100	0x0100	/* placeholder */
+#define VQ_FLAG0200	0x0200	/* placeholder */
+#define VQ_FLAG0400	0x0400	/* placeholder */
+#define VQ_FLAG0800	0x0800	/* placeholder */
+#define VQ_FLAG1000	0x1000	/* placeholder */
+#define VQ_FLAG2000	0x2000	/* placeholder */
+#define VQ_FLAG4000	0x4000	/* placeholder */
+#define VQ_FLAG8000	0x8000	/* placeholder */
+
+
+struct iovec;
+struct uio;
+
+__BEGIN_DECLS
+
+/* Mounting and unmounting filesystems.  */
+int	mount(const char *, const char *, int, void *);
+int	nmount(struct iovec *, unsigned int, int);
+int	unmount(const char *, int);
+
+/*
+ * Copyright (c) 1995
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Given a filesystem name, determine if it is resident in the kernel,
+ * and if it is resident, return its xvfsconf structure.
+ */
+static __inline int
+getvfsbyname(const char *fsname, struct xvfsconf *vfcp)
+{
+	struct xvfsconf *xvfsp;
+	size_t buflen;
+	int cnt, i;
+
+	if (sysctlbyname("vfs.conflist", NULL, &buflen, NULL, 0) < 0)
+		return (-1);
+	xvfsp = (struct xvfsconf *) malloc(buflen);
+	if (xvfsp == NULL)
+		return (-1);
+	if (sysctlbyname("vfs.conflist", xvfsp, &buflen, NULL, 0) < 0) {
+		free(xvfsp);
+		return (-1);
+	}
+	cnt = buflen / sizeof(struct xvfsconf);
+	for (i = 0; i < cnt; i++) {
+		if (strcmp(fsname, xvfsp[i].vfc_name) == 0) {
+			memcpy(vfcp, xvfsp + i, sizeof(struct xvfsconf));
+			free(xvfsp);
+			return (0);
+		}
+	}
+	free(xvfsp);
+	errno = ENOENT;
+	return (-1);
+}
+
+/* getfsstat() appears in BSD 4.4.  A variant of this API is found on OSF/1,
+   but on that system the user also needs to include <sys/fs_types.h>.  */
+
+#ifndef __USE_FILE_OFFSET64
+extern int getfsstat (struct statfs *__buf, long __bufsize,
+		      int __flags) __THROW;
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (getfsstat,
+		       (struct statfs *__buf, long __bufsize, int __flags),
+		       getfsstat64);
+# else
+#  define getfsstat getfsstat64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int getfsstat64 (struct statfs64 *__buf, long __bufsize,
+			int __flags) __THROW;
+#endif
+
+#ifdef _LIBC
+extern int __getfsstat (struct statfs *__buf, long __bufsize, int __flags);
+extern int __getfsstat64 (struct statfs64 *__buf, long __bufsize, int __flags);
+#endif
+
+/* getmntinfo() appears in BSD 4.4.  */
+
+#ifndef __USE_FILE_OFFSET64
+extern int getmntinfo (struct statfs **__mntbufp, int __flags) __THROW;
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (getmntinfo,
+		       (struct statfs **__mntbufp, int __flags),
+		       getmntinfo64);
+# else
+#  define getmntinfo getmntinfo64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int getmntinfo64 (struct statfs64 **__mntbufp, int __flags) __THROW;
+#endif
+
+#ifdef _LIBC
+extern int __getmntinfo (struct statfs **__mntbufp, int __flags);
+#endif
+
+__END_DECLS
+
+
+/* Opening files on specified mounted filesystems.
+   These system calls are reserved to the superuser, for security reasons.  */
+
+__BEGIN_DECLS
+
+/* Return in *FHP the file handle corresponding to the file or directory
+   PATH.  */
+extern int getfh (__const char *__path, fhandle_t *__fhp) __THROW;
+
+/* Return in *FHP the file handle corresponding to the file or directory
+   PATH.  */
+extern int lgetfh (__const char *__path, fhandle_t *__fhp) __THROW;
+
+/* Open a file handle *FHP, using the open() like FLAGS.  Return the
+   new file descriptor.  */
+extern int fhopen (__const fhandle_t *__fhp, int __flags) __THROW;
+
+/* Get file attributes for the file whose handle is *FHP, and return them
+   in *BUF.  Like fhopen + fstat + close.  */
+#ifndef __USE_FILE_OFFSET64
+extern int fhstat (__const fhandle_t *__fhp, struct stat *__buf) __THROW;
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (fhstat,
+		       (__const fhandle_t *__fhp, struct stat *__buf),
+		       fhstat64);
+# else
+#  define fhstat fhstat64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fhstat64 (__const fhandle_t *__fhp, struct stat64 *__buf) __THROW;
+#endif
+
+/* Return information about the filesystem on which the file resides whose
+   handle is *FHP.  Like fhopen + fstatfs + close.  */
+#ifndef __USE_FILE_OFFSET64
+extern int fhstatfs (__const fhandle_t *__fhp, struct statfs *__buf) __THROW;
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT (fhstatfs,
+		       (__const fhandle_t *__fhp, struct statfs *__buf),
+		       fhstatfs64);
+# else
+#  define fhstatfs fhstatfs64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern int fhstatfs64 (__const fhandle_t *__fhp,
+		       struct statfs64 *__buf) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* _SYS_MOUNT_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/ptrace.h
@@ -0,0 +1,127 @@
+/*-
+ * Copyright (c) 1984, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)ptrace.h	8.2 (Berkeley) 1/4/94
+ * $FreeBSD: src/sys/sys/ptrace.h,v 1.28.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $
+ */
+ 
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H	1
+
+#include <features.h>
+
+#include <signal.h>
+#include <sys/kern/param.h>
+#include <machine/reg.h>
+
+__BEGIN_DECLS
+
+#define	PT_TRACE_ME	0	/* child declares it's being traced */
+#define	PT_READ_I	1	/* read word in child's I space */
+#define	PT_READ_D	2	/* read word in child's D space */
+/* was	PT_READ_U	3	 * read word in child's user structure */
+#define	PT_WRITE_I	4	/* write word in child's I space */
+#define	PT_WRITE_D	5	/* write word in child's D space */
+/* was	PT_WRITE_U	6	 * write word in child's user structure */
+#define	PT_CONTINUE	7	/* continue the child */
+#define	PT_KILL		8	/* kill the child process */
+#define	PT_STEP		9	/* single step the child */
+
+#define	PT_ATTACH	10	/* trace some running process */
+#define	PT_DETACH	11	/* stop tracing a process */
+#define PT_IO		12	/* do I/O to/from stopped process. */
+
+#define	PT_LWPINFO	13	/* Info about the LWP that stopped. */
+#define PT_GETNUMLWPS	14	/* get total number of threads */
+#define PT_GETLWPLIST	15	/* get thread list */
+
+#define PT_CLEARSTEP	16	/* turn off single step */
+#define PT_SETSTEP	17	/* turn on single step */
+#define PT_SUSPEND	18	/* suspend a thread */
+#define PT_RESUME	19	/* resume a thread */
+
+#define	PT_TO_SCE	20
+#define	PT_TO_SCX	21
+#define	PT_SYSCALL	22
+
+#define	PT_FOLLOW_FORK	23
+
+#define PT_GETREGS      33	/* get general-purpose registers */
+#define PT_SETREGS      34	/* set general-purpose registers */
+#define PT_GETFPREGS    35	/* get floating-point registers */
+#define PT_SETFPREGS    36	/* set floating-point registers */
+#define PT_GETDBREGS    37	/* get debugging registers */
+#define PT_SETDBREGS    38	/* set debugging registers */
+
+#define	PT_VM_TIMESTAMP	40	/* Get VM version (timestamp) */
+#define	PT_VM_ENTRY	41	/* Get VM map (entry) */
+
+#define PT_FIRSTMACH    64	/* for machine-specific requests */
+
+struct ptrace_io_desc {
+	int	piod_op;	/* I/O operation */
+	void	*piod_offs;	/* child offset */
+	void	*piod_addr;	/* parent offset */
+	size_t	piod_len;	/* request length */
+};
+
+/*
+ * Operations in piod_op.
+ */
+#define PIOD_READ_D	1	/* Read from D space */
+#define PIOD_WRITE_D	2	/* Write to D space */
+#define PIOD_READ_I	3	/* Read from I space */
+#define PIOD_WRITE_I	4	/* Write to I space */
+
+/* Argument structure for PT_LWPINFO. */
+struct ptrace_lwpinfo {
+	__lwpid_t	pl_lwpid;	/* LWP described. */
+	int	pl_event;	/* Event that stopped the LWP. */
+#define	PL_EVENT_NONE	0
+#define	PL_EVENT_SIGNAL	1
+	int	pl_flags;	/* LWP flags. */
+#define	PL_FLAG_SA	0x01	/* M:N thread */
+#define	PL_FLAG_BOUND	0x02	/* M:N bound thread */
+#define	PL_FLAG_SCE	0x04	/* syscall enter point */
+#define	PL_FLAG_SCX	0x08	/* syscall leave point */
+#define	PL_FLAG_EXEC	0x10	/* exec(2) succeeded */
+#define	PL_FLAG_SI	0x20	/* siginfo is valid */
+#define	PL_FLAG_FORKED	0x40	/* new child */
+#define	PL_FLAG_CHILD	0x80	/* I am from child */
+	sigset_t	pl_sigmask;	/* LWP signal mask */
+	sigset_t	pl_siglist;	/* LWP pending signal */
+	struct siginfo	pl_siginfo;	/* siginfo for signal */
+	char		pl_tdname[MAXCOMLEN + 1]; /* LWP name */
+	int		pl_child_pid;	/* New child pid */
+};
+
+extern int ptrace(int _request, pid_t _pid, caddr_t _addr, int _data) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/reboot.h
@@ -0,0 +1,81 @@
+/*-
+ * Copyright (c) 1982, 1986, 1988, 1993, 1994
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)reboot.h	8.3 (Berkeley) 12/13/94
+ * $FreeBSD: src/sys/sys/reboot.h,v 1.26.18.1 2008/11/25 02:59:29 kensmith Exp $
+ */
+
+#ifndef _SYS_REBOOT_H_
+#define	_SYS_REBOOT_H_	1
+
+#include <features.h>
+
+/*
+ * Arguments to reboot system call.  These are passed to
+ * the boot program and on to init.
+ */
+#define	RB_AUTOBOOT	0	/* flags for system auto-booting itself */
+
+#define	RB_ASKNAME	0x001	/* ask for file name to reboot from */
+#define	RB_SINGLE	0x002	/* reboot to single user only */
+#define	RB_NOSYNC	0x004	/* dont sync before reboot */
+#define	RB_HALT		0x008	/* don't reboot, just halt */
+#define	RB_INITNAME	0x010	/* name given for /etc/init (unused) */
+#define	RB_DFLTROOT	0x020	/* use compiled-in rootdev */
+#define	RB_KDB		0x040	/* give control to kernel debugger */
+#define	RB_RDONLY	0x080	/* mount root fs read-only */
+#define	RB_DUMP		0x100	/* dump kernel memory before reboot */
+#define	RB_MINIROOT	0x200	/* mini-root present in memory at boot time */
+#define	RB_VERBOSE	0x800	/* print all potentially useful info */
+#define	RB_SERIAL	0x1000	/* use serial port as console */
+#define	RB_CDROM	0x2000	/* use cdrom as root */
+#define	RB_POWEROFF	0x4000	/* turn the power off if possible */
+#define	RB_GDB		0x8000	/* use GDB remote debugger instead of DDB */
+#define	RB_MUTE		0x10000	/* start up with the console muted */
+#define	RB_SELFTEST	0x20000	/* don't complete the boot; do selftest */
+#define	RB_RESERVED1	0x40000	/* reserved for internal use of boot blocks */
+#define	RB_RESERVED2	0x80000	/* reserved for internal use of boot blocks */
+#define	RB_PAUSE	0x100000 /* pause after each output line during probe */
+#define	RB_MULTIPLE	0x20000000	/* use multiple consoles */
+
+#define	RB_BOOTINFO	0x80000000	/* have `struct bootinfo *' arg */
+
+/* 
+ * Compatibility with Linux
+ */
+#define RB_HALT_SYSTEM	RB_HALT
+#define RB_POWER_OFF	RB_POWEROFF
+
+__BEGIN_DECLS
+
+/* Reboot or halt the system.  */
+extern int reboot (int __howto) __THROW;
+
+__END_DECLS
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/rfork.h
@@ -0,0 +1,98 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)unistd.h	8.2 (Berkeley) 1/7/94
+ * $FreeBSD: src/sys/sys/unistd.h,v 1.22.2.1 2000/03/18 23:20:12 jasone Exp $
+ */
+
+#ifndef _SYS_RFORK_H
+#define _SYS_RFORK_H
+
+#include <features.h>
+
+/*
+ * rfork() options.
+ *
+ * XXX currently, operations without RFPROC set are not supported.
+ */
+#define RFNAMEG		(1<<0)  /* UNIMPL new plan9 `name space' */
+#define RFENVG		(1<<1)  /* UNIMPL copy plan9 `env space' */
+#define RFFDG		(1<<2)  /* copy fd table */
+#define RFNOTEG		(1<<3)  /* UNIMPL create new plan9 `note group' */
+#define RFPROC		(1<<4)  /* change child (else changes curproc) */
+#define RFMEM		(1<<5)  /* share `address space' */
+#define RFNOWAIT	(1<<6)  /* parent need not wait() on child */
+#define RFCNAMEG	(1<<10) /* UNIMPL zero plan9 `name space' */
+#define RFCENVG		(1<<11) /* UNIMPL zero plan9 `env space' */
+#define RFCFDG		(1<<12) /* zero fd table */
+#define RFTHREAD	(1<<13)	/* enable kernel thread support */
+#define RFSIGSHARE	(1<<14)	/* share signal handlers */
+#define RFLINUXTHPN     (1<<16) /* do linux clone exit parent notification */
+#define	RFSTOPPED	(1<<17) /* leave child in a stopped state */
+#define	RFHIGHPID	(1<<18) /* use a pid higher than 10 (idleproc) */
+#define	RFTSIGZMB	(1<<19) /* select signal for exit parent notification */
+#define	RFTSIGSHIFT	20      /* selected signal number is in bits 20-27  */
+#define	RFTSIGMASK	0xFF
+#define	RFTSIGNUM(flags)	(((flags) >> RFTSIGSHIFT) & RFTSIGMASK)
+#define	RFTSIGFLAGS(signum)	((signum) << RFTSIGSHIFT)
+#define RFPPWAIT	(1<<31) /* parent sleeps until child exits (vfork) */
+
+#define RFTHPNSHIFT	24	/* reserve bits 24-30 */
+#define RFTHPNMASK	0x7F    /* for compatibility with linuxthreads/clone()   */
+				/* allow to specify  "clone exit parent notification" signal */
+#define RFTHPNSIGNUM(flags)	(((flags) >> RFTHPNSHIFT) & RFTHPNMASK)
+
+__BEGIN_DECLS
+
+extern int rfork (int __flags) __THROW;
+
+#ifdef _LIBC
+extern int __rfork (int __flags);
+#endif
+
+__END_DECLS
+
+#endif /* _SYS_RFORK_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/socketvar.h
@@ -0,0 +1,189 @@
+/* This header is used on many systems but for GNU we have 
+   almost everything defined in the standard header.  */
+
+#include <sys/socket.h>
+
+/*-
+ * Copyright (c) 1982, 1986, 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)socketvar.h	8.3 (Berkeley) 2/19/95
+ *
+ * $FreeBSD: src/sys/sys/socketvar.h,v 1.171.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $
+ */
+
+#ifndef _SYS_SOCKETVAR_H_
+#define _SYS_SOCKETVAR_H_
+
+#include <sys/queue.h>			/* for TAILQ macros */
+#include <sys/selinfo.h>		/* for struct selinfo */
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+#include <sys/_sx.h>
+
+struct socket;
+struct vnet;
+
+struct	xsockbuf {
+	u_int	sb_cc;
+	u_int	sb_hiwat;
+	u_int	sb_mbcnt;
+	u_int   sb_mcnt;
+	u_int   sb_ccnt;
+	u_int	sb_mbmax;
+	int	sb_lowat;
+	int	sb_timeo;
+	short	sb_flags;
+};
+
+/*
+ * Variables for socket buffering.
+ */
+struct	sockbuf {
+	struct	selinfo sb_sel;	/* process selecting read/write */
+	struct	mtx sb_mtx;	/* sockbuf lock */
+	struct	sx sb_sx;	/* prevent I/O interlacing */
+	short	sb_state;	/* (c/d) socket state on sockbuf */
+#define	sb_startzero	sb_mb
+	struct	mbuf *sb_mb;	/* (c/d) the mbuf chain */
+	struct	mbuf *sb_mbtail; /* (c/d) the last mbuf in the chain */
+	struct	mbuf *sb_lastrecord;	/* (c/d) first mbuf of last
+					 * record in socket buffer */
+	struct	mbuf *sb_sndptr; /* (c/d) pointer into mbuf chain */
+	u_int	sb_sndptroff;	/* (c/d) byte offset of ptr into chain */
+	u_int	sb_cc;		/* (c/d) actual chars in buffer */
+	u_int	sb_hiwat;	/* (c/d) max actual char count */
+	u_int	sb_mbcnt;	/* (c/d) chars of mbufs used */
+	u_int   sb_mcnt;        /* (c/d) number of mbufs in buffer */
+	u_int   sb_ccnt;        /* (c/d) number of clusters in buffer */
+	u_int	sb_mbmax;	/* (c/d) max chars of mbufs to use */
+	u_int	sb_ctl;		/* (c/d) non-data chars in buffer */
+	int	sb_lowat;	/* (c/d) low water mark */
+	int	sb_timeo;	/* (c/d) timeout for read/write */
+	short	sb_flags;	/* (c/d) flags, see below */
+	int	(*sb_upcall)(struct socket *, void *, int); /* (c/d) */
+	void	*sb_upcallarg;	/* (c/d) */
+};
+
+
+/*
+ * Kernel structure per socket.
+ * Contains send and receive buffer queues,
+ * handle on protocol and pointer to protocol
+ * private data and error information.
+ */
+typedef	u_quad_t so_gen_t;
+
+
+/*-
+ * Locking key to struct socket:
+ * (a) constant after allocation, no locking required.
+ * (b) locked by SOCK_LOCK(so).
+ * (c) locked by SOCKBUF_LOCK(&so->so_rcv).
+ * (d) locked by SOCKBUF_LOCK(&so->so_snd).
+ * (e) locked by ACCEPT_LOCK().
+ * (f) not locked since integer reads/writes are atomic.
+ * (g) used only as a sleep/wakeup address, no value.
+ * (h) locked by global mutex so_global_mtx.
+ */
+struct socket {
+	int	so_count;		/* (b) reference count */
+	short	so_type;		/* (a) generic type, see socket.h */
+	short	so_options;		/* from socket call, see socket.h */
+	short	so_linger;		/* time to linger while closing */
+	short	so_state;		/* (b) internal state flags SS_* */
+	int	so_qstate;		/* (e) internal state flags SQ_* */
+	void	*so_pcb;		/* protocol control block */
+	struct	vnet *so_vnet;		/* network stack instance */
+	struct	protosw *so_proto;	/* (a) protocol handle */
+/*
+ * Variables for connection queuing.
+ * Socket where accepts occur is so_head in all subsidiary sockets.
+ * If so_head is 0, socket is not related to an accept.
+ * For head socket so_incomp queues partially completed connections,
+ * while so_comp is a queue of connections ready to be accepted.
+ * If a connection is aborted and it has so_head set, then
+ * it has to be pulled out of either so_incomp or so_comp.
+ * We allow connections to queue up based on current queue lengths
+ * and limit on number of queued connections for this socket.
+ */
+	struct	socket *so_head;	/* (e) back pointer to listen socket */
+	TAILQ_HEAD(, socket) so_incomp;	/* (e) queue of partial unaccepted connections */
+	TAILQ_HEAD(, socket) so_comp;	/* (e) queue of complete unaccepted connections */
+	TAILQ_ENTRY(socket) so_list;	/* (e) list of unaccepted connections */
+	u_short	so_qlen;		/* (e) number of unaccepted connections */
+	u_short	so_incqlen;		/* (e) number of unaccepted incomplete
+					   connections */
+	u_short	so_qlimit;		/* (e) max number queued connections */
+	short	so_timeo;		/* (g) connection timeout */
+	u_short	so_error;		/* (f) error affecting connection */
+	struct	sigio *so_sigio;	/* [sg] information for async I/O or
+					   out of band data (SIGURG) */
+	u_long	so_oobmark;		/* (c) chars to oob mark */
+	TAILQ_HEAD(, aiocblist) so_aiojobq; /* AIO ops waiting on socket */
+
+	struct sockbuf so_rcv, so_snd;
+
+	struct	ucred *so_cred;		/* (a) user credentials */
+	struct	label *so_label;	/* (b) MAC label for socket */
+	struct	label *so_peerlabel;	/* (b) cached MAC label for peer */
+	/* NB: generation count must not be first. */
+	so_gen_t so_gencnt;		/* (h) generation count */
+	void	*so_emuldata;		/* (b) private data for emulators */
+ 	struct so_accf {
+		struct	accept_filter *so_accept_filter;
+		void	*so_accept_filter_arg;	/* saved filter args */
+		char	*so_accept_filter_str;	/* saved user args */
+	} *so_accf;
+	int so_fibnum;		/* routing domain for this socket */
+};
+
+/*
+ * Externalized form of struct socket used by the sysctl(3) interface.
+ */
+struct xsocket {
+	size_t	xso_len;	/* length of this structure */
+	struct	socket *xso_so;	/* makes a convenient handle sometimes */
+	short	so_type;
+	short	so_options;
+	short	so_linger;
+	short	so_state;
+	caddr_t	so_pcb;		/* another convenient handle */
+	int	xso_protocol;
+	int	xso_family;
+	u_short	so_qlen;
+	u_short	so_incqlen;
+	u_short	so_qlimit;
+	short	so_timeo;
+	u_short	so_error;
+	pid_t	so_pgid;
+	u_long	so_oobmark;
+	struct xsockbuf so_rcv, so_snd;
+	uid_t	so_uid;		/* XXX */
+};
+
+#endif /* !_SYS_SOCKETVAR_H_ */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/swap.h
@@ -0,0 +1,37 @@
+/* Calls to enable swapping on specified locations.  FreeBSD version.
+   Copyright (C) 1996-1997, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef __SYS_SWAP_H
+
+#define __SYS_SWAP_H	1
+#include <features.h>
+
+
+__BEGIN_DECLS
+
+/* Make the block special device PATH available to the system for swapping.
+   This call is restricted to the super-user.  */
+extern int swapon (__const char *__path) __THROW;
+
+/* Stop using block special device PATH for swapping.  */
+extern int swapoff (__const char *__path) __THROW;
+
+__END_DECLS
+
+#endif /* sys/swap.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/syscall.h
@@ -0,0 +1,505 @@
+#ifndef _SYSCALL_H
+#define _SYSCALL_H	1
+
+/*
+ * System call numbers.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: stable/10/sys/kern/syscalls.master 293474 2016-01-09 14:20:23Z dchagin
+ */
+
+#define	SYS_syscall	0
+#define	SYS_exit	1
+#define	SYS_fork	2
+#define	SYS_read	3
+#define	SYS_write	4
+#define	SYS_open	5
+#define	SYS_close	6
+#define	SYS_wait4	7
+				/* 8 is old creat */
+#define	SYS_link	9
+#define	SYS_unlink	10
+				/* 11 is obsolete execv */
+#define	SYS_chdir	12
+#define	SYS_fchdir	13
+#define	SYS_mknod	14
+#define	SYS_chmod	15
+#define	SYS_chown	16
+#define	SYS_break	17
+#define	SYS_freebsd4_getfsstat	18
+				/* 19 is old lseek */
+#define	SYS_getpid	20
+#define	SYS_mount	21
+#define	SYS_unmount	22
+#define	SYS_setuid	23
+#define	SYS_getuid	24
+#define	SYS_geteuid	25
+#define	SYS_ptrace	26
+#define	SYS_recvmsg	27
+#define	SYS_sendmsg	28
+#define	SYS_recvfrom	29
+#define	SYS_accept	30
+#define	SYS_getpeername	31
+#define	SYS_getsockname	32
+#define	SYS_access	33
+#define	SYS_chflags	34
+#define	SYS_fchflags	35
+#define	SYS_sync	36
+#define	SYS_kill	37
+				/* 38 is old stat */
+#define	SYS_getppid	39
+				/* 40 is old lstat */
+#define	SYS_dup	41
+#define	SYS_pipe	42
+#define	SYS_getegid	43
+#define	SYS_profil	44
+#define	SYS_ktrace	45
+				/* 46 is old sigaction */
+#define	SYS_getgid	47
+				/* 48 is old sigprocmask */
+#define	SYS_getlogin	49
+#define	SYS_setlogin	50
+#define	SYS_acct	51
+				/* 52 is old sigpending */
+#define	SYS_sigaltstack	53
+#define	SYS_ioctl	54
+#define	SYS_reboot	55
+#define	SYS_revoke	56
+#define	SYS_symlink	57
+#define	SYS_readlink	58
+#define	SYS_execve	59
+#define	SYS_umask	60
+#define	SYS_chroot	61
+				/* 62 is old fstat */
+				/* 63 is old getkerninfo */
+				/* 64 is old getpagesize */
+#define	SYS_msync	65
+#define	SYS_vfork	66
+				/* 67 is obsolete vread */
+				/* 68 is obsolete vwrite */
+#define	SYS_sbrk	69
+#define	SYS_sstk	70
+				/* 71 is old mmap */
+#define	SYS_vadvise	72
+#define	SYS_munmap	73
+#define	SYS_mprotect	74
+#define	SYS_madvise	75
+				/* 76 is obsolete vhangup */
+				/* 77 is obsolete vlimit */
+#define	SYS_mincore	78
+#define	SYS_getgroups	79
+#define	SYS_setgroups	80
+#define	SYS_getpgrp	81
+#define	SYS_setpgid	82
+#define	SYS_setitimer	83
+				/* 84 is old wait */
+#define	SYS_swapon	85
+#define	SYS_getitimer	86
+				/* 87 is old gethostname */
+				/* 88 is old sethostname */
+#define	SYS_getdtablesize	89
+#define	SYS_dup2	90
+#define	SYS_fcntl	92
+#define	SYS_select	93
+#define	SYS_fsync	95
+#define	SYS_setpriority	96
+#define	SYS_socket	97
+#define	SYS_connect	98
+				/* 99 is old accept */
+#define	SYS_getpriority	100
+				/* 101 is old send */
+				/* 102 is old recv */
+				/* 103 is old sigreturn */
+#define	SYS_bind	104
+#define	SYS_setsockopt	105
+#define	SYS_listen	106
+				/* 107 is obsolete vtimes */
+				/* 108 is old sigvec */
+				/* 109 is old sigblock */
+				/* 110 is old sigsetmask */
+				/* 111 is old sigsuspend */
+				/* 112 is old sigstack */
+				/* 113 is old recvmsg */
+				/* 114 is old sendmsg */
+				/* 115 is obsolete vtrace */
+#define	SYS_gettimeofday	116
+#define	SYS_getrusage	117
+#define	SYS_getsockopt	118
+#define	SYS_readv	120
+#define	SYS_writev	121
+#define	SYS_settimeofday	122
+#define	SYS_fchown	123
+#define	SYS_fchmod	124
+				/* 125 is old recvfrom */
+#define	SYS_setreuid	126
+#define	SYS_setregid	127
+#define	SYS_rename	128
+				/* 129 is old truncate */
+				/* 130 is old ftruncate */
+#define	SYS_flock	131
+#define	SYS_mkfifo	132
+#define	SYS_sendto	133
+#define	SYS_shutdown	134
+#define	SYS_socketpair	135
+#define	SYS_mkdir	136
+#define	SYS_rmdir	137
+#define	SYS_utimes	138
+				/* 139 is obsolete 4.2 sigreturn */
+#define	SYS_adjtime	140
+				/* 141 is old getpeername */
+				/* 142 is old gethostid */
+				/* 143 is old sethostid */
+				/* 144 is old getrlimit */
+				/* 145 is old setrlimit */
+				/* 146 is old killpg */
+#define	SYS_setsid	147
+#define	SYS_quotactl	148
+				/* 149 is old quota */
+				/* 150 is old getsockname */
+#define	SYS_nlm_syscall	154
+#define	SYS_nfssvc	155
+				/* 156 is old getdirentries */
+#define	SYS_freebsd4_statfs	157
+#define	SYS_freebsd4_fstatfs	158
+#define	SYS_lgetfh	160
+#define	SYS_getfh	161
+#define	SYS_freebsd4_getdomainname	162
+#define	SYS_freebsd4_setdomainname	163
+#define	SYS_freebsd4_uname	164
+#define	SYS_sysarch	165
+#define	SYS_rtprio	166
+#define	SYS_semsys	169
+#define	SYS_msgsys	170
+#define	SYS_shmsys	171
+#define	SYS_freebsd6_pread	173
+#define	SYS_freebsd6_pwrite	174
+#define	SYS_setfib	175
+#define	SYS_ntp_adjtime	176
+#define	SYS_setgid	181
+#define	SYS_setegid	182
+#define	SYS_seteuid	183
+#define	SYS_stat	188
+#define	SYS_fstat	189
+#define	SYS_lstat	190
+#define	SYS_pathconf	191
+#define	SYS_fpathconf	192
+#define	SYS_getrlimit	194
+#define	SYS_setrlimit	195
+#define	SYS_getdirentries	196
+#define	SYS_freebsd6_mmap	197
+#define	SYS___syscall	198
+#define	SYS_freebsd6_lseek	199
+#define	SYS_freebsd6_truncate	200
+#define	SYS_freebsd6_ftruncate	201
+#define	SYS___sysctl	202
+#define	SYS_mlock	203
+#define	SYS_munlock	204
+#define	SYS_undelete	205
+#define	SYS_futimes	206
+#define	SYS_getpgid	207
+#define	SYS_poll	209
+#define	SYS_freebsd7___semctl	220
+#define	SYS_semget	221
+#define	SYS_semop	222
+#define	SYS_freebsd7_msgctl	224
+#define	SYS_msgget	225
+#define	SYS_msgsnd	226
+#define	SYS_msgrcv	227
+#define	SYS_shmat	228
+#define	SYS_freebsd7_shmctl	229
+#define	SYS_shmdt	230
+#define	SYS_shmget	231
+#define	SYS_clock_gettime	232
+#define	SYS_clock_settime	233
+#define	SYS_clock_getres	234
+#define	SYS_ktimer_create	235
+#define	SYS_ktimer_delete	236
+#define	SYS_ktimer_settime	237
+#define	SYS_ktimer_gettime	238
+#define	SYS_ktimer_getoverrun	239
+#define	SYS_nanosleep	240
+#define	SYS_ffclock_getcounter	241
+#define	SYS_ffclock_setestimate	242
+#define	SYS_ffclock_getestimate	243
+#define	SYS_clock_getcpuclockid2	247
+#define	SYS_ntp_gettime	248
+#define	SYS_minherit	250
+#define	SYS_rfork	251
+#define	SYS_openbsd_poll	252
+#define	SYS_issetugid	253
+#define	SYS_lchown	254
+#define	SYS_aio_read	255
+#define	SYS_aio_write	256
+#define	SYS_lio_listio	257
+#define	SYS_getdents	272
+#define	SYS_lchmod	274
+#define	SYS_netbsd_lchown	275
+#define	SYS_lutimes	276
+#define	SYS_netbsd_msync	277
+#define	SYS_nstat	278
+#define	SYS_nfstat	279
+#define	SYS_nlstat	280
+#define	SYS_preadv	289
+#define	SYS_pwritev	290
+#define	SYS_freebsd4_fhstatfs	297
+#define	SYS_fhopen	298
+#define	SYS_fhstat	299
+#define	SYS_modnext	300
+#define	SYS_modstat	301
+#define	SYS_modfnext	302
+#define	SYS_modfind	303
+#define	SYS_kldload	304
+#define	SYS_kldunload	305
+#define	SYS_kldfind	306
+#define	SYS_kldnext	307
+#define	SYS_kldstat	308
+#define	SYS_kldfirstmod	309
+#define	SYS_getsid	310
+#define	SYS_setresuid	311
+#define	SYS_setresgid	312
+				/* 313 is obsolete signanosleep */
+#define	SYS_aio_return	314
+#define	SYS_aio_suspend	315
+#define	SYS_aio_cancel	316
+#define	SYS_aio_error	317
+#define	SYS_oaio_read	318
+#define	SYS_oaio_write	319
+#define	SYS_olio_listio	320
+#define	SYS_yield	321
+				/* 322 is obsolete thr_sleep */
+				/* 323 is obsolete thr_wakeup */
+#define	SYS_mlockall	324
+#define	SYS_munlockall	325
+#define	SYS___getcwd	326
+#define	SYS_sched_setparam	327
+#define	SYS_sched_getparam	328
+#define	SYS_sched_setscheduler	329
+#define	SYS_sched_getscheduler	330
+#define	SYS_sched_yield	331
+#define	SYS_sched_get_priority_max	332
+#define	SYS_sched_get_priority_min	333
+#define	SYS_sched_rr_get_interval	334
+#define	SYS_utrace	335
+#define	SYS_freebsd4_sendfile	336
+#define	SYS_kldsym	337
+#define	SYS_jail	338
+#define	SYS_nnpfs_syscall	339
+#define	SYS_sigprocmask	340
+#define	SYS_sigsuspend	341
+#define	SYS_freebsd4_sigaction	342
+#define	SYS_sigpending	343
+#define	SYS_freebsd4_sigreturn	344
+#define	SYS_sigtimedwait	345
+#define	SYS_sigwaitinfo	346
+#define	SYS___acl_get_file	347
+#define	SYS___acl_set_file	348
+#define	SYS___acl_get_fd	349
+#define	SYS___acl_set_fd	350
+#define	SYS___acl_delete_file	351
+#define	SYS___acl_delete_fd	352
+#define	SYS___acl_aclcheck_file	353
+#define	SYS___acl_aclcheck_fd	354
+#define	SYS_extattrctl	355
+#define	SYS_extattr_set_file	356
+#define	SYS_extattr_get_file	357
+#define	SYS_extattr_delete_file	358
+#define	SYS_aio_waitcomplete	359
+#define	SYS_getresuid	360
+#define	SYS_getresgid	361
+#define	SYS_kqueue	362
+#define	SYS_kevent	363
+#define	SYS_extattr_set_fd	371
+#define	SYS_extattr_get_fd	372
+#define	SYS_extattr_delete_fd	373
+#define	SYS___setugid	374
+#define	SYS_eaccess	376
+#define	SYS_afs3_syscall	377
+#define	SYS_nmount	378
+#define	SYS___mac_get_proc	384
+#define	SYS___mac_set_proc	385
+#define	SYS___mac_get_fd	386
+#define	SYS___mac_get_file	387
+#define	SYS___mac_set_fd	388
+#define	SYS___mac_set_file	389
+#define	SYS_kenv	390
+#define	SYS_lchflags	391
+#define	SYS_uuidgen	392
+#define	SYS_sendfile	393
+#define	SYS_mac_syscall	394
+#define	SYS_getfsstat	395
+#define	SYS_statfs	396
+#define	SYS_fstatfs	397
+#define	SYS_fhstatfs	398
+#define	SYS_ksem_close	400
+#define	SYS_ksem_post	401
+#define	SYS_ksem_wait	402
+#define	SYS_ksem_trywait	403
+#define	SYS_ksem_init	404
+#define	SYS_ksem_open	405
+#define	SYS_ksem_unlink	406
+#define	SYS_ksem_getvalue	407
+#define	SYS_ksem_destroy	408
+#define	SYS___mac_get_pid	409
+#define	SYS___mac_get_link	410
+#define	SYS___mac_set_link	411
+#define	SYS_extattr_set_link	412
+#define	SYS_extattr_get_link	413
+#define	SYS_extattr_delete_link	414
+#define	SYS___mac_execve	415
+#define	SYS_sigaction	416
+#define	SYS_sigreturn	417
+#define	SYS_getcontext	421
+#define	SYS_setcontext	422
+#define	SYS_swapcontext	423
+#define	SYS_swapoff	424
+#define	SYS___acl_get_link	425
+#define	SYS___acl_set_link	426
+#define	SYS___acl_delete_link	427
+#define	SYS___acl_aclcheck_link	428
+#define	SYS_sigwait	429
+#define	SYS_thr_create	430
+#define	SYS_thr_exit	431
+#define	SYS_thr_self	432
+#define	SYS_thr_kill	433
+#define	SYS__umtx_lock	434
+#define	SYS__umtx_unlock	435
+#define	SYS_jail_attach	436
+#define	SYS_extattr_list_fd	437
+#define	SYS_extattr_list_file	438
+#define	SYS_extattr_list_link	439
+#define	SYS_ksem_timedwait	441
+#define	SYS_thr_suspend	442
+#define	SYS_thr_wake	443
+#define	SYS_kldunloadf	444
+#define	SYS_audit	445
+#define	SYS_auditon	446
+#define	SYS_getauid	447
+#define	SYS_setauid	448
+#define	SYS_getaudit	449
+#define	SYS_setaudit	450
+#define	SYS_getaudit_addr	451
+#define	SYS_setaudit_addr	452
+#define	SYS_auditctl	453
+#define	SYS__umtx_op	454
+#define	SYS_thr_new	455
+#define	SYS_sigqueue	456
+#define	SYS_kmq_open	457
+#define	SYS_kmq_setattr	458
+#define	SYS_kmq_timedreceive	459
+#define	SYS_kmq_timedsend	460
+#define	SYS_kmq_notify	461
+#define	SYS_kmq_unlink	462
+#define	SYS_abort2	463
+#define	SYS_thr_set_name	464
+#define	SYS_aio_fsync	465
+#define	SYS_rtprio_thread	466
+#define	SYS_sctp_peeloff	471
+#define	SYS_sctp_generic_sendmsg	472
+#define	SYS_sctp_generic_sendmsg_iov	473
+#define	SYS_sctp_generic_recvmsg	474
+#define	SYS_pread	475
+#define	SYS_pwrite	476
+#define	SYS_mmap	477
+#define	SYS_lseek	478
+#define	SYS_truncate	479
+#define	SYS_ftruncate	480
+#define	SYS_thr_kill2	481
+#define	SYS_shm_open	482
+#define	SYS_shm_unlink	483
+#define	SYS_cpuset	484
+#define	SYS_cpuset_setid	485
+#define	SYS_cpuset_getid	486
+#define	SYS_cpuset_getaffinity	487
+#define	SYS_cpuset_setaffinity	488
+#define	SYS_faccessat	489
+#define	SYS_fchmodat	490
+#define	SYS_fchownat	491
+#define	SYS_fexecve	492
+#define	SYS_fstatat	493
+#define	SYS_futimesat	494
+#define	SYS_linkat	495
+#define	SYS_mkdirat	496
+#define	SYS_mkfifoat	497
+#define	SYS_mknodat	498
+#define	SYS_openat	499
+#define	SYS_readlinkat	500
+#define	SYS_renameat	501
+#define	SYS_symlinkat	502
+#define	SYS_unlinkat	503
+#define	SYS_posix_openpt	504
+#define	SYS_gssd_syscall	505
+#define	SYS_jail_get	506
+#define	SYS_jail_set	507
+#define	SYS_jail_remove	508
+#define	SYS_closefrom	509
+#define	SYS___semctl	510
+#define	SYS_msgctl	511
+#define	SYS_shmctl	512
+#define	SYS_lpathconf	513
+#define	SYS_cap_new	514
+#define	SYS___cap_rights_get	515
+#define	SYS_cap_enter	516
+#define	SYS_cap_getmode	517
+#define	SYS_pdfork	518
+#define	SYS_pdkill	519
+#define	SYS_pdgetpid	520
+#define	SYS_pselect	522
+#define	SYS_getloginclass	523
+#define	SYS_setloginclass	524
+#define	SYS_rctl_get_racct	525
+#define	SYS_rctl_get_rules	526
+#define	SYS_rctl_get_limits	527
+#define	SYS_rctl_add_rule	528
+#define	SYS_rctl_remove_rule	529
+#define	SYS_posix_fallocate	530
+#define	SYS_posix_fadvise	531
+#define	SYS_wait6	532
+#define	SYS_cap_rights_limit	533
+#define	SYS_cap_ioctls_limit	534
+#define	SYS_cap_ioctls_get	535
+#define	SYS_cap_fcntls_limit	536
+#define	SYS_cap_fcntls_get	537
+#define	SYS_bindat	538
+#define	SYS_connectat	539
+#define	SYS_chflagsat	540
+#define	SYS_accept4	541
+#define	SYS_pipe2	542
+#define	SYS_aio_mlock	543
+#define	SYS_procctl	544
+#define	SYS_ppoll	545
+#define	SYS_futimens	546
+#define	SYS_utimensat	547
+#define	SYS_MAXSYSCALL	548
+
+#define SYS_obreak	SYS_break
+#define SYS_sysctl	SYS___sysctl
+#define SYS_getcwd	SYS___getcwd
+#define SYS_setugid	SYS___setugid
+#define SYS_semctl	SYS___semctl
+
+#define SYS_acl_get_file	SYS___acl_get_file
+#define SYS_acl_set_file	SYS___acl_set_file
+#define SYS_acl_get_fd		SYS___acl_get_fd
+#define SYS_acl_set_fd		SYS___acl_set_fd
+#define SYS_acl_delete_file	SYS___acl_delete_file
+#define SYS_acl_delete_fd	SYS___acl_delete_fd
+#define SYS_acl_aclcheck_file	SYS___acl_aclcheck_file
+#define SYS_acl_aclcheck_fd	SYS___acl_aclcheck_fd
+#define SYS_acl_get_link	SYS___acl_get_link
+#define SYS_acl_set_link	SYS___acl_set_link
+#define SYS_acl_delete_link	SYS___acl_delete_link
+#define SYS_acl_aclcheck_link	SYS___acl_aclcheck_link
+
+#define SYS_mac_get_proc	SYS___mac_get_proc
+#define SYS_mac_set_proc	SYS___mac_set_proc
+#define SYS_mac_get_fd		SYS___mac_get_fd
+#define SYS_mac_get_file	SYS___mac_get_file
+#define SYS_mac_set_fd		SYS___mac_set_fd
+#define SYS_mac_set_file	SYS___mac_set_file
+#define SYS_mac_get_pid		SYS___mac_get_pid
+#define SYS_mac_get_link	SYS___mac_get_link
+#define SYS_mac_set_link	SYS___mac_set_link
+#define SYS_mac_execve		SYS___mac_execve
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/ttydefaults.h
@@ -0,0 +1,97 @@
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)ttydefaults.h	8.4 (Berkeley) 1/21/94
+ */
+
+/*
+ * System wide defaults for terminal state.  FreeBSD version.
+ */
+#ifndef _SYS_TTYDEFAULTS_H_
+#define _SYS_TTYDEFAULTS_H_
+
+/*
+ * Defaults on "first" open.
+ */
+#define TTYDEF_IFLAG	(BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
+#define TTYDEF_OFLAG	(OPOST | ONLCR)
+#define TTYDEF_LFLAG	(ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
+#define TTYDEF_CFLAG	(CREAD | CS8 | HUPCL)
+#define TTYDEF_SPEED	(B9600)
+
+/*
+ * Control Character Defaults
+ */
+#define CTRL(x)	(x&037)
+#define CEOF		CTRL('d')
+#ifdef _POSIX_VDISABLE
+# define CEOL		_POSIX_VDISABLE
+#else
+# define CEOL		((unsigned char)'\377')	/* XXX avoid _POSIX_VDISABLE */
+#endif
+#define CERASE		0177
+#define CERASE2		CTRL('h')
+#define CINTR		CTRL('c')
+#define CSTATUS		CTRL('t')
+#define CKILL		CTRL('u')
+#define CMIN		1
+#define CQUIT		034		/* FS, ^\ */
+#define CSUSP		CTRL('z')
+#define CTIME		0
+#define CDSUSP		CTRL('y')
+#define CSTART		CTRL('q')
+#define CSTOP		CTRL('s')
+#define CLNEXT		CTRL('v')
+#define CDISCARD 	CTRL('o')
+#define CWERASE 	CTRL('w')
+#define CREPRINT 	CTRL('r')
+#define CEOT		CEOF
+/* compat */
+#define CBRK		CEOL
+#define CRPRNT		CREPRINT
+#define CFLUSH		CDISCARD
+
+/* PROTECTED INCLUSION ENDS HERE */
+#endif /* !_SYS_TTYDEFAULTS_H_ */
+
+/*
+ * #define TTYDEFCHARS to include an array of default control characters.
+ */
+#ifdef TTYDEFCHARS
+cc_t	ttydefchars[NCCS] = {
+	CEOF,	CEOL,	CEOL,	CERASE, CWERASE, CKILL, CREPRINT,
+	CERASE2, CINTR,	CQUIT,	CSUSP,	CDSUSP,	CSTART,	CSTOP,	CLNEXT,
+	CDISCARD, CMIN,	CTIME,  CSTATUS, _POSIX_VDISABLE
+};
+#undef TTYDEFCHARS
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/ucontext.h
@@ -0,0 +1,49 @@
+/* Data structures for user-level context switching.  Generic version.
+   Copyright (C) 1997-1999, 2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This file's definitions suffice for any platform where all
+   the machine-specific state is described in `struct sigcontext'.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not exposed
+   by <signal.h>.  */
+#include <bits/sigcontext.h>
+#include <bits/sigstack.h>
+
+/* This include file defines the type 'mcontext_t'.  */
+#include <bits/mcontext.h>
+
+/* Userlevel context.  */
+typedef struct ucontext
+  {
+    __sigset_t uc_sigmask;
+    mcontext_t uc_mcontext;
+    struct ucontext *uc_link;
+    stack_t uc_stack;
+    int     uc_flags;
+#define UCF_SWAPPED     0x00000001      /* Used by swapcontext(3). */
+    int __unused1[4];
+  } ucontext_t;
+
+#endif /* sys/ucontext.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/un.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1991, 1995, 1996, 2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_UN_H
+#define	_SYS_UN_H	1
+
+#include <sys/cdefs.h>
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+__BEGIN_DECLS
+
+/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket.  */
+struct sockaddr_un
+  {
+    __SOCKADDR_COMMON (sun_);
+    char sun_path[104];		/* Path name, the kernel restrict it to 104, */
+#if defined(__i386__) || defined(__amd64__)
+    char __sun_user_compat[4];  /* but former user header used 108 */
+#endif    
+  };
+
+
+#ifdef __USE_MISC
+# include <string.h>		/* For prototype of `strlen'.  */
+
+/* Evaluate to actual length of the `sockaddr_un' structure.  */
+# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path)	      \
+		      + strlen ((ptr)->sun_path))
+#endif
+
+__END_DECLS
+
+#endif	/* sys/un.h  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/syscalls-inline.h
@@ -0,0 +1,82 @@
+/* prototypes of generally used "inline syscalls"
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef KFREEBSD_INLINE_SYSCALLS_H
+#define KFREEBSD_INLINE_SYSCALLS_H
+
+#include <sys/types.h>
+#include <signal.h>
+#include <syscalls-internal.h>
+
+struct iovec;
+struct rusage;
+struct timespec;
+
+int __syscall_open(const char *path, int flags, ...);
+int __syscall_close(int fd);
+libc_hidden_proto (__syscall_open)
+libc_hidden_proto (__syscall_close)
+
+ssize_t __syscall_read(int fd, void *buf, size_t nbyte);
+ssize_t __syscall_write(int fd, const void *buf, size_t nbyte);
+ssize_t __syscall_writev(int fd, const struct iovec *iovp, int iovcnt);
+libc_hidden_proto (__syscall_read)
+libc_hidden_proto (__syscall_write)
+libc_hidden_proto (__syscall_writev)
+
+ssize_t __syscall_readlink(const char *path, char *buf, size_t bufsiz);
+libc_hidden_proto (__syscall_readlink)
+
+int __syscall_fcntl(int fd, int cmd, ...);
+int __syscall_fork(void);
+int __syscall_wait4(int pid, int *status, int options, struct rusage *rusage);
+int __syscall_sigsuspend (const sigset_t *set);
+int __syscall_sigprocmask (int how, const sigset_t *set, sigset_t *oldset);
+int __syscall_nanosleep (const struct timespec *requested_time, struct timespec *remaining);
+libc_hidden_proto (__syscall_fcntl)
+libc_hidden_proto (__syscall_fork)
+libc_hidden_proto (__syscall_wait4)
+libc_hidden_proto (__syscall_sigsuspend)
+libc_hidden_proto (__syscall_sigprocmask)
+libc_hidden_proto (__syscall_nanosleep)
+
+int __syscall_sigwait     (const sigset_t *set, int *sig);
+int __syscall_sigwaitinfo (const sigset_t *set, siginfo_t *info);
+int __syscall_sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout);
+libc_hidden_proto (__syscall_sigwait)
+libc_hidden_proto (__syscall_sigwaitinfo)
+libc_hidden_proto (__syscall_sigtimedwait)
+
+int __syscall_clock_getcpuclockid2(int64_t id, int which, clockid_t *clock_id);
+libc_hidden_proto (__syscall_clock_getcpuclockid2)
+                           
+int __syscall_thr_exit(long *p);
+int __syscall_thr_kill(long id, int sig);
+int __syscall_thr_kill2(int pid, long id, int sig);
+int __syscall_thr_new(void *arg, int size);
+int __syscall_thr_self(long *id);
+int __syscall_thr_set_name(long id, const char *name);
+libc_hidden_proto (__syscall_thr_exit)
+libc_hidden_proto (__syscall_thr_kill)
+libc_hidden_proto (__syscall_thr_kill2)
+libc_hidden_proto (__syscall_thr_new)
+libc_hidden_proto (__syscall_thr_self)
+libc_hidden_proto (__syscall_thr_set_name)
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/syscalls.list
@@ -0,0 +1,214 @@
+# File name		Caller	Syscall name		# args		Strong name	Weak names
+accept4			-	accept4			Ci:iBNi		accept4
+sys_access		-	access			i:si		__syscall_access
+acl_aclcheck_fd		-	acl_aclcheck_fd		i:iip		__acl_aclcheck_fd
+acl_aclcheck_file	-	acl_aclcheck_file	i:sip		__acl_aclcheck_file
+acl_delete_fd		-	acl_delete_fd		i:ii		__acl_delete_fd
+acl_delete_file		-	acl_delete_file		i:si		__acl_delete_file
+acl_get_fd		-	acl_get_fd		i:iip		__acl_get_fd
+acl_get_file		-	acl_get_file		i:sip		__acl_get_file
+acl_set_fd		-	acl_set_fd		i:iip		__acl_set_fd
+acl_set_file		-	acl_set_file		i:sip		__acl_set_file
+sys_aio_cancel		-	aio_cancel		i:ip		__syscall_aio_cancel
+sys_aio_error		-	aio_error		i:p		__syscall_aio_error
+sys_aio_read		-	aio_read		i:p		__syscall_aio_read
+sys_aio_return		-	aio_return		i:p		__syscall_aio_return
+sys_aio_suspend		-	aio_suspend		i:bnP		__syscall_aio_suspend
+sys_aio_waitcomplete	-	aio_waitcomplete	i:pp		__syscall_aio_waitcomplete
+sys_aio_write		-	aio_write		i:p		__syscall_aio_write
+sys_bind		-	bind			i:ipi		__syscall_bind
+sys_clock_getcpuclockid2  -     clock_getcpuclockid2    Vi:iip		__syscall_clock_getcpuclockid2
+sys_clock_getres	-	clock_getres		i:ip		__syscall_clock_getres
+sys_clock_gettime	-	clock_gettime		i:ip		__syscall_clock_gettime
+sys_clock_settime	-	clock_settime		i:ip		__syscall_clock_settime
+sys_close		-	close			i:i		__syscall_close
+sys_closefrom		EXTRA	closefrom		i:i		__syscall_closefrom
+sys_connect		-	connect			i:ipi		__syscall_connect
+sys_cpuset_getaffinity	-	cpuset_getaffinity	i:iiiip		__syscall_cpuset_getaffinity
+sys_cpuset_setaffinity	-	cpuset_setaffinity	i:iiiip		__syscall_cpuset_setaffinity
+execve			-	execve			i:spp		__execve execve
+extattr_delete_file	-	extattr_delete_file	i:ss		extattr_delete_file
+extattr_get_file	-	extattr_get_file	i:ssbn		extattr_get_file
+extattr_set_file	-	extattr_set_file	i:ssbn		extattr_set_file
+extattrctl		-	extattrctl		i:sisI		extattrctl
+sys_faccessat		-	faccessat		i:isii		__syscall_faccessat
+fchmodat		-	fchmodat		i:isii		fchmodat
+fchownat		-	fchownat		i:isiii		fchownat
+sys_fcntl		-	fcntl			i:iiF		__syscall_fcntl
+fexecve			-	fexecve			i:ipp		fexecve
+fhopen			-	fhopen			i:pi		fhopen
+sys_fhstat		-	fhstat			i:pp		__syscall_fhstat
+sys_fhstatfs		-	fhstatfs		i:pp		__syscall_fhstatfs
+sys_fork		-	fork			i:		__syscall_fork	fork
+sys_fstat		-	fstat			i:ip		__syscall_fstat
+sys_fstatat		-	fstatat			i:ispi		__syscall_fstatat
+sys_fstatfs		-	fstatfs			i:ip		__syscall_fstatfs
+ftruncate		-	ftruncate		i:ii		__ftruncate !__ftruncate64 ftruncate ftruncate64
+futimes			-	futimes			i:ip		__futimes futimes
+sys_futimesat		-	futimesat		i:isp		__syscall_futimesat
+getcontext		-	getcontext		i:p		__getcontext getcontext
+sys_getcwd		-	getcwd			i:bn		__syscall_getcwd
+sys_getdents		-	getdents		i:ibn		__syscall_getdents getdents
+sys_getdirentries	-	getdirentries		i:ibnP		__syscall_getdirentries
+getegid			-	getegid			i:		__getegid getegid
+geteuid			-	geteuid			i:		__geteuid geteuid
+getfh			-	getfh			i:sp		getfh
+sys_getfsstat		-	getfsstat		i:pii		__syscall_getfsstat
+sys_getlogin		-	getlogin		i:bn		__syscall_getlogin
+getpgid			-	getpgid			i:i		__getpgid __getpgid_internal getpgid
+getpgrp			-	getpgrp			i:		getpgrp
+getppid			-	getppid			i:		__getppid getppid
+getresgid		-	getresgid		i:ppp		getresgid
+getresuid		-	getresuid		i:ppp		getresuid
+getrlimit		-	getrlimit		i:ip		__getrlimit getrlimit getrlimit64 __getrlimit64
+getsid			-	getsid			i:i		getsid
+issetugid		-	issetugid		i:		issetugid
+jail			-	jail			i:p		jail
+jail_attach		-	jail_attach		i:i		jail_attach
+jail_get		-	jail_get		i:pii		jail_get
+jail_remove		-	jail_remove		i:i		jail_remove
+jail_set		-	jail_set		i:pii		jail_set
+kenv			-	kenv			i:issi		kenv
+kevent			EXTRA	kevent			i:ipipip	__kevent kevent
+kldfind			-	kldfind			i:s		kldfind
+kldfirstmod		-	kldfirstmod		i:i		kldfirstmod
+kldload			-	kldload			i:s		kldload
+kldnext			-	kldnext			i:i		kldnext
+kldstat			-	kldstat			i:ip		kldstat
+kldsym			-	kldsym			i:iip		kldsym
+kldunload		-	kldunload		i:i		kldunload
+kldunloadf		-	kldunloadf		i:ii		kldunloadf
+kqueue			EXTRA	kqueue			i:		__kqueue kqueue
+sys_ktimer_create	-	ktimer_create		i:iPp		__syscall_ktimer_create
+sys_ktimer_delete	-	ktimer_delete		i:i		__syscall_ktimer_delete
+sys_ktimer_getoverrun	-	ktimer_getoverrun	i:i		__syscall_ktimer_getoverrun
+sys_ktimer_gettime	-	ktimer_gettime		i:ip		__syscall_ktimer_gettime
+sys_ktimer_settime	-	ktimer_settime		i:iipp		__syscall_ktimer_settime
+ktrace			-	ktrace			i:siii		ktrace
+lchflags		-	lchflags		i:si		lchflags
+lchmod			-	lchmod			i:si		__lchmod lchmod
+lchown			-	lchown			i:sii		__lchown lchown
+linkat			-	linkat			i:isisi		linkat
+sys_lio_listio		-	lio_listio		i:ibnP		__syscall_lio_listio
+lseek			-	lseek			i:iii		__libc_lseek !__lseek  lseek !__libc_lseek64 !__lseek64 lseek64 !__llseek llseek
+sys_lstat		-	lstat			i:sp		__syscall_lstat
+lutimes			-	lutimes			i:sp		__lutimes lutimes
+posix_madvise		-	madvise			i:pii		posix_madvise
+mincore			-	mincore			i:anV		mincore
+minherit		-	minherit		i:aii		minherit
+mkdirat			-	mkdirat			i:isi		mkdirat
+mkfifo			-	mkfifo			i:si		__mkfifo mkfifo
+sys_mkfifoat		-	mkfifoat		i:isi		__syscall_mkfifoat
+sys_mknod		-	mknod			i:sii		__syscall_mknod
+sys_mknodat		-	mknodat			i:isii		__syscall_mknodat
+mlock			-	mlock			i:bn		mlock
+mlockall		-	mlockall		i:i		mlockall
+sys_mmap		-	mmap			b:aniiii	__syscall_mmap
+modfind			-	modfind			i:s		modfind
+modfnext		-	modfnext		i:i		modfnext
+modnext			-	modnext			i:i		modnext
+modstat			-	modstat			i:ip		modstat
+mount			-	mount			i:ssiP		mount
+sys_msgctl		-	msgctl			i:iip		__syscall_msgctl
+msgget			-	msgget			i:ii		msgget
+msgrcv			-	msgrcv			Ci:ibnii	__libc_msgrcv msgrcv
+msgsnd			-	msgsnd			Ci:ibni		__libc_msgsnd msgsnd
+munlock			-	munlock			i:ai		munlock
+munlockall		-	munlockall		i:		munlockall
+sys_munmap		-	munmap			i:pi		__syscall_munmap
+nanosleep		-	nanosleep		Ci:pp		__libc_nanosleep __nanosleep nanosleep
+sys_nanosleep		EXTRA	nanosleep		i:pp		__syscall_nanosleep
+nfssvc			-	nfssvc			i:ip		nfssvc
+sys_nfstat		-	nfstat			i:ip		__syscall_nfstat
+nlm_syscall		-	nlm_syscall		i:iiip		nlm_syscall
+sys_nlstat		-	nlstat			i:sp		__syscall_nlstat
+nmount			-	nmount			i:pii		nmount
+sys_nstat		-	nstat			i:sp		__syscall_nstat
+ntp_adjtime		-	ntp_adjtime		i:p		ntp_adjtime
+ntp_gettime		-	ntp_gettime		i:p		ntp_gettime
+obreak			-	obreak			i:a		__syscall_obreak
+sys_open		-	open			i:siv		__syscall_open
+sys_openat		-	openat			i:isii		__syscall_openat !__openat_nocancel  !__openat64_nocancel
+poll			-	poll			Ci:pii		__poll poll
+sys_posix_fadvise	EXTRA	posix_fadvise		i:iiii		__syscall_posix_fadvise
+sys_posix_fallocate	EXTRA	posix_fallocate		i:iii		__syscall_posix_fallocate
+posix_openpt		getpt	posix_openpt		i:i		__syscall_posix_openpt
+pread			-	pread			Ci:ibni		__libc_pread !__pread pread !__libc_pread64 !__pread64 pread64
+preadv			-	preadv			Ci:ipii		__preadv  preadv  __preadv64  preadv64 
+pselect			-	pselect			Ci:iPPPPP	__pselect !__libc_pselect pselect
+pwrite			-	pwrite			Ci:ibni		__libc_pwrite !__pwrite pwrite !__libc_pwrite64 !__pwrite64 pwrite64
+pwritev			-	pwritev			Ci:ipii		__pwritev pwritev __pwritev64 pwritev64 
+quotactl		-	quotactl		i:siip		quotactl
+sys_read		-	read			i:ibn		__syscall_read
+readlink		-	readlink       		i:spi   	__syscall_readlink __readlink readlink
+readlinkat		-	readlinkat		i:issi		readlinkat
+sys_readv		-	readv			i:ipi		__syscall_readv
+renameat		-	renameat		i:isis		renameat
+rfork			-	rfork			i:i		__rfork rfork
+rtprio			-	rtprio			i:iip		__rtprio rtprio
+sched_primax		-	sched_get_priority_max	i:i		__sched_get_priority_max sched_get_priority_max
+sched_primin		-	sched_get_priority_min	i:i		__sched_get_priority_min sched_get_priority_min
+sched_gets		-	sched_getscheduler	i:i		__sched_getscheduler sched_getscheduler
+sched_rr_gi		-	sched_rr_get_interval	i:ip		__sched_rr_get_interval sched_rr_get_interval
+sched_setp		-	sched_setparam		i:ip		__sched_setparam sched_setparam
+sched_sets		-	sched_setscheduler	i:iip		__sched_setscheduler sched_setscheduler
+sched_yield		-	sched_yield		i:		__sched_yield sched_yield
+sys_semctl		-	semctl			i:iiip		__syscall_semctl
+semget			-	semget			i:iii		semget
+semop			-	semop			i:ipi		semop
+bsd_sendfile		-	sendfile		i:iiiippi	bsd_sendfile
+sys_sendto		-	sendto			i:ibnibn	__syscall_sendto
+setcontext		-	setcontext		i:p		__setcontext setcontext
+setegid			-	setegid			i:i		setegid
+seteuid			-	seteuid			i:i		seteuid
+setgid			-	setgid			i:i		__setgid setgid
+sys_setlogin		-	setlogin		i:s		__syscall_setlogin
+setpgid			-	setpgid			i:ii		__setpgid setpgid
+setresgid		-	setresgid		i:iii		setresgid
+setresuid		-	setresuid		i:iii		setresuid
+setrlimit		-	setrlimit		i:ip		__setrlimit setrlimit setrlimit64
+setsid			-	setsid			i:		__setsid setsid
+setuid			-	setuid			i:i		__setuid setuid
+sys_shm_open		-	shm_open		i:sii		__syscall_shm_open
+shm_unlink		-	shm_unlink		i:s		shm_unlink
+shmat			-	shmat			i:iai		shmat
+sys_shmctl		-	shmctl			i:iip		__syscall_shmctl
+shmdt			-	shmdt			i:a		shmdt
+shmget			-	shmget			i:iii		shmget
+sys_sigaction		-	sigaction		i:ipp		__syscall_sigaction
+sigpending		-	sigpending		i:p		sigpending
+sys_sigprocmask		EXTRA	sigprocmask		Vi:iPP		__syscall_sigprocmask
+sigprocmask		-	sigprocmask		i:iPP		__sigprocmask sigprocmask
+sigqueue		-	sigqueue		i:iii		__sigqueue sigqueue
+sigsuspend		-	sigsuspend		Ci:p		__sigsuspend sigsuspend
+sys_sigsuspend		EXTRA	sigsuspend		i:p		__syscall_sigsuspend
+sigtimedwait		-	sigtimedwait		Ci:ppP		__sigtimedwait sigtimedwait
+sys_sigtimedwait	-	sigtimedwait		i:ppP		__syscall_sigtimedwait
+sys_sigwait		-	sigwait			i:pp		__syscall_sigwait
+sigwaitinfo		-	sigwaitinfo		Ci:pp		__sigwaitinfo sigwaitinfo
+sys_sigwaitinfo		-	sigwaitinfo		i:pp		__syscall_sigwaitinfo
+sys_stat		-	stat			i:sp		__syscall_stat
+sys_statfs		-	statfs			i:sp		__syscall_statfs
+swapcontext		-	swapcontext		i:pp		__swapcontext swapcontext
+swapoff			-	swapoff			i:s		swapoff
+swapon			-	swapon			i:s		swapon
+symlinkat		-	symlinkat		i:sis		symlinkat
+sysarch			-	sysarch			i:ip		__sysarch sysarch
+sysctl			-	sysctl			i:pibNbn	__sysctl sysctl
+sys_thr_exit		-	thr_exit		Vi:P		__syscall_thr_exit
+sys_thr_kill		-	thr_kill		Vi:ii		__syscall_thr_kill
+sys_thr_kill2		-	thr_kill2		Vi:iii		__syscall_thr_kill2
+sys_thr_new		-	thr_new			Vi:pi		__syscall_thr_new
+sys_thr_self		-	thr_self		Vi:p		__syscall_thr_self
+sys_thr_set_name	-	thr_set_name		Vi:iP		__syscall_thr_set_name
+truncate		-	truncate		i:sii		__truncate !__truncate64 truncate truncate64
+sys_umtx		-	_umtx_op		Vi:piipp	__syscall__umtx_op
+undelete		-	undelete		i:s		undelete
+unlinkat		-	unlinkat		i:isi		unlinkat
+unmount			-	unmount			i:si		unmount
+utrace			-	utrace			i:bn		utrace
+wait4			-	wait4			i:iWiP		__syscall_wait4 __wait4	wait4
+sys_wait6		EXTRA	wait6			i:iiWiPP	__syscall_wait6
+sys_write		-	write			i:ibn		__syscall_write
+sys_writev		-	writev			i:ipi		__syscall_writev
+yield			-	yield			i:		__syscall_yield
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sysconf.c
@@ -0,0 +1,69 @@
+/* Get file-specific information about a file.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sysdep.h>
+#include <time.h>
+#include <unistd.h>
+#include <hp-timing.h>
+#include <sys/sysctl.h>
+
+static long int posix_sysconf (int name);
+
+/* Get the value of the system variable NAME.  */
+long int
+__sysconf (int name)
+{
+  int request[2];
+  int value;
+  size_t len = sizeof(value);
+
+  switch(name)
+    {
+      case _SC_CPUTIME:
+      case _SC_THREAD_CPUTIME:
+#if HP_TIMING_AVAIL
+	// XXX We can add  here test for machines which cannot support a
+	// XXX usable TSC.
+	return 200809L;
+#else
+	return -1;
+#endif
+      case _SC_NGROUPS_MAX:
+	request[0] = CTL_KERN;
+	request[1] = KERN_NGROUPS;
+	if (__sysctl(request, 2, &value, &len, NULL, 0) == -1)
+	    return NGROUPS_MAX;
+	return (long)value;
+      case _SC_ARG_MAX:
+	request[0] = CTL_KERN;
+	request[1] = KERN_ARGMAX;
+	if (__sysctl(request, 2, &value, &len, NULL, 0) == -1)
+	    return ARG_MAX;
+	return (long)value;
+    }
+  return posix_sysconf (name);
+}
+
+/* Now the POSIX version.  */
+#undef __sysconf
+#define __sysconf static posix_sysconf
+#include <sysdeps/posix/sysconf.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sysctlbyname.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/sysctl.h>
+#include <string.h>
+
+/* Read or write system parameters.  */
+int
+__sysctlbyname (const char *name, void *oldval, size_t *oldlenp, const void *newval, size_t newlen)
+{
+  int request[CTL_MAXNAME+2];
+  size_t requestlen = CTL_MAXNAME+2;
+
+  if (__sysctlnametomib(name, request, &requestlen) < 0)
+    return -1;
+
+  /* Now call sysctl using the binary encoded request.  */
+  return __sysctl (request, requestlen,
+		   oldval, oldlenp, (void *)newval, newlen);
+}
+
+weak_alias (__sysctlbyname, sysctlbyname)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/sysctlnametomib.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <string.h>
+
+int
+__sysctlnametomib (const char *name, int *mibp, size_t *sizep)
+{
+  /* Convert the string NAME to a binary encoded request.  The kernel
+     contains a routine for doing this, called "name2oid".  But the way
+     to call it is a little bit strange.  */
+  int name2oid_request[2] = { 0, 3 };
+  int retval;
+  
+  *sizep *= sizeof (int);
+  retval = __sysctl (name2oid_request, 2, mibp, sizep, (void *) name, strlen (name));
+  *sizep /= sizeof (int);
+  return retval;
+}
+
+weak_alias (__sysctlnametomib, sysctlnametomib)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/tcdrain.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <sysdep-cancel.h>
+#include <stddef.h>
+
+/* Wait for pending output to be written on FD.  */
+int
+__libc_tcdrain (int fd)
+{
+  if (SINGLE_THREAD_P)
+    return __ioctl (fd, TIOCDRAIN);
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = __ioctl (fd, TIOCDRAIN);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+weak_alias (__libc_tcdrain, tcdrain)
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/tcflow.c
@@ -0,0 +1,4 @@
+/* just use internal functions */
+#define tcgetattr __tcgetattr
+#define write __write
+#include <sysdeps/unix/bsd/tcflow.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/telldir.c
@@ -0,0 +1,2 @@
+/* Avoid <sysdeps/unix/bsd/telldir.c>, which doesn't pass the testsuite.  */
+#include <sysdeps/posix/telldir.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/testrtsig.h
@@ -0,0 +1,30 @@
+/* Test whether RT signals are really available.
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <string.h>
+
+#include <kernel-features.h>
+#include <getosreldate.h>
+
+static int
+kernel_has_rtsig (void)
+{
+  return 1;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/times.c
@@ -0,0 +1,71 @@
+/* Copyright (C) 1991,92,93,95,96,97,1998,2001 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/resource.h>
+#include <sys/times.h>
+#include <sys/time.h>
+#include <time.h>
+
+
+/* Time the program started.  */
+extern time_t _posix_start_time;
+
+#ifdef __GNUC__
+__inline
+#endif
+static clock_t
+timeval_to_clock_t (const struct timeval *tv, clock_t clk_tck)
+{
+  return (clock_t) ((tv->tv_sec * clk_tck) +
+		    (tv->tv_usec * clk_tck / 1000000L));
+}
+
+/* Store the CPU time used by this process and all its
+   dead children (and their dead children) in BUFFER.
+   Return the elapsed real time, or (clock_t) -1 for errors.
+   All times are in CLK_TCKths of a second.  */
+clock_t
+__times (struct tms *buffer)
+{
+  struct rusage usage;
+  clock_t clk_tck;
+
+  if (buffer == NULL)
+    {
+      __set_errno (EINVAL);
+      return (clock_t) -1;
+    }
+
+  clk_tck = __getclktck ();
+  
+  if (__getrusage (RUSAGE_SELF, &usage) < 0)
+    return (clock_t) -1;
+  buffer->tms_utime = (clock_t) timeval_to_clock_t (&usage.ru_utime, clk_tck);
+  buffer->tms_stime = (clock_t) timeval_to_clock_t (&usage.ru_stime, clk_tck);
+
+  if (__getrusage (RUSAGE_CHILDREN, &usage) < 0)
+    return (clock_t) -1;
+  buffer->tms_cutime = (clock_t) timeval_to_clock_t (&usage.ru_utime, clk_tck);
+  buffer->tms_cstime = (clock_t) timeval_to_clock_t (&usage.ru_stime, clk_tck);
+
+  return (time ((time_t *) NULL) - _posix_start_time) * clk_tck;
+}
+
+weak_alias (__times, times)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/timespec_get.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 2011-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <time.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+
+/* Set TS to calendar time based in time base BASE.  */
+
+/* if the timespec_get function is successful 
+   it returns the nonzero value base;
+   otherwise, it returns zero.
+ */
+
+int __syscall_clock_gettime(clockid_t clock_id, struct timespec *tp);
+libc_hidden_proto (__syscall_clock_gettime)
+
+int
+timespec_get (struct timespec *ts, int base)
+{
+  switch (base)
+    {
+    case TIME_UTC:
+      if ( 0 != INLINE_SYSCALL (clock_gettime, 2, CLOCK_REALTIME, ts))
+	return 0;
+      break;
+
+    default:
+      return 0;
+    }
+
+  return base;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/truncate64.c
@@ -0,0 +1 @@
+/* 'truncate64' is the same as 'truncate', because __off64_t == __off_t.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ttyname.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 1991,92,93,96,97,98,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stddef.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+/* Static buffer in `ttyname'.  */
+libc_freeres_ptr (static char *ttyname_buf);
+
+static const char dev[] = "/dev";
+
+/* Return the pathname of the terminal FD is open on, or NULL on errors.
+   The returned storage is good only until the next call to this function.  */
+char *
+ttyname (int fd)
+{
+  static size_t buflen;
+  struct fiodgname_arg fgn;
+
+  /* isatty check, tcgetattr is used because it sets the correct
+     errno (EBADF resp. ENOTTY) on error.  */
+  struct termios term;
+  if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
+    return NULL;
+
+  if (buflen == 0)
+    {
+      buflen = 4095;
+      ttyname_buf = (char *) malloc (buflen + 1);
+      if (ttyname_buf == NULL)
+	{
+	  buflen = 0;
+	  return NULL;
+	}
+    }
+
+  /* Prepare the result buffer.  */
+  memcpy (ttyname_buf, dev, sizeof (dev) - 1);
+  ttyname_buf[sizeof (dev) - 1] = '/';
+
+  fgn.buf = ttyname_buf + sizeof (dev);
+  fgn.len = buflen - sizeof (dev);
+
+  if (__ioctl(fd, FIODGNAME, &fgn) == -1)
+    {
+      return NULL; 
+    }
+
+  return ttyname_buf;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ttyname_r.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 1991,92,93,95,96,97,98,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+static const char dev[] = "/dev";
+
+/* Store at most BUFLEN character of the pathname of the terminal FD is
+   open on in BUF.  Return 0 on success,  otherwise an error number.  */
+int
+__ttyname_r (int fd, char *buf, size_t buflen)
+{
+  int ret;
+  struct fiodgname_arg fgn;
+
+  /* Test for the absolute minimal size.  This makes life easier inside
+     the loop.  */
+  if (!buf)
+    {
+      __set_errno (EINVAL);
+      return EINVAL;
+    }
+
+  if (buflen < (int) (sizeof (dev) + 1))
+    {
+      __set_errno (ERANGE);
+      return ERANGE;
+    }
+
+  /* isatty check, tcgetattr is used because it sets the correct
+     errno (EBADF resp. ENOTTY) on error.  */
+  struct termios term;
+  if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
+    return errno;
+
+  /* Prepare the result buffer.  */
+  memcpy (buf, dev, sizeof (dev) - 1);
+  buf[sizeof (dev) - 1] = '/';
+
+  fgn.buf = buf + sizeof (dev);
+  fgn.len = buflen - sizeof (dev);
+
+  ret = __ioctl(fd, FIODGNAME, &fgn);
+  if (ret == -1)
+    {
+      __set_errno (EBADF);
+      return EBADF;
+    }
+
+  return 0;
+}
+
+weak_alias (__ttyname_r, ttyname_r)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/uname.c
@@ -0,0 +1,110 @@
+/* Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/utsname.h>
+#include <sys/sysctl.h>
+#include <errno.h>
+#include <string.h>
+
+#define SYSNAME                "GNU/kFreeBSD"
+#define SYSNAME_LEN    13
+
+/* Check for bounds in pre-processor */
+#if SYSNAME_LEN > _UTSNAME_SYSNAME_LENGTH
+#error
+#endif
+
+/* Put information about the system in NAME.  */
+int
+__uname (struct utsname *name)
+{
+  int request[2] = { CTL_KERN };
+  size_t len;
+
+  /* Fill sysname: "uname -s". */
+  strcpy (name->sysname, SYSNAME);
+
+  /* Fill nodename: "uname -n".  Fetch sysctl "kern.hostname".  */
+  request[1] = KERN_HOSTNAME;
+  len = sizeof (name->nodename);
+  if (__sysctl (request, 2, name->nodename, &len, NULL, 0) >= 0)
+    {
+      if (len < sizeof (name->nodename))
+	name->nodename[len] = '\0';
+    }
+
+  /* Fill release: "uname -r".  Fetch sysctl "kern.osrelease".  */
+  request[1] = KERN_OSRELEASE;
+  len = sizeof (name->release);
+  if (__sysctl (request, 2, name->release, &len, NULL, 0) >= 0)
+    {
+      if (len < sizeof (name->release))
+        name->release[len] = '\0';
+    }
+
+  /* Fill version: "uname -v".  Fetch sysctl "kern.version".  */
+  request[1] = KERN_VERSION;
+  len = sizeof (name->version);
+  if (__sysctl (request, 2, name->version, &len, NULL, 0) >= 0)
+    {
+      if (len < sizeof (name->version))
+        name->version[len] = '\0';
+    }
+
+  /* Remove trailing whitespace.  Turn non-trailing whitespace to
+     spaces.  */
+  {
+    char *p0 = name->version;
+    char *p = p0 + __strnlen (p0, sizeof (name->version));
+
+    while (p > p0 && (p[-1] == '\t' || p[-1] == '\n' || p[-1] == ' '))
+      *--p = '\0';
+
+    while (p > p0)
+      {
+        --p;
+        if (*p == '\t' || *p == '\n')
+          *p = ' ';
+      }
+  }
+
+#ifdef __x86_64__
+  /* Check for bounds in pre-processor */
+# if 7 > _UTSNAME_MACHINE_LENGTH
+#  error
+# endif
+  /* Pristine FreeBSD kernel would return "amd64".  Avoid that.  */
+  strcpy (name->machine, "x86_64");
+#else
+  /* Fill machine: "uname -m".  Fetch sysctl "hw.machine".  */
+  request[0] = CTL_HW;
+  request[1] = HW_MACHINE;
+  len = sizeof (name->machine);
+  if (__sysctl (request, 2, name->machine, &len, NULL, 0) >= 0)
+    {
+      if (len < sizeof (name->machine))
+        name->machine[len] = '\0';
+    }
+#endif
+
+  return 0;
+}
+libc_hidden_def (__uname)
+weak_alias (__uname, uname)
+libc_hidden_def (uname)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/unlockpt.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+extern int __isptymaster(int fd);
+
+int
+unlockpt (int fd)
+{
+  /* there is no need/way to do unlocking of slave pseudo-terminal device,
+     just check whether fd might be valid master pseudo-terminal device */
+  return __isptymaster(fd);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/usleep.c
@@ -0,0 +1,50 @@
+/* Implementation of the BSD usleep function using nanosleep.
+   Copyright (C) 1996-1997, 1999, 2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <time.h>
+#include <unistd.h>
+
+int
+usleep (useconds_t useconds)
+{
+  unsigned int sec;
+  unsigned int usec;
+  struct timespec ts;
+
+  /* POSIX:2001 says that useconds >= 1000000 is invalid; nevertheless let's
+     be forgiving.  */
+  if (__builtin_expect (useconds < 1000000, 1))
+    {
+      sec = 0;
+      usec = useconds;
+    }
+  else
+    {
+      sec = useconds / 1000000;
+      usec = useconds % 1000000;
+    }
+
+  ts.tv_sec = sec;
+  ts.tv_nsec = usec * 1000;	/* Multiply as 32-bit integers.  */
+
+  /* Note the usleep() is a cancellation point.  But since we call
+     nanosleep() which itself is a cancellation point we do not have
+     to do anything here.  */
+  return __nanosleep (&ts, NULL);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/ustat.c
@@ -0,0 +1,66 @@
+/* Return info on filesystem.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/ustat.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+int
+ustat (dev_t dev, struct ustat *ubuf)
+{
+  int mntcount;
+  struct statfs *mntlist;
+
+  /* Search for the device among the f_mntfromname fields of all mounted
+     filesystems.  */
+  mntcount = __getmntinfo (&mntlist, 0);
+  if (mntcount == 0 && errno != 0)
+    return -1;
+  if (mntcount > 0)
+    {
+      int i;
+
+      for (i = 0; i < mntcount; i++)
+	{
+	  struct statfs *mnt = &mntlist[i];
+	  struct stat statbuf;
+
+	  if ((__strnlen (mnt->f_mntfromname, sizeof (mnt->f_mntfromname))
+	       < sizeof (mnt->f_mntfromname))
+	      && __xstat (_STAT_VER, mnt->f_mntfromname, &statbuf) >= 0
+	      && S_ISBLK (statbuf.st_mode)
+	      && statbuf.st_rdev == dev)
+	    {
+	      /* Found the device.  Now produce the result.  */
+	      memset (ubuf, '\0', sizeof (struct ustat));
+	      ubuf->f_tfree = mnt->f_bfree;
+	      ubuf->f_tinode = mnt->f_ffree;
+	      return 0;
+	    }
+	}
+    }
+
+  /* DEV is not among the mounted devices.  */
+  __set_errno (EINVAL);
+  return -1;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/Makefile
@@ -0,0 +1,6 @@
+# Additional functions:
+
+ifeq ($(subdir),login)
+# For <utmpx.h>.
+sysdep_routines += utmpconv
+endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/bits/utmp.h
@@ -0,0 +1,50 @@
+/* The `struct utmp' type, describing entries in the utmp file.  For FreeBSD.
+   Copyright (C) 1993, 1996-1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _UTMP_H
+# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
+#endif
+
+#include <paths.h>
+#include <time.h>
+
+
+#define	UT_NAMESIZE	16
+#define	UT_LINESIZE	8
+#define	UT_HOSTSIZE	16
+
+
+struct lastlog
+  {
+    time_t ll_time;
+    char ll_line[UT_LINESIZE];
+    char ll_host[UT_HOSTSIZE];
+  };
+
+struct utmp
+  {
+    char ut_line[UT_LINESIZE];
+    char ut_user[UT_NAMESIZE];
+#define ut_name ut_user
+    char ut_host[UT_HOSTSIZE];
+    __time_t ut_time;
+  };
+
+
+#define _HAVE_UT_HOST 1		/* We have the ut_host field.  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/getutmp.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <utmpx.h>
+#include <utmp.h>
+#include <string.h>
+
+extern int __utmpx_to_utmp (const struct utmpx *, struct utmp *);
+
+/* Copy the information in UTMPX to UTMP. */
+void
+getutmp (const struct utmpx *utmpx, struct utmp *utmp)
+{
+  if (__utmpx_to_utmp (utmpx, utmp) < 0)
+    memset (utmp, '\0', sizeof (struct utmp));
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/getutmpx.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <utmpx.h>
+#include <utmp.h>
+#include <string.h>
+
+extern int __utmp_to_utmpx (const struct utmp *, struct utmpx *);
+
+/* Copy the information in UTMP to UTMPX. */
+void
+getutmpx (const struct utmp *utmp, struct utmpx *utmpx)
+{
+  if (__utmp_to_utmpx (utmp, utmpx) < 0)
+    memset (utmpx, '\0', sizeof (struct utmpx));
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/getutxent.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <utmpx.h>
+#include <utmp.h>
+#include <stddef.h>
+
+extern int __utmp_to_utmpx (const struct utmp *, struct utmpx *);
+
+/* Static buffer to store the result.  */
+static struct utmpx buffer;
+
+struct utmpx *
+__getutxent (void)
+{
+  for (;;)
+    {
+      struct utmp *tmp = __getutent ();
+
+      if (tmp == NULL)
+	return NULL;
+
+      if (__utmp_to_utmpx (tmp, &buffer) >= 0)
+	return &buffer;
+
+      /* Skip entries that cannot be converted to utmpx.  */
+    }
+}
+
+weak_alias (__getutxent, getutxent)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/getutxid.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <utmpx.h>
+#include <stddef.h>
+#include <string.h>
+
+extern struct utmpx *__getutxent (void);
+
+struct utmpx *
+getutxid (const struct utmpx *id)
+{
+  switch (id->ut_type)
+    {
+    case INIT_PROCESS:
+    case LOGIN_PROCESS:
+    case USER_PROCESS:
+    case DEAD_PROCESS:
+      for (;;)
+	{
+	  struct utmpx *next = __getutxent ();
+
+	  if (next == NULL)
+	    return NULL;
+
+	  switch (next->ut_type)
+	    {
+	    case INIT_PROCESS:
+	    case LOGIN_PROCESS:
+	    case USER_PROCESS:
+	    case DEAD_PROCESS:
+	      if (strncmp (next->ut_id, id->ut_id, sizeof (id->ut_id)) == 0)
+		return next;
+	      break;
+	    default:
+	      break;
+	    }
+	}
+
+    default:
+      for (;;)
+	{
+	  struct utmpx *next = __getutxent ();
+
+	  if (next == NULL)
+	    return NULL;
+
+	  if (next->ut_type == id->ut_type)
+	    return next;
+	}
+    }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/getutxline.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <utmpx.h>
+#include <stddef.h>
+#include <string.h>
+
+extern struct utmpx *__getutxent (void);
+
+struct utmpx *
+getutxline (const struct utmpx *line)
+{
+  for (;;)
+    {
+      struct utmpx *next = __getutxent ();
+
+      if (next == NULL)
+	return NULL;
+
+      if ((next->ut_type == LOGIN_PROCESS || next->ut_type == USER_PROCESS)
+	  && strncmp (next->ut_line, line->ut_line, __UT_LINESIZE) == 0)
+	return next;
+    }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/pututxline.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <utmpx.h>
+#include <utmp.h>
+#include <stddef.h>
+#include <string.h>
+
+extern int __utmp_to_utmpx (const struct utmp *, struct utmpx *);
+extern int __utmpx_to_utmp (const struct utmpx *, struct utmp *);
+
+/* Static buffer to store the result.  */
+static struct utmpx buffer;
+
+struct utmpx *
+pututxline (const struct utmpx *utmpx)
+{
+  struct utmp tmp;
+
+  if (__utmpx_to_utmp (utmpx, &tmp) >= 0)
+    {
+      struct utmp *tmpres = __pututline (&tmp);
+
+      if (tmpres != NULL)
+	{
+	  if (__utmp_to_utmpx (tmpres, &buffer) >= 0)
+	    return &buffer;
+
+	  /* Hmm.  We wrote a 'struct utmp' that we cannot convert back
+	     to 'struct utmpx'.  Shouldn't happen that often.  */
+	  return NULL;
+	}
+    }
+  return NULL;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/updwtmpx.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1998, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <utmpx.h>
+#include <utmp.h>
+
+extern int __utmpx_to_utmp (const struct utmpx *, struct utmp *);
+
+void
+updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
+{
+  struct utmp tmp;
+
+  if (__utmpx_to_utmp (utmpx, &tmp) >= 0)
+    __updwtmp (wtmpx_file, &tmp);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/utmp-equal.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1996-1999,2000-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <string.h>
+#include <utmp.h>
+
+#include <utmp-private.h>
+
+/* Test whether two entries match.  */
+static int
+__utmp_equal (const struct utmp *entry, const struct utmp *match)
+{
+  /* This implementation is consistent with the __utmp_to_utmpx function.  */
+  return
+    (!((entry->ut_line[0] == '\0' && entry->ut_name[0] == '\0'
+	&& entry->ut_host[0] == '\0')
+       || ((entry->ut_line[0] == '~' || entry->ut_line[0] == '{'
+	    || entry->ut_line[0] == '|')
+	   && entry->ut_line[1] == '\0'))
+     &&
+     !((match->ut_line[0] == '\0' && match->ut_name[0] == '\0'
+	&& match->ut_host[0] == '\0')
+       || ((match->ut_line[0] == '~' || match->ut_line[0] == '{'
+	    || match->ut_line[0] == '|')
+	   && match->ut_line[1] == '\0'))
+     &&
+#if _HAVE_UT_ID - 0
+     (entry->ut_id[0] && match->ut_id[0]
+      ? strncmp (entry->ut_id, match->ut_id, sizeof match->ut_id) == 0
+      : strncmp (entry->ut_line, match->ut_line, sizeof match->ut_line) == 0)
+#else
+     strncmp (entry->ut_line, match->ut_line, sizeof match->ut_line) == 0
+#endif
+     );
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/utmp_file.c
@@ -0,0 +1 @@
+#include <login/utmp_file.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-compat/utmpconv.c
@@ -0,0 +1,227 @@
+/* Convert between 'struct utmp' and 'struct utmx'.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* We reuse the 'struct utmp' file format also for 'struct utmpx' records.
+   The mapping from 'struct utmp' to 'struct utmpx' is injective; the
+   reverse mapping succeeds only when common conventions are respected.  */
+
+#include <utmp.h>
+#include <utmpx.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Compare two 'struct utmpx' records.  */
+int
+__utmpx_equal (const struct utmpx *u1, const struct utmpx *u2)
+{
+  return (u1->ut_type == u2->ut_type)
+	 && (u1->ut_pid == u2->ut_pid)
+	 && (strncmp (u1->ut_line, u2->ut_line, __UT_LINESIZE) == 0)
+	 && (strncmp (u1->ut_id, u2->ut_id, sizeof (u1->ut_id)) == 0)
+	 && (strncmp (u1->ut_user, u2->ut_user, __UT_NAMESIZE) == 0)
+	 && (strncmp (u1->ut_host, u2->ut_host, __UT_HOSTSIZE) == 0)
+	 && (u1->ut_exit.e_termination == u2->ut_exit.e_termination)
+	 && (u1->ut_exit.e_exit == u2->ut_exit.e_exit)
+	 && (u1->ut_session == u2->ut_session)
+	 && (u1->ut_tv.tv_sec == u2->ut_tv.tv_sec)
+	 && (u1->ut_tv.tv_usec == u2->ut_tv.tv_usec)
+	 && (memcmp (u1->ut_addr_v6, u2->ut_addr_v6, sizeof (u1->ut_addr_v6))
+	     == 0);
+}
+
+int
+__utmp_to_utmpx (const struct utmp *u, struct utmpx *ux)
+{
+  memset (ux, '\0', sizeof (struct utmpx));
+
+  if (u->ut_line[0] == '\0' && u->ut_name[0] == '\0' && u->ut_host[0] == '\0')
+    {
+      ux->ut_type = EMPTY;
+    }
+  else
+    {
+      if (u->ut_line[0] == '~' && u->ut_line[1] == '\0')
+	{
+	  if (strncmp (u->ut_name, "runlevel", UT_NAMESIZE) == 0)
+	    ux->ut_type = RUN_LVL;
+	  else if (strncmp (u->ut_name, "reboot", UT_NAMESIZE) == 0)
+	    ux->ut_type = BOOT_TIME;
+	  else if (strncmp (u->ut_name, "acct", UT_NAMESIZE) == 0)
+	    ux->ut_type = ACCOUNTING;
+	  else
+	    return -1;
+	}
+      else if (u->ut_line[0] == '{' && u->ut_line[1] == '\0')
+	{
+	  if (strncmp (u->ut_name, "date", UT_NAMESIZE) == 0)
+	    ux->ut_type = NEW_TIME;
+	  else
+	    return -1;
+	}
+      else if (u->ut_line[0] == '|' && u->ut_line[1] == '\0')
+	{
+	  if (strncmp (u->ut_name, "date", UT_NAMESIZE) == 0)
+	    ux->ut_type = OLD_TIME;
+	  else
+	    return -1;
+	}
+      else
+	{
+	  if (strncmp (u->ut_name, "INIT", UT_NAMESIZE) == 0)
+	    ux->ut_type = INIT_PROCESS;
+	  else if (strncmp (u->ut_name, "LOGIN", UT_NAMESIZE) == 0)
+	    ux->ut_type = LOGIN_PROCESS;
+	  else if (strncmp (u->ut_name, "", UT_NAMESIZE) == 0)
+	    ux->ut_type = DEAD_PROCESS;
+	  else
+	    ux->ut_type = USER_PROCESS;
+
+	  if (ux->ut_type == LOGIN_PROCESS || ux->ut_type == USER_PROCESS)
+	    strncpy (ux->ut_user, u->ut_name, UT_NAMESIZE);
+
+	  if (strncmp (u->ut_line, "tty", 3) == 0)
+	    {
+	      strncpy (ux->ut_line, u->ut_line, UT_LINESIZE);
+	      strncpy (ux->ut_id, u->ut_line + 3, sizeof (ux->ut_id));
+	    }
+	  else
+	    {
+	      strncpy (ux->ut_id, u->ut_line, sizeof (ux->ut_id));
+	    }
+	}
+
+      strncpy (ux->ut_host, u->ut_host, UT_HOSTSIZE);
+
+      /* Hack: Recover the ut_pid from the hidden place after the host.  */
+      if (__strnlen (u->ut_host, UT_HOSTSIZE) < UT_HOSTSIZE - 2)
+	{
+	  const char *hidden = u->ut_host + strlen (u->ut_host) + 1;
+
+	  if (hidden[0] != '\0')
+	    {
+	      size_t n = UT_HOSTSIZE - strlen (u->ut_host) - 1;
+	      char buf[UT_HOSTSIZE];
+	      unsigned long pid;
+	      char *endp;
+
+	      strncpy (buf, hidden, n);
+	      buf[n] = '\0';
+
+	      pid = strtoul (buf, &endp, 10);
+	      if (endp != buf && *endp == '\0')
+		ux->ut_pid = pid;
+	    }
+	}
+
+      ux->ut_tv.tv_sec = u->ut_time;
+      ux->ut_tv.tv_usec = 0;
+    }
+
+  return 0;
+}
+
+int
+__utmpx_to_utmp (const struct utmpx *ux, struct utmp *u)
+{
+  char buf[10+1];
+
+  switch (ux->ut_type)
+    {
+    case EMPTY:
+      strncpy (u->ut_line, "", UT_LINESIZE);
+      strncpy (u->ut_name, "", UT_NAMESIZE);
+      strncpy (u->ut_host, "", UT_HOSTSIZE);
+      break;
+
+    case RUN_LVL:
+      strncpy (u->ut_line, "~", UT_LINESIZE);
+      strncpy (u->ut_name, "runlevel", UT_NAMESIZE);
+      strncpy (u->ut_host, ux->ut_host, UT_HOSTSIZE);
+      break;
+
+    case BOOT_TIME:
+      strncpy (u->ut_line, "~", UT_LINESIZE);
+      strncpy (u->ut_name, "reboot", UT_NAMESIZE);
+      strncpy (u->ut_host, ux->ut_host, UT_HOSTSIZE);
+      break;
+
+    case NEW_TIME:
+      strncpy (u->ut_line, "{", UT_LINESIZE);
+      strncpy (u->ut_name, "date", UT_NAMESIZE);
+      strncpy (u->ut_host, ux->ut_host, UT_HOSTSIZE);
+      break;
+
+    case OLD_TIME:
+      strncpy (u->ut_line, "|", UT_LINESIZE);
+      strncpy (u->ut_name, "date", UT_NAMESIZE);
+      strncpy (u->ut_host, ux->ut_host, UT_HOSTSIZE);
+      break;
+
+    case INIT_PROCESS:
+    case LOGIN_PROCESS:
+    case USER_PROCESS:
+    case DEAD_PROCESS:
+      if (ux->ut_line[0] != '\0')
+	strncpy (u->ut_line, ux->ut_line, UT_LINESIZE);
+      else
+	strncpy (u->ut_line, ux->ut_id, sizeof (ux->ut_id));
+      switch (ux->ut_type)
+	{
+	case INIT_PROCESS:
+	  strncpy (u->ut_name, "INIT", UT_NAMESIZE);
+	  break;
+	case LOGIN_PROCESS:
+	  strncpy (u->ut_name, "LOGIN", UT_NAMESIZE);
+	  break;
+	case USER_PROCESS:
+	  strncpy (u->ut_name, ux->ut_user, UT_NAMESIZE);
+	  break;
+	case DEAD_PROCESS:
+	  strncpy (u->ut_name, "", UT_NAMESIZE);
+	  break;
+	}
+      strncpy (u->ut_host, ux->ut_host, UT_HOSTSIZE);
+      break;
+
+    case ACCOUNTING:
+      strncpy (u->ut_line, "~", UT_LINESIZE);
+      strncpy (u->ut_name, "acct", UT_NAMESIZE);
+      strncpy (u->ut_host, ux->ut_host, UT_HOSTSIZE);
+      break;
+
+    default:
+      return -1;
+    }
+
+  u->ut_time = ux->ut_tv.tv_sec;
+
+  /* Hack: Put the ut_pid at a hidden place where there is likely room.  */
+  if (ux->ut_pid != 0)
+    {
+      size_t room = UT_HOSTSIZE - strlen (u->ut_host) - 1;
+
+      sprintf (buf, "%lu", (unsigned long) ux->ut_pid);
+      if (strlen (buf) <= room)
+	strncpy (u->ut_host + strlen (u->ut_host) + 1, buf, room);
+    }
+
+  return 0;
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/utmp-utmpx/utmp_file.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/utmp_file.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/wait.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/wait.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/wait3.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/wait3.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/waitid.c
@@ -0,0 +1,108 @@
+/* 
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <shlib-compat.h>
+#include <stddef.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/wait.h>
+#include <sysdep.h>
+
+extern int __syscall_wait6 (idtype_t itype, int64_t id,
+			    int *status, int options,
+			    struct rusage *rusage, siginfo_t *infop);
+libc_hidden_proto (__syscall_wait6)
+
+
+#define DO_WAITID simulated_waitid
+static int simulated_waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options);
+
+
+#if !defined __ASSUME_WAIT6
+static int __have_wait6;
+#endif
+
+static inline int
+do_waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options)
+{
+  int ret;
+  int status;
+#ifndef __ASSUME_WAIT6
+  if (__have_wait6 >= 0)
+#endif
+  {
+      ret = INLINE_SYSCALL (wait6, 6, idtype, id, &status, options, NULL, infop);
+      
+      if (ret == 0 && infop != NULL)
+      {
+          memset(infop, 0, sizeof(*infop));
+      }
+      if (ret >= 0)
+          return 0;
+#ifndef __ASSUME_WAIT6
+      if (errno == ENOSYS)
+      {
+          __have_wait6 = -1;
+      }
+      else
+#endif
+      {
+          return ret;
+      }
+   }
+   return simulated_waitid(idtype, id, infop, options);
+}
+
+ 
+#define waitid __unused_waitid_alias
+#include <sysdeps/posix/waitid.c>
+#undef waitid
+
+versioned_symbol (libc, __waitid, waitid, GLIBC_2_18);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_18)
+
+/* it used to be: */
+
+#define OLD_P_ALL	0
+#define OLD_P_PID	1
+#define OLD_P_PGID	2
+
+int
+__waitid_old (idtype_t oldtype, id_t id, siginfo_t *infop, int options)
+{
+  idtype_t newtype;
+
+  switch (oldtype)
+  {
+      case OLD_P_ALL:
+          newtype = P_ALL;
+      break;
+      case OLD_P_PID:
+          newtype = P_PID;
+      break;
+      case OLD_P_PGID:
+          newtype = P_PGID;
+      break;
+      default:
+          newtype = oldtype;
+   }
+  return __waitid(newtype, id, infop, options);
+}
+compat_symbol (libc, __waitid_old, waitid, GLIBC_2_1);
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/waitpid.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 1991,95,96,97,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <sys/wait.h>
+#include <sys/types.h>
+#include <stddef.h>
+#include <sysdep-cancel.h>
+
+/* Wait for a child matching PID to die.
+   If PID is greater than 0, match any process whose process ID is PID.
+   If PID is (pid_t) -1, match any process.
+   If PID is (pid_t) 0, match any process with the
+   same process group as the current process.
+   If PID is less than -1, match any process whose
+   process group is the absolute value of PID.
+   If the WNOHANG bit is set in OPTIONS, and that child
+   is not already dead, return (pid_t) 0.  If successful,
+   return PID and store the dead child's status in STAT_LOC.
+   Return (pid_t) -1 for errors.  If the WUNTRACED bit is set in OPTIONS,
+   return status for stopped children; otherwise don't.  */
+pid_t
+__libc_waitpid (pid_t pid, int *stat_loc, int options)
+{
+  if (SINGLE_THREAD_P)
+  {
+      return INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
+  }
+
+  int oldtype = LIBC_CANCEL_ASYNC ();
+
+  int result = INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
+
+  LIBC_CANCEL_RESET (oldtype);
+
+  return result;
+}
+
+weak_alias (__libc_waitpid, __waitpid)
+libc_hidden_weak (__waitpid)
+weak_alias (__libc_waitpid, waitpid)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/writev.c
@@ -0,0 +1,57 @@
+/* writev for FreeBSD.
+   Copyright (C) 1997-1998, 2000, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/param.h>
+#include <sys/uio.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+extern ssize_t __syscall_writev (int, const struct iovec *, int);
+
+static ssize_t __atomic_writev_replacement (int, const struct iovec *,
+					    int) internal_function;
+
+ssize_t
+__writev (int fd, const struct iovec *vector, int count)
+{
+  if (count <= UIO_MAXIOV)
+  {
+    if (SINGLE_THREAD_P)
+      return INLINE_SYSCALL (writev, 3, fd, vector, count);
+
+    int oldtype = LIBC_CANCEL_ASYNC ();
+    ssize_t result =  INLINE_SYSCALL (writev, 3, fd, vector, count);
+    LIBC_CANCEL_RESET (oldtype);
+    return result;
+
+  }
+  else
+    return __atomic_writev_replacement (fd, vector, count);
+}
+weak_alias (__writev, writev)
+
+#undef weak_alias
+#define weak_alias(a,b)
+#define __writev static internal_function __atomic_writev_replacement
+#include <sysdeps/posix/writev.c>
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86/Makefile
@@ -0,0 +1,9 @@
+# We don't need any header files.
+abi-includes :=
+
+abi-variants := 32 64
+
+abi-32-options := -D__i386__ -U__x86_64__
+abi-32-condition := !defined __x86_64__
+abi-64-options := -U__i386__ -D__x86_64__ -U__ILP32__ -D__LP64__
+abi-64-condition := defined __x86_64__ && defined __LP64__
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86/fbtl/bits/pthreadtypes.h
@@ -0,0 +1,240 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_PTHREADTYPES_H
+#define _BITS_PTHREADTYPES_H	1
+
+#include <bits/wordsize.h>
+
+#ifdef __x86_64__
+# if __WORDSIZE == 64
+#  define __SIZEOF_PTHREAD_ATTR_T 56
+#  define __SIZEOF_PTHREAD_MUTEX_T 40
+#  define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#  define __SIZEOF_PTHREAD_COND_T 48
+#  define __SIZEOF_PTHREAD_CONDATTR_T 4
+#  define __SIZEOF_PTHREAD_RWLOCK_T 56
+#  define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#  define __SIZEOF_PTHREAD_BARRIER_T 32
+#  define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+# else
+#  define __SIZEOF_PTHREAD_ATTR_T 32
+#  define __SIZEOF_PTHREAD_MUTEX_T 32
+#  define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#  define __SIZEOF_PTHREAD_COND_T 48
+#  define __SIZEOF_PTHREAD_CONDATTR_T 4
+#  define __SIZEOF_PTHREAD_RWLOCK_T 44
+#  define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#  define __SIZEOF_PTHREAD_BARRIER_T 20
+#  define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+# endif
+#else
+# define __SIZEOF_PTHREAD_ATTR_T 36
+# define __SIZEOF_PTHREAD_MUTEX_T 24
+# define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+# define __SIZEOF_PTHREAD_COND_T 48
+# define __SIZEOF_PTHREAD_CONDATTR_T 4
+# define __SIZEOF_PTHREAD_RWLOCK_T 32
+# define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+# define __SIZEOF_PTHREAD_BARRIER_T 20
+# define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+#endif
+
+
+/* Thread identifiers.  The structure of the attribute type is not
+   exposed on purpose.  */
+typedef unsigned long int pthread_t;
+
+
+union pthread_attr_t
+{
+  char __size[__SIZEOF_PTHREAD_ATTR_T];
+  long int __align;
+};
+#ifndef __have_pthread_attr_t
+typedef union pthread_attr_t pthread_attr_t;
+# define __have_pthread_attr_t	1
+#endif
+
+
+#ifdef __x86_64__
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+#else
+typedef struct __pthread_internal_slist
+{
+  struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+#endif
+
+
+/* Data structures for mutex handling.  The structure of the attribute
+   type is not exposed on purpose.  */
+typedef union
+{
+  struct __pthread_mutex_s
+  {
+    int __lock;
+    unsigned int __count;
+    int __owner;
+#ifdef __x86_64__
+    unsigned int __nusers;
+#endif
+    /* KIND must stay at this position in the structure to maintain
+       binary compatibility.  */
+    int __kind;
+#ifdef __x86_64__
+    int __spins;
+    __pthread_list_t __list;
+# define __PTHREAD_MUTEX_HAVE_PREV	1
+#else
+    unsigned int __nusers;
+    __extension__ union
+    {
+      int __spins;
+      __pthread_slist_t __list;
+    };
+#endif
+  } __data;
+  char __size[__SIZEOF_PTHREAD_MUTEX_T];
+  long int __align;
+} pthread_mutex_t;
+
+typedef union
+{
+  char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
+  int __align;
+} pthread_mutexattr_t;
+
+
+/* Data structure for conditional variable handling.  The structure of
+   the attribute type is not exposed on purpose.  */
+typedef union
+{
+  struct
+  {
+    int __lock;
+    unsigned int __futex;
+    __extension__ unsigned long long int __total_seq;
+    __extension__ unsigned long long int __wakeup_seq;
+    __extension__ unsigned long long int __woken_seq;
+    void *__mutex;
+    unsigned int __nwaiters;
+    unsigned int __broadcast_seq;
+  } __data;
+  char __size[__SIZEOF_PTHREAD_COND_T];
+  __extension__ long long int __align;
+} pthread_cond_t;
+
+typedef union
+{
+  char __size[__SIZEOF_PTHREAD_CONDATTR_T];
+  int __align;
+} pthread_condattr_t;
+
+
+/* Keys for thread-specific data */
+typedef unsigned int pthread_key_t;
+
+
+/* Once-only execution */
+typedef int pthread_once_t;
+
+
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
+/* Data structure for read-write lock variable handling.  The
+   structure of the attribute type is not exposed on purpose.  */
+typedef union
+{
+# ifdef __x86_64__
+  struct
+  {
+    int __lock;
+    unsigned int __nr_readers;
+    unsigned int __readers_wakeup;
+    unsigned int __writer_wakeup;
+    unsigned int __nr_readers_queued;
+    unsigned int __nr_writers_queued;
+    int __writer;
+    int __shared;
+    unsigned long int __pad1;
+    unsigned long int __pad2;
+    /* FLAGS must stay at this position in the structure to maintain
+       binary compatibility.  */
+    unsigned int __flags;
+# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED	1
+  } __data;
+# else
+  struct
+  {
+    int __lock;
+    unsigned int __nr_readers;
+    unsigned int __readers_wakeup;
+    unsigned int __writer_wakeup;
+    unsigned int __nr_readers_queued;
+    unsigned int __nr_writers_queued;
+    /* FLAGS must stay at this position in the structure to maintain
+       binary compatibility.  */
+    unsigned char __flags;
+    unsigned char __shared;
+    unsigned char __pad1;
+    unsigned char __pad2;
+    int __writer;
+  } __data;
+# endif
+  char __size[__SIZEOF_PTHREAD_RWLOCK_T];
+  long int __align;
+} pthread_rwlock_t;
+
+typedef union
+{
+  char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
+  long int __align;
+} pthread_rwlockattr_t;
+#endif
+
+
+#ifdef __USE_XOPEN2K
+/* POSIX spinlock data type.  */
+typedef volatile int pthread_spinlock_t;
+
+
+/* POSIX barriers data type.  The structure of the type is
+   deliberately not exposed.  */
+typedef union
+{
+  char __size[__SIZEOF_PTHREAD_BARRIER_T];
+  long int __align;
+} pthread_barrier_t;
+
+typedef union
+{
+  char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
+  int __align;
+} pthread_barrierattr_t;
+#endif
+
+
+#ifndef __x86_64__
+/* Extra attributes for the cleanup functions.  */
+# define __cleanup_fct_attribute __attribute__ ((__regparm__ (1)))
+#endif
+
+#endif	/* bits/pthreadtypes.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86/fbtl/bits/semaphore.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 2002-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SEMAPHORE_H
+# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 64
+# define __SIZEOF_SEM_T	32
+#else
+# define __SIZEOF_SEM_T	16
+#endif
+
+
+/* Value returned if `sem_open' failed.  */
+#define SEM_FAILED      ((sem_t *) 0)
+
+
+typedef union
+{
+  char __size[__SIZEOF_SEM_T];
+  long int __align;
+} sem_t;
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86/fbtl/lowlevellock.h
@@ -0,0 +1,38 @@
+/* Copyright (C) 2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include_next <lowlevellock.h>
+
+#ifndef __ASSEMBLER__
+  /* Delay in spinlock loop.  */
+# define BUSY_WAIT_NOP	asm ("rep; nop")
+# ifndef LOCK_INSTR
+#  ifdef UP
+#   define LOCK_INSTR	/* nothing */
+#  else
+#   define LOCK_INSTR "lock;"
+#  endif
+# endif
+#else
+# ifndef LOCK
+#  ifdef UP
+#   define LOCK
+#  else
+#   define LOCK lock
+#  endif
+# endif
+#endif  /* !__ASSEMBLER__ */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/Implies
@@ -0,0 +1 @@
+unix/bsd/bsd4.4/kfreebsd/x86
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/Makefile
@@ -0,0 +1,20 @@
+# The default ABI is 64.
+default-abi := 64
+
+32bit-predefine = __i386__
+64bit-predefine = __x86_64__
+
+# Additional header files to be installed in $prefix/include:
+
+ifeq ($(subdir),misc)
+sysdep_headers += \
+ sys/io.h \
+ sys/perm.h
+endif
+
+# Additional functions, and particular system calls:
+
+ifeq ($(subdir),misc)
+# For <sys/io.h> and <sys/perm.h>.
+sysdep_routines += iopl ioperm
+endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/Versions
@@ -0,0 +1,8 @@
+libc {
+  GLIBC_2.3.4 {
+    iopl;
+  }
+  GLIBC_2.10 {
+    ioperm;
+  }
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/____longjmp_chk.S
@@ -0,0 +1,7 @@
+/* Jump to the position specified by ENV, causing the
+   setjmp call there to return VAL, or 1 if VAL is 0.
+   void __longjmp (__jmp_buf env, int val).  */
+      
+#warning longjmp_chk unimplemented
+#define __longjmp ____longjmp_chk
+#include<__longjmp.S>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/bits/mcontext.h
@@ -0,0 +1,167 @@
+/* Machine-dependent processor state structure for FreeBSD.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.  x86_64 version.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SYS_UCONTEXT_H
+# error "Never use <bits/mcontext.h> directly; include <sys/ucontext.h> instead."
+#endif
+
+/*-
+ * Copyright (c) 2003 Peter Wemm
+ * Copyright (c) 1999 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * based on $FreeBSD: src/sys/amd64/include/ucontext.h,v 1.18 2003/11/08 04:39:22 peter Exp $
+ */
+
+#ifdef __i386__
+
+/* Whole processor state.  */
+typedef struct
+  {
+    /*
+     * The first 20 fields must match the definition of
+     * sigcontext. So that we can support sigcontext
+     * and ucontext_t at the same time.
+     */
+
+    int mc_onstack;		/* Nonzero if running on sigstack.  */
+
+    /* Segment registers.  */
+    int mc_gs;
+    int mc_fs;
+    int mc_es;
+    int mc_ds;
+
+    /* "General" registers.  These members are in the order that the i386
+       `pusha' and `popa' instructions use (`popa' ignores %esp).  */
+    int mc_edi;
+    int mc_esi;
+    int mc_ebp;
+    int mc_isp;			/* Not used; sc_esp is used instead.  */
+    int mc_ebx;
+    int mc_edx;
+    int mc_ecx;
+    int mc_eax;
+
+    int mc_trapno;
+    int mc_err;
+
+    int mc_eip;			/* Instruction pointer.  */
+    int mc_cs;			/* Code segment register.  */
+
+    int mc_efl;			/* Processor flags.  */
+
+    int mc_esp;			/* This stack pointer is used.  */
+    int mc_ss;			/* Stack segment register.  */
+
+    int mc_len;			/* sizeof(mcontext_t) */
+#define	_MC_FPFMT_NODEV		0x10000	/* device not present or configured */
+#define	_MC_FPFMT_387		0x10001
+#define	_MC_FPFMT_XMM		0x10002
+    int mc_fpformat;
+#define	_MC_FPOWNED_NONE	0x20000	/* FP state not used */
+#define	_MC_FPOWNED_FPU		0x20001	/* FP state came from FPU */
+#define	_MC_FPOWNED_PCB		0x20002	/* FP state came from PCB */
+    int mc_ownedfp;
+    int mc_spare1[1];		/* align next field to 16 bytes */
+    /*
+     * See <machine/npx.h> for the internals of mc_fpstate[].
+     */
+    int mc_fpstate[128] __attribute__((aligned(16)));
+    int mc_spare2[8];
+  } mcontext_t;
+
+#else
+
+/* Whole processor state.  */
+typedef struct
+  {
+    /*
+     * The first 20 fields must match the definition of
+     * sigcontext. So that we can support sigcontext
+     * and ucontext_t at the same time.
+     */
+    long mc_onstack;		/* XXX - sigcontext compat. */
+    long mc_rdi;			/* machine state (struct trapframe) */
+    long mc_rsi;
+    long mc_rdx;
+    long mc_rcx;
+    long mc_r8;
+    long mc_r9;
+    long mc_rax;
+    long mc_rbx;
+    long mc_rbp;
+    long mc_r10;
+    long mc_r11;
+    long mc_r12;
+    long mc_r13;
+    long mc_r14;
+    long mc_r15;
+    long mc_trapno;
+    long mc_addr;
+    long mc_flags;
+    long mc_err;
+    long mc_rip;
+    long mc_cs;
+    long mc_rflags;
+    long mc_rsp;
+    long mc_ss;
+
+    long mc_len;			/* sizeof(mcontext_t) */
+#define	_MC_FPFMT_NODEV		0x10000	/* device not present or configured */
+#define	_MC_FPFMT_XMM		0x10002
+    long mc_fpformat;
+#define	_MC_FPOWNED_NONE	0x20000	/* FP state not used */
+#define	_MC_FPOWNED_FPU		0x20001	/* FP state came from FPU */
+#define	_MC_FPOWNED_PCB		0x20002	/* FP state came from PCB */
+    long mc_ownedfp;
+     /*
+      * See <machine/fpu.h> for the internals of mc_fpstate[].
+      */
+    long mc_fpstate[64] __attribute__((aligned(16)));
+    long mc_spare[8];
+} mcontext_t;
+
+#endif
+
+/* Traditional BSD names for some members.  */
+#define mc_eflags	mc_efl
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/bits/sigcontext.h
@@ -0,0 +1,147 @@
+/* Machine-dependent signal context structure for FreeBSD.  i386 version.
+   Copyright (C) 1991-1992,1994,1997,2001-2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef _BITS_SIGCONTEXT_H
+#define _BITS_SIGCONTEXT_H  1
+
+#ifdef __i386__
+
+/* State of this thread when the signal was taken.
+   The unions below are for compatibility with Linux (whose sigcontext
+   components don't have sc_ prefix) */
+__extension__ struct sigcontext
+  {
+    __sigset_t 	sc_mask;		/* Blocked signals to restore.  */
+    int 	sc_onstack;		/* Nonzero if running on sigstack.  */
+
+    /* Segment registers.  */
+    union { int sc_gs; int gs; };
+    union { int sc_fs; int fs; };
+    union { int sc_es; int es; };
+    union { int sc_ds; int ds; };
+
+    /* "General" registers.  These members are in the order that the i386
+       `pusha' and `popa' instructions use (`popa' ignores %esp).  */
+    union { int sc_edi; int edi; };
+    union { int sc_esi; int esi; };
+    union { int sc_ebp; int ebp; };
+    union { int sc_isp; int isp; };		/* Not used; sc_esp is used instead.  */
+    union { int sc_ebx; int ebx; };
+    union { int sc_edx; int edx; };
+    union { int sc_ecx; int ecx; };
+    union { int sc_eax; int eax; };
+
+    union { int sc_trapno; int trapno; };
+    union { int sc_err; int err; };
+
+    union { int sc_eip; int eip; };		/* Instruction pointer.  */
+    union { int sc_cs; int cs; };		/* Code segment register.  */
+
+    union { int sc_efl; int eflags; }; 		/* Processor flags.  */
+
+    union { int sc_esp; int esp; };		/* This stack pointer is used.  */
+    union { int sc_ss; int ss; };		/* Stack segment register.  */
+
+    int     sc_len;                 /* sizeof(mcontext_t) */
+    /*
+     * XXX - See <machine/ucontext.h> and <machine/npx.h> for
+     *       the following fields.
+     */
+    int     sc_fpformat;
+    int     sc_ownedfp;
+    int     sc_spare1[1];
+    int     sc_fpstate[128] __attribute__((aligned(16)));
+    int     sc_spare2[8];
+  };
+
+/* Traditional BSD names for some members.  */
+#define sc_sp		sc_esp		/* Stack pointer.  */
+#define sc_fp		sc_ebp		/* Frame pointer.  */
+#define sc_pc		sc_eip		/* Process counter.  */
+#define sc_ps		sc_efl
+#define sc_eflags	sc_efl
+
+#if 1 /* FIXME: These need verification.  */
+
+/* Codes for SIGILL.  */
+#define ILL_PRIVIN_FAULT	1
+#define ILL_ALIGN_FAULT		14
+#define ILL_FPOP_FAULT		24
+
+/* Codes for SIGBUS.  */
+#define BUS_PAGE_FAULT		12
+#define BUS_SEGNP_FAULT		26
+#define BUS_STK_FAULT		27
+#define BUS_SEGM_FAULT		29
+
+#endif
+
+#else
+
+__extension__ struct sigcontext
+  {
+    __sigset_t 	sc_mask;		/* Blocked signals to restore.  */
+    long 	sc_onstack;		/* Nonzero if running on sigstack.  */
+    union { long sc_rdi; long rdi;};
+    union { long sc_rsi; long rsi;};
+    union { long sc_rdx; long rdx;};
+    union { long sc_rcx; long rcx;};
+    union { long sc_r8; long r8;};
+    union { long sc_r9; long r9;};
+    union { long sc_rax; long rax;};
+    union { long sc_rbx; long rbx;};
+    union { long sc_rbp; long rbp;};
+    union { long sc_r10; long r10;};
+    union { long sc_r11; long r11;};
+    union { long sc_r12; long r12;};
+    union { long sc_r13; long r13;};
+    union { long sc_r14; long r14;};
+    union { long sc_r15; long r15;};
+    union { long sc_trapno; long trapno;};
+    union { long sc_addr; long addr;};
+    union { long sc_flags; long flags;};
+    union { long sc_err; long err;};
+    union { long sc_rip; long rip;};
+    union { long sc_cs; long cs;};
+    union { long sc_rflags; long rflags;};
+    union { long sc_rsp; long rsp;};
+    union { long sc_ss; long ss;};
+    long	sc_len;        /* sizeof(mcontext_t) */
+    /*
+     * XXX - See <machine/ucontext.h> and <machine/fpu.h> for
+     *       the following fields.
+     */
+    long	sc_fpformat;
+    long	sc_ownedfp;
+    long	sc_fpstate[64] __attribute__((aligned(16)));
+    long	sc_spare[8];
+  };
+
+/* Traditional BSD names for some members.  */
+#define sc_sp           sc_rsp          /* Stack pointer.  */
+#define sc_fp           sc_rbp          /* Frame pointer.  */
+#define sc_pc           sc_rip          /* Process counter.  */
+
+#endif
+
+#endif /* _BITS_SIGCONTEXT_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:l
+blkcnt_t:l
+blksize_t:j
+caddr_t:Pc
+clockid_t:i
+clock_t:i
+daddr_t:l
+dev_t:j
+fd_mask:l
+fsblkcnt64_t:m
+fsblkcnt_t:m
+fsfilcnt64_t:m
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:m
+ino_t:j
+int16_t:s
+int32_t:i
+int64_t:l
+int8_t:a
+intptr_t:l
+key_t:l
+loff_t:l
+mode_t:t
+nlink_t:t
+off64_t:l
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:l
+register_t:l
+rlim64_t:l
+rlim_t:l
+sigset_t:10__sigset_t
+size_t:m
+socklen_t:j
+ssize_t:l
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:m
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:m
+useconds_t:j
+ushort:t
+u_short:t
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/dl-cache.h
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/x86_64/dl-cache.h>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/dl-machine.h
@@ -0,0 +1,119 @@
+/* Machine-dependent ELF dynamic relocation inline functions.  FreeBSD/amd64 version.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include_next <dl-machine.h>
+
+#undef RTLD_START
+
+/* Initial entry point code for the dynamic linker.
+   The C function `_dl_start' is the real entry point;
+   its return value is the user program's entry point.  */
+#define RTLD_START asm ("\n\
+.text\n\
+	.align 16\n\
+.globl _start\n\
+# we dont use it: .globl _dl_start_user\n\
+_start:\n\
+	# align stack.\n\
+	andq $-16, %rsp\n\
+	# save argument pointer.\n\
+	movq %rdi, %r13\n\
+	call _dl_start\n\
+# we dont use it: _dl_start_user:\n\
+	# Save the user entry point address in %r12.\n\
+	movq %rax, %r12\n\
+	# See if we were run as a command with the executable file\n\
+	# name as an extra leading argument.\n\
+	movl _dl_skip_args(%rip), %eax\n\
+	# get the original argument count.\n\
+	movq 0(%r13), %rdx\n\
+	# Adjust the pointer to skip _dl_skip_args words.\n\
+	leaq (%r13,%rax,8), %r13\n\
+	# Subtract _dl_skip_args from argc.\n\
+	subl %eax, %edx\n\
+	# Put argc on adjusted place\n\
+	movq %rdx, 0(%r13)\n\
+	# Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)\n\
+	# argc -> rsi\n\
+	movq %rdx, %rsi\n\
+	# _dl_loaded -> rdi\n\
+	movq _rtld_local(%rip), %rdi\n\
+	# env -> rcx\n\
+	leaq 16(%r13,%rdx,8), %rcx\n\
+	# argv -> rdx\n\
+	leaq 8(%r13), %rdx\n\
+	# Clear %rbp to mark outermost frame obviously even for constructors.\n\
+	xorl %ebp, %ebp\n\
+	# Call the function to run the initializers.\n\
+	call _dl_init@PLT\n\
+	# Pass our finalizer function to the user in %rdx, as per ELF ABI draft.\n\
+	leaq _dl_fini(%rip), %rdx\n\
+	# And make sure %rdi points to argc stored on the stack.\n\
+	movq %r13, %rdi\n\
+	# Pass finalizer function also in %rsi, as per C calling convention.\n\
+	movq %rdx, %rsi\n\
+	# Jump to the user's entry point.\n\
+	jmp *%r12\n\
+.previous\n\
+");
+
+#if 0
+Under FreeBSD:
+#define AT_EXECPATH     15      /* Path to the executable. */
+
+Under Linux:
+#define AT_PLATFORM     15      /* String identifying platform.  */
+
+Filled entries from kernel:
+
+        if (args->execfd != -1)
+                AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd);
+        AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);    
+        AUXARGS_ENTRY(pos, AT_PHENT, args->phent);  
+        AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum);  
+        AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz);
+        AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
+        AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
+        AUXARGS_ENTRY(pos, AT_BASE, args->base);
+        if (imgp->execpathp != 0)
+                AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp);
+        AUXARGS_ENTRY(pos, AT_NULL, 0);
+                                                                                                                
+#endif
+
+#ifndef _DL_MACHINE_KFREEBSD
+#define _DL_MACHINE_KFREEBSD
+
+static inline void __attribute__ ((unused))
+dl_platform_kfreebsd_x86_64_init (void)
+{
+	/* This calls cpuid and and fills dl_x86_cpu_features */
+	DL_PLATFORM_INIT;
+
+	/* we don't have reasonable AT_PLATFORM from kernel
+	   use cpuid to guess AT_HWCAP */
+	GLRO(dl_hwcap) = GLRO(dl_x86_cpu_features).cpuid[COMMON_CPUID_INDEX_1].edx;
+	GLRO(dl_platform) = ELF_MACHINE_NAME;
+}
+
+#undef  DL_PLATFORM_INIT
+#define DL_PLATFORM_INIT dl_platform_kfreebsd_x86_64_init ()
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/dl-procinfo.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/dl-procinfo.h
@@ -0,0 +1,5 @@
+#if IS_IN (ldconfig)
+# include <sysdeps/unix/bsd/bsd4.4/kfreebsd/i386/dl-procinfo.h>
+#else
+# include <sysdeps/generic/dl-procinfo.h>
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/exit-thread.h
@@ -0,0 +1,49 @@
+/* Call to terminate the current thread.  GNU/kFreeBSD x86-64 version
+   Copyright (C) 2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* This causes the current thread to exit, without affecting other
+   threads in the process if there are any.  If there are no other
+   threads left, then this has the effect of _exit (0).  */
+
+static inline void __attribute__ ((noreturn, always_inline, unused))
+__exit_thread (void)
+{
+  /* Doing this in a loop is mostly just to satisfy the compiler that the
+     function really qualifies as noreturn.  It also means that in some
+     pathological situation where the system call does not get made or does
+     not work, the thread will simply spin rather than running off the end
+     of the caller and doing unexpectedly strange things.  */
+  while (1)
+    {
+      asm volatile (
+	  "movq %%fs:0, %%rdi\n\t"
+	  "addq %0, %%rdi\n\t"    /* should be KTID, but they are at the same place anyway */
+	  "movl %1, %%eax\n\t"
+	  "syscall\n\t"
+	  /* It does return only for last thread of process */
+	  "movl %2, %%eax\n\t"
+	  "xorl %%edi, %%edi\n\t"
+	  "syscall\n\t"
+	  :
+	  : "i" (TID), "i" (SYS_ify(thr_exit)), "i" (SYS_ify(exit))
+	  : "memory", "cc", "cx", "dx", "r8", "r9", "r10", "r11");
+    }
+}
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fbtl/Implies
@@ -0,0 +1 @@
+unix/bsd/bsd4.4/kfreebsd/x86/fbtl
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fbtl/asm/prctl.h
@@ -0,0 +1 @@
+/* placeholder to linuxish sysdeps/x86_64/pt-machine.h happy */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fbtl/cancellation.S
@@ -0,0 +1,119 @@
+/* Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <tcb-offsets.h>
+#include <kernel-features.h>
+#include "lowlevellock.h"
+
+#if IS_IN (libpthread)
+# ifdef SHARED
+#  define __pthread_unwind __GI___pthread_unwind
+# endif
+#else
+# ifndef SHARED
+	.weak __pthread_unwind
+# endif
+#endif
+
+
+/* It is crucial that the functions in this file don't modify registers
+   other than %rax and %r11.  The syscall wrapper code depends on this
+   because it doesn't explicitly save the other registers which hold
+   relevant values.  */
+	.text
+
+	.hidden __pthread_enable_asynccancel
+ENTRY(__pthread_enable_asynccancel)
+	movl	%fs:CANCELHANDLING, %eax
+2:	movl	%eax, %r11d
+	orl	$TCB_CANCELTYPE_BITMASK, %r11d
+	cmpl	%eax, %r11d
+	je	1f
+
+	lock
+	cmpxchgl %r11d, %fs:CANCELHANDLING
+	jnz	2b
+
+	andl	$(TCB_CANCELSTATE_BITMASK|TCB_CANCELTYPE_BITMASK|TCB_CANCELED_BITMASK|TCB_EXITING_BITMASK|TCB_CANCEL_RESTMASK|TCB_TERMINATED_BITMASK), %r11d
+	cmpl	$(TCB_CANCELTYPE_BITMASK|TCB_CANCELED_BITMASK), %r11d
+	je	3f
+
+1:	ret
+
+3:	subq	$8, %rsp
+	cfi_adjust_cfa_offset(8)
+	LP_OP(mov) $TCB_PTHREAD_CANCELED, %fs:RESULT
+	lock
+	orl	$TCB_EXITING_BITMASK, %fs:CANCELHANDLING
+	mov	%fs:CLEANUP_JMP_BUF, %RDI_LP
+#ifdef SHARED
+	call	__pthread_unwind@PLT
+#else
+	call	__pthread_unwind
+#endif
+	hlt
+END(__pthread_enable_asynccancel)
+
+
+	.hidden __pthread_disable_asynccancel
+ENTRY(__pthread_disable_asynccancel)
+	testl	$TCB_CANCELTYPE_BITMASK, %edi
+	jnz	1f
+
+	movl	%fs:CANCELHANDLING, %eax
+2:	movl	%eax, %r11d
+	andl	$~TCB_CANCELTYPE_BITMASK, %r11d
+	lock
+	cmpxchgl %r11d, %fs:CANCELHANDLING
+	jnz	2b
+
+	movl	%r11d, %eax
+3:	andl	$(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
+	cmpl	$TCB_CANCELING_BITMASK, %eax
+	je	4f
+1:	ret
+
+# define UMTX_OP_WAIT_UINT_PRIVATE 15
+# define LOAD_PRIVATE_FUTEX_WAIT(reg) \
+	movl	$UMTX_OP_WAIT_UINT_PRIVATE, reg
+
+	/* Performance doesn't matter in this loop.  We will
+	   delay until the thread is canceled.  And we will unlikely
+	   enter the loop twice.  */
+
+# warning check this:
+	/* 
+           The C-code repeatedy does:
+           lll_futex_wait (&self->cancelhandling, newval, LLL_PRIVATE); 
+           newval = THREAD_GETMEM (self, cancelhandling);
+
+           but the original NPTL code does not fill rdx 
+           with the old value ... 
+        */
+
+4:	mov	%fs:0, %RDI_LP
+	movl	$SYS__umtx_op, %eax
+	xorq	%r8, %r8
+	xorq	%r10, %r10
+	addq	$CANCELHANDLING, %rdi
+	LOAD_PRIVATE_FUTEX_WAIT (%esi)
+	syscall
+	movl	%fs:CANCELHANDLING, %eax
+	jmp	3b
+END(__pthread_disable_asynccancel)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fbtl/libc-cancellation.S
@@ -0,0 +1,21 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define __pthread_enable_asynccancel __libc_enable_asynccancel
+#define __pthread_disable_asynccancel __libc_disable_asynccancel
+#include "cancellation.S"
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fbtl/librt-cancellation.S
@@ -0,0 +1,21 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2009.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define __pthread_enable_asynccancel __librt_enable_asynccancel
+#define __pthread_disable_asynccancel __librt_disable_asynccancel
+#include "cancellation.S"
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fbtl/sysdep-cancel.h
@@ -0,0 +1,111 @@
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <tls.h>
+#ifndef __ASSEMBLER__
+# include <fbtl/pthreadP.h>
+#endif
+
+/* Syscalls with more than 6 arguments are not supported here.  */
+
+#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
+
+/* The code to disable cancellation depends on the fact that the called
+   functions are special.  They don't modify registers other than %rax
+   and %r11 if they return.  Therefore we don't have to preserve other
+   registers around these calls.  */
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args)				      \
+  .text;								      \
+  ENTRY (name)								      \
+    SINGLE_THREAD_P;							      \
+    jne L(pseudo_cancel);						      \
+  .type __##syscall_name##_nocancel,@function;				      \
+  .globl __##syscall_name##_nocancel;					      \
+  __##syscall_name##_nocancel:						      \
+    DO_CALL (syscall_name, args);					      \
+    jb SYSCALL_ERROR_LABEL;						      \
+    ret;								      \
+  .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	      \
+  L(pseudo_cancel):							      \
+    /* We always have to align the stack before calling a function.  */	      \
+    subq $8, %rsp; cfi_adjust_cfa_offset (8);				      \
+    CENABLE								      \
+    /* The return value from CENABLE is argument for CDISABLE.  */	      \
+    movq %rax, (%rsp);							      \
+    DO_CALL (syscall_name, args);					      \
+    popq %rdi; cfi_adjust_cfa_offset(-8);				      \
+    pushfq; cfi_adjust_cfa_offset(8);					      \
+    /* Save %rax since it's the error code from the syscall.  */	      \
+    movq %rax, %rsi;							      \
+    CDISABLE								      \
+    popfq; cfi_adjust_cfa_offset(-8);					      \
+    /* fetch the error code from the syscall.  */			      \
+    movq %rsi, %rax;							      \
+    jb SYSCALL_ERROR_LABEL;						      \
+  L(pseudo_end):							      \
+
+# if IS_IN (libpthread)
+#  define CENABLE	call __pthread_enable_asynccancel;
+#  define CDISABLE	call __pthread_disable_asynccancel;
+#  define __local_multiple_threads __pthread_multiple_threads
+# elif IS_IN (libc)
+#  define CENABLE	call __libc_enable_asynccancel;
+#  define CDISABLE	call __libc_disable_asynccancel;
+#  define __local_multiple_threads __libc_multiple_threads
+# elif IS_IN (librt)
+#  define CENABLE	call __librt_enable_asynccancel;
+#  define CDISABLE	call __librt_disable_asynccancel;
+# else
+#  error Unsupported library
+# endif
+
+# if IS_IN (libpthread) || IS_IN (libc)
+#  ifndef __ASSEMBLER__
+extern int __local_multiple_threads attribute_hidden;
+#   define SINGLE_THREAD_P \
+  __builtin_expect (__local_multiple_threads == 0, 1)
+#  else
+#   define SINGLE_THREAD_P cmpl $0, __local_multiple_threads(%rip)
+#  endif
+
+# else
+
+#  ifndef __ASSEMBLER__
+#   define SINGLE_THREAD_P \
+  __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+				   header.multiple_threads) == 0, 1)
+#  else
+#   define SINGLE_THREAD_P cmpl $0, %fs:MULTIPLE_THREADS_OFFSET
+#  endif
+
+# endif
+
+#elif !defined __ASSEMBLER__
+
+# define SINGLE_THREAD_P (1)
+# define NO_CANCELLATION 1
+
+#endif
+
+#ifndef __ASSEMBLER__
+# define RTLD_SINGLE_THREAD_P \
+  __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+				   header.multiple_threads) == 0, 1)
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fbtl/tls.h
@@ -0,0 +1,73 @@
+/* Definitions for thread-local data handling.  fbtl/x86-64 version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Modification for FreeBSD by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _FREEBSD_TLS_H
+#define _FREEBSD_TLS_H
+
+#include <fbtl/sysdeps/x86_64/tls.h>
+
+#ifndef __ASSEMBLER__
+
+#include <sysarch.h>
+#include <sys/syscall.h>
+
+#if 0
+/* in Linux one; */
+/* Magic for libthread_db to know how to do THREAD_SELF.  */
+# define DB_THREAD_SELF_INCLUDE  <sys/reg.h> /* For the FS constant.  */
+# define DB_THREAD_SELF CONST_THREAD_AREA (64, FS)
+#else
+/* # warning proper FS constant needed */
+# undef DB_THREAD_SELF_INCLUDE
+# undef DB_THREAD_SELF
+# define DB_THREAD_SELF CONST_THREAD_AREA (64, 25)
+#endif
+
+/* Code to initially initialize the thread pointer.  This might need
+   special attention since 'errno' is not yet available and if the
+   operation can cause a failure 'errno' must not be touched.  */
+
+# undef TLS_INIT_TP
+# define TLS_INIT_TP(descr)						      \
+  ({									      \
+    void *_descr = (descr);						      \
+    tcbhead_t *head = _descr;						      \
+    long int _result;							      \
+									      \
+    head->tcb = _descr;							      \
+    /* For now the thread descriptor is at the same address.  */	      \
+    head->self = _descr;						      \
+									      \
+    asm volatile ("syscall"						      \
+		  : "=a" (_result)					      \
+		  : "0" ((unsigned long int) SYS_sysarch),		      \
+		    "D" ((unsigned long int) AMD64_SET_FSBASE),		      \
+		    "S" (&_descr)					      \
+		  : "memory", "cc", "cx", "dx", "r8", "r9", "r10", "r11");    \
+									      \
+    _result ? "cannot set %fs base address for thread-local storage" : 0;     \
+  })
+
+/* in fact this is OS-specific, but we do not have better header for it */
+#define NEED_STACK_SIZE_FOR_PTH_CREATE 1
+
+#endif /* __ASSEMBLER__ */
+
+#endif	/* tls.h */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fts.c
@@ -0,0 +1,3 @@
+/* On GNU/kFreeBSD x86_64, ino_t and ino64_t have different sizes, so
+   fts and fts64 have to be different functions.  */
+#include <io/fts.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/fts64.c
@@ -0,0 +1,3 @@
+/* On GNU/kFreeBSD x86_64, ino_t and ino64_t have different sizes, so
+   fts and fts64 have to be different functions.  */
+#include <io/fts64.c>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/get_clockfreq.c
@@ -0,0 +1 @@
+#include "../i386/get_clockfreq.c"
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/getcontext.S
@@ -0,0 +1,38 @@
+/* Save current context.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text
+ENTRY(__getcontext)
+        clc
+        movq 0(%rsp), %rsi	/* save the return PC value */
+
+        DO_CALL (getcontext, 1)
+        jb SYSCALL_ERROR_LABEL
+
+        addq $8, %rsp		/* remove stale return address */
+        jmp  *%rsi
+
+L(pseudo_end):
+	ret
+
+PSEUDO_END(__getcontext)
+
+weak_alias(__getcontext, getcontext)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/ioperm.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/perm.h>
+#include <sysarch.h>
+
+int
+ioperm (unsigned long int from, unsigned long int num, int turn_on)
+{
+  struct i386_ioperm_args args;
+
+  args.start = from;
+  args.length = num;
+  args.enable = turn_on;
+
+  return __sysarch (I386_SET_IOPERM, &args);
+}
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/iopl.c
@@ -0,0 +1 @@
+#include "../i386/iopl.c"
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/ld.abilist
@@ -0,0 +1,10 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 __libc_stack_end D 0x8
+GLIBC_2.3 __tls_get_addr F
+GLIBC_2.3 _dl_mcount F
+GLIBC_2.3 _r_debug D 0x28
+GLIBC_2.3 calloc F
+GLIBC_2.3 free F
+GLIBC_2.3 malloc F
+GLIBC_2.3 realloc F
+GLIBC_2.4 GLIBC_2.4 A
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/ldconfig.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdeps/generic/ldconfig.h>
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES \
+  { "/lib/ld.so.1", FLAG_ELF_LIBC6 },				\
+  { "/lib/ld-kfreebsd-x86-64.so.1", FLAG_ELF_LIBC6 },		\
+  { "/lib64/ld-kfreebsd-x86-64.so.1", FLAG_ELF_LIBC6 },		\
+  { "/libexec/ld-elf.so.1", FLAG_ELF_LIBC5 },
+
+#define SYSDEP_KNOWN_LIBRARY_NAMES \
+  { "libc.so.0.1", FLAG_ELF_LIBC6 },				\
+  { "libm.so.1", FLAG_ELF_LIBC6 },				\
+  { "libc.so.4", FLAG_ELF_LIBC5 },				\
+  { "libm.so.4", FLAG_ELF_LIBC5 },				\
+  { "libc.so.5", FLAG_ELF_LIBC5 },				\
+  { "libm.so.5", FLAG_ELF_LIBC5 },				\
+  { "libc.so.6", FLAG_ELF_LIBC5 },				\
+  { "libm.so.6", FLAG_ELF_LIBC5 },				\
+  { "libc.so.7", FLAG_ELF_LIBC5 },				\
+  { "libm.so.7", FLAG_ELF_LIBC5 },				\
+  { "libc.so.8", FLAG_ELF_LIBC5 },				\
+  { "libm.so.8", FLAG_ELF_LIBC5 },
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/ldd-rewrite.sed
@@ -0,0 +1,3 @@
+/LD_TRACE_LOADED_OBJECTS=1/a\
+add_env="$add_env LD_LIBRARY_VERSION=\\$verify_out"
+s_^\(RTLDLIST=\)\(.*lib\)\(\|64\)\(/[^/]*\)\(-kfreebsd-x86-64\)\(\.so\.[0-9.]*\)[ 	]*$_\1"\2\4\6 \2\4\5\6"_
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libBrokenLocale.abilist
@@ -0,0 +1,2 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 __ctype_get_mb_cur_max F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libanl.abilist
@@ -0,0 +1,5 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 gai_cancel F
+GLIBC_2.3 gai_error F
+GLIBC_2.3 gai_suspend F
+GLIBC_2.3 getaddrinfo_a F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libc.abilist
@@ -0,0 +1,2155 @@
+GLIBC_2.10 GLIBC_2.10 A
+GLIBC_2.10 __cxa_at_quick_exit F
+GLIBC_2.10 __posix_getopt F
+GLIBC_2.10 accept4 F
+GLIBC_2.10 devname F
+GLIBC_2.10 devname_r F
+GLIBC_2.10 endsgent F
+GLIBC_2.10 fgetsgent F
+GLIBC_2.10 fgetsgent_r F
+GLIBC_2.10 getsgent F
+GLIBC_2.10 getsgent_r F
+GLIBC_2.10 getsgnam F
+GLIBC_2.10 getsgnam_r F
+GLIBC_2.10 ioperm F
+GLIBC_2.10 kenv F
+GLIBC_2.10 malloc_info F
+GLIBC_2.10 preadv F
+GLIBC_2.10 preadv64 F
+GLIBC_2.10 psiginfo F
+GLIBC_2.10 putsgent F
+GLIBC_2.10 pwritev F
+GLIBC_2.10 pwritev64 F
+GLIBC_2.10 quick_exit F
+GLIBC_2.10 register_printf_modifier F
+GLIBC_2.10 register_printf_specifier F
+GLIBC_2.10 register_printf_type F
+GLIBC_2.10 setsgent F
+GLIBC_2.10 sgetsgent F
+GLIBC_2.10 sgetsgent_r F
+GLIBC_2.10 sysctlnametomib F
+GLIBC_2.11 GLIBC_2.11 A
+GLIBC_2.11 __longjmp_chk F
+GLIBC_2.11 _sys_errlist D 0x2f0
+GLIBC_2.11 _sys_nerr D 0x4
+GLIBC_2.11 execvpe F
+GLIBC_2.11 lchflags F
+GLIBC_2.11 mkostemps F
+GLIBC_2.11 mkostemps64 F
+GLIBC_2.11 mkstemps F
+GLIBC_2.11 mkstemps64 F
+GLIBC_2.11 sys_errlist D 0x2f0
+GLIBC_2.11 sys_nerr D 0x4
+GLIBC_2.13 GLIBC_2.13 A
+GLIBC_2.13 __fentry__ F
+GLIBC_2.13 jail_attach F
+GLIBC_2.13 jail_get F
+GLIBC_2.13 jail_remove F
+GLIBC_2.13 jail_set F
+GLIBC_2.14 GLIBC_2.14 A
+GLIBC_2.14 memcpy F
+GLIBC_2.14 syncfs F
+GLIBC_2.15 GLIBC_2.15 A
+GLIBC_2.15 __fdelt_chk F
+GLIBC_2.15 __fdelt_warn F
+GLIBC_2.15 posix_spawn F
+GLIBC_2.15 posix_spawnp F
+GLIBC_2.15 scandirat F
+GLIBC_2.15 scandirat64 F
+GLIBC_2.16 GLIBC_2.16 A
+GLIBC_2.16 __getauxval F
+GLIBC_2.16 __poll_chk F
+GLIBC_2.16 __ppoll_chk F
+GLIBC_2.16 aligned_alloc F
+GLIBC_2.16 c16rtomb F
+GLIBC_2.16 c32rtomb F
+GLIBC_2.16 getauxval F
+GLIBC_2.16 mbrtoc16 F
+GLIBC_2.16 mbrtoc32 F
+GLIBC_2.16 timespec_get F
+GLIBC_2.17 GLIBC_2.17 A
+GLIBC_2.17 clock_getcpuclockid F
+GLIBC_2.17 clock_getres F
+GLIBC_2.17 clock_gettime F
+GLIBC_2.17 clock_nanosleep F
+GLIBC_2.17 clock_settime F
+GLIBC_2.17 recvmmsg F
+GLIBC_2.17 secure_getenv F
+GLIBC_2.17 sendmmsg F
+GLIBC_2.18 GLIBC_2.18 A
+GLIBC_2.18 __cxa_thread_atexit_impl F
+GLIBC_2.18 _sys_errlist D 0x308
+GLIBC_2.18 _sys_nerr D 0x4
+GLIBC_2.18 msgctl F
+GLIBC_2.18 semctl F
+GLIBC_2.18 shmctl F
+GLIBC_2.18 sys_errlist D 0x308
+GLIBC_2.18 sys_nerr D 0x4
+GLIBC_2.18 waitid F
+GLIBC_2.21 GLIBC_2.21 A
+GLIBC_2.21 __statfs F
+GLIBC_2.22 GLIBC_2.22 A
+GLIBC_2.22 fmemopen F
+GLIBC_2.23 GLIBC_2.23 A
+GLIBC_2.23 fts64_children F
+GLIBC_2.23 fts64_close F
+GLIBC_2.23 fts64_open F
+GLIBC_2.23 fts64_read F
+GLIBC_2.23 fts64_set F
+GLIBC_2.24 GLIBC_2.24 A
+GLIBC_2.24 quick_exit F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __explicit_bzero_chk F
+GLIBC_2.25 explicit_bzero F
+GLIBC_2.25 getentropy F
+GLIBC_2.25 getrandom F
+GLIBC_2.25 gnu_dev_major F
+GLIBC_2.25 gnu_dev_makedev F
+GLIBC_2.25 gnu_dev_minor F
+GLIBC_2.25 strfromd F
+GLIBC_2.25 strfromf F
+GLIBC_2.25 strfroml F
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 _Exit F
+GLIBC_2.3 _IO_2_1_stderr_ D 0xe0
+GLIBC_2.3 _IO_2_1_stdin_ D 0xe0
+GLIBC_2.3 _IO_2_1_stdout_ D 0xe0
+GLIBC_2.3 _IO_adjust_column F
+GLIBC_2.3 _IO_adjust_wcolumn F
+GLIBC_2.3 _IO_default_doallocate F
+GLIBC_2.3 _IO_default_finish F
+GLIBC_2.3 _IO_default_pbackfail F
+GLIBC_2.3 _IO_default_uflow F
+GLIBC_2.3 _IO_default_xsgetn F
+GLIBC_2.3 _IO_default_xsputn F
+GLIBC_2.3 _IO_do_write F
+GLIBC_2.3 _IO_doallocbuf F
+GLIBC_2.3 _IO_fclose F
+GLIBC_2.3 _IO_fdopen F
+GLIBC_2.3 _IO_feof F
+GLIBC_2.3 _IO_ferror F
+GLIBC_2.3 _IO_fflush F
+GLIBC_2.3 _IO_fgetpos F
+GLIBC_2.3 _IO_fgetpos64 F
+GLIBC_2.3 _IO_fgets F
+GLIBC_2.3 _IO_file_attach F
+GLIBC_2.3 _IO_file_close F
+GLIBC_2.3 _IO_file_close_it F
+GLIBC_2.3 _IO_file_doallocate F
+GLIBC_2.3 _IO_file_finish F
+GLIBC_2.3 _IO_file_fopen F
+GLIBC_2.3 _IO_file_init F
+GLIBC_2.3 _IO_file_jumps D 0xa8
+GLIBC_2.3 _IO_file_open F
+GLIBC_2.3 _IO_file_overflow F
+GLIBC_2.3 _IO_file_read F
+GLIBC_2.3 _IO_file_seek F
+GLIBC_2.3 _IO_file_seekoff F
+GLIBC_2.3 _IO_file_setbuf F
+GLIBC_2.3 _IO_file_stat F
+GLIBC_2.3 _IO_file_sync F
+GLIBC_2.3 _IO_file_underflow F
+GLIBC_2.3 _IO_file_write F
+GLIBC_2.3 _IO_file_xsputn F
+GLIBC_2.3 _IO_flockfile F
+GLIBC_2.3 _IO_flush_all F
+GLIBC_2.3 _IO_flush_all_linebuffered F
+GLIBC_2.3 _IO_fopen F
+GLIBC_2.3 _IO_fprintf F
+GLIBC_2.3 _IO_fputs F
+GLIBC_2.3 _IO_fread F
+GLIBC_2.3 _IO_free_backup_area F
+GLIBC_2.3 _IO_free_wbackup_area F
+GLIBC_2.3 _IO_fsetpos F
+GLIBC_2.3 _IO_fsetpos64 F
+GLIBC_2.3 _IO_ftell F
+GLIBC_2.3 _IO_ftrylockfile F
+GLIBC_2.3 _IO_funlockfile F
+GLIBC_2.3 _IO_fwrite F
+GLIBC_2.3 _IO_getc F
+GLIBC_2.3 _IO_getline F
+GLIBC_2.3 _IO_getline_info F
+GLIBC_2.3 _IO_gets F
+GLIBC_2.3 _IO_init F
+GLIBC_2.3 _IO_init_marker F
+GLIBC_2.3 _IO_init_wmarker F
+GLIBC_2.3 _IO_iter_begin F
+GLIBC_2.3 _IO_iter_end F
+GLIBC_2.3 _IO_iter_file F
+GLIBC_2.3 _IO_iter_next F
+GLIBC_2.3 _IO_least_wmarker F
+GLIBC_2.3 _IO_link_in F
+GLIBC_2.3 _IO_list_all D 0x8
+GLIBC_2.3 _IO_list_lock F
+GLIBC_2.3 _IO_list_resetlock F
+GLIBC_2.3 _IO_list_unlock F
+GLIBC_2.3 _IO_marker_delta F
+GLIBC_2.3 _IO_marker_difference F
+GLIBC_2.3 _IO_padn F
+GLIBC_2.3 _IO_peekc_locked F
+GLIBC_2.3 _IO_popen F
+GLIBC_2.3 _IO_printf F
+GLIBC_2.3 _IO_proc_close F
+GLIBC_2.3 _IO_proc_open F
+GLIBC_2.3 _IO_putc F
+GLIBC_2.3 _IO_puts F
+GLIBC_2.3 _IO_remove_marker F
+GLIBC_2.3 _IO_seekmark F
+GLIBC_2.3 _IO_seekoff F
+GLIBC_2.3 _IO_seekpos F
+GLIBC_2.3 _IO_seekwmark F
+GLIBC_2.3 _IO_setb F
+GLIBC_2.3 _IO_setbuffer F
+GLIBC_2.3 _IO_setvbuf F
+GLIBC_2.3 _IO_sgetn F
+GLIBC_2.3 _IO_sprintf F
+GLIBC_2.3 _IO_sputbackc F
+GLIBC_2.3 _IO_sputbackwc F
+GLIBC_2.3 _IO_sscanf F
+GLIBC_2.3 _IO_str_init_readonly F
+GLIBC_2.3 _IO_str_init_static F
+GLIBC_2.3 _IO_str_overflow F
+GLIBC_2.3 _IO_str_pbackfail F
+GLIBC_2.3 _IO_str_seekoff F
+GLIBC_2.3 _IO_str_underflow F
+GLIBC_2.3 _IO_sungetc F
+GLIBC_2.3 _IO_sungetwc F
+GLIBC_2.3 _IO_switch_to_get_mode F
+GLIBC_2.3 _IO_switch_to_main_wget_area F
+GLIBC_2.3 _IO_switch_to_wbackup_area F
+GLIBC_2.3 _IO_switch_to_wget_mode F
+GLIBC_2.3 _IO_un_link F
+GLIBC_2.3 _IO_ungetc F
+GLIBC_2.3 _IO_unsave_markers F
+GLIBC_2.3 _IO_unsave_wmarkers F
+GLIBC_2.3 _IO_vfprintf F
+GLIBC_2.3 _IO_vfscanf F
+GLIBC_2.3 _IO_vsprintf F
+GLIBC_2.3 _IO_wdefault_doallocate F
+GLIBC_2.3 _IO_wdefault_finish F
+GLIBC_2.3 _IO_wdefault_pbackfail F
+GLIBC_2.3 _IO_wdefault_uflow F
+GLIBC_2.3 _IO_wdefault_xsgetn F
+GLIBC_2.3 _IO_wdefault_xsputn F
+GLIBC_2.3 _IO_wdo_write F
+GLIBC_2.3 _IO_wdoallocbuf F
+GLIBC_2.3 _IO_wfile_jumps D 0xa8
+GLIBC_2.3 _IO_wfile_overflow F
+GLIBC_2.3 _IO_wfile_seekoff F
+GLIBC_2.3 _IO_wfile_sync F
+GLIBC_2.3 _IO_wfile_underflow F
+GLIBC_2.3 _IO_wfile_xsputn F
+GLIBC_2.3 _IO_wmarker_delta F
+GLIBC_2.3 _IO_wsetb F
+GLIBC_2.3 __acl_aclcheck_fd F
+GLIBC_2.3 __acl_aclcheck_file F
+GLIBC_2.3 __acl_delete_fd F
+GLIBC_2.3 __acl_delete_file F
+GLIBC_2.3 __acl_get_fd F
+GLIBC_2.3 __acl_get_file F
+GLIBC_2.3 __acl_set_fd F
+GLIBC_2.3 __acl_set_file F
+GLIBC_2.3 __after_morecore_hook D 0x8
+GLIBC_2.3 __argz_count F
+GLIBC_2.3 __argz_next F
+GLIBC_2.3 __argz_stringify F
+GLIBC_2.3 __asprintf F
+GLIBC_2.3 __assert F
+GLIBC_2.3 __assert_fail F
+GLIBC_2.3 __assert_perror_fail F
+GLIBC_2.3 __backtrace F
+GLIBC_2.3 __backtrace_symbols F
+GLIBC_2.3 __backtrace_symbols_fd F
+GLIBC_2.3 __bsd_getpgrp F
+GLIBC_2.3 __bzero F
+GLIBC_2.3 __check_rhosts_file D 0x4
+GLIBC_2.3 __close F
+GLIBC_2.3 __cmsg_nxthdr F
+GLIBC_2.3 __connect F
+GLIBC_2.3 __ctype_b_loc F
+GLIBC_2.3 __ctype_get_mb_cur_max F
+GLIBC_2.3 __ctype_tolower_loc F
+GLIBC_2.3 __ctype_toupper_loc F
+GLIBC_2.3 __curbrk D 0x8
+GLIBC_2.3 __cxa_atexit F
+GLIBC_2.3 __cxa_finalize F
+GLIBC_2.3 __cyg_profile_func_enter F
+GLIBC_2.3 __cyg_profile_func_exit F
+GLIBC_2.3 __daylight D 0x4
+GLIBC_2.3 __dcgettext F
+GLIBC_2.3 __default_morecore F
+GLIBC_2.3 __dgettext F
+GLIBC_2.3 __dup2 F
+GLIBC_2.3 __duplocale F
+GLIBC_2.3 __environ D 0x8
+GLIBC_2.3 __errno_location F
+GLIBC_2.3 __fbufsize F
+GLIBC_2.3 __fcntl F
+GLIBC_2.3 __ffs F
+GLIBC_2.3 __finite F
+GLIBC_2.3 __finitef F
+GLIBC_2.3 __finitel F
+GLIBC_2.3 __flbf F
+GLIBC_2.3 __fork F
+GLIBC_2.3 __fpending F
+GLIBC_2.3 __fpu_control D 0x2
+GLIBC_2.3 __fpurge F
+GLIBC_2.3 __freadable F
+GLIBC_2.3 __freading F
+GLIBC_2.3 __free_hook D 0x8
+GLIBC_2.3 __freelocale F
+GLIBC_2.3 __fsetlocking F
+GLIBC_2.3 __fwritable F
+GLIBC_2.3 __fwriting F
+GLIBC_2.3 __fxstat F
+GLIBC_2.3 __fxstat64 F
+GLIBC_2.3 __getdelim F
+GLIBC_2.3 __getpagesize F
+GLIBC_2.3 __getpgid F
+GLIBC_2.3 __getpid F
+GLIBC_2.3 __gettimeofday F
+GLIBC_2.3 __gmtime_r F
+GLIBC_2.3 __h_errno_location F
+GLIBC_2.3 __isalnum_l F
+GLIBC_2.3 __isalpha_l F
+GLIBC_2.3 __isascii_l F
+GLIBC_2.3 __isblank_l F
+GLIBC_2.3 __iscntrl_l F
+GLIBC_2.3 __isctype F
+GLIBC_2.3 __isdigit_l F
+GLIBC_2.3 __isgraph_l F
+GLIBC_2.3 __isinf F
+GLIBC_2.3 __isinff F
+GLIBC_2.3 __isinfl F
+GLIBC_2.3 __islower_l F
+GLIBC_2.3 __isnan F
+GLIBC_2.3 __isnanf F
+GLIBC_2.3 __isnanl F
+GLIBC_2.3 __isprint_l F
+GLIBC_2.3 __ispunct_l F
+GLIBC_2.3 __isspace_l F
+GLIBC_2.3 __isupper_l F
+GLIBC_2.3 __iswalnum_l F
+GLIBC_2.3 __iswalpha_l F
+GLIBC_2.3 __iswblank_l F
+GLIBC_2.3 __iswcntrl_l F
+GLIBC_2.3 __iswctype F
+GLIBC_2.3 __iswctype_l F
+GLIBC_2.3 __iswdigit_l F
+GLIBC_2.3 __iswgraph_l F
+GLIBC_2.3 __iswlower_l F
+GLIBC_2.3 __iswprint_l F
+GLIBC_2.3 __iswpunct_l F
+GLIBC_2.3 __iswspace_l F
+GLIBC_2.3 __iswupper_l F
+GLIBC_2.3 __iswxdigit_l F
+GLIBC_2.3 __isxdigit_l F
+GLIBC_2.3 __ivaliduser F
+GLIBC_2.3 __key_decryptsession_pk_LOCAL D 0x8
+GLIBC_2.3 __key_encryptsession_pk_LOCAL D 0x8
+GLIBC_2.3 __key_gendes_LOCAL D 0x8
+GLIBC_2.3 __libc_allocate_rtsig F
+GLIBC_2.3 __libc_calloc F
+GLIBC_2.3 __libc_current_sigrtmax F
+GLIBC_2.3 __libc_current_sigrtmin F
+GLIBC_2.3 __libc_free F
+GLIBC_2.3 __libc_freeres F
+GLIBC_2.3 __libc_init_first F
+GLIBC_2.3 __libc_mallinfo F
+GLIBC_2.3 __libc_malloc F
+GLIBC_2.3 __libc_mallopt F
+GLIBC_2.3 __libc_memalign F
+GLIBC_2.3 __libc_pvalloc F
+GLIBC_2.3 __libc_realloc F
+GLIBC_2.3 __libc_start_main F
+GLIBC_2.3 __libc_valloc F
+GLIBC_2.3 __lseek F
+GLIBC_2.3 __lxstat F
+GLIBC_2.3 __lxstat64 F
+GLIBC_2.3 __malloc_hook D 0x8
+GLIBC_2.3 __malloc_initialize_hook D 0x8
+GLIBC_2.3 __mbrlen F
+GLIBC_2.3 __mbrtowc F
+GLIBC_2.3 __memalign_hook D 0x8
+GLIBC_2.3 __mempcpy F
+GLIBC_2.3 __mempcpy_small F
+GLIBC_2.3 __monstartup F
+GLIBC_2.3 __morecore D 0x8
+GLIBC_2.3 __nanosleep F
+GLIBC_2.3 __newlocale F
+GLIBC_2.3 __nl_langinfo_l F
+GLIBC_2.3 __nss_configure_lookup F
+GLIBC_2.3 __nss_database_lookup F
+GLIBC_2.3 __nss_group_lookup F
+GLIBC_2.3 __nss_hostname_digits_dots F
+GLIBC_2.3 __nss_hosts_lookup F
+GLIBC_2.3 __nss_next F
+GLIBC_2.3 __nss_passwd_lookup F
+GLIBC_2.3 __open F
+GLIBC_2.3 __overflow F
+GLIBC_2.3 __pipe F
+GLIBC_2.3 __poll F
+GLIBC_2.3 __pread64 F
+GLIBC_2.3 __printf_fp F
+GLIBC_2.3 __profile_frequency F
+GLIBC_2.3 __progname D 0x8
+GLIBC_2.3 __progname_full D 0x8
+GLIBC_2.3 __pwrite64 F
+GLIBC_2.3 __rawmemchr F
+GLIBC_2.3 __rcmd_errstr D 0x8
+GLIBC_2.3 __read F
+GLIBC_2.3 __realloc_hook D 0x8
+GLIBC_2.3 __res_init F
+GLIBC_2.3 __res_nclose F
+GLIBC_2.3 __res_ninit F
+GLIBC_2.3 __res_randomid F
+GLIBC_2.3 __res_state F
+GLIBC_2.3 __rpc_thread_createerr F
+GLIBC_2.3 __rpc_thread_svc_fdset F
+GLIBC_2.3 __rpc_thread_svc_max_pollfd F
+GLIBC_2.3 __rpc_thread_svc_pollfd F
+GLIBC_2.3 __sbrk F
+GLIBC_2.3 __sched_get_priority_max F
+GLIBC_2.3 __sched_get_priority_min F
+GLIBC_2.3 __sched_getparam F
+GLIBC_2.3 __sched_getscheduler F
+GLIBC_2.3 __sched_setscheduler F
+GLIBC_2.3 __sched_yield F
+GLIBC_2.3 __secure_getenv F
+GLIBC_2.3 __select F
+GLIBC_2.3 __send F
+GLIBC_2.3 __setpgid F
+GLIBC_2.3 __sigaction F
+GLIBC_2.3 __sigaddset F
+GLIBC_2.3 __sigdelset F
+GLIBC_2.3 __sigismember F
+GLIBC_2.3 __signbit F
+GLIBC_2.3 __signbitf F
+GLIBC_2.3 __signbitl F
+GLIBC_2.3 __sigpause F
+GLIBC_2.3 __sigsetjmp F
+GLIBC_2.3 __sigsuspend F
+GLIBC_2.3 __stpcpy F
+GLIBC_2.3 __stpcpy_small F
+GLIBC_2.3 __stpncpy F
+GLIBC_2.3 __strcasecmp F
+GLIBC_2.3 __strcasecmp_l F
+GLIBC_2.3 __strcasestr F
+GLIBC_2.3 __strcoll_l F
+GLIBC_2.3 __strcpy_small F
+GLIBC_2.3 __strcspn_c1 F
+GLIBC_2.3 __strcspn_c2 F
+GLIBC_2.3 __strcspn_c3 F
+GLIBC_2.3 __strdup F
+GLIBC_2.3 __strerror_r F
+GLIBC_2.3 __strfmon_l F
+GLIBC_2.3 __strftime_l F
+GLIBC_2.3 __strncasecmp_l F
+GLIBC_2.3 __strndup F
+GLIBC_2.3 __strpbrk_c2 F
+GLIBC_2.3 __strpbrk_c3 F
+GLIBC_2.3 __strsep_1c F
+GLIBC_2.3 __strsep_2c F
+GLIBC_2.3 __strsep_3c F
+GLIBC_2.3 __strsep_g F
+GLIBC_2.3 __strspn_c1 F
+GLIBC_2.3 __strspn_c2 F
+GLIBC_2.3 __strspn_c3 F
+GLIBC_2.3 __strtod_internal F
+GLIBC_2.3 __strtod_l F
+GLIBC_2.3 __strtof_internal F
+GLIBC_2.3 __strtof_l F
+GLIBC_2.3 __strtok_r F
+GLIBC_2.3 __strtok_r_1c F
+GLIBC_2.3 __strtol_internal F
+GLIBC_2.3 __strtol_l F
+GLIBC_2.3 __strtold_internal F
+GLIBC_2.3 __strtold_l F
+GLIBC_2.3 __strtoll_internal F
+GLIBC_2.3 __strtoll_l F
+GLIBC_2.3 __strtoul_internal F
+GLIBC_2.3 __strtoul_l F
+GLIBC_2.3 __strtoull_internal F
+GLIBC_2.3 __strtoull_l F
+GLIBC_2.3 __strverscmp F
+GLIBC_2.3 __strxfrm_l F
+GLIBC_2.3 __syscall_aio_cancel F
+GLIBC_2.3 __syscall_aio_error F
+GLIBC_2.3 __syscall_aio_read F
+GLIBC_2.3 __syscall_aio_return F
+GLIBC_2.3 __syscall_aio_suspend F
+GLIBC_2.3 __syscall_aio_waitcomplete F
+GLIBC_2.3 __syscall_aio_write F
+GLIBC_2.3 __syscall_lio_listio F
+GLIBC_2.3 __syscall_obreak F
+GLIBC_2.3 __syscall_yield F
+GLIBC_2.3 __sysconf F
+GLIBC_2.3 __sysctl F
+GLIBC_2.3 __sysv_signal F
+GLIBC_2.3 __timezone D 0x8
+GLIBC_2.3 __toascii_l F
+GLIBC_2.3 __tolower_l F
+GLIBC_2.3 __toupper_l F
+GLIBC_2.3 __towctrans F
+GLIBC_2.3 __towctrans_l F
+GLIBC_2.3 __towlower_l F
+GLIBC_2.3 __towupper_l F
+GLIBC_2.3 __tzname D 0x10
+GLIBC_2.3 __uflow F
+GLIBC_2.3 __underflow F
+GLIBC_2.3 __uselocale F
+GLIBC_2.3 __vfork F
+GLIBC_2.3 __vfscanf F
+GLIBC_2.3 __vsnprintf F
+GLIBC_2.3 __vsscanf F
+GLIBC_2.3 __wait F
+GLIBC_2.3 __waitpid F
+GLIBC_2.3 __wcscasecmp_l F
+GLIBC_2.3 __wcscoll_l F
+GLIBC_2.3 __wcsftime_l F
+GLIBC_2.3 __wcsncasecmp_l F
+GLIBC_2.3 __wcstod_internal F
+GLIBC_2.3 __wcstod_l F
+GLIBC_2.3 __wcstof_internal F
+GLIBC_2.3 __wcstof_l F
+GLIBC_2.3 __wcstol_internal F
+GLIBC_2.3 __wcstol_l F
+GLIBC_2.3 __wcstold_internal F
+GLIBC_2.3 __wcstold_l F
+GLIBC_2.3 __wcstoll_internal F
+GLIBC_2.3 __wcstoll_l F
+GLIBC_2.3 __wcstoul_internal F
+GLIBC_2.3 __wcstoul_l F
+GLIBC_2.3 __wcstoull_internal F
+GLIBC_2.3 __wcstoull_l F
+GLIBC_2.3 __wcsxfrm_l F
+GLIBC_2.3 __wctrans_l F
+GLIBC_2.3 __wctype_l F
+GLIBC_2.3 __woverflow F
+GLIBC_2.3 __write F
+GLIBC_2.3 __wuflow F
+GLIBC_2.3 __wunderflow F
+GLIBC_2.3 __xmknod F
+GLIBC_2.3 __xpg_basename F
+GLIBC_2.3 __xpg_sigpause F
+GLIBC_2.3 __xstat F
+GLIBC_2.3 __xstat64 F
+GLIBC_2.3 _authenticate F
+GLIBC_2.3 _dl_mcount_wrapper F
+GLIBC_2.3 _dl_mcount_wrapper_check F
+GLIBC_2.3 _environ D 0x8
+GLIBC_2.3 _exit F
+GLIBC_2.3 _flushlbf F
+GLIBC_2.3 _libc_intl_domainname D 0x5
+GLIBC_2.3 _longjmp F
+GLIBC_2.3 _mcleanup F
+GLIBC_2.3 _mcount F
+GLIBC_2.3 _nl_default_dirname D 0x12
+GLIBC_2.3 _nl_domain_bindings D 0x8
+GLIBC_2.3 _nl_msg_cat_cntr D 0x4
+GLIBC_2.3 _null_auth D 0x18
+GLIBC_2.3 _obstack D 0x8
+GLIBC_2.3 _obstack_allocated_p F
+GLIBC_2.3 _obstack_begin F
+GLIBC_2.3 _obstack_begin_1 F
+GLIBC_2.3 _obstack_free F
+GLIBC_2.3 _obstack_memory_used F
+GLIBC_2.3 _obstack_newchunk F
+GLIBC_2.3 _res D 0x238
+GLIBC_2.3 _res_hconf D 0x48
+GLIBC_2.3 _rpc_dtablesize F
+GLIBC_2.3 _seterr_reply F
+GLIBC_2.3 _setjmp F
+GLIBC_2.3 _sys_errlist D 0x2b8
+GLIBC_2.3 _sys_nerr D 0x4
+GLIBC_2.3 _sys_siglist D 0x408
+GLIBC_2.3 _tolower F
+GLIBC_2.3 _toupper F
+GLIBC_2.3 a64l F
+GLIBC_2.3 abort F
+GLIBC_2.3 abs F
+GLIBC_2.3 accept F
+GLIBC_2.3 access F
+GLIBC_2.3 acct F
+GLIBC_2.3 addmntent F
+GLIBC_2.3 addseverity F
+GLIBC_2.3 adjtime F
+GLIBC_2.3 advance F
+GLIBC_2.3 alarm F
+GLIBC_2.3 alphasort F
+GLIBC_2.3 alphasort64 F
+GLIBC_2.3 argp_err_exit_status D 0x4
+GLIBC_2.3 argp_error F
+GLIBC_2.3 argp_failure F
+GLIBC_2.3 argp_help F
+GLIBC_2.3 argp_parse F
+GLIBC_2.3 argp_program_bug_address D 0x8
+GLIBC_2.3 argp_program_version D 0x8
+GLIBC_2.3 argp_program_version_hook D 0x8
+GLIBC_2.3 argp_state_help F
+GLIBC_2.3 argp_usage F
+GLIBC_2.3 argz_add F
+GLIBC_2.3 argz_add_sep F
+GLIBC_2.3 argz_append F
+GLIBC_2.3 argz_count F
+GLIBC_2.3 argz_create F
+GLIBC_2.3 argz_create_sep F
+GLIBC_2.3 argz_delete F
+GLIBC_2.3 argz_extract F
+GLIBC_2.3 argz_insert F
+GLIBC_2.3 argz_next F
+GLIBC_2.3 argz_replace F
+GLIBC_2.3 argz_stringify F
+GLIBC_2.3 asctime F
+GLIBC_2.3 asctime_r F
+GLIBC_2.3 asprintf F
+GLIBC_2.3 atof F
+GLIBC_2.3 atoi F
+GLIBC_2.3 atol F
+GLIBC_2.3 atoll F
+GLIBC_2.3 authdes_create F
+GLIBC_2.3 authdes_getucred F
+GLIBC_2.3 authdes_pk_create F
+GLIBC_2.3 authnone_create F
+GLIBC_2.3 authunix_create F
+GLIBC_2.3 authunix_create_default F
+GLIBC_2.3 backtrace F
+GLIBC_2.3 backtrace_symbols F
+GLIBC_2.3 backtrace_symbols_fd F
+GLIBC_2.3 basename F
+GLIBC_2.3 bcmp F
+GLIBC_2.3 bcopy F
+GLIBC_2.3 bind F
+GLIBC_2.3 bind_textdomain_codeset F
+GLIBC_2.3 bindresvport F
+GLIBC_2.3 bindtextdomain F
+GLIBC_2.3 brk F
+GLIBC_2.3 bsd_signal F
+GLIBC_2.3 bsearch F
+GLIBC_2.3 btowc F
+GLIBC_2.3 bzero F
+GLIBC_2.3 calloc F
+GLIBC_2.3 callrpc F
+GLIBC_2.3 canonicalize_file_name F
+GLIBC_2.3 catclose F
+GLIBC_2.3 catgets F
+GLIBC_2.3 catopen F
+GLIBC_2.3 cbc_crypt F
+GLIBC_2.3 cfgetispeed F
+GLIBC_2.3 cfgetospeed F
+GLIBC_2.3 cfmakeraw F
+GLIBC_2.3 cfree F
+GLIBC_2.3 cfsetispeed F
+GLIBC_2.3 cfsetospeed F
+GLIBC_2.3 cfsetspeed F
+GLIBC_2.3 chdir F
+GLIBC_2.3 chflags F
+GLIBC_2.3 chmod F
+GLIBC_2.3 chown F
+GLIBC_2.3 chroot F
+GLIBC_2.3 clearenv F
+GLIBC_2.3 clearerr F
+GLIBC_2.3 clearerr_unlocked F
+GLIBC_2.3 clnt_broadcast F
+GLIBC_2.3 clnt_create F
+GLIBC_2.3 clnt_pcreateerror F
+GLIBC_2.3 clnt_perrno F
+GLIBC_2.3 clnt_perror F
+GLIBC_2.3 clnt_spcreateerror F
+GLIBC_2.3 clnt_sperrno F
+GLIBC_2.3 clnt_sperror F
+GLIBC_2.3 clntraw_create F
+GLIBC_2.3 clnttcp_create F
+GLIBC_2.3 clntudp_bufcreate F
+GLIBC_2.3 clntudp_create F
+GLIBC_2.3 clntunix_create F
+GLIBC_2.3 clock F
+GLIBC_2.3 clone F
+GLIBC_2.3 close F
+GLIBC_2.3 closedir F
+GLIBC_2.3 closelog F
+GLIBC_2.3 confstr F
+GLIBC_2.3 connect F
+GLIBC_2.3 copysign F
+GLIBC_2.3 copysignf F
+GLIBC_2.3 copysignl F
+GLIBC_2.3 creat F
+GLIBC_2.3 creat64 F
+GLIBC_2.3 ctermid F
+GLIBC_2.3 ctime F
+GLIBC_2.3 ctime_r F
+GLIBC_2.3 cuserid F
+GLIBC_2.3 daemon F
+GLIBC_2.3 daylight D 0x4
+GLIBC_2.3 dcgettext F
+GLIBC_2.3 dcngettext F
+GLIBC_2.3 des_setparity F
+GLIBC_2.3 dgettext F
+GLIBC_2.3 difftime F
+GLIBC_2.3 dirfd F
+GLIBC_2.3 dirname F
+GLIBC_2.3 div F
+GLIBC_2.3 dl_iterate_phdr F
+GLIBC_2.3 dngettext F
+GLIBC_2.3 dprintf F
+GLIBC_2.3 drand48 F
+GLIBC_2.3 drand48_r F
+GLIBC_2.3 dup F
+GLIBC_2.3 dup2 F
+GLIBC_2.3 duplocale F
+GLIBC_2.3 dysize F
+GLIBC_2.3 ecb_crypt F
+GLIBC_2.3 ecvt F
+GLIBC_2.3 ecvt_r F
+GLIBC_2.3 endaliasent F
+GLIBC_2.3 endfsent F
+GLIBC_2.3 endgrent F
+GLIBC_2.3 endhostent F
+GLIBC_2.3 endmntent F
+GLIBC_2.3 endnetent F
+GLIBC_2.3 endnetgrent F
+GLIBC_2.3 endprotoent F
+GLIBC_2.3 endpwent F
+GLIBC_2.3 endrpcent F
+GLIBC_2.3 endservent F
+GLIBC_2.3 endspent F
+GLIBC_2.3 endttyent F
+GLIBC_2.3 endusershell F
+GLIBC_2.3 endutent F
+GLIBC_2.3 endutxent F
+GLIBC_2.3 environ D 0x8
+GLIBC_2.3 envz_add F
+GLIBC_2.3 envz_entry F
+GLIBC_2.3 envz_get F
+GLIBC_2.3 envz_merge F
+GLIBC_2.3 envz_remove F
+GLIBC_2.3 envz_strip F
+GLIBC_2.3 erand48 F
+GLIBC_2.3 erand48_r F
+GLIBC_2.3 err F
+GLIBC_2.3 error F
+GLIBC_2.3 error_at_line F
+GLIBC_2.3 error_message_count D 0x4
+GLIBC_2.3 error_one_per_line D 0x4
+GLIBC_2.3 error_print_progname D 0x8
+GLIBC_2.3 errx F
+GLIBC_2.3 ether_aton F
+GLIBC_2.3 ether_aton_r F
+GLIBC_2.3 ether_hostton F
+GLIBC_2.3 ether_line F
+GLIBC_2.3 ether_ntoa F
+GLIBC_2.3 ether_ntoa_r F
+GLIBC_2.3 ether_ntohost F
+GLIBC_2.3 euidaccess F
+GLIBC_2.3 execl F
+GLIBC_2.3 execle F
+GLIBC_2.3 execlp F
+GLIBC_2.3 execv F
+GLIBC_2.3 execve F
+GLIBC_2.3 execvp F
+GLIBC_2.3 exit F
+GLIBC_2.3 extattr_delete_file F
+GLIBC_2.3 extattr_get_file F
+GLIBC_2.3 extattr_set_file F
+GLIBC_2.3 extattrctl F
+GLIBC_2.3 fattach F
+GLIBC_2.3 fchdir F
+GLIBC_2.3 fchflags F
+GLIBC_2.3 fchmod F
+GLIBC_2.3 fchown F
+GLIBC_2.3 fclose F
+GLIBC_2.3 fcloseall F
+GLIBC_2.3 fcntl F
+GLIBC_2.3 fcvt F
+GLIBC_2.3 fcvt_r F
+GLIBC_2.3 fdatasync F
+GLIBC_2.3 fdetach F
+GLIBC_2.3 fdopen F
+GLIBC_2.3 feof F
+GLIBC_2.3 feof_unlocked F
+GLIBC_2.3 ferror F
+GLIBC_2.3 ferror_unlocked F
+GLIBC_2.3 fexecve F
+GLIBC_2.3 fflush F
+GLIBC_2.3 fflush_unlocked F
+GLIBC_2.3 ffs F
+GLIBC_2.3 ffsl F
+GLIBC_2.3 ffsll F
+GLIBC_2.3 fgetc F
+GLIBC_2.3 fgetc_unlocked F
+GLIBC_2.3 fgetgrent F
+GLIBC_2.3 fgetgrent_r F
+GLIBC_2.3 fgetpos F
+GLIBC_2.3 fgetpos64 F
+GLIBC_2.3 fgetpwent F
+GLIBC_2.3 fgetpwent_r F
+GLIBC_2.3 fgets F
+GLIBC_2.3 fgets_unlocked F
+GLIBC_2.3 fgetspent F
+GLIBC_2.3 fgetspent_r F
+GLIBC_2.3 fgetwc F
+GLIBC_2.3 fgetwc_unlocked F
+GLIBC_2.3 fgetws F
+GLIBC_2.3 fgetws_unlocked F
+GLIBC_2.3 fgetxattr F
+GLIBC_2.3 fhopen F
+GLIBC_2.3 fhstat F
+GLIBC_2.3 fhstatfs F
+GLIBC_2.3 fileno F
+GLIBC_2.3 fileno_unlocked F
+GLIBC_2.3 finite F
+GLIBC_2.3 finitef F
+GLIBC_2.3 finitel F
+GLIBC_2.3 flistxattr F
+GLIBC_2.3 flock F
+GLIBC_2.3 flockfile F
+GLIBC_2.3 fmemopen F
+GLIBC_2.3 fmtmsg F
+GLIBC_2.3 fnmatch F
+GLIBC_2.3 fopen F
+GLIBC_2.3 fopen64 F
+GLIBC_2.3 fopencookie F
+GLIBC_2.3 fork F
+GLIBC_2.3 fpathconf F
+GLIBC_2.3 fprintf F
+GLIBC_2.3 fputc F
+GLIBC_2.3 fputc_unlocked F
+GLIBC_2.3 fputs F
+GLIBC_2.3 fputs_unlocked F
+GLIBC_2.3 fputwc F
+GLIBC_2.3 fputwc_unlocked F
+GLIBC_2.3 fputws F
+GLIBC_2.3 fputws_unlocked F
+GLIBC_2.3 fread F
+GLIBC_2.3 fread_unlocked F
+GLIBC_2.3 free F
+GLIBC_2.3 freeaddrinfo F
+GLIBC_2.3 freeifaddrs F
+GLIBC_2.3 freelocale F
+GLIBC_2.3 fremovexattr F
+GLIBC_2.3 freopen F
+GLIBC_2.3 freopen64 F
+GLIBC_2.3 frexp F
+GLIBC_2.3 frexpf F
+GLIBC_2.3 frexpl F
+GLIBC_2.3 fscanf F
+GLIBC_2.3 fseek F
+GLIBC_2.3 fseeko F
+GLIBC_2.3 fseeko64 F
+GLIBC_2.3 fsetpos F
+GLIBC_2.3 fsetpos64 F
+GLIBC_2.3 fsetxattr F
+GLIBC_2.3 fstatfs F
+GLIBC_2.3 fstatfs64 F
+GLIBC_2.3 fstatvfs F
+GLIBC_2.3 fstatvfs64 F
+GLIBC_2.3 fsync F
+GLIBC_2.3 ftell F
+GLIBC_2.3 ftello F
+GLIBC_2.3 ftello64 F
+GLIBC_2.3 ftime F
+GLIBC_2.3 ftok F
+GLIBC_2.3 ftruncate F
+GLIBC_2.3 ftruncate64 F
+GLIBC_2.3 ftrylockfile F
+GLIBC_2.3 fts_children F
+GLIBC_2.3 fts_close F
+GLIBC_2.3 fts_open F
+GLIBC_2.3 fts_read F
+GLIBC_2.3 fts_set F
+GLIBC_2.3 ftw F
+GLIBC_2.3 ftw64 F
+GLIBC_2.3 funlockfile F
+GLIBC_2.3 futimes F
+GLIBC_2.3 fwide F
+GLIBC_2.3 fwprintf F
+GLIBC_2.3 fwrite F
+GLIBC_2.3 fwrite_unlocked F
+GLIBC_2.3 fwscanf F
+GLIBC_2.3 gai_strerror F
+GLIBC_2.3 gcvt F
+GLIBC_2.3 get_avphys_pages F
+GLIBC_2.3 get_current_dir_name F
+GLIBC_2.3 get_myaddress F
+GLIBC_2.3 get_nprocs F
+GLIBC_2.3 get_nprocs_conf F
+GLIBC_2.3 get_phys_pages F
+GLIBC_2.3 getaddrinfo F
+GLIBC_2.3 getaliasbyname F
+GLIBC_2.3 getaliasbyname_r F
+GLIBC_2.3 getaliasent F
+GLIBC_2.3 getaliasent_r F
+GLIBC_2.3 getc F
+GLIBC_2.3 getc_unlocked F
+GLIBC_2.3 getchar F
+GLIBC_2.3 getchar_unlocked F
+GLIBC_2.3 getcontext F
+GLIBC_2.3 getcwd F
+GLIBC_2.3 getdate F
+GLIBC_2.3 getdate_err D 0x4
+GLIBC_2.3 getdate_r F
+GLIBC_2.3 getdelim F
+GLIBC_2.3 getdents F
+GLIBC_2.3 getdirentries F
+GLIBC_2.3 getdirentries64 F
+GLIBC_2.3 getdomainname F
+GLIBC_2.3 getdtablesize F
+GLIBC_2.3 getegid F
+GLIBC_2.3 getenv F
+GLIBC_2.3 geteuid F
+GLIBC_2.3 getfh F
+GLIBC_2.3 getfsent F
+GLIBC_2.3 getfsfile F
+GLIBC_2.3 getfsspec F
+GLIBC_2.3 getfsstat F
+GLIBC_2.3 getfsstat64 F
+GLIBC_2.3 getgid F
+GLIBC_2.3 getgrent F
+GLIBC_2.3 getgrent_r F
+GLIBC_2.3 getgrgid F
+GLIBC_2.3 getgrgid_r F
+GLIBC_2.3 getgrnam F
+GLIBC_2.3 getgrnam_r F
+GLIBC_2.3 getgrouplist F
+GLIBC_2.3 getgroups F
+GLIBC_2.3 gethostbyaddr F
+GLIBC_2.3 gethostbyaddr_r F
+GLIBC_2.3 gethostbyname F
+GLIBC_2.3 gethostbyname2 F
+GLIBC_2.3 gethostbyname2_r F
+GLIBC_2.3 gethostbyname_r F
+GLIBC_2.3 gethostent F
+GLIBC_2.3 gethostent_r F
+GLIBC_2.3 gethostid F
+GLIBC_2.3 gethostname F
+GLIBC_2.3 getifaddrs F
+GLIBC_2.3 getitimer F
+GLIBC_2.3 getline F
+GLIBC_2.3 getloadavg F
+GLIBC_2.3 getlogin F
+GLIBC_2.3 getlogin_r F
+GLIBC_2.3 getmntent F
+GLIBC_2.3 getmntent_r F
+GLIBC_2.3 getmntinfo F
+GLIBC_2.3 getmntinfo64 F
+GLIBC_2.3 getmsg F
+GLIBC_2.3 getnameinfo F
+GLIBC_2.3 getnetbyaddr F
+GLIBC_2.3 getnetbyaddr_r F
+GLIBC_2.3 getnetbyname F
+GLIBC_2.3 getnetbyname_r F
+GLIBC_2.3 getnetent F
+GLIBC_2.3 getnetent_r F
+GLIBC_2.3 getnetgrent F
+GLIBC_2.3 getnetgrent_r F
+GLIBC_2.3 getnetname F
+GLIBC_2.3 getopt F
+GLIBC_2.3 getopt_long F
+GLIBC_2.3 getopt_long_only F
+GLIBC_2.3 getpagesize F
+GLIBC_2.3 getpass F
+GLIBC_2.3 getpeername F
+GLIBC_2.3 getpgid F
+GLIBC_2.3 getpgrp F
+GLIBC_2.3 getpid F
+GLIBC_2.3 getpmsg F
+GLIBC_2.3 getppid F
+GLIBC_2.3 getpriority F
+GLIBC_2.3 getprotobyname F
+GLIBC_2.3 getprotobyname_r F
+GLIBC_2.3 getprotobynumber F
+GLIBC_2.3 getprotobynumber_r F
+GLIBC_2.3 getprotoent F
+GLIBC_2.3 getprotoent_r F
+GLIBC_2.3 getpt F
+GLIBC_2.3 getpublickey F
+GLIBC_2.3 getpw F
+GLIBC_2.3 getpwent F
+GLIBC_2.3 getpwent_r F
+GLIBC_2.3 getpwnam F
+GLIBC_2.3 getpwnam_r F
+GLIBC_2.3 getpwuid F
+GLIBC_2.3 getpwuid_r F
+GLIBC_2.3 getresgid F
+GLIBC_2.3 getresuid F
+GLIBC_2.3 getrlimit F
+GLIBC_2.3 getrlimit64 F
+GLIBC_2.3 getrpcbyname F
+GLIBC_2.3 getrpcbyname_r F
+GLIBC_2.3 getrpcbynumber F
+GLIBC_2.3 getrpcbynumber_r F
+GLIBC_2.3 getrpcent F
+GLIBC_2.3 getrpcent_r F
+GLIBC_2.3 getrpcport F
+GLIBC_2.3 getrusage F
+GLIBC_2.3 gets F
+GLIBC_2.3 getsecretkey F
+GLIBC_2.3 getservbyname F
+GLIBC_2.3 getservbyname_r F
+GLIBC_2.3 getservbyport F
+GLIBC_2.3 getservbyport_r F
+GLIBC_2.3 getservent F
+GLIBC_2.3 getservent_r F
+GLIBC_2.3 getsid F
+GLIBC_2.3 getsockname F
+GLIBC_2.3 getsockopt F
+GLIBC_2.3 getspent F
+GLIBC_2.3 getspent_r F
+GLIBC_2.3 getspnam F
+GLIBC_2.3 getspnam_r F
+GLIBC_2.3 getsubopt F
+GLIBC_2.3 gettext F
+GLIBC_2.3 gettimeofday F
+GLIBC_2.3 getttyent F
+GLIBC_2.3 getttynam F
+GLIBC_2.3 getuid F
+GLIBC_2.3 getusershell F
+GLIBC_2.3 getutent F
+GLIBC_2.3 getutent_r F
+GLIBC_2.3 getutid F
+GLIBC_2.3 getutid_r F
+GLIBC_2.3 getutline F
+GLIBC_2.3 getutline_r F
+GLIBC_2.3 getutmp F
+GLIBC_2.3 getutmpx F
+GLIBC_2.3 getutxent F
+GLIBC_2.3 getutxid F
+GLIBC_2.3 getutxline F
+GLIBC_2.3 getw F
+GLIBC_2.3 getwc F
+GLIBC_2.3 getwc_unlocked F
+GLIBC_2.3 getwchar F
+GLIBC_2.3 getwchar_unlocked F
+GLIBC_2.3 getwd F
+GLIBC_2.3 getxattr F
+GLIBC_2.3 glob F
+GLIBC_2.3 glob64 F
+GLIBC_2.3 glob_pattern_p F
+GLIBC_2.3 globfree F
+GLIBC_2.3 globfree64 F
+GLIBC_2.3 gmtime F
+GLIBC_2.3 gmtime_r F
+GLIBC_2.3 gnu_get_libc_release F
+GLIBC_2.3 gnu_get_libc_version F
+GLIBC_2.3 grantpt F
+GLIBC_2.3 group_member F
+GLIBC_2.3 gsignal F
+GLIBC_2.3 gtty F
+GLIBC_2.3 h_errlist D 0x28
+GLIBC_2.3 h_nerr D 0x4
+GLIBC_2.3 hasmntopt F
+GLIBC_2.3 hcreate F
+GLIBC_2.3 hcreate_r F
+GLIBC_2.3 hdestroy F
+GLIBC_2.3 hdestroy_r F
+GLIBC_2.3 herror F
+GLIBC_2.3 host2netname F
+GLIBC_2.3 hsearch F
+GLIBC_2.3 hsearch_r F
+GLIBC_2.3 hstrerror F
+GLIBC_2.3 htonl F
+GLIBC_2.3 htons F
+GLIBC_2.3 iconv F
+GLIBC_2.3 iconv_close F
+GLIBC_2.3 iconv_open F
+GLIBC_2.3 if_freenameindex F
+GLIBC_2.3 if_indextoname F
+GLIBC_2.3 if_nameindex F
+GLIBC_2.3 if_nametoindex F
+GLIBC_2.3 imaxabs F
+GLIBC_2.3 imaxdiv F
+GLIBC_2.3 in6addr_any D 0x10
+GLIBC_2.3 in6addr_loopback D 0x10
+GLIBC_2.3 index F
+GLIBC_2.3 inet_addr F
+GLIBC_2.3 inet_aton F
+GLIBC_2.3 inet_lnaof F
+GLIBC_2.3 inet_makeaddr F
+GLIBC_2.3 inet_netof F
+GLIBC_2.3 inet_network F
+GLIBC_2.3 inet_nsap_addr F
+GLIBC_2.3 inet_nsap_ntoa F
+GLIBC_2.3 inet_ntoa F
+GLIBC_2.3 inet_ntop F
+GLIBC_2.3 inet_pton F
+GLIBC_2.3 initgroups F
+GLIBC_2.3 initstate F
+GLIBC_2.3 initstate_r F
+GLIBC_2.3 innetgr F
+GLIBC_2.3 insque F
+GLIBC_2.3 ioctl F
+GLIBC_2.3 iruserok F
+GLIBC_2.3 iruserok_af F
+GLIBC_2.3 isalnum F
+GLIBC_2.3 isalnum_l F
+GLIBC_2.3 isalpha F
+GLIBC_2.3 isalpha_l F
+GLIBC_2.3 isascii F
+GLIBC_2.3 isastream F
+GLIBC_2.3 isatty F
+GLIBC_2.3 isblank F
+GLIBC_2.3 isblank_l F
+GLIBC_2.3 iscntrl F
+GLIBC_2.3 iscntrl_l F
+GLIBC_2.3 isctype F
+GLIBC_2.3 isdigit F
+GLIBC_2.3 isdigit_l F
+GLIBC_2.3 isfdtype F
+GLIBC_2.3 isgraph F
+GLIBC_2.3 isgraph_l F
+GLIBC_2.3 isinf F
+GLIBC_2.3 isinff F
+GLIBC_2.3 isinfl F
+GLIBC_2.3 islower F
+GLIBC_2.3 islower_l F
+GLIBC_2.3 isnan F
+GLIBC_2.3 isnanf F
+GLIBC_2.3 isnanl F
+GLIBC_2.3 isprint F
+GLIBC_2.3 isprint_l F
+GLIBC_2.3 ispunct F
+GLIBC_2.3 ispunct_l F
+GLIBC_2.3 issetugid F
+GLIBC_2.3 isspace F
+GLIBC_2.3 isspace_l F
+GLIBC_2.3 isupper F
+GLIBC_2.3 isupper_l F
+GLIBC_2.3 iswalnum F
+GLIBC_2.3 iswalnum_l F
+GLIBC_2.3 iswalpha F
+GLIBC_2.3 iswalpha_l F
+GLIBC_2.3 iswblank F
+GLIBC_2.3 iswblank_l F
+GLIBC_2.3 iswcntrl F
+GLIBC_2.3 iswcntrl_l F
+GLIBC_2.3 iswctype F
+GLIBC_2.3 iswctype_l F
+GLIBC_2.3 iswdigit F
+GLIBC_2.3 iswdigit_l F
+GLIBC_2.3 iswgraph F
+GLIBC_2.3 iswgraph_l F
+GLIBC_2.3 iswlower F
+GLIBC_2.3 iswlower_l F
+GLIBC_2.3 iswprint F
+GLIBC_2.3 iswprint_l F
+GLIBC_2.3 iswpunct F
+GLIBC_2.3 iswpunct_l F
+GLIBC_2.3 iswspace F
+GLIBC_2.3 iswspace_l F
+GLIBC_2.3 iswupper F
+GLIBC_2.3 iswupper_l F
+GLIBC_2.3 iswxdigit F
+GLIBC_2.3 iswxdigit_l F
+GLIBC_2.3 isxdigit F
+GLIBC_2.3 isxdigit_l F
+GLIBC_2.3 jail F
+GLIBC_2.3 jrand48 F
+GLIBC_2.3 jrand48_r F
+GLIBC_2.3 key_decryptsession F
+GLIBC_2.3 key_decryptsession_pk F
+GLIBC_2.3 key_encryptsession F
+GLIBC_2.3 key_encryptsession_pk F
+GLIBC_2.3 key_gendes F
+GLIBC_2.3 key_get_conv F
+GLIBC_2.3 key_secretkey_is_set F
+GLIBC_2.3 key_setnet F
+GLIBC_2.3 key_setsecret F
+GLIBC_2.3 kill F
+GLIBC_2.3 killpg F
+GLIBC_2.3 kldfind F
+GLIBC_2.3 kldfirstmod F
+GLIBC_2.3 kldload F
+GLIBC_2.3 kldnext F
+GLIBC_2.3 kldstat F
+GLIBC_2.3 kldsym F
+GLIBC_2.3 kldunload F
+GLIBC_2.3 kldunloadf F
+GLIBC_2.3 ktrace F
+GLIBC_2.3 l64a F
+GLIBC_2.3 labs F
+GLIBC_2.3 lchmod F
+GLIBC_2.3 lchown F
+GLIBC_2.3 lckpwdf F
+GLIBC_2.3 lcong48 F
+GLIBC_2.3 lcong48_r F
+GLIBC_2.3 ldexp F
+GLIBC_2.3 ldexpf F
+GLIBC_2.3 ldexpl F
+GLIBC_2.3 ldiv F
+GLIBC_2.3 lfind F
+GLIBC_2.3 lgetxattr F
+GLIBC_2.3 link F
+GLIBC_2.3 listen F
+GLIBC_2.3 listxattr F
+GLIBC_2.3 llabs F
+GLIBC_2.3 lldiv F
+GLIBC_2.3 llistxattr F
+GLIBC_2.3 loc1 D 0x8
+GLIBC_2.3 loc2 D 0x8
+GLIBC_2.3 localeconv F
+GLIBC_2.3 localtime F
+GLIBC_2.3 localtime_r F
+GLIBC_2.3 lockf F
+GLIBC_2.3 lockf64 F
+GLIBC_2.3 locs D 0x8
+GLIBC_2.3 longjmp F
+GLIBC_2.3 lrand48 F
+GLIBC_2.3 lrand48_r F
+GLIBC_2.3 lremovexattr F
+GLIBC_2.3 lsearch F
+GLIBC_2.3 lseek F
+GLIBC_2.3 lseek64 F
+GLIBC_2.3 lsetxattr F
+GLIBC_2.3 lutimes F
+GLIBC_2.3 madvise F
+GLIBC_2.3 makecontext F
+GLIBC_2.3 mallinfo F
+GLIBC_2.3 malloc F
+GLIBC_2.3 malloc_get_state F
+GLIBC_2.3 malloc_set_state F
+GLIBC_2.3 malloc_stats F
+GLIBC_2.3 malloc_trim F
+GLIBC_2.3 malloc_usable_size F
+GLIBC_2.3 mallopt F
+GLIBC_2.3 mallwatch D 0x8
+GLIBC_2.3 mblen F
+GLIBC_2.3 mbrlen F
+GLIBC_2.3 mbrtowc F
+GLIBC_2.3 mbsinit F
+GLIBC_2.3 mbsnrtowcs F
+GLIBC_2.3 mbsrtowcs F
+GLIBC_2.3 mbstowcs F
+GLIBC_2.3 mbtowc F
+GLIBC_2.3 mcheck F
+GLIBC_2.3 mcheck_check_all F
+GLIBC_2.3 mcheck_pedantic F
+GLIBC_2.3 mcount F
+GLIBC_2.3 memalign F
+GLIBC_2.3 memccpy F
+GLIBC_2.3 memchr F
+GLIBC_2.3 memcmp F
+GLIBC_2.3 memcpy F
+GLIBC_2.3 memfrob F
+GLIBC_2.3 memmem F
+GLIBC_2.3 memmove F
+GLIBC_2.3 mempcpy F
+GLIBC_2.3 memrchr F
+GLIBC_2.3 memset F
+GLIBC_2.3 mincore F
+GLIBC_2.3 minherit F
+GLIBC_2.3 mkdir F
+GLIBC_2.3 mkdtemp F
+GLIBC_2.3 mkfifo F
+GLIBC_2.3 mkstemp F
+GLIBC_2.3 mkstemp64 F
+GLIBC_2.3 mktemp F
+GLIBC_2.3 mktime F
+GLIBC_2.3 mlock F
+GLIBC_2.3 mlockall F
+GLIBC_2.3 mmap F
+GLIBC_2.3 mmap64 F
+GLIBC_2.3 modf F
+GLIBC_2.3 modff F
+GLIBC_2.3 modfind F
+GLIBC_2.3 modfl F
+GLIBC_2.3 modfnext F
+GLIBC_2.3 modnext F
+GLIBC_2.3 modstat F
+GLIBC_2.3 moncontrol F
+GLIBC_2.3 monstartup F
+GLIBC_2.3 mount F
+GLIBC_2.3 mprobe F
+GLIBC_2.3 mprotect F
+GLIBC_2.3 mrand48 F
+GLIBC_2.3 mrand48_r F
+GLIBC_2.3 msgctl F
+GLIBC_2.3 msgget F
+GLIBC_2.3 msgrcv F
+GLIBC_2.3 msgsnd F
+GLIBC_2.3 msync F
+GLIBC_2.3 mtrace F
+GLIBC_2.3 munlock F
+GLIBC_2.3 munlockall F
+GLIBC_2.3 munmap F
+GLIBC_2.3 muntrace F
+GLIBC_2.3 nanosleep F
+GLIBC_2.3 netname2host F
+GLIBC_2.3 netname2user F
+GLIBC_2.3 newlocale F
+GLIBC_2.3 nftw F
+GLIBC_2.3 nftw64 F
+GLIBC_2.3 ngettext F
+GLIBC_2.3 nice F
+GLIBC_2.3 nl_langinfo F
+GLIBC_2.3 nl_langinfo_l F
+GLIBC_2.3 nmount F
+GLIBC_2.3 nrand48 F
+GLIBC_2.3 nrand48_r F
+GLIBC_2.3 ntohl F
+GLIBC_2.3 ntohs F
+GLIBC_2.3 ntp_adjtime F
+GLIBC_2.3 ntp_gettime F
+GLIBC_2.3 obstack_alloc_failed_handler D 0x8
+GLIBC_2.3 obstack_exit_failure D 0x4
+GLIBC_2.3 obstack_free F
+GLIBC_2.3 obstack_printf F
+GLIBC_2.3 obstack_vprintf F
+GLIBC_2.3 on_exit F
+GLIBC_2.3 open F
+GLIBC_2.3 open64 F
+GLIBC_2.3 open_memstream F
+GLIBC_2.3 opendir F
+GLIBC_2.3 openlog F
+GLIBC_2.3 optarg D 0x8
+GLIBC_2.3 opterr D 0x4
+GLIBC_2.3 optind D 0x4
+GLIBC_2.3 optopt D 0x4
+GLIBC_2.3 parse_printf_format F
+GLIBC_2.3 passwd2des F
+GLIBC_2.3 pathconf F
+GLIBC_2.3 pause F
+GLIBC_2.3 pclose F
+GLIBC_2.3 perror F
+GLIBC_2.3 pipe F
+GLIBC_2.3 pmap_getmaps F
+GLIBC_2.3 pmap_getport F
+GLIBC_2.3 pmap_rmtcall F
+GLIBC_2.3 pmap_set F
+GLIBC_2.3 pmap_unset F
+GLIBC_2.3 poll F
+GLIBC_2.3 popen F
+GLIBC_2.3 posix_fadvise F
+GLIBC_2.3 posix_fadvise64 F
+GLIBC_2.3 posix_fallocate F
+GLIBC_2.3 posix_fallocate64 F
+GLIBC_2.3 posix_madvise F
+GLIBC_2.3 posix_memalign F
+GLIBC_2.3 posix_openpt F
+GLIBC_2.3 posix_spawn F
+GLIBC_2.3 posix_spawn_file_actions_addclose F
+GLIBC_2.3 posix_spawn_file_actions_adddup2 F
+GLIBC_2.3 posix_spawn_file_actions_addopen F
+GLIBC_2.3 posix_spawn_file_actions_destroy F
+GLIBC_2.3 posix_spawn_file_actions_init F
+GLIBC_2.3 posix_spawnattr_destroy F
+GLIBC_2.3 posix_spawnattr_getflags F
+GLIBC_2.3 posix_spawnattr_getpgroup F
+GLIBC_2.3 posix_spawnattr_getschedparam F
+GLIBC_2.3 posix_spawnattr_getschedpolicy F
+GLIBC_2.3 posix_spawnattr_getsigdefault F
+GLIBC_2.3 posix_spawnattr_getsigmask F
+GLIBC_2.3 posix_spawnattr_init F
+GLIBC_2.3 posix_spawnattr_setflags F
+GLIBC_2.3 posix_spawnattr_setpgroup F
+GLIBC_2.3 posix_spawnattr_setschedparam F
+GLIBC_2.3 posix_spawnattr_setschedpolicy F
+GLIBC_2.3 posix_spawnattr_setsigdefault F
+GLIBC_2.3 posix_spawnattr_setsigmask F
+GLIBC_2.3 posix_spawnp F
+GLIBC_2.3 pread F
+GLIBC_2.3 pread64 F
+GLIBC_2.3 printf F
+GLIBC_2.3 printf_size F
+GLIBC_2.3 printf_size_info F
+GLIBC_2.3 profil F
+GLIBC_2.3 program_invocation_name D 0x8
+GLIBC_2.3 program_invocation_short_name D 0x8
+GLIBC_2.3 pselect F
+GLIBC_2.3 psignal F
+GLIBC_2.3 pthread_attr_destroy F
+GLIBC_2.3 pthread_attr_getdetachstate F
+GLIBC_2.3 pthread_attr_getinheritsched F
+GLIBC_2.3 pthread_attr_getschedparam F
+GLIBC_2.3 pthread_attr_getschedpolicy F
+GLIBC_2.3 pthread_attr_getscope F
+GLIBC_2.3 pthread_attr_init F
+GLIBC_2.3 pthread_attr_setdetachstate F
+GLIBC_2.3 pthread_attr_setinheritsched F
+GLIBC_2.3 pthread_attr_setschedparam F
+GLIBC_2.3 pthread_attr_setschedpolicy F
+GLIBC_2.3 pthread_attr_setscope F
+GLIBC_2.3 pthread_cond_broadcast F
+GLIBC_2.3 pthread_cond_destroy F
+GLIBC_2.3 pthread_cond_init F
+GLIBC_2.3 pthread_cond_signal F
+GLIBC_2.3 pthread_cond_timedwait F
+GLIBC_2.3 pthread_cond_wait F
+GLIBC_2.3 pthread_condattr_destroy F
+GLIBC_2.3 pthread_condattr_init F
+GLIBC_2.3 pthread_equal F
+GLIBC_2.3 pthread_exit F
+GLIBC_2.3 pthread_getschedparam F
+GLIBC_2.3 pthread_mutex_destroy F
+GLIBC_2.3 pthread_mutex_init F
+GLIBC_2.3 pthread_mutex_lock F
+GLIBC_2.3 pthread_mutex_unlock F
+GLIBC_2.3 pthread_self F
+GLIBC_2.3 pthread_setcancelstate F
+GLIBC_2.3 pthread_setcanceltype F
+GLIBC_2.3 pthread_setschedparam F
+GLIBC_2.3 ptrace F
+GLIBC_2.3 ptsname F
+GLIBC_2.3 ptsname_r F
+GLIBC_2.3 putc F
+GLIBC_2.3 putc_unlocked F
+GLIBC_2.3 putchar F
+GLIBC_2.3 putchar_unlocked F
+GLIBC_2.3 putenv F
+GLIBC_2.3 putgrent F
+GLIBC_2.3 putmsg F
+GLIBC_2.3 putpmsg F
+GLIBC_2.3 putpwent F
+GLIBC_2.3 puts F
+GLIBC_2.3 putspent F
+GLIBC_2.3 pututline F
+GLIBC_2.3 pututxline F
+GLIBC_2.3 putw F
+GLIBC_2.3 putwc F
+GLIBC_2.3 putwc_unlocked F
+GLIBC_2.3 putwchar F
+GLIBC_2.3 putwchar_unlocked F
+GLIBC_2.3 pvalloc F
+GLIBC_2.3 pwrite F
+GLIBC_2.3 pwrite64 F
+GLIBC_2.3 qecvt F
+GLIBC_2.3 qecvt_r F
+GLIBC_2.3 qfcvt F
+GLIBC_2.3 qfcvt_r F
+GLIBC_2.3 qgcvt F
+GLIBC_2.3 qsort F
+GLIBC_2.3 quotactl F
+GLIBC_2.3 raise F
+GLIBC_2.3 rand F
+GLIBC_2.3 rand_r F
+GLIBC_2.3 random F
+GLIBC_2.3 random_r F
+GLIBC_2.3 rawmemchr F
+GLIBC_2.3 rcmd F
+GLIBC_2.3 rcmd_af F
+GLIBC_2.3 re_comp F
+GLIBC_2.3 re_compile_fastmap F
+GLIBC_2.3 re_compile_pattern F
+GLIBC_2.3 re_exec F
+GLIBC_2.3 re_match F
+GLIBC_2.3 re_match_2 F
+GLIBC_2.3 re_search F
+GLIBC_2.3 re_search_2 F
+GLIBC_2.3 re_set_registers F
+GLIBC_2.3 re_set_syntax F
+GLIBC_2.3 re_syntax_options D 0x8
+GLIBC_2.3 read F
+GLIBC_2.3 readdir F
+GLIBC_2.3 readdir64 F
+GLIBC_2.3 readdir64_r F
+GLIBC_2.3 readdir_r F
+GLIBC_2.3 readlink F
+GLIBC_2.3 readv F
+GLIBC_2.3 realloc F
+GLIBC_2.3 realpath F
+GLIBC_2.3 reboot F
+GLIBC_2.3 recv F
+GLIBC_2.3 recvfrom F
+GLIBC_2.3 recvmsg F
+GLIBC_2.3 regcomp F
+GLIBC_2.3 regerror F
+GLIBC_2.3 regexec F
+GLIBC_2.3 regfree F
+GLIBC_2.3 register_printf_function F
+GLIBC_2.3 registerrpc F
+GLIBC_2.3 remove F
+GLIBC_2.3 removexattr F
+GLIBC_2.3 remque F
+GLIBC_2.3 rename F
+GLIBC_2.3 revoke F
+GLIBC_2.3 rewind F
+GLIBC_2.3 rewinddir F
+GLIBC_2.3 rexec F
+GLIBC_2.3 rexec_af F
+GLIBC_2.3 rexecoptions D 0x4
+GLIBC_2.3 rfork F
+GLIBC_2.3 rindex F
+GLIBC_2.3 rmdir F
+GLIBC_2.3 rpc_createerr D 0x20
+GLIBC_2.3 rpmatch F
+GLIBC_2.3 rresvport F
+GLIBC_2.3 rresvport_af F
+GLIBC_2.3 rtime F
+GLIBC_2.3 rtprio F
+GLIBC_2.3 ruserok F
+GLIBC_2.3 ruserok_af F
+GLIBC_2.3 ruserpass F
+GLIBC_2.3 sbrk F
+GLIBC_2.3 scalbn F
+GLIBC_2.3 scalbnf F
+GLIBC_2.3 scalbnl F
+GLIBC_2.3 scandir F
+GLIBC_2.3 scandir64 F
+GLIBC_2.3 scanf F
+GLIBC_2.3 sched_get_priority_max F
+GLIBC_2.3 sched_get_priority_min F
+GLIBC_2.3 sched_getparam F
+GLIBC_2.3 sched_getscheduler F
+GLIBC_2.3 sched_rr_get_interval F
+GLIBC_2.3 sched_setparam F
+GLIBC_2.3 sched_setscheduler F
+GLIBC_2.3 sched_yield F
+GLIBC_2.3 seed48 F
+GLIBC_2.3 seed48_r F
+GLIBC_2.3 seekdir F
+GLIBC_2.3 select F
+GLIBC_2.3 semctl F
+GLIBC_2.3 semget F
+GLIBC_2.3 semop F
+GLIBC_2.3 send F
+GLIBC_2.3 sendfile F
+GLIBC_2.3 sendfile64 F
+GLIBC_2.3 sendmsg F
+GLIBC_2.3 sendto F
+GLIBC_2.3 setaliasent F
+GLIBC_2.3 setbuf F
+GLIBC_2.3 setbuffer F
+GLIBC_2.3 setcontext F
+GLIBC_2.3 setdomainname F
+GLIBC_2.3 setegid F
+GLIBC_2.3 setenv F
+GLIBC_2.3 seteuid F
+GLIBC_2.3 setfsent F
+GLIBC_2.3 setgid F
+GLIBC_2.3 setgrent F
+GLIBC_2.3 setgroups F
+GLIBC_2.3 sethostent F
+GLIBC_2.3 sethostid F
+GLIBC_2.3 sethostname F
+GLIBC_2.3 setitimer F
+GLIBC_2.3 setjmp F
+GLIBC_2.3 setlinebuf F
+GLIBC_2.3 setlocale F
+GLIBC_2.3 setlogin F
+GLIBC_2.3 setlogmask F
+GLIBC_2.3 setmntent F
+GLIBC_2.3 setnetent F
+GLIBC_2.3 setnetgrent F
+GLIBC_2.3 setpgid F
+GLIBC_2.3 setpgrp F
+GLIBC_2.3 setpriority F
+GLIBC_2.3 setprotoent F
+GLIBC_2.3 setpwent F
+GLIBC_2.3 setregid F
+GLIBC_2.3 setresgid F
+GLIBC_2.3 setresuid F
+GLIBC_2.3 setreuid F
+GLIBC_2.3 setrlimit F
+GLIBC_2.3 setrlimit64 F
+GLIBC_2.3 setrpcent F
+GLIBC_2.3 setservent F
+GLIBC_2.3 setsid F
+GLIBC_2.3 setsockopt F
+GLIBC_2.3 setspent F
+GLIBC_2.3 setstate F
+GLIBC_2.3 setstate_r F
+GLIBC_2.3 settimeofday F
+GLIBC_2.3 setttyent F
+GLIBC_2.3 setuid F
+GLIBC_2.3 setusershell F
+GLIBC_2.3 setutent F
+GLIBC_2.3 setutxent F
+GLIBC_2.3 setvbuf F
+GLIBC_2.3 setxattr F
+GLIBC_2.3 sgetspent F
+GLIBC_2.3 sgetspent_r F
+GLIBC_2.3 shmat F
+GLIBC_2.3 shmctl F
+GLIBC_2.3 shmdt F
+GLIBC_2.3 shmget F
+GLIBC_2.3 shutdown F
+GLIBC_2.3 sigaction F
+GLIBC_2.3 sigaddset F
+GLIBC_2.3 sigaltstack F
+GLIBC_2.3 sigandset F
+GLIBC_2.3 sigblock F
+GLIBC_2.3 sigdelset F
+GLIBC_2.3 sigemptyset F
+GLIBC_2.3 sigfillset F
+GLIBC_2.3 siggetmask F
+GLIBC_2.3 sighold F
+GLIBC_2.3 sigignore F
+GLIBC_2.3 siginterrupt F
+GLIBC_2.3 sigisemptyset F
+GLIBC_2.3 sigismember F
+GLIBC_2.3 siglongjmp F
+GLIBC_2.3 signal F
+GLIBC_2.3 sigorset F
+GLIBC_2.3 sigpause F
+GLIBC_2.3 sigpending F
+GLIBC_2.3 sigprocmask F
+GLIBC_2.3 sigqueue F
+GLIBC_2.3 sigrelse F
+GLIBC_2.3 sigreturn F
+GLIBC_2.3 sigset F
+GLIBC_2.3 sigsetmask F
+GLIBC_2.3 sigstack F
+GLIBC_2.3 sigsuspend F
+GLIBC_2.3 sigtimedwait F
+GLIBC_2.3 sigvec F
+GLIBC_2.3 sigwait F
+GLIBC_2.3 sigwaitinfo F
+GLIBC_2.3 sleep F
+GLIBC_2.3 snprintf F
+GLIBC_2.3 sockatmark F
+GLIBC_2.3 socket F
+GLIBC_2.3 socketpair F
+GLIBC_2.3 sprintf F
+GLIBC_2.3 sprofil F
+GLIBC_2.3 srand F
+GLIBC_2.3 srand48 F
+GLIBC_2.3 srand48_r F
+GLIBC_2.3 srandom F
+GLIBC_2.3 srandom_r F
+GLIBC_2.3 sscanf F
+GLIBC_2.3 ssignal F
+GLIBC_2.3 sstk F
+GLIBC_2.3 statfs F
+GLIBC_2.3 statfs64 F
+GLIBC_2.3 statvfs F
+GLIBC_2.3 statvfs64 F
+GLIBC_2.3 stderr D 0x8
+GLIBC_2.3 stdin D 0x8
+GLIBC_2.3 stdout D 0x8
+GLIBC_2.3 step F
+GLIBC_2.3 stime F
+GLIBC_2.3 stpcpy F
+GLIBC_2.3 stpncpy F
+GLIBC_2.3 strcasecmp F
+GLIBC_2.3 strcasecmp_l F
+GLIBC_2.3 strcasestr F
+GLIBC_2.3 strcat F
+GLIBC_2.3 strchr F
+GLIBC_2.3 strchrnul F
+GLIBC_2.3 strcmp F
+GLIBC_2.3 strcoll F
+GLIBC_2.3 strcoll_l F
+GLIBC_2.3 strcpy F
+GLIBC_2.3 strcspn F
+GLIBC_2.3 strdup F
+GLIBC_2.3 strerror F
+GLIBC_2.3 strerror_r F
+GLIBC_2.3 strfmon F
+GLIBC_2.3 strfmon_l F
+GLIBC_2.3 strfry F
+GLIBC_2.3 strftime F
+GLIBC_2.3 strftime_l F
+GLIBC_2.3 strlen F
+GLIBC_2.3 strncasecmp F
+GLIBC_2.3 strncasecmp_l F
+GLIBC_2.3 strncat F
+GLIBC_2.3 strncmp F
+GLIBC_2.3 strncpy F
+GLIBC_2.3 strndup F
+GLIBC_2.3 strnlen F
+GLIBC_2.3 strpbrk F
+GLIBC_2.3 strptime F
+GLIBC_2.3 strrchr F
+GLIBC_2.3 strsep F
+GLIBC_2.3 strsignal F
+GLIBC_2.3 strspn F
+GLIBC_2.3 strstr F
+GLIBC_2.3 strtod F
+GLIBC_2.3 strtod_l F
+GLIBC_2.3 strtof F
+GLIBC_2.3 strtof_l F
+GLIBC_2.3 strtoimax F
+GLIBC_2.3 strtok F
+GLIBC_2.3 strtok_r F
+GLIBC_2.3 strtol F
+GLIBC_2.3 strtol_l F
+GLIBC_2.3 strtold F
+GLIBC_2.3 strtold_l F
+GLIBC_2.3 strtoll F
+GLIBC_2.3 strtoq F
+GLIBC_2.3 strtoul F
+GLIBC_2.3 strtoul_l F
+GLIBC_2.3 strtoull F
+GLIBC_2.3 strtoumax F
+GLIBC_2.3 strtouq F
+GLIBC_2.3 strverscmp F
+GLIBC_2.3 strxfrm F
+GLIBC_2.3 strxfrm_l F
+GLIBC_2.3 stty F
+GLIBC_2.3 svc_exit F
+GLIBC_2.3 svc_fdset D 0x80
+GLIBC_2.3 svc_getreq F
+GLIBC_2.3 svc_getreq_common F
+GLIBC_2.3 svc_getreq_poll F
+GLIBC_2.3 svc_getreqset F
+GLIBC_2.3 svc_max_pollfd D 0x4
+GLIBC_2.3 svc_pollfd D 0x8
+GLIBC_2.3 svc_register F
+GLIBC_2.3 svc_run F
+GLIBC_2.3 svc_sendreply F
+GLIBC_2.3 svc_unregister F
+GLIBC_2.3 svcauthdes_stats D 0x18
+GLIBC_2.3 svcerr_auth F
+GLIBC_2.3 svcerr_decode F
+GLIBC_2.3 svcerr_noproc F
+GLIBC_2.3 svcerr_noprog F
+GLIBC_2.3 svcerr_progvers F
+GLIBC_2.3 svcerr_systemerr F
+GLIBC_2.3 svcerr_weakauth F
+GLIBC_2.3 svcfd_create F
+GLIBC_2.3 svcraw_create F
+GLIBC_2.3 svctcp_create F
+GLIBC_2.3 svcudp_bufcreate F
+GLIBC_2.3 svcudp_create F
+GLIBC_2.3 svcudp_enablecache F
+GLIBC_2.3 svcunix_create F
+GLIBC_2.3 svcunixfd_create F
+GLIBC_2.3 swab F
+GLIBC_2.3 swapcontext F
+GLIBC_2.3 swapoff F
+GLIBC_2.3 swapon F
+GLIBC_2.3 swprintf F
+GLIBC_2.3 swscanf F
+GLIBC_2.3 symlink F
+GLIBC_2.3 sync F
+GLIBC_2.3 sys_errlist D 0x2b8
+GLIBC_2.3 sys_nerr D 0x4
+GLIBC_2.3 sys_sigabbrev D 0x408
+GLIBC_2.3 sys_siglist D 0x408
+GLIBC_2.3 sysarch F
+GLIBC_2.3 syscall F
+GLIBC_2.3 sysconf F
+GLIBC_2.3 sysctl F
+GLIBC_2.3 sysctlbyname F
+GLIBC_2.3 syslog F
+GLIBC_2.3 system F
+GLIBC_2.3 sysv_signal F
+GLIBC_2.3 tcdrain F
+GLIBC_2.3 tcflow F
+GLIBC_2.3 tcflush F
+GLIBC_2.3 tcgetattr F
+GLIBC_2.3 tcgetpgrp F
+GLIBC_2.3 tcgetsid F
+GLIBC_2.3 tcsendbreak F
+GLIBC_2.3 tcsetattr F
+GLIBC_2.3 tcsetpgrp F
+GLIBC_2.3 tdelete F
+GLIBC_2.3 tdestroy F
+GLIBC_2.3 telldir F
+GLIBC_2.3 tempnam F
+GLIBC_2.3 textdomain F
+GLIBC_2.3 tfind F
+GLIBC_2.3 time F
+GLIBC_2.3 timegm F
+GLIBC_2.3 timelocal F
+GLIBC_2.3 times F
+GLIBC_2.3 timezone D 0x8
+GLIBC_2.3 tmpfile F
+GLIBC_2.3 tmpfile64 F
+GLIBC_2.3 tmpnam F
+GLIBC_2.3 tmpnam_r F
+GLIBC_2.3 toascii F
+GLIBC_2.3 tolower F
+GLIBC_2.3 tolower_l F
+GLIBC_2.3 toupper F
+GLIBC_2.3 toupper_l F
+GLIBC_2.3 towctrans F
+GLIBC_2.3 towctrans_l F
+GLIBC_2.3 towlower F
+GLIBC_2.3 towlower_l F
+GLIBC_2.3 towupper F
+GLIBC_2.3 towupper_l F
+GLIBC_2.3 tr_break F
+GLIBC_2.3 truncate F
+GLIBC_2.3 truncate64 F
+GLIBC_2.3 tsearch F
+GLIBC_2.3 ttyname F
+GLIBC_2.3 ttyname_r F
+GLIBC_2.3 ttyslot F
+GLIBC_2.3 twalk F
+GLIBC_2.3 tzname D 0x10
+GLIBC_2.3 tzset F
+GLIBC_2.3 ualarm F
+GLIBC_2.3 ulckpwdf F
+GLIBC_2.3 ulimit F
+GLIBC_2.3 umask F
+GLIBC_2.3 uname F
+GLIBC_2.3 undelete F
+GLIBC_2.3 ungetc F
+GLIBC_2.3 ungetwc F
+GLIBC_2.3 unlink F
+GLIBC_2.3 unlockpt F
+GLIBC_2.3 unmount F
+GLIBC_2.3 unsetenv F
+GLIBC_2.3 updwtmp F
+GLIBC_2.3 updwtmpx F
+GLIBC_2.3 uselocale F
+GLIBC_2.3 user2netname F
+GLIBC_2.3 usleep F
+GLIBC_2.3 ustat F
+GLIBC_2.3 utime F
+GLIBC_2.3 utimes F
+GLIBC_2.3 utmpname F
+GLIBC_2.3 utmpxname F
+GLIBC_2.3 utrace F
+GLIBC_2.3 valloc F
+GLIBC_2.3 vasprintf F
+GLIBC_2.3 vdprintf F
+GLIBC_2.3 verr F
+GLIBC_2.3 verrx F
+GLIBC_2.3 versionsort F
+GLIBC_2.3 versionsort64 F
+GLIBC_2.3 vfork F
+GLIBC_2.3 vfprintf F
+GLIBC_2.3 vfscanf F
+GLIBC_2.3 vfwprintf F
+GLIBC_2.3 vfwscanf F
+GLIBC_2.3 vhangup F
+GLIBC_2.3 vlimit F
+GLIBC_2.3 vprintf F
+GLIBC_2.3 vscanf F
+GLIBC_2.3 vsnprintf F
+GLIBC_2.3 vsprintf F
+GLIBC_2.3 vsscanf F
+GLIBC_2.3 vswprintf F
+GLIBC_2.3 vswscanf F
+GLIBC_2.3 vsyslog F
+GLIBC_2.3 vtimes F
+GLIBC_2.3 vwarn F
+GLIBC_2.3 vwarnx F
+GLIBC_2.3 vwprintf F
+GLIBC_2.3 vwscanf F
+GLIBC_2.3 wait F
+GLIBC_2.3 wait3 F
+GLIBC_2.3 wait4 F
+GLIBC_2.3 waitid F
+GLIBC_2.3 waitpid F
+GLIBC_2.3 warn F
+GLIBC_2.3 warnx F
+GLIBC_2.3 wcpcpy F
+GLIBC_2.3 wcpncpy F
+GLIBC_2.3 wcrtomb F
+GLIBC_2.3 wcscasecmp F
+GLIBC_2.3 wcscasecmp_l F
+GLIBC_2.3 wcscat F
+GLIBC_2.3 wcschr F
+GLIBC_2.3 wcschrnul F
+GLIBC_2.3 wcscmp F
+GLIBC_2.3 wcscoll F
+GLIBC_2.3 wcscoll_l F
+GLIBC_2.3 wcscpy F
+GLIBC_2.3 wcscspn F
+GLIBC_2.3 wcsdup F
+GLIBC_2.3 wcsftime F
+GLIBC_2.3 wcsftime_l F
+GLIBC_2.3 wcslen F
+GLIBC_2.3 wcsncasecmp F
+GLIBC_2.3 wcsncasecmp_l F
+GLIBC_2.3 wcsncat F
+GLIBC_2.3 wcsncmp F
+GLIBC_2.3 wcsncpy F
+GLIBC_2.3 wcsnlen F
+GLIBC_2.3 wcsnrtombs F
+GLIBC_2.3 wcspbrk F
+GLIBC_2.3 wcsrchr F
+GLIBC_2.3 wcsrtombs F
+GLIBC_2.3 wcsspn F
+GLIBC_2.3 wcsstr F
+GLIBC_2.3 wcstod F
+GLIBC_2.3 wcstod_l F
+GLIBC_2.3 wcstof F
+GLIBC_2.3 wcstof_l F
+GLIBC_2.3 wcstoimax F
+GLIBC_2.3 wcstok F
+GLIBC_2.3 wcstol F
+GLIBC_2.3 wcstol_l F
+GLIBC_2.3 wcstold F
+GLIBC_2.3 wcstold_l F
+GLIBC_2.3 wcstoll F
+GLIBC_2.3 wcstoll_l F
+GLIBC_2.3 wcstombs F
+GLIBC_2.3 wcstoq F
+GLIBC_2.3 wcstoul F
+GLIBC_2.3 wcstoul_l F
+GLIBC_2.3 wcstoull F
+GLIBC_2.3 wcstoull_l F
+GLIBC_2.3 wcstoumax F
+GLIBC_2.3 wcstouq F
+GLIBC_2.3 wcswcs F
+GLIBC_2.3 wcswidth F
+GLIBC_2.3 wcsxfrm F
+GLIBC_2.3 wcsxfrm_l F
+GLIBC_2.3 wctob F
+GLIBC_2.3 wctomb F
+GLIBC_2.3 wctrans F
+GLIBC_2.3 wctrans_l F
+GLIBC_2.3 wctype F
+GLIBC_2.3 wctype_l F
+GLIBC_2.3 wcwidth F
+GLIBC_2.3 wmemchr F
+GLIBC_2.3 wmemcmp F
+GLIBC_2.3 wmemcpy F
+GLIBC_2.3 wmemmove F
+GLIBC_2.3 wmempcpy F
+GLIBC_2.3 wmemset F
+GLIBC_2.3 wordexp F
+GLIBC_2.3 wordfree F
+GLIBC_2.3 wprintf F
+GLIBC_2.3 write F
+GLIBC_2.3 writev F
+GLIBC_2.3 wscanf F
+GLIBC_2.3 xdecrypt F
+GLIBC_2.3 xdr_accepted_reply F
+GLIBC_2.3 xdr_array F
+GLIBC_2.3 xdr_authdes_cred F
+GLIBC_2.3 xdr_authdes_verf F
+GLIBC_2.3 xdr_authunix_parms F
+GLIBC_2.3 xdr_bool F
+GLIBC_2.3 xdr_bytes F
+GLIBC_2.3 xdr_callhdr F
+GLIBC_2.3 xdr_callmsg F
+GLIBC_2.3 xdr_char F
+GLIBC_2.3 xdr_cryptkeyarg F
+GLIBC_2.3 xdr_cryptkeyarg2 F
+GLIBC_2.3 xdr_cryptkeyres F
+GLIBC_2.3 xdr_des_block F
+GLIBC_2.3 xdr_double F
+GLIBC_2.3 xdr_enum F
+GLIBC_2.3 xdr_float F
+GLIBC_2.3 xdr_free F
+GLIBC_2.3 xdr_getcredres F
+GLIBC_2.3 xdr_hyper F
+GLIBC_2.3 xdr_int F
+GLIBC_2.3 xdr_int16_t F
+GLIBC_2.3 xdr_int32_t F
+GLIBC_2.3 xdr_int64_t F
+GLIBC_2.3 xdr_int8_t F
+GLIBC_2.3 xdr_key_netstarg F
+GLIBC_2.3 xdr_key_netstres F
+GLIBC_2.3 xdr_keybuf F
+GLIBC_2.3 xdr_keystatus F
+GLIBC_2.3 xdr_long F
+GLIBC_2.3 xdr_longlong_t F
+GLIBC_2.3 xdr_netnamestr F
+GLIBC_2.3 xdr_netobj F
+GLIBC_2.3 xdr_opaque F
+GLIBC_2.3 xdr_opaque_auth F
+GLIBC_2.3 xdr_pmap F
+GLIBC_2.3 xdr_pmaplist F
+GLIBC_2.3 xdr_pointer F
+GLIBC_2.3 xdr_reference F
+GLIBC_2.3 xdr_rejected_reply F
+GLIBC_2.3 xdr_replymsg F
+GLIBC_2.3 xdr_rmtcall_args F
+GLIBC_2.3 xdr_rmtcallres F
+GLIBC_2.3 xdr_short F
+GLIBC_2.3 xdr_sizeof F
+GLIBC_2.3 xdr_string F
+GLIBC_2.3 xdr_u_char F
+GLIBC_2.3 xdr_u_hyper F
+GLIBC_2.3 xdr_u_int F
+GLIBC_2.3 xdr_u_long F
+GLIBC_2.3 xdr_u_longlong_t F
+GLIBC_2.3 xdr_u_short F
+GLIBC_2.3 xdr_uint16_t F
+GLIBC_2.3 xdr_uint32_t F
+GLIBC_2.3 xdr_uint64_t F
+GLIBC_2.3 xdr_uint8_t F
+GLIBC_2.3 xdr_union F
+GLIBC_2.3 xdr_unixcred F
+GLIBC_2.3 xdr_vector F
+GLIBC_2.3 xdr_void F
+GLIBC_2.3 xdr_wrapstring F
+GLIBC_2.3 xdrmem_create F
+GLIBC_2.3 xdrrec_create F
+GLIBC_2.3 xdrrec_endofrecord F
+GLIBC_2.3 xdrrec_eof F
+GLIBC_2.3 xdrrec_skiprecord F
+GLIBC_2.3 xdrstdio_create F
+GLIBC_2.3 xencrypt F
+GLIBC_2.3 xprt_register F
+GLIBC_2.3 xprt_unregister F
+GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.3.2 __register_atfork F
+GLIBC_2.3.2 pthread_cond_broadcast F
+GLIBC_2.3.2 pthread_cond_destroy F
+GLIBC_2.3.2 pthread_cond_init F
+GLIBC_2.3.2 pthread_cond_signal F
+GLIBC_2.3.2 pthread_cond_timedwait F
+GLIBC_2.3.2 pthread_cond_wait F
+GLIBC_2.3.2 strptime_l F
+GLIBC_2.3.3 GLIBC_2.3.3 A
+GLIBC_2.3.3 inet6_option_alloc F
+GLIBC_2.3.3 inet6_option_append F
+GLIBC_2.3.3 inet6_option_find F
+GLIBC_2.3.3 inet6_option_init F
+GLIBC_2.3.3 inet6_option_next F
+GLIBC_2.3.3 inet6_option_space F
+GLIBC_2.3.3 nftw F
+GLIBC_2.3.3 nftw64 F
+GLIBC_2.3.3 remap_file_pages F
+GLIBC_2.3.3 sched_getaffinity F
+GLIBC_2.3.3 sched_setaffinity F
+GLIBC_2.3.3 semtimedop F
+GLIBC_2.3.3 strtoll_l F
+GLIBC_2.3.3 strtoull_l F
+GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.3.4 __chk_fail F
+GLIBC_2.3.4 __fprintf_chk F
+GLIBC_2.3.4 __gets_chk F
+GLIBC_2.3.4 __libc_sa_len F
+GLIBC_2.3.4 __memcpy_chk F
+GLIBC_2.3.4 __memmove_chk F
+GLIBC_2.3.4 __mempcpy_chk F
+GLIBC_2.3.4 __memset_chk F
+GLIBC_2.3.4 __printf_chk F
+GLIBC_2.3.4 __snprintf_chk F
+GLIBC_2.3.4 __sprintf_chk F
+GLIBC_2.3.4 __stpcpy_chk F
+GLIBC_2.3.4 __strcat_chk F
+GLIBC_2.3.4 __strcpy_chk F
+GLIBC_2.3.4 __strncat_chk F
+GLIBC_2.3.4 __strncpy_chk F
+GLIBC_2.3.4 __vfprintf_chk F
+GLIBC_2.3.4 __vprintf_chk F
+GLIBC_2.3.4 __vsnprintf_chk F
+GLIBC_2.3.4 __vsprintf_chk F
+GLIBC_2.3.4 __xpg_strerror_r F
+GLIBC_2.3.4 _sys_errlist D 0x2e8
+GLIBC_2.3.4 _sys_nerr D 0x4
+GLIBC_2.3.4 fhstat64 F
+GLIBC_2.3.4 fhstatfs64 F
+GLIBC_2.3.4 getipv4sourcefilter F
+GLIBC_2.3.4 getsourcefilter F
+GLIBC_2.3.4 iopl F
+GLIBC_2.3.4 kevent F
+GLIBC_2.3.4 kqueue F
+GLIBC_2.3.4 regexec F
+GLIBC_2.3.4 setipv4sourcefilter F
+GLIBC_2.3.4 setsourcefilter F
+GLIBC_2.3.4 sys_errlist D 0x2e8
+GLIBC_2.3.4 sys_nerr D 0x4
+GLIBC_2.3.4 xdr_quad_t F
+GLIBC_2.3.4 xdr_u_quad_t F
+GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.4 __confstr_chk F
+GLIBC_2.4 __fgets_chk F
+GLIBC_2.4 __fgets_unlocked_chk F
+GLIBC_2.4 __fgetws_chk F
+GLIBC_2.4 __fgetws_unlocked_chk F
+GLIBC_2.4 __fwprintf_chk F
+GLIBC_2.4 __fxstatat F
+GLIBC_2.4 __fxstatat64 F
+GLIBC_2.4 __getcwd_chk F
+GLIBC_2.4 __getdomainname_chk F
+GLIBC_2.4 __getgroups_chk F
+GLIBC_2.4 __gethostname_chk F
+GLIBC_2.4 __getlogin_r_chk F
+GLIBC_2.4 __getwd_chk F
+GLIBC_2.4 __mbsnrtowcs_chk F
+GLIBC_2.4 __mbsrtowcs_chk F
+GLIBC_2.4 __mbstowcs_chk F
+GLIBC_2.4 __pread64_chk F
+GLIBC_2.4 __pread_chk F
+GLIBC_2.4 __ptsname_r_chk F
+GLIBC_2.4 __read_chk F
+GLIBC_2.4 __readlink_chk F
+GLIBC_2.4 __realpath_chk F
+GLIBC_2.4 __recv_chk F
+GLIBC_2.4 __recvfrom_chk F
+GLIBC_2.4 __stack_chk_fail F
+GLIBC_2.4 __stpncpy_chk F
+GLIBC_2.4 __swprintf_chk F
+GLIBC_2.4 __syslog_chk F
+GLIBC_2.4 __ttyname_r_chk F
+GLIBC_2.4 __vfwprintf_chk F
+GLIBC_2.4 __vswprintf_chk F
+GLIBC_2.4 __vsyslog_chk F
+GLIBC_2.4 __vwprintf_chk F
+GLIBC_2.4 __wcpcpy_chk F
+GLIBC_2.4 __wcpncpy_chk F
+GLIBC_2.4 __wcrtomb_chk F
+GLIBC_2.4 __wcscat_chk F
+GLIBC_2.4 __wcscpy_chk F
+GLIBC_2.4 __wcsncat_chk F
+GLIBC_2.4 __wcsncpy_chk F
+GLIBC_2.4 __wcsnrtombs_chk F
+GLIBC_2.4 __wcsrtombs_chk F
+GLIBC_2.4 __wcstombs_chk F
+GLIBC_2.4 __wctomb_chk F
+GLIBC_2.4 __wmemcpy_chk F
+GLIBC_2.4 __wmemmove_chk F
+GLIBC_2.4 __wmempcpy_chk F
+GLIBC_2.4 __wmemset_chk F
+GLIBC_2.4 __wprintf_chk F
+GLIBC_2.4 __xmknodat F
+GLIBC_2.4 eaccess F
+GLIBC_2.4 faccessat F
+GLIBC_2.4 fchmodat F
+GLIBC_2.4 fchownat F
+GLIBC_2.4 fdopendir F
+GLIBC_2.4 futimesat F
+GLIBC_2.4 linkat F
+GLIBC_2.4 mkdirat F
+GLIBC_2.4 mkfifoat F
+GLIBC_2.4 open_wmemstream F
+GLIBC_2.4 openat F
+GLIBC_2.4 openat64 F
+GLIBC_2.4 ppoll F
+GLIBC_2.4 readlinkat F
+GLIBC_2.4 renameat F
+GLIBC_2.4 symlinkat F
+GLIBC_2.4 unlinkat F
+GLIBC_2.5 GLIBC_2.5 A
+GLIBC_2.5 __readlinkat_chk F
+GLIBC_2.5 inet6_opt_append F
+GLIBC_2.5 inet6_opt_find F
+GLIBC_2.5 inet6_opt_finish F
+GLIBC_2.5 inet6_opt_get_val F
+GLIBC_2.5 inet6_opt_init F
+GLIBC_2.5 inet6_opt_next F
+GLIBC_2.5 inet6_opt_set_val F
+GLIBC_2.5 inet6_rth_add F
+GLIBC_2.5 inet6_rth_getaddr F
+GLIBC_2.5 inet6_rth_init F
+GLIBC_2.5 inet6_rth_reverse F
+GLIBC_2.5 inet6_rth_segments F
+GLIBC_2.5 inet6_rth_space F
+GLIBC_2.6 GLIBC_2.6 A
+GLIBC_2.6 __sched_cpucount F
+GLIBC_2.6 futimens F
+GLIBC_2.6 strerror_l F
+GLIBC_2.6 utimensat F
+GLIBC_2.7 GLIBC_2.7 A
+GLIBC_2.7 __fread_chk F
+GLIBC_2.7 __fread_unlocked_chk F
+GLIBC_2.7 __isoc99_fscanf F
+GLIBC_2.7 __isoc99_fwscanf F
+GLIBC_2.7 __isoc99_scanf F
+GLIBC_2.7 __isoc99_sscanf F
+GLIBC_2.7 __isoc99_swscanf F
+GLIBC_2.7 __isoc99_vfscanf F
+GLIBC_2.7 __isoc99_vfwscanf F
+GLIBC_2.7 __isoc99_vscanf F
+GLIBC_2.7 __isoc99_vsscanf F
+GLIBC_2.7 __isoc99_vswscanf F
+GLIBC_2.7 __isoc99_vwscanf F
+GLIBC_2.7 __isoc99_wscanf F
+GLIBC_2.7 __open64_2 F
+GLIBC_2.7 __open_2 F
+GLIBC_2.7 __openat64_2 F
+GLIBC_2.7 __openat_2 F
+GLIBC_2.7 __sched_cpualloc F
+GLIBC_2.7 __sched_cpufree F
+GLIBC_2.7 mkostemp F
+GLIBC_2.7 mkostemp64 F
+GLIBC_2.8 GLIBC_2.8 A
+GLIBC_2.8 __asprintf_chk F
+GLIBC_2.8 __dprintf_chk F
+GLIBC_2.8 __obstack_printf_chk F
+GLIBC_2.8 __obstack_vprintf_chk F
+GLIBC_2.8 __vasprintf_chk F
+GLIBC_2.8 __vdprintf_chk F
+GLIBC_2.8 qsort_r F
+GLIBC_2.9 GLIBC_2.9 A
+GLIBC_2.9 dup3 F
+GLIBC_2.9 pipe2 F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libcrypt.abilist
@@ -0,0 +1,8 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 crypt F
+GLIBC_2.3 crypt_r F
+GLIBC_2.3 encrypt F
+GLIBC_2.3 encrypt_r F
+GLIBC_2.3 fcrypt F
+GLIBC_2.3 setkey F
+GLIBC_2.3 setkey_r F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libdl.abilist
@@ -0,0 +1,12 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 dladdr F
+GLIBC_2.3 dlclose F
+GLIBC_2.3 dlerror F
+GLIBC_2.3 dlopen F
+GLIBC_2.3 dlsym F
+GLIBC_2.3 dlvsym F
+GLIBC_2.3.3 GLIBC_2.3.3 A
+GLIBC_2.3.3 dladdr1 F
+GLIBC_2.3.3 dlinfo F
+GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.3.4 dlmopen F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libm.abilist
@@ -0,0 +1,465 @@
+GLIBC_2.15 GLIBC_2.15 A
+GLIBC_2.15 __acos_finite F
+GLIBC_2.15 __acosf_finite F
+GLIBC_2.15 __acosh_finite F
+GLIBC_2.15 __acoshf_finite F
+GLIBC_2.15 __acoshl_finite F
+GLIBC_2.15 __acosl_finite F
+GLIBC_2.15 __asin_finite F
+GLIBC_2.15 __asinf_finite F
+GLIBC_2.15 __asinl_finite F
+GLIBC_2.15 __atan2_finite F
+GLIBC_2.15 __atan2f_finite F
+GLIBC_2.15 __atan2l_finite F
+GLIBC_2.15 __atanh_finite F
+GLIBC_2.15 __atanhf_finite F
+GLIBC_2.15 __atanhl_finite F
+GLIBC_2.15 __cosh_finite F
+GLIBC_2.15 __coshf_finite F
+GLIBC_2.15 __coshl_finite F
+GLIBC_2.15 __exp10_finite F
+GLIBC_2.15 __exp10f_finite F
+GLIBC_2.15 __exp10l_finite F
+GLIBC_2.15 __exp2_finite F
+GLIBC_2.15 __exp2f_finite F
+GLIBC_2.15 __exp2l_finite F
+GLIBC_2.15 __exp_finite F
+GLIBC_2.15 __expf_finite F
+GLIBC_2.15 __expl_finite F
+GLIBC_2.15 __fmod_finite F
+GLIBC_2.15 __fmodf_finite F
+GLIBC_2.15 __fmodl_finite F
+GLIBC_2.15 __gamma_r_finite F
+GLIBC_2.15 __gammaf_r_finite F
+GLIBC_2.15 __gammal_r_finite F
+GLIBC_2.15 __hypot_finite F
+GLIBC_2.15 __hypotf_finite F
+GLIBC_2.15 __hypotl_finite F
+GLIBC_2.15 __j0_finite F
+GLIBC_2.15 __j0f_finite F
+GLIBC_2.15 __j0l_finite F
+GLIBC_2.15 __j1_finite F
+GLIBC_2.15 __j1f_finite F
+GLIBC_2.15 __j1l_finite F
+GLIBC_2.15 __jn_finite F
+GLIBC_2.15 __jnf_finite F
+GLIBC_2.15 __jnl_finite F
+GLIBC_2.15 __lgamma_r_finite F
+GLIBC_2.15 __lgammaf_r_finite F
+GLIBC_2.15 __lgammal_r_finite F
+GLIBC_2.15 __log10_finite F
+GLIBC_2.15 __log10f_finite F
+GLIBC_2.15 __log10l_finite F
+GLIBC_2.15 __log2_finite F
+GLIBC_2.15 __log2f_finite F
+GLIBC_2.15 __log2l_finite F
+GLIBC_2.15 __log_finite F
+GLIBC_2.15 __logf_finite F
+GLIBC_2.15 __logl_finite F
+GLIBC_2.15 __pow_finite F
+GLIBC_2.15 __powf_finite F
+GLIBC_2.15 __powl_finite F
+GLIBC_2.15 __remainder_finite F
+GLIBC_2.15 __remainderf_finite F
+GLIBC_2.15 __remainderl_finite F
+GLIBC_2.15 __scalb_finite F
+GLIBC_2.15 __scalbf_finite F
+GLIBC_2.15 __scalbl_finite F
+GLIBC_2.15 __sinh_finite F
+GLIBC_2.15 __sinhf_finite F
+GLIBC_2.15 __sinhl_finite F
+GLIBC_2.15 __sqrt_finite F
+GLIBC_2.15 __sqrtf_finite F
+GLIBC_2.15 __sqrtl_finite F
+GLIBC_2.15 __y0_finite F
+GLIBC_2.15 __y0f_finite F
+GLIBC_2.15 __y0l_finite F
+GLIBC_2.15 __y1_finite F
+GLIBC_2.15 __y1f_finite F
+GLIBC_2.15 __y1l_finite F
+GLIBC_2.15 __yn_finite F
+GLIBC_2.15 __ynf_finite F
+GLIBC_2.15 __ynl_finite F
+GLIBC_2.18 GLIBC_2.18 A
+GLIBC_2.18 __issignaling F
+GLIBC_2.18 __issignalingf F
+GLIBC_2.18 __issignalingl F
+GLIBC_2.23 GLIBC_2.23 A
+GLIBC_2.23 __signgam D 0x4
+GLIBC_2.23 lgamma F
+GLIBC_2.23 lgammaf F
+GLIBC_2.23 lgammal F
+GLIBC_2.24 GLIBC_2.24 A
+GLIBC_2.24 nextdown F
+GLIBC_2.24 nextdownf F
+GLIBC_2.24 nextdownl F
+GLIBC_2.24 nextup F
+GLIBC_2.24 nextupf F
+GLIBC_2.24 nextupl F
+GLIBC_2.25 GLIBC_2.25 A
+GLIBC_2.25 __iscanonicall F
+GLIBC_2.25 __iseqsig F
+GLIBC_2.25 __iseqsigf F
+GLIBC_2.25 __iseqsigl F
+GLIBC_2.25 canonicalize F
+GLIBC_2.25 canonicalizef F
+GLIBC_2.25 canonicalizel F
+GLIBC_2.25 fegetmode F
+GLIBC_2.25 fesetexcept F
+GLIBC_2.25 fesetmode F
+GLIBC_2.25 fetestexceptflag F
+GLIBC_2.25 fmaxmag F
+GLIBC_2.25 fmaxmagf F
+GLIBC_2.25 fmaxmagl F
+GLIBC_2.25 fminmag F
+GLIBC_2.25 fminmagf F
+GLIBC_2.25 fminmagl F
+GLIBC_2.25 fromfp F
+GLIBC_2.25 fromfpf F
+GLIBC_2.25 fromfpl F
+GLIBC_2.25 fromfpx F
+GLIBC_2.25 fromfpxf F
+GLIBC_2.25 fromfpxl F
+GLIBC_2.25 getpayload F
+GLIBC_2.25 getpayloadf F
+GLIBC_2.25 getpayloadl F
+GLIBC_2.25 llogb F
+GLIBC_2.25 llogbf F
+GLIBC_2.25 llogbl F
+GLIBC_2.25 roundeven F
+GLIBC_2.25 roundevenf F
+GLIBC_2.25 roundevenl F
+GLIBC_2.25 setpayload F
+GLIBC_2.25 setpayloadf F
+GLIBC_2.25 setpayloadl F
+GLIBC_2.25 setpayloadsig F
+GLIBC_2.25 setpayloadsigf F
+GLIBC_2.25 setpayloadsigl F
+GLIBC_2.25 totalorder F
+GLIBC_2.25 totalorderf F
+GLIBC_2.25 totalorderl F
+GLIBC_2.25 totalordermag F
+GLIBC_2.25 totalordermagf F
+GLIBC_2.25 totalordermagl F
+GLIBC_2.25 ufromfp F
+GLIBC_2.25 ufromfpf F
+GLIBC_2.25 ufromfpl F
+GLIBC_2.25 ufromfpx F
+GLIBC_2.25 ufromfpxf F
+GLIBC_2.25 ufromfpxl F
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 _LIB_VERSION D 0x4
+GLIBC_2.3 __clog10 F
+GLIBC_2.3 __clog10f F
+GLIBC_2.3 __clog10l F
+GLIBC_2.3 __finite F
+GLIBC_2.3 __finitef F
+GLIBC_2.3 __finitel F
+GLIBC_2.3 __fpclassify F
+GLIBC_2.3 __fpclassifyf F
+GLIBC_2.3 __fpclassifyl F
+GLIBC_2.3 __signbit F
+GLIBC_2.3 __signbitf F
+GLIBC_2.3 __signbitl F
+GLIBC_2.3 acos F
+GLIBC_2.3 acosf F
+GLIBC_2.3 acosh F
+GLIBC_2.3 acoshf F
+GLIBC_2.3 acoshl F
+GLIBC_2.3 acosl F
+GLIBC_2.3 asin F
+GLIBC_2.3 asinf F
+GLIBC_2.3 asinh F
+GLIBC_2.3 asinhf F
+GLIBC_2.3 asinhl F
+GLIBC_2.3 asinl F
+GLIBC_2.3 atan F
+GLIBC_2.3 atan2 F
+GLIBC_2.3 atan2f F
+GLIBC_2.3 atan2l F
+GLIBC_2.3 atanf F
+GLIBC_2.3 atanh F
+GLIBC_2.3 atanhf F
+GLIBC_2.3 atanhl F
+GLIBC_2.3 atanl F
+GLIBC_2.3 cabs F
+GLIBC_2.3 cabsf F
+GLIBC_2.3 cabsl F
+GLIBC_2.3 cacos F
+GLIBC_2.3 cacosf F
+GLIBC_2.3 cacosh F
+GLIBC_2.3 cacoshf F
+GLIBC_2.3 cacoshl F
+GLIBC_2.3 cacosl F
+GLIBC_2.3 carg F
+GLIBC_2.3 cargf F
+GLIBC_2.3 cargl F
+GLIBC_2.3 casin F
+GLIBC_2.3 casinf F
+GLIBC_2.3 casinh F
+GLIBC_2.3 casinhf F
+GLIBC_2.3 casinhl F
+GLIBC_2.3 casinl F
+GLIBC_2.3 catan F
+GLIBC_2.3 catanf F
+GLIBC_2.3 catanh F
+GLIBC_2.3 catanhf F
+GLIBC_2.3 catanhl F
+GLIBC_2.3 catanl F
+GLIBC_2.3 cbrt F
+GLIBC_2.3 cbrtf F
+GLIBC_2.3 cbrtl F
+GLIBC_2.3 ccos F
+GLIBC_2.3 ccosf F
+GLIBC_2.3 ccosh F
+GLIBC_2.3 ccoshf F
+GLIBC_2.3 ccoshl F
+GLIBC_2.3 ccosl F
+GLIBC_2.3 ceil F
+GLIBC_2.3 ceilf F
+GLIBC_2.3 ceill F
+GLIBC_2.3 cexp F
+GLIBC_2.3 cexpf F
+GLIBC_2.3 cexpl F
+GLIBC_2.3 cimag F
+GLIBC_2.3 cimagf F
+GLIBC_2.3 cimagl F
+GLIBC_2.3 clog F
+GLIBC_2.3 clog10 F
+GLIBC_2.3 clog10f F
+GLIBC_2.3 clog10l F
+GLIBC_2.3 clogf F
+GLIBC_2.3 clogl F
+GLIBC_2.3 conj F
+GLIBC_2.3 conjf F
+GLIBC_2.3 conjl F
+GLIBC_2.3 copysign F
+GLIBC_2.3 copysignf F
+GLIBC_2.3 copysignl F
+GLIBC_2.3 cos F
+GLIBC_2.3 cosf F
+GLIBC_2.3 cosh F
+GLIBC_2.3 coshf F
+GLIBC_2.3 coshl F
+GLIBC_2.3 cosl F
+GLIBC_2.3 cpow F
+GLIBC_2.3 cpowf F
+GLIBC_2.3 cpowl F
+GLIBC_2.3 cproj F
+GLIBC_2.3 cprojf F
+GLIBC_2.3 cprojl F
+GLIBC_2.3 creal F
+GLIBC_2.3 crealf F
+GLIBC_2.3 creall F
+GLIBC_2.3 csin F
+GLIBC_2.3 csinf F
+GLIBC_2.3 csinh F
+GLIBC_2.3 csinhf F
+GLIBC_2.3 csinhl F
+GLIBC_2.3 csinl F
+GLIBC_2.3 csqrt F
+GLIBC_2.3 csqrtf F
+GLIBC_2.3 csqrtl F
+GLIBC_2.3 ctan F
+GLIBC_2.3 ctanf F
+GLIBC_2.3 ctanh F
+GLIBC_2.3 ctanhf F
+GLIBC_2.3 ctanhl F
+GLIBC_2.3 ctanl F
+GLIBC_2.3 drem F
+GLIBC_2.3 dremf F
+GLIBC_2.3 dreml F
+GLIBC_2.3 erf F
+GLIBC_2.3 erfc F
+GLIBC_2.3 erfcf F
+GLIBC_2.3 erfcl F
+GLIBC_2.3 erff F
+GLIBC_2.3 erfl F
+GLIBC_2.3 exp F
+GLIBC_2.3 exp10 F
+GLIBC_2.3 exp10f F
+GLIBC_2.3 exp10l F
+GLIBC_2.3 exp2 F
+GLIBC_2.3 exp2f F
+GLIBC_2.3 exp2l F
+GLIBC_2.3 expf F
+GLIBC_2.3 expl F
+GLIBC_2.3 expm1 F
+GLIBC_2.3 expm1f F
+GLIBC_2.3 expm1l F
+GLIBC_2.3 fabs F
+GLIBC_2.3 fabsf F
+GLIBC_2.3 fabsl F
+GLIBC_2.3 fdim F
+GLIBC_2.3 fdimf F
+GLIBC_2.3 fdiml F
+GLIBC_2.3 feclearexcept F
+GLIBC_2.3 fedisableexcept F
+GLIBC_2.3 feenableexcept F
+GLIBC_2.3 fegetenv F
+GLIBC_2.3 fegetexcept F
+GLIBC_2.3 fegetexceptflag F
+GLIBC_2.3 fegetround F
+GLIBC_2.3 feholdexcept F
+GLIBC_2.3 feraiseexcept F
+GLIBC_2.3 fesetenv F
+GLIBC_2.3 fesetexceptflag F
+GLIBC_2.3 fesetround F
+GLIBC_2.3 fetestexcept F
+GLIBC_2.3 feupdateenv F
+GLIBC_2.3 finite F
+GLIBC_2.3 finitef F
+GLIBC_2.3 finitel F
+GLIBC_2.3 floor F
+GLIBC_2.3 floorf F
+GLIBC_2.3 floorl F
+GLIBC_2.3 fma F
+GLIBC_2.3 fmaf F
+GLIBC_2.3 fmal F
+GLIBC_2.3 fmax F
+GLIBC_2.3 fmaxf F
+GLIBC_2.3 fmaxl F
+GLIBC_2.3 fmin F
+GLIBC_2.3 fminf F
+GLIBC_2.3 fminl F
+GLIBC_2.3 fmod F
+GLIBC_2.3 fmodf F
+GLIBC_2.3 fmodl F
+GLIBC_2.3 frexp F
+GLIBC_2.3 frexpf F
+GLIBC_2.3 frexpl F
+GLIBC_2.3 gamma F
+GLIBC_2.3 gammaf F
+GLIBC_2.3 gammal F
+GLIBC_2.3 hypot F
+GLIBC_2.3 hypotf F
+GLIBC_2.3 hypotl F
+GLIBC_2.3 ilogb F
+GLIBC_2.3 ilogbf F
+GLIBC_2.3 ilogbl F
+GLIBC_2.3 j0 F
+GLIBC_2.3 j0f F
+GLIBC_2.3 j0l F
+GLIBC_2.3 j1 F
+GLIBC_2.3 j1f F
+GLIBC_2.3 j1l F
+GLIBC_2.3 jn F
+GLIBC_2.3 jnf F
+GLIBC_2.3 jnl F
+GLIBC_2.3 ldexp F
+GLIBC_2.3 ldexpf F
+GLIBC_2.3 ldexpl F
+GLIBC_2.3 lgamma F
+GLIBC_2.3 lgamma_r F
+GLIBC_2.3 lgammaf F
+GLIBC_2.3 lgammaf_r F
+GLIBC_2.3 lgammal F
+GLIBC_2.3 lgammal_r F
+GLIBC_2.3 llrint F
+GLIBC_2.3 llrintf F
+GLIBC_2.3 llrintl F
+GLIBC_2.3 llround F
+GLIBC_2.3 llroundf F
+GLIBC_2.3 llroundl F
+GLIBC_2.3 log F
+GLIBC_2.3 log10 F
+GLIBC_2.3 log10f F
+GLIBC_2.3 log10l F
+GLIBC_2.3 log1p F
+GLIBC_2.3 log1pf F
+GLIBC_2.3 log1pl F
+GLIBC_2.3 log2 F
+GLIBC_2.3 log2f F
+GLIBC_2.3 log2l F
+GLIBC_2.3 logb F
+GLIBC_2.3 logbf F
+GLIBC_2.3 logbl F
+GLIBC_2.3 logf F
+GLIBC_2.3 logl F
+GLIBC_2.3 lrint F
+GLIBC_2.3 lrintf F
+GLIBC_2.3 lrintl F
+GLIBC_2.3 lround F
+GLIBC_2.3 lroundf F
+GLIBC_2.3 lroundl F
+GLIBC_2.3 matherr F
+GLIBC_2.3 modf F
+GLIBC_2.3 modff F
+GLIBC_2.3 modfl F
+GLIBC_2.3 nan F
+GLIBC_2.3 nanf F
+GLIBC_2.3 nanl F
+GLIBC_2.3 nearbyint F
+GLIBC_2.3 nearbyintf F
+GLIBC_2.3 nearbyintl F
+GLIBC_2.3 nextafter F
+GLIBC_2.3 nextafterf F
+GLIBC_2.3 nextafterl F
+GLIBC_2.3 nexttoward F
+GLIBC_2.3 nexttowardf F
+GLIBC_2.3 nexttowardl F
+GLIBC_2.3 pow F
+GLIBC_2.3 pow10 F
+GLIBC_2.3 pow10f F
+GLIBC_2.3 pow10l F
+GLIBC_2.3 powf F
+GLIBC_2.3 powl F
+GLIBC_2.3 remainder F
+GLIBC_2.3 remainderf F
+GLIBC_2.3 remainderl F
+GLIBC_2.3 remquo F
+GLIBC_2.3 remquof F
+GLIBC_2.3 remquol F
+GLIBC_2.3 rint F
+GLIBC_2.3 rintf F
+GLIBC_2.3 rintl F
+GLIBC_2.3 round F
+GLIBC_2.3 roundf F
+GLIBC_2.3 roundl F
+GLIBC_2.3 scalb F
+GLIBC_2.3 scalbf F
+GLIBC_2.3 scalbl F
+GLIBC_2.3 scalbln F
+GLIBC_2.3 scalblnf F
+GLIBC_2.3 scalblnl F
+GLIBC_2.3 scalbn F
+GLIBC_2.3 scalbnf F
+GLIBC_2.3 scalbnl F
+GLIBC_2.3 signgam D 0x4
+GLIBC_2.3 significand F
+GLIBC_2.3 significandf F
+GLIBC_2.3 significandl F
+GLIBC_2.3 sin F
+GLIBC_2.3 sincos F
+GLIBC_2.3 sincosf F
+GLIBC_2.3 sincosl F
+GLIBC_2.3 sinf F
+GLIBC_2.3 sinh F
+GLIBC_2.3 sinhf F
+GLIBC_2.3 sinhl F
+GLIBC_2.3 sinl F
+GLIBC_2.3 sqrt F
+GLIBC_2.3 sqrtf F
+GLIBC_2.3 sqrtl F
+GLIBC_2.3 tan F
+GLIBC_2.3 tanf F
+GLIBC_2.3 tanh F
+GLIBC_2.3 tanhf F
+GLIBC_2.3 tanhl F
+GLIBC_2.3 tanl F
+GLIBC_2.3 tgamma F
+GLIBC_2.3 tgammaf F
+GLIBC_2.3 tgammal F
+GLIBC_2.3 trunc F
+GLIBC_2.3 truncf F
+GLIBC_2.3 truncl F
+GLIBC_2.3 y0 F
+GLIBC_2.3 y0f F
+GLIBC_2.3 y0l F
+GLIBC_2.3 y1 F
+GLIBC_2.3 y1f F
+GLIBC_2.3 y1l F
+GLIBC_2.3 yn F
+GLIBC_2.3 ynf F
+GLIBC_2.3 ynl F
+GLIBC_2.4 GLIBC_2.4 A
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libnsl.abilist
@@ -0,0 +1,122 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 __free_fdresult F
+GLIBC_2.3 __nis_default_access F
+GLIBC_2.3 __nis_default_group F
+GLIBC_2.3 __nis_default_owner F
+GLIBC_2.3 __nis_default_ttl F
+GLIBC_2.3 __nis_finddirectory F
+GLIBC_2.3 __nis_hash F
+GLIBC_2.3 __nisbind_connect F
+GLIBC_2.3 __nisbind_create F
+GLIBC_2.3 __nisbind_destroy F
+GLIBC_2.3 __nisbind_next F
+GLIBC_2.3 __yp_check F
+GLIBC_2.3 nis_add F
+GLIBC_2.3 nis_add_entry F
+GLIBC_2.3 nis_addmember F
+GLIBC_2.3 nis_checkpoint F
+GLIBC_2.3 nis_clone_directory F
+GLIBC_2.3 nis_clone_object F
+GLIBC_2.3 nis_clone_result F
+GLIBC_2.3 nis_creategroup F
+GLIBC_2.3 nis_destroy_object F
+GLIBC_2.3 nis_destroygroup F
+GLIBC_2.3 nis_dir_cmp F
+GLIBC_2.3 nis_domain_of F
+GLIBC_2.3 nis_domain_of_r F
+GLIBC_2.3 nis_first_entry F
+GLIBC_2.3 nis_free_directory F
+GLIBC_2.3 nis_free_object F
+GLIBC_2.3 nis_free_request F
+GLIBC_2.3 nis_freenames F
+GLIBC_2.3 nis_freeresult F
+GLIBC_2.3 nis_freeservlist F
+GLIBC_2.3 nis_freetags F
+GLIBC_2.3 nis_getnames F
+GLIBC_2.3 nis_getservlist F
+GLIBC_2.3 nis_ismember F
+GLIBC_2.3 nis_leaf_of F
+GLIBC_2.3 nis_leaf_of_r F
+GLIBC_2.3 nis_lerror F
+GLIBC_2.3 nis_list F
+GLIBC_2.3 nis_local_directory F
+GLIBC_2.3 nis_local_group F
+GLIBC_2.3 nis_local_host F
+GLIBC_2.3 nis_local_principal F
+GLIBC_2.3 nis_lookup F
+GLIBC_2.3 nis_mkdir F
+GLIBC_2.3 nis_modify F
+GLIBC_2.3 nis_modify_entry F
+GLIBC_2.3 nis_name_of F
+GLIBC_2.3 nis_name_of_r F
+GLIBC_2.3 nis_next_entry F
+GLIBC_2.3 nis_perror F
+GLIBC_2.3 nis_ping F
+GLIBC_2.3 nis_print_directory F
+GLIBC_2.3 nis_print_entry F
+GLIBC_2.3 nis_print_group F
+GLIBC_2.3 nis_print_group_entry F
+GLIBC_2.3 nis_print_link F
+GLIBC_2.3 nis_print_object F
+GLIBC_2.3 nis_print_result F
+GLIBC_2.3 nis_print_rights F
+GLIBC_2.3 nis_print_table F
+GLIBC_2.3 nis_read_obj F
+GLIBC_2.3 nis_remove F
+GLIBC_2.3 nis_remove_entry F
+GLIBC_2.3 nis_removemember F
+GLIBC_2.3 nis_rmdir F
+GLIBC_2.3 nis_servstate F
+GLIBC_2.3 nis_sperrno F
+GLIBC_2.3 nis_sperror F
+GLIBC_2.3 nis_sperror_r F
+GLIBC_2.3 nis_stats F
+GLIBC_2.3 nis_verifygroup F
+GLIBC_2.3 nis_write_obj F
+GLIBC_2.3 readColdStartFile F
+GLIBC_2.3 writeColdStartFile F
+GLIBC_2.3 xdr_cback_data F
+GLIBC_2.3 xdr_domainname F
+GLIBC_2.3 xdr_keydat F
+GLIBC_2.3 xdr_mapname F
+GLIBC_2.3 xdr_obj_p F
+GLIBC_2.3 xdr_peername F
+GLIBC_2.3 xdr_valdat F
+GLIBC_2.3 xdr_yp_buf F
+GLIBC_2.3 xdr_ypall F
+GLIBC_2.3 xdr_ypbind_binding F
+GLIBC_2.3 xdr_ypbind_resp F
+GLIBC_2.3 xdr_ypbind_resptype F
+GLIBC_2.3 xdr_ypbind_setdom F
+GLIBC_2.3 xdr_ypdelete_args F
+GLIBC_2.3 xdr_ypmap_parms F
+GLIBC_2.3 xdr_ypmaplist F
+GLIBC_2.3 xdr_yppush_status F
+GLIBC_2.3 xdr_yppushresp_xfr F
+GLIBC_2.3 xdr_ypreq_key F
+GLIBC_2.3 xdr_ypreq_nokey F
+GLIBC_2.3 xdr_ypreq_xfr F
+GLIBC_2.3 xdr_ypresp_all F
+GLIBC_2.3 xdr_ypresp_key_val F
+GLIBC_2.3 xdr_ypresp_maplist F
+GLIBC_2.3 xdr_ypresp_master F
+GLIBC_2.3 xdr_ypresp_order F
+GLIBC_2.3 xdr_ypresp_val F
+GLIBC_2.3 xdr_ypresp_xfr F
+GLIBC_2.3 xdr_ypstat F
+GLIBC_2.3 xdr_ypupdate_args F
+GLIBC_2.3 xdr_ypxfrstat F
+GLIBC_2.3 yp_all F
+GLIBC_2.3 yp_bind F
+GLIBC_2.3 yp_first F
+GLIBC_2.3 yp_get_default_domain F
+GLIBC_2.3 yp_maplist F
+GLIBC_2.3 yp_master F
+GLIBC_2.3 yp_match F
+GLIBC_2.3 yp_next F
+GLIBC_2.3 yp_order F
+GLIBC_2.3 yp_unbind F
+GLIBC_2.3 yp_update F
+GLIBC_2.3 ypbinderr_string F
+GLIBC_2.3 yperr_string F
+GLIBC_2.3 ypprot_err F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libpthread.abilist
@@ -0,0 +1,227 @@
+GLIBC_2.12 GLIBC_2.12 A
+GLIBC_2.12 pthread_getname_np F
+GLIBC_2.12 pthread_setname_np F
+GLIBC_2.18 GLIBC_2.18 A
+GLIBC_2.18 pthread_getattr_default_np F
+GLIBC_2.18 pthread_setattr_default_np F
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 _IO_flockfile F
+GLIBC_2.3 _IO_ftrylockfile F
+GLIBC_2.3 _IO_funlockfile F
+GLIBC_2.3 __close F
+GLIBC_2.3 __connect F
+GLIBC_2.3 __errno_location F
+GLIBC_2.3 __fcntl F
+GLIBC_2.3 __fork F
+GLIBC_2.3 __h_errno_location F
+GLIBC_2.3 __libc_allocate_rtsig F
+GLIBC_2.3 __libc_current_sigrtmax F
+GLIBC_2.3 __libc_current_sigrtmin F
+GLIBC_2.3 __lseek F
+GLIBC_2.3 __nanosleep F
+GLIBC_2.3 __open F
+GLIBC_2.3 __open64 F
+GLIBC_2.3 __pread64 F
+GLIBC_2.3 __pthread_getspecific F
+GLIBC_2.3 __pthread_key_create F
+GLIBC_2.3 __pthread_mutex_destroy F
+GLIBC_2.3 __pthread_mutex_init F
+GLIBC_2.3 __pthread_mutex_lock F
+GLIBC_2.3 __pthread_mutex_trylock F
+GLIBC_2.3 __pthread_mutex_unlock F
+GLIBC_2.3 __pthread_mutexattr_destroy F
+GLIBC_2.3 __pthread_mutexattr_init F
+GLIBC_2.3 __pthread_mutexattr_settype F
+GLIBC_2.3 __pthread_once F
+GLIBC_2.3 __pthread_rwlock_destroy F
+GLIBC_2.3 __pthread_rwlock_init F
+GLIBC_2.3 __pthread_rwlock_rdlock F
+GLIBC_2.3 __pthread_rwlock_tryrdlock F
+GLIBC_2.3 __pthread_rwlock_trywrlock F
+GLIBC_2.3 __pthread_rwlock_unlock F
+GLIBC_2.3 __pthread_rwlock_wrlock F
+GLIBC_2.3 __pthread_setspecific F
+GLIBC_2.3 __pwrite64 F
+GLIBC_2.3 __read F
+GLIBC_2.3 __res_state F
+GLIBC_2.3 __send F
+GLIBC_2.3 __sigaction F
+GLIBC_2.3 __vfork F
+GLIBC_2.3 __wait F
+GLIBC_2.3 __write F
+GLIBC_2.3 _pthread_cleanup_pop F
+GLIBC_2.3 _pthread_cleanup_pop_restore F
+GLIBC_2.3 _pthread_cleanup_push F
+GLIBC_2.3 _pthread_cleanup_push_defer F
+GLIBC_2.3 accept F
+GLIBC_2.3 close F
+GLIBC_2.3 connect F
+GLIBC_2.3 fcntl F
+GLIBC_2.3 flockfile F
+GLIBC_2.3 fork F
+GLIBC_2.3 fsync F
+GLIBC_2.3 ftrylockfile F
+GLIBC_2.3 funlockfile F
+GLIBC_2.3 longjmp F
+GLIBC_2.3 lseek F
+GLIBC_2.3 lseek64 F
+GLIBC_2.3 msync F
+GLIBC_2.3 nanosleep F
+GLIBC_2.3 open F
+GLIBC_2.3 open64 F
+GLIBC_2.3 pause F
+GLIBC_2.3 pread F
+GLIBC_2.3 pread64 F
+GLIBC_2.3 pthread_atfork F
+GLIBC_2.3 pthread_attr_destroy F
+GLIBC_2.3 pthread_attr_getdetachstate F
+GLIBC_2.3 pthread_attr_getguardsize F
+GLIBC_2.3 pthread_attr_getinheritsched F
+GLIBC_2.3 pthread_attr_getschedparam F
+GLIBC_2.3 pthread_attr_getschedpolicy F
+GLIBC_2.3 pthread_attr_getscope F
+GLIBC_2.3 pthread_attr_getstack F
+GLIBC_2.3 pthread_attr_getstackaddr F
+GLIBC_2.3 pthread_attr_getstacksize F
+GLIBC_2.3 pthread_attr_init F
+GLIBC_2.3 pthread_attr_setdetachstate F
+GLIBC_2.3 pthread_attr_setguardsize F
+GLIBC_2.3 pthread_attr_setinheritsched F
+GLIBC_2.3 pthread_attr_setschedparam F
+GLIBC_2.3 pthread_attr_setschedpolicy F
+GLIBC_2.3 pthread_attr_setscope F
+GLIBC_2.3 pthread_attr_setstack F
+GLIBC_2.3 pthread_attr_setstackaddr F
+GLIBC_2.3 pthread_attr_setstacksize F
+GLIBC_2.3 pthread_barrier_destroy F
+GLIBC_2.3 pthread_barrier_init F
+GLIBC_2.3 pthread_barrier_wait F
+GLIBC_2.3 pthread_barrierattr_destroy F
+GLIBC_2.3 pthread_barrierattr_init F
+GLIBC_2.3 pthread_barrierattr_setpshared F
+GLIBC_2.3 pthread_cancel F
+GLIBC_2.3 pthread_cond_broadcast F
+GLIBC_2.3 pthread_cond_destroy F
+GLIBC_2.3 pthread_cond_init F
+GLIBC_2.3 pthread_cond_signal F
+GLIBC_2.3 pthread_cond_timedwait F
+GLIBC_2.3 pthread_cond_wait F
+GLIBC_2.3 pthread_condattr_destroy F
+GLIBC_2.3 pthread_condattr_getpshared F
+GLIBC_2.3 pthread_condattr_init F
+GLIBC_2.3 pthread_condattr_setpshared F
+GLIBC_2.3 pthread_create F
+GLIBC_2.3 pthread_detach F
+GLIBC_2.3 pthread_equal F
+GLIBC_2.3 pthread_exit F
+GLIBC_2.3 pthread_getattr_np F
+GLIBC_2.3 pthread_getconcurrency F
+GLIBC_2.3 pthread_getcpuclockid F
+GLIBC_2.3 pthread_getschedparam F
+GLIBC_2.3 pthread_getspecific F
+GLIBC_2.3 pthread_join F
+GLIBC_2.3 pthread_key_create F
+GLIBC_2.3 pthread_key_delete F
+GLIBC_2.3 pthread_kill F
+GLIBC_2.3 pthread_kill_other_threads_np F
+GLIBC_2.3 pthread_mutex_destroy F
+GLIBC_2.3 pthread_mutex_init F
+GLIBC_2.3 pthread_mutex_lock F
+GLIBC_2.3 pthread_mutex_timedlock F
+GLIBC_2.3 pthread_mutex_trylock F
+GLIBC_2.3 pthread_mutex_unlock F
+GLIBC_2.3 pthread_mutexattr_destroy F
+GLIBC_2.3 pthread_mutexattr_getkind_np F
+GLIBC_2.3 pthread_mutexattr_getpshared F
+GLIBC_2.3 pthread_mutexattr_gettype F
+GLIBC_2.3 pthread_mutexattr_init F
+GLIBC_2.3 pthread_mutexattr_setkind_np F
+GLIBC_2.3 pthread_mutexattr_setpshared F
+GLIBC_2.3 pthread_mutexattr_settype F
+GLIBC_2.3 pthread_once F
+GLIBC_2.3 pthread_rwlock_destroy F
+GLIBC_2.3 pthread_rwlock_init F
+GLIBC_2.3 pthread_rwlock_rdlock F
+GLIBC_2.3 pthread_rwlock_timedrdlock F
+GLIBC_2.3 pthread_rwlock_timedwrlock F
+GLIBC_2.3 pthread_rwlock_tryrdlock F
+GLIBC_2.3 pthread_rwlock_trywrlock F
+GLIBC_2.3 pthread_rwlock_unlock F
+GLIBC_2.3 pthread_rwlock_wrlock F
+GLIBC_2.3 pthread_rwlockattr_destroy F
+GLIBC_2.3 pthread_rwlockattr_getkind_np F
+GLIBC_2.3 pthread_rwlockattr_getpshared F
+GLIBC_2.3 pthread_rwlockattr_init F
+GLIBC_2.3 pthread_rwlockattr_setkind_np F
+GLIBC_2.3 pthread_rwlockattr_setpshared F
+GLIBC_2.3 pthread_self F
+GLIBC_2.3 pthread_setcancelstate F
+GLIBC_2.3 pthread_setcanceltype F
+GLIBC_2.3 pthread_setconcurrency F
+GLIBC_2.3 pthread_setschedparam F
+GLIBC_2.3 pthread_setspecific F
+GLIBC_2.3 pthread_sigmask F
+GLIBC_2.3 pthread_spin_destroy F
+GLIBC_2.3 pthread_spin_init F
+GLIBC_2.3 pthread_spin_lock F
+GLIBC_2.3 pthread_spin_trylock F
+GLIBC_2.3 pthread_spin_unlock F
+GLIBC_2.3 pthread_testcancel F
+GLIBC_2.3 pthread_yield F
+GLIBC_2.3 pwrite F
+GLIBC_2.3 pwrite64 F
+GLIBC_2.3 raise F
+GLIBC_2.3 read F
+GLIBC_2.3 recv F
+GLIBC_2.3 recvfrom F
+GLIBC_2.3 recvmsg F
+GLIBC_2.3 sem_close F
+GLIBC_2.3 sem_destroy F
+GLIBC_2.3 sem_getvalue F
+GLIBC_2.3 sem_init F
+GLIBC_2.3 sem_open F
+GLIBC_2.3 sem_post F
+GLIBC_2.3 sem_timedwait F
+GLIBC_2.3 sem_trywait F
+GLIBC_2.3 sem_unlink F
+GLIBC_2.3 sem_wait F
+GLIBC_2.3 send F
+GLIBC_2.3 sendmsg F
+GLIBC_2.3 sendto F
+GLIBC_2.3 sigaction F
+GLIBC_2.3 siglongjmp F
+GLIBC_2.3 sigwait F
+GLIBC_2.3 system F
+GLIBC_2.3 tcdrain F
+GLIBC_2.3 vfork F
+GLIBC_2.3 wait F
+GLIBC_2.3 waitpid F
+GLIBC_2.3 write F
+GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.3.2 pthread_cond_broadcast F
+GLIBC_2.3.2 pthread_cond_destroy F
+GLIBC_2.3.2 pthread_cond_init F
+GLIBC_2.3.2 pthread_cond_signal F
+GLIBC_2.3.2 pthread_cond_timedwait F
+GLIBC_2.3.2 pthread_cond_wait F
+GLIBC_2.3.3 GLIBC_2.3.3 A
+GLIBC_2.3.3 __pthread_cleanup_routine F
+GLIBC_2.3.3 __pthread_register_cancel F
+GLIBC_2.3.3 __pthread_register_cancel_defer F
+GLIBC_2.3.3 __pthread_unregister_cancel F
+GLIBC_2.3.3 __pthread_unregister_cancel_restore F
+GLIBC_2.3.3 __pthread_unwind_next F
+GLIBC_2.3.3 pthread_attr_getaffinity_np F
+GLIBC_2.3.3 pthread_attr_setaffinity_np F
+GLIBC_2.3.3 pthread_barrierattr_getpshared F
+GLIBC_2.3.3 pthread_condattr_getclock F
+GLIBC_2.3.3 pthread_condattr_setclock F
+GLIBC_2.3.3 pthread_getaffinity_np F
+GLIBC_2.3.3 pthread_setaffinity_np F
+GLIBC_2.3.3 pthread_timedjoin_np F
+GLIBC_2.3.3 pthread_tryjoin_np F
+GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.3.4 pthread_attr_getaffinity_np F
+GLIBC_2.3.4 pthread_attr_setaffinity_np F
+GLIBC_2.3.4 pthread_getaffinity_np F
+GLIBC_2.3.4 pthread_setaffinity_np F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libresolv.abilist
@@ -0,0 +1,94 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 __b64_ntop F
+GLIBC_2.3 __b64_pton F
+GLIBC_2.3 __dn_comp F
+GLIBC_2.3 __dn_count_labels F
+GLIBC_2.3 __dn_expand F
+GLIBC_2.3 __dn_skipname F
+GLIBC_2.3 __fp_nquery F
+GLIBC_2.3 __fp_query F
+GLIBC_2.3 __fp_resstat F
+GLIBC_2.3 __hostalias F
+GLIBC_2.3 __loc_aton F
+GLIBC_2.3 __loc_ntoa F
+GLIBC_2.3 __p_cdname F
+GLIBC_2.3 __p_cdnname F
+GLIBC_2.3 __p_class F
+GLIBC_2.3 __p_class_syms D 0xa8
+GLIBC_2.3 __p_fqname F
+GLIBC_2.3 __p_fqnname F
+GLIBC_2.3 __p_option F
+GLIBC_2.3 __p_query F
+GLIBC_2.3 __p_secstodate F
+GLIBC_2.3 __p_time F
+GLIBC_2.3 __p_type F
+GLIBC_2.3 __p_type_syms D 0x450
+GLIBC_2.3 __putlong F
+GLIBC_2.3 __putshort F
+GLIBC_2.3 __res_close F
+GLIBC_2.3 __res_dnok F
+GLIBC_2.3 __res_hnok F
+GLIBC_2.3 __res_hostalias F
+GLIBC_2.3 __res_isourserver F
+GLIBC_2.3 __res_mailok F
+GLIBC_2.3 __res_mkquery F
+GLIBC_2.3 __res_nameinquery F
+GLIBC_2.3 __res_nmkquery F
+GLIBC_2.3 __res_nquery F
+GLIBC_2.3 __res_nquerydomain F
+GLIBC_2.3 __res_nsearch F
+GLIBC_2.3 __res_nsend F
+GLIBC_2.3 __res_ownok F
+GLIBC_2.3 __res_queriesmatch F
+GLIBC_2.3 __res_query F
+GLIBC_2.3 __res_querydomain F
+GLIBC_2.3 __res_search F
+GLIBC_2.3 __res_send F
+GLIBC_2.3 __sym_ntop F
+GLIBC_2.3 __sym_ntos F
+GLIBC_2.3 __sym_ston F
+GLIBC_2.3 _gethtbyaddr F
+GLIBC_2.3 _gethtbyname F
+GLIBC_2.3 _gethtbyname2 F
+GLIBC_2.3 _gethtent F
+GLIBC_2.3 _getlong F
+GLIBC_2.3 _getshort F
+GLIBC_2.3 _res_opcodes D 0x80
+GLIBC_2.3 _sethtent F
+GLIBC_2.3 inet_net_ntop F
+GLIBC_2.3 inet_net_pton F
+GLIBC_2.3 inet_neta F
+GLIBC_2.3 res_gethostbyaddr F
+GLIBC_2.3 res_gethostbyname F
+GLIBC_2.3 res_gethostbyname2 F
+GLIBC_2.3 res_send_setqhook F
+GLIBC_2.3 res_send_setrhook F
+GLIBC_2.3.2 GLIBC_2.3.2 A
+GLIBC_2.3.2 __p_rcode F
+GLIBC_2.9 GLIBC_2.9 A
+GLIBC_2.9 ns_datetosecs F
+GLIBC_2.9 ns_format_ttl F
+GLIBC_2.9 ns_get16 F
+GLIBC_2.9 ns_get32 F
+GLIBC_2.9 ns_initparse F
+GLIBC_2.9 ns_makecanon F
+GLIBC_2.9 ns_msg_getflag F
+GLIBC_2.9 ns_name_compress F
+GLIBC_2.9 ns_name_ntol F
+GLIBC_2.9 ns_name_ntop F
+GLIBC_2.9 ns_name_pack F
+GLIBC_2.9 ns_name_pton F
+GLIBC_2.9 ns_name_rollback F
+GLIBC_2.9 ns_name_skip F
+GLIBC_2.9 ns_name_uncompress F
+GLIBC_2.9 ns_name_unpack F
+GLIBC_2.9 ns_parse_ttl F
+GLIBC_2.9 ns_parserr F
+GLIBC_2.9 ns_put16 F
+GLIBC_2.9 ns_put32 F
+GLIBC_2.9 ns_samedomain F
+GLIBC_2.9 ns_samename F
+GLIBC_2.9 ns_skiprr F
+GLIBC_2.9 ns_sprintrr F
+GLIBC_2.9 ns_sprintrrf F
+GLIBC_2.9 ns_subdomain F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/librt.abilist
@@ -0,0 +1,46 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 aio_cancel F
+GLIBC_2.3 aio_cancel64 F
+GLIBC_2.3 aio_error F
+GLIBC_2.3 aio_error64 F
+GLIBC_2.3 aio_fsync F
+GLIBC_2.3 aio_fsync64 F
+GLIBC_2.3 aio_init F
+GLIBC_2.3 aio_read F
+GLIBC_2.3 aio_read64 F
+GLIBC_2.3 aio_return F
+GLIBC_2.3 aio_return64 F
+GLIBC_2.3 aio_suspend F
+GLIBC_2.3 aio_suspend64 F
+GLIBC_2.3 aio_write F
+GLIBC_2.3 aio_write64 F
+GLIBC_2.3 clock_getcpuclockid F
+GLIBC_2.3 clock_getres F
+GLIBC_2.3 clock_gettime F
+GLIBC_2.3 clock_nanosleep F
+GLIBC_2.3 clock_settime F
+GLIBC_2.3 lio_listio F
+GLIBC_2.3 lio_listio64 F
+GLIBC_2.3 shm_open F
+GLIBC_2.3 shm_unlink F
+GLIBC_2.3 timer_create F
+GLIBC_2.3 timer_delete F
+GLIBC_2.3 timer_getoverrun F
+GLIBC_2.3 timer_gettime F
+GLIBC_2.3 timer_settime F
+GLIBC_2.3.4 GLIBC_2.3.4 A
+GLIBC_2.3.4 mq_close F
+GLIBC_2.3.4 mq_getattr F
+GLIBC_2.3.4 mq_notify F
+GLIBC_2.3.4 mq_open F
+GLIBC_2.3.4 mq_receive F
+GLIBC_2.3.4 mq_send F
+GLIBC_2.3.4 mq_setattr F
+GLIBC_2.3.4 mq_timedreceive F
+GLIBC_2.3.4 mq_timedsend F
+GLIBC_2.3.4 mq_unlink F
+GLIBC_2.4 GLIBC_2.4 A
+GLIBC_2.4 lio_listio F
+GLIBC_2.4 lio_listio64 F
+GLIBC_2.7 GLIBC_2.7 A
+GLIBC_2.7 __mq_open_2 F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libthread_db.abilist
@@ -0,0 +1,42 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 td_init F
+GLIBC_2.3 td_log F
+GLIBC_2.3 td_symbol_list F
+GLIBC_2.3 td_ta_clear_event F
+GLIBC_2.3 td_ta_delete F
+GLIBC_2.3 td_ta_enable_stats F
+GLIBC_2.3 td_ta_event_addr F
+GLIBC_2.3 td_ta_event_getmsg F
+GLIBC_2.3 td_ta_get_nthreads F
+GLIBC_2.3 td_ta_get_ph F
+GLIBC_2.3 td_ta_get_stats F
+GLIBC_2.3 td_ta_map_id2thr F
+GLIBC_2.3 td_ta_map_lwp2thr F
+GLIBC_2.3 td_ta_new F
+GLIBC_2.3 td_ta_reset_stats F
+GLIBC_2.3 td_ta_set_event F
+GLIBC_2.3 td_ta_setconcurrency F
+GLIBC_2.3 td_ta_thr_iter F
+GLIBC_2.3 td_ta_tsd_iter F
+GLIBC_2.3 td_thr_clear_event F
+GLIBC_2.3 td_thr_dbresume F
+GLIBC_2.3 td_thr_dbsuspend F
+GLIBC_2.3 td_thr_event_enable F
+GLIBC_2.3 td_thr_event_getmsg F
+GLIBC_2.3 td_thr_get_info F
+GLIBC_2.3 td_thr_getfpregs F
+GLIBC_2.3 td_thr_getgregs F
+GLIBC_2.3 td_thr_getxregs F
+GLIBC_2.3 td_thr_getxregsize F
+GLIBC_2.3 td_thr_set_event F
+GLIBC_2.3 td_thr_setfpregs F
+GLIBC_2.3 td_thr_setgregs F
+GLIBC_2.3 td_thr_setprio F
+GLIBC_2.3 td_thr_setsigpending F
+GLIBC_2.3 td_thr_setxregs F
+GLIBC_2.3 td_thr_sigsetmask F
+GLIBC_2.3 td_thr_tls_get_addr F
+GLIBC_2.3 td_thr_tsd F
+GLIBC_2.3 td_thr_validate F
+GLIBC_2.3.3 GLIBC_2.3.3 A
+GLIBC_2.3.3 td_thr_tlsbase F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/libutil.abilist
@@ -0,0 +1,7 @@
+GLIBC_2.3 GLIBC_2.3 A
+GLIBC_2.3 forkpty F
+GLIBC_2.3 login F
+GLIBC_2.3 login_tty F
+GLIBC_2.3 logout F
+GLIBC_2.3 logwtmp F
+GLIBC_2.3 openpty F
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/makecontext.S
@@ -0,0 +1,146 @@
+/* makecontext() for FreeBSD/amd64.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+#include <ucontext_i.h>
+
+/*
+   void makecontext(ucontext_t *ucp, void *func(), int argc, ...);
+
+
+   input parameters:
+
+   rdi		ucp
+   rsi		func
+   edx		argc
+   rcx		arg1	-> ucp.rdi
+   r8		arg2	-> ucp.rsi
+   r9		arg3	-> ucp.rdx
+    8(%rsp)	arg4	-> ucp.rcx
+   16(%rsp)	arg5	-> ucp.r8
+   24(%rsp)	arg6	-> ucp.r9
+   i*8+24(%rsp) arg(6+i)-> future stack
+
+*/
+
+ENTRY(__makecontext)
+
+	/* Compute the address of the stack.
+	   The information comes from us_stack element. */
+	movq	oSS_SP(%rdi), %rax
+	addq	oSS_SIZE(%rdi), %rax
+
+	/* Put start addr into ucp */
+	movq	%rsi, oRIP(%rdi)
+
+	/* properly align future stack */
+	andq $-16, %rax
+	subq   $8, %rax
+
+	/* Put the next context into preserved ucp.rbx
+	   (from the uc_link element).  */
+	movq	oLINK(%rdi), %rsi
+	movq	%rsi, oRBX(%rdi)
+
+	/* save future registers arguments */
+
+	orl %edx, %edx
+	jz L(param_done)
+
+	decl %edx
+	movq %rcx, oRDI(%rdi)
+	jz L(param_done)
+
+	decl %edx
+	movq %r8,  oRSI(%rdi)
+	jz L(param_done)
+
+	decl %edx
+	movq %r9,  oRDX(%rdi)
+	jz L(param_done)
+
+	movq 8(%rsp), %rsi
+	decl %edx
+	movq %rsi, oRCX(%rdi)
+	jz L(param_done)
+
+	movq 16(%rsp), %rcx
+	decl %edx
+	movq %rcx, oR8(%rdi)
+	jz L(param_done)
+
+	movq 24(%rsp), %rsi
+	decl %edx
+	movq %rsi, oR9(%rdi)
+	jz L(param_done)
+
+	/* we have to copy some arguments also on the future stack */
+	movl %edx, %ecx
+	negq %rdx
+	leaq -16(%rax,%rdx,8), %rax /* we a litle bit waste stack space */
+	orq  $8, %rax
+
+1:	movq 24(%rsp,%rcx,8), %rsi
+	movq %rsi,(%rax,%rcx,8)
+	loop 1b
+
+L(param_done):
+
+	/* Store the future stack pointer and chain helper code. */
+	leaq	L(exitcode)(%rip), %rdx
+	movq	%rax, oRSP(%rdi)
+	movq	%rdx, (%rax)
+
+	/* 'makecontext' returns no value.  */
+	ret
+
+/***************************************************************************/
+
+	/* This is the helper code which gets called if a function which
+	   is registered with 'makecontext' returns.  In this case we
+	   have to install the context listed in the uc_link element of
+	   the context 'makecontext' manipulated at the time of the
+	   'makecontext' call.  If the pointer is NULL the process must
+	   terminate.  */
+
+L(exitcode):
+	/* we don't bother with extra arguments left on the stack
+		- more than 6 arguments is rare
+		- setcontext changes stacks immediately
+		- exit will call _exit in near future
+	*/
+
+	movq %rbx, %rdi		/* argument for either syscall */
+	testq %rbx, %rbx	/* If it is zero exit.  */
+	jz 2f
+
+	call	JUMPTARGET(__setcontext)
+	/* If this returns (which can happen if the syscall fails) we'll
+	   exit the program with the return error value (-1).  */
+
+	movq %rax, %rdi
+2:	call	HIDDEN_JUMPTARGET(exit)
+	/* The 'exit' call should never return.  In case it does cause
+	   the process to terminate.  */
+	hlt
+END(__makecontext)
+
+weak_alias(__makecontext, makecontext)
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/pipe.S
@@ -0,0 +1,32 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text
+ENTRY (__pipe)
+	DO_CALL (pipe, 1)
+	jb SYSCALL_ERROR_LABEL
+        movl %eax, 0(%rdi)
+        movl %edx, 4(%rdi)
+        xorl %eax, %eax
+L(pseudo_end):
+	ret
+PSEUDO_END (__pipe)
+libc_hidden_def (__pipe)
+weak_alias (__pipe, pipe)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/pt-vfork.S
@@ -0,0 +1 @@
+#include <sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/vfork.S>
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/readelflib.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
+		  Jakub Jelinek <jakub@redhat.com>, 1999.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+
+int process_elf32_file (const char *file_name, const char *lib, int *flag,
+			unsigned int *osversion, char **soname,
+			void *file_contents, size_t file_length);
+int process_elf64_file (const char *file_name, const char *lib, int *flag,
+			unsigned int *osversion, char **soname,
+			void *file_contents, size_t file_length);
+
+/* Returns 0 if everything is ok, != 0 in case of error.  */
+int
+process_elf_file (const char *file_name, const char *lib, int *flag,
+		  unsigned int *osversion, char **soname, void *file_contents,
+		  size_t file_length)
+{
+  ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
+  int ret;
+
+  if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
+    return process_elf32_file (file_name, lib, flag, osversion, soname,
+			       file_contents, file_length);
+  else
+    {
+      ret = process_elf64_file (file_name, lib, flag, osversion, soname,
+				file_contents, file_length);
+      /* x86-64 64bit libraries are always LIBC6.  */
+      if (!ret)
+	*flag = FLAG_X8664_LIB64|FLAG_ELF_LIBC6;
+      return ret;
+    }
+}
+
+#undef __ELF_NATIVE_CLASS
+#undef process_elf_file
+#define process_elf_file process_elf32_file
+#define __ELF_NATIVE_CLASS 32
+#include "elf/readelflib.c"
+
+#undef __ELF_NATIVE_CLASS
+#undef process_elf_file
+#define process_elf_file process_elf64_file
+#define __ELF_NATIVE_CLASS 64
+#include "elf/readelflib.c"
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/rfork.S
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991-1992, 1994-1995, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text;
+ENTRY (__rfork)
+	/* save the return PC value into RSI */
+	movq 0(%rsp), %rsi;
+	DO_CALL (rfork, 1)
+	jb SYSCALL_ERROR_LABEL;
+	/* R1 is now 0 for the parent and 1 for the child.  Decrement it to
+	   make it -1 (all bits set) for the parent, and 0 (no bits set)
+	   for the child.  Then AND it with R0, so the parent gets
+	   R0&-1==R0, and the child gets R0&0==0.  */
+	decq %rdx
+	andq %rdx, %rax
+
+	popq %rdx
+	cfi_adjust_cfa_offset(-8)
+
+	jmp  *%rsi
+
+L(pseudo_end):
+	ret
+PSEUDO_END (__rfork)
+
+weak_alias (__rfork, rfork)
+
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/shlib-versions
@@ -0,0 +1 @@
+ld=ld-kfreebsd-x86-64.so.1
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/sigcontextinfo.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+native FreeBSD:
+        sighandler(int signum, int code,       struct sigcontext * sg, void * fault_ip)
+posix like:
+        sighandler(int signum, siginfo_t * si, struct sigcontext * sg, void * fault_ip)
+*/
+
+#define SIGCONTEXT long _code, struct sigcontext * _sg, void *
+#define SIGCONTEXT_EXTRA_ARGS _code, _sg,
+
+/* really, really, rest of glibc expects that struct sigcontext is the last argument */
+#define GET_PC(ctx)	((void *) (_sg)->sc_rip)
+#define GET_FRAME(ctx)	((void *) (_sg)->sc_rbp)
+#define GET_STACK(ctx)	((void *) (_sg)->sc_rsp)
+
+#define CALL_SIGHANDLER(handler, signo, ctx) \
+  (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/start.S
@@ -0,0 +1,156 @@
+/* Startup code for FreeBSD/amd64 ABI.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andreas Jaeger <aj@suse.de>, 2001.
+   FreeBSD modification by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  The SVR4/i386 ABI (pages 3-31, 3-32) says that when the entry
+   point runs, most registers' values are unspecified, except for a few.
+   Blindly applied on amd64:
+
+   %rdx		Contains a function pointer to be registered with `atexit'.
+		This is how the dynamic linker arranges to have DT_FINI
+		functions called for shared libraries that have been loaded
+		before this code runs.
+
+   %rsp		The stack contains the arguments and environment:
+		0(%rsp)			argc
+		8(%rsp)			argv[0]
+		...
+		(8*argc)(%rsp)		NULL
+		(8*(argc+1))(%rsp)	envp[0]
+		...
+					NULL
+
+   But on amd64 %rsp also have to be 16-byte aligned,
+   standard C calling convention already passes arguments in registers.
+
+   FreeBSD uses %edi as pointer to arguments and environment, %rsp is passed aligned.
+   On entry from kernel, %rsp=%rdi or %rsp=%rdi-8,
+   on entry from ld.so, glibc might set up it slightly differently.
+
+   On FreeBSD, we use %rsi for passing function pointer to rtld_fini().
+   On entry from FreeBSD kernel, %rsi is cleared, %rdx is not cleared,
+   on entry from ld.so, glibc sets both %rsi and %rdx to point to rtld_fini().
+
+   Used interface (via %rdi, %rsi) is equal to standard C calling interface for
+
+   void _start(void *arg, void *rtld_fini());
+
+*/
+
+#include <sysdep.h>
+#include <libc-symbols.h>
+
+	weak_extern (_end)
+
+	.text
+	.globl _start
+	.type _start,@function
+_start:
+	cfi_startproc
+	cfi_undefined (rip)
+	/* Clear the frame pointer.  The ABI suggests this be done, to mark
+	   the outermost frame obviously.  */
+	xorl %ebp, %ebp		/* zero extending clears whole rbp */
+
+	/* Extract the arguments as encoded on the stack and set up
+	   the arguments for __libc_start_main (int (*main) (int, char **, char **),
+		   int argc, char *argv,
+		   void (*init) (void), void (*fini) (void),
+		   void (*rtld_fini) (void), void *stack_end).
+	   The arguments are passed via registers and on the stack:
+	main:		%rdi
+	argc:		%rsi
+	argv:		%rdx
+	init:		%rcx
+	fini:		%r8
+	rtld_fini:	%r9
+	stack_end:	stack.	*/
+
+	movq %rsi, %r9		/* Address of the shared library termination
+				   function.  */
+	movq 0(%rdi), %rsi	/* argument count.  */
+	leaq 8(%rdi), %rdx      /* argv starts just at above argc.  */
+
+	/* Align the stack to a 16 byte boundary to follow the ABI.  */
+	andq  $~15, %rsp
+
+	pushq %rax		/* Push garbage because we push 8 more bytes.  */
+
+	/* Provide the highest stack address to the user code (for stacks
+	   which grow downwards).  */
+	pushq %rsp
+
+#ifdef SHARED
+	/* Pass address of our own entry points to .fini and .init.  */
+	movq __libc_csu_fini@GOTPCREL(%rip), %r8
+	movq __libc_csu_init@GOTPCREL(%rip), %rcx
+
+	movq main@GOTPCREL(%rip), %rdi
+
+	/* Call the user's main function, and exit with its value.
+	   But let the libc call main.	  */
+	call __libc_start_main@PLT
+#else
+	/* Pass address of our own entry points to .fini and .init.  */
+	movq $__libc_csu_fini, %r8
+	movq $__libc_csu_init, %rcx
+
+	movq $main, %rdi
+
+	/* Call the user's main function, and exit with its value.
+	   But let the libc call main.	  */
+	call __libc_start_main
+#endif
+
+	hlt			/* Crash if somehow `exit' does return.	 */
+	/* just reference _end, 
+	   it is needed as global symbol for brk() usage,
+	   it is a dead code on purpose.  */
+#ifdef SHARED
+	movq _end@GOTPCREL(%rip), %rax
+#else
+	movq $_end, %rax
+#endif
+	cfi_endproc
+/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.long 0
+	.weak data_start
+	data_start = __data_start
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/start_thread.S
@@ -0,0 +1,196 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+   Modification for amd64 contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* __start_thread (flags, stack, func, arg)
+   calls __rfork (flags), and in the child sets the stack pointer and then
+   calls _exit (func (arg)).
+   It cannot be done in portable C.  */
+
+/*
+   The parameters are passed in registers:
+   rdi: flags for rfork
+   rsi: child_stack
+   rdx: func
+   rcx: arg
+*/
+
+#include <sysdep.h>
+#include <asm-syntax.h>
+
+#define SIG_SETMASK	3
+
+/* There is a window of a few instructions, right after the rfork
+   system call, where the handling of a signal would write garbage
+   into the stack shared by the parent and the child (assuming
+   RFMEM is set in flags).  To solve this: 1. We block all signals
+   around the rfork system call and unblock them afterwards in
+   the parent and in the child (but only after changing the stack
+   pointer).  2. The child accesses only values passed in registers
+   and on its own stack.  This way, if the parent is scheduled to
+   run first, and handles a signal, it will not affect the child;
+   and if the child runs first, and handles a signal, it will use
+   the child's stack and not affect the parent.
+*/
+
+	.text
+ENTRY (__start_thread)
+
+        /* Insert the argument onto the new aligned stack.  */
+        andq	$-16,%rsi
+        subq    $16,%rsi
+        movq    %rcx,8(%rsi)
+
+        /* Save the function pointer.  It will be popped off in the child */
+        movq    %rdx,0(%rsi)
+
+	testq	$32, %rdi	/* flags & RFMEM */
+	jnz	L(complex)
+
+        /* Do the system call.  */
+	movl    $SYS_ify(rfork),%eax
+        /* End FDE now, because in the child the unwind info will be
+           wrong.  */
+        cfi_endproc;
+        syscall			/* rdi and rsi are extra preserved */
+
+        jb SYSCALL_ERROR_LABEL
+
+	testq   %rdx,%rdx	/*  0 for the parent and 1 for the child */
+	jz     L(pseudo_end)	/* just return in parent */
+
+L(thread_start):
+
+	/* set up stack */
+	movq	%rsi, %rsp
+
+        /* Clear the frame pointer.  The ABI suggests this be done, to mark
+           the outermost frame obviously.  */
+        xorl    %ebp, %ebp
+
+L(thread_start2):
+
+        /* Set up arguments for the function call.  */
+        popq    %rax            /* Function to call.  */
+        popq    %rdi            /* Argument.  */
+        call    *%rax
+
+        /* Call exit with return value from function call. */
+        movq    %rax, %rdi
+        call    HIDDEN_JUMPTARGET (_exit)
+
+
+/******************************************************************************************************
+ *
+ * and now the complex one ...
+ *
+ ******************************************************************************************************/
+
+L(complex):
+
+        subq    $32, %rsp
+
+        /* save arguments - flags and stack */
+        movq    %rdi,0(%rsp)
+        movq    %rsi,8(%rsp)
+
+        /* Block all signals.  */
+        orq     $-1, %rax
+        movq    %rax, 16(%rsp)
+        movq    %rax, 24(%rsp)
+
+        leaq    16(%rsp), %rsi
+        movl    $SIG_SETMASK, %edi
+        movq    %rsi,%rdx
+        DO_CALL (sigprocmask, 3)
+        jb      L(error)
+
+        /* restore arguments - flags and stack */
+        movq    0(%rsp),%rdi
+        movq    8(%rsp),%rsi
+
+        /* Copy mask info into the child's stack.  */
+
+        subq    $16,%rsi
+        movq    16(%rsp),%rcx
+        movq    24(%rsp),%rdx
+        movq    %rcx, 0(%rsi)
+        movq    %rdx, 8(%rsi)
+
+        /* Perform the rfork system call.  */
+        DO_CALL (rfork, 1)
+        jb      L(error_unmask)
+
+        /* %rdx is now 0 for the parent and 1 for the child.  */
+        testq   %rdx, %rdx
+        jnz     L(child)
+
+        /* Save the child pid, currently in %rax.  */
+        movq    %rax, 0(%rsp)
+
+        /* Restore the previous signal mask.  */
+        movl    $SIG_SETMASK, %edi
+        leaq    16(%rsp), %rsi
+        xorl    %edx,%edx
+        DO_CALL (sigprocmask, 3)
+
+        /* Return the child pid, saved on stack.  */
+        movq    0(%rsp), %rax
+        addq    $32, %rsp
+L(pseudo_end):
+        ret
+
+L(error_unmask):
+
+        /* Save the error code, currently in %rax.  */
+        movq    %rax, 0(%rsp)
+
+        /* Restore the previous signal mask.  */
+        movq    $SIG_SETMASK, %rdi
+        leaq    16(%rsp), %rsi
+        xorl    %edx,%edx
+        DO_CALL (sigprocmask, 3)
+
+	/* load saved error code */
+        movq    0(%rsp), %rax
+
+L(error):
+        addq    $32, %rsp
+        jmp     SYSCALL_ERROR_LABEL
+
+L(child):/* Here we are in the child thread.  */
+
+        /* set up stack */
+        movq    %rsi, %rsp
+
+        /* Clear the frame pointer.  The ABI suggests this be done, to mark
+           the outermost frame obviously.  */
+        xorl    %ebp, %ebp
+
+        /* Restore the previous signal mask.  */
+        movq    $SIG_SETMASK, %rdi
+        xorl    %edx,%edx
+        DO_CALL (sigprocmask, 3)
+
+        addq    $16, %rsp
+        jmp     L(thread_start2)
+
+        cfi_startproc;
+
+PSEUDO_END (__start_thread)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/swapcontext.S
@@ -0,0 +1,32 @@
+/* swap current context.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text
+ENTRY(__swapcontext)
+        clc
+        DO_CALL (swapcontext, 2)
+        jb SYSCALL_ERROR_LABEL
+L(pseudo_end):
+	ret
+
+PSEUDO_END(__swapcontext)
+
+weak_alias(__swapcontext, swapcontext)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/sys/io.h
@@ -0,0 +1,184 @@
+/* Copyright (C) 1996, 2000, 2002, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef	_SYS_IO_H
+#define	_SYS_IO_H	1
+
+#ifdef _MACHINE_CPUFUNC_H_
+#error "This header must not be used in combination with <machine/cpufunc.h>."
+#endif
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* If TURN_ON is TRUE, request for permission to do direct i/o on the
+   port numbers in the range [FROM,FROM+NUM-1].  Otherwise, turn I/O
+   permission off for that range.  This call requires root privileges.
+
+   Portability note: not all kFreeBSD platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however. */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+                   int __turn_on) __THROW;
+
+/* Set the I/O privilege level to LEVEL.  If LEVEL>3, permission to
+   access any I/O port is granted.  This call requires root
+   privileges. */
+extern int iopl (int __level) __THROW;
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+static __inline unsigned char
+inb (unsigned short int port)
+{
+  unsigned char _v;
+
+  __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned char
+inb_p (unsigned short int port)
+{
+  unsigned char _v;
+
+  __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned short int
+inw (unsigned short int port)
+{
+  unsigned short _v;
+
+  __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned short int
+inw_p (unsigned short int port)
+{
+  unsigned short int _v;
+
+  __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned int
+inl (unsigned short int port)
+{
+  unsigned int _v;
+
+  __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline unsigned int
+inl_p (unsigned short int port)
+{
+  unsigned int _v;
+  __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
+  return _v;
+}
+
+static __inline void
+outb (unsigned char value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outb_p (unsigned char value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+outw (unsigned short int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
+
+}
+
+static __inline void
+outw_p (unsigned short int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+outl (unsigned int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline void
+outl_p (unsigned int value, unsigned short int port)
+{
+  __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80": :"a" (value),
+			"Nd" (port));
+}
+
+static __inline void
+insb (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insw (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+insl (unsigned short int port, void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsb (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsw (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+static __inline void
+outsl (unsigned short int port, const void *addr, unsigned long int count)
+{
+  __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr),
+			"=c" (count):"d" (port), "0" (addr), "1" (count));
+}
+
+#endif	/* GNU C */
+
+__END_DECLS
+#endif /* _SYS_IO_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/sys/perm.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 1996, 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYS_PERM_H
+#define _SYS_PERM_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Set port input/output permissions.  */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+		   int __turn_on) __THROW;
+
+
+/* Change I/O privilege level.  */
+extern int iopl (int __level) __THROW;
+
+__END_DECLS
+
+#endif	/* _SYS_PERM_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/sys_fork.S
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991-1992, 1994-1995, 1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+.text;
+ENTRY (__syscall_fork)
+	DO_CALL (fork, 0)
+	jb SYSCALL_ERROR_LABEL;
+	/* R1 is now 0 for the parent and 1 for the child.  Decrement it to
+	   make it -1 (all bits set) for the parent, and 0 (no bits set)
+	   for the child.  Then AND it with R0, so the parent gets
+	   R0&-1==R0, and the child gets R0&0==0.  */
+
+	decq	%rdx
+	andq	%rdx, %rax
+
+L(pseudo_end):
+	ret
+PSEUDO_END (__syscall_fork)
+libc_hidden_def (__syscall_fork)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/sysarch.h
@@ -0,0 +1,72 @@
+/* Parameters for the architecture specific system call.  amd64 version.
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _SYSARCH_H
+#define _SYSARCH_H	1
+
+#include <features.h>
+
+/* Function that can be used as first argument to 'sysarch'.  */
+enum
+  {
+    I386_GET_LDT = 0,
+#define I386_GET_LDT I386_GET_LDT
+    I386_SET_LDT = 1,
+#define I386_SET_LDT I386_SET_LDT
+    I386_GET_IOPERM = 3,
+#define I386_GET_IOPERM I386_GET_IOPERM
+    I386_SET_IOPERM = 4,
+#define I386_SET_IOPERM I386_SET_IOPERM
+    I386_GET_FSBASE = 7,
+#define I386_GET_FSBASE I386_GET_FSBASE
+    I386_SET_FSBASE = 8,
+#define I386_SET_FSBASE I386_SET_FSBASE
+    I386_GET_GSBASE = 9,
+#define I386_GET_GSBASE I386_GET_GSBASE
+    I386_SET_GSBASE = 10,
+#define I386_SET_GSBASE I386_SET_GSBASE
+    AMD64_GET_FSBASE = 128,
+#define	AMD64_GET_FSBASE AMD64_GET_FSBASE
+    AMD64_SET_FSBASE = 129,
+#define	AMD64_SET_FSBASE AMD64_SET_FSBASE
+    AMD64_GET_GSBASE = 130,
+#define	AMD64_GET_GSBASE AMD64_GET_GSBASE
+    AMD64_SET_GSBASE = 131
+#define	AMD64_SET_GSBASE AMD64_SET_GSBASE
+  };
+
+/* Argument struct for I386_GET_IOPERM and I386_SET_IOPERM.  */
+struct i386_ioperm_args
+  {
+    unsigned int start;
+    unsigned int length;
+    int enable;
+  };
+
+__BEGIN_DECLS
+
+extern int sysarch (int __cmd, void *__arg);
+
+#ifdef _LIBC
+extern int __sysarch (int __cmd, void *__arg);
+#endif
+
+__END_DECLS
+
+#endif /* _SYSARCH_H */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/syscall.S
@@ -0,0 +1,31 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Modification for FreeBSD contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+	.text
+ENTRY (__syscall)
+	movq %rcx, %r10
+	movl $SYS_ify (syscall), %eax
+	syscall
+	jb SYSCALL_ERROR_LABEL
+L(pseudo_end):
+	ret
+PSEUDO_END (__syscall)
+weak_alias (__syscall, syscall)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/syscalls-internal.h
@@ -0,0 +1,129 @@
+/* generally used "internal syscalls"
+   Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef KFREEBSD_INTERNAL_SYSCALLS_H
+#define KFREEBSD_INTERNAL_SYSCALLS_H
+
+#include <sys/syscall.h>
+
+/* 
+   for now, we do not care whether syscall succeeded,
+   we do not have defined 
+   INTERNAL_SYSCALL_ERROR_P and INTERNAL_SYSCALL_ERRNO
+   we do not store errno at all
+   to be sure, we return void
+*/
+
+#undef INTERNAL_SYSCALL_DECL
+#undef INTERNAL_SYSCALL_NCS
+#undef INTERNAL_SYSCALL
+#undef INTERNAL_SYSCALL_ERROR_P
+#undef INTERNAL_SYSCALL_ERRNO
+
+#define INTERNAL_SYSCALL_DECL(err)		\
+  do { } while (0)
+
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+  INTERNAL_SYSCALL_##name(name, err, nr, ##args)
+
+
+#define INTERNAL_SYSCALL_clock_gettime(name, err, nr, clkid, ts) \
+(void)({                                        \
+  register long int _a1 = (long int) (clkid);	\
+  register long int _a2 = (long int) (ts);	\
+  register long int result;			\
+  asm volatile (				\
+	"syscall"				\
+        : "=a" (result)				\
+        : "0" ((long int) SYS_##name),		\
+	  "D" (_a1),				\
+	  "S" (_a2)				\
+	: "memory", "cc", "cx", "dx", "r8", "r9", "r10", "r11"); \
+  result;                                       \
+})
+
+#define INTERNAL_SYSCALL_close(name, err, nr, fd) \
+(void)({                                        \
+  register long int _a1 = (long int) (fd);	\
+  register long int result;			\
+  asm volatile (				\
+	"syscall"				\
+        : "=a" (result)				\
+        : "0" ((long int) SYS_##name),		\
+	  "D" (_a1)				\
+	: "memory", "cc", "cx", "dx", "r8", "r9", "r10", "r11"); \
+  result;                                       \
+})
+
+#define INTERNAL_SYSCALL_kill(name, err, nr, pid, sig) \
+(void)({                                        \
+  register long int _a1 = (long int) (pid);	\
+  register long int _a2 = (long int) (sig);	\
+  register long int result;			\
+  asm volatile (				\
+	"syscall"				\
+        : "=a" (result)				\
+        : "0" ((long int) SYS_##name),		\
+	  "D" (_a1),				\
+	  "S" (_a2)				\
+	: "memory", "cc", "cx", "dx", "r8", "r9", "r10", "r11"); \
+  result;                                       \
+})
+
+#define INTERNAL_SYSCALL_write(name, err, nr, fd, buf, cnt) \
+(void)({                                        \
+  register long int _a1 = (long int) (fd);	\
+  register long int _a2 = (long int) (buf);	\
+  register long int _a3 = (long int) (cnt);	\
+  register long int result;			\
+  register long int _trash;			\
+  asm volatile (				\
+	"syscall"				\
+        : "=a" (result),			\
+          "=d" (_trash)				\
+        : "0" ((long int) SYS_##name),		\
+	  "D" (_a1),				\
+	  "S" (_a2),				\
+	  "d" (_a3)				\
+          /*  beware rdx is not preserved after syscall */ \
+	: "memory", "cc", "cx", "r8", "r9", "r10", "r11"); \
+  result;                                       \
+})
+
+#define INTERNAL_SYSCALL_writev(name, err, nr, fd, iov, cnt) \
+(void)({                                        \
+  register long int _a1 = (long int) (fd);	\
+  register long int _a2 = (long int) (iov);	\
+  register long int _a3 = (long int) (cnt);	\
+  register long int result;			\
+  register long int _trash;			\
+  asm volatile (				\
+	"syscall"				\
+        : "=a" (result),			\
+          "=d" (_trash)				\
+        : "0" ((long int) SYS_##name),		\
+	  "D" (_a1),				\
+	  "S" (_a2),				\
+	  "d" (_a3)				\
+          /*  beware rdx is not preserved after syscall */ \
+	: "memory", "cc", "cx", "r8", "r9", "r10", "r11"); \
+  result;                                       \
+})
+
+#endif
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/sysdep.S
@@ -0,0 +1,40 @@
+/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+/* The following code is only used in the shared library when we
+   compile the reentrant version.  Otherwise each system call defines
+   each own version.  */
+
+#ifndef PIC
+
+/* The syscall stubs jump here when they detect an error.
+   The code for Linux is almost identical to the canonical Unix
+   code, except that the error number in %rax is negated.  */
+
+#undef CALL_MCOUNT
+#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %rax.  */
+
+	.text
+ENTRY (__syscall_error)
+
+#define __syscall_error __syscall_error_1
+#include <sysdeps/unix/x86_64/sysdep.S>
+
+#endif	/* !PIC */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/sysdep.h
@@ -0,0 +1,204 @@
+/* Copyright (C) 2001,02,03,04 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Modification for FreeBSD contributed by Petr Salinger, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _KFREEBSD_X86_64_SYSDEP_H
+#define _KFREEBSD_X86_64_SYSDEP_H 1
+
+/* There is some commonality.  */
+#include <sysdeps/unix/x86_64/sysdep.h>
+/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
+#include <dl-sysdep.h>
+#include <tls.h>
+
+#ifdef __ASSEMBLER__
+
+/* We don't want the label for the error handle to be global when we define
+   it here.  */
+#ifdef PIC
+# define SYSCALL_ERROR_LABEL 0f
+#else
+# define SYSCALL_ERROR_LABEL syscall_error
+#endif
+
+#undef	PSEUDO
+#define	PSEUDO(name, syscall_name, args)				      \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args);					      \
+    jb SYSCALL_ERROR_LABEL;						      \
+  L(pseudo_end):
+
+#undef	PSEUDO_END
+#define	PSEUDO_END(name)						      \
+  SYSCALL_ERROR_HANDLER							      \
+  END (name)
+
+#undef	PSEUDO_NOERRNO
+#define	PSEUDO_NOERRNO(name, syscall_name, args) \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args)
+
+#undef	PSEUDO_END_NOERRNO
+#define	PSEUDO_END_NOERRNO(name) \
+  END (name)
+
+#define ret_NOERRNO ret
+
+#undef	PSEUDO_ERRVAL
+#define	PSEUDO_ERRVAL(name, syscall_name, args) \
+  .text;								      \
+  ENTRY (name)								      \
+    DO_CALL (syscall_name, args);					      \
+
+#undef	PSEUDO_END_ERRVAL
+#define	PSEUDO_END_ERRVAL(name) \
+  END (name)
+
+#define ret_ERRVAL ret
+
+#ifndef PIC
+#define SYSCALL_ERROR_HANDLER	/* Nothing here; code in sysdep.S is used.  */
+#elif RTLD_PRIVATE_ERRNO
+# define SYSCALL_ERROR_HANDLER			\
+0:						\
+  leaq rtld_errno(%rip), %rcx;			\
+  movl %eax, (%rcx);				\
+  orq $-1, %rax;				\
+  jmp L(pseudo_end);
+#else
+# if IS_IN (libc)
+#  define SYSCALL_ERROR_ERRNO __libc_errno
+# else
+#  define SYSCALL_ERROR_ERRNO errno
+# endif
+# define SYSCALL_ERROR_HANDLER			\
+0:						\
+  movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
+  movl %eax, %fs:(%rcx);			\
+  orq $-1, %rax;				\
+  jmp L(pseudo_end);
+#endif	/* PIC */
+
+/* The FreeBSD/amd64 kernel expects the system call parameters in
+   registers according to the following table:
+
+    syscall number	rax
+    arg 1		rdi
+    arg 2		rsi
+    arg 3		rdx
+    arg 4		r10
+    arg 5		r8
+    arg 6		r9
+
+    The FreeBSD kernel internal syscall usage of registers:
+
+    preserved:
+	stack pointer			rsp
+	C preserved			rbx, rbp, r12-r15
+	some input params		rdi, rsi
+
+    destroyed:
+	return value(s)			rax, rdx, eflags
+	return address from syscall	rcx
+	eflags from syscall		r11
+	used internally			r8-r10
+
+    Normal function call, including calls to the system call stub
+    functions in the libc, get the first six parameters passed in
+    registers and the seventh parameter and later on the stack.  The
+    register use is as follows:
+
+     system call number	in the DO_CALL macro
+     arg 1		rdi
+     arg 2		rsi
+     arg 3		rdx
+     arg 4		rcx
+     arg 5		r8
+     arg 6		r9
+
+    We have to take care that the stack is aligned to 16 bytes.  When
+    called the stack is not aligned since the return address has just
+    been pushed.
+
+*/
+
+#undef	DO_CALL
+#define DO_CALL(syscall_name, args)		\
+    DOARGS_##args				\
+    movl $SYS_ify (syscall_name), %eax;		\
+    syscall;
+
+#define DOARGS_0 /* nothing */
+#define DOARGS_1 /* nothing */
+#define DOARGS_2 /* nothing */
+#define DOARGS_3 /* nothing */
+#define DOARGS_4 movq %rcx, %r10;
+#define DOARGS_5 DOARGS_4
+#define DOARGS_6 DOARGS_5
+#define DOARGS_7 DOARGS_6
+#define DOARGS_8 DOARGS_7
+
+#else   /* !__ASSEMBLER__ */
+
+#include <syscalls-inline.h>
+
+#endif	/* __ASSEMBLER__ */
+
+
+/* Pointer mangling support.  */
+#if IS_IN (rtld)
+/* We cannot use the thread descriptor because in ld.so we use setjmp
+   earlier than the descriptor is initialized.  */
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(reg)	xorq __pointer_chk_guard_local(%rip), reg;    \
+				rolq $17, reg
+#  define PTR_DEMANGLE(reg)	rorq $17, reg;				      \
+				xorq __pointer_chk_guard_local(%rip), reg
+# else
+#  define PTR_MANGLE(reg)	asm ("xorq __pointer_chk_guard_local(%%rip), %0\n" \
+				     "rolq $17, %0"			      \
+				     : "=r" (reg) : "0" (reg))
+#  define PTR_DEMANGLE(reg)	asm ("rorq $17, %0\n"			      \
+				     "xorq __pointer_chk_guard_local(%%rip), %0" \
+				     : "=r" (reg) : "0" (reg))
+# endif
+#else
+# ifdef __ASSEMBLER__
+#  define PTR_MANGLE(reg)	xorq %fs:POINTER_GUARD, reg;		      \
+				rolq $17, reg
+#  define PTR_DEMANGLE(reg)	rorq $17, reg;				      \
+				xorq %fs:POINTER_GUARD, reg
+# else
+#  define PTR_MANGLE(var)	asm ("xorq %%fs:%c2, %0\n"		      \
+				     "rolq $17, %0"			      \
+				     : "=r" (var)			      \
+				     : "0" (var),			      \
+				       "i" (offsetof (tcbhead_t,	      \
+						      pointer_guard)))
+#  define PTR_DEMANGLE(var)	asm ("rorq $17, %0\n"			      \
+				     "xorq %%fs:%c2, %0"		      \
+				     : "=r" (var)			      \
+				     : "0" (var),			      \
+				       "i" (offsetof (tcbhead_t,	      \
+						      pointer_guard)))
+# endif
+#endif
+
+#endif /* _KFREEBSD_X86_64_SYSDEP_H  */
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/ucontext_i.h
@@ -0,0 +1,38 @@
+/* Offsets  needed in the makecontext() function implementation.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Offsets of the fields in the ucontext_t structure. */
+
+#define oRDI		24
+#define oRSI		32
+#define oRDX		40
+#define oRCX		48
+#define oR8		56
+#define oR9		64
+
+#define oRAX		72
+#define oRBX		80
+#define oRBP		88
+
+#define oRIP		176
+#define oRSP		200
+
+#define oLINK		816
+#define oSS_SP		824
+#define oSS_SIZE	832
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/x86_64/vfork.S
@@ -0,0 +1,59 @@
+/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+/* Clone the calling process, but without copying the whole address space.
+   The calling process is suspended until the new process exits or is
+   replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
+   and the process ID of the new process to the old process.  */
+
+ENTRY (__vfork)
+
+	/* Pop the return PC value into RDI.  */
+	popq	%rdi
+	cfi_adjust_cfa_offset(-8)
+	cfi_register(%rip, %rdi)
+
+	/* Perform the system call.  */
+	DO_CALL (vfork, 0)
+	jb	L(error)	/* Branch forward if it failed.  */
+
+	/* In the parent process, %rdx == 0, %rax == child pid.  */
+	/* In the child process, %rdx == 1, %rax == parent pid.  */
+
+	/* Change %rax to be 0 in the child process.  */
+	decq	%rdx
+	andq	%rdx, %rax
+
+	/* Jump to the return PC.  */
+	jmp	*%rdi
+
+L(error):
+	/* Push back the return PC.  */
+	pushq	%rdi
+	cfi_adjust_cfa_offset(8)
+
+	/* Branch to the error handler, hidden in PSEUDO_END.  */
+	jmp	SYSCALL_ERROR_LABEL
+L(pseudo_end):
+	ret
+PSEUDO_END (__vfork)
+libc_hidden_def (__vfork)
+
+weak_alias (__vfork, vfork)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/xmknod.c
@@ -0,0 +1,48 @@
+/* xmknod call using old-style Unix mknod and mkfifo system calls.
+   Copyright (C) 1991, 1993, 1995-1997, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+extern int __syscall_mknod (const char *, mode_t, dev_t);
+extern int __mkfifo (const char *, mode_t);
+
+/* Create a device file named PATH, with permission and special bits MODE
+   and device number DEV (which can be constructed from major and minor
+   device numbers with the `makedev' macro above).  */
+int
+__xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
+{
+  if (vers != _MKNOD_VER)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  /* The FreeBSD mknod() system call cannot be used to create FIFOs; we
+     must use the mkfifo() system call for this purpose.  */
+  if (S_ISFIFO (mode))
+    return __mkfifo (path, mode & ~S_IFMT);
+
+  return __syscall_mknod (path, mode, *dev);
+}
+libc_hidden_def (__xmknod)
+
+weak_alias (__xmknod, _xmknod)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/xmknodat.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysdep.h>
+#include <sys/stat.h>
+#include <sys/user.h>
+#include <kernel-features.h>
+
+extern int __syscall_mknodat (int fd, const char *path,
+			      mode_t mode, dev_t dev);
+libc_hidden_proto (__syscall_mknodat)
+
+extern int __syscall_mkfifoat (int fd, const char *path,
+			       mode_t mode);
+libc_hidden_proto (__syscall_mkfifoat)
+
+/* Create a device file named PATH relative to FD, with permission and
+   special bits MODE and device number DEV (which can be constructed
+   from major and minor device numbers with the `makedev' macro above).  */
+int
+__xmknodat (int vers, int fd, const char *file, mode_t mode, dev_t * dev)
+{
+  if (vers != _MKNOD_VER)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+      /* The FreeBSD mknod() system call cannot be used to create FIFOs; we
+         must use the mkfifo() system call for this purpose.  */
+      if (S_ISFIFO (mode))
+	return INLINE_SYSCALL (mkfifoat, 3, fd, file, mode);
+      else
+	return INLINE_SYSCALL (mknodat, 4, fd, file, mode, *dev);
+}
+
+libc_hidden_def (__xmknodat)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/xstat.c
@@ -0,0 +1,47 @@
+/* xstat using FreeBSD stat, nstat system calls.
+   Copyright (C) 1991,1995-1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include "stat16conv.c"
+
+int
+__xstat (int vers, const char *file, struct stat *buf)
+{
+  if (__builtin_expect (vers == _STAT_VER, 1))
+    {
+      struct stat16 buf16;
+      int result = __syscall_stat (file, &buf16);
+      if (result == 0)
+	stat16_to_stat (&buf16, buf);
+      return result;
+    }
+  else if (__builtin_expect (vers == _STAT_VER_stat, 1))
+    return __syscall_stat (file, (struct stat16 *) buf);
+  else
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+}
+hidden_def (__xstat)
+
+weak_alias (__xstat, _xstat)
--- /dev/null
+++ b/sysdeps/unix/bsd/bsd4.4/kfreebsd/xstat64.c
@@ -0,0 +1,43 @@
+/* xstat using FreeBSD stat, nstat system calls.
+   Copyright (C) 1991,1995-1997,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include "stat16conv.c"
+
+int
+__xstat64 (int vers, const char *file, struct stat64 *buf)
+{
+  if (__builtin_expect (vers == _STAT_VER, 1))
+    {
+      struct stat16 buf16;
+      int result = __syscall_stat (file, &buf16);
+      if (result == 0)
+	stat16_to_stat64 (&buf16, buf);
+      return result;
+    }
+  else
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+}
+hidden_def (__xstat64)