Welcome to mirror list, hosted at ThFree Co, Russian Federation.

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

	* syslog.cc (vsyslog): Decrement len if trailing \n has been removed.
	Add \n when writing to stderr if LOG_PERROR option is set.

2005-12-31  Corinna Vinschen  <corinna@vinschen.de>

	* include/cygwin/in.h: Drop including stdint.h.  Move definition
	of in_port_t and in_addr_t to top of file and use throughout. Use
	sa_family_t type where appropriate.
	(struct in6_addr): Change `unsigned char' to `uint8_t'.
	(struct sockaddr_in6): Add sin6_scope_id member. Add comments.
	* include/cygwin/socket.h: Include stdint.h.  Move definition of
	socklen_t to top of file.  Define sa_family_t.  Define struct
	sockaddr_storage as per SUSv3.
	* include/sys/un.h: Include cygwin/socket.h.  Use sa_family_t type.

2005-12-29  Christopher Faylor  <cgf@timesys.com>

	* fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Use
	strace method rather than accessing field directly.
	(fhandler_tty_common::__release_output_mutex): Ditto.

2005-12-29  Christopher Faylor  <cgf@timesys.com>

	* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
	(child_info::dwProcessId): Delete.
	(child_info::straced): New variable.
	(child_info::handle_fork): New member function.
	* dcrt0.cc (in_forkee): New global variable.
	(__cygwin_user_data::forkee): Mark as obsolete.
	(do_global_ctors): Use in_forkee rather than user_data->forkee.
	(get_cygwin_startup_info): Ditto.  Deal with new straced field to allow
	strace to deal with children of attached processes.
	(initial_env): Accommodate changes to strace::hello.
	(child_info_fork::handle_fork): Rename from plain old 'handle_fork'.
	Move alloc_stack() call elsewhere.
	(dll_crt0_0): Fill out more of user_data.  Reference handle_fork via
	fork_info.  Add some debugging output.
	(_dll_crt0): Don't wait for sync thread if sync_startup is invalid.
	Zero sync_startup here.  Call alloc_stack() here, if appropriate.
	(dll_crt0_1): Use in_forkee rather than user_data->forkee.
	(dll_crt0): Ditto.
	* malloc_wrapper.cc (malloc_init): Ditto.
	* dll_init.cc (in_forkee): Remove local static version of this
	variable.
	(dll_list::load_after_fork): Don't set in_forkee here.
	* external.cc (cygwin_internal): Use strace method rather than
	accessing field directly.
	* fhandler.cc (fhandler_base::read): Ditto.
	* fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto.
	* fork.cc (frok::parent): Invoke strace write_childpid to communicate
	with potential strace.
	(child_copy): Add more detail to debugging output.
	* init.cc (calibration_id): New static variable.
	(prime_threads): Set sync_startup to invalid handle if we already know
	about thread_func_ix.  Use static calibration_id to hold calibration
	thread id.
	* munge_threadfunc (munge_threadfunc): Don't try to debug if we don't
	find threadfunc_ix.
	(dll_entry): Avoid calling munge_threadfunc and _cygtls::remove on
	non-cygwin threads invoked during process startup.
	* pinfo.cc (set_myself): Always call strace.hello here regardless of
	DEBUGGING.
	* sigproc.cc (child_info::child_info): Remove spurious handling of
	dwProcessId.  Set straced as appropriate.
	* spawn.cc (spawn_guts): Rename ciresrv to ch.  Invoke strace
	write_childpid to communicate with potential strace.
	* strace.cc: Include child_info.h.
	(strace::hello): Remove inited test.  Use active() method to test if
	strace has been activated.  Handle case where we are started before
	(mypid): New function.
	(strace::vsprntf): Try to deal more intelligently with case where
	progname may not be filled out.  Put pid in parentheses if it is a
	windows pid rather than a cygwin pid.  myself has been filled out.
	(strace::write_childpid): New function for notifying strace about the
	creation of children.
	(strace::vprntf): Use strace method rather than accessing field
	directly.
	(strace_printf): Ditto.
	(strace::wm): Ditto.
	* winsup.h (in_forkee): Declare.
	* include/sys/strace.h (strace::write_childpid): Declare new function.
	(strace::attached): Define new function.
	(strace::active): Ditto.
	(strace::active_val): Ditto.
	(_STRACE_ON): Delete.
	(_STRACE_OFF): Ditto.
	(define_strace0): Use strace method rather than accessing field
	directly.
	(strace_printf_wrap): Ditto.
	(strace_printf_wrap1): Ditto.

2005-12-28  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (win_env::add_cache): Don't add variables to the
	environment during initialization.

