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
|
2003-09-02 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/not-cancel.h: New file.
* sysdeps/unix/sysv/linux/x86-64/not-cancel.h: New file.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Make sure the code
in subsections has a symbol associated with it.
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (PSEUDO): Also
defined symbol for entry point to avoid cancellation.
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (PSEUDO): Likewise.
2003-09-01 Jakub Jelinek <jakub@redhat.com>
* Makefile (tests): Add tst-tls5.
(module-names): Add tst-tls5mod{,a,b,c,d,e,f}.
($(objpfx)tst-tls5mod{,a,b,c,d,e,f}.so-no-z-defs): Set to yes.
($(objpfx)tst-tls5): New.
($(objpfx)tst-tls6.out): Likewise.
(tests): Depend on $(objpfx)tst-tls6.out.
* tst-tls3.c: Include stdint.h and pthreaddef.h.
(do_test): Check pthread_self () return value alignment.
* tst-tls3mod.c: Include stdint.h and pthreaddef.h.
(tf): Check pthread_self () return value alignment.
* tst-tls5.c: New test.
* tst-tls5.h: New.
* tst-tls5mod.c: New.
* tst-tls5moda.c: New.
* tst-tls5modb.c: New.
* tst-tls5modc.c: New.
* tst-tls5modd.c: New.
* tst-tls5mode.c: New.
* tst-tls5modf.c: New.
* tst-tls6.sh: New test.
* sysdeps/pthread/pthread-functions.h (struct pthread_functions): Add
ptr___pthread_cond_timedwait and ptr___pthread_cond_timedwait_2_0.
* init.c (pthread_functions): Initialize them.
* forward.c (pthread_cond_timedwait@GLIBC_2.0,
pthread_cond_timedwait@@GLIBC_2.3.2): New forwards.
* Versions (libc): Export pthread_cond_timedwait@GLIBC_2.0,
pthread_cond_timedwait@@GLIBC_2.3.2.
2003-09-01 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/alpha/timer_create.c: New file.
* sysdeps/unix/sysv/linux/alpha/timer_delete.c: New file.
* sysdeps/unix/sysv/linux/alpha/timer_getoverr.c: New file.
* sysdeps/unix/sysv/linux/alpha/timer_gettime.c: New file.
* sysdeps/unix/sysv/linux/alpha/timer_settime.c: New file.
* sysdeps/unix/sysv/linux/alpha/Versions: New file.
* sysdeps/unix/sysv/linux/alpha/aio_cancel.c: New file.
* sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Define
_POSIX_THREAD_PRIORITY_SCHEDULING.
* sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2003-08-31 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock): Avoid
nested function, use static inline function from libio.h.
Code by Richard Henderson.
* sysdeps/pthread/bits/libc-lock.h: Mark pthread_setcancelstate as
weak.
2003-08-30 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/sparc/sparc64/Versions: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_create.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_delete.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_getoverr.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_gettime.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/timer_settime.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: New file.
* sysdeps/unix/sysv/linux/sparc/bits/semaphore.h: New file.
* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/sparc/pthread_once.c: New file.
* sysdeps/unix/sysv/linux/sparc/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/sparc/fork.c: New file.
* sysdeps/unix/sysv/linux/sparc/aio_cancel.c: New file.
* sysdeps/sparc/sparc32/sparcv9/pthread_spin_lock.c: New file.
* sysdeps/sparc/sparc32/sparcv9/pthread_spin_trylock.c: New file.
* sysdeps/sparc/sparc32/sparcv9/pthread_spin_unlock.c: New file.
* sysdeps/sparc/sparc32/pthread_spin_lock.c: New file.
* sysdeps/sparc/sparc32/pthread_spin_trylock.c: New file.
* sysdeps/sparc/sparc32/pthreaddef.h: New file.
* sysdeps/sparc/sparc64/pthread_spin_lock.c: New file.
* sysdeps/sparc/sparc64/pthread_spin_trylock.c: New file.
* sysdeps/sparc/sparc64/pthread_spin_unlock.c: New file.
* sysdeps/sparc/sparc64/pthreaddef.h: New file.
* sysdeps/sparc/tls.h: New file.
* sysdeps/sparc/tcb-offsets.sym: New file.
* sysdeps/sparc/Makefile: New file.
* sysdeps/sparc/td_ta_map_lwp2thr.c: New file.
* init.c [__sparc__] (__NR_set_tid_address): Define.
2003-08-29 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/bits/stdio-lock.h (_IO_acquire_lock,
_IO_release_lock): Define.
2003-08-29 Jakub Jelinek <jakuB@redhat.com>
* tst-cancel4.c (tf_sigwait, tf_sigwaitinfo, tf_sigtimedwait): Add
sigemptyset before sigaddset. Reported by jreiser@BitWagon.com.
2003-08-27 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread.h (pthread_exit): Remove __THROW.
(__pthread_cleanup_class): Add missing return types of member
functions.
2003-08-26 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
(lll_mutex_unlock_force): Add memory barrier between store and futex
syscall.
2003-08-25 Ulrich Drepper <drepper@redhat.com>
* tst-cancel4.c (do_test): Also unlink tempfname and remove
tempmsg in first loop.
2003-08-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
_POSIX_THREAD_PRIORITY_SCHEDULING.
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
2003-08-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
(__rtld_lock_default_lock_recursive,
__rtld_lock_default_unlock_recursive): Define.
[_LIBC && SHARED] (__rtld_lock_lock_recursive,
__rtld_lock_unlock_recursive): Define using
GL(_dl_rtld_*lock_recursive).
* init.c (__pthread_initialize_minimal_internal): Initialize
_dl_rtld_lock_recursive and _dl_rtld_unlock_recursive.
Lock GL(_dl_load_lock) the same number of times as
GL(_dl_load_lock) using non-mt implementation was nested.
* pthreadP.h (__pthread_cleanup_upto): Add hidden_proto.
* pt-longjmp.c (__pthread_cleanup_upto): Add hidden_def.
2003-08-06 Jakub Jelinek <jakub@redhat.com>
* tst-cancel17.c (do_test): Make len2 maximum of page size and
PIPE_BUF.
2003-08-07 Jakub Jelinek <jakub@redhat.com>
* pthread_create.c (__pthread_create_2_0): Clear new_attr.cpuset.
2003-08-03 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/createthread.c (do_clone): Move error handling
to first syscall error check. Move syscall error check for tkill
into __ASSUME_CLONE_STOPPED #ifdef.
2003-08-02 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED
is not defined, do explicit synchronization.
(create_thread): Do not lock pd->lock here. If __ASSUME_CLONE_STOPPED
is not defined also unlock pd->lock for non-debugging case in case
it is necessary.
* pthread_create.c (start_thread): Always get and release pd->lock
if __ASSUME_CLONE_STOPPED is not defined.
(start_thread_debug): Removed. Adjust users.
* allocatestack.c (allocate_stack): Always initialize lock if
__ASSUME_CLONE_STOPPED is not defined.
* Makefile (tests): Add tst-sched1.
* tst-sched1.c: New file.
* sysdeps/pthread/createthread.c (do_clone): Only use
sched_setschduler and pass correct parameters.
2003-07-31 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/pthread.h (pthread_attr_setstackaddr,
pthread_attr_setstacksize): Change PTHREAD_STACK_SIZE to
PTHREAD_STACK_MIN in comments.
2003-07-31 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
Shut up warnings if INTERNAL_SYSCALL_ERROR_P does not use its first
argument.
* sysdeps/unix/sysv/linux/timer_create.c (timer_create): Likewise.
* pthread_condattr_setclock.c (pthread_condattr_setclock): Likewise.
* sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Include pthreaddef.h.
(__pthread_cleanup_upto): Fix prototype.
(_longjmp_unwind): Adjust caller.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_timedlock):
Change second argument to const struct pointer.
* tst-sem8.c (main): Remove unused s2 and s3 variables.
* tst-sem9.c (main): Likewise.
* unwind.c: Include string.h for strlen prototype.
2003-07-31 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
(__pthread_cond_timedwait): Don't use cmov unless HAVE_CMOV is defined.
* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S:
Define HAVE_CMOV.
Patch by Nicholas Miell <nmiell@attbi.com>.
2003-07-30 Jakub Jelinek <jakub@redhat.com>
* init.c (__pthread_initialize_minimal_internal): Initialize
GL(dl_init_static_tls).
* pthreadP.h (__pthread_init_static_tls): New prototype.
* allocatestack.c (init_one_static_tls, __pthread_init_static_tls):
New functions.
* Makefile (tests): Add tst-tls4.
(modules-names): Add tst-tls4moda and tst-tls4modb.
($(objpfx)tst-tls4): Link against libdl and libpthread.
($(objpfx)tst-tls4.out): Depend on tst-tls4moda.so and
tst-tls4modb.so.
* tst-tls4.c: New file.
* tst-tls4moda.c: New file.
* tst-tls4modb.c: New file.
2003-06-19 Daniel Jacobowitz <drow@mvista.com>
* sysdeps/pthread/timer_create.c (timer_create): Call timer_delref
before __timer_dealloc.
* sysdeps/pthread/timer_routines.c (__timer_thread_find_matching):
Don't call list_unlink.
2003-07-29 Roland McGrath <roland@redhat.com>
* Makefile [$(build-shared) = yes] (tests): Depend on $(test-modules).
2003-07-25 Jakub Jelinek <jakub@redhat.com>
* tst-cancel17.c (do_test): Check if aio_cancel failed.
Don't reuse struct aiocb A if it failed.
Write fpathconf (fds[1], _PC_PIPE_BUF) + 2 bytes using aio_write,
not just one byte, as that does not block.
2003-07-22 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/unwind-resume.c: New file.
* sysdeps/pthread/Makefile (routines, shared-only-routines): Add
unwind-resume in csu subdir.
(CFLAGS-unwind-resume.c, CFLAGS-rt-unwind-resume.c): Compile with
exceptions.
(librt-sysdep_routines, librt-shared-only-routines): Add
rt-unwind-resume.
* sysdeps/pthread/rt-unwind-resume.c: New file.
* unwind-forcedunwind.c: New file.
* Makefile (libpthread-routines): Add unwind-forcedunwind.
(libpthread-shared-only-routines): Likewise.
(CFLAGS-unwind-forcedunwind.c): Compile with exceptions.
* pthreadP.h (pthread_cancel_init): New prototype.
* pthread_cancel.c (pthread_cancel): Call pthread_cancel_init.
* sysdeps/pthread/createthread.c (do_thread, create_thread): Make
attr argument const struct pthread_attr *.
* res.c (__res_state): Return __resp.
* descr.h: Include resolv.h.
(struct pthread): Add res field.
* pthread_create.c: Include resolv.h.
(start_thread): Initialize __resp.
* Makefile (tests): Add tst-_res1.
(module-names): Add tst-_res1mod1, tst-_res1mod2.
($(objpfx)tst-_res1mod2.so): Depend on $(objpfx)tst-_res1mod1.so.
($(objpfx)tst-_res1): Depend on $(objpfx)tst-_res1mod2.so and
libpthread.
* tst-_res1.c: New file.
* tst-_res1mod1.c: New file.
* tst-_res1mod2.c: New file.
2003-07-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/createthread.c: Don't define CLONE_STOPPED.
* Makefile: Define various *-no-z-defs variables for test DSOs
which has undefined symbols.
2003-07-21 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/pthread_once.c (__pthread_once):
Retry if the stwcx fails to store once_control.
2003-07-20 Ulrich Drepper <drepper@redhat.com>
* Makefile (libpthread-routines): Add pthread_attr_getaffinity and
pthread_attr_setaffinity.
* Versions [libpthread] (GLIBC_2.3.3): Likewise.
* sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c: New file.
* sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: New file.
* pthread_attr_destroy.c: Free cpuset element if allocated.
* pthread_create.c: Pass iattr as additional parameter to
create_thread.
* sysdeps/pthread/createthread.c: If attribute is provided and
a new thread is created with affinity set or scheduling parameters,
start thread with CLONE_STOPPED.
* sysdeps/pthread/pthread.h: Declare pthread_attr_getaffinity and
pthread_attr_setaffinity.
* sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_attr): Add
cpuset element.
2003-07-15 Ulrich Drepper <drepper@redhat.com>
* tst-tcancel-wrappers.sh: lseek and llseek are not cancelation points.
2003-07-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/configure.in: Require CFI directives also for
ppc and s390.
2003-07-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (PSEUDO):
Add cfi directives.
2003-07-12 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/tcb-offsets.sym: Add RESULT, TID, CANCELHANDLING and
CLEANUP_JMP_BUF.
* sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Use more
registers as variables. Call __pthread_mutex_unlock_usercnt.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Store TID
not self pointer in __writer. Compare with TID to determine
deadlocks.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/sh/sem_wait.S: Add cancellation support.
* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Define all the nice
macros also when compiling librt.
2003-07-11 Jakub Jelinek <jakub@redhat.com>
* Makefile (CFLAGS-pthread_once.c): Add -fexceptions
-fasynchronous-unwind-tables.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
(PSEUDO): Add cfi directives.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO):
Likewise.
2003-07-08 Jakub Jelinek <jakub@redhat.com>
* pthreadP.h (__pthread_unwind_next, __pthread_register_cancel,
__pthread_unregister_cancel): Add prototypes and hidden_proto.
* unwind.c (__pthread_unwind_next): Add hidden_def.
* cleanup.c (__pthread_register_cancel, __pthread_unregister_cancel):
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S (__new_sem_wait):
Use HIDDEN_JUMPTARGET to jump to __pthread_unwind.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S (sem_wait): Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
Likewise.
* sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once): Use
HIDDEN_JUMPTARGET to call __pthread_register_cancel,
__pthread_unregister_cancel and __pthread_unwind_next.
2003-07-04 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (PSEUDO): Use
different symbol for the cancellation syscall wrapper and
non-cancellation syscall wrapper.
(PSEUDO_END): Define.
2003-07-05 Richard Henderson <rth@redhat.com>
* sysdeps/alpha/elf/pt-initfini.c: Avoid .ent/.end.
* sysdeps/unix/sysv/linux/alpha/lowlevellock.h (lll_futex_wait,
lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
return actual return value from the syscall, not 0.
2003-07-07 Ulrich Drepper <drepper@redhat.com>
* descr.h (struct pthread): Add pid field.
* allocatestack.c (allocate_stack): Initialize pid field in descriptor.
(__reclaim_stacks): Likewise.
* init.c (sigcancel_handler): If __ASSUME_CORRECT_SI_PID is defined
also check for PID of the signal source.
(__pthread_initialize_minimal_internal): Also initialize pid field
of initial thread's descriptor.
* pthread_cancel.c: Use tgkill instead of tkill if possible.
* sysdeps/unix/sysv/linux/fork.c: Likewise.
* sysdeps/unix/sysv/linux/pt-raise.c: Likewise.
* sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
* sysdeps/unix/sysv/linux/raise.c: Likewise.
2003-07-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_push): Renamed.
Fix use of parameter.
(__libc_cleanup_pop): Likewise.
2003-07-04 Ulrich Drepper <drepper@redhat.com>
* init.c (sigcancel_handler): Change parameters to match handler
for SA_SIGACTION. Check signal number and code to recognize
invalid invocations.
2003-07-03 Roland McGrath <roland@redhat.com>
* sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr):
Apply sizeof (struct pthread) bias to r13 value.
2003-07-03 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/configure.in: Require CFI directives.
* sysdeps/pthread/librt-cancellation.c (__pthread_unwind): Remove
definition.
* pthreadP.h (__pthread_unwind): Add hidden_proto if used in
libpthread compilation.
* unwind.c (__pthread_unwind): Add hidden_def.
* Versions (libpthread) [GLIBC_PRIVATE]: Add __pthread_unwind.
2003-07-01 Ulrich Drepper <drepper@redhat.com>
* libc-cancellation.c (__libc_cleanup_routine): Define.
* sysdeps/pthread/bits/libc-lock.h (__pthread_cleanup_push): Define.
(__pthread_cleanup_pop): Define.
2003-07-01 Richard Henderson <rth@redhat.com>
* sysdeps/alpha/elf/pt-initfini.c: New file.
* sysdeps/alpha/pthread_spin_lock.S: New file.
* sysdeps/alpha/pthread_spin_trylock.S: New file.
* sysdeps/alpha/pthreaddef.h: New file.
* sysdeps/alpha/td_ta_map_lwp2thr.c: New file.
* sysdeps/alpha/tls.h: New file.
* sysdeps/unix/sysv/linux/alpha/Makefile: New file.
* sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h: New file.
* sysdeps/unix/sysv/linux/alpha/bits/semaphore.h: New file.
* sysdeps/unix/sysv/linux/alpha/createthread.c: New file.
* sysdeps/unix/sysv/linux/alpha/fork.c: New file.
* sysdeps/unix/sysv/linux/alpha/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/alpha/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/alpha/pthread_once.c: New file.
* sysdeps/unix/sysv/linux/alpha/sem_post.c: New file.
* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: New file.
2003-07-01 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Add correct
cleanup support and unwind info.
2003-06-30 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/pthread_once.S (__pthread_once):
Use correct cleanup handler registration. Add unwind info.
* sysdeps/unix/sysv/linux/unwindbuf.sym: New file.
* sysdeps/unix/sysv/linux/Makefile: Add rule to build unwindbuf.h.
* tst-once3.c: Add cleanup handler and check it is called.
* tst-once4.c: Likewise.
* tst-oncex3.c: New file.
* tst-oncex4.c: New file.
* Makefile: Add rules to build and run tst-oncex3 and tst-oncex4.
2003-06-29 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/configure.in: Check for C cleanup handling in gcc.
2003-06-27 Ulrich Drepper <drepper@redhat.com>
* tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
(tf_msgsnd): Likewise.
* tst-cancel4.c (tf_msgrcv): Strengthen test against valid
premature returns a bit more.
2003-06-26 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/librt-cancellation.c: Move __pthread_unwind
definition to the front.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rename
the cleanup functions to make the names unique. Fix dwarf opcode
un unwind table.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Rename cleanup
functions to make the names unique. Fix CFA offset for two blocks.
2003-06-25 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread.h (class __pthread_cleanup_class): Add
missing closing braces.
Patch by Christophe Saout <christophe@saout.de>.
2003-06-24 Roland McGrath <roland@redhat.com>
* pthread_mutex_trylock.c (__pthread_mutex_trylock): Typo fix.
2003-06-24 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: New file.
* sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: New file.
* pthreadP.h: Declare __find_thread_by_id.
* allocatestack.c [HP_TIMING_AVAIL]: Define __find_thread_by_id.
* pthread_clock_gettime.c: Allow using other thread's clock.
* pthread_clock_settime.c: Likewise.
* sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
* Makefile: Add rules to build and run tst-clock2.
* tst-clock2.c: New file.
2003-06-23 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Rewrite
to use exception-based cleanup handler.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
* tst-cond8.c (ch): Announce that we are done.
* pthreadP.h (__pthread_mutex_cond_lock): Mark with internal_function.
* tst-cancel17.c (tf): Retry aio_suspend in case of EINTR.
Also test aio_suspend with timeout value.
2003-06-22 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h: Mark __pthread_mutex_unlock_usercnt also hidden.
* pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Add
attribute_hidden.
* pthreadP.h (__pthread_mutex_init_internal): Mark hidden.
(__pthread_mutex_lock_internal): Likewise.
(__pthread_mutex_unlock_internal): Likewise.
(__pthread_mutex_unlock_usercnt): Declare.
* pthread_mutex_destroy.c: Always fail if used in any way.
* pthread_mutex_init.c: Update comment.
* pthread_mutex_lock.c: If NO_INCR is not defined adjust __nusers.
* pthread_mutex_timedlock.c: Adjust __nusers.
* pthread_mutex_trylock.c: Adjust __nusers.
* pthread_mutex_unlock.c: Old code is in __pthread_mutex_unlock_usercnt
and public interfaces are wrapper with pass additional parameter.
__pthread_mutex_unlock_usercnt does not adjust __nusers if second
parameter zero.
* tst-mutex8.c: New file.
* Makefile (tests): Add tst-mutex8.
* sysdeps/pthread/pthread_cond_timedwait.c: Call
__pthread_mutex_unlock_usercnt.
* sysdeps/pthread/pthread_cond_wait.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Define NO_INCR.
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
Add __nusers.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
* pthread_mutex_lock.c: Don't store THREAD_ID in __owner, use TID.
* pthread_mutex_timedlock.c: Likewise.
* pthread_mutex_trylock.c: Adjust __nusers.
* pthread_mutex_unlock.c: Compare with TID not THREAD_ID.
* tst-mutex9.c: New file.
* Makefile (tests): Add tst-mutex9.
* sysdeps/i386/tls.h: Remove THREAD_ID definition.
* sysdeps/ia64/tls.h: Likewise.
* sysdeps/powerpc/tls.h: Likewise.
* sysdeps/s390/tls.h: Likewise.
* sysdeps/sh/tls.h: Likewise.
* sysdeps/x86_64/tls.h: Likewise.
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_mutex_t):
Change type of __owner.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2003-06-19 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/ia64/sem_post.c: Move to...
* sysdeps/unix/sysv/linux/sem_post.c: ...here.
* sysdeps/unix/sysv/linux/sem_post.c: Move to...
* sysdeps/unix/sysv/linux/powerpc/sem_post.c: ... here. Pass nr + 1
instead of nr to lll_futex_wake. Only set errno and return -1
if err < 0.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (lll_futex_wait,
lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): On success
return actual return value from the syscall, not 0.
2003-06-18 Ulrich Drepper <drepper@redhat.com>
* tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
find a random value.
(tf_msgrcv): Likewise. Also don't report msgrcv returns if
errno==EIDRM.
* sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
compat_timer_settime.
* sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
compat_timer_gettime.
* sysdeps/unix/sysv/linux/timer_getoverr.c: Add prototype for
compat_timer_getoverrun.
* sysdeps/unix/sysv/linux/timer_delete.c: Add prototype for
compat_timer_delete.
* pthread_mutex_destroy.c (__pthread_mutex_destroy): For
error-checking mutex detect busy mutexes.
2003-06-17 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_mutex_lock):
Add ax to clobber list.
(lll_mutex_cond_lock): Likewise.
(lll_mutex_unlock): Likewise.
(lll_lock): Likewise.
(lll_unlock): Likewise.
* Makefile: Add rules to build and run tst-cancel18 and tst-cancelx18.
* tst-cancel18.c: New file.
* tst-cancelx18.c: New file.
* tst-cancel4.c: Test connect, creat, msgrcv, msgsnd, sendmsg, sendto,
and tcdrain.
* Makefile: Add rules to build and run tst-cancel17 and tst-cancel17x.
* tst-cancel17.c: New file.
* tst-cancelx17.c: New file.
* sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
* sysdeps/unix/sysv/linux/sigwait.c: New file.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
* tst-cancel4.c: Test open, close, pread, pwrite, fsync, and msync.
2003-06-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/createthread.c (create_thread): Set
header.multiple_threads unconditionally.
* allocatestack.c (allocate_stack): Likewise.
* descr.h (struct pthread): Add header.multiple_threads
unconditionally.
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (CENABLE, CDISABLE):
Define for librt. #error if neither libpthread, libc nor librt.
* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (CENABLE, CDISABLE):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (CENABLE,
CDISABLE): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (CENABLE,
CDISABLE): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h (CENABLE,
CDISABLE): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (CENABLE,
CDISABLE): Likewise. Access header.multiple_threads outside of
libc and libpthread.
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (CENABLE, CDISABLE):
Likewise.
* sysdeps/x86_64/tls.h (tcbhead_t): Add multiple_threads.
* sysdeps/x86_64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Define.
2003-06-17 Ulrich Drepper <drepper@redhat.com>
* tst-cancel4.c: Add tests for the socket and signal functions, pause.
Also test early cancellation before the thread reaches the cancellation
point.
* Makefile: Compile forward.c with exceptions.
* sysdeps/unix/sysv/linux/sleep.c: New file.
2003-06-16 Ulrich Drepper <drepper@redhat.com>
* Makefile: Add CFLAGS definition to compile function wrappers
duplicated from libc with exceptions.
* tst-cancel4.c: Also check cancellation handlers.
* Makefile: Add rules to build and run tst-cancel16 and
tst-cancelx16. Add missing CFLAGS definitions.
* tst-cancel16.c: New file.
* tst-cancelx16.c: New file.
2003-06-15 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h
(DL_SYSINFO_IMPLEMENTATION): Use CFI opcodes.
* sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
(DL_SYSINFO_IMPLEMENTATION): Likewise.
* pthreadP.h (LIBC_CANCEL_ASYNC): Also define for librt.
(LIBC_CANCEL_RESET): Likewise.
Declare __librt_enable_asynccancel and __librt_disable_asynccancel.
* sysdeps/pthread/Makefile (librt-sysdep_routines): Add
librt-cancellation.
(CFLAGS-libcrt-cancellation.c): Define.
* sysdeps/pthread/librt-cancellation.c: New file.
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define all the nice
macros also when compiling librt.
* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/timer_create.c: Add prototype for
compat_timer_create.
2003-06-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/posix-timer.h (timespec_compare): Always inline.
* sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
__register_atfork.
* sysdeps/unix/sysv/linux/register-atfork.c (__register_atfork):
Add libc_hidden_def.
2003-06-13 Roland McGrath <roland@redhat.com>
* sysdeps/x86_64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Pass FS
constant from <sys/reg.h> to ps_get_thread_area, not register contents.
2003-06-11 Ulrich Drepper <drepper@redhat.com>
* allocatestack.c (queue_stack): Always inline.
* ptreadhP.h (__do_cancel): Likewise.
2003-06-10 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait): Fix
a typo.
2003-06-10 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
(__pthread_cond_signal): Remove incorrect second addition for
cond_lock!=0.
2003-06-09 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
(__pthread_cond_signal): Use correct futex pointer in
__lll_mutex_lock_wait call.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
(__pthread_cond_signal): Some more tweaks to handle cond_lock!=0.
2003-06-08 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/s390/sem_wait.c (__new_sem_wait): Make
cancelable.
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Remove
hand-written CFI generation code. Since ENTRY/END also initiated
CFI frames this caused two CFI sets to be generated.
2003-06-07 Ulrich Drepper <drepper@redhat.com>
* cleanup_routine.c: New file.
* Versions (libpthread) [GLIBC_2.3.3]: Add __pthread_cleanup_routine.
* sysdeps/pthread/pthread.h: Add support for fully exception-based
cleanup handling.
* Makefile (libpthread-routines): Add cleanup_routine.
Add more CFLAGS variables to compile with exceptions. Add comments
why which file needs unwind tables.
(tests) [have-forced-unwind==yes]: Add tst-cancelx* and tst-cleanupx*
tests.
* tst-cancelx1.c: New file.
* tst-cancelx2.c: New file.
* tst-cancelx3.c: New file.
* tst-cancelx4.c: New file.
* tst-cancelx5.c: New file.
* tst-cancelx6.c: New file.
* tst-cancelx7.c: New file.
* tst-cancelx8.c: New file.
* tst-cancelx9.c: New file.
* tst-cancelx10.c: New file.
* tst-cancelx11.c: New file.
* tst-cancelx12.c: New file.
* tst-cancelx13.c: New file.
* tst-cancelx14.c: New file.
* tst-cancelx15.c: New file.
* tst-cleanupx0.c: New file.
* tst-cleanupx0.expect: New file.
* tst-cleanupx1.c: New file.
* tst-cleanupx2.c: New file.
* tst-cleanupx3.c: New file.
* tst-cleanup0.c: Make standard compliant.
* tst-cleanup1.c: Likewise.
* sysdeps/unix/sysv/linux/sem_timedwait.c: Add cancellation support.
* sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* sysdeps/i386/tcb-offsets.sym: Add RESULT, CANCELHANDLING, and
CLEANUP_JMP_BUF.
* sysdeps/x86_64/tcb-offsets.sym: Likewise.
* tst-cancel12.c: New file.
* tst-cancel13.c: New file.
* tst-cancel14.c: New file.
* tst-cancel15.c: New file.
* Makefile (tests): Add tst-cancel12, tst-cancel13, tst-cancel14,
and tst-cancel15.
* tst-cancel1.c: Add some comments.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Compute relative
timeout correctly.
2003-06-06 Ulrich Drepper <drepper@redhat.com>
* Makefile (CFLAGS-pthread_cancel.c): Define.
2003-06-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_rwlock_t):
Change type of __writer element to int.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
* sysdeps/i386/tcb-offsets.sym: Replace SELF entry with TID entry.
* sysdeps/x86_64/tcb-offsets.sym: Likewise.
* pthread_rwlock_trywrlock.c: Store TID not self pointer in __writer.
Compare with TID to determine deadlocks.
* sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_timedwrlock.: Likewise.
* sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
* Makefile (tests): Add tst-rwlock12.
* tst-rwlock12.c: New file.
2003-06-05 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait,
__lll_timedlock_wait, lll_unlock_wake_cb, __lll_timedwait_tid):
Remove bogus hidden_proto.
* sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_lock,
lll_unlock_wake_cb, ___lll_timedwait_tid): Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (___lll_mutex_lock,
___lll_mutex_timedlock): Likewise.
2003-06-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
(__pthread_cond_signal): Add some code to eventually handle
cond_lock!=0.
2003-06-01 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-exec4.
(tst-exec4-ARGS): Define.
* tst-exec4.c: New file.
2003-05-31 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
Also fail if tv_nsec < 0.
(__lll_timedwait_tid): Likewise.
* sysdeps/unix/sysv/linux/sem_timedwait.c (sem_timedwait): Likewise.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_timedwait_tid):
Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevellock.c (___lll_timedwait_tid):
Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevelmutex.c (__lll_mutex_timedlock):
Likewise.
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c (sem_timedwait):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_timedwait_tid):
Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_timedwait_tid):
Likewise.
* Makefile (tests): Add tst-sem8 and tst-sem9.
* tst-sem8.c: New file.
* tst-sem9.c: New file.
* sem_open.c: Fix creation of in_use record if the file exists but
no internal record.
* posix-timer.h: Remove old, unused timer_id2ptr and timer_ptr2id
definitions.
* sysdeps/pthread/timer_create.c (timer_create): In case
evp==NULL, assign timer ID to sival_ptr.
* descr.h (struct pthread_unwind_buf): Change type of prev element to
struct pthread_unwind_buf *.
(struct pthread): Likewise for cleanup_jmp_buf element.
* cleanup.c (__pthread_register_cancel): Add cast to avoid warning.
* cleanup_defer.c (__pthread_register_cancel_defer): Likewise.
* unwind.c (__pthread_unwind_next): Likewise.
2003-05-30 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h
(lll_futex_timed_wait): Use int for futex value parameter.
(lll_futex_wake): Likewise.
(lll_futex_requeue): Likewise.
* sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
Replace one memory operation with one register operation.
* tst-join4.c (do_test): Fix error message.
* tst-rwlock6.c (do_test): Use correct format specifier.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
(__lll_mutex_lock_wait): Replace one memory operation with one
register operation.
* sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S
(__lll_mutex_lock_wait): Likewise.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h
(__lll_mutex_cond_lock): Add one to value parameter of
__lll_lock_wait to reflect reality in the futex syscall.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
(lll_mutex_cond_lock): Likewise.
2003-05-30 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/s390/lowlevellock.h (__lll_mutex_cond_lock):
New function.
(lll_mutex_cond_lock): Define.
2003-05-29 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-signal6.
* tst-signal6.c: New file.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h
(__lll_mutex_unlock_force): New function
(lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h
(__lll_mutex_unlock_force): New function.
(lll_mutex_unlock_force): Use __lll_mutex_unlock_force.
* tst-rwlock7.c (do_test): Use correct format specifier.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_requeue):
Find break parameter in correct asm argument.
2003-05-27 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_clobbers):
Remove out4.
(lll_futex_requeue): Fix __o3 constraint, return negative errno if
error occured.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
Add __mutex.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h (FUTEX_REQUEUE,
lll_futex_requeue, lll_mutex_unlock_force): Define.
2003-05-30 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
(pthread_cond_t): Add __mutex.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (FUTEX_REQUEUE,
lll_futex_requeue, lll_mutex_unlock_force): Define.
2003-05-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/tcb-offsets.sym: Define MUTEX_FUTEX.
* sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h (pthread_cond_t):
Add __mutex field.
* sysdeps/unix/sysv/linux/sh/lowlevellock.h (SYSCALL_WITH_INST_PAD):
Define.
(lll_futex_wait, lll_futex_wake): Define.
* sysdeps/unix/sysv/linux/sh/sh4/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: Try using
FUTEX_REQUEUE instead of FUTEX_WAIT.
* sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Remember
mutex which was used in condvar structure. Call
__pthread_mutex_cond_lock instead of __pthread_mutex_lock_internal.
* sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Don't
include tcb-offsets.h. Read wakeup value in locked region.
Use the value of gbr register as THREAD_ID.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove futex related
macros.
2003-05-28 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread_cond_broadcast.c
(__pthread_cond_broadcast): Fix typo: MAX_INT -> INT_MAX.
2003-05-26 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Fix
typo in register name.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Use parameters
correctly. Actually use requeue. Little optimization.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Store
mutex address early. Handle cancellation state as 32-bit value.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
Remove unnecessary label.
2003-05-25 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread_cond_broadcast.c: Try using FUTEX_REQUEUE
instead of FUTEX_WAIT.
* sysdeps/pthread/pthread_cond_signal.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
* sysdeps/pthread/pthread_cond_timedwait.c: Remember mutex which was
used in condvar structure. Call __pthread_mutex_cond_lock instead
of __pthread_mutex_lock_internal.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
* sysdeps/pthread/pthread_cond_wait.c: Likewise.
(__condvar_cleanup): Always call __pthread_mutex_cond_lock.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/Makefile (libpthread-sysdep_routines):
Add pthread_mutex_cond_lock.
* sysdeps/unix/sysv/linux/lowlevelcond.sym: Add dep_mutex.
* sysdeps/unix/sysv/linux/pthread_cond_mutex_lock.c: New file.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define
lll_mutex_cond_lock.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
Add __mutex field.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
* sysdeps/i386/tcb-offsets.sym: Define MUTEX_FUTEX.
* sysdeps/x86_64/tcb-offsets.sym: Likewise.
* pthreadP.h: Declare __pthread_mutex_cond_lock.
* pthread_mutex_lock.c: Define LLL_MUTEX_LOCK if not already defined.
Use it instead of lll_mutex_lock. If __pthread_mutex_lock is a
macro don't define aliases.
* cancellation.c: Remove __pthread_enable_asynccancel_2.
* pthreadP.h: Remove declaration of __pthread_enable_asynccancel_2.
* sysdeps/pthread/pthread_cond_timedwait.c: Use
__pthread_enable_asynccancel instead of __pthread_enable_asynccancel_2.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
* sysdeps/pthread/pthread_cond_wait.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
2003-05-17 Ulrich Drepper <drepper@redhat.com>
* sem_open.c: Fix one endless loop. Implement correct semantics
wrt opening the same semaphore more then once.
* sem_close.c: Adjust for sem_open change.
* semaphoreP.h: Include <semaphore.h>. Define struct inuse_sem.
Declare __sem_mappings, __sem_mappings_lock, __sem_search.
* Makefile (tests): Add tst-sem7.
* tst-sem7.c: New file.
2003-05-16 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/register-atfork.c (libc_freeres_fn): Fix
uninitialized variable braino.
2003-05-16 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/timer_gettime.c (timer_gettime): Correct
test for syscall availability.
* sysdeps/unix/sysv/linux/timer_settime.c (timer_settime): Set
__no_posix_timers to -1 if the syscalls don't exist.
* pthread_join.c (pthread_join): Set tid field of the joined
thread to -1. This isn't necessary but helps to recognize some
error conditions with almost no cost.
* allocatestack.c (FREE_P): Also negative values indicate an
unused stack.
* unwind.c: Include <unistd.h>.
2003-05-14 Ulrich Drepper <drepper@redhat.com>
* Makefile ($(objpfx)$(multidir)): Add rule to create the directory.
2003-05-14 Jakub Jelinek <jakub@redhat.com>
* Makefile (crti-objs, crtn-objs): New variables.
(omit-deps, extra-objs): Add crtn.
($(objpfx)libpthread.so): Depend on both crti and crtn
and links to them in multidir.
($(objpfx)crtn.S, $(objpfx)crtn.o): New rules.
2003-05-12 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
(lll_mutex_unlock): Use atomic_exchange_rel.
2003-05-11 Ulrich Drepper <drepper@redhat.com>
* cond-perf.c (cons): Add missing locking around setting of alldone.
2003-05-10 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove futex
related macros.
* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
2003-05-09 Ulrich Drepper <drepper@redhat.com>
* tst-sem6.c: New file.
* Makefile (tests): Add tst-sem6.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h (___lll_mutex_unlock):
Use atomic_exchange_rel instead of atomic_exchange.
* sysdeps/unix/sysv/linux/lowlevellock.c (lll_unlock_wake_cb):
Likewise.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Improve quality of
code for lll_futex_wait and lll_futex_wake in static apps. Use
vsyscall is possible.
* sysdeps/unix/sysv/linux/pthread_getaffinity.c: New file.
* sysdeps/unix/sysv/linux/pthread_setaffinity.c: New file.
* sysdeps/pthread/pthread.h: Declare pthread_getaffinity_np and
pthread_setaffinity_np.
* Versions [libpthread] (GLIBC_2.3.3): Add pthread_getaffinity_np
and pthread_setaffinity_np.
* Makefile (libpthread-routines): Add pthread_getaffinity and
pthread_setaffinity.
* allocatestack.c (allocate_stack): If ARCH_RETRY_MMAP is defined,
use it in case mmap to allocate the stack fails.
* sysdeps/unix/sysv/linux/x86_64/Makefile: Don't define
ARCH_MAP_FLAGS here.
* sysdeps/x86_64/pthreaddef.h: Define ARCH_MAP_FLAGS and
ARCH_RETRY_MMAP.
2003-05-08 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/fork.c: Complete rewrite of the atfork
handler implementation. It is now lockless in fork().
* sysdeps/unix/sysv/linux/register-atfork.c: Likewise.
* sysdeps/unix/sysv/linux/unregister-atfork.c: Likewise.
* sysdeps/unix/sysv/linux/fork.h: Don't include <link.h>. Don't
declare the __fork_*_lists.
(struct fork_handler): Include pointers to all three functions.
Add next, refcntr and need_signal elements.
(__fork_handlers): New declaration.
(__register_atfork_malloc): Remove declaration.
(HAVE_register_atfork_malloc): Remove definition.
* sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove
__pthread_child_handler variable.
(__libc_pthread_init): Use __register_atfork instead of explicitly
adding to the list.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define lll_futex_wait
and lll_futex_wake.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
* unwind.c (unwind_cleanup): Print error message and then abort. This
function must never be reached.
* cond-perf.c: New file.
2003-05-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/tls.h (TLS_INIT_TP): Include \n in error message.
2003-05-04 Roland McGrath <roland@redhat.com>
* Makefile ($(objpfx)../libc.so): New target.
2003-05-02 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
(pthread_condattr_t): Size is only an int, don't use long for
alignment.
(pthread_mutexattr_t): Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
2003-05-01 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/tls.h: Define THREAD_ID.
* sysdeps/ia64/tls.h: Likewise.
* sysdeps/powerpc/tls.h: Likewise.
* sysdeps/s390/tls.h: Likewise.
* sysdeps/sh/tls.h: Likewise.
* sysdeps/x86_64/tls.h: Likewise.
* pthread_mutex_lock.c: Use THREAD_ID instead of THREAD_SELF to
record ownership.
* pthread_mutex_timedlock.c: Likewise.
* pthread_mutex_trylock.c: Likewise.
* pthread_mutex_unlock.c: Likewise.
* pthread_rwlock_trywrlock.c: Likewise.
* sysdeps/pthread/pthread_rwlocklock_rdlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
* sysdeps/pthread/createthread.c (create_thread): Use CLONE_SYSVSEM
flag.
2003-04-29 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
(__SIZEOF_PTHREAD_COND_T): Define to 48.
(pthread_rwlock_t): Add 16 bytes of pad instead of 8 before __flags.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h (pthread_cond_t):
Make __align long long instead of long.
(pthread_rwlock_t): Formatting.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h
(pthread_rwlock_t): Formatting.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
(pthread_cond_t): Make __align long long instead of long.
(pthread_rwlock_t): Move __flags field to the same position as in
linuxthreads.
2003-04-30 Ulrich Drepper <drepper@redhat.com>
* tst-rwlock6.c (do_test): Use correct printf format specifiers.
* tst-rwlock7.c (do_test): Likewise.
2003-04-26 Roland McGrath <roland@redhat.com>
* Makefile ($(test-modules)): Depend on $(common-objpfx)shlib.lds.
2003-04-22 Jakub Jelinek <jakub@redhat.com>
* allocatestack.c (TLS_TPADJ): Add TLS_PRE_TCB_SIZE instead of
sizeof (struct pthread).
(allocate_stack): Subtract TLS_PRE_TCB_SIZE bytes instead of
1 struct pthread.
* sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define
to 0.
(TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of
struct pthread.
(TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad
to 32-bit bytes.
(INSTALL_DTV, GET_DTV, THREAD_DTV): tcbhead_t is immediately before
tcbp.
(TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE
unneccessarily.
(NO_TLS_OFFSET): Define.
* sysdeps/unix/sysv/linux/powerpc/createthread.c (TLS_VALUE): Don't
add TLS_TCB_SIZE unnecessarily.
2003-04-22 Roland McGrath <roland@redhat.com>
* Makeconfig (shared-thread-library): Reverse link order to work
around linker bug.
2003-04-22 Ulrich Drepper <drepper@redhat.com>
* semaphore.h: Fix typo in comment.
2003-04-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/sigfillset.c: New file.
* init.c (__pthread_initialize_minimal): Don't block SIGTIMER.
* pthreadP.h: Make SIGTIMER and SIGCANCEL the same.
* sysdeps/pthread/pthread_sigmask.c: Remove handling of SIGTIMER.
* sysdeps/pthread/sigaction.c: Likewise.
* sysdeps/pthread/sigprocmask.c: New file.
* sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): Define as
__SIGRTMIN+1.
* sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
Block SIGTIMER. Also handle SI_TKILL events and terminate thread
in this case.
2003-04-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h
(DL_SYSINFO_IMPLEMENTATION): Add .eh_frame information.
* sysdeps/unix/sysv/linux/unregister-atfork.c
(__unregister_atfork): Don't free memory not allocated dynamically.
* semaphore.h: Remove __THROW marker from cancellation points.
* nptl/sysdeps/pthread/pthread.h: Likewise.
2003-04-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread.h: Don't mark pthread_testcancel,
pthread_cancel, pthread_setcancelstate, and pthread_setcanceltype with
__THROW.
2003-04-16 Jakub Jelinek <jakub@redhat.com>
* tst-cancel4.c (do_test): Use %zd instead of %d when printing cnt.
2003-04-15 Roland McGrath <roland@redhat.com>
* forward.c (__pthread_unwind): Tweak to avoid warning.
2003-04-15 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h: Move THREAD_ATOMIC_* replacements to the top.
2003-04-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Don't
overflow CFA advance instructions.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
2003-04-14 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/tls.h: Rename LOCK to LOCK_PREFIX.
* sysdeps/i386/pthread_spin_lock.c: Likewise.
* sysdeps/x86_64/tls.h: Likewise. Define LOCK_PREFIX if not already
defined.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Use
DW_CFA_advance_loc2 for .Laddl-.Lsubl.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
DW_CFA_advance_loc for .Laddl-.Lsubl.
2003-04-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Don't use
position-independent unwind data for static libraries.
Add missing unwind info. Add comments.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Add unwind info.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
2003-04-12 Ulrich Drepper <drepper@redhat.com>
* Makefile: Make sure all cancellation points are compiled with
exception and asynchronous unwind tables.
* sysdeps/x86_64/tls.h (THREAD_SETMEM): Word around compiler bug
which mishandles loading of global object addresses in PIC.
(THREAD_SETMEM_NC): Likewise.
2003-04-11 Ulrich Drepper <drepper@redhat.com>
* pthread.h: Define new data structure for cleanup buffer. Declare
new cleanup handler interfaces.
* descr.h: Include <unwind.h> if necessary. Define pthread_unwind_buf.
(struct pthread): Add cleanup_jmp_buf pointer. Define
HAVE_CLEANUP_JMP_BUF and not HAVE_CANCELBUF.
* pthreadP.h: Declare __pthread_unwind. Define __do_cancel to use
it. Declare old cleanup handler installation functions.
* cleanup.c: Rewrite. Install handler for unwind-based cleanup
handling.
* cleanup_defer.c: Likewise.
* cleanup_compat.c: New file. Old cleanup code.
* cleanup_def_compat.c: New file. Old cleanup code.
* pthread_create.c (start_thread): Initialize cleanup_jmp_buf element
if own thread descriptor.
* unwind.c: New file.
* forward.c: Add __pthread_unwind.
* init.c (pthread_functions): Add __pthread_unwind.
* sysdeps/pthread/pthread-functions.s (struct pthread_functions):
Add ptr___pthread_unwind.
* Versions [GLIBC_2.3.3] (libpthread): Export new cleanup handling
and unwind function.
* Makefile (libpthread-routines): Add cleanup_compat,
cleanup_def_compat, and unwind. Define CFLAGS to enable unwind
table generation if necessary.
* version.c: Record whether unwind support is compiled in.
* sysdeps/pthread/configure.in: Add checks for unwind unterfaces.
* sysdeps/pthread/bits/libc-lock.h: Add prototypes of the old cleanup
handler interfaces.
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Add quite a bit of
complication to generate unwind information for syscall wrappers.
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define
__cleanup_fct_attribute.
* Makefile: Add rules to build and run tst-cleanup0.
* tst-cleanup0.c: New file.
* tst-cleanup0.expect: New file.
* pthread_create.c (deallocate_tsd): Don't take parameter. Adjust
caller. Optimize to avoid often unecessary local variable.
2003-04-11 Roland McGrath <roland@redhat.com>
* Makefile ($(objpfx)multidir.mk): New target, generated makefile that
sets variable `multidir'; include that.
(generated): Add it.
($(objpfx)$(multidir)/crti.o): New target.
[$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.
2003-04-11 Ulrich Drepper <drepper@redhat.com>
* tst-attr2.c (do_test): Add cast to avoid warning.
* tst-mutex4.c (do_test): Likewise.
2003-04-10 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Reset CPU clocks
in child.
2003-04-09 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-detach1.
* tst-detach1.c: New file.
2003-04-08 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread.h: Remove duplicate
pthread_cleanup_{push,pop} definitions.
* tst-barrier2.c: Eliminate warnings.
* tst-cancel4.c: Likewise.
* tst-cond4.c: Likewise.
* tst-cond6.c: Likewise.
* tst-detach1.c: Likewise.
* tst-rwlock4.c: Likewise.
* tst-rwlock6.c: Likewise.
* tst-rwlock7.c: Likewise.
* tst-sem3.c: Likewise.
* tst-spin2.c: Likewise.
* tst-umask1.c: Likewise.
2003-04-07 Ulrich Drepper <drepper@redhat.com>
* pthread_detach.c (pthread_detach): Fix test for invalid TID.
2003-04-06 Ulrich Drepper <drepper@redhat.com>
* descr.h (struct pthread): Move cancelhandling member to the front.
2003-04-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/register-atfork.c: Define malloc_prepare,
malloc_parent, and malloc_child statically.
(__register_atfork_malloc): New function.
(free_mem): Don't free any of the malloc_* variables on the list.
* sysdeps/unix/sysv/linux/fork.h: Declare __register_atfork_malloc.
Define HAVE_register_atfork_malloc.
2003-04-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/createthread.c (create_thread): Add some more
comments explaining when to set multiple_threads and when not.
* pthreadP.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
THREAD_ATOMIC_BIT_SET if not already defined.
* sysdeps/i386/tls.h: Define THREAD_ATOMIC_CMPXCHG_VAL and
THREAD_ATOMIC_BIT_SET:
* sysdeps/x86_64/tls.h: Likewise.
* cleanup_defer.c (_pthread_cleanup_push_defer): Rewrite to use
THREAD_ATOMIC_CMPXCHG_VAL.
(_pthread_cleanup_pop_restore): Likewise.
* cancellation.c (__pthread_enable_asynccancel): Likewise.
(__pthread_enable_asynccancel_2): Likewise.
(__pthread_disable_asynccancel): Likewise.
* libc-cancellation.c (__libc_enable_asynccancel): Likewise.
(__libc_disable_asynccancel): Likewise.
* init.c (sigcancel_handler): Likewise.
* pthread_setcancelstate.c (__pthread_setcancelstate): Likewise.
* pthread_setcanceltype.c (__pthread_setcanceltype): Likewise.
2003-04-03 Ulrich Drepper <drepper@redhat.com>
* init.c (sigcancel_handler): Don't set EXITING_BIT here.
* libc-cancellation.c (__libc_enable_asynccancel): Likewise.
* pthreadP.h (__do_cancel): Set EXITING_BIT here.
* Makefile (tests): Add tst-cancel11.
* tst-cancel11.c: New file.
2003-04-01 Ulrich Drepper <drepper@redhat.com>
* pthread_create.c (deallocate_tsd): Clear/free memory after the last
round, not the first. Use specific_used flag instead of local
found_nonzero variable. Use THREAD_[SG]ETMEM where possible.
(__free_tcb): Don't call deallocate_tsd here.
(start_thread): Call deallocate_tsd here.
* pthread_setspecific.c: Set specific_used flag really only when
needed.
* Makefile (tests): Add tst-tsd3.c and tst-tsd4.
* tst-tsd3.c: New file.
* tst-tsd4.c: New file.
2003-03-31 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_mutex_lock):
Use atomic_exchange_and_add instead of __lll_add.
(__lll_mutex_timedlock): Likewise.
Patch by Ian Wienand.
2003-03-24 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
(SINGLE_THREAD_P): Fix typo.
* tst-cancel-wrappers.sh: Handle '.'ed symbols.
2003-03-31 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-align.
* tst-align.c: New file.
* sysdeps/i386/Makefile: Define CFLAGS-tst-align.
* sysdeps/i386/tls.h (CALL_THREAD_FCT): Align stack of called
function correctly.
* tst-tsd2.c: Add casts to avoid warnings.
2003-03-30 Ulrich Drepper <drepper@redhat.com>
* descr.h (struct pthread): Move most often used elements to the front.
2003-03-29 Ulrich Drepper <drepper@redhat.com>
* Makefile (libpthread-routines): Add pthread_atfork.
(libpthread-static-only-routines): Add pthread_atfork.
2003-03-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/tls.h: Include nptl/descr.h after the definition
of TLS_DTV_AT_TP.
(INSTALL_DTV): Add parens.
(THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
Use passed descr instead of THREAD_SELF.
* sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
(__lll_mutex_timedlock_wait): Correct expected value after
spurious wakeup.
* sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S:
Release lock before waking up the waiters.
* sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Correct exit
criteria. Reorderstruct passed to cleanup handler. Fix
handling of cancellation and failung pthread_mutex_unlock call.
Use __pthread_enable_asynccancel_2 instead of
__pthread_enable_asynccancel.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
Return result of lock re-get if it fails.
* sysdeps/unix/sysv/linux/sh/pthread_once.S: Fix wrong argument
for __pthread_cleanup_push.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Fix
completely broken rwlock implementation.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_post.S: Fix error value. Use
versioned_symbol macro.
* sysdeps/unix/sysv/linux/sh/sem_trywait.S: Use versioned_symbol macro.
* sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
2003-03-27 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/kernel-posix-timers.h: Don't declare
__timer_helper_thread. Declare __start_helper_thread, __helper_once,
and __helper_tid.
(struct timer): Remove th and bar field.
* sysdeps/unix/sysv/linux/timer_create.c (timer_create): Remove
debugging code. Create only one helper thread.
* sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Don't kill
helper thread.
* sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
Renamed. Define statically. Use thread info from siginfo.
(__helper_once): New variable.
(__helper_tid): New variable.
(__reset_helper_control): New function.
(__start_helper_thread): New function.
* pthread_create.c (start_thread): Don't use setjmp inside
__builtin_expect to work around gcc bug.
* sysdeps/unix/sysv/linux/timer_delete.c (timer_delete): Even if
timer_delete syscall fails, but not with ENOSYS, set
__no_posix_timers.
* sysdeps/unix/sysv/linux/timer_settime.c [!__ASSUME_POSIX_TIMERS]
(timer_settime): Fix typo.
* sysdeps/unix/sysv/linux/timer_getoverr.c
[!__ASSUME_POSIX_TIMERS] (timer_getoverrun): Likewise.
2003-03-27 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Fix
offset of cleanupbuf.__prev.
2003-03-26 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/timer_getoverr.c: Fix typo in name
of included file.
2003-03-26 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/timer_create.c (timer_create): If EVP ==
NULL provide default definition to syscall.
2003-03-25 Roland McGrath <roland@redhat.com>
* sysdeps/pthread/posix-timer.h (TIMER_MAX): Define if not defined.
(timer_id2ptr): Fix typo.
2003-03-25 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h: Define SIGCANCEL and SIGTIMER.
* sysdeps/i386/pthreaddef.h: Remove SIGCANCEL definition.
* sysdeps/ia64/pthreaddef.h: Likewise.
* sysdeps/powerpc/pthreaddef.h: Likewise.
* sysdeps/s390/pthreaddef.h: Likewise.
* sysdeps/sh/pthreaddef.h: Likewise.
* sysdeps/x86_64/pthreaddef.h: Likewise.
* init.c (__pthread_initialize_minimal): Block SIGTIMER.
* sysdeps/pthread/sigaction.c: Also prevent SIGTIMER handler from
being changed.
* sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Make sure
SIGTIMER is not unblocked.
* sysdeps/unix/sysv/linux/allocrtsig.c (current_rtmin): One more
RT signal taken.
* sysdeps/unix/sysv/linux/pthread_kill.c: Do not allow SIGTIMER to
be send.
* sysdeps/pthread/posix-timer.h (timer_id2ptr, timer_ptr2id): Just
pass pointer through as ID.
* sysdeps/unix/sysv/linux/bits/local_lim.h (TIMER_MAX): Removed.
* sysdeps/unix/sysv/linux/kernel-posix-timers.h: New file.
* sysdeps/unix/sysv/linux/timer_create.c: New file.
* sysdeps/unix/sysv/linux/timer_delete.c: New file.
* sysdeps/unix/sysv/linux/timer_getoverr.c: New file.
* sysdeps/unix/sysv/linux/timer_gettime.c: New file.
* sysdeps/unix/sysv/linux/timer_routines.c: New file.
* sysdeps/unix/sysv/linux/timer_settime.c: New file.
* sysdeps/unix/sysv/linux/ia64/Versions: New file.
* sysdeps/unix/sysv/linux/ia64/timer_create.c: New file.
* sysdeps/unix/sysv/linux/ia64/timer_delete.c: New file.
* sysdeps/unix/sysv/linux/ia64/timer_getoverr.c: New file.
* sysdeps/unix/sysv/linux/ia64/timer_gettime.c: New file.
* sysdeps/unix/sysv/linux/ia64/timer_settime.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_create.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_delete.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_getoverr.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_gettime.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/timer_settime.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/Versions: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/timer_create.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/timer_delete.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/timer_getoverr.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/timer_gettime.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/timer_settime.c: New file.
* sysdeps/unix/sysv/linux/x86_64/Versions: New file.
* sysdeps/unix/sysv/linux/x86_64/compat-timer.h: New file.
* sysdeps/unix/sysv/linux/x86_64/timer_create.c: New file.
* sysdeps/unix/sysv/linux/x86_64/timer_delete.c: New file.
* sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c: New file.
* sysdeps/unix/sysv/linux/x86_64/timer_gettime.c: New file.
* sysdeps/unix/sysv/linux/x86_64/timer_settime.c: New file.
* pthreadP.h: Remove FRAME_LEFT definition.
* cleanup.c (_pthread_cleanup_push): Don't check for reference to
already left frame. Programs which have this problem are not POSIX
compliant.
* cleanup_defer.c (_pthread_cleanup_push_defer): Likewise.
2003-03-24 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/tst-timer.c: Check return values of the
functions we test.
2003-03-23 Roland McGrath <roland@redhat.com>
* tst-tls3.c (do_test) [! HAVE___THREAD]: Don't test anything.
* tst-tls3mod.c: Likewise.
* tst-tls1.c: Likewise.
* tst-tls2.c: Likewise.
* tst-mutex5.c (do_test): Unlock before destroy, otherwise we invoke
undefined behavior.
* tst-join5.c (tf1, tf2): Add a cast.
* Makeconfig (includes): Append -I$(..)nptl to this variable.
* tst-barrier2.c (do_test) [! _POSIX_THREAD_PROCESS_SHARED]:
Don't test anything.
* tst-cond4.c: Likewise.
* tst-cond6.c: Likewise.
* tst-flock2.c: Likewise.
* tst-mutex4.c: Likewise.
* tst-rwlock4.c: Likewise.
* tst-signal1.c: Likewise.
* tst-spin2.c: Likewise.
* tst-cond11.c [! _POSIX_CLOCK_SELECTION]: Likewise.
* tst-mutex4.c: Use test-skeleton.c.
* tst-spin2.c: Likewise.
* tst-sysconf.c: Likewise.
* tst-barrier2.c: Likewise.
* tst-cond4.c: Likewise.
* tst-cond6.c: Likewise.
* tst-rwlock4.c: Likewise.
* tst-unload.c: Likewise.
* tst-flock2.c (do_test): Use return instead of exit.
2003-03-22 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/fork.c (__fork): Add libc_hidden_def.
2003-03-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h
(__lll_mutex_trylock): Use atomic_compare_and_exchange_val_acq
instead of __lll_compare_and_swap.
* sysdeps/unix/sysv/linux/ia64/pthread_once.c (__pthread_once):
Likewise.
Removed definition if __lll_compare_and_swap.
* cancellation.c: Adjust for new form of compare&exchange macros.
* cleanup_defer.c: Likewise.
* init.c: Likewise.
* libc-cancellation.c: Likewise.
* old_pthread_cond_broadcast.c: Likewise.
* old_pthread_cond_signal.c: Likewise.
* old_pthread_cond_timedwait.c: Likewise.
* old_pthread_cond_wait.c: Likewise.
* pthread_cancel.c: Likewise.
* pthread_create.c: Likewise.
* pthread_detach.c: Likewise.
* pthread_join.c: Likewise.
* pthread_key_delete.c: Likewise.
* pthread_setcancelstate.c: Likewise.
* pthread_setcanceltype.c: Likewise.
* pthread_timedjoin.c: Likewise.
* pthread_tryjoin.c: Likewise.
* sysdeps/pthread/createthread.c: Likewise.
2003-03-20 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Include <atomic.h>.
Remove __lll_add, __lll_dec_if_positive, and __lll_test_and_set
definitions. Replace uses with calls to atomic_* functions.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/lowlevellock.c: Replace __lll_add and
__lll_test_and_set calls with atomic_exchange_and_add and
atomic_exchange calls respectively.
* sysdeps/unix/sysv/linux/sem_post.c: Likewise.
* sysdeps/unix/sysv/linux/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sem_trywait.c: Likewise.
* sysdeps/unix/sysv/linux/sem_wait.c: Likewise.
* sysdeps/unix/sysv/linux/ia64/pthread_once.c: Likewise.
* sysdeps/unix/sysv/linux/ia64/sem_port.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/pthread_once.c: Likewise.
* allocatestack.c (allocate_stack): Assume atomic_exchange_and_add
returns the old value.
2003-03-20 Martin Schwidefsky <sky@mschwid3.boeblingen.de.ibm.com>
* sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
int for variable OLDVAL and correct inline assembler contraint.
* sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
type int for variable OLD.
* sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
only for s390-32.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
(SINGLE_THREAD_P): Use global variable __local_multiple_threads
instead of multiple_threads field in the TCB.
2003-03-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/i686/bits/atomic.h: Removed.
* sysdeps/i386/i586/bits/atomic.h: Removed.
* sysdeps/i386/i486/bits/atomic.h: Removed. Moved to glibc.
* sysdeps/x86_64/bits/atomic.h: Removed. Moved to glibc.
* sysdeps/s390/bits/atomic.h: Removed. Moved to glibc.
* sysdeps/sh/bits/atomic.h: Removed. Moved to glibc.
* sysdeps/ia64/bits/atomic.h: Removed. Moved to glibc.
* sysdeps/powerpc/bits/atomic.h: Removed. Moved to glibc.
* atomic.h: Removed. Moved to glibc.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Add
support for clock selection.
* sysdeps/pthread/pthread_cond_broadcast.c: Release lock before
signalling waiters.
2003-03-18 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
Add __lll_rel_instr first. Add memory clobber.
(lll_mutex_unlock): Use __lll_test_and_set.
From Paul Mackerras <paulus@samba.org>.
* sysdeps/powerpc/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define
unconditionally.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h
(SINGLE_THREAD_P): Add `header.' prefix.
From Paul Mackerras <paulus@samba.org>.
* Versions (libpthread: GLIBC_2.3.2): Move pthread_tryjoin_np and
pthread_timedjoin_np to ...
(libpthread: GLIBC_2.3.3): ... here.
(libpthread: GLIBC_2.2): Move pthread_barrierattr_getpshared there too.
* sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
Avoid shadowing VAL variable.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_test_and_set):
New macro.
2003-03-18 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-cond11.
* tst-cond11.c: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Reorder
struct passed to cleanup handler to eliminate one more
instruction.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
(pthrad_cond_t): Replace __unused field with __clock.
* sysdeps/pthread/pthread_cond_wait.c: Release condvar lock before
waken all waiters in cleanup handler.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
* pthread_condattr_getclock.c: New file.
* pthread_condattr_setclock.c: New file.
* sysdeps/pthread/pthread.h: Declare these new functions.
* Versions [GLIBC_2.3.3] (libpthread): Add the new functions.
* Makefile (libpthread-routines): Add the new functions.
* sysdeps/unix/sysv/linux/internaltypes.h (struct pthread_condattr):
Renamed field to value. Document use of the bits.
* pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
change.
* pthread_condattr_setpshared.c: Likewise.
* pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
* sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
Add __clock field.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S:
Implement clock selection.
* sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
* pthread-errnos.sym: Add ENOSYS.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
_POSIX_CLOCK_SELECTION.
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Remove
invalid .size directive.
2003-03-17 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/lowlevellock.c (__lll_lock_wait):
Formatting tweaks.
2003-03-17 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
Use __lll_add instead of spelling it out. Use protected symbol names.
* sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
Use __lll_add.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
Renamed from lll_compare_and_swap. Use new name where necessary.
(__lll_add): Defined.
(__lll_dec_if_positive): Defined.
(__lll_test_and_set): Defined.
* sysdeps/ia64/pthread_spin_init.c: Removed.
* sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
* sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
* sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
* sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
* sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
* sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
* sysdeps/ia64/bits/atomic.h: Add __builtin_expect where appropriate.
* sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use
__sync_lock_release_si.
Patch by Jakub Jelinek.
* sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait):
Fix timeout handling.
(__lll_timedwait_tid): Likewise.
(lll_unlock_wake_cb): Wake up other waiters if necessary.
Patch by Jakub Jelinek.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Pretty printing.
2003-03-17 Roland McGrath <roland@redhat.com>
PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
* sysdeps/pthread/pthread_spin_init.c: New file.
* sysdeps/pthread/pthread_spin_unlock.c: New file.
* sysdeps/powerpc/Makefile: New file.
* sysdeps/powerpc/pthread_spin_lock.c: New file.
* sysdeps/powerpc/pthread_spin_trylock.c: New file.
* sysdeps/powerpc/pthreaddef.h: New file.
* sysdeps/powerpc/tcb-offsets.sym: New file.
* sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
* sysdeps/powerpc/tls.h: New file.
* sysdeps/powerpc/bits/atomic.h: New file.
* sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
* sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
* sysdeps/unix/sysv/linux/sem_post.c: New file.
* sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
* sysdeps/unix/sysv/linux/sem_trywait.c: New file.
* sysdeps/unix/sysv/linux/sem_wait.c: New file.
* sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
* sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
* sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
* sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
not gettimeofday.
* sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
* sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
2003-03-17 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
* sysdeps/pthread/pthread_cond_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
Patch by Ewald Snel <ewald@rambo.its.tudelft.nl>.
2003-03-16 Roland McGrath <roland@redhat.com>
* tst-fork4.c: Include <string.h>.
* tst-signal2.c: Likewise.
* tst-mutex5.c (do_test): exit -> return.
* tst-mutex2.c: Include <stdlib.h>.
2003-03-16 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
(__lll_mutex_timedlock_wait): Correct expected value after
spurious wakeup. Otherwise we would never wait again.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Work around red
zone versus inline asm stupidity. Use correct instructions.
* tst-rwlock6.c: Add some more status output.
2003-03-15 Roland McGrath <roland@redhat.com>
* sysdeps/pthread/configure.in: New file.
* sysdeps/pthread/configure: New file (generated).
2003-03-15 Ulrich Drepper <drepper@redhat.com>
* allocatestack.c (allocate_stack): Store the exact stack size of
user allocated stacks.
2003-03-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
(SINGLE_THREAD): Use `header' prefix instead of `header.data'.
* sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
* sysdeps/sh/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define.
* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P):
Use `header.' prefix.
* sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS_OFFSET): Likewise.
2003-03-15 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use
__builtin_frame_address, use stack pointer.
* sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME
instead of __builtin_frame_pointer.
2003-03-14 Ulrich Drepper <drepper@redhat.com>
* tst-basic1.c (do_test): Add cast to avoid warning.
* tst-basic2.c (do_test): Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
amount of stack correction.
* tst-fork4.c: Use test-skeleton.c.
2003-03-14 Roland McGrath <roland@redhat.com>
* init.c: Fix typo "#eli" for "#else".
2003-03-14 Steven Munroe <sjmunroe@us.ibm.com>
* allocatestack.c (__stack_user): Use hidden_data_def.
* pthread_create.c (__pthread_keys): Likewise.
* init.c [__powerpc__] (__NR_set_tid_address): Define it.
2003-03-14 Roland McGrath <roland@redhat.com>
* tst-fork4.c: New file.
* Makefile (tests): Add it.
* descr.h (struct pthread): Move the union out of [!TLS_DTV_AT_TP], so
we always define the padding space.
[!TLS_DTV_AT_TP]: Give tcbhead_t field a name, `header', since GCC
stopped supporting its own extensions fully.
[TLS_MULTIPLE_THREADS_IN_TCB]: Put `multiple_threads' inside a wrapper
struct also called `header', so `header.multiple_threads' is the field
name to use on all machines.
* allocatestack.c (allocate_stack): Use `header.' prefix.
* sysdeps/pthread/createthread.c (create_thread): Likewise.
* pthread_create.c (__pthread_create_2_1): Likewise.
* sysdeps/i386/tls.h (INSTALL_NEW_DTV, THREAD_DTV): Likewise.
(THREAD_SELF): Likewise.
* sysdeps/x86_64/tls.h: Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
(SINGLE_THREAD_P): Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
(SINGLE_THREAD_P): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
(SINGLE_THREAD_P): Likewise.
* sysdeps/s390/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Use REGS[18]
value directly.
2003-03-14 Ulrich Drepper <drepper@redhat.com>
* pthread_create.c (start_thread): Use CALL_THREAD_FCT if defined.
* sysdeps/i386/tls.h: Define CALL_THREAD_FCT.
* pthread_create.c (start_thread): setjmp is expected to return 0.
* sysdeps/x86_64/tls.h (THREAD_GETMEM): Mark asms volatile.
(THREAD_GETMEM_NC): Likewise.
2003-03-13 Ulrich Drepper <drepper@redhat.com>
* allocatestack.c (allocate_stack): If MULTI_PAGE_ALIASING is defined
and the size of the stack which must be allocated is a multiple,
allocate one more page.
* sysdeps/i386/i686/Makefile: Don't define COLORING_INCREMENT, but
MULTI_PAGE_ALIASING.
2003-03-13 Roland McGrath <roland@redhat.com>
* pthread_create.c (start_thread): Set EXITING_BIT after the
event-reporting (and destructors), not before.
2003-03-13 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h (lll_futex_timed_wait,
lll_futex_wake): Declare register variables as long int instead of
unsigned long int. Patch by Ian Wienand <ianw@gelato.unsw.edu.au>.
Make syscall arguments clobbered by the syscall.
(lll_futex_wait): Define using lll_futex_timed_wait.
* sysdeps/ia64/td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Cast regs[13]
to void *.
* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Only declare and set
PPID if [! NDEBUG].
* allocatestack.c (nptl_ncreated): Only declare if
COLORING_INCREMENT != 0.
* pthreadP.h (__pthread_enable_asynccancel_2): New prototype.
(__libc_enable_asynccancel_2): Remove prototype.
* sysdeps/unix/sysv/linux/ia64/fork.c (ARCH_FORK): Swap ptid and
ctid to match kernel.
2003-03-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add
libc_multiple_threads.
* sysdeps/unix/sysv/linux/libc_pthread_init.c: Move definition of
__libc_multiple_threads to...
* sysdeps/unix/sysv/linux/libc_multiple_threads.c: ...here. New file.
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove unnecessary
versioning.
* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S
(__pthread_once_internal): Define.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Use shlib-compat.h
macros instead of .symver directly.
* sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
* sysdeps/x86_64/tls.h [__ASSEMBLER__]: Include tcb-offsets.h.
* sysdeps/x86_64/tcb-offsets.sym: New file.
* sysdeps/x86_64/Makefile: New file.
* sysdeps/i386/tcb-offsets.sym: Add SELF.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Use SELF
to access own pthread_t in TCB.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
2003-03-12 Roland McGrath <roland@redhat.com>
* pthread-errnos.sym: New file.
* Makefile (gen-as-const-headers): New variable, list that file.
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
header <pthread-errnos.h> instead of defining errno values here.
* sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
* sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
* sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
* sysdeps/sh/pthread_spin_trylock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
CLONE_CHILD_SETTID worked.
2003-03-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S: New
file.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S: New
file.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
(pthread_cond_t): Add padding.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: New file.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S
(__pthread_rwlock_timedwrlock): Add missing opcode suffix.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
(__pthread_rwlock_timedrdlock): Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
(__pthread_rwlock_wrlock): Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
(__pthread_rwlock_rdlock): Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Return
result of lock re-get if it fails.
2003-03-11 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Fix asm syntax.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* sysdeps/x86_64/tls.h (THREAD_SELF, THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Correct asm syntax.
* allocatestack.c [! TLS_MULTIPLE_THREADS_IN_TCB] (allocate_stack):
Initialize *__libc_multiple_threads_ptr not __libc_multiple_threads.
* sysdeps/pthread/createthread.c [! TLS_MULTIPLE_THREADS_IN_TCB]
(create_thread): Likewise.
Define __pthread_multiple_threads and __libc_multiple_threads_ptr.
* init.c (__pthread_initialize_minimal_internal): Initialize
__libc_multiple_threads_ptr if necessary.
* pthreadP.h: Adjust prototype for __libc_pthread_init. Declare
__pthread_multiple_threads and __libc_multiple_threads_ptr.
* sysdeps/unix/sysv/linux/libc_pthread_init.c: Define
__libc_multiple_threads.
(__libc_pthread_init): Return pointer to __libc_pthread_init if
necessary.
* sysdeps/i386/tls.h (THREAD_SETMEM): Fix one-byte variant.
(THREAD_SETMEM_NC): Likewise.
* sysdeps/x86_64/pthread_spin_trylock.c: Removed.
* sysdeps/x86_64/pthread_spin_trylock.S: New file.
* sysdeps/x86_64/pthread_spin_unlock.c: Removed.
* sysdeps/x86_64/pthread_spin_unlock.S: New file.
* sysdeps/i386/i486/pthread_spin_trylock.S (pthread_spin_trylock):
Eliminate one entire instruction.
* cancellation.c (__pthread_enable_asynccancel_2): New function.
* pthreadP.h: Declare __pthread_enable_asynccancel_2.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
(__pthread_cond_timedwait): Use __pthread_enable_asynccancel_2
instead of __pthread_enable_asynccancel.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
(__pthread_cond_wait): Likewise.
* sysdeps/pthread/pthread_cond_timedwait.c
(__pthread_cond_timedwait): Likewise.
* sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait): Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
(__condvar_cleanup): Wake up all waiters in case we got signaled
after being woken up but before disabling asynchronous
cancellation.
* sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
(__condvar_cleanup): Likewise.
* init.c (__NR_set_tid_address): If already defined, don't redefine.
Make it an error if architecture has no #if case. Add x86-64.
* sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for
pt-initfini.s generation.
* sysdeps/x86_64/tls.h: Include <asm/prctl.h>.
(TLS_INIT_TP): Fix typo.
2003-03-11 Jakub Jelinek <jakub@redhat.com>
* sysdeps/ia64/bits/atomic.h (atomic_exchange_and_add): Swap 2nd and
3rd argument of __arch_compare_and_exchange_{32,64}_val_acq.
* sysdeps/unix/sysv/linux/ia64/sem_post.c: Include semaphore.h.
* sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Likewise.
* sysdeps/unix/sysv/linux/ia64/sem_wait.c: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_post.c: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
2003-03-11 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread_cond_timedwait.c
(__pthread_cond_timedwait): Return the result of the final
locking. If it succeeds, the regular function return value.
* sysdeps/pthread/pthread_cond_wait.c (__pthread_cond_wait):
Return result of the final locking.
* version.c (__nptl_main): Work around problems with the strange
INTERNAL_SYSCALL macro on ppc32.
* init.c (__pthread_initialize_minimal_internal): Unblock
SIGCANCEL in case the parent blocked it.
Reported by Paul Mackerras <paulus@samba.org>.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S: New file.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S: New file.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: New file.
2003-03-11 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/pthread_cond_timedwait.c
(__pthread_cond_timedwait): Unlock and fail if
__pthread_mutex_unlock_internal failed.
* sysdeps/pthread/createthread.c (ARCH_CLONE): Define if not defined.
(create_thread): Only assert PD->tcb != NULL under [TLS_TCB_AT_TP].
Use ARCH_CLONE.
* allocatestack.c (ALLOCATE_STACK_PARMS): New macro.
[NEED_SEPARATE_REGISTER_STACK] (STACK_VARIABLES,
STACK_VARIABLES_ARGS, STACK_VARIABLES_PARMS, ALLOCATE_STACK_PARMS,
ALLOCATE_STACK): New macros.
(TLS_TPADJ): New macro.
(get_cached_stack, queue_stack, __deallocate_stack): Use TLS_TPADJ.
(allocate_stack): Handle TLS_DTV_AT_TP and
NEED_SEPARATE_REGISTER_STACK. Use TLS_TPADJ.
* pthread_create.c (__pthread_create_2_1) [! TLS_TCB_AT_TP]:
Don't set PD->self.
* init.c [__ia64__] (__NR_set_tid_address): Define.
* sysdeps/unix/sysv/linux/ia64/bits/pthreadtypes.h: New file.
* sysdeps/unix/sysv/linux/ia64/bits/semaphore.h: New file.
* sysdeps/unix/sysv/linux/ia64/fork.c: New file.
* sysdeps/unix/sysv/linux/ia64/createthread.c: New file.
* sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: New file.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: New file.
* sysdeps/unix/sysv/linux/ia64/pt-initfini.c: New file.
* sysdeps/unix/sysv/linux/ia64/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/ia64/pthread_once.c: New file.
* sysdeps/unix/sysv/linux/ia64/sem_post.c: New file.
* sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: New file.
* sysdeps/unix/sysv/linux/ia64/sem_trywait.c: New file.
* sysdeps/unix/sysv/linux/ia64/sem_wait.c: New file.
* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: New file.
* sysdeps/ia64/bits/atomic.h: New file.
* sysdeps/ia64/Makefile: New file.
* sysdeps/ia64/pthread_spin_init.c: New file.
* sysdeps/ia64/pthread_spin_lock.c: New file.
* sysdeps/ia64/pthread_spin_trylock.c: New file.
* sysdeps/ia64/pthread_spin_unlock.c: New file.
* sysdeps/ia64/pthreaddef.h: New file.
* sysdeps/ia64/tcb-offsets.sym: New file.
* sysdeps/ia64/td_ta_map_lwp2thr.c: New file.
* sysdeps/ia64/tls.h: New file.
* sysdeps/s390/pthreaddef.h (__exit_thread_inline): Pass 1 argument
to syscall instead of no arguments.
2003-03-10 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: New file.
* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: New file.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: New file.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Fix error value in
unused code.
* sysdeps/unix/sysv/linux/x86_64/pthread_barrier_wait.S: New file
* sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
lowlevelbarrier.sym.
* sysdeps/unix/sysv/linux/lowlevelbarrier.sym: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S:
Include lowlevelbarrier.h and don't define offsets locally.
* sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
(__lll_mutex_lock_wait): Reverse order of first two parameters.
(__lll_mutex_timedlock_wait): Likewise.
(lll_mutex_lock): Adjust asm for that.
(lll_mutex_timedlock): Likewise. Mark cx, cc, r10 as clobbered.
(lll_lock): Adjust asm for operand order change.
* sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: New file.
* sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: New file.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (__lll_lock_wait):
Reverse order of parameters.
(__lll_timedwait_tid): Remove regparms attribute.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: New file.
* sysdeps/unix/sysv/linux/x86_64/libc-lowlevellock.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
(__lll_timedwait_tid): Remove one unnecessary instruction.
* sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Define
__lll_mutex_timedlock_wait only for NOT_IN_libc.
* sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: Include
lowlevelmutex.S.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Define
lll_unlock_wake_cb, __lll_wait_tid, and __lll_timedwait_tid only
for NOT_IN_libc.
* sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Include
lowlevellock.S.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Don't define
LOCK is already defined. Don't define __lll_mutex_timedlock_wait
for libc.so.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Only
define LOCK here (if UP is not defined). The actual code is in
lowlevelmutex.S.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Don't define
LOCK is already defined. Don't define lll_unlock_wake_cb and
__lll_timedwait_tid for libc.so.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Only
define LOCK here (if UP is not defined). The actual code is in
lowlevellock.S.
* sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Not needed anymore.
* sysdeps/unix/sysv/linux/s390/lowlevelsem.h: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_post.c: Include lowlevellock.h
instead of lowlevelsem.h.
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_trywait.c: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_wait.c: Likewise.
* sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add
lowlevelrwlock.sym.
* sysdeps/unix/sysv/linux/lowlevelrwlock.sym: New file.
* sysdeps/unix/sysv/linux/i386/lowlevelrwlock.h: Removed.
* sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: Removed.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_trylock): Fix
register loading.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_trylock): Undo
last changed. D'oh.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove declaration
of __libc_locking_needed.
(lll_trylock): Initialize %eax to zero.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Update
pthread_cond_t definition.
2003-03-10 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/lowlevelcond.sym: New file.
* sysdeps/unix/sysv/linux/Makefile (gen-as-const-headers): Add it.
* sysdeps/unix/sysv/linux/sh/lowlevelcond.h: File removed.
* sysdeps/unix/sysv/linux/i386/lowlevelcond.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: Likewise.
* allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]:
Instead of setting PD->multiple_threads, set globals
__pthread_multiple_threads and __libc_multiple_threads.
* sysdeps/pthread/createthread.c (create_thread): Likewise.
* sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it.
* sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise.
* descr.h (struct pthread): Conditionalize first member on
[!TLS_DTV_AT_TP]. Replace the `header' member with an anonymous union
containing an anonymous tcbhead_t. Move `list' member out.
[TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member.
* allocatestack.c: Remove use of `header.data.' prefix.
* pthread_create.c: Likewise.
* init.c (__pthread_initialize_minimal_internal): Likewise.
* sysdeps/pthread/createthread.c (create_thread): Likewise.
* sysdeps/i386/tls.h (INSTALL_DTV): Add parens.
(THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix.
* sysdeps/x86_64/tls.h: Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
(SINGLE_THREAD_P): Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
(SINGLE_THREAD_P): Likewise.
* sysdeps/i386/tls.h (tcbhead_t): Remove `list' member.
* sysdeps/s390/tls.h (tcbhead_t): Likewise.
2003-03-09 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevelcond.h: New file.
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix many
leftovers from the ia32 code.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Remove unneccessary
memory load.
(clear_once_control): Don't load %esi.
* sysdeps/x86_64/tls.h: Remove all traces of segment descriptor
handling.
* sysdeps/unix/sysv/linux/x86_64/fork.c: New file.
* sysdeps/unix/sysv/linux/s390/createthread.c: Moved to...
* sysdeps/unix/sysv/linux/createthread.c: ...here.
* Makefile (tests): Add tst-cond10.
* tst-cond10.c: New file.
2003-03-08 Ulrich Drepper <drepper@redhat.com>
* tst-tls2.c (do_test): Add TEMP_FAILURE_RETRY around sem_wait call.
* tst-signal3.c (do_test): Likewise.
* tst-sem5.c (do_test): Likewise.
* tst-kill6.c (do_test): Likewise.
* tst-tls3.c (do_test): Likewise. Include <errno.h>.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use add/sub instead
of inc/dec.
* sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
* allocatestack.c (allocate_stack): If mprotect() fails free the
TLS memory.
2003-03-07 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/i486/bits/atomic.h: Fix a few unused definitions.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Remove all trace of
lll_wake_tid. This was used only to work around kernel limits in
the early days.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise.
* init.c (__static_tls_align_m1): Renamed from __static_tls_align.
(__pthread_initialize_minimal_internal): Change initialization of
__static_tls_align_m1 appropriately.
* pthreadP.h (__static_tls_align_m1): Renamed from
__static_tls_align.
* allocatestack.c (allocate_stack): Use __static_tls_align_m1
instead of __static_tls_align-1.
2003-03-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/Makefile: New file.
* pthread_create.c: Define __pthread_keys using nocommon
attribute, not by placing it explicitly in bss.
Remove DEFINE_DEALLOC definition. Not needed anymore.
* allocatestack.c: Define ARCH_MAP_FLAGS if not already defined.
Use it in mmap call to allocate stacks.
* sysdeps/pthread/createthread.c (create_thread): Fix comment.
* pthread_create.c (start_thread): Use THREAD_SETMEM to store
result of the thread function.
2003-03-03 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/s390/dl-sysdep.h: Removed. The generic
version is just fine.
* sysdeps/unix/sysv/linux/libc_pthread_init.c
(__pthread_child_handler): Renamed from pthread_child_handler,
exported, and marked hidden. Change all users.
* sysdeps/unix/sysv/linux/register-atfork.c (free_mem): Do not
free __pthread_child_handler from child list.
2003-03-03 Martin Schwidefsky <schwidefsky@de.ibm.com>
* atomic.h (atomic_exchange_and_add): Return newval, not oldval.
* sysdeps/pthread/pthread_cond_timedwait.c (__pthread_cond_timedwait):
Fix handling of cancellation and failing pthread_mutex_unlock call.
* sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise.
(__pthread_cond_wait): Likewise.
* sysdeps/pthread/pthread_rwlock_timedrdlock.c
(pthread_rwlock_timedrdlock): Fix clobber of result variable by
lll_futex_timed_wait call.
* sysdeps/pthread/pthread_rwlock_timedwrlock.c
(pthread_rwlock_timedwrlock): Likewise.
* sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c (___lll_lock):
Don't define lll_unlock_wake_cb and ___lll_timedwait_tid in libc.so.
* sysdeps/unix/sysv/linux/s390/lowlevellock.c: Remove XXX comments.
* sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Fix
check of lll_futex_wake return value.
2003-03-03 Roland McGrath <roland@redhat.com>
* forward.c: Fix typo in __pthread_attr_init_2_0 compat_symbol decl.
* sysdeps/pthread/pthread-functions.h (struct pthread_functions):
Argument to ptr___pthread_cleanup_upto is __jmp_buf, not jmp_buf.
* sysdeps/unix/sysv/linux/jmp-unwind.c: Likewise.
2003-03-02 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/timer_create.c (timer_create): Return correct
error for CPU clocks.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
_POSIX_MONOTONIC_CLOCK.
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
* tst-cancel4.c (tf_sleep): Lower sleep time a bit to not upset
recent kernels.
2003-03-01 Ulrich Drepper <drepper@redhat.com>
* descr.h (struct pthread): Move cleanup field to the front.
2003-03-01 Roland McGrath <roland@redhat.com>
* sem_open.c (sem_open): Braino fix.
2003-03-01 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/tcb-offsets.sym: Add CLEANUP and CLEANUP_PREV.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Inline
__pthread_cleanup_pop functionality.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* descr.h (struct pthread): Move tid field to the front now that
it is often used.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S
(__lll_mutex_timedlock_wait): Remove.
(__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S
(__lll_mutex_unlock_wake): Don't save, load, and restore %esi.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
(lll_unlock_wake_cb): Don't save and restore %esi.
(__lll_unlock_wake): Add alignment. Don't save, load, and restore
%esi.
(__lll_timedwait_tid): Add alignment.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
(__lll_unlock_wake): Add alignment. Don't save, load, and restore
%esi.
(__lll_timedwait_tid): Removed.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
(__pthread_cond_broadcast): Don't save, load, and restore %esi.
* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S
(pthread_barrier_wait): Don't save, load, and restore %esi for
last thread.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
(__pthread_cond_signal): Don't save, load, and restore %esi.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S
(__pthread_rwlock_unlock): Don't save, load, and restore %esi.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S (__new_sem_post):
Don't save, load, and restore %esi.
2003-02-27 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
Release lock before waking up the waiters.
* tst-exit1.c (do_test): Don't start more than one thread in parallel.
* tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
(reader_thread): Likewise.
* sysdeps/pthread/pthread_rwlock_unlock.c
(__pthread_rwlock_unlock): Release internal lock early. Don't try
to wake up readers if there are none.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S:
Release internal lock before wake threads.
2003-02-26 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-rwlock10 and tst-rwlock11.
* tst-rwlock8.c: Initialize lock with INIT. Allow INIT to be
predefined.
* tst-rwlock9.c: Likewise.
* tst-rwlock10.c: New file.
* tst-rwlock11.c: New file.
* Makefile (tests): Add tst-dlsym1.
* tst-dlsym1.c: New file.
* init.c (__pthread_initialize_minimal_internal): Set
GL(dl_error_catch_tsd) to __libc_dl_error_tsd.
* Versions (libc:GLIBC_PRIVATE): Export __libc_dl_error_tsd.
2003-02-24 Ulrich Drepper <drepper@redhat.com>
* sem_open.c (sem_open): Fix handling of O_CREAT without O_EXCL.
* tst-cond2.c: Fix sychronization with child.
* tst-rwlock8.c (reader_thread): Remove unused variable.
* Makefile: Add rules to build and run tst-tls3.
* tst-tls3.c: New file.
* tst-tls3mod.c: New file.
* Makefile (tests): Add tst-rwlock8 and tst-rwlock9.
* tst-rwlock8.c: New file.
* tst-rwlock9.c: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Fix
complete broken rwlock implementation.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/pthread/pthread_rwlock_rdlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_timedrdlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_timedwrlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_unlock.c: Likewise.
* sysdeps/pthread/pthread_rwlock_wrlock.c: Likewise.
2003-02-23 Roland McGrath <roland@redhat.com>
* Makefile (nptl-version): Change regexp so case sensitivity is ok.
2003-02-23 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-context1.
* tst-context1.c: New file.
* Makefile (tests): Add tst-tls1 and tst-tls2.
* tst-tls1.c: New file.
* tst-tls2.c: New file.
* libc-cancellation.c (__libc_enable_asynccancel): Correct test
for failed cmpxchg.
* pthread_create.c (start_thread): Set EXITING_BIT early.
* sysdeps/i386/tls.h (THREAD_GETMEM): Mark asm as volatile.
(THREAD_GETMEM_NC): Likewise.
2003-02-22 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Shave
off 3 more bytes by using offset-less instructions when possible.
* Makefile: Add dependency for $(objpfx)version.d.
* eintr.c (eintr_source): Add unnecessary return but the compiler
insists.
* tst-kill3.c: Include <unistd.h>.
2003-02-21 Roland McGrath <roland@redhat.com>
* pthread_create.c (start_thread): Call __libc_thread_freeres.
2003-02-21 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-eintr1.
(distribute): Add eintr.c.
* tst-eintr1.c: New file.
* eintr.c: New file.
* pthread_cancel.c (pthread_cancel): Use tkill directly.
* sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill):
Disallow sending SIGCANCEL.
* Makefile (tests): Remove tst-basic7. Add tst-kill1, tst-kill2,
tst-kill3, tst-kill4, tst-kill5, tst-kill6.
* tst-kill1.c: New file.
* tst-kill2.c: New file.
* tst-kill3.c: New file.
* tst-kill5.c: New file.
* tst-kill6.c: New file.
* tst-basic7.c: Renamed to...
* tst-kill4.c: ...this.
2003-02-21 Roland McGrath <roland@redhat.com>
* Makefile (install-lib-ldscripts): New variable.
2003-02-21 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P.
* pthread_cancel.c: Use INVALID_TD_P.
* pthread_detach.c: Likewise.
* pthread_getschedparam.c: Likewise.
* pthread_setschedparam.c: Likewise.
* sysdeps/pthread/pthread_getcpuclockid.c: Likewise.
* sysdeps/unix/sysv/linux/pthread_kill.c: Likewise.
* pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P.
* pthread_timedjoin.c: Likewise.
* tst-basic7.c: Include <signal.h>.
* pthread_join.c (pthread_join): Limited checking for invalid
descriptors.
* pthread_timedjoin.c (pthread_timedjoin_np): Likewise.
2003-02-20 Ulrich Drepper <drepper@redhat.com>
* pthread_create.c (deallocate_tsd): Reset found_nonzero at the
beginning of the loop. Clear the entire first block of TSD.
* Makefile (tests): Add tst-key4.
* tst-key4.c: New file.
2003-02-18 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-basic7.
* tst-basic7.c: New file.
* pthread_create.c (deallocate_tsd): Mark as internal_function.
Add some more __builtin_expect.
* pthreadP.h: Define dummy version of DEBUGGING_P.
2003-02-17 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remnove
_POSIX_THREAD_PRIORITY_SCHEDULING.
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Remove
_XOPEN_REALTIME_THREADS.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Likewise.
* sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): The
kernel returns EINVAL for PID <= 0, work around it.
* Makefile (tests): Add tst-signal5.
* tst-signal5.c: New file.
* sysdeps/unix/sysv/linux/bits/local_lim.h: Define TTY_NAME_MAX
and LOGIN_NAME_MAX.
* tst-cancel1.c (tf): Block all signals.
* Makefile (tests): Add tst-basic6.
* tst-basic6.c: New file.
* tst-basic1.c: Add test for process ID.
* Makefile (tests): Add tst-cancel10.
* tst-cancel10.c: New file.
* Makefile (tests): Add tst-signal4.
* tst-signal4.c: New file.
* sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use
__sigismember instead of sigismember. Add __builtin_expect.
2003-02-16 Ulrich Drepper <drepper@redhat.com>
* tst-attr1.c (do_test): Add tests for pthread_setcanceltype,
pthread_setcancelstate, and pthread_rwlock_setpshared.
* tst-cancel7.c (do_test): Make sure the pid file exists before
canceling the thread.
* tst-rwlock6.c: More pthread_rwlock_timedwrlock and
pthread_rwlock_timedrdlock tests.
* tst-rwlock7.c: More pthread_rwlock_timedwrlock tests.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Check for invalid tv_nsec field.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* pthread_mutex_trylock.c (__pthread_mutex_trylock): Protect
recursive mutex of overflow.
* tst-attr1.c (do_test): Add test for pthread_mutexattr_setpshared.
* libc-cancellation.c (__libc_enable_asynccancel): Rewrite to avoid
going into an endless loop.
* Makefile (tests): Add tst-cancel9.
* tst-cancel9.c: New file.
* pthread_cancel.c (pthread_cancel): Use the result of __pthread_kill.
2003-02-15 Ulrich Drepper <drepper@redhat.com>
* tst-mutex5.c (do_test): Add more timedlock tests.
* tst-mutex2.c: Tests of trylock and unlock with ERROR mutexes.
* tst-mutex3.c (do_test): Add tests for trylock with RECURSIVE mutexes.
* sysdeps/unix/sysv/linux/pthread_kill.c (__pthread_kill): Don't
use INLINE_SYSCALL. Error number is returned, not -1.
* pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
and __deallocate_stack with internal_function.
* pthread_create.c: Adjust definitions appropriately.
* allocatestack.c: Likewise.
* pthread_join.c: Add one more __builtin_expect.
* pthread_timedjoin.c: Likewise.
* pthread_getspecific.c (__pthread_getspecific): Clear data->data
not data of sequence number does not match.
Add one __builtin_expect.
* Makefile (tests): Add tst-clock1.
* tst-clock1.c: New file.
* pthread_setconcurrency.c (pthread_setconcurrency): Fail for
negative arguments.
* Makefile (tests): Add tst-basic5.
* tst-basic5.c: New file.
2003-02-14 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-basic4.
* tst-basic4.c: New file.
* pthreadP.h: Add declaraction for __nptl_nthreads.
* pthread_create.c: Define __nptl_nthreads
(start_thread): Increment __nptl_nthreads at beginning. Decrement
after thread is done. If then zero, call exit(0).
* sysdeps/pthread/pthread-functions.h (struct pthread_functions):
Add ptr_nthreads. Define HAVE_PTR_NTHREADS.
* init.c (pthread_functions): Initialize ptr_nthreads.
* allocatestack.c (nptl_nthreads): Remove definition and all uses.
(__reclaim_stacks): Decrement __nptl_nthreads.
* sysdeps/pthread/Makefile [$(subdir)==csu] (CFLAGS-libc-start.c):
Define.
* Makefile (tests): Add tst-basic3.
* tst-basic3.c: New file.
* descr.h: Define CANCELING_BIT and CANCELING_BITMASK. Introduce
after CANCELTYPE_BIT, move the other bits up. Update CANCEL_RESTMASK.
* init.c (sigcancel_handler): Also set CANCELING_BITMASK bit in newval.
* pthread_cancel.c (pthread_cancel): Likewise. Also set CANCELING_BIT
if asynchronous canceling is enabled.
* pthread_join.c (pthread_join): When recognizing circular joins,
take into account the other thread might be already canceled.
* Makefile (tests): Add tst-join5.
* tst-join5.c: New file.
* Makefile (tests): Add tst-join4.
* tst-join4.c: New file.
2003-02-13 Ulrich Drepper <drepper@redhat.com>
* tst-cond4.c (main): Add test of pthread_attr_getpshared.
2003-02-13 Martin Schwidefsky <schwidefsky@de.ibm.com>
* sysdeps/s390/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM,
THREAD_SETMEM_NC): Use passed descr instead of THREAD_SELF.
* sysdeps/unix/sysv/linux/s390/jmp-unwind.c (_longjmp_unwind): Avoid
warning.
* sysdeps/unix/sysv/linux/s390/lowlevellock.c: Include <sys/time.h>
to avoid warning.
* sysdeps/unix/sysv/linux/s390/sem_post.c (__new_sem_post): Return
error if lll_futex_wake failed.
2003-02-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Fix
handling of cancellation and failung pthread_mutex_unlock call.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* Makefile (tests): Add tst-cond8 and tst-cond9.
* tst-cond8.c: New file.
* tst-cond9.c: New file.
* tst-cond7.c (do_test): Unlock the mutex before canceling the thread.
* sysdeps/pthread/pthread.h: Add missing initializers. Protect
non-standard initializers with __USE_GNU.
* Makefile (tests): Add tst-cleanup3.
* tst-cleanup3.c: New file.
2003-02-12 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-attr1 and tst-attr2.
* tst-attr1.c: New file.
* tst-attr2.c: New file.
* Makefile: Add rules to build and run tst-atfork2 test.
* tst-atfork2.c: New file.
* tst-atfork2mod.c: New file.
* sysdeps/unix/sysv/linux/unregister-atfork.c
(__unregister_atfork): Free the memory allocated for the handlers
after removing them from the lists.
* sysdeps/unix/sysv/linux/register-atfork.c: Define memeory
cleanup function.
* tst-atfork1.c (do_test): Wait for the child we forked.
Report error in child.
* sysdeps/unix/sysv/linux/fork.c (__libc_fork): Fix comment.
* sysdeps/pthread/Makefile: Define CFLAGS-confstr.c.
2003-02-10 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-cancel8.
* tst-cancel8.c: New file.
* sysdeps/unix/sysv/linux/i386/pthread_once.S (clear_once_control): Fix
clearing of control variable.
* Makefile (tests): Add tst-once3 and tst-once4.
* tst-once3.c: New file.
* tst-once4.c: New file.
2003-02-08 kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/Makefile: New file.
* sysdeps/sh/bits/atomic.h: New file.
* sysdeps/sh/pthread_spin_init.c: New file.
* sysdeps/sh/pthread_spin_lock.c: New file.
* sysdeps/sh/pthread_spin_trylock.S: New file.
* sysdeps/sh/pthread_spin_unlock.S: New file.
* sysdeps/sh/pthreaddef.h: New file.
* sysdeps/sh/tcb-offsets.sym: New file.
* sysdeps/sh/td_ta_map_lwp2thr.c: New file.
* sysdeps/sh/tls.h: New file.
* sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: New file.
* sysdeps/unix/sysv/linux/sh/bits/semaphore.h: New file.
* sysdeps/unix/sysv/linux/sh/createthread.c: New file.
* sysdeps/unix/sysv/linux/sh/fork.c: New file.
* sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: New file.
* sysdeps/unix/sysv/linux/sh/libc-lowlevelmutex.S: New file.
* sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h: New file.
* sysdeps/unix/sysv/linux/sh/lowlevelcond.h: New file.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: New file.
* sysdeps/unix/sysv/linux/sh/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: New file.
* sysdeps/unix/sysv/linux/sh/lowlevelrwlock.h: New file.
* sysdeps/unix/sysv/linux/sh/pt-initfini.c: New file.
* sysdeps/unix/sysv/linux/sh/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_once.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: New file.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: New file.
* sysdeps/unix/sysv/linux/sh/sem_post.S: New file.
* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: New file.
* sysdeps/unix/sysv/linux/sh/sem_trywait.S: New file.
* sysdeps/unix/sysv/linux/sh/sem_wait.S: New file.
* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: New file.
2003-02-08 Ulrich Drepper <drepper@redhat.com>
* tst-cond2.c: Rearrange code to not rely on behavior undefined
according to POSIX.
* tst-basic2.c (do_test): Lock mutex before creating the thread.
2003-02-07 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/tls.h: Remove unnecessary macros, left over from x86.
(TLS_GET_FS): New #define.
(TLS_SET_FS): New #define.
Correct value of __NR_set_thread_area.
* sysdeps/x86_64/td_ta_map_lwp2thr.c: New file.
2003-02-06 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-popen1.
* tst-popen1.c: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Remove wrong
but inactive generalization.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
Minor optimization, remove one instruction.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
2003-02-04 Martin Schwidefsky <schwidefsky@de.ibm.com>
* sysdeps/unix/sysv/linux/s390/fork.c: Correct order of parameters.
2003-01-31 Martin Schwidefsky <schwidefsky@de.ibm.com>
* init.c (__NR_set_tid_address): Add #ifdef for s390.
* sysdeps/pthread/pthread_barrier_wait.c: New file.
* sysdeps/pthread/pthread_cond_broadcast.c: New file.
* sysdeps/pthread/pthread_cond_signal.c: New file.
* sysdeps/pthread/pthread_cond_timedwait.c: New file.
* sysdeps/pthread/pthread_cond_wait.c: New file.
* sysdeps/pthread/pthread_rwlock_rdlock.c: New file.
* sysdeps/pthread/pthread_rwlock_timedrdlock.c: New file.
* sysdeps/pthread/pthread_rwlock_timedwrlock.c: New file.
* sysdeps/pthread/pthread_rwlock_unlock.c: New file.
* sysdeps/pthread/pthread_rwlock_wrlock.c: New file.
* sysdeps/s390/Makefile: New file.
* sysdeps/s390/bits/atomic.h: New file.
* sysdeps/s390/pthread_spin_init.c: New file.
* sysdeps/s390/pthread_spin_lock.c: New file.
* sysdeps/s390/pthread_spin_trylock.c: New file.
* sysdeps/s390/pthread_spin_unlock.c: New file.
* sysdeps/s390/pthreaddef.h: New file.
* sysdeps/s390/tcb-offsets.sym: New file.
* sysdeps/s390/td_ta_map_lwp2thr.c: New file.
* sysdeps/s390/tls.h: New file.
* sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: New file.
* sysdeps/unix/sysv/linux/s390/bits/semaphore.h: New file.
* sysdeps/unix/sysv/linux/s390/createthread.c: New file.
* sysdeps/unix/sysv/linux/s390/dl-sysdep.h: New file.
* sysdeps/unix/sysv/linux/s390/fork.c: New file.
* sysdeps/unix/sysv/linux/s390/jmp-unwind.c: New file.
* sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: New file.
* sysdeps/unix/sysv/linux/s390/lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: New file.
* sysdeps/unix/sysv/linux/s390/lowlevelsem.h: New file.
* sysdeps/unix/sysv/linux/s390/pthread_once.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-32/pt-initfini.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-32/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/pt-initfini.c: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/s390/sem_post.c: New file.
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c: New file.
* sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/s390/sem_wait.c: New file.
2003-02-04 Ulrich Drepper <drepper@redhat.com>
* atomic.h: Add a couple more default implementations.
(atomic_compare_and_exchange_acq): Use
__arch_compare_and_exchange_32_acq in return value definition. It
always exists.
(atomic_bit_set): Renamed from atomic_set_bit.
Add missing atomic_ prefixes.
* sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
thread library is available, use correct value to mark initialized
once variable.
2003-02-03 Ulrich Drepper <drepper@redhat.com>
* allocatestack.c (allocate_stack): Use __getpagesize instead of
__sysconf to determine pagesize.
* pthread_create.c: Include <atomic.h>.
* allocatestack.c (allocate_stack): Implement coloring of the
allocated stack memory. Rename pagesize to pagesize_m1. It's the
size minus one. Adjust users.
* sysdeps/i386/i686/Makefile: New file.
2003-02-02 Ulrich Drepper <drepper@redhat.com>
* allocatestack.c: Improve comment throughout the file.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
(__lll_lock_wait): Add branch prediction.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S
(__lll_lock_wait): Likewise.
(lll_unlock_wake_cb): Removed.
2003-01-31 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Remove
_POSIX_THREAD_PRIORITY_SCHEDULING.
2003-01-30 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/pthread-functions.h (struct pthread_functions):
Fix return type of ptr___pthread_getspecific.
2003-01-29 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-umask1.
(tst-umask1-ARGS): Define.
* tst-umask1.c: New file.
2003-01-28 Ulrich Drepper <drepper@redhat.com>
* Makefile (libpthread-routines): Remove lowlevelrwlock. Add
pthread_rwlock_rdlock, pthread_rwlock_timedrdlock,
pthread_rwlock_wrlock, pthread_rwlock_timedwrlock, and
pthread_rwlock_unlock.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Removed
* sysdeps/unix/sysv/linux/i386/i586/lowlevelrwlock.S: Removed
* sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Removed
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_rdlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedrdlock.S:
New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_wrlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_timedwrlock.S:
New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_rwlock_unlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_rdlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedrdlock.S:
New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_wrlock.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_timedwrlock.S:
New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_rwlock_unlock.S: New file.
* Makefile (libpthread-routines): Remove lowlevelcond and
lowlevelsem. Add sem_wait, sem_trywait, sem_timedwait, sem_post,
pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
and pthread_cond_broadcast.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Removed
* sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Removed
* sysdeps/unix/sysv/linux/i386/i586/lowlevelsem.S: Removed
* sysdeps/unix/sysv/linux/i386/i586/lowlevelcond.S: Removed
* sysdeps/unix/sysv/linux/i386/i686/lowlevelsem.S: Removed
* sysdeps/unix/sysv/linux/i386/i686/lowlevelcond.S: Removed
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: New file.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/sem_post.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_cond_wait.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_cond_timedwait.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_cond_signal.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/pthread_cond_broadcast.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/sem_post.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_wait.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_timedwait.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_signal.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/pthread_cond_broadcast.S: New file.
* sysdeps/unix/sysv/linux/i386/lowlevelcond.h: New file.
* sysdeps/unix/sysv/linux/i386/createthread.c: Define
PREPARE_CREATE and TLS_VALUE with x86-specific bits. All the rest
of the code is moved to ...
* sysdeps/pthread/createthread.c: ...here. New file.
2003-01-27 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S
(__new_sem_post): Clear %eax before returning.
Reported by MAEDA Naoaki <maeda.naoaki@jp.fujitsu.com>.
* Makefile (tests): Add tst-cleanup2.
* tst-cleanup2.c: New file.
* sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
Interpret first parameter correctly.
2003-01-17 Ulrich Drepper <drepper@redhat.com>
* Makefile (headers): Add bits/semaphore.h.
2003-01-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/tls.h (INIT_SYSINFO): Initialize _head->sysinfo even
if not SHARED.
2003-01-14 Ulrich Drepper <drepper@redhat.com>
* sem_open.c (sem_open): Return SEM_FAILED if existing semaphore
must be used and mapping failed.
Reported by Luke Elliott <luke.elliott@activfinancial.com>.
* Makefile (CFLAGS-pthread_self.os): Define this, not
CFLAGS-pthread_self.c.
2003-01-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Don't export
lll_unlock_wake_cb.
* Makefile (libpthread-routines): Add version. Add rules to build
version.os and banner.h.
* version.c: New file.
2003-01-13 Jakub Jelinek <jakub@redhat.com>
* pthread_mutex_lock.c (__pthread_mutex_lock_internal): Make
the alias unconditional.
* pthread_mutex_unlock.c (__pthread_mutex_unlock_internal): Likewise.
2003-01-13 Ulrich Drepper <drepper@redhat.com>
* Makefile (CFLAGS-pthread_self.c): New definition.
2003-01-06 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Add
INTERNAL_SYSCALL_DECL, add err argument to INTERNAL_SYSCALL* macros.
* sysdeps/unix/sysv/linux/raise.c (raise): Likewise.
* init.c (__pthread_initialize_minimal_internal): Likewise.
2003-01-07 Jakub Jelinek <jakub@redhat.com>
* pthreadP.h (__pthread_cond_timedwait): Add prototype.
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h
(RTLD_CORRECT_DYNAMIC_WEAK): Remove.
(DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
* sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h
(RTLD_CORRECT_DYNAMIC_WEAK): Remove.
(DL_SYSINFO_IMPLEMENTATION): Change into .text section and back.
2003-01-06 Jakub Jelinek <jakub@redhat.com>
* pthreadP.h (LIBC_CANCEL_HANDLED): Define.
* pt-system.c (LIBC_CANCEL_HANDLED): Add.
* tst-cancel-wrappers.sh: Remove all exceptions.
2003-01-05 Ulrich Drepper <drepper@redhat.com>
* tst-cancel-wrappers.sh: Invoke gawk not awk since we use GNU awk
features. Reported by Marijn Ros <marijn@mad.scientist.com>.
* sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
Use __libc_pthread_functions array if SHARED.
* pthreadP.h: Move pthread_cond_2_0_t definition to...
* sysdeps/unix/sysv/linux/internaltypes.h: ...here.
* sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
(__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
__libc_key_create, __libc_getspecific, __libc_setspecific): Use
__libc_ptf_call instead of __libc_maybe_call.
(PTF): New #define.
(__libc_cleanup_region_start): Wrap function name with PTF call.
(__libc_cleanup_region_end): Likewise.
(__libc_cleanup_end): Likewise.
* pthread_getspecific.c: Add __pthread_getspecific_internal alias.
* pthread_setspecific.c: Add __pthread_setspecific_internal alias.
* pthread_key_create.c: Add __pthread_key_create_internal alias.
* pthreadP.h: Add prototypes.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
__pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
__pthread_rwlock_unlock aliases.
* pthreadP.h: Add prototypes for new aliases.
* pthreadP.h (struct pthead_functions): Moved to...
* sysdeps/pthread/pthread-functions.h: ...here. New file.
* init.c (pthread_functions): Add initializers for new elements.
* cleanup_defer.c: Add __pthread_cleanup_push_defer and
__pthread_cleanup_pop_restore aliases.
* pthreadP.h: Add prototypes.
* cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
* pthreadP.h: Adjust prototypes and callers.
2003-01-04 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-cancel7.
(tst-cancel7-ARGS): New variable.
* tst-cancel7.c: New file.
* old_pthread_cond_broadcast.c: Optimize initialization a bit to work
around gcc defficiencies.
* old_pthread_cond_signal.c: Likewise.
* old_pthread_cond_timedwait.c: Likewise.
* old_pthread_cond_wait.c: Likewise.
* pthreadP.h (pthread_cond_2_0_t): Remove unneeded lock element.
2003-01-03 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-cond7.
* tst-cond7.c: New file.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
(condvar_cleanup): Get condvar address from the right place.
* atomic.h: Correct definitions of atomic_full_barrier,
atomic_read_barrier, atomic_write_barrier.
* old_pthread_cond_broadcast.c: Make memory allocate and initialization
race-free.
* old_pthread_cond_signal.c: Likewise.
* old_pthread_cond_timedwait.c: Likewise.
* old_pthread_cond_wait.c: Likewise.
2003-01-03 Jakub Jelinek <jakub@redhat.com>
* Makefile ($(objpfx)libpthread.so): Depend on ld.so.
2003-01-03 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h (pthread_cond_2_0_t): New type.
(struct pthread_functions): Use new type for 2.0 condvar callbacks.
Use new type for the 2.0 condvar function prototypes.
* forward.c: Use pthread_cond_2_0_t for 2.0 condvar functions.
* old_pthread_cond_init.c: Use pthread_cond_2_0_t for condvar
parameter.
* old_pthread_cond_destroy.c: Likewise.
* old_pthread_cond_broadcast.c: Likewise. Lock appropriately.
* old_pthread_cond_signal.c: Likewise.
* old_pthread_cond_timedwait.c: Likewise.
* old_pthread_cond_wait.c: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S
(__pthread_cond_wait): Don't save cancellation mode and seq value
in same location.
* herrno.c (__h_errno_location): Don't define as weak.
2003-01-02 Jakub Jelinek <jakub@redhat.com>
* Versions [libc] (GLIBC_2.3.2): Export pthread_cond_broadcast,
pthread_cond_destroy, pthread_cond_init, pthread_cond_signal
and pthread_cond_wait.
* old_pthread_cond_broadcast.c (__old_pthread_cond_broadcast):
Renamed to...
(__pthread_cond_broadcast_2_0): ... this.
* old_pthread_cond_destroy.c (__old_pthread_cond_destroy):
Renamed to...
(__pthread_cond_destroy_2_0): ... this.
* old_pthread_cond_init.c (__old_pthread_cond_init):
Renamed to...
(__pthread_cond_init_2_0): ... this.
* old_pthread_cond_signal.c (__old_pthread_cond_signal):
Renamed to...
(__pthread_cond_signal_2_0): ... this.
* old_pthread_cond_wait.c (__old_pthread_cond_wait):
Renamed to...
(__pthread_cond_wait_2_0): ... this.
* pthread_cond_destroy.c: Include shlib-compat.h.
(pthread_cond_destroy): Change strong_alias into versioned_symbol.
* pthread_cond_init.c: Include shlib-compat.h.
(pthread_cond_init): Change strong_alias into versioned_symbol.
* pthreadP.h (struct pthread_functions): Rename ptr_pthread_cond_*
fields to ptr___pthread_cond_* and add ptr___pthread_cond_*_2_0
fields.
(__pthread_cond_broadcast_2_0, __pthread_cond_destroy_2_0,
__pthread_cond_init_2_0, __pthread_cond_signal_2_0,
__pthread_cond_wait_2_0): New prototypes.
(__old_pthread_cond_broadcast, __old_pthread_cond_destroy,
__old_pthread_cond_init, __old_pthread_cond_signal,
__old_pthread_cond_wait): Removed.
* init.c: Include shlib-compat.h.
(pthread_functions): Guard ptr___pthread_attr_init_2_0
initialization with SHLIB_COMPAT (GLIBC_2_0, GLIBC_2_1).
Rename ptr_pthread_cond_* to ptr___pthread_cond_*, initialize
ptr___pthread_cond_*_2_0 fields.
* forward.c: Export both pthread_cond_*@@GLIBC_2.3.2 and
pthread_cond_*@GLIBC_2.0 compatibility symbols.
* sysdeps/pthread/sigaction.c (SIGCANCEL): Only define if
LIBC_SIGACTION was not yet defined.
[!defined LIBC_SIGACTION]: Define LIBC_SIGACTION, #include self.
[!defined LIBC_SIGACTION] (__sigaction): New function and
libc_hidden_weak.
[!defined LIBC_SIGACTION] (sigaction): New weak_alias.
[defined LIBC_SIGACTION]: #include_next <sigaction.c>.
2003-01-02 Jakub Jelinek <jakub@redhat.com>
* Makefile (CFLAGS-pthread_atfork.c): Add -DNOT_IN_libc.
2003-01-02 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
New, larger type definition.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: New condvar
implementation.
* Versions [libpthread]: Add definitions for new pthread_cond_*
interfaces for version GLIBC_2.3.2.
* pthread_cond_init.c: Update initialization for new type definition.
* Makefile (libpthread-routines): Remove pthread_cond_wait,
pthread_cond_timedwait, pthread_cond_signal, and
pthread_cond_broadcast. Add old_pthread_cond_init,
old_pthread_cond_destroy, old_pthread_cond_wait,
old_pthread_cond_timedwait, old_pthread_cond_signal, and
old_pthread_cond_broadcast.
* old_pthread_cond_broadcast.c: New file.
* old_pthread_cond_destroy.c: New file.
* old_pthread_cond_init.c: New file.
* old_pthread_cond_signal.c: New file.
* old_pthread_cond_timedwait.c: New file.
* old_pthread_cond_wait.c: New file.
* pthreadP.h: Add prototypes for the compatibility interfaces.
* pthread_cond_destroy.c: Don't include <errno.h>.
2003-01-01 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Avoid
unnecessary zero offset when addressing MUTEX.
2002-12-31 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/fork.h: Add libc_hidden_proto for
__register_atfork.
* sysdeps/unix/sysv/linux/register-atfork.c: Add libc_hidden_def
for __register_atfork.
2002-12-31 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use __ASSEMBLER__
instead of ASSEMBLER test macro.
* sysdeps/unix/sysv/linux/allocrtsig.c (__libc_current_sigrtmin,
__libc_current_sigrtmax): Add libc_hidden_def.
* sysdeps/pthread/list.h: Remove assert.h include.
2002-12-31 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Use
__pthread_initialize_minimal_internal not
__pthread_initialize_minimal.
2002-12-30 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pt-initfini.c (call_initialize_minimal): Mark
__pthread_initialize_minimal as hidden.
* init.c (__pthread_initialize_minimal_internal): Don't mark as
constructor.
2002-12-31 Jakub Jelinek <jakub@redhat.com>
* Makefile ($(inst_libdir)/libpthread.so): Depend on
$(common-objpfx)format.lds, include that into the output script.
Fix comment.
(extra-B-pthread.so): Change linuxthreads/ into nptl/.
2002-12-28 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
nsec resolution changes.
(xstat64_conv): Likewise.
(xstat32_conv): Likewise.
* sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
struct kernel_stat.
* sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
structs stat and stat64.
* time/time.h (__timespec_defined): Define for __USE_MISC.
* io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
2002-12-30 Jakub Jelinek <jakub@redhat.com>
* forward.c (FORWARD2): Renamed from FORWARD3. Remove unused export
argument.
(pthread_attr_init_2_0, pthread_attr_init_2_1): Use FORWARD macro.
(pthread_exit): Use strong_alias to avoid warnings.
* pthreadP.h (struct pthread_functions): Rename ptr_pthread_exit
and ptr_pthread_attr_init_2_* to ptr___pthread_exit and
ptr___pthread_attr_init_2_*.
* init.c (pthread_functions): Adjust.
2002-12-29 Ulrich Drepper <drepper@redhat.com>
* forward.c: Make all functions available by default again. It
caused too much trouble.
* pt-siglongjmp.c: Removed.
2002-12-28 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/tls.h: Include tcb-offsets.h in assembler.
(SYSINFO_OFFSET, MULTIPLE_THREADS_OFFSET): Remove.
* sysdeps/i386/Makefile: New file.
* sysdeps/i386/tcb-offsets.sym: New file.
* sysdeps/pthread/tcb-offsets.h: New file.
* sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
Remove MULTIPLE_THREADS_OFFSET and SYSINFO_OFFSET checks.
* sysdeps/unix/sysv/linux/Versions [libc] (GLIBC_PRIVATE): Move
__register_atfork...
(GLIBC_2.3.2): ...here.
2002-12-28 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread.h: Mark pthread_attr_getstackaddr and
pthread_attr_setstackaddr with __attribute_deprecated__.
2002-12-27 Jakub Jelinek <jakub@redhat.com>
* pt-system.c (system): Remove cancellation handling.
* tst-cancel-wrappers.sh: Allow pt-system.o* to not use the
cancellation routines.
2002-12-28 Ulrich Drepper <drepper@redhat.com>
* descr.h: Include <dl-sysdep.h>.
(struct pthread): Move header.data.list to the back of the struct.
* sysdeps/i386/tls.h (tcbhead_t): Move list to the back of the struct.
(MULTIPLE_THREADS_OFFSET): Adjust offset.
(SYSINFO_OFFSEET): Likewise.
2002-12-27 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h (USE_DL_SYSINFO):
Define.
(DL_SYSINFO_DEFAULT): Cast to uintptr_t to avoid warnings.
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h (NEED_DL_SYSINFO,
DL_SYSINFO_DEFAULT, DL_SYSINFO_IMPLEMENTATION): Define.
(USE_DL_SYSINFO): Undef.
2002-12-22 Jakub Jelinek <jakub@redhat.com>
* Makefile (tests-reverse): Use $(objpfx)../libc.so instead of
$(common-objpfx)libc.so.
* tst-cancel4.c (tf_write, tf_writev): Increase buf sizes so that
it is bigger than pipe buffer size even on arches with bigger
page size.
(tf_usleep): Cast usleep argument to useconds_t to avoid warnings.
2002-12-25 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Implement
correct errno access for case that USE___THREAD is not defined.
2002-12-24 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Add missing #endif.
Patch by Marijn Ros <marijn@mad.scientist.com>.
2002-12-22 Roland McGrath <roland@redhat.com>
* Makefile (omit-deps): Add $(unix-syscalls:%=ptw-%).
2002-12-20 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/bits/stdio-lock.h (_IO_lock_inexpensive): Define.
2002-12-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Don't define
NEED_DL_SYSINFO since no processor < i686 had the sysenter opcode.
* sysdeps/unix/sysv/linux/i386/i686/dl-sysdep.h: New file.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Use ENTER_KERNEL instead
of int $0x80.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_barrier_wait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Add support for using
sysenter.
* sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Likewise.
* sysdeps/i386/tls.h: Unconditionally include <dl-sysdep.h>.
* allocatestack.c (allocate_stack) [NEED_DL_SYSINFO]: Set sysinfo
in new TCB.
* sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Check
that sysinfo is properly initialized.
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define RTLD_PRIVATE_ERRNO
to 1 only for ld.so.
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h: Define
RTLD_CORRECT_DYNAMIC_WEAK.
2002-12-19 Jakub Jelinek <jakub@redhat.com>
* forward.c (pthread_attr_init_2_0, pthread_attr_init_2_1):
Use return 0 as 6th argument to FORWARD4.
* pthread_equal.c: Include pthreadP.h instead of pthread.h.
2002-12-18 Ulrich Drepper <drepper@redhat.com>
* descr.h (struct pthread) [NEED_DL_SYSINFO]: Add sysinfo member.
* sysdeps/i386/tls.h (tcbhead_t): Add sysinfo member.
Define SYSINFO_OFFSEET if NEED_DL_SYSINFO is defined.
(INIT_SYSINFO): New #define.
(TLS_TP_INIT): Use INIT_SYSINFO.
* sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
At test to make sure SYSINFO_OFFSET value is correct.
* sysdeps/unix/sysv/linux/i386/dl-sysdep.h: New file.
2002-12-18 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/flockfile.c (flockfile): Change into weak alias.
* sysdeps/unix/sysv/linux/raise.c (gsignal): Add weak alias to raise.
* Versions [libc: GLIBC_2.0]: Add pthread_attr_init.
[libpthread: GLIBC_2.1]: Remove __pthread_rwlock_init,
__pthread_rwlock_destroy, __pthread_rwlock_rdlock,
__pthread_rwlock_wrlock, __pthread_rwlock_unlock,
__pthread_rwlock_tryrdlock and __pthread_rwlock_trywrlock.
2002-12-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Use ENTER_KERNEL
macro instead of using int $0x80 directly.
* sysdeps/pthread/bits/stdio-lock.h: New file.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: New file.
* Makefile (routines): Add libc-lowlevelmutex.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Remove
__i686.get_pc_thunk.dx.
2002-12-17 Jakub Jelinek <jakub@redhat.com>
* Makefile (libpthread-shared-only-routines): Add pt-allocrtsig.
(tests): Depend on $(objpfx)tst-cancel-wrappers.out.
($(objpfx)tst-cancel-wrappers.out): New rule.
* tst-cancel-wrappers.sh: New test.
* tst-locale1.c: Include signal.h.
(uselocale): Test static linking of __libc_current_sigrt*.
2002-12-17 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-cancel6.
* tst-cancel6.c: New file
2002-12-17 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P):
Define meaningfully for assembler as well.
* pthreadP.h (struct pthread_functions): Remove
ptr_pthread_attr_init field. Add ptr_pthread_attr_init_2_0
and ptr_pthread_attr_init_2_1 fields.
* init.c (pthread_functions): Initialize ptr_pthread_attr_init_2_0
and ptr_pthread_attr_init_2_1 instead of ptr_pthread_attr_init.
* forward.c (FORWARD4): Renamed from FORWARD3. Add export argument.
(FORWARD3): Define using FORWARD4.
(pthread_attr_init): Provide both @GLIBC_2.0 and @@GLIBC_2.1
versions.
* pt-system.c: Remove duplicate stdlib.h include.
2002-12-16 Ulrich Drepper <drepper@redhat.com>
* sem_init.c: Define sem_init@GLIBC_2.0.
* sem_destroy.c: Define sem_destroy@GLIBC_2.0.
* sem_getvalue.c: Define sem_getvalue@GLIBC_2.0.
* flockfile.c: Moved to...
* sysdeps/pthread/flockfile.c: ...here. New file.
* funlockfile.c: Moved to...
* sysdeps/pthread/funlockfile.c: ...here. New file.
* ftrylockfile.c: Moved to...
* sysdeps/pthread/ftrylockfile.c: ...here. New file.
2002-12-16 Jakub Jelinek <jakub@redhat.com>
* libc-cancellation.c: Guard both function with
#if !defined NOT_IN_libc.
* Makefile (libpthread-routines): Use ptw-, not pt- prefix for the
automatically provided pthread wrappers.
* pthreadP.h (LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): Define to
CANCEL_* if IS_IN_libpthread and to dummy versions if not in libc
nor in libpthread.
* pt-open.c: Removed.
* pt-fcntl.c: Removed.
* pt-fsync.c: Removed.
* pt-lseek.c: Removed.
* pt-msgrcv.c: Removed.
* pt-msgsnd.c: Removed.
* pt-msync.c: Removed.
* pt-nanosleep.c: Removed.
* pt-open64.c: Removed.
* pt-pause.c: Removed.
* pt-pread.c: Removed.
* pt-pread64.c: Removed.
* pt-pwrite.c: Removed.
* pt-pwrite64.c: Removed.
* pt-read.c: Removed.
* pt-recv.c: Removed.
* pt-recvfrom.c: Removed.
* pt-recvmsg.c: Removed.
* pt-send.c: Removed.
* pt-sendto.c: Removed.
* pt-sigtimedwait.c: Removed.
* pt-sigwait.c: Removed.
* pt-wait.c: Removed.
* pt-waitpid.c: Removed.
* pt-write.c: Removed.
* pt-accept.c: Removed.
* pt-close.c: Removed.
* pt-connect.c: Removed.
* pt-lseek64.c: Removed.
* pt-sendmsg.c: Removed.
* pt-tcdrain.c: Removed.
2002-12-15 Ulrich Drepper <drepper@redhat.com>
* init.c (__pthread_initialize_minimal_internal): Renamed from
__pthread_initialize_minimal. Make old name an alias. This
converts a normal relocation into a relative relocation.
* pt-fcntl.c (__fcntl): Use fcntl64 syscall, not fcntl.
* Versions [libpthread: GLIBC_2.3.2]: Remove creat, poll, pselect,
readv, select, sigpause, sigsuspend, sigwaitinfo, waitid, writev.
* Makefile (libpthread-routines): Remove pt-creat, pt-poll,
pt-pselect, pt-readv, pt-select, pt-sigpause, pt-sigsuspend,
pt-sigwaitinfo, pt-waitid, and pt-writev.
* pt-creat.c: Removed.
* pt-poll.c: Removed.
* pt-pselect.c: Removed.
* pt-readv.c: Removed.
* pt-select.c: Removed.
* pt-sigpause.c: Removed.
* pt-sigsuspend.c: Removed.
* pt-sigwaitinfo.c: Removed.
* pt-waitid.c: Removed.
* pt-writev.c: Removed.
* init.c (pthread_functions): New variable.
(__pthread_initialize_minimal): Pass pointer to pthread_functions
(or NULL) to __libc_pthread_init.
* forward.c: Rewrite to use __libc:pthread_functions array to get
function addresses.
* sysdeps/unix/sysv/linux/fork.h: Remove __libc_pthread_init
prototype.
* sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
Take new parameter. Copy content of variable pointed to by it
to __libc_pthread_init.
* pthreadP.h (struct pthread_functions): New type.
(__libc_pthread_init): Declare.
* pthread_attr_destroy.c: Add namespace protected alias.
* pthread_attr_getdetachstate.c: Likewise.
* pthread_attr_getinheritsched.c: Likewise.
* pthread_attr_getschedparam.c: Likewise.
* pthread_attr_getschedpolicy.c: Likewise.
* pthread_attr_getscope.c: Likewise.
* pthread_attr_setdetachstate.c: Likewise.
* pthread_attr_setinheritsched.c: Likewise.
* pthread_attr_setschedparam.c: Likewise.
* pthread_attr_setschedpolicy.c: Likewise.
* pthread_attr_setscope.c: Likewise.
* pthread_cond_broadcast.c: Likewise.
* pthread_cond_destroy.c: Likewise.
* pthread_cond_init.c: Likewise.
* pthread_cond_signal.c: Likewise.
* pthread_cond_wait.c: Likewise.
* pthread_condattr_destroy.c: Likewise.
* pthread_condattr_init.c: Likewise.
* pthread_equal.c: Likewise.
* pthread_exit.c: Likewise.
* pthread_getschedparam.c: Likewise.
* pthread_self.c: Likewise.
* pthread_setcancelstate.c: Likewise.
* pthread_setschedparam.c: Likewise.
* pthread_mutex_destroy.c: Likewise.
* pthread_mutex_init.c: Likewise.
* pthreadP.h: Add prototypes for the aliases.
* sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Set
multiple_threads member in correct TCB to 1.
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Define
SINGLE_THREAD_P. If in libc or libpthread examine multiple_thread
member of thread decriptor, otherwise return unconditionally 1.
2002-12-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/pt-socket.S: Changes folded into the
regular Linux version. Remove file.
* sysdeps/unix/sysv/linux/connect.S: Likewise. Remove file.
* sysdeps/unix/sysv/linux/llseek.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/msgrcv.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/msgsnd.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/open64.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/poll.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/pread.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/pread64.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/pselect.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/pwrite.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/pwrite64.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/readv.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/recv.S: Likewise. Remove file.
* sysdeps/unix/sysv/linux/recvfrom.S: Likewise. Remove file.
* sysdeps/unix/sysv/linux/recvmsg.S: Likewise. Remove file.
* sysdeps/unix/sysv/linux/send.S: Likewise. Remove file.
* sysdeps/unix/sysv/linux/sendmsg.S: Likewise. Remove file.
* sysdeps/unix/sysv/linux/sendto.S: Likewise. Remove file.
* sysdeps/unix/sysv/linux/sigpause.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/sigsuspend.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/sigwait.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/system.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/tcdrain.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/wait.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/waitid.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/waitpid.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/writev.c: Likewise. Remove file.
* sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise. Remove file.
2002-12-14 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/open.c: Removed.
* sysdeps/unix/sysv/linux/fsync.c: Removed.
* sysdeps/unix/sysv/linux/lseek.c: Removed.
* sysdeps/unix/sysv/linux/msync.c: Removed.
* sysdeps/unix/sysv/linux/read.c: Removed.
* sysdeps/unix/sysv/linux/close.c: Removed.
* sysdeps/unix/sysv/linux/creat.c: Removed.
* sysdeps/unix/sysv/linux/nanosleep.c: Removed.
* sysdeps/unix/sysv/linux/pause.c: Removed.
* sysdeps/unix/sysv/linux/select.c: Removed.
* sysdeps/unix/sysv/linux/write.c: Removed.
2002-12-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/pt-socket.S: Check multiple_threads
element in TCB to see whether locking is needed.
* sysdeps/unix/sysv/linux/libc_pthread_init.c: Check that
MULTIPLE_THREADS_OFFSET value is correct.
* sysdeps/unix/sysv/linux/close.c: New file.
* sysdeps/unix/sysv/linux/connect.S: New file.
* sysdeps/unix/sysv/linux/creat.c: New file.
* sysdeps/unix/sysv/linux/fsync.c: New file.
* sysdeps/unix/sysv/linux/llseek.c: New file.
* sysdeps/unix/sysv/linux/lseek.c: New file.
* sysdeps/unix/sysv/linux/msgrcv.c: New file.
* sysdeps/unix/sysv/linux/msgsnd.c: New file.
* sysdeps/unix/sysv/linux/msync.c: New file.
* sysdeps/unix/sysv/linux/nanosleep.c: New file.
* sysdeps/unix/sysv/linux/open.c: New file.
* sysdeps/unix/sysv/linux/open64.c: New file.
* sysdeps/unix/sysv/linux/pause.c: New file.
* sysdeps/unix/sysv/linux/poll.c: New file.
* sysdeps/unix/sysv/linux/pread.c: New file.
* sysdeps/unix/sysv/linux/pread64.c: New file.
* sysdeps/unix/sysv/linux/pselect.c: New file.
* sysdeps/unix/sysv/linux/pwrite.c: New file.
* sysdeps/unix/sysv/linux/pwrite64.c: New file.
* sysdeps/unix/sysv/linux/readv.c: New file.
* sysdeps/unix/sysv/linux/recv.S: New file.
* sysdeps/unix/sysv/linux/recvfrom.S: New file.
* sysdeps/unix/sysv/linux/recvmsg.S: New file.
* sysdeps/unix/sysv/linux/select.c: New file.
* sysdeps/unix/sysv/linux/send.S: New file.
* sysdeps/unix/sysv/linux/sendmsg.S: New file.
* sysdeps/unix/sysv/linux/sendto.S: New file.
* sysdeps/unix/sysv/linux/sigpause.c: New file.
* sysdeps/unix/sysv/linux/sigsuspend.c: New file.
* sysdeps/unix/sysv/linux/sigtimedwait.c: New file.
* sysdeps/unix/sysv/linux/sigwait.c: New file.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: New file.
* sysdeps/unix/sysv/linux/system.c: New file.
* sysdeps/unix/sysv/linux/tcdrain.c: New file.
* sysdeps/unix/sysv/linux/wait.c: New file.
* sysdeps/unix/sysv/linux/waitid.c: New file.
* sysdeps/unix/sysv/linux/waitpid.c: New file.
* sysdeps/unix/sysv/linux/writev.c: New file.
* sysdeps/unix/sysv/linux/i386/fcntl.c: New file.
* pt-readv.c: Fix comment.
2002-12-14 Jakub Jelinek <jakub@redhat.com>
* tst-cleanup1.c: Include stdlib.h.
* tst-cancel5.c: New test.
* Makefile (tests): Add tst-cancel5.
(tst-cancel5): Link against libc.so libpthread.so in that order.
2002-12-13 Ulrich Drepper <drepper@redhat.com>
* forward.c (test_loaded): Prevent recursive calls.
* Makefile (routines): Add libc-cancellation.
* libc-cancellation.c: New file.
* descr.h (struct pthread): Add multiple_threads field.
* allocatestack.c (allocate_stack): Initialize multiple_header field of
new thread descriptor to 1.
* sysdeps/unix/sysv/linux/i386/createthread.c (create_thread):
Initialize multiple_thread field after successful thread creation.
* cancellation.c (__do_cancel): Move to pthreadP.h.
(__pthread_enable_asynccancel): Remove parameter from __do_cancel call.
(__pthread_disable_asynccancel): Add internal_function attribute.
* init.c (sigcancel_handler): Remove parameter from __do_cancel call.
* pthread_setcancelstate.c: Likewise.
* pthread_setcanceltype.c: Likewise.
* pthread_exit.c: Likewise.
* pthreadP.h (CANCELLATION_P): Likewise.
(__do_cancel): Define as static inline.
(LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET): New #defines.
(__libc_enable_asynccancel, __libc_disable_asynccancel): New
declarations.
* sysdeps/i386/tls.h (tcbhead_t): Add list and multiple_threads
fields. Define MULTIPLE_THREADS_OFFSET.
* sysdeps/pthread/bits/libc-lock.h: Remove __libc_locking_needed
declaration.
* sysdeps/unix/sysv/linux/accept.S: New file.
* sysdeps/unix/sysv/linux/read.c: New file.
* sysdeps/unix/sysv/linux/write.c: New file.
* sysdeps/unix/sysv/linux/i386/pt-socket.S: New file.
* sysdeps/unix/sysv/linux/libc_pthread_init.c: Remove definition and
initialization of __libc_locking_needed.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Don't use
__libc_locking_needed, use multiple_threads field in TCB.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2002-12-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: Use i486
version.
* sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Correct
access to __libc_locking_needed for PIC.
2002-12-12 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/bits/libc-lock.h (__libc_locking_needed): Only
declare for libc.so.
(__libc_lock_init, __libc_lock_init_recursive): Change into comma
expression.
(__libc_lock_lock): Put into statement expression.
(__libc_lock_unlock): Remove trailing semicolon.
* sysdeps/unix/sysv/linux/fork.h (__libc_pthread_init): Fix typo.
2002-12-12 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use asm operand with
"m" constraint to refer to __libc_locking_needed. Declare it here.
2002-12-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/fork-gen.c: Renamed to...
* sysdeps/unix/sysv/linux/libc_pthread_init.c: ...this.
Initialize __libc_locking_needed.
* init.c (__pthread_initialize_minimal): Call __libc_pthread_init
instead of __register_pthread_fork_handler.
* sysdeps/pthread/bits/libc-lock.h: Declare __libc_locking_needed.
* sysdeps/unix/sysv/linux/Makefile (sysdep_routimes): Replace
fork-gen with libc_pthread_init.
* sysdeps/unix/sysv/linux/Versions: Use __libc_pthread_init instead
of __register_pthread_fork_handler.
* sysdeps/unix/sysv/linux/fork.h: Declare __libc_pthread_init instead
of __register_pthread_fork_handler.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Use
__libc_locking_needed to determine whether lock prefix can be avoided.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: Likewise.
2002-12-11 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-cleanup1.
* tst-cleanup1.c: New file.
* cancellation.c (__cleanup_thread): Removed.
(__do_cancel): Remove call to __cleanup_thread.
* pthreadP.h: Remove __cleanup_thread prorotype.
* sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
Remember function and argument even if cancellation handler
function is not available.
(__libc_cleanup_region_end): Execute registered function directly if
pthread functions are not available.
(__libc_cleanup_end): Likewise.
* init.c (__pthread_initialize_minimal): Fix initialization in
static lib by preventing gcc from being too clever.
2002-12-10 Ulrich Drepper <drepper@redhat.com>
* init.c (__pthread_initialize_minimal): Remove unneccesary
sigaddset call.
* Makefile (tests): We can run tst-locale2 now.
2002-12-09 Ulrich Drepper <drepper@redhat.com>
* Versions: Remove duplicated sigwait entry.
2002-12-08 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h: Enable pthread_cleanup_{push,pop} optimizations only
inside libpthread.
* pt-fcntl.c (__fcntl): Initialize oldtype to avoid warning.
* pthreadP.h: Declare __pthread_enable_asynccancel and
__pthread_disable_asynccancel.
(CANCEL_ASYNC): Use __pthread_enable_asynccancel.
(CANCEL_RESET): Use __pthread_disable_asynccancel.
* cancellation.c (__pthread_enable_asynccancel): New function.
(__pthread_disable_asynccancel): New function.
* pt-accept.c: Adjust for CANCEL_ASYNC and CANCEL_RESET change.
* pt-close.c: Likewise.
* pt-connect.c: Likewise.
* pt-creat.c: Likewise.
* pt-fcntl.c: Likewise.
* pt-fsync.c: Likewise.
* pt-lseek.c: Likewise.
* pt-lseek64.c: Likewise.
* pt-msgrcv.c: Likewise.
* pt-msgsnd.c: Likewise.
* pt-msync.c: Likewise.
* pt-nanosleep.c: Likewise.
* pt-open.c: Likewise.
* pt-open64.c: Likewise.
* pt-pause.c: Likewise.
* pt-poll.c: Likewise.
* pt-pread.c: Likewise.
* pt-pread64.c: Likewise.
* pt-pselect.c: Likewise.
* pt-pwrite.c: Likewise.
* pt-pwrite64.c: Likewise.
* pt-read.c: Likewise.
* pt-readv.c: Likewise.
* pt-recv.c: Likewise.
* pt-recvfrom.c: Likewise.
* pt-recvmsg.c: Likewise.
* pt-select.c: Likewise.
* pt-send.c: Likewise.
* pt-sendmsg.c: Likewise.
* pt-sendto.c: Likewise.
* pt-sigpause.c: Likewise.
* pt-sigsuspend.c: Likewise.
* pt-sigtimedwait.c: Likewise.
* pt-sigwait.c: Likewise.
* pt-sigwaitinfo.c: Likewise.
* pt-system.c: Likewise.
* pt-tcdrain.c: Likewise.
* pt-wait.c: Likewise.
* pt-waitid.c: Likewise.
* pt-waitpid.c: Likewise.
* pt-write.c: Likewise.
* pt-writev.c: Likewise.
* pthread_join.c: Likewise.
* pthread_timedjoin.c: Likewise.
* pt-sigpause.c (sigsuspend): Call __sigsuspend.
(__xpg_sigpause): New function.
* Versions (libpthread:GLIBC_2.3.2): Add __xpg_sigpause.
2002-12-07 Ulrich Drepper <drepper@redhat.com>
* Makefile (CFLAGS-ftrylockfile.c): Add -D_IO_MTSAFE_IO.
* cleanup.c: Move declarations of _GI_pthread_cleanup_push and
_GI_pthread_cleanup_pop to pthreadP.h.
* ftrylockfile.c: Use _IO_lock_trylock instead of
pthread_mutex_trylock.
* pthreadP.h (CANCEL_ASYNC): Use __pthread_setcanceltype.
(CANCEL_RESET): Likewise.
(__pthread_setcanceltype_): Declare.
(__pthread_mutex_lock_internal): Declare.
(__pthread_mutex_unlock_internal): Declare.
(__pthread_once_internal): Declare.
(pthread_cleanup_push): Redefine using _GI_pthread_cleanup_push.
(pthread_cleanup_pop): Redefine using _GI_pthread_cleanup_pop.
* pthread_cond_timedwait.c: Use INTUSE is calls to pthread_mutex_lock
and pthread_mutex_unlock.
* pthread_cond_wait.c: Likewise.
* pthread_mutex_lock.c: Use INTDEF to define alias if needed.
* pthread_mutex_unlock.c: Likewise.
* pthread_setcanceltype.c: Add additional alias
__pthread_setcanceltype.
* sem_unlink.c (sem_unlink): Use __pthread_once with INTDEF.
* sem_open.c (sem_open): Likewise.
Use __libc_open, __libc_write, and __libc_close instead of
open, write, and close respectively.
* sysdeps/pthread/bits/libc-lock.h (__libc_lock_trylock_internal):
Rewrite as statement expression since it must return a value.
* pthread_cancel.c: Use __pthread_kill instead of pthread_kill.
* sysdeps/unix/sysv/linux/pthread_kill.c: Define additional alias
__pthread_kill.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Define additional
alias __pthread_once_internal.
* sysdeps/unix/sysv/linux/raise.c: Use libc_hidden_def for raise.
2002-12-06 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-stdio1 and tst-stdio2.
* tst-stdio1.c: New file.
* tst-stdio2.c: New file.
* init.c (__pthread_initialize_minimal): Correct INIT_LIST_HEAD use.
* Makefile (tests): Comment out tst-locale2 for now.
(CFLAGS-flockfile.c, CFLAGS-funlockfile.c): Define to -D_IO_MTSAFE_IO.
* sysdeps/unix/sysv/linux/Makefile: Define CFLAGS-fork.c to
-D_IO_MTSAFE_IO.
* sysdeps/unix/sysv/linux/fork.c: Include <bits/stdio-lock.h>.
Use _IO_lock_init instead of explicit assignment.
* sysdeps/pthread/bits/libc-lock.h: Define __rtld_lock_* macros.
Define __libc_lock_* and __libc_lock_recursive macros with
lowlevellock macros, not pthread mutexes.
* flockfile.c: Include <bits/stdio-lock.h>. Use _IO_lock_lock instead
of pthread_mutex_lock.
* funlockfile.c: Include <bits/stdio-lock.h>. Use _IO_lock_unlock
instead of pthread_mutex_unlock.
2002-12-06 Roland McGrath <roland@redhat.com>
* allocatestack.c (__stack_user): Use uninitialized defn.
* init.c (__pthread_initialize_minimal): Initialize it here.
2002-12-05 Roland McGrath <roland@redhat.com>
* sysdeps/i386/tls.h (TLS_INIT_TP): Make it return zero or an error
string.
* sysdeps/x86_64/tls.h (TLS_INIT_TP): Likewise.
* sysdeps/unix/sysv/linux/i386/createthread.c (create_thread): Add
missing & here too.
2002-12-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
lowlevellock.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevellock.S: New file.
* sysdeps/unix/sysv/linux/i386/i586/libc-lowlevellock.S: New file.
* sysdeps/unix/sysv/linux/i386/i686/libc-lowlevellock.S: New file.
* sysdeps/pthread/bits/libc-lock.h: Use lowlevellock implementation
for __libc_lock_* macros.
* Makefile (routines): Add libc-lowlevellock.
2002-10-09 Roland McGrath <roland@redhat.com>
* sysdeps/pthread/bits/libc-lock.h (__libc_maybe_call): New macro.
Under [__PIC__], call the function via the pointer fetched for
comparison rather than a call by name that uses the PLT.
(__libc_lock_init, __libc_rwlock_init, __libc_lock_fini)
(__libc_rwlock_fini, __libc_lock_lock, __libc_rwlock_rdlock)
(__libc_rwlock_wrlock, __libc_lock_trylock, __libc_rwlock_tryrdlock)
(__libc_rwlock_trywrlock, __libc_lock_unlock, __libc_rwlock_unlock)
(__libc_key_create, __libc_getspecific, __libc_setspecific): Use it.
2002-12-04 Roland McGrath <roland@redhat.com>
* forward.c (pthread_self): Use FORWARD3 macro to correct return type.
* sysdeps/i386/td_ta_map_lwp2thr.c: Moved from ../nptl_db.
* sysdeps/generic/td_ta_map_lwp2thr.c: New file.
* pthread_create.c (start_thread): Add missing & on __nptl_last_event.
2002-12-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Make pthread_t
a completely opaque, non-integer type.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise.
2002-12-05 Jakub Jelinek <jakub@redhat.com>
* sysdeps/i386/tls.h: Include stdlib.h.
* sysdeps/x86_64/tls.h: Likewise.
2002-12-04 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-locale2.
(tests-static): Likewise.
* tst-locale2.c: New file.
* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Mark asms as
volatile and add memory clobbers to lock operations.
2002-12-03 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/i686/bits/atomic.h: Use i486 version.
* sysdeps/i386/i486/bits/atomic.h: New file.
* sysdeps/i386/i586/bits/atomic.h: New file.
* sysdeps/i386/i686/pthread_spin_trylock.S: Define HAVE_CMOV and
include i486 version.
* sysdeps/i386/i486/pthread_spin_trylock.S: New file.
* sysdeps/i386/i586/pthread_spin_trylock.S: New file.
Patch by Marijn Ros <marijn@mad.scientist.com>.
* allocatestack.c (get_cached_stack): Don't crash if we first
found a stack with a larger size then needed.
Reported by Hui Huang <hui.huang@sun.com>.
* Makefile (tests): Add tst-sysconf.
* tst-sysconf.c: New file.
* sysdeps/unix/sysv/linux/bits/local_lim.h: Undefine
PTHREAD_THREADS_MAX.
2002-12-02 Roland McGrath <roland@redhat.com>
* pthreadP.h (__stack_user, __nptl_create_event, __nptl_death_event):
Declare using hidden_proto instead of attribute_hidden, so there are
non-.hidden static symbols for gdb to find.
(__pthread_keys): Likewise.
* events.c (__nptl_create_event, __nptl_death_event): Add hidden_def.
* allocatestack.c (__stack_user): Likewise.
* pthread_create.c (__pthread_keys): Likewise.
(__nptl_threads_events, __nptl_last_event): Make these static instead
of hidden.
* pthread_key_create.c (__pthread_pthread_keys_max,
__pthread_pthread_key_2ndlevel_size): Renamed from __linuxthreads_*.
2002-12-02 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-locale1. If buid-static is yes link
statically.
* tst-locale1.c: New file.
* pthread_cond_timedwait.c: Include <stdlib.h>.
* Makefile (tests): Add tst-fork2 and tst-fork3.
* tst-fork2.c: New file.
* tst-fork3.c: New file.
2002-11-28 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: New file.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define macros which
require it to 200112L.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Use cmov
instruction only if HAVE_CMOV is defined.
* sysdeps/unix/sysv/linux/i386/i686/lowlevelrwlock.S: Define HAVE_CMOV.
* sysdeps/unix/sysv/linux/x86_64/bits/semaphore.h: New file.
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: New file.
* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: New file.
* sysdeps/unix/sysv/linux/x86_64/pt-vfork.S: New file.
2002-11-27 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/bits/atomic.h: New file.
* sysdeps/i386/i686/bits/atomic.h: Fix asm syntax for 8- and
16-bit operations.
* sysdeps/unix/sysv/linux/raise.c (raise): Use INTERNAL_SYSCALL if
possible since gettid cannot fail.
* sysdeps/x86_64/pthreaddef.h: New file.
* sysdeps/i386/pthreaddef.h (gettid): Removed.
* sysdeps/x86_64/pthread_spin_init.c: New file.
* sysdeps/x86_64/pthread_spin_lock.c: New file.
* sysdeps/x86_64/pthread_spin_trylock.c: New file.
* sysdeps/x86_64/pthread_spin_unlock.c: New file.
* sysdeps/i386/i686/pthread_spin_trylock.S (pthread_spin_trylock):
Add missing lock prefix. Minute optimization.
* tst-spin2.c (main): Also check successful trylock call.
* sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Use correct
syscall. Fix typo in case INTERNAL_SYSCALL is not used.
* sysdeps/i386/pthread_spin_destroy.c: Moved to...
* sysdeps/pthread/pthread_spin_destroy.c: ...here. New file.
* sysdeps/i386/pthread_sigmask.c: Removed. Use the generic code.
* sysdeps/pthread/pthread_sigmask.c (pthread_sigmask): Return correct
value in case of an error. Add support for INTERNAL_SYSCALL.
* sysdeps/i386/pthread_sigmask.c (pthread_sigmask): Return correct
value in case of an error.
* sysdeps/x86_64/tls.h: New file.
2002-11-26 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/tls.h (THREAD_GETMEM_NC): Change interface. It now
takes the array member name and the index as parameters.
(THREAD_SETMEM_NC): Likewise.
* pthread_getspecific.c: Use new THREAD_GETMEM_NC interface.
* pthread_setspecific.c: Use new THREAD_GETMEM_NC and THREAD_SETMEM_NC
interfaces.
* sysdeps/i386/tls.h (THREAD_SETMEM): Use size of member element
to decide which code to use.
(THREAD_SETMEM_NC): Likewise.
* allocatestack.c (queue_stack): Don't remove stack from list here.
Do it in the caller. Correct condition to prematurely terminate
loop to free stacks.
(__deallocate_stack): Remove stack from list here.
2002-11-26 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-stack1.
* tst-stack1.c: New file.
* allocatestack.c (allocate_stack): Initialize the TCB on a user
provided stack.
* pthread_attr_getstack.c: Return bottom of the thread area.
2002-11-25 Ulrich Drepper <drepper@redhat.com>
* Makefile (libpthread-routines): Add pt-allocrtsig and
pthread_kill_other_threads.
* pt-allocrtsig.c: New file.
* pthread_kill_other_threads.c: New file.
* sysdeps/unix/sysv/linux/allocrtsig.c: Add additional aliases for
all three functions.
* sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove
allocrtsig.
* sysdeps/unix/sysv/linux/Versions (libc:GLIBC_PRIVATE): Export
__libc_current_sigrtmin_private, __libc_current_sigrtmax_private,
and __libc_allocate_rtsig_private.
* Versions (libpthread): Export pthread_kill_other_threads_np,
__libc_current_sigrtmin, and __libc_current_sigrtmax.
2002-11-24 Ulrich Drepper <drepper@redhat.com>
* allocatestack.c (allocate_stack): stackaddr in attribute points to
the end of the stack. Adjust computations.
When mprotect call fails dequeue stack and free it.
* pthread_attr_setstack.c: Store top of the stack in stackaddr
attribute.
* pthread_getattr_np.c: Likewise.
* descr.h (IS_DETACHED): Add some more parenthesis to prevent
surprises.
2002-11-23 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread.h (pthread_self): __THROW must come before
attribute definitions. Patch by Luca Barbieri <ldb@ldb.ods.org>.
2002-11-22 Ulrich Drepper <drepper@redhat.com>
* pthread_getspecific.c: Optimize access to first 2nd-level array.
* pthread_setspecific.c: Likewise.
2002-11-21 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/createthread.c: Remove CLONE_ flags
definitions. Get them from the official place.
* sysdeps/unix/sysv/linux/i386/fork.c: Likewise.
* sysdeps/unix/sysv/linux/i386/createthread.c: Update CLONE_* flags.
Use new CLONE_ flags in clone() calls.
* sysdeps/unix/sysv/linux/fork.c: Use ARCH_FORK to actually fork.
* sysdeps/unix/sysv/linux/i386/fork.c: New file.
* Versions: Add pthread_* functions for libc.
* forward.c: New file.
* sysdeps/pthread/Makefile (libpthread-sysdeps_routines): Add
errno-loc.
* herrno.c: New file.
* res.c: New file.
* Makefile (libpthread-routines): Remove sem_post, sem_wait,
sem_trywait, and sem_timedwait. Add herrno and res.
* sem_init.c: Don't initialize lock and waiters members.
* sem_open.c: Likewise.
* sem_post.c: Removed.
* sem_wait.c: Removed.
* sem_trywait.c: Removed.
* sem_timedwait.c: Removed.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Complete rewrite.
Includes full implementations of sem_post, sem_wait, sem_trywait,
and sem_timedwait.
* sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Adjust
for new implementation.
* sysdeps/unix/sysv/linux/internaltypes.h (struct sem): Remove lock
and waiters fields.
* tst-sem3.c: Improve error message.
* tst-signal3.c: Likewise.
* init.c (__pthread_initialize_minimal): Use set_tid_address syscall
to tell the kernel about the termination futex and to initialize tid
member. Don't initialize main_thread.
* descr.h (struct pthread): Remove main_thread member.
* cancelllation.c (__do_cancel): Remove code handling main thread.
The main thread is not special anymore.
* allocatestack.c (__reclaim_stacks): Mark stacks as unused. Add
size of the stacks to stack_cache_actsize.
* pt-readv.c: Add missing "defined".
* pt-sigwait.c: Likewise.
* pt-writev.c: Likewise.
2002-11-09 Ulrich Drepper <drepper@redhat.com>
* Versions: Export __connect from libpthread.
Patch by Luca Barbieri <ldb@ldb.ods.org>.
* Makefile (libpthread-routines): Add pt-raise.
* sysdeps/unix/sysv/linux/raise.c: New file.
* sysdeps/unix/sysv/linux/pt-raise.c: New file.
* sysdeps/generic/pt-raise.c: New file.
* pthread_cond_init.c: Initialize all data elements of the condvar
structure. Patch by Luca Barbieri <ldb@ldb.ods.org>.
* pthread_attr_init.c: Actually implement 2.0 compatibility version.
* pthread_create.c: Likewise.
* Makefile (tests): Add tst-key1, tst-key2, tst-key3.
* tst-key1.c: New file.
* tst-key2.c: New file.
* tst-key3.c: New file.
* Versions: Export pthread_detach for version GLIBC_2.0.
Reported by Saurabh Desai <sdesai@austin.ibm.com>.
2002-11-08 Ulrich Drepper <drepper@redhat.com>
* pthread_key_create.c: Terminate search after an unused key was found.
Patch by Luca Barbieri <ldb@ldb.ods.org>.
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Return zero.
Patch by Luca Barbieri <ldb@ldb.ods.org>.
2002-10-10 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/lowlevelsem.S: Use slow generic
dynamic lookup for errno in PIC.
* allocatestack.c (get_cached_stack): Rearrange code slightly to
release the stack lock as soon as possible.
Call _dl_allocate_tls_init for TCB from the cache to re-initialize
the static TLS block.
(allocate_stack): Call _dl_allocate_tls_init for user-provided stack.
* cancellation.c: Renamed from cancelation.c.
* Makefile: Adjust accordingly.
* pthreadP.h (CANCELLATION_P): Renamed from CANCELATION_P.
* cleanup_defer.c: Use CANCELLATION_P.
* pthread_testcancel.c: Likewise.
* descr.h: Fix spelling in comments.
* init.c: Likewise.
* pthread_getattr_np.c: Likewise.
* pthread_getschedparam.c: Likewise.
* pthread_setschedparam.c: Likewise.
* Versions: Likewise.
* pt-pselect.c: New file.
* Makefile (libpthread-routines): Add pt-pselect.
* Versions: Add pselect.
* tst-cancel4.c: New file.
* Makefile (tests): Add tst-cancel4.
2002-10-09 Ulrich Drepper <drepper@redhat.com>
* pthread_mutex_lock.c: Always record lock ownership.
* pthread_mutex_timedlock.c: Likewise.
* pthread_mutex_trylock.c: Likewise.
* pt-readv.c: New file.
* pt-writev.c: New file.
* pt-creat.c: New file.
* pt-msgrcv.c: New file.
* pt-msgsnd.c: New file.
* pt-poll.c: New file.
* pt-select.c: New file.
* pt-sigpause.c: New file.
* pt-sigsuspend.c: New file.
* pt-sigwait.c: New file.
* pt-sigwaitinfo.c: New file.
* pt-waitid.c: New file.
* Makefile (libpthread-routines): Add pt-readv, pt-writev, pt-creat,
pt-msgrcv, pt-msgsnd, pt-poll, pt-select, pt-sigpause, pt-sigsuspend,
pt-sigwait, pt-sigwaitinfo, and pt-waitid.
* Versions: Add all the new functions.
* tst-exit1.c: New file.
* Makefile (tests): Add tst-exit1.
* sem_timedwait.c: Minor optimization for more optimal fastpath.
2002-10-08 Ulrich Drepper <drepper@redhat.com>
* pt-fcntl.c: Only enable asynchronous cancellation for F_SETLKW.
* pthread_join.c: Enable asynchronous cancellation around lll_wait_tid
call. pthread_join is an official cancellation point.
* pthread_timedjoin.c: Likewise.
* pthread_cond_wait.c: Revert order in which internal lock are dropped
and the condvar's mutex are retrieved.
* pthread_cond_timedwait.c: Likewise.
Reported by dice@saros.East.Sun.COM.
2002-10-07 Ulrich Drepper <drepper@redhat.com>
* pthreadP.h: Cut out all type definitions and move them...
* sysdeps/unix/sysv/linux/internaltypes.h: ...here. New file.
* pthreadP.h: Include <internaltypes.h>.
* sysdeps/unix/sysv/linux/i386/lowlevelsem.h (lll_sem_post): Little
performance tweaks.
* sem_trywait.c: Shuffle #includes around to get right order.
* sem_timedwait.c: Likewise.
* sem_post.c: Likewise.
* sem_wait.c: Likewise.
* nptl 0.3 released.
* Makefile (tests): Add tst-signal3.
* tst-signal3.c: New file.
2002-10-05 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/lowlevelsem.h: Tell the compiler that
the asms modify the sem object.
(__lll_sem_timedwait): Now takes struct sem* as first parameter.
* sysdeps/unix/sysv/linux/i386/bits/semaphore.h (sem_t): Don't expose
the actual members.
* pthreadP.h (struct sem): New type. Actual semaphore type.
* semaphoreP.h: Include pthreadP.h.
* sem_getvalue.c: Adjust to sem_t change.
* sem_init.c: Likewise.
* sem_open.c: Likewise.
* sem_post.c: Likewise.
* sem_timedwait.c: Likewise.
* sem_trywait.c: Likewise.
* sem_wait.c: Likewise.
2002-10-04 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add tst-basic2, tst-exec1, tst-exec3, tst-exec3.
* tst-basic2.c: New file.
* tst-exec1.c: New file.
* tst-exec2.c: New file.
* tst-exec3.c: New file.
* tst-fork1.c: Remove extra */.
* nptl 0.2 released. The API for IA-32 is complete.
|