2005-12-27  Corinna Vinschen  <corinna@vinschen.de>

	* exceptions.cc (_cygtls::handle_exceptions): Drop redundant `break'.

2005-12-27  Corinna Vinschen  <corinna@vinschen.de>

	* exceptions.cc (inside_kernel): Rename from interruptible.
	Accommodate change throughout file.

2005-12-27  Corinna Vinschen  <corinna@vinschen.de>

	* exceptions.cc (interruptible): New function, code stripped from
	_cygtls::interrupt_now.
	(_cygtls::handle_exceptions): Handle STATUS_DATATYPE_MISALIGNMENT as
	SIGBUS error.  Differ between unmapped memory (SEGV_MAPERR) and access
	violation (SEGV_ACCERR) in case of STATUS_ACCESS_VIOLATION.  Write
	kernel log message in case of uncatched STATUS_ACCESS_VIOLATION.
	(_cygtls::interrupt_now): Just call interruptible now instead of
	evaluating interruptibility here.

2005-12-27  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (path_conv::check): Rework loop removing trailing dots
	and spaces.

	* syslog.cc (vklog): Set facility to LOG_KERN if not set.

2005-12-26  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (__api_fatal): Simplify to just use strace mechamisms.
	(do_exit): Move minimal_printf...
	* pinfo.cc (pinfo::exit): ...into here.
	* strace.cc (strace::vprntf): Guarantee output to the console when
	system_printf/api_fatal.

	* heap.cc (heap_init): Wait a second before issuing an error when
	ERROR_INVALID_ADDRESS since this is probably due to a CTRL-C handler
	sneaking in, using the memory that we want to use for the heap, and,
	eventually exiting.

2005-12-23  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (_cygtls::handle_threadlist_exception): Make an error
	fatal.
	* cygtls.h (sockaddr_in): Use header rather than defining our own
	structure.
	* exceptions.cc (_cygtls::interrupt_setup): Use exact contents of
	sa_mask rather than assuming that current sig should be masked, too.
	(_cygtls::call_signal_handler): Use more aggressive locking.
	* gendef (_sigbe): Wait until later before releasing incyg.
	(_sigreturn): Remove more arguments to accommodate quasi-sa_sigaction
	support.
	(_sigdelayed): Push arguments for sa_sigaction.  More work needed here.
	* signal.cc (sigaction): Implement SA_NODEFER.
	* tlsoffsets.h: Regenerate.

	* sigproc.cc (wait_sig): Use default buffer size or Windows 9x
	complains.

	* pinfo.cc (_onreturn::dummy_handle): Remove.
	(_onreturn::h): Make this a pointer.
	(_onreturn::~_onreturn): Detect whether pointer is NULL rather than
	value is NULL.
	(_onreturn::_onreturn): Set h to NULL initially.
	(_onreturn::no_close_p_handle): Set h to NULL.
	(winpids::add): Initialize onreturn with value from p.hProcess
	immediately.

2005-12-22  Christopher Faylor  <cgf@timesys.com>

	* fork.cc (fork): Honor error return from sig_send.  Don't continue
	with fork if we couldn't suspend signals.
	* sigproc.cc (sig_send): Set sigCONT event when we see __SIGNOHOLD.
	(wait_sig): Remove holding_signals.  Create pipe with a buffer which
	will theoretically cause blocking if there is nothing reading on the
	pipe.  Wait for sigCONT at end of loop when we have a __SIGHOLD.

2005-12-22  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_base::issymlink): New method.
	* syscalls.cc (open): Handle O_NOFOLLOW flag.
	* include/fcntl.h (_FNOFOLLOW): New define.
	(O_NOFOLLOW): Ditto.
	* include/cygwin/version.h: Bump API minor number.

2005-12-22  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (winpids::add): Increment nelem when winpid is true since we
	don't care if it's a cygwin process in that case.

2005-12-22  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (winpids::release): Fix typo.

2005-12-21  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::init): Clarify comment slightly.
	(_onreturn): New helper class.
	(winpids:add): Remove copied stuff.  Try to put process handle into
	pinfo in question and use _onreturn class to control when to close it.
	(winpids::release): Remove use of copied array.  Free procinfo when
	hProcess is NULL.  Otherwise call release and call CloseHandle on
	hProcess.
	* pinfo.h (winpids::copied): Remove throughout class.

2005-12-21  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::init): Remove spurious low_priority_sleep.

2005-12-21  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (spawn_guts): Hide the window whenever ctty == -1, not just
	when we have no console.

2005-12-21  Christopher Faylor  <cgf@timesys.com>

	* cygheap.cc (init_cygheap::manage_console_count): Revert previous
	change.  Handle this a different way.
	* external.cc (cygwin_internal): Accommodate extra
	hook_or_detect_cygwin argument.
	* hookapi.cc (cygwin_internal): Fill in subsys variable with the
	subsystem of the executable.
	* spawn.cc (av::iscui): New variable.
	(spawn_guts): Hide window when we don't have a console and this isn't
	NT/XP/2003.
	(av::fixup): Set iscui flag.
	* winsup.h (hook_or_detect_cygwin): Accommodate extra argument.

2005-12-21  Christopher Faylor  <cgf@timesys.com>

	* cygheap.cc (init_cygheap::manage_console_count): Don't call
	FreeConsole on 9x/Me.

2005-12-21  Corinna Vinschen  <corinna@vinschen.de>

	* (fhandler_disk_file::fchown): Remove execute bits from "sensible"
	permissions.  Use same setting as in symlink.

2005-12-21  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix inode number
	debug output.
	(fhandler_disk_file::fchown): Always set sensible permission values
	when creating the ACL for symlinks.

2005-12-20  Corinna Vinschen  <corinna@vinschen.de>

	* winsup.h (flush_file_buffers): Define as inline function.
	* miscfuncs.cc (flush_file_buffers): Remove.

2005-12-20  Corinna Vinschen  <corinna@vinschen.de>

	* winsup.h (flush_file_buffers): Declare new function.
	(FLushFileBuffers): New define.
	* miscfuncs.cc (flush_file_buffers): Define new function.

2005-12-20  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (fhandler_termios::fixup_after_exec): Make non-inlined.
	* fhandler_termios.cc (fhandler_termios::fixup_after_exec): Don't call
	fixup_after_fork if close_on_exec'ed.

2005-12-19  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (_cygtls::interrupt_now): Subsume interruptible().
	(interruptible): Delete.
	(setup_handler): Remove interruptible call and just use return from
	interrupt_now.

2005-12-19  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (set_console_state_for_spawn): Add an argument to the
	declaration.
	* fhandler_console.cc (set_console_state_for_spawn): Ditto for the
	definition.  Only set invisible console for non-cygwin process.  Remove
	debugging leftover.
	* spawn.cc (spawn_guts): Pass argument denoting whether this is a
	cygwin process to set_console_state_for_spawn and only call this
	function when exec'ing.

2005-12-19  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (fhandler_dev_zero::mmap): Call VirtualFree(MEM_RELEASE)
	with zero length parameter, otherwise it fails.
	(fhandler_dev_zero::munmap): Ditto.

2005-12-18  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (fhandler_console::invisible_console): Declare new
	variable.
	(fhandler_pipe::fixup_in_child): Declare new function.
	(fhandler_console::need_invisible): Ditto.
	(fhandler_console::has_a): Ditto.
	* fhandler_console.cc (set_console_state_for_spawn): Eliminate return
	value.  Set up an invisible console if necessary prior to spawning.
	(fhandler_console::invisible_console): Define.
	* fhandler_tty.cc (fhandler_tty_slave::open): Use
	fhandler_console::invisible_console to setup an invisible console.
	* pipe.cc (fhandler_pipe::fixup_in_child): Define new function from
	fixup_after_exec.
	(fhandler_pipe::fixup_after_exec): Use fixup_in_child when appropriate.
	(fhandler_pipe::fixup_after_fork): Ditto.
	* spawn.cc (handle): Reorganize and modernize a little.
	(spawn_guts): Rely on set_console_state_for_spawn to set the console
	into the right state but don't create the process with "detached" flag
	if we have no controlling tty since that confuses 'cmd'.
	* dtable.cc (dtable::stdio_init): Don't set console as controlling
	terminal if we have an invisible console.

	* sigproc.cc (child_info::sync): Use correct name in ForceCloseHandle1.

2005-12-18  Christopher Faylor  <cgf@timesys.com>

	* include/sys/dirent.h: Change __deprecated_d_ino to __invalid_d_ino
	throughout to make things a little clearer.
	* dir.cc (readdir_worker): Reflect above change.

2005-12-16  Christopher Faylor  <cgf@timesys.com>

	* winsup.h (child_copy): Change prototype to match new functionality.
	* cygheap.cc (cygheap_fixup_in_child): Accommodate new child_copy
	arguments.
	* dcrt0.cc (dll_data_start): Move definition here from fork.
	(dll_data_end): Ditto.
	(dll_bss_start): Ditto.
	(dll_bss_end): Ditto.
	(handle_fork): New function.  Called when forked to deal with fork
	issues and copy data to this process from the parent.
	(dll_crt0_0): Call handle_fork when _PROC_FORK condition.
	(dll_crt0): Don't copy user_data when we've forked.  Don't zero first
	element of main_environment ever.
	(cygwin_dll_init): Ditto.
	* fork.cc (child_copy): Rename from fork_copy and change arguments so
	that each pair of things to copy gets its own descriptor.
	(frok::child): Remove fixup_mmaps_after_fork call here.  Move to
	handle_fork in dcrt0.cc.
	(frok::parent): Use child_copy rather than fork_copy and accommodate
	changes in parameters.

	* exceptions.cc (setup_handler): Delay test of whether we're locked
	until after GetThreadContext has been called since there are apparently
	cases where SuspendThread does not cause an immediate thread
	suspension.

2005-12-16  Christopher Faylor  <cgf@timesys.com>

	* init.cc (dll_entry): Call prime_threads after dll_crt0_0 to avoid
	conflicts between heap allocation and thread stack allocation.

2005-12-16  Christopher Faylor  <cgf@timesys.com>

	* hookapi.cc (putmem): Remove query of previous memory protection since
	we get that for free the first time we call VirtualProtect.

2005-12-15  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (fhandler_dev_zero::fixup_mmap_after_fork): Use
	system_printf like any other fixup_mmap_after_fork.

2005-12-14  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.cc (ACCFLAGS): Remove macro.
	(fhandler_base::get_default_fmode): Use O_ACCMODE instead of ACCFLAGS
	and or'ed read/write flags.
	(fhandler_base::open_9x): Use O_ACCMODE instead of or'ed read/write
	flags.
	(fhandler_base::open): Ditto.
	* fhandler_disk_file.cc (fhandler_base::open_fs): Ditto.
	* fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
	* fhandler_raw.cc (fhandler_dev_raw::open): Ditto.

2005-12-14  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.cc (fhandler_base::open_9x): Handle O_SYNC and O_DIRECT
	flags.
	(fhandler_base::open): Ditto.
	* fhandler_floppy.cc (fhandler_dev_floppy::open): Don't allocate devbuf
	in O_DIRECT case.
	* fhandler_raw.cc (fhandler_dev_raw::ioctl): Don't allow buffer
	changes in O_DIRECT case.  Allow returning a buffer size 0, which
	indicates O_DIRECT.
	* fhandler_tape.cc (fhandler_dev_tape::open): Use O_SYNC flag to
	hand down the !buffer_writes case.  Don't allocate devbuf in O_DIRECT
	case.
	(fhandler_dev_tape::raw_read): Don't mess with devbuf if it's NULL.
	* include/fcntl.h: Define _FDIRECT, O_DIRECT, O_DSYNC and O_RSYNC.
	* include/cygwin/version.h: Bump API minor version.

2005-12-13  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (_cygtls::remove): Don't bother if we're exiting.
	* sigproc.cc (_cygtls::remove_wq): Ditto.

2005-12-13  Christopher Faylor  <cgf@timesys.com>

	* fhandler_tty.cc (fhandler_tty::open): Enhance comment.

2005-12-13  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_tty.cc (fhandler_tty::open): Close newly created window
	station after switching to original window station.

2005-12-13  Christopher Faylor  <cgf@timesys.com>

	* fhandler_tty.cc (fhandler_tty::open): Add a comment.

2005-12-12  Christopher Faylor  <cgf@timesys.com>

	* times.cc (hires_ms::usecs): Subtract from slop from system time or
	we'll always end up priming the pump.

2005-12-12  Nick Duffek <nick@duffek.com>

	* times.cc (systime): Correct precision referenced in comment.

2005-12-12  Christopher Faylor  <cgf@timesys.com>

	* fhandler_tty.cc (fhandler_tty_slave::open): Don't free original
	windows station since that will cause strange problems displaying
	fonts.  Reset windows station to original station after creating
	console.
	* times.cc (hires_ms::usecs): Only reprime when calculated time is less
	than system time.

2005-12-12  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (winpids::add): Don't copy procinfo when there is no cygwin
	process associated with the pid, i.e., procinfo == NULL.

2005-12-12  Christopher Faylor  <cgf@timesys.com>

	* times.cc (hires_ms::usecs): Correct order when checking if high
	precision time is <= current time.

2005-12-12  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (size_copied): New convenience macro.
	(winpids::add): Alias the element that we are working on for slightly
	better clarity.  Honor the "make_copy" flag.
	(winpids::release): Free and zero procinfo field if it was allocated
	via malloc.
	(winpids::~winpids): Free copied array.
	* pinfo.h (class pinfo): Make winpids class a friend.
	(winpids::make_copy): New field.
	(winpids::copied): New array.
	(winpids::reset): Reset npids after releasing pinfos or suffer a memory
	leak.
	(winpids::winpids): Try harder to zero all fields in the class.

2005-12-12  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc (GetSystemTimes): Remove.

2005-12-12  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_proc.cc (format_proc_uptime): Drop usage of GetSystemTimes.
	Use NtQuerySystemInformation to evaluate uptime and idle_time from
	all CPU's processor times.  Fallback to GetTickCount.

2005-12-12  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (gen_create_protect): Always generate WRITECOPY protection
	for private maps.
	(fixup_mmaps_after_fork): Fix calculation of WRITECOPY protection for
	VirtualProtect.  Add some words to the comment.

2005-12-10  Christopher Faylor  <cgf@timesys.com>

	* dirent.h: Change the rest of the d_ino's to __deprecated_d_ino.

2005-12-10  Christopher Faylor  <cgf@timesys.com>

	* malloc.cc: Update to version 2.8.3.
	* cygmalloc.h (MSPACE): Remove unneeded definition.

2005-12-08  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_raw.cc (fhandler_dev_raw::ioctl): Only allow 0, 1 or a
	multiple of 512 as new buffersize.

2005-12-08  Pekka Pessi <ppessi@gmail.com>
	    Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::recvfrom): Mask flags with
	MSG_WINMASK for Windows socket calls.
	(fhandler_socket::recvmsg): Ditto.
	(fhandler_socket::sendmsg): Ditto.

2005-12-07  Christopher Faylor  <cgf@timesys.com>

	* hires.h (hires_ms::initime_ms): Delete.
	(hires_ms::initime_us): Just define as LONGLONG.
	(hires_ms::uptime): New function.
	* select.cc (select_stuff::wait): Use gtod for timing to attempt to
	avoid windows 32 bit wraparound.
	* times.cc (systime): New function.
	(times): Replace GetTickCount with gtod.uptime.
	(hires_us::prime): Use systime() to calculate system time rather than
	calling GetSystemTimeAsFileTime directly.
	(hires_ms::prime): Ditto.  Eliminate initime_ms.
	(hires_ms::usecs): Try harder to detect wraparound.

	* fhandler_proc.cc (format_proc_partitions): Set drive_size to zero to
	avoid a compiler warning.

2005-12-07  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_proc.cc (format_proc_partitions): Use modern IOCTLs
	to determine drive size as far as possible.

2005-12-07  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_raw.cc (fhandler_dev_raw::ioctl): Fix INVALID_PARAMETER
	condition.  Only copy devbuf to buf if buf is non-NULL.

2005-12-07  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_raw.cc (fhandler_dev_raw::ioctl): Fix setting devbuf
	when rd_parm is 0 or 1.

2005-12-07  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_floppy.cc (fhandler_dev_floppy::lseek): Fix test for
	valid file position at EOM.

2005-12-07  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/stdlib.h: Guard compilation of *unsetenv* in newlib.

2005-12-07  Corinna Vinschen  <corinna@vinschen.de>

	* exceptions.cc (_cygtls::handle_exceptions): In case of a
	STATUS_ACCESS_VIOLATION, check if the page is a mmaped page beyond
	a file's EOF.  Generate SIGBUS instead of SIGSEGV then.
	* mmap.cc (__PROT_ATTACH): New define.
	(__PROT_FILLER): Ditto.
	(fh_anonymous): Rename from fh_paging_file;
	(fh_disk_file): New global static variable.
	(attached): New inline function.
	(filler): Ditto.
	(gen_create_protect): Split off from gen_protect to use the file's
	access mode to create mapping always with maximum allowed protections.
	(gen_protect): Accommodate pages attached beyond EOF.  Use symbolic
	values instead of numerics when possible.  Drop create parameter.
	(gen_access): Use file's access mode instead of protection.
	(CreateMapping9x): Create named mapping names so that different
	creation access modes result in different mappings.
	(CreateMappingNT): Only reserve attached pages, don't commit them.
	(MapViewNT): Ditto.  Set AT_ROUND_TO_PAGE for all non-NULL base
	addresses.
	(mmap_func_t): Define CreateMapping and MapView function pointers
	with additional openflags parameter.
	(class mmap_record): Add openflags member.
	(mmap_record::mmap_record): Add openflags parameter.
	(mmap_record::get_openflags): New accessor.
	(mmap_record::attached): Call global attached function.
	(mmap_record::filler): Call global filler function.
	(mmap_record::gen_create_protect): Call global gen_create_protect
	function.
	(mmap_record::gen_protect): Drop create parameter.
	(mmap_record::alloc_fh): Set fhandler's access flags.
	(list::search_record): Accommodate filler pages.
	(list::set): Use inode number as hash value.
	(map::get_list_by_fd): Check hash value against file's inode number.
	(mmap_is_attached_page): New function to evaluate if a given address
	is on a attached page.  Called from _cygtls::handle_exceptions.
	(mmap_worker): New function to do mapping and bookkeeping in a
	single call.
	(mmap64): Use roundup2 to round length to pagesize alignment.
	Initialize global fhandlers.  Simplify anonymous initialization.
	Add SUSv3 compatible check of file open mode vs. requested protection.
	Try creating new file handles to allow maximum page protection.
	Allow creating attached pages in case of mapping beyond EOF.
	Close new file handle if one has been created.
	(munmap): Align len to pagesize.
	(msync): Rework argument checks. Align len to pagesize.
	(mprotect): Ditto.  Accommodate attached pages.
	(mlock): Use roundup/rounddown macros instead of homemade expressions.
	(munlock): Add page alignment as in mlock.
	(fhandler_dev_zero::munmap): Fix unmapping of non-private mappings.
	(fhandler_dev_zero::fixup_mmap_after_fork): Accommodate filler pages.
	(fixup_mmaps_after_fork): Don't fail if attached pages couldn't be
	created in child.  Avoid superfluous call to VirtualFree.  Check for
	original allocation protection to fix PAGE_WRITECOPY protection.
	* ntdll.h: Revert deletion of AT_ROUND_TO_PAGE define.
	* winsup.h (mmap_is_attached_page): Declare.

2005-12-05  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/stdlib.h: New file.
	* environ.cc (unsetenv): Change to return -1 on input error.
	* include/cygwin/version.h: Add more description to latest api bump.

2005-12-05  Christopher Faylor  <cgf@timesys.com>

	* dir.cc (readdir_workdir): Only fill out d_ino when linked into older
	app.
	* include/cygwin/version.h: Bump api minor number to 147, reflecting
	obsolescence of d_ino.
	(CYGWIN_VERSION_USER_API_VERSION_COMBINED): New convenience macro.
	(CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): New convenience macro.
	* include/sys/dirent.h: Change d_ino field to __deprecated_d_ino.

2005-12-05  Christopher Faylor  <cgf@timesys.com>

	Remove unneeded whitespace.
	* cygtls.cc (_cygtls::set_state): Delete.
	(_cygtls::reset_exception): Ditto.
	(_cygtls::init_thread): Set initialized state directly here.
	(_cygtls::push): Remove exception argument.  Don't treat exceptions
	specially.
	* cygtls.h (_cygtls::push): Ditto.
	(_cygtls::isinitialized): Don't treat exceptions specially.
	(_cygtls::reset_exception): Delete.
	(_cygtls::set_state): Ditto.
	(_cygtls::handle_exceptions): Don't push ebp on the stack prior to
	calling sig_send.  Just set incyg instead.
	(_cygtls::interrupt_setup): Accommodate _cygtls::push argument change.
	(_cygtls::interrupt_now): Ditto.
	(setup_handler): Don't treat exceptions specially.
	* gendef (longjmp): Always zero incyg flag.

2005-12-04  Corinna Vinschen  <corinna@vinschen.de>

	* environ.cc (spenvs): Add "windir" as an "always export" variable
	to accommodate WinSock on Windows 95.

2005-12-02  Christopher Faylor  <cgf@timesys.com>

	* include/exceptions.h (exception_list): Revert previous change.
	Windows doesn't care.
	(exception_handler): Use real exception_list parameter type rather than
	void *
	* tlsoffsets.h: Regenerate.
	* cygtls.h (_cygtls::handle_exceptions): Use real exception_list
	parameter type rather than void *.
	(handle_threadlist_exception): Ditto.
	(init_exception_handler): Ditto.
	* cygtls.cc (_cygtls::handle_threadlist_exception ): Ditto.
	(_cygtls::init_exception_handler): Add kludge to terminate linked list
	with a loop, which seems to solve problem of RtlUnwind causing problems
	* exceptions.cc (rtl_unwind): Use real exception_list parameter type
	rather than void *.
	(_cygtls::handle_exceptions): Ditto.

2005-12-02  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (_cygtls::el): New field.
	(_cygtls::handle_exceptions): New function declaration.
	(_cygtls::handle_threadlist_exception): Ditto.
	(_cygtls::init_exception_handler): Ditto.
	(_cygtls::init_threadlist_exceptions): Remove arg from declaration.
	* cygtls.cc (_cygtls::call2): Don't initialize exceptions here.
	(_cygtls::init_thread): Do it here instead and use member function.
	(_cygtls::handle_threadlist_exception): Move into _cygtls class.
	(_cygtls::init_exception_handler): Ditto.  Rely on existence of 'el'
	memmber in _cygtls.
	(_cygtls::init_threadlist_exceptions): Ditto.
	* dcrt0.cc (dll_crt0_1): Remove exception_list definition and setting
	since it now commonly resides in the tls.
	* exceptions.cc (init_exception_handler): Move to cygtls.cc.
	(init_exceptions): Ditto.
	(rtl_unwind): New, safe wrapper function for RtlUnwind.
	(_cygtls::handle_exceptions): Move to _cygtls.  Call rtl_unwind to
	unwind frames and eliminate copying of structures.  Put address of
	failing instruction in si_addr, not the address on the stack.  Return 0
	to indicate that we've handled this exception.
	* external.cc (cygwin_internal): Make CW_INIT_EXCEPTIONS a no-op.
	* sigproc.cc (wait_sig): Accommodate argument change to
	_cygtls::init_threadlist_exceptions.
	* tlsoffsets.h: Regenerate.
	* include/exceptions.h (exception_list): Add more stuff to the
	exception list.  Apparently windows needs this?
	(init_exceptions): Remove bogus declaration.

	* include/cygwin/signal.h (SI_USER): Redefine as zero as per SUSv3.
	* include/cygwin/version.h: Bump API minor version number to 146.

	* thread.cc (pthread_kill): Set si_pid and si_uid.

	* timer.cc (timer_thread): Set si_code to SI_TIMER.

2005-12-01  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (getstack): Try harder to modify memory.
	(alloc_stack): Alloc page prior to stack top, too.

2005-12-01  Christopher Faylor  <cgf@timesys.com>

	* devices.h (_major): Revert previous ill-advised change.
	(_minor): Ditto.

2005-12-01  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc (handle_exceptions): Translate a guard page exception
	to a "SIGBUS".

2005-12-01  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc: Make debug output more consistently.  Fix some comments.
	(gen_protect): Convert to inline function.
	(gen_access): Ditto.
	(mmap_record::gen_protect): Add create parameter as in global function.
	(mmap_record::alloc_page_map): Change condition so that always the
	correct protection setting is set after mapping has been established.
	(mmap64): For anonymous mappings set offset always to 0.
	(fixup_mmaps_after_fork): Always call fixup_mmap_after_fork method
	with the MAP_FIXED flag set.

2005-12-01  Christopher Faylor  <cgf@timesys.com>

	* devices.h (_minor): Coerce argument to proper type before
	manipulating.
	(_major): Ditto.
	(device::is_fs_special): New function.
	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Set the size to
	0 for devices rather than reporting the size of the symlink.
	(fhandler_disk_file::readdir): Use is_fs_special to determine if .lnk
	should be stripped.
	* path.cc: Rename symlink_info::is_symlink to symlink_info::issymlink
	throughout.
	(symlink_info::isdevice): New field.
	(path_conv::check): Use 'isdevice' to determine if just-parsed entity
	is a device rather than relying on non-zero major/minor.
	(symlink_info::parse_device): Set isdevice to true if we've discovered
	a device.
	(symlink_info::check): Clear isdevice field prior to processing.  Use
	isdevice to control debugging output.
	(symlink_info::set): Set isdevice to false.
	* path.h (path_conv::is_fs_special): New function.
	* devices.cc: Regenerate.

2005-11-30  Christopher Faylor  <cgf@timesys.com>

	* times.cc (hires_ms::prime): Remove debugging stuff.
	(hires_ms::usecs): Ditto.

2005-11-30  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (list::try_map): New method, implementing trying to map
	within another already existing map, moved from mmap64 here.
	(mmap64): Just call try_map now.
	(fhandler_dev_zero::fixup_mmap_after_fork): Always create new private
	map with PAGE_READWRITE protection.
	(fixup_mmaps_after_fork): Fix comment.

2005-11-29  Corinna Vinschen  <corinna@vinschen.de>

	* include/cygwin/version.h: Bump API minor version.

2005-11-29  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_dev_zero::mmap): Add method.
	(fhandler_dev_zero::munmap): Ditto.
	(fhandler_dev_zero::msync): Ditto.
	(fhandler_dev_zero::fixup_mmap_after_fork): Ditto.
	* mmap.cc: Implement anonymous mapping using fhandler_dev_zero class.
	Implement private anonymous maps using VirtualAlloc/VirtualFree.  Fix
	or add some more comments.
	(fh_paging_file): Change to type fhandler_dev_zero.
	(priv): New static inline function to avoid having lots of flag bit
	tests in the code.  Use throughout were appropriate.
	(fixed): Ditto.
	(anonymous): Ditto.
	(noreserve): Ditto.
	(autogrow): Ditto.
	(gen_protect): Never generate PAGE_WRITECOPY protection for
	private anonymous maps.
	(gen_access): Drop FILE_MAP_EXECUTE handling since it's not supported
	correctly on 9x.
	(VirtualProt9x): Move comment from mmap64 here.
	(mmap_record::mmap_record): Gegerate correct device entry for
	anonymous maps, though unused right now.
	(mmap_record::priv): Call global priv function.
	(mmap_record::fixed): Call global fixed function.
	(mmap_record::anonymous): Call global anonymous function.
	(mmap_record::noreserve): Call global noreserve function.
	(mmap_record::autogrow): Call global autogrow function.
	(list::anonymous): New method.  Use throughout were appropriate.
	(mmap_record::compatible_flags): Drop now useless ifdef.
	(mmap_record::alloc_page_map): Accommodate private anonymous maps.
	(mmap_record::map_pages): Accommodate MAP_NORESERVE mappings.
	(mmap_record::unmap_pages): Accommodate private anonymous maps.
	(mmap64): Simplify argument check.  Don't remove the MAP_PRIVATE flag
	for anonymous mappings on 9x anymore since that's now handled
	gracefully.
	(mprotect): Accommodate MAP_NORESERVE mappings.  Fix case when
	non-mmap areas are just MEM_RESERVEd.
	(fhandler_dev_zero::mmap): Implement anonymous mapping here.
	(fhandler_dev_zero::munmap): Ditto.
	(fhandler_dev_zero::msyn): Ditto.
	(fhandler_dev_zero::fixup_mmap_after_fork): Ditto.
	(fixup_mmaps_after_fork): Accommodate private anonymous maps.  Enhance
	debug output in case VirtualProtect fails.
	* include/sys/mman.h: Really define MAP_NORESERVE now.

2005-11-28  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc (NtCreateSection): Define.
	* cygheap.cc (_csbrk): Call getpagesize instead of getshmlba.
	* dcrt0.cc (dll_crt0_0): Call mmap_init.
	* external.cc (cygwin_internal): Call getpagesize instead of getshmlba.
	* fhandler.h (fhandler_base::mmap): Change access to prot parameter.
	(fhandler_base::fixup_mmap_after_fork): Ditto.
	(fhandler_disk_file::mmap): Ditto.
	(fhandler_disk_file::fixup_mmap_after_fork): Ditto.
	(fhandler_dev_mem::mmap): Ditto.
	(fhandler_dev_mem::fixup_mmap_after_fork): Ditto.
	* fhandler_mem.cc (fhandler_dev_mem::write): Call getsystempagesize
	instead of getpagesize.
	(fhandler_dev_mem::read): Ditto.
	(fhandler_dev_mem::fstat): Ditto.
	(fhandler_dev_mem::mmap): Move to mmap.cc.
	(fhandler_dev_mem::munmap): Ditto.
	(fhandler_dev_mem::msync): Ditto.
	(fhandler_dev_mem::fixup_mmap_after_fork): Ditto.
	* fhandler_proc.cc (format_proc_meminfo): Call getsystempagesize
	instead of getpagesize.
	* fhandler_process.cc (format_process_stat): Ditto.
	(format_process_status): Ditto.
	(get_mem_values): Ditto.
	* mmap.cc: Fix formatting.  Try to make more readable and modular.
	Take advantage of pagesize==granularity.
	(gen_protect): New static function to evaluate Windows
	protection bits from POSIX protection and flags.
	(gen_access): Ditto for Windows access mode.
	(VirtualProt9x): Wrapper function to call VirtualProtect on 9x.
	(VirtualProtNT): Ditto for NT.
	(VirtualProtEx9x): Ditto for VirtualProtectEx on 9x.
	(VirtualProtExNT): Ditto for NT.
	(CreateMapping9x): Wrapper function for creating a mapping handle on 9x.
	(CreateMappingNT): Ditto for NT.
	(MapView9x): Wrapper function to map a view on 9x.
	(MapViewNT): Ditto for NT.
	(mmap_funcs_9x): Structure containing function pointers to wrapper
	functions for 9x.
	(mmap_funcs_nt): Ditto for NT.
	(mmap_func): Pointer to wrapper functions used in subsequent code.
	(mmap_init): Initialize mmap_func depending on OS.
	(class mmap_record): Use sensible member names.  Add POSIX protection
	member. Drop Windows access flags member.  Constify more methods.
	Use accessors instead of direct member access inside of own methods.
	(mmap_record::gen_protect): Class wrapper to evaluate matching
	Windows protection bits.
	(mmap_record::gen_access): Ditto for Windows access flags.
	(mmap_record::compatible_flags): New function to check if flags are
	compatible with flags of existing map.
	(list::add_record): Drop offset and length arguments.
	(class map): Change counters to unsigned.  Match usage throughout.
	(mmapped_areas): Convert from pointer to global struct.
	(mmap_record::alloc_page_map): Simplify.
	(mmap_record::map_pages): Ditto.
	(mmap_record::fixup_page_map): Delete.
	(mmap64): Simplify.  Add workaround for Windows 98 bug.  Fix bug on
	NT that existing anonymous mappings weren't searched for a match.
	(munmap): Add workaround for Windows 98 bug.
	(msync): Simplify.
	(mprotect): Handle existing maps correctly.
	(mlock): Add local pagesize variable and enlightening comment.
	(fhandler_disk_file::mmap): Main functionality now in CreateMapping/
	MapView wrapper functions.
	(fhandler_disk_file::fixup_mmap_after_fork): Call MapView wrapper.
	(fhandler_dev_mem::mmap): Moved from fhandler_mem.cc.  Simplify by
	calling MapViewNT.
	(fhandler_dev_mem::munmap): Moved from fhandler_mem.cc.
	(fhandler_dev_mem::msync): Ditto.
	(fhandler_dev_mem::fixup_mmap_after_fork): Ditto.  Call MapViewNT.
	(fixup_mmaps_after_fork): Restructure and hopefully speed up loop for
	setting protection and memory content on MAP_PRIVATE maps.
	* ntdll.h (AT_ROUND_TO_PAGE): Remove define.
	(AT_EXTENDABLE_FILE): Add define.
	(NtCreateSection): Add prototype.
	* syscalls.cc (getpagesize): Return granularity as pagesize now.
	(getsystempagesize): New function to retrieve "real" pagesize.
	(getshmlba): Delete since it's replaced by getpagesize now.
	* wincap.h (wincaps::has_mmap_alignment_bug): New element.
	* wincap.cc: Implement above element throughout.
	* winsup.h (getshmlba): Drop prototype.
	(getsystempagesize): Add prototype.
	(mmap_init): Ditto.
	* include/sys/mman.h: (Not yet) define MAP_NORESERVE.

2005-11-28  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't rely on
	has_acl() state for evaluating inodes.  Temporarily(?) enable "real"
	inodes for remote drives.

2005-11-25  Christopher Faylor  <cgf@timesys.com>

	* heap.cc: Remove spurious getpagesize declaration.

2005-11-25  Christian Franke  <Christian.Franke@t-online.de>

	* exceptions.cc (ctrl_c_handler): Distinguish CTRL-BREAK from CTRL-C in
	some cases.

2005-11-23  Christopher Faylor  <cgf@timesys.com>

	* fhandler_tty.cc (fhandler_tty_slave::open): Reset the current windows
	station whenever ctty == -1 regardles of whether there's a windows
	station already assigned.  Close the old windows station in this
	situation.
	* pinfo.cc (_pinfo::set_ctty): Reinstate incrementing of console count
	when recording ctty so that the current tty is always around.
	* autoload.cc (CloseWindowStation): Define.

2005-11-18  Christopher Faylor  <cgf@timesys.com>

	* strptime.cc (_strptime): Fix gcc warnings.

2005-11-18  Christopher Faylor  <cgf@timesys.com>

	* memmem.cc: Move from here.
	* lib/memmem.cc: Move to here.

2005-11-18  Corinna Vinschen  <corinna@vinschen.de>

	* libc: Add subdirectory.
	* Makefile.in (VPATH): Add libc subdir.
	(DLL_OFILES): Add strptime.o and timelocal.o.
	* cygwin.din: Export timelocal and timegm.
	* localtime.cc: Define STD_INSPIRED unconditionally.
	* include/cygwin/time.h (timelocal): Add declaration.
	(timegm): Ditto.
	* include/cygwin/version.h: Bump API minor version.
	* libc/strptime.cc: New file.
	* libc/timelocal.cc: New file.
	* libc/timelocal.h: New file.

2005-11-18  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/sys_time.h: Move futimes and lutimes declaration here
	from newlib.

2005-11-18  Christopher Faylor  <cgf@timesys.com>

	* times.cc (timezone): Put back (void).
	* include/cygwin/time.h: Add more cygwin stuff from newlib.

2005-11-18  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/sys_time.h: Rename from include/cygwin/time.h.
	* include/cygwin/time.h: New file.

2005-11-17  Christopher Faylor  <cgf@timesys.com>

	* fork.cc (fork): Move top-of-stack calculation later.

	* pinfo.cc (_pinfo::set_ctty): Use __ctty to print current console in
	debugging output.

2005-11-17  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_tty.cc (fhandler_tty_slave::open):  Don't expect that
	service applications have no window station attached.

2005-11-16  Christopher Faylor  <cgf@timesys.com>

	* times.cc (hires_ms::prime): Don't escalate the priority.

2005-11-14  Christopher Faylor  <cgf@timesys.com>

	* include/sys/elf64.h: Fix types to reflect linux usage.

2005-11-14  Corinna Vinschen  <corinna@vinschen.de>
	    Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (fhandler_console::fixup_after_fork_exec): Define with
	additional bool parameter.
	(fhandler_console::fixup_after_exec): Accommodate
	fixup_after_fork_exec's parameter.
	(fhandler_console::fixup_after_fork): Ditto.
	* fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Avoid
	opening new console only when close_on_exec AND execing.

2005-11-14  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (fhandler_console::fixup_after_fork_exec): Declare new function.
	(fhandler_console::fixup_after_fork): Use fixup_after_fork_exec.
	(fhandler_console::fixup_after_exec): Ditto.
	* fhandler_console.cc (fhandler_console::fixup_after_fork): Delete definition.
	(fhandler_console::fixup_after_fork_exec): Rename from fixup_after_exec.
	* pinfo.cc (_pinfo::set_ctty): Don't play with console count here.
	* syscalls.cc (close_all_files): Don't close cygheap ctty if hExeced
	since the child will be copying information from us.
	(setsid): Use myctty() rather than raw ctty #.

2005-11-13  Christopher Faylor  <cgf@timesys.com>

	* cygheap.h (init_cygheap::manage_console_count): Declare new function.
	(init_cygheap::console_count): Renamed from open_fhs.  Make private.
	* cygheap.cc (init_cygheap::manage_console_count): Define new function.
	* dtable.cc (dtable::fixup_after_exec): Always call fixup_after_exec on
	elements of fd even when they are about to be closed.
	* fhandler.h (report_tty_counts): Remove open_fhs from debugging
	output.
	* fhandler_console.cc (fhandler_console::open): Use
	manage_console_count rather than manipulating count directly.
	(fhandler_console::close): Ditto.
	(fhandler_console::fixup_after_fork): Ditto.
	(fhandler_console::fixup_after_exec): Ditto.  Don't close handles if
	close_on_exec.
	* fhandler_tty.cc (fhandler_tty_slave::open): Use
	manage_console_count() rather than manipulating count directly.
	Reflect change in arguments to report_tty_counts().
	(fhandler_tty_slave::close): Ditto for both.
	(fhandler_tty_slave::dup): Ditto for both.
	(fhandler_tty_slave::ioctl): Use myctty() rather than raw ctty #.
	(fhandler_tty_slave::fixup_after_fork): Reflect change in arguments to
	report_tty_counts().
	(fhandler_tty_master::init_console): Use manage_console_count() rather
	than manipulating count directly.
	* fhandler_clipboard.cc (fhandler_dev_clipboard::fixup_after_exec):
	Don't perform any operations if close_on_exec.
	* fhandler_dsp.cc (fhandler_dev_dsp::fixup_after_exec): Ditto.
	* fhandler_raw.cc (fhandler_dev_raw::fixup_after_exec): Ditto.
	* fhandler_serial.cc (fhandler_serial::fixup_after_exec): Ditto.
	* pinfo.h (_pinfo::_ctty): Declare new function.
	(myctty): Declare new macro.
	(__ctty): Declare new macro.
	* pinfo.cc (_pinfo::_ctty): Define new function.
	(_pinfo::set_ctty): Use manage_console_count() rather than manipulating
	count directly.
	* signal.cc (kill_pgrp): Use myctty() and __ctty() macros rather than
	raw ctty #.
	* syscalls.cc (setsid): Ditto.  Use manage_console_count() rather than
	manipulating count directly.

2005-11-13  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::recvfrom): Just return 0 (EOF)
	in case of WSAESHUTDOWN.
	(fhandler_socket::recvmsg): Ditto.
	* poll.cc (poll): Set revents to POLLIN instead of POLLHUP. Add comment.

2005-11-11  Christopher Faylor  <cgf@timesys.com>

	* cygheap.h (init_cygheap::_gtod): Remove.
	* cygwin.din: Export clock_getres and clock_setres.
	* hires.h (hires_ms::minperiod): Delete declaration.
	(hires_ms::began_period): Ditto.
	(hires_ms::prime): Make void.
	(hires_ms::resolution): Just define here.
	(hires_ms::usecs): Remove unneeded argument.
	(gtod): Redeclare as a variable.
	* timer.cc (timer_thread): Eliminate argument to gtod.usecs().
	(timer_tracker::gettime): Ditto.
	(timer_tracker::settime): Ditto.
	* times.cc (gettimeofday): Ditto.
	(hires_ms::began_period): Delete declaration.
	(hires_us::prime): Remove debugging.
	(hires_ms::prime): Make void.  Eliminate period stuff.
	(hires_ms::usecs): Eliminate argument to gtod.usecs().
	(hires_ms::resolution): New function.
	(clock_getres): Ditto.
	(clock_setres): Ditto.
	* version.h: Bump API version to 143.
	* include/cygwin/time.h: New file.

2005-11-10  Christopher Faylor  <cgf@timesys.com>

	* times.cc (hires_ms::prime): Comment out call to timeBeginPeriod for
	now.
	(hires_ms::usecs): Call prime if haven't called began_period().

	* param.h: Don't define stuff that is already defined in endian.h.

2005-11-10  Christopher Faylor  <cgf@timesys.com>

	* include/endian.h: Remove USE_BSD ifdef since it is never defined on
	Cygwin.

2005-11-10  Corinna Vinschen  <corinna@vinschen.de>

	* syslog.cc (setlogmask): Don't mask the mask.
	(vsyslog): Fix priority check.

2005-11-10  Scott Finneran  <scottf@pacom.com>

	* include/cygwin/signal.h: Add missing sigrelse prototype.

2005-11-08  Christopher Faylor  <cgf@timesys.com>

	* fhandler_base.cc (fhandler_base::readv): Free buf, not a pointer into
	the middle of buf.

2005-11-08  Christopher Faylor  <cgf@timesys.com>

	* memmem.cc: New file.
	* include/cygwin/version.h: Bump API version number to 142.
	* cygwin.din: Export memmem.
	* Makefile.in: Build memmem.o.

2005-11-08  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (spenvs): Make "SYSTEMDRIVE" an "always export".

2005-11-07  Corinna Vinschen  <corinna@vinschen.de>

	* times.cc (futimes): Redirect to utimes_worker if given file
	descriptor is opened R/O.

2005-11-06  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (dll_crt0_0): Initialize security data first so that it can
	be used by subsequent handle creation.

2005-11-04  Christopher Faylor  <cgf@timesys.com>

	* cygheap.h (init_cygheap::_gtod): New hires_ms element.
	* hires.h (hires_ms::minperiod): Remove static designation.
	(hires::began_period): New field.
	* signal.cc: Include headers required for cygheap.h now that gtod lives
	in the cygheap.
	* timer.c: Ditto.
	* times.cc (gtod): Delete variable.
	(gtod::minperiod): Ditto.
	(gtod::began_period): Define.
	(hires_ms::prime): Add more debugging output.  Call timeBeginPeriod
	only when !began_period.

2005-11-04  Christopher Faylor  <cgf@timesys.com>

	* times.cc (hires_ms::prime): More debugging.
	(hires_ms::usecs): Ditto.

2005-11-03  Christopher Faylor  <cgf@timesys.com>

	* times.cc (stupid_printf): Define and use throughout -- temporarily.

2005-11-03  Christopher Faylor  <cgf@timesys.com>

	* times.cc (hires_ms::prime): Add lots of temporary debugging output.

2005-11-02  Christopher Faylor  <cgf@timesys.com>

	* times.cc (hires_ms::minperiod): Make copy-on-fork.
	(gettimeofday): Remove temporary debugging.
	(hires_us::prime): Add lots of temporary debugging output.

2005-11-02  Christopher Faylor  <cgf@timesys.com>

	* times.cc (gettimeofday): Add temporary debugging output.

2005-11-01  Christopher Faylor  <cgf@timesys.com>

	* include/sys/cygwin.h: Define CYGWIN_SIGNAL_STRING.
	* exceptins.cc (sigpacket::process): Send a _CYGWIN_SIGNAL_STRING to
	gdb if the process is being debugged.  A WIP.

2005-10-29  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc (signal_exit): Eliminate setting of main thread
	priority since process lock should make that unnecessary.
	* fork.cc (stack_base): Eliminate.
	(frok::parent): Subsume stack_base and just set stack stuff here.
	Report on priority class in debugging output.
	* spawn.cc (spawn_guts): Report on priority class in debugging output.

2005-10-29  Christopher Faylor  <cgf@timesys.com>

	* fork.cc (frok::child): Change order of cleanup prior to return.
	(fork): Save more of the stack.

	* gendef: Fix some comments.

	* sigproc.cc (wait_sig): Clarify debug output.

2005-10-29  Christopher Faylor  <cgf@timesys.com>

	* child_info.h (CHILD_INFO_MAGIC): Reset.

2005-10-24  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (_pinfo::fds): Lock fdtab while enumerating.

2005-10-24  Corinna Vinschen  <corinna@vinschen.de>

	* spawn.cc (spawn_guts): Don't leave the function with return inside
	pthread cleanup brackets.

2005-10-24  Christopher Faylor  <cgf@timesys.com>

	* cygheap.h (cygheap_fdenum): Remove start_fd stuff.
	(cygheap_fdenum::rewind): Ditto.
	* pipe.cc (fhandler_pipe::open): Lock fdtab while enumerating.
	* times.cc (utimes_worker): Ditto.

2005-10-23  Christopher Faylor  <cgf@timesys.com>

	* cygheap.h (cygheap_fdenum::cygheap_fdenum): Record locked state or
	suffer deadlocks.
	(class locked_process): Move to another header.
	* sync.h (lock_process): Define here.
	* cygtls.cc (_cygtls::fixup_after_fork): Reset spinning state as well
	as stacklock state.
	* dcrt0.cc (lock_process::locker): Define.
	(dtable::lock_cs): Delete.
	(dll_crt0_0): Initialize process lock here ASAP.
	* dtable.cc (dtable_init): Eliminate call to init_lock().
	(dtable::fixup_after_fork): Ditto.
	(dtable::init_lock): Delete definition.
	* dtable.h (dtable::init_lock): Delete declaration.
	(dtable::lock): Use process lock rather than dtable-specific lock.
	(dtable::unlock): Ditto.

	* sigproc.cc (sigproc_init): Minor change to debugging output.

	* times.cc (utime_worker): Use build_fh_pc rather than reinterpreting
	the posix path name again.  Return any error from path_conv immediately.

2005-10-22  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::connect): Don't restrict
	WSAEINVAL -> WSAEISCONN conversion to nonblocking sockets.
	(fhandler_socket::accept): Use event driven technique to implement
	interuptible accept.
	(fhandler_socket::wait): Allow FD_ACCEPT handling.
	* net.cc (cygwin_accept): Remove workaround for allowing blocking
	accept.  That's entirely in fhandler_socket::accept now.

2005-10-22  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_socket): Add timeout parameter to wait()
	method.
	* fhandler_socket.cc (fhandler_socket::connect): Use event driven
	technique (prepare/wait/release) to implement interuptible connect.
	(fhandler_socket::wait): Add timeout parameter.  Allow FD_CONNECT
	handling.
	* net.cc (cygwin_connect): Remove braindead workaround for allowing
	blocking connect.  That's entirely in fhandler_socket::connect now.

2005-10-22  Corinna Vinschen  <corinna@vinschen.de>

	* include/cygwin/version.h: Fix typo.

2005-10-21  Christopher Faylor  <cgf@timesys.com>

	* dir.cc (rmdir): Eliminate nonsensical code.

	* fork.cc (fork): Move exit debug_printf to last statement.

2005-10-20  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (futimes): Export.
	(lutimes): Export.
	* times.cc (utimes_worker): Created from utimes, add nofollow flag
	to implement utimes and lutimes.
	(utimes): Just call utimes_worker.
	(lutimes): New function.
	(futimes): Ditto.
	* include/cygwin/version.h: Bump API minor version.

2005-10-19  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (child_info::sync): Move check for !wr_proc_pipe lower.
	* spawn.cc (spawn_guts): Correct check for top-level process.

2005-10-19  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc: Revert loading rcmd, rexec, rresvport and inet_network
	from wsock32.dll since these symbols are not exported from ws2_32.dll.

2005-10-19  Christopher Faylor  <cgf@timesys.com>

	* times.cc (utimes): Only consider fds opened with write access.

2005-10-19  Christopher Faylor  <cgf@timesys.com>

	* fhandler_disk_file.cc (fhandler_base::utimes_fs): Use existing handle
	if fhandler has one.
	* times.cc (utimes): Scan open fds for matching paths and use existing
	fhandler if one exists.

2005-10-19  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (_pinfo::dup_proc_pipe): Make warning more severe by
	actually printing it.
	(_pinfo::alert_parent): Fix comment.  Don't send to parent if we are in
	an exec stub.

2005-10-18  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (handle_threadlist_exception): Improve diagnostic output.

	* sigproc.cc (child_info::sync): Only clear hProcess when execing.
	(wait_sig): Protect readsig handle.

2005-10-18  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc (NtLockVirtualMemory): Import.
	(NtUnlockVirtualMemory): Import.
	(GetProcessWorkingSetSize): Import.
	(SetProcessWorkingSetSize): Import.
	* cygwin.din (mlock): Export.
	(munlock): Export.
	* mmap.cc (mlock): New function.
	(munlock): Ditto.
	* ntdll.h (STATUS_WORKING_SET_QUOTA): Define.
	(LOCK_VM_IN_WSL): Define.
	(LOCK_VM_IN_RAM): Define.
	(NtLockVirtualMemory): Declare.
	(NtUnlockVirtualMemory): Declare.
	* sysconf.cc (sysconf): Implement _SC_MEMLOCK_RANGE.
	* wincap.h: Implement has_working_virtual_lock throughout.
	* wincap.cc: Ditto.
	* include/cygwin/version.h: Bump API minor version.
	* include/sys/mman.h (mlock): Declare,
	(munlock): Declare.

2005-10-18  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (child_info::sync): Use correct name when closing to
	prevent warnings when DEBUGGING.
	* spawn.cc (spawn_guts): Set myself.hProcess to pi.hProcess since this
	may have been zeroed by the previous sync.

2005-10-18  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (child_info::sync): Fix typo which caused hProcess to
	never be cleared.  Only clear hProcess when not forking.

2005-10-17  Christopher Faylor  <cgf@timesys.com>

	Change process_lock to lock_process throughout.
	Change all calls to new cygthread to handle extra argument, throughout.
	* cygthread.h (cygthread::callproc): Declare new method.
	(cygthread::cygthread): Add optional length argument to allow copying
	arguments to executing thread.
	* cygthread.cc (cygthread::callproc): Define new method.
	(cygthread::stub): Use callfunc to invoke thread func to allow
	potentially allocating stack memory which will be returned.
	(cygthread::simplestub): Ditto.
	(cygthread::cygthread): Accept arglen argument.  Reset ev here prior to
	activating thread.  Wait for ev after activating thread if we're
	copying contents to the thread.  Wait until the end before setting h,
	to allow thread synchronization.
	(cygthread::release): Don't reset ev here.  Rely on that happening the next
	time the thread is activated.
	* pinfo.h (commune_process): Rename declaration from _pinfo::commune_process.
	* pinfo.cc (commune_process): Ditto for definition.  Modify slightly to allow
	running as a separate cygthread.
	* sigproc.cc (child_info::sync): Always wait for both subproc_ready and
	any hProcess if we have a cygwin parent.
	(talktome): Change argument to be a pointer to siginfo_t.  Contiguously
	allocate whole siginfo_t structure + any needed extra for eventual passing
	to commune_process thread.
	(wait_sig): Accommodate change in talktome argument.

	* pipe.cc (fhandler_pipe::fixup_after_exec): Remove debugging.

2005-10-17  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc: Never load wsock32.dll. Load all wsock32 function
	from ws2_32.  Rearrange symbol order accordingly.  None of the ws2_32
	functions is optional right now.
	(wsadata): Move from net.cc here.  Define NO_COPY.
	(wsock_init): Drop unused symbols ws2_32_handle and wsock32_handle.
	(load_wsock32): Remove.
	(WSACleanup): Remove.
	* fhandler_socket.cc: Drop Winsock 1 accommodations throughout.
	(fhandler_socket::readv): Accommodate new POSIX style struct msghdr.
	(fhandler_socket::writev): Ditto.
	(fhandler_socket::recvmsg): Ditto. Handle "old" applications using
	former struct msghdr correctly.
	* net.cc: Drop Winsock 1 accommodations throughout.
	(wsadata): Move definition to autoload.cc.
	(set_socket_inheritance): Remove.
	(convert_ws1_ip_optname): New static function to convert Winsock1
	IPPROTO_IP option values into Winsock2 IPPROTO_IP option values.
	(cygwin_setsockopt): Remove wrong and incomplete cleartext printing
	of optname.  For "old" applications, convert optname from Winsock1
	to Winsock2 values before using them.  Add comment to describe the
	IP_TOS weirdness on W2K and above.
	(cygwin_getsockopt): Remove wrong and incomplete cleartext printing
	of optname.  For "old" applications, convert optname from Winsock1
	to Winsock2 values before using them.
	* select.cc (start_thread_socket): Forget about winsock2_active.
	* winsup.h (wsock32_handle): Remove declaration.
	(ws2_32_handle): Ditto.
	(netapi32_handle): Ditto.
	(wsadata): Ditto.
	(winsock2_active): Remove definition.
	* include/cygwin/socket.h: Change formatting slightly.
	(socklen_t): Move definition up in file.
	(struct msghdr): Convert to POSIX style.
	(struct cmsghdr): New type.
	(CMSG_ALIGN): New macro.
	(CMSG_LEN): Ditto.
	(CMSG_SPACE): Ditto.
	(CMSG_FIRSTHDR): Ditto.
	(CMSG_NXTHDR): Ditto.
	(CMSG_DATA): Ditto.
	(SCM_RIGHTS): Ditto.
	(struct OLD_msghdr): Define old msghdr structure for Cygwin internal
	purposes.
	(MSG_TRUNC): New macro.
	(MSG_CTRUNC): Ditto.
	(IP_OPTIONS): Redefine IPPROTO_IP option values to Winsock2 values.
	Keep Winsock1 values for Cygwin internal purposes.
	* include/cygwin/version.h: Bump API minor version.
	(CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR): Define to check for
	applications using old struct msghdr.
	(CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES): Define to check for
	applications using old Winsock1 IPPROTO_IP values.

2005-10-13  David Rothenberger <daveroth@acm.org>
	   Christopher Faylor  <cgf@timesys.com>

	* Makefile.in (MKDIRP): Just use raw $(INSTALL) rather than
	$(INSTALL_DATA).  Create directories with 755 permissions.

2005-10-12  Christopher Faylor  <cgf@timesys.com>

	* dir.cc (mkdir): Abandon use of PC_WRITABLE.
	(rmdir): Ditto.
	* path.h (PC_WRITABLE): Delete.
	* path.cc (path_conv::check): Remove PC_WRITABLE accommodations.
	Revisit later.

2005-10-12  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::rmdir): Convert an
	ERROR_INVALID_FUNCTION into an ERROR_FILE_NOT_FOUND.  Add comment
	to explain why.

2005-10-11  Christopher Faylor  <cgf@timesys.com>

	* Makefile.in: Make sure that directories are created prior to copying
	to them.

2005-10-11  Christopher Faylor  <cgf@timesys.com>

	* net.cc (cygwin_gethostbyname): Remove debugging.

2005-10-11  Corinna Vinschen  <corinna@vinschen.de>

	* syslog.cc (try_connect_syslogd): Add priority parameter. Use writev
	to add the priority to the message in a syslog conformant way.
	(vsyslog): If facility isn't set in the priority, use default facility
	as given in call to openlog. Fix agressive use of spaces in syslog
	output. Call try_connect_syslogd with priority parameter.

2005-10-11  Christopher Faylor  <cgf@timesys.com>

	* (symlink_info::set_error): Change to return bool if input error
	should be ignored.
	(symlink_info::check): Treat path as a normal file if set_error returns
	false.

2005-10-03  Christopher Faylor  <cgf@timesys.com>

	* cygheap.h (class process_lock): New class.
	* dtable.h (class dtable): Add class process_lock as a friend.
	* dcrt0.cc (get_exit_lock): Delete.
	(do_exit): Use process_lock class instead of get_exit_lock.
	* exceptions.cc (signal_exit): Ditto.
	* pinfo.cc (pinfo::exit): Ditto.
	(_pinfo::commune_process): Set process lock around this whole function.
	(_pinfo::commune_request): Use process_lock rather than myself.lock.
	* pinfo.h (pinfo::_lock): Delete.
	(pinfo::initialize_lock): Delete.
	(pinfo::lock): Delete.
	(pinfo::unlock): Delete.
	* winsup.h (get_exit_lock): Delete declaration.

2005-10-03  Corinna Vinschen  <corinna@vinschen.de>

	* uname.cc (uname): Disable use of GetNativeSystemInfo.

2005-10-01  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (get_exit_lock): Use myself.lock rather than exit_lock.
	* exceptions.cc (exit_lock): Delete.
	(events_init): Don't init exit_lock.
	* (_pinfo::commune_process): Add per-PICOM debugging.
	* sigproc.cc (talktome): Add some temporary debugging statements.

	* fhandler_proc.cc (format_proc_cpuinfo): Cosmetic change.
	(format_proc_partitions): Ditto.
	* syscalls.cc (locked_append): Ditto.

2005-09-30  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (do_exit): Don't set ES_SET_MUTO here.  Call get_exit_lock()
	instead.
	(get_exit_lock): New function.  Grabs the lock and sets initial
	exit_state.
	* exceptions.cc (try_to_debug): Use low_priority_sleep.
	(sigpacket::process): Avoid handler if this is an exec stub.
	(signal_exit): Use get_exit_lock rather than manipulating the exit_lock
	critical section directly.
	* pinfo.cc (pinfo::exit): Ditto.
	* winsup.h (get_exit_lock): Declare.
	(exit_lock): Delete declaration.

2005-09-30  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc: Change calls to pc.set_attributes into
	calls to pc.file_attributes throughout.
	* path.h (class path_conv): Remove superfluous set_attributes method.

2005-09-30  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Use
	fhandler method to access major device number.  Add comment to
	explain floppy weirdness.

2005-09-30  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Also use
	attributes stored in this->pc if call to GetFileInformationByHandle
	failed.

2005-09-30  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Only write
	attributes if call to GetFileInformationByHandle was successful.

2005-09-29  Christopher Faylor  <cgf@timesys.com>

	* fork.cc (frok::parent): Simplify error messages.  Don't issue an
	error when child.remember fails.
	(fork): When appropriate, build up an error message from grouped.error.

2005-09-29  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Don't call
	EX ioctls on floppy drives.

2005-09-29  Corinna Vinschen  <corinna@vinschen.de>

	* dir.cc (mkdir): Check for trailing /. or /.. component.
	(rmdir): Ditto.
	* path.cc (has_dot_last_component): New function.
	* path.h (has_dot_last_component): Add declaration.

2005-09-29  Corinna Vinschen  <corinna@vinschen.de>

	* crt0.cc: Remove PPC considerations.
	(WinMainCRTStartup): Add symbol as alias to mainCRTStartup.

2005-09-28  Christopher Faylor  <cgf@timesys.com>

	Change name from commune_recv to commune_process throughout.
	Change name from commune_send to commune_request throughout.
	* pinfo.h (PICOM_EXTRASTR): New flag.
	(PICOM_FIFO): Define with new flag.
	(_pinfo::hello_pid): Delete.
	(_pinfo::tothem): Delete.
	(_pinfo::fromthem): Delete.
	(_pinfo::commune_process): Rename from commune_recv.  Add a siginfo_t
	argument to declaration.
	(_pinfo::commune_request): Rename from commune_send.  Change DWORD to
	__uint32_t in declaration.
	* pinfo.cc (_pinfo::commune_process): Rename from commune_recv.  Add
	siginfo_t argument.  Use information from argument rather than reading
	from another pipe.  Synchronize with other process's commune event.
	(_pinfo::commune_request): Rename from commune_send.  Change DWORD to
	__uint32 in argument.  Fill out information in new siginfo_t element
	and rely on extended operation of sig_send rather than trying to deal
	with synchronization issues here.  Use process handle and read pipe
	information filled out by sig_send to gather information from the other
	process.
	* sigproc.cc (sig_send): Take special action if "communing" to ensure
	synchronization with the other process and to return information about
	the other process to the caller.
	(talktome): Accept a siginfo_t and handle arguments.  Read additional
	information from the signal pipe when _si_commune._si_code has the
	PICOM_EXTRASTR flag set.
	(wait_sig): Pass the transmitted siginfo_t struct and the pipe handle
	to talktome.  Close pipe read handle as soon as possible after we
	detect that we're exiting.

2005-09-28  Christopher Faylor  <cgf@timesys.com>

	* hookapi.cc (hook_or_detect_cygwin): Correct inverted test for whether
	to allocate a buffer by always allocating a buffer.

2005-09-28  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_dev_raw): Delete current_position and
	eof_detected status flag.  Delete is_eom and is_eof methods.
	Move drive_size, bytes_per_sector, eom_detected status flag, as well
	as the methods read_file, write_file, raw_read and raw_write to ...
	(class fhandler_dev_floppy): ... here. Remove is_eom and is_eof
	methods.  Add dup method.
	* fhandler_floppy.cc (IS_EOM): New macro.
	(fhandler_dev_floppy::is_eom): Remove.
	(fhandler_dev_floppy::is_eof): Remove.
	(fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags.
	(fhandler_dev_floppy::get_drive_info): Only call EX functions on
	systems supporting them and stop suffering strange delays.
	(fhandler_dev_floppy::read_file): Move here, drop setting
	current_position.
	(fhandler_dev_floppy::write_file): Move here, drop setting
	current_position.
	(fhandler_dev_floppy::open): Rearrange comment.
	(fhandler_dev_floppy::dup): New method.
	(fhandler_dev_floppy::get_current_position): New inline method.  Use
	instead of former current_position were appropriate.
	(fhandler_dev_floppy::raw_read): Move here.  Drop EOF handling.
	(fhandler_dev_floppy::raw_write): Move here.  Drop EOF handling.
	(fhandler_dev_floppy::lseek): Remove useless conditions.  Convert
	sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call.
	(fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case
	to here.
	* fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove.
	(fhandler_dev_raw::is_eof): Remove.
	(fhandler_dev_raw::write_file): Remove.
	(fhandler_dev_raw::read_file): Remove.
	(fhandler_dev_raw::raw_read): Remove.
	(fhandler_dev_raw::raw_write): Remove.
	(fhandler_dev_raw::dup): Drop copying removed members.
	(fhandler_dev_raw::ioctl): Drop blocksize testing.
	* wincap.h: Implement has_disk_ex_ioctls throughout.
	* wincap.cc: Ditto.
	(wincap_vista): Preliminary wincaps for Windows Vista/Longhorn.
	(wincapc::init): Add Vista/Longhorn handling.

2005-09-28  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (getstack): New function.
	(alloc_stack): Use tls stuff for stack info rather than calling
	VirtualQuery.
	(dll_crt0_0): Initialize _impure_ptr stuff much earlier.  Move
	init_console_handler here.
	* fork.cc (class frok): New class renamed from local fork() struct.
	(stack_base): Change argument type.  Use tls stuff to determine stack
	info rather than calling VirtualQuery.
	(frok::child): Rename from fork_child.  Eliminate now unneeded
	arguments.
	(frok::parent): Rename from fork_parent and ditto.  Set error and errno
	as appropriate.  Fixup impersonation in cleanup, if needed.  Try harder
	to set errno appropriately.
	(fork): Define "grouped" as a frok type.  Deal with errors from
	fork_parent here.
	* init.cc (dll_entry): Remove init_console_handler call.

2005-09-28  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (_pinfo::dup_proc_pipe): Ignore error if the child process
	has just gone away.

2005-09-27  Christopher Faylor  <cgf@timesys.com>

	* init.cc (prime_threads): Make this static, as it should be.
	(dll_entry): Apply cosmetic changes to define closer to the way MSDN
	suggests.

2005-09-27  Corinna Vinschen  <corinna@vinschen.de>

	* pthread.cc (mangle_sem_name): Use cygheap->shared_prefix instead
	of fiddling with wincap.has_terminal_services manually.

2005-09-27  Corinna Vinschen  <corinna@vinschen.de>

	* cygheap.cc (cygheap_init): Add GLOBAL_PRIV to hProcToken explicitely
	since hProcImpToken isn't initialized here.
	* shared.cc (open_shared): Always print mapname instead of name in
	debug output.

2005-09-27  Christopher Faylor  <cgf@timesys.com>

	* strace.cc (strace::vsprntf): Avoid printing a zero pid.

2005-09-27  Corinna Vinschen  <corinna@vinschen.de>

	* init.cc (dll_entry): Call IsWow64Process with GetCurrentProcess
	as process handle since hMainProc isn't initialized here.

2005-09-27  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Always
	try IOCTL_DISK_GET_DRIVE_GEOMETRY_EX and
	IOCTL_DISK_GET_PARTITION_INFO_EX ioctls first, to allow access to GPT
	partitioned disks.  Fall back to old non-EX ioctls otherwise.
	Add comment to explain NT4 weirdness.

2005-09-26  Corinna Vinschen  <corinna@vinschen.de>

	* errno.cc (errmap): Map ERROR_SEEK and ERROR_SECTOR_NOT_FOUND.

2005-09-26  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc (_cygtls::call_signal_handler): Minor cleanup.

2005-09-26  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_dev_raw): Add drive information members
	drive_size, current_position and bytes_per_sector.
	(fhandler_dev_floppy::get_drive_info): Declare.
	* fhandler_floppy.cc (fhandler_dev_floppy::is_eom): Define ERROR_SEEK
	and ERROR_SECTOR_NOT_FOUND as end-of-medium conditions.
	(fhandler_dev_floppy::get_drive_info): New method to have one function
	retrieving drive info.
	(fhandler_dev_floppy::open): Call get_drive_info to get drive
	information right from the start.
	(fhandler_dev_floppy::lseek): Use and set drive information members.
	Especially keep track of current_position.
	(fhandler_dev_floppy::ioctl): Ditto.
	* fhandler_raw.cc (fhandler_dev_raw::write_file): Keep track of
	current_position.
	(fhandler_dev_raw::read_file): Ditto.
	(fhandler_dev_raw::raw_read): Never try to read beyond end-of-medium.
	(fhandler_dev_raw::dup): Handle new drive information members.

2005-09-26  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc (handle_exceptions): Just set si_code to SI_KERNEL
	first and let it be overridden.

2005-09-26  Yitzchak Scott-Thoennes  <sthoenna@efn.org>

	* exceptions.cc (_cygtls::call_signal_handler): Call signal handler
	with extra siginfo_t * and void * parameters when SA_SIGINFO flag is
	set.
	* signal.cc (signal): Clear SA_SIGINFO flag.
	(sigqueue): Fix incorrect setting of si_code.
	* sigproc.cc (signal_fixup_after_exec): Clear SA_SIGINFO flag when
	setting handler to SIG_DFL.

2005-09-26  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (proc_waiter): Properly fill out si_code as according to SUSv3.

2005-09-26  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc (handle_exceptions): Properly fill out si_code as
	according to SUSv3.

2005-09-25  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (wait_sig): Cosmetic change.
	* pinfo.cc (pinfo::exit): Don't explicitly remove myself since some
	other thread may still be using it.

2005-09-24  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (sigproc_terminate): More reversion of
	always-exit-from-sigthread change.

2005-09-23  Christopher Faylor  <cgf@timesys.com>

	* shared.cc (open_shared): Add crucial bit of debugging info.

2005-09-23  Christopher Faylor  <cgf@timesys.com>

	Semi-reversion of always-exit-from-sigthread change of 2005-09-15.
	* exceptions.cc (sigpacket::process): Eliminate return after call to
	reinstated noreturn function.
	(signal_exit): Allow function to exit when a captive process has been
	terminated.
	* pinfo.cc (pinfo::exit): Enter exit_lock here.  Once again exit here
	under control of exit_lock.
	* sigproc.cc (sig_send): Don't wait for completion if process is exiting.
	Remove special __SIGEXIT accommodations.
	(wait_sig): Just exit the thread when a __SIGEXIT has been detected.
	Don't exit the process.

2005-09-23  Christopher Faylor  <cgf@timesys.com>

	* net.cc (cygwin_gethostbyname): Remove debugging cruft.

2005-09-23  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::exit): Call ExitProcess if called from signal
	thread.

2005-09-23  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::exit): Eliminate use of _my_tls.thread_handle.
	* tlsoffsets.h: Regenerate.

2005-09-23  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (struct _cygtls::thread_handle): Remove/revert.
	* sigproc.h (struct sipacket::thread_handle): Put thread_handle here.
	* sigproc.cc (sigproc_terminate): Move setting of thread_handle...
	(sig_send): ...to here.  Put it in packet being sent.  Only close
	pack.wakeup when we're waiting for completion.
	(wait_sig): Use thread_handle directly from received packet.

2005-09-22  Christopher Faylor  <cgf@timesys.com>

	* cygheap.cc (cygheap_fixup_in_child): It's not just for exec.
	* cygtls.h (struct _cygtls::thread_handle): New field.
	* dcrt0.cc (exit_lock): Remove declaration.
	* winsup.h (exit_lock): Add declaration.
	* exceptions.cc (sigpacket::process): Properly return after
	signal_exit.
	* pinfo.cc (pinfo::exit): Only exit the process if
	_my_tls.thread_handle has not been filled out -- which should be an
	impossible event.
	* sigproc.cc (sigproc_terminate): Fillout _my_tls.thread_handle to
	provide something for wait_sig to wait for.  Use the siginfo_t version
	of sig_send and fill out the tls argument with _my_tls.
	(wait_sig): Wait for the thread specified in pack.tls or (for now)
	complain bitterly if it doesn't exit.
	* tlsoffsets.h: Regenerate.

2005-09-22  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (set_myself): Call strace.hello unconditionally when
	DEBUGGING.
	(pinfo::init): Sleep and issue debugging output before looping when a
	PID_EXITED is found.

2005-09-22  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix copy/paste
	bug.

2005-09-22  Christopher Faylor  <cgf@timesys.com>

	* strace.cc (strace::vsprntf): Avoid accessing myself->pid if !myself.

2005-09-22  Christopher Faylor  <cgf@timesys.com>

	* include/sys/strace.h (_STRACE_ON): Remove semicolon from definition.
	(_STRACE_OFF): Remove semicolon from definition.

2005-09-22  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_base::fstat_helper): Declare with additional
	file attributes argument.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Use
	file attributes evaluated from NtQueryFileInformation or
	FileInformationByHandle in call to fstat_helper.
	Set pc.fileattr from just evaluated file attributes here.
	(fhandler_base::fstat_by_name): Use file attributes evaluated from
	FindFileFirst or default attribute in call to fstat_helper.
	Set pc.fileattr from just evaluated file attributes here.
	(fhandler_base::fstat_helper): Use file attributes given as argument,
	not file attributes stored in this fhandler, since this information
	is potentially wrong.  Add comment to explain this.
	* path.h (has_attribute): New global inline function.
	(path_conv::set_attributes): New method to change fileattr.

2005-09-21  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::operator new): Just use getenv() to look for
	CYGWIN_FREERANGE_NOCHECK since the Windows environment may be truncated
	by being previously execed.

2005-09-20  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (av::fixup): Just blindly run any file if it has a .bat or
	.cmd extension.

2005-09-19  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (do_exit): Only call sigproc_terminate from one location --
	pinfo::exit.
	* pinfo.cc (pinfo::exit): Move sigproc_terminate later so that signals
	can be processed while waiting for hExeced child.
	(pinfo::maybe_set_exit_code_from_windows): Set exit code from sigExeced
	if it is non-zero.  Set exit_state to ES_EXEC_EXIT prior to waiting for
	captive process exit code.
	* exceptions.cc (sigExeced): New global variable.
	(signal_exit): Remove noreturn attribute from declaration.
	(signal_exit): Just terminate captive process and return if hExeced on
	the theory that the exit will be subsequently handled in the main
	thread.
	* sigproc.cc (sigproc_terminate): Eliminate test for
	ES_SIGPROCTERMINATE and use ES_FINAL instead.
	(sig_send): Use no_signals_available instead of duplicate test.
	* winsup.h (ES_EXEC_EXIT): New enum.
	(ES_SIGPROCTERMINATE): Delete.

2005-09-19  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (talktome): Take siginfo_t argument.  Don't scan all pids
	trying to find one that's talking to me.  Just use the pid from
	siginfo_t.
	(wait_pid): Pass siginfo_t argument to talktome.

2005-09-17  Christopher Faylor  <cgf@timesys.com>

	* pipe.cc (fhandler_pipe::open): Use 'cfree' to free buffer since it is
	now allocated by cmalloc.

2005-09-17  Corinna Vinschen  <corinna@vinschen.de>

	* net.cc (cygwin_inet_ntop): Change len argument to socklen_t to
	follow SUSv3.
	* include/arpa/inet.h (inet_ntop): Ditto.
	* include/cygwin/in.h: Include cygwin/socket.h to get socklen_t.

2005-09-16  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (build_env): Use "kilo"bytes not "mega"bytes.  Return
	immediately on error.
	* spawn.cc (spawn_guts): Set return value to -1 on error from
	build_env.

2005-09-16  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (build_env): Clear envblock and return NULL on attempt to
	use env var > 32K.
	* spawn.cc (spawn_guts): Set E2BIG if build_env detects an error.

2005-09-16  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (environ_init): Protect with a 'myfault' in case
	GetEnvironmentStrings misbehaves.

2005-09-16  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (environ_init): Add debugging output with value returned
	from GetEnvironmentStrings.

2005-09-16  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (environ_init): Issue an error if GetEnvironmentStrings
	fails and return.

2005-09-15  Christopher Faylor  <cgf@timesys.com>

	* pinfo.h (EXITCODE_SET): Move out of range of Windows error.
	(EXITCODE_NOSET): Ditto.
	* sigproc.cc (no_signals_available): Remove check for hwait_sig.  Just
	rely on my_sendsig.  Pass in an argument controlling when it is
	appropriate to test EXITCODE_SET.
	(proc_can_be_signalled): Remove checks for myself since this function
	is never called in that context.
	(sigproc_init): Pre-initialize my_sendsig to non-zero so that
	proc_can_be_signalled will know that we expect to be signalable soon.
	(sig_send): Change debugging output.

2005-09-15  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (no_signals_available): Return true if sending to self
	from the signal thread.
	(wait_sig): Correct so that WaitForSingleObject is called when
	hMainThread is != 0, rather than the reverse.

	* cygheap.cc (cygheap_fixup_in_child): Clarify potential error message.

	* fork.cc (fork_copy): Cosmetic change.

2005-09-15  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (wait_sig): Reorganize exit case so that ExitProcess is
	always called, since that is the intent of sending a __SIGEXIT.  Wait
	forever for main thread to go away since, presumably, the main thread
	told us it was going away.

2005-09-14  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (av::fixup): Avoid breaking out of the wrong "loop".

2005-09-14  Christopher Faylor  <cgf@timesys.com>

	* hookapi.cc (hook_or_detect_cygwin): Simplify very slightly.
	* spawn.cc (av::fixup): Guard against problems reading an executable
	which does not match Microsoft's documentation about PE format.

2005-09-14  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (av::error): Eliminate.
	(av::av): Remove reference to error.
	(av::replace0_maybe): Ditto.
	(av::dup_maybe): Ditto.
	(av::dup_all): Ditto.
	(av::unshift): Ditto.
	(spawn_guts): On a fault, return E2BIG only if ENOMEM has been set.
	Otherwise return EFAULT.

2005-09-14  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (san): New structure.
	(cygtls::andreas): New element.  Replaces _myfault and _myfault_errno.
	(cygtls::fault_guarded): Use andreas.
	(cygtls::return_from_fault): Ditto.
	(cygtls::setup_fault): Add a parameter denoting where to store old
	fault handler, if any and use it to "stack" faults.
	(cygtls::reset_fault): Restore fault from parameter.
	(myfault::sebastian): New variable.
	(myfault::~myfault): Pass sebastian to reset_fault.
	(myfault::myfault): Store old fault values in sebastian.

2005-09-14  Christopher Faylor  <cgf@timesys.com>

	* heap.cc (heap_init): Revert 2005-09-11 patch as it seems to
	inexplicably cause problems with emacs.

2005-09-14  Christopher Faylor  <cgf@timesys.com>

	Remove some more unneeded 'return;'s throughout.

2005-09-14  Christopher Faylor  <cgf@timesys.com>

	* sigproc.h: Protect declaration so that it only happens when
	__INSIDE_CYGWIN__.

2005-09-14  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc (sigtid): Remove declaration.
	(handle_exceptions): Use _sig_tls rather than sigtid to determine if
	this is the signal thread.
	(set_signal_mask): Ditto for conditionalized CGF code.
	* pinfo.cc (pinfo::exit): Exit the thread if we forcefully terminated
	the main thread.
	* sigproc.cc (sigtid): Delete.
	(_sig_tls): Define.
	(sig_clear): Use _sig_tls rather than sigtid to determine if this is
	the signal thread.
	(sig_dispatch_pending): Ditto.
	(wait_sig): Set _sig_tls here.

2005-09-13  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (do_exit): Move sigproc_terminate call later since signal
	handling was still needed for subsequent stuff.  Call sigproc_terminate
	with new exit_state value.
	* pinfo.cc (pinfo::exit): Call sigproc_terminate with new exit_state
	value.
	* sigproc.cc (proc_terminate): Remove unnecessary (void) parameter.
	(sigproc_terminate): Ditto.  Add new argument to accept exit state to
	be set.
	(wait_sig): Reorganize __SIGEXIT handling.  Add more debugging output.
	* winsup.h (sigproc_terminate): Declare with new exit_state argument.
	(exit_states): Reorganize to reflect new exit ordering of
	sigproc_terminate.

2005-09-13  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (do_exit): Rely on sigproc_terminate to set exit_state
	appropriately.
	* pinfo.cc (pinfo::exit): Always call sigproc_terminate here.  Rely on
	sigproc_terminate to signal signal thread to handle eventual process
	exit.
	* sigproc.cc (no_signals_available): Change criteria for determining if
	this process can handle signals to itself.
	(my_sendsig): New variable.  Copy of my sendsig handle.
	(proc_can_be_signalled): Don't send signals if exit code is set.
	(sigproc_terminate): Use and set exit_state appropriately to determine
	when to do anything.  Send __SIGEXIT to self to control process exit.
	(sig_send): Use my_sendsig for sending signals.  Don't call
	proc_can_be_signalled for myself since the criteria is now different
	for sending signals to myself.
	(wait_sig): Copy myself->sendsig to my_sendsig for future use.  Exit
	signal loop when __SIGEXIT is received.  Wait for main thread to exit
	and use its exit status to actually exit process.
	* sigproc.h (__SIGEXIT): New enum.

2005-09-13  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (alloc_stack): Eliminate superfluous "return;".
	* debug.cc (add_handle): Ditto.
	* devices.in (device::parse): Ditto.
	* dtable.cc (dtable::vfork_parent_restore): Ditto.
	(dtable::vfork_child_fixup): Ditto.
	* environ.cc (parse_options): Ditto.
	* errno.cc (seterrno_from_win_error): Ditto.
	* exceptions.cc (sig_handle_tty_stop): Ditto.
	(set_signal_mask): Ditto.
	* fhandler.cc (fhandler_base::read): Ditto.
	(fhandler_base::operator delete): Ditto.
	(fhandler_base::seekdir): Ditto.
	(fhandler_base::rewinddir): Ditto.
	* fhandler_console.cc (fhandler_console::read): Ditto.
	(fhandler_console::fixup_after_exec): Ditto.
	* sigproc.cc (sigproc_init): Ditto.
	(sigproc_terminate): Ditto.

	* devices.cc: Regenerate.

2005-09-13  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (wait_sig): Be more defensive about detecting when we're
	exiting.

2005-09-12  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::cygthread): Add more info to fatal error.

	* fhandler_disk_file.cc (fhandler_disk_file::readdir): Temporarily
	remove insertion of /dev into root directory.
	* path.cc (path_conv::check): Ditto.

2005-09-11  Christopher Faylor  <cgf@timesys.com>

	* heap.cc (heap_init): Allocate heap from top down as a hedge against
	subsequent ERROR_INVALID_ADDRESS in forked processes when CTRL-C is
	pressed.

2005-09-09  Christopher Faylor  <cgf@timesys.com>

	* heap.cc (heap_init): Be slightly more aggressive when trying to
	allocate heap.  Change fatal error message to avoid confusion with
	cygheap.

	* spawn.cc (linebuf::finish): New function.
	(linebuf::add): Cosmetic change.
	(spawn_guts): Only avoid building windows command line if the program
	being executed was actually mounted with -X.  Don't return E2BIG if we
	hit the 32K size and we're executing a detected cygwin program.  Just
	silently truncate the windows command line, instead.

2005-09-08  Christopher Faylor  <cgf@timesys.com>

	* fhandler_serial.cc (fhandler_serial::tcgetattr): Just zero c_cflag
	here rather than clearing CBAUD after the fact.
	* termios.cc (tcgetattr): Revert previous change.

2005-09-08  Christopher Faylor  <cgf@timesys.com>

	* fhandler_serial.cc (fhandler_serial::ioctl): Always return 0 for
	window size.
	* termios.cc (tcgetattr): Clear out baud part of c_cflag since it is
	always ignored.

2005-09-08  Corinna Vinschen  <corinna@vinschen.de>

	* exceptions.cc (ctrl_c_handler): Disable any special CTRL_LOGOFF_EVENT
	handling and add longish comment about the reasons.

2005-09-07  Christopher Faylor  <cgf@timesys.com>

	* hookapi.cc (rvadelta): Change argument to DWORD to eliminate a
	compiler warning.

	* path.h (path_conv::set_cygexec): New function.
	* spawn.cc (av::iscygwin): Eliminate.
	(av::av): Don't initialize iscygwin.
	(spawn_guts): Just use real_path.iscygexec for all tests.
	(av::fixup): Short circuit test if .exe extension and known cygexec.
	Set cygexec flag appropriately if we find that program uses cygwin1.dll.

2005-09-06  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (initial_env): Don't attempt stracing if dynamically loaded.
	(dll_crt0_0): Move console initialization earlier.
	* init.cc (dll_entry): Move console initialization here.
	* exceptions.cc (init_console_handler): Fully remove any old console
	handler.
	(handle_sigsuspend): Make cancelable when called from non-main thread.

	* spawn.cc (spawn_guts): Don't fill out windows argv if we've deduced
	that this is a cygwin-using program.
	(av::fixup): Always check executables to see if they are using
	cygwin1.dll.  Don't consider .com files to be scripts.
	* hookapi.cc (rvadelta): New function.
	(PEHeaderFromHModule): Simplify slightly.
	(hook_or_detect_cygwin): Use passed in name argument for "HMODULE"
	rather than incorrectly reading current program.  Calculate delta
	needed to read image data and file names if this isn't a real
	"HMODULE".

2005-09-06  Corinna Vinschen  <corinna@vinschen.de>

	* thread.h: Revert patch from 2005-09-05.
	* thread.cc (pthread_mutex::can_be_unlocked): Return true also if
	mutex is owned by MUTEX_OWNER_ANONYMOUS.

2005-09-05  Christopher Faylor  <cgf@timesys.com>

	* cygheap.cc (cygheap_init): Eliminate debugging #if.

	* fork.cc (fork_parent): Don't issue errors if "somebody" has set the
	PID_EXITED flag on a child.  Don't close process handle if it has
	potentially already been closed.
	* pinfo.cc (winpids::add): Eliminate PID_ALLPIDS handling which was
	obsoleted by previous changes.

	* spawn.cc (av::fixup): Do win16 detection for .com files.  Make sure
	that buffer has been unmapped in all cases.

2005-09-05  Corinna Vinschen  <corinna@vinschen.de>

	* thread.h (pthread_mutex::get_pthread_self): Remove.
	(pthread_mutex::lock): Use ::pthread_self as self parameter.
	(pthread_mutex::trylock): Ditto.
	(pthread_mutex::unlock): Ditto.
	(pthread_mutex::destroy): Ditto.

2005-09-02  Dave Korn  <dave.korn@artimi.com>

	* Makefile.in (CXXFLAGS): Use 'override' to correctly set flags to
	generate dependencies when invoked from top-level make.

2005-08-28  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc (set_process_mask_delta): Conditionalize debugging
	output.
	* sigproc.cc (proc_subproc): Make strace output a little more verbose.

2005-08-28  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (__ljfault): Declare.
	(_cygtls::return_from_fault): Use __ljfault.
	* exceptions.cc (set_signal_mask): Revert previous checkin.
	* gendef (__sjfault): Split out into a separate function which doesn't
	bother with any special signal locking.
	(_ljfault): Return from a __sjfault without bothering with signals.

2005-08-28  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (_local_storage::strerror_buf): Allocate more space.
	* errno.cc (strerror_worker): New function, adapted from strerror.
	(strerror): Use strerror_worker.
	* tlsoffsets.h: Regenerate.

	* exceptions.cc (set_signal_mask): Minimize time during which mask_sync
	is held.

2005-08-28  Christopher Faylor  <cgf@timesys.com>

	* cygwin.din: Correct readdir_r typo.

2005-08-27  Bas van Gompel  <cygwin-patch.buzz@bavag.tmfweb.nl>

	* dir.cc (readdir_r): Invert sense on error test.

2005-08-25  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (normalize_posix_path): Keep two leading slashes
	intact throughout.
	(normalize_win32_path): Revert to only checking for slash.
	(realpath): Convert drive letters to cygdrive paths before
	doing anything else.
	* shared_info.h (mount_info::cygdrive_posix_path): Make public.

2005-08-25  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (realpath): Drop call to mount_info::conv_to_posix_path
	in favor of calling path_conv with PC_POSIX flag.  Align error
	handling closer to POSIX.  As on Linux, return user space allocated
	memory if second parameter is NULL.

2005-08-25  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (normalize_win32_path): Honor network paths.  Fold more
	than two leading dir separators into one.  Check for dir separator
	instead of just slashes to handle incoming Win32 paths correctly.

2005-08-25  Christopher Faylor  <cgf@timesys.com>

	* errno.cc (errmap): Translate ERROR_NO_MORE_ITEMS to ENMFILE.

2005-08-24  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc (handle_sigsuspend): Just sleep forever if called from
	non-main thread.
	(sigpacket:process): Simplify logic which determines when and how a
	signal is masked.  Don't trigger sigwait if there is a signal handler.
	* sigproc.cc (wait_sig): Update comment.  Try to process a signal which
	is in the queue if it isn't queued for the target thread (this is still
	not right).

2005-08-24  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (perhaps_suffix): Record errno-type error value in third
	argument.
	(find_exec): On error, set errno returned from perhaps_suffix.
	(spawn_guts): Ditto.

2005-08-24  Christopher Faylor  <cgf@timesys.com>

	* fhandler_virtual.cc (fhandler_virtual::close): Don't free filebuf if
	it's NULL.
	* pinfo.cc (_pinfo::commune_send): Fix test for incorrect number of
	bytes read from pipe.

2005-08-24  Corinna Vinschen  <corinna@vinschen.de>

	* syscalls.cc (endusershell): Reset shell_fp to NULL to allow
	subsequent getusershell calls.

2005-08-24  Christopher Faylor  <cgf@timesys.com>

	* path.cc (path_conv::check): Fill in fileattr for /dev, defaulting to
	directory if /dev doesn't actually exist.
	(win32_device_name): Don't consider FH_DEV to be a device since it's
	really a directory which should go through mount processing.

2005-08-24  Christopher Faylor  <cgf@timesys.com>

	* cygheap.h (cygheap_types): Add HEAP_COMMUNE.
	* fhandler_proc.cc: Use cygheap rather than user heap for allocation of
	filebuf throughout.
	* fhandler_registry.cc: Ditto.
	* fhandler_virtual.cc: Ditto.
	* fhandler_process.cc: Ditto.
	(get_mem_values): Use malloc/realloc/free rather than new.
	* pinfo.cc (_pinfo::commune_send): Allocate on cygwin heap rather than
	user heap.  Avoid calling ReadFile when correct number of characters
	have been read or suffer buffer corruption.
	(_pinfo::fd): Allocate on cygwin heap rather than user heap.
	(_pinfo::fds): Ditto.
	(_pinfo::root): Ditto.
	(_pinfo::cwd): Ditto.
	(_pinfo::cmdline): Ditto.

	* devices.h (FH_DEV): New define.
	* devices.in: Detect lone /dev.
	* devices.cc: Regenerate.
	* path.cc (path_conv::check): Treat FH_DEV as a special case.

2005-08-23  Christopher Faylor  <cgf@timesys.com>

	* sigproc.h (set_signal_mask): Remove default on second parameter and
	make pass by reference.
	* signal.cc (abort): Accommodate change to set_signal_mask.
	* select.cc (pselect): Ditto.
	* exceptions.cc (handle_sigsuspend): Ditto.
	(ctrl_c_handler): Ditto.
	(sighold): Ditto.
	(sigrelse): Ditto.
	(set_process_mask_delta): Ditto.
	(_cygtls::call_signal_handler): Ditto.

	* fhandler_disk_file.cc (fhandler_disk_file::readdir): Return ENMFILE
	if __handle is not set.  Set __handle to NULL when out of files.
	(fhandler_disk_file::rewinddir): Don't close handle if it's NULL.
	(fhandler_disk_file::closedir): Ditto.

2005-08-22  Christopher Faylor  <cgf@timesys.com>

	* dir.cc (readdir_worker): Make static.  Only add '.' and '..' when
	readdir fails due to ENMFILE.
	* fhandler_disk_file.cc (fhandler_disk_file::readdir): Only close
	handle on error != ENMFILE.

2005-08-22  Corinna Vinschen  <corinna@vinschen.de>

	* mtinfo.h (mtinfo_drive::error): Fix argument bug in debug_printf call.

2005-08-20  Christopher Faylor  <cgf@timesys.com>

	* cygerrno.h (geterrno_from_win_error): Change declaration to default
	to using GetLastError and EACCESS.
	* cygwin.din: Export readdir_r.
	* include/cygwin/version.h: Bump API version number to 138.
	* syscalls.cc (readdir_worker): New function, renamed from old
	readdir() function.
	(readdir): Use readdir_worker.
	(readdir_r): New function.
	* fhandler.h (fhandler_base::readdir): Accommodate second argument
	indicating dirent buffer.
	(fhandler_disk_file::readdir): Ditto.
	(fhandler_cygdrive::readdir): Ditto.
	(fhandler_proc::readdir): Ditto.
	(fhandler_netdrive::readdir): Ditto.
	(fhandler_registry::readdir): Ditto.
	(fhandler_process::readdir): Ditto.
	* fhandler.cc (fhandler_base::readdir): Ditto.
	* fhandler_disk_file.cc (fhandler_disk_file::readdir): Ditto.
	* fhandler_cygdrive.cc (fhandler_cygdrive::readdir): Ditto.
	* fhandler_proc.cc (fhandler_proc::readdir): Ditto.
	* fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto.
	* fhandler_registry.cc (fhandler_registry::readdir): Ditto.
	* fhandler_process.cc (fhandler_process::readdir): Ditto.
	* include/sys/dirent.h (readdir_r): Add declaration.

2005-08-19  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (dirent_states): Add dirent_saw_proc.
	* fhandler_disk_file.cc (fhandler_disk_file::readdir): Fill in "proc"
	if it is the root dir and it is missing.

2005-08-19  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (dirent_states): Add dirent_isroot, dirent_saw_cygdrive,
	dirent_saw_dev.
	* dir.cc (opendir): Don't zero __flags here.  Push that responsibility
	to opendir methods.
	(seekdir): Preserve dirent_isroot in __flags.
	(rewinddir): Ditto.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Set
	dirent_isroot appropriately.
	(fhandler_disk_file::readdir): Fill in "cygdrive" and "dev" if it is
	the root dir and they are missing.
	* fhandler_process.cc (fhandler_process::opendir): Set __flags here.
	* fhandler_virtual.cc (fhandler_virtual::opendir): Set __flags here.

2005-08-19  Christopher Faylor  <cgf@timesys.com>

	* winsup.h (create_pipe): Declare new function.
	(CreatePipe): New define.
	* miscfuncs.cc (create_pipe): Define new function.

2005-08-18  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (fhandler_tty_common::lseek): Declare new method.
	(fhandler_tty_slave::lseek): Delete old method.
	(fhandler_tty_master::lseek): Delete old method.
	* fhandler_tty.cc (fhandler_tty_common::lseek): Define new method.

2005-08-18  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::recvfrom): Always initialize
	ret to 0.
	(fhandler_socket::recvmsg): Ditto.

2005-08-18  Corinna Vinschen  <corinna@vinschen.de>

	* errno.cc (strerror): Check errnum for underflow.

2005-08-17  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (dll_crt0_1): Tweak debugging stuff.

2005-08-17  Pavel Tsekov  <ptsekov@gmx.net>

	* fhandler_tty.cc (fhandler_tty_common::close): Rearrange the code so
	that the master end of the input and output pipes is closed before
	signalling an EOF event to the slave.
	(fhandler_pty_master::close): Likewise.

2005-08-14  Corinna Vinschen  <corinna@vinschen.de>

	* init.cc (respawn_wow64_process): Make inline function.  Remove
	"noreturn" attribute.  Add additional check if parent process is
	actually a 64 bit process.
	(dll_entry): Only test WOW64 processes with a stack in the usual
	"dangerous" process space area.

2005-08-11  Troy Curtiss  <trcurtiss@gmail.com>

	* fhandler_serial.cc (fhandler_serial::tcgetattr): Return current baud
	rate regardless of current DTR state.

2005-08-11  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc: Remove ld_preload declaration.
	* winsup.h: Move ld_preload declaration here.
	* fork.cc (fork_child): Call ld_preload() before returning.

2005-08-11  Christopher Faylor  <cgf@timesys.com>

	* child_info.  (CURR_CHILD_INFO_MAGIC): Refresh.
	(child_info::child_info()): New constructor.
	(child_info_spawn::child_info_spawn()): Ditto.
	(child_info_spawn::operator new): New operator.
	(child_info_spawn::set): New function.
	* spawn.cc (av()): New constructor.
	(av::operator new): New operator.
	(av::set): New function.
	(spawn_guts): Reorganize so that classes which allocate are defined
	early in the function so that it can be properly cleaned up after an
	efault.  Set errno to E2BIG in the event of a SEGV situation.

2005-08-08  Christopher Faylor  <cgf@timesys.com>

	* include/sys/cdefs.h: Remove extra line.

2005-08-08  Corinna Vinschen  <corinna@vinschen.de>

	* security.cc (get_reg_security): New static function.
	(get_nt_object_security): Call get_reg_security for registry keys
	to circumvent problems with predefined registry keys.

2005-08-08  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_process.cc (fhandler_process::open): Allow opening of
	/proc/<pid>/fd for reading.
	* fhandler_registry.cc (fhandler_registry::open): Ditto for registry
	keys.

2005-08-08  Christopher Faylor  <cgf@timesys.com>

	* include/sys/cdefs.h (__CONCAT): Define.
	* include/elf.h: New file.
	* include/sys/elf32.h: Ditto.
	* include/sys/elf64.h: Ditto.
	* include/sys/elf_common.h: Ditto.
	* include/sys/elf_generic.h: Ditto.

2005-08-08  Christopher Faylor  <cgf@timesys.com>

	* cygwin.sc: Use simpler method to align .cygheap.
	* dllfixdbg: Just copy .stab and .stabstr sections when making
	cygwin1.dbg, rather than relying on objcopy to keep only the debug
	sections since objcopy seems to get it wrong.

2005-08-08  Corinna Vinschen  <corinna@vinschen.de>

	* dtable.cc (build_fh_pc): Check setting fh to fhandler_nodevice for
	NULL, too.

2005-08-08  Corinna Vinschen  <corinna@vinschen.de>

	* ftw.c: Include winsup.h.
	* nftw.c: Ditto.
	* include/ftw.h: Guard declarations appropriately.

2005-08-08  Corinna Vinschen  <corinna@vinschen.de>

	* Makefile.in (DLL_OFILES): Add fts.o, ftw.o, nftw.o.
	* cygwin.din: Export fts_children, fts_close, fts_get_clientptr,
	fts_get_stream, fts_open, fts_read, fts_set, fts_set_clientptr,
	ftw, nftw.
	* fts.c: New file, imported from FreeBSD.
	* ftw.c: Ditto.
	* nftw.c: Ditto.
	* include/fts.h: Ditto.
	* include/ftw.h: Ditto.
	* include/cygwin/version.h: Bump API minor number.

2005-08-07  Christopher Faylor  <cgf@timesys.com>

	* Makefile.in (dtable_CFLAGS): Use -fomit-frame-pointer and
	-fcheck-new.
	* cygheap.cc (cmalloc): Only emit system_printf warnings on failure if
	DEBUGGING.
	(crealloc): Ditto.
	(ccalloc): Ditto.
	* dtable.cc (build_fh_name): Treat NULL return from cnew as indicative
	of EMFILE condition.
	(build_fh_dev): Ditto.
	(dtable::dup_worker): Handle NULL return from build_fh_pc.
	(dtable::vfork_child_dup): Trust dup_worker to set errno.
	* fhandler.h (fhandler_base::new): Mark as nothrow.

2005-08-07  Christopher Faylor  <cgf@timesys.com>

	* dllfixdbg: New perl script.
	* configure.in: Detect objcopy, objdump, strip.
	* configure: Regenerate.
	* Makefile.in: Pass target objcopy/objdump to new dllfixdbg script.
	Remove previous perl check.
	* cygwin.sc: Add .gnu_debuglink_overlay section for eventual
	replacement with .gnu_debuglink section.  Revert move of cygheap to end
	of image.

2005-08-06  Corinna Vinschen  <corinna@vinschen.de>

	* Makefile.in: Allow previous patch to work in a 64 bit environment.

2005-08-06  Christopher Faylor  <cgf@timesys.com>

	* Makefile.in: Warn when end of cygheap is not on 64k boundary.
	* cygwin.sc: Try harder to ensure that cygheap is on a 64k boundary.
	Move cygheap to end of image to stop interference from unstripped debug
	regions.

2005-08-06  Christopher Faylor  <cgf@timesys.com>

	* include/endian.h: Move everything into this file and define things
	more like linux.
	* include/cygwin/types.h: Include endian.h.
	* include/sys/dirent.h: Define DT_* types and conversion macros.

	* pinfo.cc (pinfo::init): Remove special handling for PID_ALLPIDS and
	execed code, even though it probably still isn't quite right.

2005-08-05 Michael Gorse <mgorse@alum.wpi.edu>

	* thread.cc (pthread::create(3 args)): Make bool.
	(pthread_null::create): Ditto.
	(pthread::create(4 args)): Check return of inner create rather than
	calling is_good_object().
	* thread.h: Ditto.

2005-08-05  Vaclav Haisman  <v.haisman@sh.cvut.cz>

	* fhandler_tty.cc (fhandler_tty_slave::tcflush): Return either 0 or -1.

2005-08-05  Corinna Vinschen  <corinna@vinschen.de>

	* thread.cc (pthread_cond_timedwait): Check abstime for validity
	according to SUSv3.  Rewrite timeout check and waitlength calculation
	to avoid overflow problems.

2005-08-02  Yitzchak Scott-Thoennes  <sthoenna@efn.org>

	* include/sys/termios.h: Define TIOCMBIS and TIOCMBIC.
	* fhandler.h (class fhandler_serial): Declare switch_modem_lines.
	* fhandler_serial.cc (fhandler_serial::switch_modem_lines): New
	static function to set or clear DTR and/or RTS.
	(fhandler_serial::ioctl): Use switch_modem_lines for TIOCMSET
	and new TIOCMBIS and TIOCMBIC.
	* include/cygwin/version.h: Bump API minor number.

2005-07-29  Christopher Faylor  <cgf@timesys.com>

	* fhandler_disk_file.cc (fhandler_base::pread): Don't move file offset
	pointer after I/O.
	(fhandler_base::pwrite): Ditto.

2005-07-29  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (fhandler_base::pread): Declare new function.
	(fhandler_base::pwrite): Ditto.
	(fhandler_disk_file::pread): Ditto.
	(fhandler_disk_file::pwrite): Ditto.
	* fhandler.cc (fhandler_base::pread): Define new function.
	(fhandler_base::pwrite): Ditto.
	* fhandler_disk_file.cc (fhandler_base::pread): Ditto.
	(fhandler_base::pwrite): Ditto.
	* syscalls.cc (pread): Define new function.
	(pwrite): Ditto.
	* cygwin.din: Export pread, pwrite.

	* include/sys/ioctl.h: Guard some _IO* declarations to avoid conflict
	with socket.h.

2005-07-29  Christopher Faylor  <cgf@timesys.com>

	* include/sys/ioctl.h: Add some linux defines.

2005-07-29  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::init): Put back accidentally removed debug_printf.

2005-07-29  Arto Huusko  <arto.huusko@wmdata.fi>

	* cygthread.cc (cygthread::simplestub): Wait for h to be filled out
	by main thread before assigning it.

2005-07-29  Arto Huusko  <arto.huusko@wmdata.fi>

	* pinfo.cc (pinfo::init): Sleep before retrying open_shared().

2005-07-29  Arto Huusko  <arto.huusko@wmdata.fi>

	* fork.cc (fork_parent): Fix null deref if pinfo creation fails.

2005-07-28  Christopher Faylor  <cgf@timesys.com>

	* cygmalloc.h (MSPACES): Define.  This dropped through the cracks after
	the last malloc update.
	* dcrt0.cc: Fix a comment.
	* malloc.cc (internal_malloc): Fix definition so that it can be safely
	coerced.

2005-07-27  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/in.h (INET_ADDRSTRLEN): Add new definition.

2005-07-27  Christopher Faylor  <cgf@timesys.com>

	* gendef: Use nocr to remove \r's from input.
	gendef (nocr): New function.

2005-07-27  Christopher Faylor  <cgf@timesys.com>

	* fhandler_clipboard.cc (fhandler_dev_clipboard::close): Set membuffer
	to NULL.
	(fhandler_dev_clipboard::fixup_after_exec): Don't call close here.
	Just set variables directly.

2005-07-25  Christopher Faylor  <cgf@timesys.com>

	* include/byteswap.h: New file.

2005-07-25  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/types.h: Define loff_t.

2005-07-16  Christopher Faylor  <cgf@timesys.com>

	* child_info.h (child_info::sync): Pass pid and HANDLE rather than
	using pinfo.
	(child_info::child_info): Accept an argument controlling whether to
	create proc_subproc.
	(child_info_spawn::child_info_spawn): Ditto.
	* sigproc.cc (child_info::child_info): Ditto.
	(child_info_spawn::child_info_spawn): Ditto.
	(child_info::sync): Use passed in pid and HANDLE.
	* fork.cc (fork_parent): Reflect additional arguments required for
	child_info::sync.
	* hookapi.cc (hook_or_detect_cygwin): Rename.  Change so that NULL 'fn'
	argument just returns "true", indicating that program uses cygwin1.dll.
	* spawn.cc (av::win16_exe): New element.
	* spawn.cc (av::iscygwin): New element.
	(av::fixup): New function.
	(spawn_guts): Protect against SEGV.  Use fixup function to detect when
	it is safe to wait for a spawned (as opposed to an execed) program.
	Reflect changes in child_info::sync arguments.
	* external.cc (cygwin_internal): Reflect function renaming to
	hook_or_detect_cygwin.

	* cygheap.cc (cygheap_fixup_in_child): Close handle after debug fixup
	has been done to prevent false positives in handle collision.

	* exceptions.cc (try_to_debug): Notify debugger if already being
	debugged.

2005-07-09  Christopher Faylor  <cgf@timesys.com>

	* path.cc (mount): Only check win32_path when we know we need it.

2005-07-09  Nicholas Wourms  <nwourms@gmail.com>

	* cygwin.din (getline): Export.
	(getdelim): Export.
	* include/sys/stdio.h (getline): Replace macro with function prototype.
	(getdelim):  Likewise.
	* include/cygwin/version.h: Bump API minor number.

2005-07-08  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (__getline): Export.
	(__getdelim): Export.
	* include/sys/stdio.h (getline): Define as __getline.
	(getdelim): Define as __getdelim.
	* include/cygwin/version.h: Bump API minor number.

2005-07-06  Christopher Faylor  <cgf@timesys.com>

	Eliminate (void) cast on standalone function calls throughout.

2005-07-05  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (cygwin_exit): Mark as "noreturn".
	* sigproc.cc (child_info::ready): Don't signal parent that we are a
	cygwin process if we are dynamically loaded.

2005-07-05  Christopher Faylor  <cgf@timesys.com>

	* malloc.cc: Update to version 2.8.2.

2005-07-05  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_tape.cc (fhandler_dev_tape::close): Don't do "extra stuff"
	when we know we're execing.

2005-07-04  Christopher Faylor  <cgf@timesys.com>

	Change foo (void) to foo () for all c++ functions throughout.
	Remove all fhandler_*::dump functions throughout.

	* fhandler.h (fhandler_dev_mem::close): Remove pass-through function in
	favor of virtual method.
	(handler_dev_raw::close): Ditto.
	(fhandler_dev_clipboard::fixup_after_exec): New method.
	* fhandler_dev_mem.cc (fhandler_dev_mem::close): Eliminate pass through
	function in favor of virtual method.
	* fhandler_dev_raw.cc (fhandler_dev_raw::close): Ditto.
	* fhandler_clipboard.cc (fhandler_dev_clipboard::close): Don't go to
	extra effort when execing.
	(fhandler_dev_clipboard::fixup_after_exec): New function.
	* fhandler_console.cc (fhandler_console::close): Don't do "extra stuff"
	when we know we're execing.
	* fhandler_disk_file.cc (fhandler_disk_file::close): Ditto.
	* fhandler_dsp.cc (fhandler_dev_dsp::close): Ditto.
	* fhandler_fifo.cc (fhandler_fifo.cc::close): Ditto.  function in favor
	of base function.
	* fhandler_random.cc (fhandler_dev_random::close): Ditto.
	* fhandler_registry.cc (fhandler_registry::close): Ditto.
	* fhandler_tty.cc (fhandler_tty_slave::close): Ditto.
	* fhandler_virtual.cc (fhandler_virtual::close): Ditto.

	* pinfo.cc (proc_waiter): Remove unneeded hExeced declaration.
	* sigproc.cc: Ditto.
	* winsup.h (hExeced): Define here.

	* fhandler_virtual.cc (fhandler_virtual::fixup_after_exec): Just call
	close() to reinitialize things to known state.

2005-07-04  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (_cygtls): Perform minor reformatting.

	* winsup.h (close_all_files): Reflect argument change.
	* dtable.cc (close_all_files): Ditto.
	* dtable.h: Ditto.
	* fhandler.h: Ditto.
	* spawn.cc (spawn_guts): Move close_all_files back to its original
	location in first P_OVERLAY test but use argument denoting that handles
	are only supposed to be closed, not released (more work to be done
	here).
	* syscalls.cc (close_all_files): Take an argument denoting whether to
	release closed files or not.

	* path.cc (symlink): Change argument names to reflect linux man page.
	(symlink_worker): Ditto.  Also appropriately set ENOENT for empty
	strings.


2005-07-04  Pierre Humblet <pierre.humblet@ieee.org>

	* cygheap.h (struct init_cygheap): Delete cygwin_regname member.
	* external.cc (cygwin_internal): Use cygpsid::get_id for
	CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID.
	Turn CW_SET_CYGWIN_REGISTRY_NAME and CW_GET_CYGWIN_REGISTRY_NAME
	into noops.

2005-07-03  Christopher Faylor  <cgf@timesys.com>

	* thread.cc (pthread_mutex::init): Remove unneeded efault/mutex check.

2005-07-02  Christopher Faylor  <cgf@timesys.com>

	* thread.h (verifyable_object_state verifyable_object_isvalid): Delete
	function declaration that should have been static.
	* thread.cc (verifyable_object_state verifyable_object_isvalid): Make
	inline static.
	(pthread*::is_good_object): Move to directly after
	verifyable_object_state verifyable_object_isvalid and make inline.
	(check_valid_pointer): Delete function.
	(pthread_cond_timedwait): Use myfault to detect valid pointer.
	(pthread_mutex::init): Ditto.

2005-07-02  Christopher Faylor  <cgf@timesys.com>

	Replace valid memory checks with new myfault class "exception
	handling", almost everywhere.  Leave some thread.cc stuff alone for
	now.
	* cygtls.h: Kludge some definitions to avoid including a problematic
	windows header.
	(_cygtls::_myfault): New entry.
	(_cygtls::_myfault_errno): Ditto.
	(_cygtls::fault_guarded): New function.
	(_cygtls::setup_fault): Ditto.
	(_cygtls::return_from_fault): Ditto.
	(_cygtls::clear_fault): Ditto.
	(myfault): New class.
	* exceptions.cc (handle_exceptions): Handle case of guarded fault in
	system routine.
	* gendef: Add another entry point for setjmp that the compiler doesn't
	know about and won't complain about.
	* gentls_offsets: Just include windows.h rather than kludging a HANDLE
	def.
	* miscfuncs.cc (check_null_str): Delete.
	(check_null_empty_str): Ditto.
	(check_null_empty_str_errno): Ditto.
	(check_null_str_errno): Ditto.
	(__check_null_invalid_struct): Ditto.
	(__check_null_invalid_struct_errno): Ditto.
	(__check_invalid_read_ptr): Ditto.
	(__check_invalid_read_ptr_errno): Ditto.
	(dummytest): New function.
	(check_iovec_for_read): Delete.
	(chec_iovec): Rename from check_iovec_for_write.  Take a read/write
	parameter.
	* tlsoffsets.h: Regenerate.
	* winsup.h: Remove check_* declarations.
	(check_iovec_for_read): Delete declaration.  Turn into a define
	instead.
	(check_iovec_for_write): Ditto.
	(check_iovec): New declaration.

	* thread.h: Use ifdef guard name consistent with other header files.

2005-07-02  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/version.h: Bump DLL minor number to 19.

2005-06-30  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.cc (fhandler_base::readv): Use malloc/free instead of alloca.
	(fhandler_base::writev): Ditto.

2005-06-29  Christopher Faylor  <cgf@timesys.com>

	* cygerrno.h: Make multi-inclusion safe.
	* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Deal with EINTR.
	* dcrt0.cc (dll_crt0_0): Accommodate init_console_handler argument
	change.
	* winsup.h: Ditto.
	* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
	* exceptions.cc (init_console_handler): Ditto.  Ignore console events
	if we're not attached to a terminal.
	* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
	* wincap.cc: Implement has_null_console_handler_routine throughout.
	* wincap.h: Ditto.

2005-06-29  Christopher Faylor  <cgf@timesys.com>

	* autoload.cc (LoadDLLprime): Use a more descriptive name for autoload
	text sections.
	* cygwin.sc: Ditto.

2005-06-27  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::facl): Add missing break.

2005-06-24  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (path_conv::check): Don't strip trailing dots and spaces
	at the start of the path.

2005-06-24  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.cc (rootdir): Don't set errno.
	* syscalls.cc (statvfs): Set errno to ENOTDIR if rootdir() failed.

2005-06-22  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_dev_tape): Add declaration for
	fixup_after_fork and set_close_on_exec.
	* fhandler_tape.cc (fhandler_dev_tape::open): Create mt_mtx mutex
	inheritable.
	(fhandler_dev_tape::close): Close mt_mtx.
	(fhandler_dev_tape::dup): Duplicate mt_mtx and mt_evt as necessary.
	(fhandler_dev_tape::fixup_after_fork): New method.
	(fhandler_dev_tape::set_close_on_exec): New method.

2005-06-21  Corinna Vinschen  <corinna@vinschen.de>

	* security.cc (get_initgroups_sidlist): Drop special_pgrp parameter.
	(get_setgroups_sidlist): Avoid duplicate groups in group list.
	(create_token): Remove special_pgrp local variable.  Accommodate
	change to get_initgroups_sidlist call.

2005-06-21  Corinna Vinschen  <corinna@vinschen.de>

	* uinfo.cc (uinfo_init): Call reimpersonate to set the main thread's
	impersonation token.

2005-06-20  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_proc.cc (format_proc_partitions): Only list recognized
	partitions.  Use partition number given by PartitionNumber member.

2005-06-18  Corinna Vinschen  <corinna@vinschen.de>

	* glob.c: (glob0): New local variable `limit`. Use in calls to glob1
	and globextend.
	(glob1): Add `limit' parameter.
	(glob2): Ditto.
	(glob3): Ditto.
	(globextend): Ditto. Implement GLOB_LIMIT handling.
	* include/glob.h (GLOB_LIMIT): New define.
	* include/cygwin/version.h: Bump API minor number.

2005-06-17  Christopher Faylor  <cgf@timesys.com>

	* wincap.h (wincaps::detect_win16_exe): Declare.
	(wincapc::detect_win16_exe): Implement.
	* wincap.cc: Populate detect_win16_exe where appropriate.
	* spawn.cc (spawn_guts): Only go out of the way to detect 16-bit apps
	on systems which are flummoxed by them.

2005-06-17  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (spawn_guts): Detect when executing a 16-bit application and
	avoid setting the process pipe since this causes conniptions in Windows
	9x.

2005-06-17  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (inet_pton): Export.
	(inet_ntop): Export.
	* net.cc (cygwin_inet_pton): Implement inet_pton for AF_INET for now.
	(cygwin_inet_ntop): Implement inet_ntop for AF_INET for now.
	* include/arpa/inet.h (inet_pton): Declare.
	(inet_ntop): Declare.
	* include/cygwin/version.h: Bump API minor number.

2005-06-17  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_union): Add missing members corresponding to
	fhandler_fifo and fhandler_netdrive.

2005-06-16  Corinna Vinschen  <corinna@vinschen.de>

	* syscalls.cc (statvfs): Handle the case when GetDiskFreeSpaceEx
	succeeds but GetDiskFreeSpace fails by faking bytes-per-sector and
	sectors-per-cluster values.

2005-06-15  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::detach): Fix debugging output.
	* dcrt0.cc (dll_crt0_1): Create signal_arrived early -- before any
	filename manipulation.
	* sigproc.cc (sigproc_init): Don't create signal_arrived here.
	* fork.cc (fork_child): Ditto.
	* sigproc.h (create_signal_arrived): Declare.

2005-06-14  Christopher Faylor  <cgf@timesys.com>

	* path.cc (path_conv::check): Always reset to FH_FS when component != 0
	and FH_NETDRIVE to fix problems with strict case checking.

2005-06-12  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::recvmsg): Avoid SEGV in OpenSSH
	when trying to pass file descriptor by setting msg->msg_accrightslen
	to 0.

2005-06-11  Christopher Faylor  <cgf@timesys.com>

	* Makefile.in: Avoid initial heap allocation since cygwin has its own
	heap.

2005-06-11  Christopher Faylor  <cgf@timesys.com>

	* fhandler_console.cc (fhandler_console::read): Fix a compiler warning.

2005-06-10  Christopher Faylor  <cgf@timesys.com>

	* include/pthread.h: Change PTHREAD_MUTEX_DEFAULT to
	PTHREAD_MUTEX_NORMAL.  Revert PTHREAD_MUTEX_INITIALIZER to
	PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP since that is actually closer
	to what linux does.
	* thread.h (cw_cancel_action): New enum.
	(cancelable_wait): Use cw_cancel_action as third argument.
	* thread.cc (cancelable_wait): Ditto.  Don't wait for cancel if
	cancel_action == cw_no_cancel.
	(pthread::create): Don't wait for cancel event since that is racy.
	(pthread_mutex::pthread_mutex): Set default to PTHREAD_MUTEX_ERRORCHECK.
	(pthread_mutexattr::pthread_mutexattr): Ditto.
	(pthread_mutex::_lock): Tell cancelable_wait not to wait for
	cancellation event.
	(semaphore::_timedwait): Accommodate change in cancelable_wait args.
	(pthread::join): Ditto.

2005-06-10  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::sendto): Always initialize
	ret to 0.
	(fhandler_socket::sendmsg): Ditto.

2005-06-10  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (imaxabs): Export.
	(imaxdiv): Export.
	(llabs): Export.
	(lldiv): Export.
	(strtoimax): Export.
	(strtoumax): Export.
	* include/inttypes.h (imaxabs): Activate declaration.
	(imaxdiv): Ditto.
	(strtoimax): Ditto.
	(strtoumax): Ditto.
	* include/cygwin/version.h: Bump API minor.

2005-06-09  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::detach): Improve diagnostics for what should
	be an impossible failure condition.

2005-06-09  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (_local_storage::setmode_file): New element.
	(_local_storage::setmode_mode): New element.
	* tlsoffsets.h: Regenerate.
	* cygwin.din (setmode): Define as cygwin_getmode.
	* syscalls.cc (setmode_helper): Use setmode_* variables from tls rather
	than using unthreadsafe static.
	(setmode): Break out fwalk stuff.
	(cygwin_setmode): New function.  Put fwalk stdio stuff here.

2005-06-09  Christopher Faylor  <cgf@timesys.com>

	* thread.cc (pthread_mutex::_lock): Use cancelable_wait rather than
	WaitForSingleObject.

2005-06-09  Christopher Faylor  <cgf@timesys.com>

	* cygwin.sc: Place .cygwin_dll_common in a more sensible spot.

2005-06-09  Christopher Faylor  <cgf@timesys.com>

	* cygwin.sc: Place .cygwin_dll_common.
	* init.cc (threadfunc_ix): Use a more common name for the section name.

2005-06-09  Christopher Faylor  <cgf@timesys.com>

	* include/pthread.h (PTHREAD_MUTEX_INITIALIZER): Change to
	PTHREAD_NORMAL_MUTEX_INITIALIZER_NP to be closer to linux default.

2005-06-09  Christopher Faylor  <cgf@timesys.com>

	* thread.cc (cancelable_wait): No-op change to make sure that res is
	always a valid WFMO return.

2005-06-09  Christopher Faylor  <cgf@timesys.com>

	Change pthread::cancelable_wait to just cancelable_wait, throughout.
	* thread.h (cw_sig_wait): New enum.
	(fast_mutex::lock): Use cancelable_wait with resumable signal.
	(cancelable_wait): Change fourth argument to cw_sig_wait enum.
	* thread.cc (cancelable_wait): Ditto.  Loop on signal detection if
	fourth argument == cw_sig_resume.

2005-06-08  Christopher Faylor  <cgf@timesys.com>

	* cygwin.sc: Apparently nonloading sections need to go last.

2005-06-08  Christopher Faylor  <cgf@timesys.com>

	* cygwin.sc: Restore resource and reloc sections and use more modern
	syntax for stabs sections.

2005-06-08  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (spenvs): Remove cut/paste error which associated
	CYGWIN_DEBUG with HOME.

2005-06-08  Corinna Vinschen  <corinna@vinschen.de>

	* security.cc (cygwin_logon_user): Run LogonUser in the primary
	process token context.  Fix potential handle leak.

2005-06-07  Corinna Vinschen  <corinna@vinschen.de>

	* pinfo.cc (pinfo::init): Define sa_buf as PSECURITY_ATTRIBUTES and
	allocate dynamically.
	(pinfo::set_acl): Replace sa_buf by dynamically allocated acl_buf.
	* sec_acl.cc (setacl): Allocate acl dynamically.
	* sec_helper.cc (sec_acl): Add test for alignment of acl when
	DEBUGGING is defined.
	(__sec_user): Same for sa_buf.
	* security.cc (verify_token): Define sd_buf as PSECURITY_DESCRIPTOR
	and allocate dynamically.
	(alloc_sd): Allocate acl dynamically.
	security.h (sec_user_nih): Change first parameter to
	SECURITY_ATTRIBUTES *.
	(sec_user): Ditto.
	* sigproc.cc (wait_sig): Define sa_buf as PSECURITY_ATTRIBUTES and
	allocate dynamically.
	* syscalls.cc (seteuid32): Define dacl_buf as PACL and allocate
	dynamically.
	* uinfo.cc (cygheap_user::init): Define sa_buf as PSECURITY_ATTRIBUTES
	and allocate dynamically.
	* winbase.h (ilockincr): Mark first argument of inline assembly as
	earlyclobber.
	(ilockdecr): Ditto.

2005-06-07  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::detach): Make error message a little more
	detailed.
	* fhandler.cc (fhandler_base::raw_read): Ditto for debug message.
	* dcrt0.cc (do_exit): Add some more synchronization tests.
	* fhandler_fifo.cc (fhandler_fifo::dup): Don't duplicate a nonexistent
	handle.  Use derived return value rather than always retuning 0.
	* fhandler_netdrive.cc (fhandler_netdrive::exists): Wnet -> WNet.
	* winsup.h (exit_states): Add a couple of new exit states.

2005-06-06  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (symlink_info::check): If GetFileAttributes returns
	with ERROR_SHARING_VIOLATION, the file exists.

2005-06-06  Corinna Vinschen  <corinna@vinschen.de>

	* uname.cc (uname): Change "amd64" to "x86_64" as on Linux.

2005-06-06  Corinna Vinschen  <corinna@vinschen.de>

	* uname.cc (uname): Add missing break.

2005-06-05  Christopher Faylor  <cgf@timesys.com>

	* Makefile.in: Build sync.o with -fomit-frame-pointer and -O3.

2005-06-05  Christopher Faylor  <cgf@timesys.com>

	* sync.cc (muto::acquire): Remove unneeded brackets and fix whitespace.

2005-06-04  Christopher Faylor  <cgf@timesys.com>

	* malloc.cc: Update to Doug Lea's malloc v2.8.0.

2005-06-03  Max Kaehn <slothman@electric-cloud.com>

	* dcrt0.cc (cygwin_dll_init): Initialize main_environ and cygtls.  Add
	comment to explain the caveats of this method.
	* how-cygtls-works.txt: New file.

2005-06-02  Christopher Faylor  <cgf@timesys.com>

	* dlfcn.cc (get_full_path_of_dll): Use a relative path when converting
	so that the standard Windows rules for finding a library will be used
	if no path is given.  Stop explicitly searching /usr/bin since that is
	now in effect.

2005-06-01  Christopher Faylor  <cgf@timesys.com>

	Revert 2005-05-30 close_all_files changes.
	* spawn.cc (spawn_guts): When execing, close all files after the child
	has synced with us.

2005-06-01  Christopher Faylor  <cgf@timesys.com>

	* fhandler_disk_file.cc (fhandler_disk_file::fchown): Make sure that
	disk open is called in case we're passed in a non-existent device.

2005-06-01  Christopher Faylor  <cgf@timesys.com>

	* include/machine/stdlib.h: New file.

2005-06-01  Christopher Faylor  <cgf@timesys.com>

	* thread.h (List_remove): Revert most of 2005-05-30 change.

2005-06-01  Christopher Faylor  <cgf@timesys.com>

	* cygwin.sc: Don't output .reloc or .rsrc sections.  Clean up stuff
	around .cygheap and use a workaround to get things working with newer
	(broken?) binutils.

2005-05-31  Christopher Faylor  <cgf@timesys.com>

	* cygheap.cc (cygheap_end): Remove bogus section attribute.
	* cygwin.sc: Make __cygheap_mid absolute.  Remove unused _cygheap_foo.

2005-05-30  Christopher Faylor  <cgf@timesys.com>

	* child_info.h (child_info::cygheap_h): Delete.
	(child_info::dwProcessId): New field.
	* cygheap.cc (init_cheap): Delete.
	(dup_now): Ditto.
	(cygheap_setup_for_child): Ditto.
	(cygheap_setup_for_child_cleanup): Ditto.
	(cygheap_fixup_in_child): Simplify.  Use new "child_copy" function to
	copy heap from parent.
	(_csbrk): Don't attempt allocation if within cygheap section.  Fix so
	that more than one allocation will succeed.
	(cygheap_init): Reset possibly-nonzero region to zero.
	* cygheap.h (cygheap_setup_for_child): Delete declaration.
	(cygheap_setup_for_child_cleanup): Ditto.
	(cygheap_start): Define as an array.
	* cygwin.sc: Modernize.  Remove unneeded sections.  Define cygheap
	here.
	* dcrt0.cc (do_exit): Reflect argument change to close_all_files.
	* dtable.cc (dtable::vfork_parent_restore): Ditto.
	* dtable.h: Ditto.
	* fhandler.h: Ditto.
	* fork.cc (fork_copy): Call ReadProcessMemory if there is no thread
	(indicating that we're execing).
	(fork_child): Don't mess with hParent.
	(fork_parent): Remove hParent stuff.  It happens earlier now.
	Remove call to cygheap_setup_for_child* stuff.
	(fork): Put child_info_stuff in grouped structure.  Issue error if
	parent handle is not set.
	(child_copy): New function.
	* sigproc.cc (child_info::child_info): Put cygheap settings here.  Set
	parent handle.
	(child_info::~child_info): Close parent handle if it exists.
	* spawn.cc (spawn_guts): Reorganize so that ciresrv is allocated at
	only the last minute so that cygheap changes are reflected.  Delete
	cygheap_setup* calls.
	* syscalls.cc (close_all_files): Add an argument to flag when the fd
	entry should be released.
	* winsup.h (close_all_files): Add an argument to close_all_files
	declaration.  Declare child_copy.

2005-05-30  Vaclav Haisman  <v.haisman@sh.cvut.cz>

	* thread.h (List_remove): Make node parameter const.  Use simple
	comparison and assignment rather than InterlockedCompareExchangePointer
	since access is already synchronized.

2005-05-30  Christopher Faylor  <cgf@timesys.com>

	* dlfcn.cc (set_dl_error): Use UNIX error rather than Windows error.

2005-05-29  Christopher Faylor  <cgf@timesys.com>

	* cygmagic: Remove debugging cruft missed on 2005-05-21.

2005-05-29  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (path_conv::check): Move component to function scope. Set
	PATH_RO only on *real* FH_NETDRIVEs or on non-FH_NETDRIVE virtual
	paths. Allow non-retrievable shares to be handled as files.

2005-05-29  Eric Blake  <ebb9@byu.net>

	* include/limits.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Always define.

2005-05-28  Christopher Faylor  <cgf@timesys.com>

	* thread.h (pthread_key::set): Inline.
	(pthread_key::get): Ditto.
	* thread.cc (pthread::set): Delete.
	(pthread::get): Ditto.

2005-05-28  Christopher Faylor  <cgf@timesys.com>

	* cygwin.din: Remove signal front end from pthread_[gs]etspecific.

2005-05-28  Christopher Faylor  <cgf@timesys.com>

	* fhandler_tty.cc (fhandler_tty_slave:tcflush): Use signed comparison.

2005-05-28  Christopher Faylor  <cgf@timesys.com>

	* times.cc (time_ms::usecs): Coerce comparison to signed or whole test
	is a no-op.

2005-05-27  Christopher Faylor  <cgf@timesys.com>

	* cygheap.h: Reference _cygheap_start via .cygheap section.

	* environ.cc: Fix force_into_environment typo throughout.
	(spenvs): Export CYGWIN_DEBUG if DEBUGGING.

2005-05-26  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/version.h: Bump DLL minor number to 18.

2005-05-25  Pierre Humblet  <pierre.humblet@ieee.org>

	* fhandler.h (fhandler_base::mkdir): New virtual method.
	(fhandler_base::rmdir): Ditto.
	(fhandler_disk_file:mkdir): New method.
	(fhandler_disk_file:rmdir): Ditto.
	* dir.cc (mkdir): Implement with fhandlers.
	(rmdir): Ditto.
	* fhandler.cc (fhandler_base::mkdir): New virtual method.
	(fhandler_base::rmdir): Ditto.
	(fhandler_disk_file::mkdir): New method.
	(fhandler_disk_file::rmdir): Ditto.

2005-05-24  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/version.h: Bump API minor number to 129.

2005-05-24  Christopher Faylor  <cgf@timesys.com>

	* cygwin.din: Export mkdtemp.
	* mktemp.cc: New file.
	* Makefile.in (DLL_OFILES): Add mktemp.o

2005-05-23  Eric Blake  <ebb9@byu.net>

	* include/stdint.h (INTMAX_C, UINTMAX_C): Fix definition.

2005-05-21  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (find_exec): Accept a PATH-like string in place of an
	environment variable.
	* dlfcn.cc (get_full_path_of_dll): Search /usr/bin (for windows
	compatibility) and /usr/lib (for UNIX compatibility) when looking for
	shared libraries.
	* environ.cc (conv_envvars): Put back LD_LIBRARY_PATH since it is used
	by get_full_path_of_dll().
	* errno.cc (errmap): Map MOD_NOT_FOUND to ENOENT.

	* cygmagic: Remove debugging cruft.

2005-05-19  Corinna Vinschen  <corinna@vinschen.de>

	* include/cygwin/in.h: Add comment.

2005-05-19  Corinna Vinschen  <corinna@vinschen.de>

	* include/cygwin/in.h: Define IPPROTO_xxx values as macros to
	accommodate SUSv3.

2005-05-19  Christopher Faylor  <cgf@timesys.com>

	* include/limits.h: Include features.h, as on linux.

2005-05-19  Christopher Faylor  <cgf@timesys.com>

	* include/endian.h: New file.

2005-05-19  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.sc: Add Dwarf-2 debug sections.

2005-05-19  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (mmap64): Make granularity an automatic variable.

2005-05-19  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (fhandler_cygdrive::seekdir): Delete declaration.
	(fhandler_cygdrive::seekdir): Delete.

2005-05-19  Pierre Humblet  <pierre.humblet@ieee.org>

	* fhandler.h (fhandler_cygdrive::iscygdrive_root): Delete method.
	(fhandler_cygdrive::telldir): Delete declaration.
	* fhandler_disk_file.cc: Remove all uses of
	fhandler_cygdrive::iscygdrive_root.
	(fhandler_disk_file::mkdir): New method.
	(fhandler_disk_file::rmdir): Ditto.
	(fhandler_cygdrive::telldir): Delete.

2005-05-18  Christopher Faylor  <cgf@timesys.com>

	* external.cc: Move pids declaration to file scope and use less
	enthusiastic constructor.
	* pinfo.h (winpids::winpids): Remove default setting.
	* fhandler_fifo.cc (fhandler_fifo::open_not_mine): Accommodate removal
	of default setting.
	* fhandler_proc.cc (fhandler_proc::readdir): Ditto.

2005-05-18  Christopher Faylor  <cgf@timesys.com>

	* cygtls.h (_local_storage::unknown_thread_name): New buffer.
	* tlsoffsets.h: Regenerate.
	* cygthread.cc (cygthread::name): Use new thread-local buffer.
	* exceptions.cc (handle_exceptions): Avoid unnecessary initialization
	of static variables to zero.
	* fork.cc (slow_pid_reuse) Ditto.

2005-05-18  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (mmap64): Avoid compiler warning.
	* ntea.cc (NTReadEA): Ditto.
	* hires.h (hires_base): Remove useless usecs function.

2005-05-18  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_netdrive.cc (fhandler_netdrive::telldir): Remove since it's
	equivalent to fhandler_virtual::telldir now anyway.
	* fhandler.h (class fhandler_netdrive): Remove telldir.

2005-05-18  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_netdrive.cc (fhandler_netdrive::telldir): Implement.
	(fhandler_netdrive::seekdir): Implement.
	(fhandler_netdrive::closedir): Call rewinddir to have only one point
	of calling WNetCloseEnum.

2005-05-17  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_netdrive): Add method rewinddir.
	* fhandler_netdrive.cc (struct netdriveinf): New structure to
	store thread arguments.
	(thread_netdrive): Thread handling all potentially blocking
	WNet... calls.
	(create_thread_and_wait): Start and wait for above thread.
	(fhandler_netdrive::exists): Change to call create_thread_and_wait
	instead of calling WNet... function.
	(fhandler_netdrive::readdir): Ditto.  Fix error handling.
	(fhandler_netdrive::rewinddir): New method.

2005-05-17  Corinna Vinschen  <corinna@vinschen.de>

	* external.cc (cygwin_internal): Avoid compiler warning.

2005-05-16  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (dll_crt0_0): Don't do fixup_after_exec if dynamically
	loaded since the state of fds is unknown at this point.

2005-05-16  Christopher Faylor  <cgf@timesys.com>

	* include/sys/cygwin.h (enum cygwin_getinfo_types): Add CW_DEBUG_SELF.
	* external.cc (cygwin_internal): Implement CW_DEBUG_SELF.

	* init.cc (dll_entry): Minor rearrangement of code.

2005-05-16  Christopher Faylor  <cgf@timesys.com>

	* path.cc (path_conv::check): Remove embedded dots before slashes.

2005-05-16  Corinna Vinschen  <corinna@vinschen.de>

	* environ.cc (conv_envvars): Remove LD_LIBRARY_PATH entirely.
	It doesn't belong here.

2005-05-15  Corinna Vinschen  <corinna@vinschen.de>

	* environ.cc (conv_envvars): Treat LD_LIBRARY_PATH as path list.

2005-05-14  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Check
	return code from GetFileSize and set file size to 0 if necessary.
	* fhandler_netdrive.cc (fhandler_netdrive::fstat): Set permissions
	to read/execute for all.

2005-05-13  Christopher Faylor  <cgf@timesys.com>

	* path.cc (normalize_posix_path): Do normalization on .  and ..  after
	a '//'.

2005-05-13  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_netdrive::readdir): Remove useless comment.

2005-05-13  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc (WNetGetResourceParentA): Import.
	(WNetOpenEnumA): Import.
	(WNetEnumResourceA): Import.
	(WNetCloseEnum): Import.
	* fhandler.h (fhandler_netdrive::telldir): Add declaration.
	(fhandler_netdrive::seekdir): Ditto.
	(fhandler_netdrive::closedir): Ditto.
	* fhandler_netdrive.cc: Drop explicit including windows.h.  Include
	winnetwk.h instead of shlwapi.h.  Include dirent.h.
	(fhandler_netdrive::readdir): Implement.
	(fhandler_netdrive::telldir): New method.
	(fhandler_netdrive::seekdir): New method.
	(fhandler_netdrive::closedir): Ditto.

2005-05-13  Christopher Faylor  <cgf@timesys.com>

	Remove PC_FULL from path_conv usage throughout.
	* path.h (enum pathconv_arg): Change PC_FULL to PC_NOFULL.
	* path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL.
	(cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path.

2005-05-13  Christopher Faylor  <cgf@timesys.com>

	* fhandler_netdrive.cc (fhandler_netdrive::exists): Assert that "//"
	exists.

2005-05-12  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (_cygtls::remove): Eliminate compiler warning.

	* dir.cc (mkdir): Check path for writability.
	(rmdir): Ditto.  Remove check for special directories.
	* path.cc (path_conv::check): Set PATH_RO for virtual devices.  Set
	error if read-only and asked for writability.
	* path.h (pathconv_arg): Add PC_WRITABLE.
	(path_types): Add PATH_RO.
	(path_conv::isro): Add (currently unused) check for read-only
	filesystem.  Return "ENOSHARE" when we know a share doesn't exist.
	* include/sys/mount.h: Add MOUNT_RO flag.
	* autoload.cc (WNetGetResourceInformationA): Import.
	* fhandler_netdrive.cc (fhandler_netdrive::exists): Detect actual
	existence of remote system rather than always assuming that it exists.

2005-05-11  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (do_global_dtors): Don't call dll_global_dtors here.
	(__main): Reinstate atexit of do_global_dtors.
	(cygwin_exit): Call dll_global_dtors here.
	(do_exit): And here.


2005-05-10  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (_cygtls::remove): Clear exitsock after close.
	* fhandler_console.cc (fhandler_console::write_normal): Store character
	in a local variable for potential future inspection.

2005-05-10  Corinna Vinschen  <corinna@vinschen.de>

	* Makefile.in (DLL_OFILES): Add fhandler_mailslot.o.
	* devices.h (FH_KMSG): Define new device.
	* devices.in: Add "/dev/kmsg" entry.
	* devices.cc: Regenerate.
	* dtable.cc (build_fh_pc): Handle case FH_KMSG.
	* fhandler.h (class fhandler_mailslot): New class.
	(class select_stuff): Add device_specific_mailslot pointer.
	* fhandler_mailslot.cc: New file.
	* select.cc (peek_mailslot): New function.
	(verify_mailslot): Ditto.
	(struct mailslotinf): New stuct to handle select on mailslots.
	(thread_mailslot): New function.
	(start_thread_mailslot): Ditto.
	(mailslot_cleanup): Ditto.
	(fhandler_mailslot::select_read): New method.
	* syslog.cc (klog_guard): New muto.
	(dev_kmsg): Local mailslot for kernel message device.
	(vklog): New function.
	(klog): Ditto.
	* winsup.h (vklog): Declare.
	(klog): Ditto.
	* include/sys/syslog.h: Define _PATH_KLOG.

2005-05-10  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (dll_crt0_1): Call cygwin_exit to ensure that destructors
	are handled correctly.

2005-05-10  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (path_conv::check): Set correct file attributes for socket
	files.

2005-05-09  Pierre Humblet <pierre.humblet@ieee.org>

	* fhandler.h (class fhandler_netdrive): New class.
	* fhandler_netdrive.cc (fhandler_netdrive::fhandler_netdrive): New constructor.
	(fhandler_netdrive::exists): New method.
	(fhandler_netdrive::fstat): Ditto.
	(fhandler_netdrive::readdir): Ditto.
	(fhandler_netdrive::open): Ditto.
	* dtable.cc (build_fh_pc): Handle case FH_NETDRIVE.
	* path.cc (isvirtual_dev): Add FH_NETDRIVE.
	(mount_info::conv_to_win32_path): Detect netdrive device and bypass mount
	search for network paths.

2005-05-08  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (get_cygwin_startup_info): New function pulled from
	dll_crt0_0.
	(dll_crt0_0): Use get_cygwin_startup_info to retrieve cygwin-specific
	startup pointer.
	* external.cc (cygwin_internal): Implement CW_ARGV and CW_ENVP.
	* include/sys/cygwin.h: Implement CW_ARGV and CW_ENVP.

2005-05-07  Christopher Faylor  <cgf@timesys.com>

	* path.cc (normalize_posix_path): Don't treat '//' specially since
	newer versions of bash now get this right.

2005-05-07  Christopher Faylor  <cgf@timesys.com>

	* devices.cc: Regenerate with correct name for dev_netdrive_storage.

2005-05-06  Christopher Faylor  <cgf@timesys.com>

	* Makefile.in (DLL_O_FILES): Add fhandler_netdrive.o.
	* fhandler_netdrive.cc: Placeholder file for future development.
	* devices.h (FH_NETDRIVE): Define new virtual device type.
	(netdrive_dev): Define.
	* devices.in (dev_netdrive_storage): Define.
	* devices.cc: Regenerate.

2005-05-04  Corinna Vinschen  <corinna@vinschen.de>

	* cygerrno.h (__set_errno): Remove useless parentheses.

2005-05-04  Corinna Vinschen  <corinna@vinschen.de>

	* cygerrno.h (__set_errno): Define as inline function here.
	(set_errno): Always define as call to __set_errno.
	* debug.cc (__set_errno): Move to cygerrno.h.

2005-05-03  Christopher Faylor  <cgf@timesys.com>

	* shared.cc (user_shared_initialize): Rework locking so that nothing is
	checked until cb is non-zero.

2005-05-03  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't treat
	inability to open file as failure if only SetFileAttributes is
	going to be called.  Only call set_file_attribute if really necessary.

2005-05-03  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (get_inet_addr): Add missing __seterrno call.

2005-05-01  Christopher Faylor  <cgf@timesys.com>

	* fhandler_tty.cc (fhandler_tty_slave::read): Actually read input when
	vmin == vtime == 0.

2005-04-30  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (spenv::force_into_environment): Rename from add_always.
	(spenv::add_if_exists): Rename from force.
	(build_env): Accommodate name changes.  Make sure that stuff that is
	always supposed to be in the environment is actually added to the
	environment.

	* shared.cc (open_shared): Restore VirtualFree eliminated by 2005-04-28
	change.

2005-04-30  Christopher Faylor  <cgf@timesys.com>

	* errno.cc (errmap): Sort table.

2005-04-29  Christopher Faylor  <cgf@timesys.com>

	* errno.cc (errmap): Map ERROR_NETNAME_DELETED to ENOSHARE.

2005-04-28  Corinna Vinschen  <corinna@vinschen.de>

	* shared_info.h (cygwin_shared_address): Bump to a higher value to avoid
	collision with large data areas.

2005-04-28  Christopher Faylor  <cgf@timesys.com>

	* fhandler_console.cc (fhandler_console::get_tty_stuff): Accommodate
	changes to open_shared arguments.
	* fhandler_tape.cc (mtinfo_init): Ditto.
	* pinfo.cc (pinfo::init): Use open_shared rather than win32 mmap calls.
	* shared.cc (user_shared_initialize): Ditto.
	(memory_init): Ditto.
	(open_shared): Change to allow use a smore general mmap handler.
	* shared_info.h (shared_locations): Add SH_JUSTCREATE, SH_JUSTOPEN.
	(open_shared): Change declaration to match new usage.

	* autoload.cc (LoadDLLfuncEx2): Define in terms of LoadDLLfuncEx3.
	(LoadDLLfuncEx3): New macro.

2005-04-27  Christopher Faylor  <cgf@timesys.com>

	* fhandler.cc (fhandler_base::open_9x): Remove (broken) check for
	O_CREAT|O_EXCL.
	* syscalls.cc (open): Do O_CREAT|O_EXCL check here first.

2005-04-26  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (build_env): Ensure that win32 array is properly filled in
	when a missing value has to be generated.

2005-04-26  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/version.h: Bump DLL minor number to 17.

2005-04-24  Pavel Tsekov <ptsekov@gmx.net>

	* how-to-debug-cygwin.txt: Fix typo.

2005-04-22  Christopher Faylor  <cgf@timesys.com>

	* shared.cc (user_shared_initialize): Implement locking similar to
	shared_info when initializing shared region.

2005-04-22  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (dev_console::set_color): Define new function.
	(dev_console::set_default_attr): Ditto, moved from fhandler_console.
	(dev_console::fillin_info): Ditto.  Accommodate this change throughout
	this file.
	(fhandler_console::get_win32_attr): Eliminate.
	* fhandler_console.cc (fhandler_console::get_tty_stuff): Properly set
	default attributes on initialization.
	(fhandler_console::open): Set current attributes rather than default
	color on open.
	(fhandler_console::get_win32_attr): Eliminate.
	(dev_console::set_color): New function.  Move get_win32_attr stuff
	here.
	(dev_console::set_default_attr): New function, moved from
	fhandler_console.
	(dev_console::fillin_info): Ditto.
	(fhandler_console::char_command): Call set_color to set screen
	characteristics.

2005-04-22  Christopher Faylor  <cgf@timesys.com>

	* fhandler.cc (fhandler_base::read): Remove unused signal state tweaks.
	* fhandler.h (fhandler_pipe::create_selectable): Declare.
	(fhandler_fifo::close_one_end): Declare.
	* fhandler_fifo.cc (fhandler_fifo::close_one_end): Define.
	(fhandler_fifo::open_not_mine): Use close_one_end to close appropriate
	end of pipe.
	* pinfo.cc (_pinfo::commune_recv): Ditto.
	* pipe.cc (fhandler_pipe::create_selectable): Rename from
	create_selectable_pipe.  Reorganize.
	(fhandler_pipe::create): Use create_selectable.

2005-04-21  Christopher Faylor  <cgf@timesys.com>

	* shared.cc (shared_info::initialize): Test previous version of shared
	memory magic rather than current version when determining if there has
	been a shared memory mismatch.

2005-04-20  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (proc_subproc): Fix handling of waiting for pids with zero
	value.

	* strace.cc (strace::hello): Report parent pid of executing process.

2005-04-20  Christopher Faylor  <cgf@timesys.com>

	* path.cc (path_conv::check): Fix problem reading symlinks introduced
	in below change by reverting the change and adding an additional test
	for nonexistent files in /proc.

2005-04-20  Christopher Faylor  <cgf@timesys.com>

	* path.cc (path_conv::check): Punt when attempting to access a
	nonexistent directory or file in /proc.

2005-04-19  Corinna Vinschen  <corinna@vinschen.de>

	* security.cc (alloc_sd): Remove DELETE bit from user's ACE if
	allow_traverse is set.

2005-04-19  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (pselect): Export.
	* select.cc (pselect): New function.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/select.h: Include signal.h.  Declare pselect.

2005-04-18  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (enum conn_state): Add connect_failed state.
	* fhandler_socket.cc (fhandler_socket::connect): Set connect_state to
	connect_failed when connect failed.
	* poll.cc (poll): Change errno to EINVAL if allocating memory fails,
	according to SUSv3. Add socket descriptors always to except_fds. Test
	for failed connect and set revents flags appropriately.
	* select.cc (set_bits): Set connect_state to connect_failed when
	select indicates failed nonblocking connect.
	(fhandler_dev_null::select_except): Set except_ready to false so that
	/dev/null is not always in except state.
	(peek_socket): Fix bogus conditional.
	(fhandler_socket::select_write): Treat all connect_states except
	unconnected equivalent to return consistent results.
	(fhandler_windows::select_except): Set except_ready to false so that
	/dev/windows is not always in except state.

2005-04-18  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/version.h: Bump DLL minor number to 16.

2005-04-18  Pierre Humblet <pierre.humblet@ieee.org>

	* grp.cc (initgroups32): Return the correct value.

2005-04-16  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::utimes_fs): Ignore
	ERROR_NOT_SUPPORTED to workaround Win9x weirdness.
	* path.cc (symlink_info::check): Remap ERROR_INVALID_FUNTION to
	ERROR_FILE_NOT_FOUND for the same reason.

2005-04-16  Corinna Vinschen  <corinna@vinschen.de>
	    Pierre Humblet <pierre.humblet@ieee.org>

	* security.h (cygsidlist::addfromgr): Allow duplicate entries.
	(get_server_groups): Declare new function.
	* security.cc (is_group_member): Simplify.
	(get_server_groups): New function.
	(get_initgroups_sidlist): Call get_server_groups.
	(verify_token): Allow token when supplementary sids are not in
	/etc/group but are in the token.
	Streamline the code.
	* grp.cc (initgroups32): New implementation.
	(getgroups32): Handle case where the supplementary groups are set.

2005-04-16  Corinna Vinschen  <corinna@vinschen.de>

	* environ.cc (environ_init): Don't set traverse checking as default.

2005-04-16  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::utimes_fs): Drop touching
	ChangeTime.

2005-04-16  Christopher Faylor  <cgf@timesys.com>

	* fhandler.cc (fhandler::dup): Duplicate flags, too.
	* fhandler.h (fhandler_fifo::owner): Eliminate.
	* fhandler_disk_file.cc (fhandler_base::fstat_fs): Handle on-disk
	devices better.
	(fhandler_base::fstat_helper): Ditto.
	* fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Don't initialize
	obsolete "owner".
	(fhandler_fifo::open_not_mine): Add some debugging.  Duplicate correct
	handle when we own it.
	(fhandler_fifo::open): Set flags from input, not from first pipe.  Flag
	that fork fixup is needed.
	(fhandler_fifo::dup): Set errno correctly when DuplicateHandle fails.
	* pinfo.cc (commune_send): Add debugging for fifo.

	* cygwin/version.h: Bump API minor version to 127 to reflect exporting
	of sigrelese.

2005-04-14  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>

	* syscalls.cc (setuid32): Correct debugging output.

2005-04-14  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (do_global_dtors): Run DLL dtors.
	(__main): Don't rely on atexit to run dtors.
	(do_exit): Specifically call do_global_dtors here.
	(cygwin_exit): Ditto.
	* dll_init.cc (dll_global_dtors): Make global.  Only run dtors once.
	(dll_list::init): Just set flag that dtors should be run.  Don't rely on atexit.
	* dll_init.h (dll_global_dtors): Declare.

	* exceptions.cc (sigrelse): Define.

	* path.h (is_fs_device): New method.
	(is_lnk_special): Ditto.
	* fhandler_disk_file.cc (fhandler_disk_file::link): Use
	"is_lnk_special" rather than "is_lnk_symlink".
	* syscalls.cc (rename): Ditto.

	* hookapi.cc (ld_preload): Use colon as a separator rather than space.

2005-04-13  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_socket): Remove utimes.
	* fhandler_socket.cc (fhandler_socket::utimes): Remove.

2005-04-13  Corinna Vinschen  <corinna@vinschen.de>

	* cygerrno.h (__seterrno_from_nt_status): Define. Always set Win32
	error code as well as errno. Use throughout where errno is set from
	NT status.
	(set_errno): Evaluate val only once.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fix typo in
	debug output.
	* fhandler_mem.cc (fhandler_dev_mem::open): Rely on
	__seterrno_from_nt_status setting Win32 error code in debug output.
	* fhandler_proc.cc (format_proc_uptime): Ditto.
	(format_proc_stat): Ditto.
	* fhandler_process.cc (format_process_stat): Ditto.
	* sysconf.cc (sysconf): Ditto.

2005-04-13  Christopher Faylor  <cgf@timesys.com>

	* fhandler.h (fhandler_base::utimes_fs): New method.
	* fhandler.cc (fhandler_base::utimes): Call utimes_fs if on-disk
	special file.
	* fhandler_disk_file.cc (fhandler_disk_file::utimes): Use utimes_fs.
	(fhandler_base::utimes_fs): Handle on-disk device files.

2005-04-13  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::utimes): Don't set errno
	if open fails, it has already been set by open.

2005-04-12  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc (NtQueryVolumeInformationFile): Add.
	* fhandler.cc (fhandler_base::raw_write): Don't touch has_changed flag.
	* fhandler.h (enum change_state): Remove.
	(fhandler_base::status): Revert has_changed to a simple bit.
	(fhandler_base::fstat_helper): Add nAllocSize parameter.  Rename
	ftCreationTime to ftChangeTime.
	* fhandler_disk_file.cc: Call fstat_helper with additional
	allocation size throughout.
	(fhandler_base::fstat_by_handle): Use NT native functions to get
	full file information on NT.  Call fstat_helper with LastWriteTime
	as ctime, if ChangeTime is not available.
	(fhandler_base::fstat_by_name): Call fstat_helper with LastWriteTime
	as ctime.
	(fhandler_base::fstat_helper): Add comment. Drop special FAT
	handling since it's useless. Use nAllocSize for st_blocks if available.
	(fhandler_disk_file::touch_ctime): Only touch LastWriteTime.
	(fhandler_disk_file::fchmod): Set has_changed on 9x only.
	(fhandler_disk_file::fchown): Don't set has_changed.
	(fhandler_disk_file::facl): Ditto.
	(fhandler_disk_file::ftruncate): Ditto.
	(fhandler_disk_file::link): Set has_changed on 9x only and on original
	file only.
	(fhandler_base::open_fs): Don't set has_changed in O_TRUNC case.
	* ntdll.h (FILE_BASIC_INFORMATION): Define.
	(FILE_STANDARD_INFORMATION): Define.
	(FILE_INTERNAL_INFORMATION): Define.
	(FILE_EA_INFORMATION): Define.
	(FILE_ACCESS_INFORMATION): Define.
	(FILE_POSITION_INFORMATION): Define.
	(FILE_MODE_INFORMATION): Define.
	(FILE_ALIGNMENT_INFORMATION): Define.
	(FILE_NAME_INFORMATION): Don't define with arbitrary FileName size.
	(FILE_ALL_INFORMATION): Define.
	(FILE_INFORMATION_CLASS): Add FileAllInformation.
	(FILE_FS_VOLUME_INFORMATION): Define.
	(FS_INFORMATION_CLASS): Define.
	(NtQueryVolumeInformationFile): Define.

2005-04-11  Corinna Vinschen  <corinna@vinschen.de>

	Revert previous patch.
	* autoload.cc (GetVolumePathNamesForVolumeNameA): Remove.
	(GetVolumeNameForVolumeMountPointA): Add.
	* syscalls.cc (sync): Rewrite guid case to skip floppies also on
	Windows 2000.

2005-04-11  Corinna Vinschen  <corinna@vinschen.de>

	* syscalls.cc (sync): Use renamed has_get_volume_pathnames wincap.
	* wincap.h (wincaps::has_get_volume_pathnames): Rename from
	has_guid_volumes
	* wincap.cc: Accommodate above rename throughout.  Set to false on
	Windows 2000.

2005-04-08  Christopher Faylor  <cgf@timesys.com>

	* pipe.cc (fhandler_pipe::open): Remove O_CREAT limitation.

2005-04-07  Corinna Vinschen  <corinna@vinschen.de>

	* syslog.cc (try_connect_guard): Remove useless conditionalized code.

2005-04-07  Corinna Vinschen  <corinna@vinschen.de>

	* syslog.cc: Include sys/socket.h.
	(try_connect_guard): New static variable.
	(syslogd_inited): Ditto.
	(syslogd_sock): Ditto.
	(try_connect_syslogd): New function to connect and write syslog to
	local syslogd.
	(vsyslog): Log to stderr if LOG_PERROR flag has been given to openlog.
	Try logging to syslogd.  Use Event Log resp. log file as fallback.
	(closelog): Close socket to syslogd.
	* include/sys/syslog.h (_PATH_LOG): Define.
	(INTERNAL_NOPRI): Define if SYSLOG_NAMES is defined.
	(INTERNAL_MARK): Ditto.
	(struct _code): Ditto.
	(prioritynames): Ditto.
	(facilitynames): Ditto.

2005-04-06  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (get_inet_addr): Add type parameter to return
	unix socket type.  Read socket type from unix socket file.
	(fhandler_socket::bind): Write socket type to unix socket file.
	(fhandler_socket::connect): Return with errno EPROTOTYPE if
	socket type of socket doesn't match socket type of unix socket
	trying to connect to.

2005-04-06  Pierre Humblet <pierre.humblet@ieee.org>

	* security.h (cygsidlist::addfromgr): Avoid duplicate entries.
	* grp.cc (initgrousp): Add syscall_printf.
	(setgroups): Add syscall_printf and make sure sids are added only once.

2005-04-06  Christopher Faylor  <cgf@timesys.com>

	* net.cc (cygwin_getservbyname): Return (possibly NULL) return value of
	dup_ent rather than assuming that tls buffer is valid.
	(cygwin_getservbyport): Ditto.
	(cygwin_gethostbyname): Ditto.
	(cygwin_gethostbyaddr): Ditto.

2005-04-05  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (_cygtls::remove): Don't free or close stuff if we're being
	called in a "non-standard" way.

2005-04-05  Christopher Faylor  <cgf@timesys.com>

	* sync.h (muto::initforce): Delete flawed implementation.
	* pwdgrp.h (pwdgrp::pglock): Make static.
	* grp.cc (pwdgrp::pwdgrp): Eliminate use of initforce.

2005-04-05  Christopher Faylor  <cgf@timesys.com>

	* sync.h (muto::initforce): Force initialization even when name !=
	NULL.
	* grp.cc (pwdgrp::pwdgrp): Use initforce since the enclosing structure
	is !NO_COPY.

2005-04-05  Christopher Faylor  <cgf@timesys.com>

	* sync.h (muto::operator int): New operator.
	(locker): Remove unused class.
	(new_muto): Delete.
	(new_muto1): Ditto.
	(new_muto_name): Ditto.
	* cygheap.cc (cygheap_setup_for_child): Reflect use of static storage
	for muto rather than pointer.
	(_csbrk): Ditto.
	(_cmalloc): Ditto.
	(_cmalloc): Ditto.
	(_cfree): Ditto.
	* cygheap.h (cwdstuff::cwd_lock): Ditto.
	(cwdstuff::get_drive): Ditto.
	* cygmalloc.h (__malloc_lock): Ditto.
	(__malloc_unlock): Ditto.
	* cygtls.cc (sentry::lock): Ditto.
	(sentry::sentry): Ditto.
	(~sentry): Ditto.
	(_cygtls::init): Ditto.
	* dcrt0.cc: Ditto.
	(cygwin_atexit): Ditto.
	(cygwin_exit): Ditto.
	* debug.cc (lock_debug::locker): Ditto.
	(lock_debug::lock_debug): Ditto.
	(lock_debug::unlock): Ditto.
	(debug_init): Ditto.
	* dtable.cc (dtable::init_lock): Ditto.
	* dtable.h (dtable::lock_cs): Ditto.
	(dtable::lock): Ditto.
	(dtable::unlock): Ditto.
	* exceptions.cc (mask_sync): Ditto.
	(sighold): Ditto.
	(set_process_mask_delta): Ditto.
	(set_signal_mask): Ditto.
	(events_init): Ditto.
	* grp.cc (pwdgrp::pwdgrp): Ditto.
	* malloc_wrapper.cc (mallock): Ditto.
	(malloc_init): Ditto.
	* path.cc (cwdstuff::cwd_lock): Ditto.
	(cwdstuff::get_hash): Ditto.
	(cwdstuff::get_hash): Ditto.
	(cwdstuff::init): Ditto.
	(cwdstuff::set): Ditto.
	(cwdstuff::get): Ditto.
	* pwdgrp.h (pwdgrp::pglock): Ditto.
	(pwdgrp::refresh): Ditto.
	* sigproc.cc (sync_proc_subproc): Ditto.
	(get_proc_lock): Ditto.
	(proc_subproc): Ditto.
	(_cygtls::remove_wq): Ditto.
	(proc_terminate): Ditto.
	(sigproc_init): Ditto.
	* timer.cc (lock_timer_tracker::protect): Ditto.
	(lock_timer_tracker::lock_timer_tracker): Ditto.
	(lock_timer_tracker::~lock_timer_tracker): Ditto.
	* wininfo.cc (wininfo::_lock;): Ditto.
	(wininfo::winthread): Ditto.
	(operator HWND): Ditto.
	(wininfo::lock): Ditto.
	(wininfo::release): Ditto.
	* wininfo.h (wininfo::_lock;): Ditto.

2005-04-04  Christopher Faylor  <cgf@timesys.com>

	* path.cc (path_conv::check): Only check for PC_NO_ACCESS_CHECK in end
	component.

2005-04-04  Corinna Vinschen  <corinna@vinschen.de>

	* dcrt0.cc (dll_crt0_1): Don't call set_cygwin_privileges on 9x.

	* fhandler.h (enum change_state): Add.
	(fhandler_base::status): Add a bit to has_changed flag.
	(fhandler_base::has_changed): Implement with type change_state.
	* fhandler.cc (fhandler_base::raw_write): Accommodate type change
	of has_changed.
	* fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): Also
	touch modification time if has_changed == data_changed.
	(fhandler_disk_file::fchmod): Also open on 9x, otherwise we can't
	touch ctime.  Accommodate type change of has_changed.
	(fhandler_disk_file::fchown): Accommodate type change of has_changed.
	(fhandler_disk_file::facl): Ditto.
	(fhandler_disk_file::ftruncate): Ditto.
	(fhandler_disk_file::link): Ditto.
	(fhandler_base::open_fs): Ditto.

2005-04-03  Corinna Vinschen  <corinna@vinschen.de>

	* cygheap.cc (cygheap_init): Accommodate set_process_privilege change.
	* cygheap.h (cygheap_user::curr_primary_token): New member.
	(cygheap_user::primary_token): New method.
	(cygheap_user::deimpersonate): Always revert to processes'
	impersonation token.
	(cygheap_user::reimpersonate): Set processes' or setuid token as
	necessary.
	(cygheap_user::has_impersonation_tokens): Look for curr_primary_token
	value.
	(cygheap_user::close_impersonation_tokens): Close curr_primary_token
	here if necessary.  Don't reset token values to NO_IMPERSONATION since
	that's done in uinfo_init anyway.
	(init_cygheap::luid): New LUID array keeping privilege LUIDs.
	* cygtls.cc (_cygtls::init_thread): Call cygheap->user.reimpersonate.
	* dcrt0.cc (hProcToken): New global variable to keep process token.
	(hProcImpToken): Ditto for process impersonation token.
	(dll_crt0_0): Open process token here once.  Duplicate to create
	hProcImpToken.
	(dll_crt0_1): Call set_cygwin_privileges.
	* environ.cc (allow_ntea): Drop duplicate declaration.
	(allow_smbntsec): Ditto.
	(set_traverse): Only set allow_traverse here.
	(environ_init): Ditto.
	* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Drop call to
	enable_restore_privilege.
	(fhandler_disk_file::fchown): Ditto.
	(fhandler_disk_file::facl): Ditto.
	* fork.cc (fork_child): Move call to cygheap->user.reimpersonate after
	syn with parent. Call set_cygwin_privileges.
	* grp.cc (internal_getgroups): Use hProcImpToken instead of opening
	process token.
	* path.cc (fs_info::update): Bypass traverse checking when retrieving
	volume information using push/pop_thread_privileges.
	* registry.cc (load_registry_hive): Drop setting restore privilege
	since it's already set if available.
	* sec_helper.cc: Include cygtls.h.
	(cygpriv): Privilege string array.
	(privilege_luid): New function, evaluate LUID from cygpriv_idx.
	(privilege_luid_by_name): New function, evaluate LUID from privilege
	string.
	(privilege_name): New function, evaluate privilege string from
	cygpriv_idx.
	(set_privilege): New static function called by set_process_privilege
	and set_thread_privilege.  Call privilege_luid to get privilege LUID.
	Fix bug in return value evaluation. Improve debug output.
	(set_cygwin_privileges): New function.
	(set_process_privilege): Remove.
	(enable_restore_privilege): Remove.
	* security.cc (allow_traverse): New global variable.
	(sys_privs): Change type to cygpriv_idx and store privilege indices
	instead of strings.
	(SYSTEM_PRIVILEGES_COUNT): Renamed from SYSTEM_PERMISSION_COUNT.
	(get_system_priv_list): Don't use numerical constant in malloc call.
	Use privilege_luid to get privilege LUIDs.
	(get_priv_list): Call privilege_luid_by_name to get LUIDs. Improve
	inner privilege LUID comparison loop.
	(create_token): Enable create token privilege using
	push/pop_self_privileges. Use hProcToken instead of opening process
	token. Use default DACL when duplicating token.
	(subauth): Enable tcb privilege using push/pop_self_privileges.
	Use sec_none instead of homw made security attributes when duplicating
	token.
	(check_file_access): Don't duplicate access token, use active
	impersonation token as is.
	* security.h (enum cygpriv_idx): New enumeration type enumerating
	possible privileges.
	(privilege_luid): Declare new function.
	(privilege_luid_by_name): Ditto.
	(privilege_name): Ditto.
	(allow_traverse): Declare.
	(set_privilege): Declare function.
	(set_process_privilege): Define as macro.
	(enable_restore_privilege): Remove declaration.
	(_push_thread_privilege): Define macro.
	(push_thread_privilege): Ditto.
	(pop_thread_privilege): Ditto.
	(pop_self_privilege): Ditto.
	* spawn.cc (spawn_guts): Use cygheap->user.primary_token instead of
	cygheap->user.token.
	* syscalls.cc (statvfs): Bypass traverse checking when retrieving
	volume information using push/pop_thread_privileges. Rearrange code
	to simplify push/pop bracketing.
	(seteuid32): Use hProcToken instead of opening process token. Call
	cygheap->user.deimpersonate instead of RevertToSelf.  Create
	impersonation token from primary internal or external token.  Set
	cygheap->user.curr_primary_token and cygheap->user.current_token
	privileges once here.  Drop "failed" and "failed_ptok" labels.
	Drop setting DefaultDacl of process token.
	(setegid32): Use hProcToken and hProcImpToken instead of opening
	process token. Always reimpersonate afterwards.
	* uinfo.cc (cygheap_user::init): Use hProcToken instead of opening
	process token.
	(internal_getlogin): Ditto. Set hProcImpToken, too.
	(uinfo_init): Initialize cygheap->user.curr_primary_token.
	* winsup.h (hProcToken): Declare.
	(hProcImpToken): Declare.

2005-04-03  Corinna Vinschen  <corinna@vinschen.de>

	Unify usage of CYG_MAX_PATH throughout.  Change buffers from
	size CYG_MAX_PATH + 1 to CYG_MAX_PATH.  Change length tests
	accordingly.

2005-04-02  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/version.h: Bump DLL minor number to 15.

2005-04-01  Corinna Vinschen  <corinna@vinschen.de>

	* fork.cc (fork_child): Add missing __stdcall.

2005-04-01  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (create_signal_arrive): New (temporary?) function to
	create signal_arrived event.
	(sigproc_init): Use create_signal_arrived.
	* fork.cc (fork_child): Create signal_arrived early.

2005-04-01  Corinna Vinschen  <corinna@vinschen.de>

	* fork.cc (fork_child): Fixup SYSV IPC shared memory before fixing
	up fdtab.

2005-03-31  Corinna Vinschen  <corinna@vinschen.de>

	* gentls_offsets: Add '-m32' flag to native compiler call to satisfy
	cross platform builds.

2005-03-31  Corinna Vinschen  <corinna@vinschen.de>

	* errno.cc (NO_SYSTEM_RESOURCES): Map to EAGAIN.
	(NONPAGED_SYSTEM_RESOURCES): Ditto.
	(PAGED_SYSTEM_RESOURCES): Ditto.
	(WORKING_SET_QUOTA): Ditto.
	(PAGEFILE_QUOTA): Ditto.
	(COMMITMENT_LIMIT): Ditto.

2005-03-30  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (spenvs): Re-force SYSTEMROOT to always be included in
	environment.
	(build_env): Ditto.

2005-03-30  Christopher Faylor  <cgf@timesys.com>

	* environ.cc (spenv::retrieve): Revert most of previous change.
	(build_env): Ditto.  Rework to track environment variables which need
	to always be in the windows environment in a separate array.

2005-03-30  Igor Pechtchanski  <pechtcha@cs.nyu.edu>

	* path.cc (symlink_info::case_check): Ignore trailing characters
	in paths when comparing case.

2005-03-30  Christopher Faylor  <cgf@timesys.com>

	* environ.h (win_env::immediate): Declare new field.
	(win_env::operator = ): Declare new operator.
	(win_env::reset): Declare new function.
	(win_env::~win_env): Declare new destructor.
	(getwinenv): Add optional third argument to declaration.
	* environ.cc (conv_envvars): Accommodate immediate field.
	(win_env::operator =): Define new operator.
	(win_env::~win_env): Define new destructor.
	(win_env::add_cache): Add value to environment immediately if
	"immediate" is set.
	(getwinenv): Accept optional third argument which will be used to store
	"cached" values to avoid overwriting real cache.
	(spenv::force): Declare new field.
	(spenvs): Accommodate force field.  Add "PATH=" with force set to true.
	(spenv::retrieve): Avoid duping anything if we're not building an
	envblock.
	(build_env): Ditto.  Use size of potentially constructed new
	environment block to determine if we need to create an environment
	block.  Pass getwinenv temporary storage to avoid inappropriately
	overwriting the environment cache.

2005-03-29  Eric Blake  <ebb9@byu.net>

	* include/limits.h (NAME_MAX): New define.
	(PATH_MAX): POSIX allows PATH_MAX to include trailing NUL.

2005-03-29  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (is_floppy): Make externally available.
	* path.h (is_floppy): Declare.
	* syscalls.cc (sync): Check for floppies on A: and B: in guid case.
	Don't call setmntent in non-guid case but evaluate drive bit mask
	locally.

2005-03-29  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_process.cc: Re-add exename.

2005-03-28  Christopher Faylor  <cgf@timesys.com>

	* include/ctype.h: Accommodate building in newlib.

2005-03-28  Christopher Faylor  <cgf@timesys.com>

	* timer.cc (getitimer): Check that ovalue is a valid pointer, not just
	NULL.

2005-03-28  Christopher Faylor  <cgf@timesys.com>

	* timer.cc (timer_tracker::settime): Set times to zero when just
	cancelling a timer.

2005-03-28  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::detach): Revert to just waiting for thread
	event since waiting for anything else is racy.
	* timer.cc (timer_tracker::hcancel): Rename from cancel.
	(timer_tracker::cancel): New method.
	(timer_tracker::th): Remove.
	(timer_tracker::~timer_tracker): Call cancel method.
	(timer_tracker::timer_tracker): Ditto.
	(timer_tracker::timer_tracker): Always, clear cancel, even though it is
	probably not strictly necessary for ttstart.
	(timer_thread): Accommodate cancel -> hcancel rename.
	(timer_tracker::settime): Ditto.
	(timer_tracker::gettime): Ditto.
	(timer_delete): Ditto.

	* cygwin.din: Export _ctype_.
	* include/ctype.h: Mark that _ctype_ is imported.

2005-03-28  Christopher Faylor  <cgf@timesys.com>

	* timer.cc (timer_tracker::timer_tracker): Eliminate simple
	constructor.
	(ttstart): Fully initialize.

	* errno.cc: Fix typo introduced in previous change.

2005-03-28  Eric Blake  <ebb9@byu.net>

	* errno.cc (FILENAME_EXCED_RANGE): Map to ENAMETOOLONG.

2005-03-27  Christopher Faylor  <cgf@timesys.com>

	* signal.cc (nanosleep): Revert tv_sec < 0 check as it is fixed
	properly in the below change to hires.h.

2005-03-27  Pierre Humblet <pierre.humblet@ieee.org>

	* times.cc (hires_ms::usecs): Compare the difference.
	* hires.h: Add parentheses to HIRES_DELAY_MAX.

2005-03-26  Christopher Faylor  <cgf@timesys.com>

	* timer.cc (nanosleep): Treat tv_sec < 0 as invalid.

	* include/search.h: Make declarations consistent with newlib.

2005-03-26  Pierre Humblet <pierre.humblet@ieee.org>
	    Christopher Faylor <cgf@timesys.com>

	* wininfo.h (wininfo::timer_active): Delete.
	(wininfo::itv): Ditto.
	(wininfo::start_time): Ditto.
	(wininfo::window_started): Ditto.
	(wininfo::getitimer): Ditto.
	(wininfo::setitimer): Ditto.
	(wininfo::wininfo): Ditto.
	(wininfo::lock): New method.
	(wininfo::release): Ditto.
	* window.cc:  Use new lock/acquire wininfo methods throughout.
	 (wininfo::wininfo): Delete
	(wininfo::getitimer): Ditto.
	(wininfo::setitimer): Ditto.
	(getitimer): Ditto.
	(setitimer): Ditto.
	(ualarm): Ditto.
	(alarm): Ditto.
	(wininfo::lock): Define new function.
	(wininfo::release): Ditto.
	(wininfo::process): Delete WM_TIMER handling.
	* timer.cc (struct timetracker): Delete it, flags.  Add it_interval,
	interval_us, sleepto_us, running, init_muto(), syncthread, and
	gettime().
	(ttstart): Make NO_COPY.
	(lock_timer_tracker): New class.
	(timer_tracker::timer_tracker): Distinguish ttstart case.
	(timer_tracker::~timer_tracker): New destructor.  Clean out events, and
	reset magic.
	(timer_tracker::init_muto): New method.
	(to_us): Round up as per POSIX.
	(timer_thread): Reorganize to match timer_tracker::settime and
	timer_tracker::gettime.  Call sig_send without wait.  Call
	auto_release.
	(timer_tracker::settime): Reorganize logic to avoid race.  Call gettime
	to recover old value.
	(timer_tracker::gettime): New method.
	(timer_create): Properly set errno on invalid timerid.  Use new
	lock_timer_tracker method.
	(timer_delete): Ditto.  Simplify code slightly.
	(timer_gettime): New function.
	(fixup_timers_after_fork): Reinit ttstart.
	(getitimer): New implementation.
	(setitimer): Ditto.
	(ualarm): Ditto.
	(alarm): Ditto.
	* cygwin.din: Export timer_gettime.
	* winsup.h: Remove has has_visible_window_station declaration.

2005-03-26  Christopher Faylor  <cgf@timesys.com>

	* Makefile.in (DLL_OFILES): Add lsearch.o.
	* cygthread.h (cygthread::notify_detached): New element.
	(cygthread::cygthread): Take optional fourth argument signifying event
	to signal on thread completion.
	* cygthread.cc (cygthread::stub): Signal notify_detached event, if it
	exists.
	(cygthread::cygthread): Initialize notify_detached from fourth argument.
	(cygthread::detach): Wait for notify_detached field is present.

	* lsearch.cc: New file.
	* search.h: Ditto.
	* include/cygwin/version.h: Bump API minor number to 126.
	* cygwin.din: Export lsearch, lfind.

2005-03-23  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_socket::secret_event): Remove.
	(fhandler_socket::af_local_set_secret): New function combining former
	set_connect_secret and get_connect_secret into one function.
	(fhandler_socket::af_local_setblocking): Rename from eid_setblocking.
	(fhandler_socket::af_local_unsetblocking): Rename from
	eid_unsetblocking.
	(fhandler_socket::af_local_set_cred): New method.
	(fhandler_socket::af_local_copy): New method.
	(fhandler_socket::af_local_recv_secret): New method.
	(fhandler_socket::af_local_send_secret): New method.
	(fhandler_socket::af_local_recv_cred): Rename from eid_recv.
	(fhandler_socket::af_local_send_cred): Rename from eid_send.
	(fhandler_socket::af_local_accept): New method.
	(fhandler_socket::af_local_set_sockpair_cred): Rename from
	set_socketpair_eids.
	(fhandler_socket::eid_accept): Remove.
	(fhandler_socket::eid_connect): Remove.
	(fhandler_socket::set_connect_secret): Remove.
	(fhandler_socket::get_connect_secret): Remove.
	(fhandler_socket::create_secret_event): Remove.
	(fhandler_socket::check_peer_secret_event): Remove.
	(fhandler_socket::signal_secret_event): Remove.
	(fhandler_socket::close_secret_event): Remove.
	(fhandler_socket::sec_event_accept): Remove.
	(fhandler_socket::sec_event_connect): Remove.
	* fhandler_socket.cc (secret_event_name): Remove.
	(fhandler_socket::af_local_set_sockpair_cred): Rename from
	set_socketpair_eids.
	(fhandler_socket::af_local_setblocking): Rename from eid_setblocking.
	(fhandler_socket::af_local_unsetblocking): Rename from
	eid_unsetblocking.
	(fhandler_socket::af_local_recv_secret): New function to receive
	AF_LOCAL connect secret over socket itself.
	(fhandler_socket::af_local_send_secret): New function to send AF_LOCAL
	connect secret over socket itself.
	(fhandler_socket::af_local_recv_cred): Rename from eid_recv.
	(fhandler_socket::af_local_send_cred): Rename from eid_send.
	(fhandler_socket::eid_connect): Remove.
	(fhandler_socket::af_local_connect): Take over connect side handling
	of AF_LOCAL secret and credential handshake.
	(fhandler_socket::eid_accept): Remove.
	(fhandler_socket::af_local_accept): New method, take over accept side
	handling of AF_LOCAL secret and credential handshake.
	(fhandler_socket::af_local_set_cred): New method, set eid credentials
	to start values.
	(fhandler_socket::af_local_copy): New method, copy secret and
	credentials to another socket.
	(fhandler_socket::af_local_set_secret): New function combining former
	set_connect_secret and get_connect_secret into one function.
	(fhandler_socket::create_secret_event): Remove.
	(fhandler_socket::signal_secret_event): Remove.
	(fhandler_socket::close_secret_event): Remove.
	(fhandler_socket::check_peer_secret_event): Remove.
	(fhandler_socket::sec_event_connect): Remove.
	(fhandler_socket::sec_event_accept): Remove.
	(fhandler_socket::fixup_after_fork): Drop secret_event handling.
	(fhandler_socket::bind): Call af_local_set_secret.
	(fhandler_socket::connect): Call af_local_set_cred and af_local_connect.
	(fhandler_socket::listen): Call af_local_set_cred.
	(fhandler_socket::accept): Call af_local_copy and af_local_accept on
	accepted socket.
	(fhandler_socket::close): Don't call close_secret_event.
	(fhandler_socket::set_close_on_exec): Don't set secret_event
	inheritance.
	* net.cc (cygwin_getsockopt): Add debug output.
	(socketpair): Call af_local_set_sockpair_cred instead of
	set_socketpair_eids.
	* select.cc (set_bits): Drop AF_LOCAL special handling in case
	of except bit set.

2005-03-23  Christopher Faylor  <cgf@timesys.com>

	* include/ctype.h: Always define macros when inside cygwin.
	(isblank): New macro.

2005-03-23  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_socket::eid_connect): Make private.
	(fhandler_socket::set_connect_secret): Ditto.
	(fhandler_socket::get_connect_secret): Ditto.
	(fhandler_socket::create_secret_event): Ditto. Remove secret argument.
	(fhandler_socket::check_peer_secret_event): Ditto.
	(fhandler_socket::signal_secret_event): Make private.
	(fhandler_socket::close_secret_event): Ditto.
	(fhandler_socket::sec_event_accept): New private method.
	(fhandler_socket::sec_event_connect): Ditto.
	(fhandler_socket::af_local_connect): New public method.
	* fhandler_socket.cc: Use 'struct sockaddr' and 'struct sockaddr_in'
	rather than just 'sockaddr' and 'sockaddr_in' throughout.
	(fhandler_socket::eid_connect): Drop AF_LOCAL/SOCK_STREAM test.
	(fhandler_socket::create_secret_event): Remove secret argument.
	Always use connect_secret instead.
	(fhandler_socket::check_peer_secret_event): Ditto.
	(fhandler_socket::sec_event_connect): New method, combining entire
	secret event handshake on connect side.
	(fhandler_socket::af_local_connect): New method, combining secret
	event handshake and eid credential transaction on connect side, to
	be called from select.
	(fhandler_socket::sec_event_accept): New method, combining entire
	secret event handshake on accept side.
	(fhandler_socket::connect): Drop secret, use connect_secret instead.
	Move entire secret event handshake to sec_event_connect.
	(fhandler_socket::accept): Move entire secret event handshake to
	sec_event_accept.
	* select.cc (set_bits): Just call af_local_connect here.

2005-03-23  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/version.h: Change comment for most recent API version
	bump to reflect new additions to the DLL and to remove change obsoleted
	by the previous checkin.

2005-03-23  Christopher Faylor  <cgf@timesys.com>

	* include/ctype.h: New file.
	* ctype.cc: Ditto.
	* Makefile.in: Add ctype.o to DLL_OFILES.
	* cygwin.din: Remove _ctype_ptr (for now?).

2005-03-22  Christopher Faylor  <cgf@timesys.com>

	* Makefile.in (DLL_OFILES): Add hookapi.o.  Eliminate some cruft.
	* cygheap.h (cygheap_types): Add new enum: HEAP_1_HOOK.
	(hook_chain): New struct.
	(init_cygheap::hooks): Define new element.
	* cygheap.cc (cygheap_fixup_in_child): Zero hook chain on exec.
	* dcrt0.cc (dll_crt0_1): Call ld_preload just before calling main function.
	* external.cc (cygwin_internal): Implement CW_HOOK.
	* fork.cc (fork_child): Call fixup_hooks_after_fork.
	* init.cc (cygwin_hmodule): Reinstate after a long absence.
	* include/sys/cygwin.h: Define CW_HOOK.
	* hookapi.cc: New file.

	* select.cc (start_thread_socket): Add debugging output.

	* fhandler_disk_file.cc (fhandler_disk_file::fchmod): gcc 4.x
	accommodation.

	* fhandler_socket.cc (fhandler_socket::connect): Make sure that err is
	initialized.

2005-03-22  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (__ctype_ptr): Export.
	* include/cygwin/version.h: Bump API minor version.

2005-03-21  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class cygthread): Remove forward declaration.

2005-03-21  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class cygthread): Forward declare.
	(fhandler_socket::sec_pipe): Remove.
	(fhandler_socket::eid_pipe_name): Remove.
	(fhandler_socket::eid_setblocking): New private method.
	(fhandler_socket::eid_unsetblocking): Ditto
	(fhandler_socket::eid_recv): Ditto
	(fhandler_socket::eid_send): Ditto
	(fhandler_socket::eid_accept): Ditto
	(fhandler_socket::eid_connect): New public method.
	* fhandler_socket.cc (ASYNC_MASK): Move to beginning of file.
	(fhandler_socket::eid_pipe_name): Remove.
	(fhandler_socket::set_socketpair_eids): Move down to fhandler_socket
	methods.
	(fhandler_socket::fhandler_socket): Drop initializing sec_pipe.
	(fhandler_socket::~fhandler_socket): Drop closing sec_pipe.
	(fhandler_socket::eid_setblocking): New method.
	(fhandler_socket::eid_unsetblocking): New method.
	(fhandler_socket::eid_recv): New method.
	(fhandler_socket::eid_send): New method.
	(fhandler_socket::eid_connect): New method.
	(fhandler_socket::eid_accept): New method.
	(fhandler_socket::dup): Drop sec_pipe handling.
	(fhandler_socket::connect): Fix WinSock error handling. Prepare
	eid credential transaction. Call eid_connect on successful connect.
	(fhandler_socket::listen): Drop creating sec_pipe.
	(fhandler_socket::accept): Slightly simplify code. Call eid_accept
	on accepted socket.
	(fhandler_socket::getpeereid): Reshuffle code for readability. Fix
	test for invalid pid.
	* select.cc (set_bits): Call eid_connect on successfully connected
	socket.

2005-03-19  Christopher Faylor  <cgf@timesys.com>

	* child_info.h (fork_info): Use different method to alias variable.
	(spawn_info): Ditto.
	* cxx.cc (__cxa_guard_acquire): New function (needed for gcc 4.x).
	(__cxa_guard_release): Ditto.
	* devices.in: Make sure stuff is correctly bracketed (for gcc 4.x).
	* devices.cc: Regenerate.
	* fhandler.h (fhandler_disk_file::fchmod): Avoid left coercion (for gcc
	4.x).
	* smallprint.c (__rn): Declare as __fastcall since gcc 4.x complains
	about use of regparm, for some reason.
	* sync.h (sync::init_lock): Remove.
	* sync.cc (sync::init_lock): Ditto.

2005-03-18  Christopher Faylor  <cgf@timesys.com>

	* net.cc (cygwin_getprotobyname): Don't try to be fancy with return
	values.
	(cygwin_getprotobynumber): Ditto.

2005-03-17  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::utimes): Handle opening
	directories under 9x gracefully.

2005-03-17  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::connect): Always set sun_path
	in case of a successful or pending connect.
	(fhandler_socket::accept): Don't run secret event and eid credential
	transactions if OS accept returned WSAEWOULDBLOCK.

2005-03-16  Christopher Faylor  <cgf@timesys.com>

	* fhandler_tape.cc (get_ll): This is a generally useful function so
	move it
	* winsup.h (get_ll): to here.
	* security.cc (get_token_group_sidlist): Use get_ll to figure out the
	long long version of the luid since QuadPart is not part of the
	standard Windows API.

2005-03-16  Christopher Faylor  <cgf@timesys.com>

	* dir.cc: Rename opendir_* to dirent_* throughout.
	(opendir_states): Move and rename.
	* fhandler.h (dirent_states): to here.
	* fhandler_disk_file.cc (fhandler_disk_file::readdir): Use raw readdir
	when skipping through entries since it is keeping track of "." and
	"..".
	(fhandler_cygdrive::seekdir): Use fhandler_disk_file::readdir to do
	everything.
	* fhandler_virtual.cc (fhandler_virtual::opendir): Set flag indicating
	that we provide .  and ..
	(fhandler_virtual::seekdir): Ditto.
	(fhandler_virtual::rewinddir): Ditto.
	* fhandler_registry.cc (fhandler_registry::rewinddir): Ditto.

2005-03-16  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (free_local): New macro.
	(_cygtls::remove): Use free_local to free known-malloced local
	variables.
	* cygtls.h: Mark some variables as "malloced".
	* net.cc (enum struct_type): Rename from is_* to t_* for clarity.
	(dump_protoent): Delete.
	(dup_ent): New macro.
	(__dup_ent): Renamed from dup_ent.  Change arguments for convenience.
	Replace first argument with newly alloced value.  Allocate a rounded
	number of bytes in an attempt to try to reuse space.  Subsume
	"dump_protent".
	(cygwin_getprotobyname): Simplify using new dup_ent functionality.
	(cygwin_getprotobynumber): Ditto.
	(cygwin_getservbyname): Ditto.
	(cygwin_getservbyport): Ditto.
	(cygwin_gethostname): Ditto.
	(cygwin_gethostbyname): Ditto.
	* tlsoffsets.h: Regenerate.

	* syslog.cc (openlog): Use NULL rather than 0, for consistency with the
	rest of cygwin.
	(pass_handler::initialize): Use unbuffered I/O in pass one.

2005-03-15  Christopher Faylor  <cgf@timesys.com>

	* errno.cc (errmap): Correct typo in previous change.

2005-03-15  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (_cygtls::remove): Free process_ident, if it exists.

	* errno.cc (errmap): ERROR_DISK_CORRUPT -> EIO.

2005-03-11  Christopher Faylor  <cgf@timesys.com>

	* path.h (pathconv_arg): Define PC_NO_ACCESS_CHECK.
	(path_types): Define PATH_NO_ACCESS_CHECK == PC_NO_ACCESS_CHECK.
	* path.cc (symlink_info::check_sysfile): Move to symlink_info class and
	eliminate arguments that are part of class.  Use set_error.
	(symlink_info::check_shortcut): Ditto.
	(symlink_info::set_error): New function.
	(path_conv::check): Pass PC_NO_ACCESS_CHECK to symlink_info::check.
	(symlink_info::check): Preserve PC_NO_ACCESS_CHECK in pflags.  Use
	set_error.

2005-03-10  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (is_floppy): New function.
	(setmntent): Drop floppy drives on A: and B: from logical drive DWORD.
	* syscalls.cc (sync): Don't sync floppies on A: and B:.

2005-03-10  Christopher Faylor  <cgf@timesys.com>

	* autoload.cc (LoadDLLprime): Use nocopy segment or forked processes
	will not initialize properly.

2005-03-10  Christopher Faylor  <cgf@timesys.com>

	* autoload.cc (LoadDLLprime): Scrap use of .linkonce and just use an
	ifdef guard to load .foo_init into data segment.

	* dcrt0.cc (initial_env): Allow colon or space as CYGWIN_DEBUG
	separator for consistency.

2005-03-09  Christopher Faylor  <cgf@timesys.com>

	* pinfo.h (pinfo::pinfo): Clear more elements in the constructor.

2005-03-09  Christopher Faylor  <cgf@timesys.com>

	* net.cc (dup_ent): Revert older stupid test for null.  Don't copy name
	if it is NULL.

2005-03-09  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::eid_pipe_name): Fix format
	string.
	(fhandler_socket::connect): Set sun_path before running eid credential
	transaction.  Run transaction only if OS connect was successful.
	(fhandler_socket::accept): Run transaction only if OS accept was
	successful.

2005-03-09  Corinna Vinschen  <corinna@vinschen.de>

	* signal.cc (sigprocmask): Rename first parameter to "how".
	(handle_sigprocmask): Ditto.  Check "how" for being a valid "how" value.
	Fix call order in case of wrong "how" value.

2005-03-09  Christopher Faylor  <cgf@timesys.com>

	* net.cc (dup_ent): Revert previous stupid change.

2005-03-09  Christopher Faylor  <cgf@timesys.com>

	* net.cc (dup_ent): Avoid dereferencing a null pointer in a debug_printf.

2005-03-09  Christopher Faylor  <cgf@timesys.com>

	* path.cc (path_conv::check): Treat ENOSHARE similarly to ENOENT when
	determining if there was a problem with a symlink.

2005-03-08  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_socket.cc (fhandler_socket::listen): Don't limit the number
	of pipe instances.

2005-03-08  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::exit): Right shift exit value by eight when not
	started in a cygwin environment.

2005-03-07  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (mmap64): Handle MAP_AUTOGROW flag.
	(fhandler_disk_file::mmap): Ditto. Clean conditional for readability.
	* include/sys/mman.h: Add MAP_AUTOGROW flag.
	* include/cygwin/version.h: Bump API minor version.

2005-03-08  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (dll_crt0_0): Eliminate muto::init call.
	* sync.h (locker): New, currently unused class.
	(muto::init): Eliminate.
	* sync.cc (muto::init): Ditto.
	(muto::init): Eliminate critical section lock and instead use name as a
	guard to prevent against multiple attempts to initialize the same muto.

	* pinfo.cc (pinfo::init): Set myself procinfo when not execing and pid
	matches windows pid or cygwin pid.

2005-03-06  Pavel Tsekov  <ptsekov@gmx.net>

	* path.cc (mount_info::read_cygdrive_info_from_registry): Use the user
	prefix if it exists.

2005-03-06  Christopher Faylor  <cgf@timesys.com>

	* sync.h (sync::init_lock): Declare new static member.
	(sync::init()): Declare new static function.
	* sync.cc (sync::init): Define.
	(sync::init): Lock attempt to initialize a muto to stop multiple
	threads from colliding.
	* dcrt0.cc (dll_crt0_0): Initialize muto environment.

2005-03-06  Christopher Faylor  <cgf@timesys.com>

	* path.cc (special_name): Reorganize to always detect the use of
	special names first, before detecting special characters.

2005-03-04  Christopher Faylor  <cgf@timesys.com>

	* fhandler_clipboard.cc: Use int for cygnativeformat rather than UINT
	as that is what is returned by GetPriorityClipboardFormat.
	(fhandler_dev_clipboard::read): Ditto for the format variable.

2005-03-04  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.cc (fhandler_base::open_9x): Satisfy query_open values.

2005-03-04  Pierre Humblet <pierre.humblet@ieee.org>

	* fhandler_socket.cc (fhandler_socket::ioctl): Only cancel
	WSAAsyncSelect when async mode is on.

2005-03-03  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (utmpxname): Export.
	* syscalls.cc (utmpxname): Create export alias to utmpname.
	* include/utmpx.h: Define ut_name and ut_xtime if not already defined.
	(utmpxname): Add prototype.
	* include/sys/utmp.h: Only define ut_name if not already defined.
	* include/cygwin/version.h: Bump API minor version.

2005-03-03  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::detach): Use a slightly higher priority when
	waiting for thread signalling.

2005-03-02  Christopher Faylor  <cgf@timesys.com>

	* autoload.cc (std_dll_init): Save and restore fpu control register
	around LoadAddress to prevent loaded dlls (like msvcrt.dll) from
	setting unwanted stuff.

2005-03-02  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (_cygtls::remove): Don't attempt any removal activities if
	exitsock is zero.

2005-03-02  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (_cygtls::init_thread): Move exitsock setting later.  It
	should always be set.
	(_cygtls::remove): Detect zero exitsock.  Not quite sure why this is needed.

2005-03-02  Christopher Faylor  <cgf@timesys.com>

	* autoload.cc (LoadDLLprime): Mask error code to low-order 16 bits.
	(noload): Preserve sign when returning error code.

2005-03-02  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (do_cleanup): Properly restore SIGINT/SIGQUIT even if they
	had previously been SIG_DFL.

2005-03-01  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): Replace
	GetSystemTime/SystemTimeToFileTime with GetSystemTimeAsFileTime.
	* times.cc (time_as_timestruc_t): Ditto.
	(time): Ditto.

2005-03-01  Christopher Faylor  <cgf@timesys.com>

	* include/cygwin/version.h: Bump DLL minor number to 14.

2005-03-01  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_clipboard.cc (fhandler_dev_clipboard::write): Never set
	errno to 0.
	(fhandler_dev_clipboard::read): Ditto.
	* fhandler_windows.cc (fhandler_windows::read): Ditto.
	* scandir.cc (scandir): Ditto.
	* syscalls.cc (_fstat64_r): Ditto.
	(_fstat_r): Ditto.
	(_stat64_r): Ditto.
	(_stat_r): Ditto.

	* mmap.cc (mmap64): Fix /dev/zero mapping.

2005-02-28  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_socket): Declare new method
	set_socketpair_eids.
	* fhandler_socket.cc (fhandler_socket::set_socketpair_eids): New method.
	(fhandler_socket::dup): Duplicate sec_pipe if necessary.
	(fhandler_socket::listen): Only create sec_pipe if named pipes are
	available. Initialized sec_peer_pid to 0 as on Linux.
	(fhandler_socket::connect): Only run eid credential transaction if
	named pipes are available.  Fake otherwise. Initialized sec_peer_pid
	to 0 as on Linux.
	(fhandler_socket::accept): Ditto.
	(fhandler_socket::close): Move closing sec_pipe handle from here...
	(fhandler_socket::~fhandler_socket): ... to here.
	* net.cc (socketpair): Set eid credentials by calling
	fhandler_socket::set_socketpair_eids() on both socket ends.
	* wincap.h (wincaps::has_named_pipes): New element.
	* wincap.cc: Implement above element throughout.

2005-02-26  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (_pinfo::set_ctty): Move function
	* pinfo.cc (_pinfo::set_ctty): to here.

	* fhandler_mem.cc (fhandler_dev_mem::fstat): Don't fill out structure
	if this is an on-disk device rather than an "auto" device.
	* fhandler_raw.cc (fhandler_dev_raw::fstat): Ditto.

	* path.cc (normalize_posix_path): Don't treat a standalone '//' as
	introducing a UNC path.
	(normalize_win32_path): Ditto.

2005-02-26  Christopher Faylor  <cgf@timesys.com>

	* debug.cc (delete_handle): Report on handle value in debugging output.

	* pinfo.h (_pinfo::exists): Declare "new" function.
	(_pinfo::kill): Ditto.
	* fhandler_termios.cc (tty_min::kill_pgrp): Use _pinfo::exists rather
	than proc_exists.
	* pinfo.cc (pinfo::init): Ditto.  Don't do a low_priority_sleep(0) when
	looping to find exec'ed procinfo.
	(pinfo::release): Be more careful about unmapping and closing.
	* signal.cc (_pinfo::kill): Rename from kill_worker.  Accommodate entry
	into _pinfo class.
	(kill0): Use _pinfo::kill rather than kill_worker.
	(kill_pgrp): Ditto.  Use _pinfo::exists rather than proc_exists.
	* sigproc.cc (_pinfo::exists): Rename from proc_exists.
	(pid_exists): Use _pinfo::exists rather than proc_exists.
	(remove_proc): Ditto.
	* sigproc.h (proc_exists): Delete declaration.

2005-02-25  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_base): Declare fixup_mmap_after_fork
	with additional flags parameter.  Change offset parameter to _off64_t.
	(class fhandler_disk_file): Ditto.
	(class fhandler_dev_mem): Ditto.
	* fhandler_mem.cc (fhandler_dev_mem::fixup_mmap_after_fork):
	Accommodate new parameters.
	* mmap.cc: Include ntdll.h.
	(class mmap_record): Add flags member.
	(mmap_record::mmap_record): Add flags parameter.
	(mmap_record::get_flags): New method.
	(class map): Add next_anon_addr member to store next anonymous mapping
	address suggestion.
	(map::get_next_anon_addr): New method.
	(map::set_next_anon_addr): New method.
	(mmap64): Don't align offset and length to granularity in case of
	MAP_ANONYMOUS on NT.  Check for already existing mapping only on 9x.
	Call mmap_record::mmap_record with additional flags argument.
	(fhandler_base::fixup_mmap_after_fork): Accommodate new parameters.
	(fhandler_disk_file::mmap): Use NtMapViewOfSection with
	AT_ROUND_TO_PAGE flag for anonymous mappings on NT.  If addr is NULL,
	try to map adjacent to previous mapping.
	(fhandler_disk_file::fixup_mmap_after_fork): Add flags argument.
	Change offset parameter to _off64_t.  Use NtMapViewOfSection to
	re-create anonymous mappings on NT.
	(fixup_mmaps_after_fork): Accommodate new parameters when calling
	fhandler's fixup_mmaps_after_fork function.
	* ntdll.h (AT_ROUND_TO_PAGE): New define.

2005-02-25  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (mmap64): Handle anonymous MAP_FIXED request on
	non-granulation boundary.

2005-02-25  Corinna Vinschen  <corinna@vinschen.de>

	* mmap.cc (class mmap_record): Declare new map_pages method with
	address parameter.
	(mmap_record::map_pages): New method with address parameter.
	(mmap64): Evaluate access mode before checking if already existing
	mapping can be used.
	Only use existing mapping if requested access mode matches the one
	in the existing mapping.
	Add check for existing mapping for anonymous MAP_FIXED case.

2005-02-23  Corinna Vinschen  <corinna@vinschen.de>

	* localtime.cc: Implement setting __tzrule's offset member using
	newlib's __gettzinfo () interface.
	(__tzrule): Remove.
	(timezone): Define as long according to POSIX.

2005-02-23  Eric Blake  <ebb9@byu.net>

	* devices.in (parsedisk): Fix typo.
	* devices.cc: Regenerate.

2005-02-23  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (getpeereid): Export.
	* fhandler.h (class fhandler_socket): Add pipe and id members to
	exchange eid credentials for AF_LOCAL sockets.
	(eid_pipe_name): Declare new method.
	(getpeereid): Ditto.
	* fhandler_socket.cc (fhandler_socket::eid_pipe_name): New method.
	(fhandler_socket::fhandler_socket): Initialize sec_pipe.
	(fhandler_socket::connect): Exchange eid credentials with accepting
	socket process.
	(fhandler_socket::listen): Prepare eid credential transaction.
	(fhandler_socket::accept): Exchange eid credentials with connecting
	socket process.
	(fhandler_socket::close): Close eid credentials pipe if open.
	(fhandler_socket::getpeereid): New method.
	* net.cc (cygwin_getsockopt): Add SO_PEERCRED handling.
	(getpeereid): New function.
	* include/asm/socket.h (SO_PEERCRED): Define.
	* include/cygwin/socket.h (struct ucred): Define new type.
	* include/cygwin/version.h: Bump API minor version.

2005-02-23  Corinna Vinschen  <corinna@vinschen.de>

	* include/sys/statvfs.h (ST_RDONLY): Define.
	(ST_NOSUID): Define.

2005-02-23  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (fstatvfs): Export.
	(statvfs): Export.
	* syscalls.cc: Include sys/statvfs.h.
	(statvfs): New function.  Move statfs functionality here.
	(fstatvfs): New function.
	(statfs): Just call statvfs and copy structure.  Check validity of
	incoming struct statfs pointer.
	* include/cygwin/types.h (fsblkcnt_t): Define.
	(fsfilcnt_t): Define.
	* include/cygwin/version.h: Bump API minor version.
	* include/sys/statvfs.h: New file.

2005-02-23  Corinna Vinschen  <corinna@vinschen.de>

	* devices.h: Switch FH_ZERO and FH_PORT as on Linux.  Add FH_FULL.
	* devices.in: Add /dev/full.
	* devices.cc: Regenerate.
	* dtable.cc (build_fh_pc): Add FH_FULL.
	* fhandler.cc (fhandler_base::fstat): Set FH_FULL permission bits
	correctly.
	* fhandler_zero.cc (fhandler_dev_zero::write): Set errno to ENOSPC
	and return -1 if device is FH_FULL.

2005-02-22  Christopher Faylor  <cgf@timesys.com>

	* fhandler_disk_file.cc (fhandler_cygdrive::closedir): Return 0 when
	closing cygdrive_root.

2005-02-22  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (basename): Export.
	(dirname): Export.
	* path.cc (basename): New function.
	(dirname): New function.
	* include/libgen.h: New file.
	* include/cygwin/version.h: Bump API minor version.

2005-02-22  Corinna Vinschen  <corinna@vinschen.de>

	* select.cc (peek_pipe): Disable new pipe code until there's
	a working substitute.

2005-02-22  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din (fdatasync): Export.
	* fhandler.cc (fhandler_base::fsync): Return with EINVAL if no
	handle is available.
	* syscalls.cc (fdatasync): Create export alias to fsync.
	* include/cygwin/version.h: Bump API minor version.

2005-02-20  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_base::fstat_helper): Declare with additional
	dwVolumeSerialNumber argument.  Drop default values for last three
	arguments.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Pass
	dwVolumeSerialNumber from GetFileInformationByHandle to fstat_helper.
	(fhandler_base::fstat_by_name): Pass pc.volser () to fstat_helper.
	Accommodate dropping default values for last three arguments of
	fstat_helper.
	(fhandler_base::fstat_helper): Add dwVolumeSerialNumber argument.
	Use for st_dev member unless 0 in which case pc.volser () is used.

2005-02-20  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc (FindFirstVolumeA): Add.
	(FindNextVolumeA): Add.
	(FindVolumeClose): Add.
	(GetVolumePathNamesForVolumeNameA): Add.
	* fhandler.h (class fhandler_base): Declare new method fsync.
	* fhandler.cc (fhandler_base::fsync): New method.
	* syscalls.cc (fsync): Move functionality into fhandler method fsync.
	Just call this method from here.
	(sync_worker): New static function.
	(sync): Fill with life for NT systems.
	* wincap.h (wincaps::has_guid_volumes): New element.
	* wincap.cc: Implement above element throughout.

2005-02-20  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (enum query_state): Add query_write_attributes state.
	(fhandler_base::status.query_open): Add a bit to make room for more
	states.
	(class fhandler_base): Declare new method utimes.
	(class fhandler_socket): Ditto.
	(class fhandler_disk_file): Ditto.
	(fhandler_disk_file::fhandler_disk_file): Add constructor with
	path_conv parameter.
	* fhandler.cc (fhandler_base::open): Add query_write_attributes
	handling.
	(fhandler_base::utimes): New method.
	* fhandler_disk_file.cc (fhandler_disk_file::link): Simplify.
	Open file with query_write_attributes instead of query_write_control.
	(fhandler_disk_file::utimes): New method.
	(fhandler_disk_file::fhandler_disk_file): Add constructor with
	path_conv parameter setting pc member immediately.
	* fhandler_socket.cc (fhandler_socket::fchmod): Use new
	fhandler_disk_file constructor.
	(fhandler_socket::fchown): Ditto.
	(fhandler_socket::facl): Ditto.
	(fhandler_socket::link): Ditto.
	(fhandler_socket::utimes): New method.
	* times.cc: Include dtable.h.
	(timeval_to_filetime): Make non-static.
	(utimes): Move functionality into fhandler method utimes. Just call
	this method from here.
	* winsup.h: Simplify declarations of time helper functions.
	(timeval_to_filetime): Add extern declaration.

2005-02-19  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_base): Declare new method link.
	(class fhandler_socket): Ditto.
	(class fhandler_disk_file): Ditto.
	* fhandler.cc (fhandler_base::open): Add FILE_WRITE_ATTRIBUTES
	to query_write_control access flags.
	(fhandler_base::link): New method.
	* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't try to
	open with O_WRONLY since query_write_control includes
	FILE_WRITE_ATTRIBUTES.
	(fhandler_disk_file::fchown): Ditto.
	(fhandler_disk_file::facl): Ditto.
	(fhandler_disk_file::link): New method.  Touch st_ctime on successful
	link.
	* fhandler_socket.cc (fhandler_socket::link): New method.
	* syscalls.cc (link): Move functionality into fhandler method link.
	Just call this method from here.

2005-02-19  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (class fhandler_socket): Declare new methods fchown,
	fchmod and facl.
	* fhandler_socket.cc (fhandler_socket::fstat): Handle AF_LOCAL
	sockets.
	(fhandler_socket::fchmod): New method.
	(fhandler_socket::fchown): New method.
	(fhandler_socket::facl): New method.

2005-02-19  Corinna Vinschen  <corinna@vinschen.de>

	* localtime.cc: Temporary implementation of setting __tzrule's offset
	member to be used by strftime.
	(__tzrule): New global variable.
	(tzparse): Set __tzrule's offset member appropriately.

2005-02-17  Christopher Faylor  <cgf@timesys.com>

	* path.cc (path_conv::check): Set fs flag when a unix-domain socket
	is detected.

2005-02-17  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::fstat): Set st_ctime if
	has_changed flag is set.
	(fhandler_disk_file::touch_ctime): Reset has_changed flag on success.

2005-02-17  Corinna Vinschen  <corinna@vinschen.de>

	* times.cc (utimes): Open files with FILE_WRITE_ATTRIBUTES first,
	if that fails, try opeing with GENERIC_WRITE.  Fix comments.

2005-02-15  Christopher Faylor  <cgf@timesys.com>

	* path.h (path_conv::issocket): Return true if device == FH_UNIX rather
	than expecting path_conv to set a flag.

2005-02-11  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.cc (fhandler_base::raw_write): Mark as changed on
	successful write.
	* fhandler.h (fhandler_base::status_flags): Add 'has_changed' flag.
	* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call
	fhandler_disk_file's own open and close instead of open_fs and
	close_fs.  Mark as changed on success.
	(fhandler_disk_file::fchown): Ditto.
	(fhandler_disk_file::facl): Ditto.
	(fhandler_disk_file::ftruncate): Ditto.
	(fhandler_base::open_fs): Mark as changed when O_TRUNC flag on existing
	file is set.
	(fhandler_disk_file::close): Set st_ctime if has_changed flag is set.

2005-02-11  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::release): Reset ev here if it exists.
	(cygthread::terminate_thread): Eliminate racy code which reset ev and
	thread_sync.  Remove a few nonsensical inuse checks.  Exit at the
	bottom.
	(cygthread::detach): Rewrite to again try to ensure that we don't say
	we're signalled when we are not signalled.
	* fhandler.cc (fhandler_base::raw_read): Revert to signalling read
	success quickly.
	* pipe.cc (fhandler_pipe::close): Use base method to close handle.
	* sigproc.h (WAIT_SIG_PRIORITY): Just trundle along at normal priority
	to allow the pipe thread to do its thing if possible.

	* pinfo.h (pinfo::zap_cwd): Declare new function.
	(pinfo::zap_cwd): Move 'cd out of the way code' here.
	(pinfo::exit): Use it here.
	* spawn.cc (spawn_guts): And here.

2005-02-11  Corinna Vinschen  <corinna@vinschen.de>

	* times.cc (utimes): Open files with GENERIC_WRITE on file systems
	not supporting ACLs.

2005-02-09  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Fix checking
	lseek return code.

2005-02-08  Corinna Vinschen  <corinna@vinschen.de>

	* times.cc (timeval_to_filetime): Define first parameter const.
	(utimes): Define second parameter to const according to SUSv3.
	(utime): Ditto.
	* include/sys/utime.h (utime) : Change declaration accordingly.

2005-02-08  Corinna Vinschen  <corinna@vinschen.de>

	* cygthread.cc (cygthread::detach): Just test thread handle after
	signal arrived, don't wait infinitely for it.

2005-02-08  Christopher Faylor  <cgf@timesys.com>

	* pipe.cc (fhandler_pipe::read): Remove hold over from old read_state
	implementation.

2005-02-06  Yitzchak Scott-Thoennes <sthoenna@efn.org>

	* net.cc (cygwin_gethostbyname): Be more picky about what's a numeric
	address string, and use tls in that case too.

2005-02-07  Christopher Faylor  <cgf@timesys.com>

	* exceptions.cc: Make windows_system_directory non-static.
	* pinfo.cc (pinfo::exit): Change innocuous cd'ed location to one that
	is more likely to exist.

2005-02-06  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (path_conv::check): Leave symlink expansion loop in case
	a not-ENOENT error happens.

	* cygheap.h (cygheap_fdmanip::fhandler_pipe *): New cast operator.
	* pinfo.cc (_pinfo::commune_recv): Add PICOM_PIPE_FHANDLER handling.
	(_pinfo::commune_send): Ditto.
	(_pinfo::pipe_fhandler): New method.
	* pinfo.h (enum picom): Add PICOM_PIPE_FHANDLER.
	(_pinfo::pipe_fhandler): Declare.
	* pipe.cc (fhandler_pipe::open): Rewrite.  Allow to open foreign
	pipe handles.

2005-02-03  Christopher Faylor  <cgf@timesys.com>

	* cygthread.h (cygthread::terminate_thread): Reflect return value.
	* cygthread.cc (cygthread::detach): Be more careful about ensuring that
	sigwait is properly waited for to avoid later missynchronization.
	(cygthread::terminate_thread): Return true if thread was actually
	terminated and all handles were closed.
	* fhandler_base.cc (fhandler_base::raw_read): Use signal_read_state
	rather than raw calls to win32 api.
	(fhandler_base::read): Ditto.
	* fhandler.h (fhandler_pipe::fixup_after_exec): Use method to create
	read_state signalling.
	(fhandler_pipe::create): Ditto.

	* Makefile.in: Make some more files -fomit-frame-pointer.

2005-02-02  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_base::ftruncate): Define new virtual method.
	(fhandler_disk_file::ftruncate): Ditto.
	* fhandler.cc (fhandler_base::ftruncate): New method.
	* fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto.
	* syscalls.cc (ftruncate64): Move functionality into fhandlers.
	Call fhandler method from here.

2005-02-02  Corinna Vinschen  <corinna@vinschen.de>

	* pipe.cc (fhandler_pipe::dup): Fix conditionals in case of error.

2005-02-02  Corinna Vinschen  <corinna@vinschen.de>

	* times.cc (utimes): Mark st_ctime for update according to SUSv3.

2005-02-01  Christopher Faylor  <cgf@timesys.com>

	* fhandler_proc.cc (format_proc_partitions): Remove PartitionType check
	since it could skip over partitions that are actually interesting.

2005-02-01  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::terminate_thread): Wait briefly for
	notification event in the event that the thread was actually in the
	process of exiting.

	* pipe.cc (fhandler_pipe::dup): read_state is not supposed to be
	inheritable.  Fix that.

	* path.cc (path_conv::check): Set symlen = 0 to avoid a compiler
	warning.

	* devices.h (devices::parsedisk): Declare new function.
	* devices.in (devices::parsedisk): Define new function.
	* dtable.cc (dtable::init_std_file_from_handle): Use device numbers
	rather than name.
	* fhandler_proc.cc (format_proc_partitions): Use parsedisk to generate
	disk names from numeric codes.  (This was broken on two of my
	systems previously and is still broken now)

2005-02-01  Corinna Vinschen  <corinna@vinschen.de>

	* pipe.cc (fhandler_pipe::open):  Allow re-opening of /proc/<pid>/fd
	pipes of the current process.

2005-02-01  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.cc (fhandler_base::get_proc_fd_name): Don't generate
	"device:" entry.
	* fhandler.h (fhandler_socket::open): New method.
	(fhandler_pipe::open): New method.
	* fhandler_proc.cc (fhandler_proc::exists): Return -2 in case of
	/proc/self.
	* fhandler_process.cc (fhandler_process::exists): Return -2 in
	case of symlinks, -3 for pipes and -4 for sockets.
	(fhandler_process::fstat): Handle pipes and sockets.
	(fhandler_process::open): Handle opening /proc/<pid>/fd.
	(fhandler_process::fill_filebuf): Generate empty names for
	non exisiting file descriptors.
	* fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Always
	generate "socket:[number]" strings as on Linux.
	(fhandler_socket::open): New method.
	(fhandler_socket::fstat): Always return socket type.
	* path.cc (symlink_info::set): Remove unused second parameter.
	(path_conv::check): Handle pipes and sockets in /proc.
	Set correct device type for AF_LOCAL sockets.
	* pinfo.cc (_pinfo::commune_recv): Generate empty names for
	non exisiting file descriptors.
	(_pinfo::fd): Ditto.
	* pipe.cc (fhandler_pipe::open): New method.

2005-01-31  Christopher Faylor  <cgf@timesys.com>

	* path.h (path_conv::set_name): Declare new function.
	* path.cc (path_conv::set_name): Define new function.
	* fhandler.h (fhandler_dev_null::open): Declare new function.
	* fhandler.cc (fhandler_dev_null::open): Define new function.

2005-01-31  Christopher Faylor  <cgf@timesys.com>

	* smallprint.c (rnarg): Use long rather than unsigned long so that we
	get proper sign extension.

2005-01-31  Corinna Vinschen  <corinna@vinschen.de>

	* environ.cc (set_traverse): New function.
	(parse_thing): Add "traverse" option.  Sort options alphabetically.
	(environ_init): On NT, switch on traverse checking by default.

2005-01-31  Christopher Faylor  <cgf@timesys.com>

	* smallprint.c (__rn): Regparmize.

2005-01-31  Christopher Faylor  <cgf@timesys.com>

	* smallprint.c (rnarg): New macro.
	(rnargLL): Ditto.
	(__rn): Rename from 'rn', add a mask argument, and use the mask
	argument to control how many significant digits to care about.
	(__small_vsprintf): Use __rn, rnarg, rnargLL, as appropriate.

2005-01-31  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::exit): Only return low-order 16 bits when exiting.

2005-01-31  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_process.cc (format_process_maps): Get destbuf argument by
	reference.  Allow resizing of destbuf as necessary.  Fix string
	handling.

2005-01-31  Corinna Vinschen  <corinna@vinschen.de>

	* cygheap.h (class cygheap_fdenum): New class to enumerate used
	fhandlers.
	* dtable.h (class dtable): Add cygheap_fdenum as friend class.
	* fhandler.h (fhandler_base::get_proc_fd_name): New virtual method
	to return a name for /proc/<pid>/fd.
	(fhandler_socket::get_proc_fd_name): Ditto.
	(fhandler_pipe::get_proc_fd_name): Ditto.
	(fhandler_virtual::opendir): Make virtual method.
	(fhandler_process::opendir): New method.
	* fhandler.cc (fhandler_base::get_proc_fd_name): New method.
	* fhandler_process.cc: Include ctype.h.
	(PROCESS_FD): Define.
	(process_listing): Add "fd".
	(fhandler_process::exists): Fix comment.  Return 1 in case of "fd"
	directory. Handle files below "fd".
	(fhandler_process::fstat): Drop "self" handling.  Set correct link
	count for directories.
	(fhandler_process::opendir): New method to handle "fd" directory.
	(fhandler_process::readdir): Add "fd" handling.
	(fhandler_process::open): Drop "self" handling.
	(fhandler_process::fill_filebuf): Ditto.  Add "fd" handling.  Fix
	"maps" output string.
	* fhandler_registry.cc (fhandler_registry::fstat): Set correct link
	count for directories.
	* fhandler_socket.cc (fhandler_socket::get_proc_fd_name): New method.
	* path.cc (symlink_info::set): Fix thinko.
	* pinfo.cc (_pinfo::commune_recv): Rename pathbuf to path throughout.
	Drop local path variable in PICOM_FIFO case.  Fix debug output.
	Close handles as early as possible. Add PICOM_FDS and PICOM_FD
	handling.
	(_pinfo::commune_send): Add PICOM_FDS and PICOM_FD handling.
	(_pinfo::fd): New method.
	(_pinfo::fds): New method.
	* pinfo.h (enum picom): Add PICOM_FDS and PICOM_FD.
	(_pinfo::fd): Declare.
	(_pinfo::fds): Declare.
	* pipe.cc (fhandler_pipe::get_proc_fd_name): New method.

2005-01-29  Corinna Vinschen  <corinna@vinschen.de>

	* smallprint.c (rn): Change uval to unsigned long long to fix 64 bit
	handling.
	* fhandler_process.cc (format_process_maps): Print major, minor and
	inode numbers correctly.

2005-01-29  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc (GetModuleFileNameExA): Add.
	(GetModuleInformation): Add.
	(QueryWorkingSet): Add.
	* fhandler.h (fhandler_virtual::get_filebuf): New method.
	* fhandler_proc.cc (PROC_SELF): Define.
	(proc_fhandlers): Change type of self to FH_PROC.
	(fhandler_proc::exists): Return -3 if self.
	(fhandler_proc::fstat): Handle self as symlink.
	(fhandler_proc::fill_filebuf): Handle self.
	* fhandler_process.cc: Include psapi.h.
	(PROCESS_EXENAME): Remove.
	(PROCESS_MAPS): Define.
	(PROCESS_ROOT): Define.
	(PROCESS_EXE): Define.
	(PROCESS_CWD): Define.
	(process_listing): Remove "exename", add "maps, "root", "exe" and
	"cwd" elements.
	(fhandler_process::exists): Return -2 for symlinks.
	(fhandler_process::fstat): Handle symlinks.
	(fill_filebuf): Evaluate pid if pid is 0.  Use exename handling for
	exe.  Handle maps, root and cwd.
	(format_process_maps): New function evaluating "maps".
	* path.cc (symlink_info::set): New method to fill symlink_info
	with data matching virtual symlinks.
	(path_conv::check): Handle virtual symlinks.
	* pinfo.cc (_pinfo::commune_recv): Add PICOM_CWD and PICOM_ROOT
	handling.
	(_pinfo::commune_send): Ditto.
	(_pinfo::root): New function.
	(_pinfo::cwd): New function.
	* pinfo.h (enum picom): Add PICOM_CWD and PICOM_ROOT.
	(_pinfo::root): Declare.
	(_pinfo::cwd): Declare.

2005-01-29  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (new): Add a little more debugging.
	* thread.cc (pthread_null::exit): Add a _my_tls.remove() for safety.

2005-01-28  Christopher Faylor  <cgf@timesys.com>

	* cygtls.cc (cygtls::call2): Move socket cleanup.
	(cygtls::remove): Move socket cleanup here.  Don't use _my_tls to
	reference it.

2005-01-26  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::init): Avoid a compiler warning.

2005-01-25  Corinna Vinschen  <corinna@vinschen.de>

	* syscalls.cc (setpriority): Implement PRIO_PGRP, PRIO_USER and
	setting priority in other Cygwin processes.
	(getpriority): Implement PRIO_PGRP, PRIO_USER and getting nice value
	from other processes.

2005-01-26  Pierre Humblet <pierre.humblet@ieee.org>

	* path.cc (path_conv::check): Return ENOTDIR rather than ENOENT
	when a component is not a directory. Remove unreachable code.
	(digits): Delete.

2005-01-25  Christopher Faylor  <cgf@timesys.com>

	* pinfo.h (pinfo::init): Make third parameter non-optional and
	propagate change throughout.
	* pinfo.cc (set_myself): Pass INVALID_HANDLE_POINTER if h is NULL.
	(pinfo::init): Make third parameter non-optional.  Eliminate use of
	PID_EXECED as an argument.  Put setting of handle back inside loop but
	reorganize to try to open it only when necessary.

2005-01-25  Corinna Vinschen  <corinna@vinschen.de>

	* cygwin.din: Export getpriority and setpriority.
	* fork.cc (fork_parent): Copy parent's nice value into child.
	* spawn.cc (spawn_guts): Ditto.
	* miscfuncs.cc (winprio_to_nice): New function.
	(nice_to_winprio): Ditto.
	* pinfo.cc (pinfo_init): If parent is not a Cygwin process, set
	default nice value according to current Win32 priority class.
	* pinfo.h (class _pinfo): Add nice member.
	* syscalls.cc (setpriority): New function, only implementing
	PRIO_PROCESS for now.
	(getpriority): Ditto.
	(nice): Just call setpriority.
	* wincap.h (wincaps::has_extended_priority_class): New element.
	* wincap.cc: Implement above element throughout.
	* winsup.h: Add prototypes for winprio_to_nice and nice_to_winprio.
	* include/limits.h (NZERO): New define.
	* include/cygwin/types.h (id_t): New datatype.
	* include/cygwin/version.h: Bump API minor version.
	* include/sys/resource.h: Add PRIO_XXX defines and prototypes for
	getpriority and setpriority.

2005-01-25  Corinna Vinschen  <corinna@vinschen.de>

	* path.cc (realpath): Allow to expand with .exe suffix.

2005-01-22  Christopher Faylor  <cgf@timesys.com>

	* spawn.cc (spawn_guts): Perform same "cd" as in pinfo::exit below to
	make sure that a stub process does not keep the current working
	directory busy after the "execed" process has exited.

2005-01-22  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::init): Move everything but the MapViewOfFileEx out
	of the loop since trying multiple times to call CreateFileMapping
	doesn't make much sense.  Try to structure the loop a little better so
	that exiting with a break does the right thing.
	(pinfo::release): Release shared memory area if it exists and close
	handle if it exists.

2005-01-22  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::maybe_set_exit_code_from_windows): Make sure that
	process has exited before getting an error code.
	(pinfo::exit): "cd" to innocuous location before exiting to make sure
	that process does not keep the current working directory busy while it
	is in the process of really exiting.

2005-01-18  Corinna Vinschen  <corinna@vinschen.de>

	* autoload.cc (CoInitialize): Remove.
	(CoUninitialize): Remove.
	(CoCreateInstance): Remove.
	(CoTaskMemFree): Add.
	(SHGetDesktopFolder): Add.
	* path.cc (shortcut_header): Remove.
	(shortcut_initalized): Remove.
	(GUID_shortcut): New static GUID.
	(struct win_shortcut_hdr): New struct describing Windows shortcut
	header structure.
	(symlink_worker): Rewrite creating Windows shortcuts.  Create
	ITEMIDLIST if target exists.  Only write once.
	(cmp_shortcut_header): Use win_shortcut_hdr structure for comparison.
	(check_shortcut): Rewrite to read only once from file.  Allow skipping
	an ITIMIDLIST in the file.

2005-01-16  Christopher Faylor  <cgf@timesys.com>

	* pinfo.h (maybe_set_exit_code_from_windows): Renamed from
	set_exit_state.
	* pinfo.cc (pinfo::exit): Use renamed function.
	(proc_waiter): Ditto.  Make a copy of input argument to avoid problems
	when procs array is shuffled.  Flag when copy is made so that
	remove_proc knows when it is safe to reshuffle.
	* sigproc.cc (proc_terminate): Don't flag process_state as PID_EXITED.
	(remove_proc): Wait for waiter to finish copying pinfo element before
	moving it (an actual wait should be an extremely rare event).

2005-01-15  Christopher Faylor  <cgf@timesys.com>

	* init.cc (dll_entry): Remove unused extern.

	* include/sys/cygwin.h: Remove PID_ZOMBIE.
	* pinfo.h: Rename EXITCODE_* defines.
	(pinfo::set_exit_state): Remove parameter.
	* pinfo.cc (set_exit_state): Remove parameter.  Reverse sense of test
	so that exitcode is checked for having been set rather than not having
	been set.  Set flag when exitcode has been established.  Don't set
	PID_STATE here.
	(pinfo::init): Remove exitcode initialization.
	(pinfo::exit): Reflect change in EXITCODE_* naming.  Set flag when
	exitcode has been established.  Reflect change in arguments to
	set_process_state.
	(proc_waiter): Reflect change in arguments to set_process_state.  Set
	process_state here and only here.
	* fhandler_process.cc (fhandler_process::fill_filebuf): Reflect removal
	of PID_ZOMBIE define.
	(format_process_stat): Ditto.
	(format_process_status): Ditto.
	* sigproc.cc (pid_exists): Ditto.
	(stopped_or_terminated): Ditto.  Make sure that only low-order 16 bits of
	exitcode are used.
	* spawn.cc (spawn_guts): Reflect change in EXITCODE_* naming.

2005-01-15  Christopher Faylor  <cgf@timesys.com>

	* sigproc.cc (sig_send): Don't complain if attempt to send signal to
	myself fails after I've "execed".

2005-01-14  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_disk_file::facl): Pretend successful
	SETACL if no acls are available.
	* fhandler.cc (fhandler_base::facl): Implement to return sensible
	values on GETACL and GETACLCNT.  Pretend successful SETACL.
	* fhandler_virtual.cc (fhandler_virtual::facl): Ditto.

2005-01-13  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.h (fhandler_disk_file::touch_ctime): Declare.
	* fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): New method
	to set file's ctime.
	(fhandler_disk_file::fchmod): Try opening file for writing first.
	Set file's ctime on success.
	(fhandler_disk_file::fchown): Ditto.
	(fhandler_disk_file::facl): Ditto.

2005-01-13  Corinna Vinschen  <corinna@vinschen.de>

	* pinfo.cc (pinfo::exit): Don't access self after releasing it.
	* path.h (path_conv::path_conv): Fill path with native device
	name in case of device argument.

2005-01-13  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_serial.cc (fhandler_serial::dup): Call overlapped_setup
	for child, not for parent.

2005-01-13  Christopher Faylor  <cgf@timesys.com>

	* init.cc (dll_entry): Nuke attempt to set exit code since parent will
	use windows exit code if needed.
	* pinfo.cc (pinfo::exit): Move release() here to minimize pid creation
	race (suggested by Pierre Humblet).

2005-01-12  Christopher Faylor  <cgf@timesys.com>

	Reorganize header file inclusion throughout so that cygerrno.h comes
	first.
	* fhandler.h (select_record::thread_errno): Save any encountered errno
	here.
	(select_record::set_select_errno): New function.
	(select_record::saw_error): New function.
	(select_record::select_record): Initialize thread_errno to zero.
	* select.cc (set_handle_or_return_if_not_open): Set thread_errno on
	failure.
	(select_stuff::wait): Record errno for later resurrection in calling
	thread.
	(peek_serial): Ditto.

2005-01-12  Christopher Faylor  <cgf@timesys.com>

	* syscalls.cc (system): Use "/bin/sh" as per linux and (sorta) SUSv3.

2005-01-12  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::exit): Don't assume that this == myself.

2005-01-11  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (pinfo::init): Don't close input handle on temporary (?)
	failure.

2005-01-11  Christopher Faylor  <cgf@timesys.com>

	* pinfo.h (_pinfo::set_exit_state): Declare new function.
	(pinfo::exit): Move here from _pinfo::exit.
	* sigproc.cc (child_info::sync): Use new function to set exitcode and
	process_state.
	* pinfo.cc (_pinfo::exit): Ditto.
	(proc_waiter): Ditto.
	(_pinfo::set_exit_state): Define new function.
	(_pinfo::dup_proc_pipe): Close handle when there is no parent process
	around to care about the exit value.
	* dcrt0.cc (dll_crt0_0): Move subproc_ready synchronization later to
	make sure that myself is still mapped in parent.
	(do_exit): Reflect movement to pinfo::exit.
	(__api_fatal): Ditto.
	* exceptions.cc (signal_exit): Ditto.
	* errno.cc (errmap): Map PROC_NOT_FOUND.
	* init.cc (dll_entry): Release myself before exiting.
	* sigproc.cc (proc_can_be_signalled): Set errno appropriately.
	(sig_send): Ditto.  Also remove ill-advised test for !myself->sendsig
	since this is an indication of a process which is still initializating
	-- it is not an error.
	(child_info::sync): Don't set exitcode here.  Assume that will happen
	in proc_waiter, if necessary.
	* spawn.cc (spawn_guts): Delay "wait_for_myself" logic until later.
	Don't wait at all if the process has already exited.  Reflect movement
	to pinfo::exit.

2005-01-11  Corinna Vinschen  <corinna@vinschen.de>

	* environ.cc (build_env): Disallow empty strings and strings starting
	with '=' in Win32 environment.

2005-01-08  Pierre Humblet <pierre.humblet@ieee.org>

	* syscalls.cc (seteuid32): Only change the default dacl when
	seteuid succeeds. Do not close HKCU.

2005-01-06  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_process.cc: Use strcasematch instead of strcasecmp
	throughout.

2005-01-06  Corinna Vinschen  <corinna@vinschen.de>

	* syscalls.cc (rename): Fix behaviour in case of renaming directories
	according to SUSv3.

2005-01-06  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler_disk_file.cc (fhandler_base::open_fs): Don't allow
	opening directories for writing.

2005-01-06  Christopher Faylor  <cgf@timesys.com>

	* timer.cc (timer_thread): Pass sigev pointer value as per SuSv3 rather
	than pointer to sigev.

2005-01-05  Christopher Faylor  <cgf@timesys.com>

	* dcrt0.cc (multiple_cygwin_problem): Reorganize error message to not
	always talk about a "version" when it's not a version.
	(dll_crt0_0): Change info passed to multiple_cygwin_problem to be a
	little more precise.
	* shared.cc (user_shared_initialize): Ditto.
	(shared_info::initialize): Ditto.

2005-01-03  Christopher Faylor  <cgf@timesys.com>

	* pinfo.cc (_pinfo::dup_proc_pipe): Can't close proc pipe when execing
	or we will suffer an exit code race.

2005-01-03  Corinna Vinschen  <corinna@vinschen.de>

	* signal.cc (abort): Call _GLOBAL_REENT's __cleanup.

2005-01-03  Corinna Vinschen  <corinna@vinschen.de>

	* syscalls.cc (setmode): Call _fwalk with _GLOBAL_REENT.

2005-01-01  Christopher Faylor  <cgf@timesys.com>

	* cygthread.cc (cygthread::stub): Set inuse to false when exiting.
	(cygthread::cygthread): Actually pass name as argument to debugging
	output to avoid SEGV when strace'ing.
	(cygthread::release): Don't set stack_ptr to NULL, since it is only set
	once on first entry to a stub not on each stub iteration.
	(cygthead::exit_thread): Remove obsolete function.
	* cygthread.h (cygthread::exit_thread): Ditto.

2005-01-01  Christopher Faylor  <cgf@timesys.com>

	* shared.cc (open_shared): Don't attempt VirtualAlloc magic if first
	attempt to map memory fails.