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
|
2012-04-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* devices.in (exists_console): Allow /dev/con{sole,in,out} to be
referenced if a console exists.
* devices.cc: Regenerate.
* fhandler_console.cc (fhandler_console::set_unit): Ditto.
2012-04-11 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (fhandler_base::stat_fixup): Fix inode numbers of
non-device files in virtual fileysystems.
2012-04-07 Christopher Faylor <me.cygwin2012@cgf.cx>
* dtable.cc (cygwin_attach_handle_to_fd): Defend against NULL return
from build_fh_*.
(dtable::init_std_file_from_handle): Ditto.
* mmap.cc (mmap_record::alloc_fh): Ditto.
* path.cc (path_conv::check): Ditto.
2012-04-06 Christopher Faylor <me.cygwin2012@cgf.cx>
* fhandler.h (fhandler_base::nohandle): Implement "by hand" rather than
through macro. Set io_handle to INVALID_HANDLE_VALUE when setting flag
to true.
2012-04-06 Christopher Faylor <me.cygwin2012@cgf.cx>
* path.c (path_conv::check): Avoid directly referencing fields of the
dev structure when it can be easily avoided.
2012-04-05 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 14.
2012-04-05 Corinna Vinschen <corinna@vinschen.de>
* passwd.cc (pwdgrp::read_passwd): Fix pretty_ls entry typo contain
the required number of colons.
2012-04-04 Christopher Faylor <me.cygwin2012@cgf.cx>
* fhandler.h (fhandler_pty_common::bytes_available): Declare new
function.
(fhandler_pty_master::flush_to_slave): Ditto.
* fhandler_tty.cc (bytes_available): Define new function.
(fhandler_pty_common::bytes_available): Ditto.
(handler_pty_master::flush_to_slave): Ditto.
(fhandler_pty_master::process_slave_output): Call flush_to_slave ()
here. Use bytes_available () rather than PeekNamedPipe. Clean up
sloppy logic.
(fhandler_pty_slave::read): Use bytes_available () rather than
PeekNamedPipe.
(fhandler_pty_slave::ioctl): Ditto.
(fhandler_pty_master::ioctl): Ditto.
(fhandler_pty_master::cleanup): Remove ancient #if 0.
* select.cc (peek_pipe): Call flush_to_slave whenever we're checking
for a pty master.
2012-04-04 Corinna Vinschen <corinna@vinschen.de>
* fhandler_nodevice.cc (fhandler_nodevice::open): Convert EROFS to
ENOENT if non-existent file got opened for reading only. Explain why.
* path.cc (path_conv::check): Stick to ENOENT if file has been opened
for informational purposes only. Add to comment.
2012-04-04 Corinna Vinschen <corinna@vinschen.de>
* path.cc (path_conv::check): Convert device type to FH_FS for
non-existent files on /dev, unless /dev itself doesn't exist on disk.
Add comment to explain why.
2012-04-04 Corinna Vinschen <corinna@vinschen.de>
* hookapi.cc (rvadelta): Compute max_size using SizeOfRawData rather
than VirtualSize.
2012-04-04 Corinna Vinschen <corinna@vinschen.de>
* passwd.cc (_getpass_close_fd): New static pthread cleanup handler.
(getpass): Rework to use /dev/tty in the first place. Install
_getpass_close_fd as pthread cleanup handler. Flush prompt explicitely.
Lock input and switch off signal input handling when reading password.
2012-04-03 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 13.
2012-04-03 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (fhandler_base::stat_fixup): Replace string comparison
with new device::is_dev_resident() call.
2012-04-02 Christopher Faylor <me.cygwin2012@cgf.cx>
* devices.h (lives_in_dev): New field.
(dev_on_fs): Set bit size.
(is_dev_resident): Define new method.
* devices.in: Use different method for labelling requested name for dev
storage: prefix it with a ='. Use an actual ':' to denote an internal
device.
(exists_console): Avoid repeated test.
(exists_ntdev_silent): Rename from the less-descriptive exists_ntdevs.
(dev_dev_storage): Delete unneeded define.
* gendevices: Add a flag to each line denoting whether the device lives
in /dev space.
(generate): Handle special ":" case here for internal devices. Parse
=something_dev as requiring a storage location. Tack the rest of the
line back onto the reformulated "$rest".
* devices.cc: Regenerate.
2012-04-02 Corinna Vinschen <corinna@vinschen.de>
* devices.h (device::get_device): New method.
* fhandler_dev.cc (fhandler_dev::readdir): Set st_ino to device number.
* syscalls.cc (fhandler_base::stat_fixup): Ditto. Fix link count for
CD-ROM devices. Fix typo in comment.
2012-04-02 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_base::stat_fixup): Rename from
fhandler_base::set_ino_and_dev.
* syscalls.cc (fhandler_base::stat_fixup): Ditto. Accommodate name
change throughout. Fixup link count of console devices.
2012-04-02 Corinna Vinschen <corinna@vinschen.de>
* devices.h (FH_CYGDRIVE): Define as DEV_VIRTFS_MAJOR class device.
(DEV_CYGDRIVE_MAJOR): Remove.
(iscygdrive_dev): Define.
* dtable.cc (fh_alloc): Accommodate above change.
* path.cc (path_conv::check): Use iscygdrive_dev to check for cygdrive.
* syscalls.cc (fhandler_base::set_ino_and_dev): Drop check for
DEV_CYGDRIVE_MAJOR from conditional.
2012-04-02 Corinna Vinschen <corinna@vinschen.de>
* devices.h (FH_DEV): Define as DEV_VIRTFS_MAJOR class device.
(DEV_DEV_MAJOR): Remove.
* dtable.cc (fh_alloc): Accommodate above change.
* syscalls.cc (set_ino_and_dev): Drop check for DEV_DEV_MAJOR from
conditional.
2012-04-02 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_base::set_ino_and_dev): Declare.
* syscalls.cc (fhandler_base::set_ino_and_dev): New method to set
st_ino, st_dev, and st_rdev for devices in a single spot.
(fstat64): Call fhandler_base::set_ino_and_dev instead of setting
st_ino, st_dev, and st_rdev here.
(stat_worker): Ditto.
2012-04-02 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_dev::open): Declare.
(fhandler_dev::close): Declare.
(fhandler_dev::fstat): Declare.
(fhandler_dev::fstatvfs): Declare.
(fhandler_cygdrive::fstatvfs): Declare.
* fhandler_dev.cc (fhandler_dev::open): New method.
(fhandler_dev::close): Ditto.
(fhandler_dev::fstat): Ditto.
(fhandler_dev::fstatvfs): Ditto.
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't fill
st_rdev.
(fhandler_cygdrive::fstatvfs): New method.
* path.h (path_conv::fs_got_fs): New method.
* mount.h (fs_info::got_fs): Change type to bool, make public.
2012-04-02 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (fillout_mntent): Use "none" rather than 0 when checking
FS type.
2012-04-01 Christopher Faylor <me.cygwin2012@cgf.cx>
* dtable.cc (dtable::fixup_close): Define new function.
(dtable::fixup_after_exec): Use fixup_close() and detect when it was
not possible to open an inherited file handle.
(dtable::fixup_after_fork): Defensively close any file handles which
were not, for some reason, inheritable.
* dtable.h: Make #pragma once.
(dtable::fixup_close): Declare new function.
* fhandler_console.cc (fhandler_console::set_unit): Set I/O handles to
NULL when this function fails.
2012-04-01 Corinna Vinschen <corinna@vinschen.de>
* fhandler_dev.cc (fhandler_dev::readdir): Fix formatting. Simplify
code. Use device::type() to fetch dirent compatible device type.
Add comment.
2012-03-31 Christopher Faylor <me.cygwin2012@cgf.cx>
* devices.h (device::exists_func): Redefine field.
(device::dev_on_fs): Remove unneeded bit field. Just make a normal
boolean.
(device::exists): Redefine function.
* devices.in: Move previous functions earlier since they are now only
defined static. Rename some functions due to an as-yet unresolved bug
in gendevices. Rename posix part of internal-only devices with a
double-slash. gendevices will eventuall translate that to a ":".
(device::parse): Rework to use dev pointer and dev_storage_end.
* devices.cc: Regenerate.
* gendevices: Translate "// to ": after shilka processing.
2012-03-31 Corinna Vinschen <corinna@vinschen.de>
* devices.cc: Regenerate.
* devices.h (device::exists_func): New member function pointer,
replacing noexpose.
(device::expose): Remove.
(device::exists_never): Declare.
(device::exists_ptys): Declare.
(device::exists_cons): Declare.
(device::exists_console): Declare.
(device::exists_nt_dev): Declare.
(device::exists): Declare.
* devices.in (dev_storage): Replace former noexpose values with
pointers to matching exists_XXX method.
(device::exists_never): New method.
(device::exists_ptys): New method.
(device::exists_cons): New method.
(device::exists_console): New method.
(device::exists_nt_dev): New method.
(device::exists): New method.
* fhandler_dev.cc (fhandler_dev::readdir): Replace call to
device::expose with call to device::exists and drop all further
existence filtering since it's done in device::exists now.
* path.cc (path_conv::check): Replace call to device::expose with call
to device::exists.
2012-03-30 Christopher Faylor <me.cygwin2012@cgf.cx>
* devices.cc: Regenerate.
* devices.h (device::noexpose): New field.
(device::dev_on_fs): Make a bit field.
(get_major): Use proper type for declaration.
(expose): New field.
(ext_dev_storage): Delete declaration.
(dev_storage_size): Ditto.
(dev_storage): New declaration.
(dev_storage_end): Ditto.
* devices.in: Mark /dev/ptym*, /dev/com*, /dev/pipe, /dev/fifo, and
"/dev" as "no expose".
* fhandler.h (fhandler_dev::lastrealpos): Delete declaration.
(fhandler_dev::devidx): Declare new field.
* fhandler_disk_file.cc: Move fhandler_dev functions into
fhandler_dev.cc.
* fhandler_dev.cc: Add includes needed for functions moved from
fhandler_disk_file.cc.
(dev_storage_scan_start): Define place to start listing devices.
(dev_storage_size): Define size of array to scan.
(fhandler_dev::fhandler_dev): Move here from fhandler_disk_file.cc.
(fhandler_dev::opendir): Ditto.
(fhandler_dev::readdir): Just check devidx for non-NULL to determine
when to go to disk for /dev content. Use dev_storage rather than
ext_dev_storage. Iterate over dev_storage using devidx pointer. Use
accessor functions rather than raw references to the device struct.
Only increment dir->__d_position when we are actually going to be
returning something. Add debug_printf for exit.
(fhandler_dev::rewinddir): Set devidx as appropriate depending on
whether there's a /dev on disk or not.
* gendevices: Don't mark dev_storage static but do put it in the _RDATA
section.
* path.cc (path_conv::check): Use new "device::expose()" function to
decide to forbid programs from referencing internal device types.
2012-03-30 Corinna Vinschen <corinna@vinschen.de>
* posix.sgml (std-notes): Change description of flock restrictions.
2012-03-30 Corinna Vinschen <corinna@vinschen.de>
* devices.h (DEV_TTY_MAJOR): Define, use throughout where appropriate.
(DEV_VIRTFS_MAJOR): Ditto.
* fhandler_dev.cc (fhandler_dev::readdir): Add comments. Tweak tests
for invisible devices. Don't print comX devices, only ttySX. Drop
requirement to call stat64.
2012-03-29 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Add fhandler_dev.o.
* devices.h (DEV_DEV_MAJOR): Define.
(FH_DEV): Redefine in terms of DEV_DEV_MAJOR.
(ext_dev_storage): Declare.
(dev_storage_size): Declare.
(dev_dev_storage): Declare.
(dev_dev): Define.
(isdev_dev): Define.
* devices.in (dev_dev_storage): Activate.
(ext_dev_storage): Define as externally available pointer to
dev_storage.
(dev_storage_size): Define to contain number of dev_storage elements.
* dir.cc (rmdir): Handle /dev as always not empty.
* dtable.cc (fh_alloc): Handle DEV_DEV_MAJOR.
* fhandler.h (fhandler_dev): New class, derived from fhandler_disk_file.
(fhandler_union): Add fhandler_dev member.
* fhandler_disk_file.cc (class __DIR_mounts): Handle /dev directory
to make sure it always exists.
* fhandler_dev.cc: New file implementing /dev.
* globals.cc (ro_u_dev): New R/O unicode string.
* path.cc (path_conv::check): Handle FH_DEV device.
2012-03-29 Christopher Faylor <me.cygwin2012@cgf.cx>
* fhandler_console.cc (fhandler_console::set_unit): Don't succeed
unless we are opening a console actually associated with this process.
2012-03-29 Corinna Vinschen <corinna@vinschen.de>
* sec_acl.cc (acl32): Fix potential crash if build_fh_name returns NULL.
2012-03-29 Christopher Faylor <me.cygwin2012@cgf.cx>
* exceptions.cc (ctrl_c_handler): Don't generate a SIGINT if we've
execed a non-cygwin process. Let the Windows process deal with it
itself.
2012-03-28 Christopher Faylor <me.cygwin2012@cgf.cx>
* sigproc.cc (proc_terminate): Avoid releasing myself.
2012-03-28 Corinna Vinschen <corinna@vinschen.de>
* times.cc (clock_setres): Set minperiod to period.
2012-03-27 Corinna Vinschen <corinna@vinschen.de>
* fhandler_process.cc (process_tab): Add entry for mountinfo.
(format_process_mountstuff): New function, derived from
format_process_mounts. Only open another user's user_info shared
memory area if the process is owned by another user. Actually
access the opened shared user_info to get the right mount table.
For other users, don't print remote cygdrive mount points. Print
mountinfo or mounts output depending on the bool mountinfo argument.
(format_process_mounts): Just call format_process_mountstuff with
mountinfo set to false.
(format_process_mountinfo): Ditto with mountinfo set to true.
2012-03-27 Corinna Vinschen <corinna@vinschen.de>
* times.cc (clock_setres): Revert previous change.
2012-03-26 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (class fhandler_dev_clipboard): Add fstat method.
* fhandler_clipboard.cc (cygcb_t): New type for Cygwin-specific
clipboard format.
(set_clipboard): Use new clipboard format to allow setting a timestamp.
(fhandler_dev_clipboard::fstat): New method. Read modification and
access timestamp as well as length from clipboard data.
(fhandler_dev_clipboard::read): Use new clipboard format.
2012-03-26 Corinna Vinschen <corinna@vinschen.de>
* hires.h (hires_ms::dmsecs): Drop unused method.
* times.cc (JITTER): Remove.
(gtod): Revert to process-local variable.
(hires_ms::nsecs): Just return system time to disallow discrepancy with
the OS.
(hires_ms::resolution): Return coarsest timer value from OS. Add
comment to explain why.
(clock_setres): Ditto.
2012-03-21 Christopher Faylor <me.cygwin2012@cgf.cx>
* child_info.h: Reset magic number.
2012-03-21 Christopher Faylor <me.cygwin2012@cgf.cx>
* child_info.h (child_info::postfork): Define new function.
* fork.cc (frok::parent): Call postfork to do all of the manipulation
required prior to calling pinfo::remember.
* pinfo.h (pinfo::set_rd_proc_pipe): Just set pinfo's rd_proc_pipe.
Don't bother setting it to NULL.
* sigproc.cc (child_info_spawn::wait_for_myself): Call postfork to set
up myself for waiting.
* spawn.cc (child_info_spawn::worker): Avoid now-unnecessary global
lock. Consistently test mode rather than chtype when making
wr_proc_pipe decisions. Call postfork() to set up stuff prior to
pinfo::remember.
2012-03-21 Corinna Vinschen <corinna@vinschen.de>
* cygtls.cc (well_known_dlls): Add advapi32.dll.
2012-03-21 Christopher Faylor <me.cygwin2012@cgf.cx>
* child_info.h: Reset magic number.
(child_info_spawn::wait_for_myself): Move function to sigproc.cc.
* pinfo.cc (is_toplevel_proc): Delete unneeded variable.
* sigproc.cc (child_info_spawn::wait_for_myself): Move function from
header to here. Do all setup required to properly wait for top-level
execed process to exit.
* spawn.cc (child_info_spawn::worker): Attempt to properly handle
_P_DETACH. Set wr_proc_pipe if top-level process even when execing.
Just call wait_for_myself() to... wait for myself. Don't call cleanup
twice.
2012-03-21 Christopher Faylor <me.cygwin2012@cgf.cx>
* pinfo.cc (proc_waiter): Remove debugging.
2012-03-20 Christopher Faylor <me.cygwin2012@cgf.cx>
* dtable.cc (set_std_handle): Call SetStdHandle with NULL if fd is
closed.
(dtable::release): "Close" standard handle if appropriate.
* dcrt0.cc (dll_crt0_0): Fix minor switch formatting problem.
* fork.cc (frok::parent): Make minor comment indentation change.
2012-03-20 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (lseek): Fix debug output.
2012-03-20 Christian Franke <franke@computer.org>
* ntdll.h (SharedUserData): Add volatile qualifier. This fixes a
possible infinite loop in hires_ms::timeGetTime_ns.
2012-03-20 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/socket.h: Fix definitions of MCAST_INCLUDE and
MCAST_EXCLUDE.
2012-03-20 Christopher Faylor <me.cygwin2012@cgf.cx>
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
(child_info::rd_proc_pipe): Declare new field.
(child_info::wr_proc_pipe): Ditto.
(child_info::prefork): Declare new function, derived from previous
pinfo version.
* dcrt0.cc (child_info_fork::handle_fork): Close previous wr_proc_pipe
when appropriate and assign new one from passed-in child_info block.
(child_info_spawn::handle_spawn): Assign our wr_proc_pipe handle from
passed-in child_info block.
* fork.cc (child_info::prefork): Define new function.
(frok::child): Clear rd_proc_pipe and wr_proc_pipe so they will not be
closed by the child_info destructor.
(frok::parent): Use child_info prefork handling, outside of retry loop.
Set rd_proc_pipe in child's pinfo after successful CreateProcess.
Eliminate postfork call.
* globals.cc (my_wr_proc_pipe): Define/declare new variable.
* pinfo.cc (pinfo::pending_rd_proc_pipe): Delete.
(pinfo::pending_wr_proc_pipe): Ditto.
(pinfo::prefork): Ditto.
(pinfo::postfork): Ditto.
(pinfo::postexec): Ditto.
(pinfo::wait): Assume that rd_proc_pipe is set up correctly prior to
call.
(_pinfo::alert_parent): Replace "wr_proc_pipe" with "my_wr_proc_pipe".
* pinfo.h (_pinfo::_wr_proc_pipe): Delete declaration.
(_pinfo::set_rd_proc_pipe): Define new function.
(pinfo::pending_rd_proc_pipe): Delete declaration.
(pinfo::pending_wr_proc_pipe): Ditto.
(pinfo::prefork): Ditto.
(pinfo::postfork): Ditto.
(pinfo::postexec): Ditto.
(pinfo::wr_proc_pipe): Ditto.
* sigproc.cc (child_info::child_info): Clear rd_proc_pipe and
wr_proc_pipe.
(child_info::cleanup): Close rd_proc_pipe and
wr_proc_pipe if necessary.
(child_info_fork::child_info_fork): Set forker_finished to NULL by
default.
(child_info_spawn::child_info_spawn): Use my_wr_proc_pipe rather than
myself->wr_proc_pipe.
(child_info::sync): Ditto.
(child_info_spawn::cleanup): Call child_info::cleanup.
* spawn.cc (child_info_spawn::worker): Remove call to myself.prefork().
Set wr_proc_pipe when execing or set up new rd_proc_pipe/wr_proc_pipe
via child_info::prefork when spawning. Remove call to pinfo::postexec.
Set rd_proc_pipe in child pinfo when spawning. Use my_wr_proc_pipe
rather than myself->wr_proc_pipe. Remove call to postfork.
2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx>
* pinfo.cc (pinfo_init): Cosmetic change: unset "destroy" for myself.
(pinfo::wait): Change some comments.
(pinfo::prefork): Move a comment.
(pinfo::postfork): Set pending_*_pipe variables to NULL if closed.
(pinfo::postexec): Use right name when closing handle.
(_pinfo::alert_parent): Ditto.
* sigproc.h (hold_everything): Remove debugging label.
2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx>
* cygserver_ipc.h: Include sigproc.h for signal_arrived declaration.
2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx>
* cygprops.h: Use #pragma once.
* mkglobals_h: Ditto for generated globals.h file.
* globals.cc: Use specific NO_GLOBALS_H flag to control inclusion of
globals.h.
* winsup.h: Honor NO_GLOBALS_H to control inclusion of globals.h. Make
clear_procimptoken extern inline so that it is only defined when
needed.
2012-03-19 Corinna Vinschen <corinna@vinschen.de>
* thread.cc (cancelable_wait): Don't malloc tbi, just make it a struct
on the stack to avoid memory leak.
2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx>
* pinfo.cc (pinfo::wait): Handle case where prefork was not called
prior to calling wait(). This is the case when we are reabsorbing
processes after being execed.
2012-03-16 Christopher Faylor <me.cygwin2012@cgf.cx>
* fork.cc (lock_signals): Move to sigproc.h.
(lock_pthread): Ditto.
(hold_everything): Ditto.
(frok::parent): Call myself.prefork() just before calling
CreateProcess. Call myself.postfork () on function exit.
* pinfo.cc (pinfo::pending_rd_proc_pipe): Define.
(pinfo::pending_wr_proc_pipe): Ditto.
(_pinfo::dup_proc_pipe): Delete.
(pinfo::wait): Move pipe creation into pinfo::prefork. Set pipe
variables from pending_*.
(_pinfo::sync_proc_pipe): Delete.
(_pinfo::proc_pipe_owner): Ditto.
(pinfo::prefork): Define new function.
(pinfo::postfork): Ditto.
(pinfo::postexec): Ditto.
(_pinfo::alert_parent): Remove obsolete call to sync_proc_pipe.
(_pinfo::dup_proc_pipe): Delete declaration.
(_pinfo::sync_proc_pipe): Ditto.
(pinfo::pending_rd_proc_pipe): Declare.
(pinfo::pending_wr_proc_pipe): Ditto.
(pinfo::prefork): Declare new function.
(pinfo::postfork): Ditto.
(pinfo::postexec): Ditto.
(pinfo::wr_proc_pipe): Define new wrapper function.
* sigproc.h: Include "sync.h". Move locking functions from fork to
here.
* spawn.cc (child_info_spawn::worker): Delete now-unneeded requirement
to record orig_wr_proc_pipe. Call hold_everything prior to doing
anything. Call myself.prefork() if spawning. Replace wr_proc_pipe
synchronization with call to myself.postexec(). Call myself.postfork()
if not execing.
* sync.h: Replace #ifdef wrapper with "#pragma once".
2012-03-13 Corinna Vinschen <corinna@vinschen.de>
* hookapi.cc (hook_or_detect_cygwin): Change condition when to use
importRVAMaxSize or importRVASize for the mapping size. Make sure
to map never more than the section size. Change comments accordingly.
2012-03-13 Corinna Vinschen <corinna@vinschen.de>
* include/netdb.h (h_errno): Add self-referencing macro and comment.
2012-03-12 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <me.cygwin2012@cgf.cx>
* fhandler.h (wait_return): Add overlapped_nullread.
* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Detect
zero-byte read as a special case.
(fhandler_base_overlapped::raw_read): Keep looping when zero-byte read
detected without EOF.
(fhandler_base_overlapped::raw_write): Quiet gcc warning by adding
overlapped_nullread to switch statement even though it will never
actually be hit.
2012-03-10 Christopher Faylor <me.cygwin2012@cgf.cx>
* dtable.cc (fh_alloc): Treat pc.dev as unsigned.
* fhandler_console.cc (fhandler_console::set_unit): Use lock always to
avoid races between competing cygwin processes running on the console.
2012-03-09 Corinna Vinschen <corinna@vinschen.de>
* hookapi.cc (find_first_notloaded_dll): Fix a compiler warning.
2012-03-09 Corinna Vinschen <corinna@vinschen.de>
* hookapi.cc (rvadelta): Add parameter to return maximum available
size from start of import RVA table to end of section.
(find_first_notloaded_dll): Take big executables into account. Use
offset and size computation as in hook_or_detect_cygwin, just simpler.
(hook_or_detect_cygwin): Return NULL rather than false througout.
Change computation of required mapping size to take non-gcc compilers
into account. Explain the differences and what we do against them.
Don't alloca buf if fn is NULL. Never use buf if fn is NULL.
2012-03-08 Corinna Vinschen <corinna@vinschen.de>
* net.cc (call_gaa): New thread function to call GetAdaptersAddresses.
(get_adapters_addresses): Call call_gaa. If necessary, call it as
child thread. Explain why that's necessary.
2012-03-08 Václav Zeman <vhaisman@gmail.com>
* path.cc (readlink): Avoid calling strlen() twice.
2012-03-07 Corinna Vinschen <corinna@vinschen.de>
* Throughout, replace usage of w32api's min with MIN from sys/param.h.
2012-03-07 Christopher Faylor <me.cygwin2012@cgf.cx>
* pinfo.cc (_pinfo::dup_proc_pipe): Reorganize to provide more
information for failing condition.
(pinfo::wait): Pass name of function to dup_proc_pipe. Eliminate error
check for dup_proc_pipe since it never actually returned an error.
* pinfo.h (_pinfo::dup_proc_pipe): Add an argument.
* spawn.cc (child_info_spawn::worker): Pass name of function to
dup_proc_pipe.
2012-03-07 Corinna Vinschen <corinna@vinschen.de>
* glob.cc (MAXPATHLEN): Reinstantiate with a value of 8192.
2012-03-05 Denis Excoffier <cygwin@Denis-Excoffier.org>
* pinfo.cc (_pinfo::dup_proc_pipe): Fix order of arguments in debug
output.
2012-03-05 Corinna Vinschen <corinna@vinschen.de>
* init.cc (dll_entry): Move wincap.init call back from here...
* dcrt0.cc (dll_crt0_0): ...to here.
2012-03-05 Corinna Vinschen <corinna@vinschen.de>
* cygheap.h (enum fcwd_version_t): Move here from path.cc.
(class fcwd_access_t): Ditto. Only declare methods.
(class cwdstuff): Move fast_cwd_ptr and fast_cwd_version from shared
DLL section here.
* path.cc: Keep fcwd_access_t method definitions.
(fcwd_access_t::fast_cwd_version): New method.
(find_fast_cwd_pointer): Change comment. Mention test on W8CP.
(cwdstuff::init): Initialize fast_cwd_ptr and fast_cwd_version.
2012-03-05 Corinna Vinschen <corinna@vinschen.de>
* dll_init.cc (dll_list::operator[]): Extend comment a bit more to
explain previous patch.
2012-03-04 Corinna Vinschen <corinna@vinschen.de>
* dll_init.cc (dll_list::alloc): Compare linked DLLs by basename only.
Explain why. Add code to check if a DLL with the same basename but
different path is the same DLL. Bail out if not.
(in_load_after_fork): New static NO_COPY bool to allow to differ
between linked and loaded DLL at fork.
(dll_list::load_after_fork): Set in_load_after_fork accordingly.
(dll_dllcrt0_1): Don't treat DLL as linked if in_load_after_fork is set.
Drop test for in_forkee.
2012-03-04 Corinna Vinschen <corinna@vinschen.de>
* dll_init.cc: Revert pathname changes from 2012-02-08.
(dll_list::operator[]): Add long comment to explain the misery.
(dll_list::alloc): Skip long pathname prefix potentially returned by
GetModuleFileNameW.
* dll_init.h (dll_list::find_by_modname): Add back declaration.
2012-03-04 Corinna Vinschen <corinna@vinschen.de>
* winver.rc: Bump copyright date.
2012-03-03 Christopher Faylor <me.cygwin2012@cgf.cx>
* fhandler_console.cc (fhandler_console::dup): Only set ctty when we
haven't specifically called setsid.
* fhandler_tty.cc (fhandler_pty_slave::dup): Ditto. Also add comment
documenting research into rxvt problem.
* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Don't check
specifically for myself->ctty == -1. Test for > 0 as that is the
correct test.
(fhandler_termios::sigflush): Ditto.
2012-03-02 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (allow_others_to_sync): Reorder conditional expression to
check for DACL presence first, since otherwise dacl pointer value is
undefined. Add comment.
2012-03-02 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (allow_others_to_sync): Use RtlGetDaclSecurityDescriptor
rather than accessing the SECURITY_DESCRIPTOR structure directly.
Take no DACL and NULL DACL into account.
2012-03-02 Corinna Vinschen <corinna@vinschen.de>
* fhandler_console.cc (fhandler_console::input_tcsetattr): Revert
previous patch.
(fhandler_console::open_setup): Install Ctrl-C handler here, if this
console is the controlling tty and the process hasn't been started by
a Cygwin process.
2012-03-02 Corinna Vinschen <corinna@vinschen.de>
* fhandler_console.cc (fhandler_console::input_tcsetattr): Set the
state of the Ctrl-C handler depending on the setting of
ENABLE_PROCESSED_INPUT.
2012-02-28 Eric Blake <eblake@redhat.com>
* include/sys/termios.h (tcgetsid): Fix return type.
* termios.cc (tcgetsid): Likewise.
* fhandler_termios.cc (fhandler_termios::tcgetsid): Likewise.
* fhandler.h (fhandler_base): Likewise.
* fhandler.cc (fhandler_base::tcgetsid): Likewise.
2012-02-28 Corinna Vinschen <corinna@vinschen.de>
* cygtls.cc (well_known_dlls): Add shlwapi.dll.
2012-02-27 Corinna Vinschen <corinna@vinschen.de>
* cygtls.cc (dll_cmp): New comparison function for bsearch.
(well_known_dlls): New array containing well-known DLLs.
(_cygtls::call2): Add code for BLODA detection.
* net.cc (fdsock): Ditto.
2012-02-26 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (enum settings): Add setbool. Rename justset to setdword
to avoid future problems.
(struct parse_thing): Change all justset to setbool for bool variables.
(parse_options): Add a case for setbool setting for bool variables
since justset (now setdword) always writes a DWORD value, thus
overwriting adjacent memory locations.
* external.cc (cygwin_internal): Drop extern declaration.
2012-02-26 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (dos_file_warning): Drop declaration.
(ignore_case_with_glob): Ditto.
(allow_winsymlinks): Ditto.
(reset_com): Move definition to globals.cc.
(struct parse_thing): Add "detect_bloda" option.
* fhandler_serial.cc (fhandler_serial::open): Drop (incorrect)
declaration of reset_com.
* globals.cc (ignore_case_with_glob): Move definition into C++-only
block.
(dos_file_warning): Define.
(allow_winsymlinks): Define.
(reset_com): Define.
(detect_bloda): Define.
* path.cc (dos_file_warning): Drop definition here.
(allow_winsymlinks): Drop definition here.
2012-02-26 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (LOCK_DIR_NAME_FMT): Define.
(LOCK_DIR_NAME_LEN): Define.
(LOCK_DIR_NAME_DEV_OFF): Define.
(LOCK_DIR_NAME_INO_OFF): Define.
(LOCK_OBJ_NAME_FMT): Define. Add comment.
(class lockf_t): Use bitsize-explicit types. Declare from_obj_name,
(class inode_t): Make use, unuse and inuse methods public. Add a
lock argument to get method declaration.
(inode_t::get): Add lock argument. Only lock node if lock arg is true.
(inode_t::inode_t): Use LOCK_DIR_NAME_FMT as format string.
(lockf_t::from_obj_name): New method to generate lockf_t content from
lock event object basename.
(inode_t::get_all_locks_list): Just call from_obj_name here and copy
result into final lockf_t.
(create_lock_obj_attr): Use LOCK_OBJ_NAME_FMT as format string.
(create_lock_in_parent): New thread function to create lockf_t
structure in parent process.
(delete_lock_in_parent): New thread function to reap stale BSD locks in
parent process.
(lockf_t::create_lock_obj): Try to duplicate lock object handle into
parent process and call create_lock_in_parent as parent remote thread.
(lockf_t::del_lock_obj): Call delete_lock_in_parent as parent remote
thread.
(fhandler_disk_file::lock): Add lock arg to inode_t::get call.
2012-02-25 Christopher Faylor <me.cygwin2012@cgf.cx>
* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 12.
2012-02-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* cygwin.din (scandirat): Export.
* posix.sgml (std-gnu): Add scandirat.
* syscalls.cc (scandirat): New function.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* include/sys/dirent.h (scandirat): Declare.
2012-02-21 Corinna Vinschen <corinna@vinschen.de>
Based on an idea from Nick Lowe <nick.lowe@gmail.com>:
* shared.cc (shared_info::init_obcaseinsensitive): Check actual state
of case sensitivity on post-Windows 2000 systems.
* wincap.h (wincaps::kernel_is_always_casesensitive): New element.
* wincap.cc: Implement above element throughout.
2012-02-20 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (inode_t::del_my_locks): Drop useless counter lc. Close
lock object handle explicitely in case of called during fork. Add
comment to explain why.
* fork.cc (frok::child): Drop declaration of fixup_lockf_after_fork.
2012-02-17 Corinna Vinschen <corinna@vinschen.de>
* timer.cc (getitimer): Don't create another local ret variable in
timer_gettime calling branch. Simplify conditional since timer_gettime
always returns 0 or -1 anyway.
2012-02-17 Corinna Vinschen <corinna@vinschen.de>
* ntdll.h (struct _PEB): Add EnvironmentUpdateCount member.
* spawn.cc (child_info_spawn::worker): Speed up job recognition. Expand
comment to explain every little detail and so we never forget.
* wincap.h (wincaps::has_program_compatibility_assitant): New element.
* wincap.cc: Implement above element throughout.
2012-02-17 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (get_disk_type): Drop unneeded toupper call. Convert case
constants to wide chars.
2012-02-16 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (NetUseGetInfo): Define.
* fhandler_disk_file.cc (fhandler_cygdrive::opendir): Rename flptst
to drive. Call new get_disk_type function rather than is_floppy and
check SMB drives with the NetUseGetInfo function. Explain why.
* mount.cc (get_disk_type): New function to evaluate disk type from
native NT device name.
(is_floppy): Remove.
* mount.h (enum disk_type): Define.
(get_disk_type): Declare.
* path.h (is_floppy): Drop declaration.
2012-02-15 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc: Revert change from 2012-02-13 which used the
Windows-provided stack rather than an own stack created in
CygwinCreateThread.
(struct thread_wrapper_arg): Rename commitsize to stacklimit.
(CygwinCreateThread): Rename commitsize to real_stacklimit.
2012-02-15 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::init_std_file_from_handle): Use tmp_pathbuf for
name.
(handle_to_fn): Ditto for device. Fix size in QueryDosDeviceW call.
2012-02-15 Christopher Faylor <me.cygwin2012@cgf.cx>
* smallprint.cc (tmpbuf): Declare new class holding a static buffer,
protected by a lock.
(__small_vsprintf): Use tmpbuf to hold large buffer.
(__small_vswprintf): Ditto.
2012-02-15 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (lf_setlock): Add timeout variable and set before calling
WFMO. Drop debug output if process is not available. Set timeout to
0 instead. Document timeout 0 in WFMO comment.
(lf_getblock): Drop invalid F_POSIX lock type shortcut. Only return
overlap if event is not signalled. Fix comment.
2012-02-14 Christopher Faylor <me.cygwin2012@cgf.cx>
* pinfo.cc (_pinfo::set_ctty): Revert 2012-02-07 change to skip
function if tty in question == our ctty.
* syscalls.cc (setsid): Avoid two function calls.
* dtable.cc (dtable::dup_worker): Remove debugging.
* init.cc (search_for): Calculate for every new process rather than
using shared value.
(threadfunc_ix): Fill in for every new process rather than sing shared
value.
2012-02-14 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_cygdrive::fstat): Don't bother to
set st_nlink correctly, just set it to 1 to avoid potential network
timeouts.
2012-02-14 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (lf_setlock): Don't close waited lock object handle before
we own the node lock. Fix comment.
2012-02-14 Corinna Vinschen <corinna@vinschen.de>
* cygheap.cc (init_cygheap::init_installation_root): Convert function
init_installation_root into a cygheap method.
* cygheap.h (struct init_cygheap): Move installation_root,
installation_key, and installation_key_buf from shared
.cygwin_dll_common DLL section to cygheap. Declare new method
init_installation_root.
* dtable.cc (handle_to_fn): Accommodate the move of installation strings
to the cygheap.
* external.cc (cygwin_internal): Ditto.
* fhandler_console.cc (fhandler_console::open_shared_console): Ditto.
* fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Ditto.
* fhandler_tty.cc: Ditto, throughout.
* mount.cc (mount_info::init): Ditto.
* pipe.cc (fhandler_pipe::create): Ditto.
* shared.cc: Ditto, throughout.
(installation_root): Remove.
(installation_key): Move to cygheap.
(installation_key_buf): Ditto.
(installation_root_inited): Remove.
(SPIN_WAIT): Remove.
(init_installation_root): Move to cygheap.
(memory_init): Call cygheap->init_installation_root right after
cygheap->user.init. Drop call of init_installation_root function.
* shared_info.h (init_installation_root): Drop declaration.
(installation_root): Ditto.
(installation_key): Ditto.
* uinfo.cc (pwdgrp::load): Accommodate the move of installation strings
to the cygheap.
2012-02-14 Corinna Vinschen <corinna@vinschen.de>
* thread.cc: Drop including unused headers.
2012-02-13 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc (struct thread_wrapper_arg): Convert char * to PBYTE.
Change related casts throughout.
(thread_wrapper): Only do the thread change if the application provided
the stack. Otherwise, just use the Windows-provided stack. Set up
POSIX guardpage here, if necessary. Move related comment from
CygwinCreateThread here.
(CygwinCreateThread): Never allocate and set up own stack here. Just
compute stack size to reserve and use value in CreateThread call if
stack hasn't been provided by the application.
2012-02-13 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (clean): Remove non-existent regexp dir.
* collate.h: New header.
(__collate_range_cmp): Declare.
(__collate_load_error): Define.
* glob.cc: Pull in latest version from FreeBSD. Simplify and reduce
Cygwin-specific changes.
* regex/regcomp.c: Include collate.h on Cygwin as well.
(__collate_range_cmp): Move from here...
* nlsfuncs.cc (__collate_range_cmp): ...to here.
* miscfuncs.cc (thread_wrapper): Fix typo in comment.
(CygwinCreateThread): Take dead zone of Windows stack into account.
Change the way how the stack is commited and how to handle guardpages.
Explain how and why.
* thread.h (PTHREAD_DEFAULT_STACKSIZE): Change definition. Explain why.
2012-02-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* include/pthread.h: Include time.h as required by POSIX.
2012-02-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* exception.h (stackdump): Declare.
* exceptions.cc (stackdump): Rework to perform all operations needed
for a stackdump and to avoid recursion.
(exception::handle): Use simplified stackdump interface.
* sigproc.cc (signal::exit): Ditto. Delete now, uneeded declaration.
2012-02-11 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc (DEFAULT_STACKSIZE): Remove.
(CygwinCreateThread): Simplify code by assuming that now stack-related
input values are undefined. Set stack protection to PAGE_READWRITE,
as is default on Windows. Add lengthy comment to explain POSIX
guardpage.
* thread.cc (pthread_attr::pthread_attr): Initialize stacksize as
PTHREAD_DEFAULT_STACKSIZE. Initialize guardsize as
PTHREAD_DEFAULT_GUARDSIZE.
* thread.h (PTHREAD_DEFAULT_STACKSIZE): Define. Add comment to explain.
(PTHREAD_DEFAULT_GUARDSIZE): Define.
2012-02-10 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc (DEFAULT_STACKSIZE): Set to 1 Megs. Drop comment about
RLIMIT_STACK.
* registry.cc (get_registry_hive_path): Expect the user hive path to
be never longer than MAX_PATH. Don't prepend native NT path prefix
here. Add comment.
(load_registry_hive): Prepend native NT path prefix here. Additionally
try to load user's classes hive.
* uinfo.cc (cygheap_user::env_userprofile): Reduce size of
userprofile_env_buf to MAX_PATH. Add comment.
2012-02-10 Christopher Faylor <me.cygwin2012@cgf.cx>
* syscalls.cc (setsid): On second thought, in the spirit of keeping
things kludgy, set ctty to -2 here as a special flag, and...
(open): ...only eschew setting O_NOCTTY when that case is detected.
2012-02-10 Christopher Faylor <me.cygwin2012@cgf.cx>
* syscalls.cc (open): Semi-revert (?) to allowing open of a tty to
become controlling tty if there is no controlling tty.
2012-02-09 Christopher Faylor <me.cygwin2012@cgf.cx>
* exceptions.cc (setup_handler): Reduce system_printf to sigproc_printf
since it is for a transient situation which will undoubtedly be
handled.
2012-02-09 Corinna Vinschen <corinna@vinschen.de>
* fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::write): Set
bytes_to_write to 0 in case it fits into the buffer, otherwise suffer
early EOF in caller.
2012-02-09 Corinna Vinschen <corinna@vinschen.de>
* dll_init.h (struct dll): Re-add modname.
* dll_init.cc: Throughout, use modname where it was used before.
(dll_list::operator[]): Use modname. Move comment from dll_list::alloc
here and remove hint about GetModuleBaseNameW.
(dll_list::alloc): Store full path in name, pointer to basename in
modname. Search dll using modname.
2012-02-08 Christopher Faylor <me.cygwin2012@cgf.cx>
* dtable.cc (dtable::init_std_file_from_handle): Reinstate opening tty
handles with O_RDWR permissions.
2012-02-08 Corinna Vinschen <corinna@vinschen.de>
* thread.cc (__pthread_cond_wait_init): New static function replacing
__pthread_cond_dowait. Only check and potentially initialize cond and
mutex, drop call to (*cond)->wait.
(pthread_cond_timedwait): Replace call to __pthread_cond_dowait with
separate calls to __pthread_cond_wait_init and (*cond)->wait to be
able to initialize cond before accessing its clock_id member.
(pthread_cond_wait): Ditto (more or less).
2012-02-08 Christian Franke <franke@computer.org>
* include/sys/wait.h: Remove C++ inline functions for `union wait'.
For C++ use `void *' as __wait_status_ptr_t instead. This is less type
safe but fixes compile error on `wait(NULL)'. Remove extra `;'.
2012-02-08 Corinna Vinschen <corinna@vinschen.de>
* sigproc.cc (child_info_fork::abort): Call TerminateProcess rather
than ExitProcess.
2012-02-08 Corinna Vinschen <corinna@vinschen.de>
* uinfo.cc (cygheap_user::env_userprofile): Simplify since network
drives are not supported here.
2012-02-08 Corinna Vinschen <corinna@vinschen.de>
* uinfo.cc (cygheap_user::env_userprofile): Convert native
userprofile path returned from get_registry_hive_path to Win32 path.
2012-02-08 Corinna Vinschen <corinna@vinschen.de>
* dll_init.cc: Throughout, drop usage of modname in favor of name.
(dll_list::find_by_modname): Remove.
(dll_list::alloc): Only store module basename in name. Add comment to
explain why. Simplify address check. Fix formatting in comment.
* dll_init.h (struct dll): Drop modname and find_by_modname.
2012-02-08 Corinna Vinschen <corinna@vinschen.de>
* dll_init.cc (dll_list::alloc): Add DLL name to fabort output. Fix
fabort string in case of bss start.
2012-02-08 Corinna Vinschen <corinna@vinschen.de>
* include/sys/sysmacros.h: Include sys/types.h.
2012-02-07 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::create_root_entry): Fix format specifier in
api_fatal message.
2012-02-07 Corinna Vinschen <corinna@vinschen.de>
* include/process.h: Move here from include/cygwin subdir.
* exec.cc: Change include of process.h to reflect the fact that it's
now back in include.
* spawn.cc: Ditto.
* syscalls.cc: Ditto.
2012-02-07 Christopher Faylor <me.cygwin2012@cgf.cx>
* cygheap.cc (init_cygheap::manage_console_count): Delete.
* cygheap.h (init_cygheap::manage_console_count): Ditto.
(init_cygheap::console_count): Ditto.
* fhandler.h (fhandler_console::has_a): Ditto.
(fhandler_console::free_console): Declare new function.
* fhandler_console.cc (fhandler_console::free_console): Define new
function.
(fhandler_console::open_setup): Delete call to manage_console_count.
(fhandler_console::close): Ditto. Replace with call to free_console().
* fhandler_tty.cc (fhandler_pty_slave::open): Delete call to
manage_console_count.
(fhandler_pty_slave::cleanup): Ditto.
(fhandler_pty_slave::close): Call fhandler_console::free_console() if
this is our controlling tty.
* pinfo.cc (_pinfo::set_ctty): Skip function if tty in question == our
ctty. Delete call to manage_console_count.
* syscalls.cc (close_all_files): Avoid locking and avoid setting errno
when iterating over fds.
2012-02-07 Christopher Faylor <me.cygwin2012@cgf.cx>
* include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 11.
2012-02-03 Václav Zeman <vhaisman@gmail.com>
* grp.cc (pwdgrp::parse_group): Convert grp from macro to reference.
* passwd.cc (pwdgrp::parse_passwd): Ditto for res.
2012-02-02 Christopher Faylor <me.cygwin2012@cgf.cx>
* syscalls.cc (close_all_files): Use cygheap_fdget to manipulate
fhandler. Use debug_only_printf.
2012-02-02 Corinna Vinschen <corinna@vinschen.de>
Fix memory and handle leaks due to fdopendir:
* dir.cc (closedir): Call global close instead of just releasing the
fhandler.
* fhandler_disk_file.cc (fhandler_disk_file::closedir): Don't close
fhandler handle here, rely on global closedir doing the right thing.
* fhandler_registry.cc (fhandler_registry::readdir): Also delete
d_hash when closing registry key.
(fhandler_registry::rewinddir): Ditto.
Avoid infinite recursion in VirtualStore under UAC:
* fhandler_registry.cc (VIRT_CLASSES_KEY_PREFIX): Define.
(VIRT_CLASSES_KEY_SUFFIX): Ditto.
(VIRT_CLASSES_KEY): Ditto.
(VIRT_CLASSES_LINKTGT): Ditto.
(fhandler_registry::exists): Return virt_symlink as file type if
this is a Classes key under the VirtualStore.
(fhandler_registry::fstat): Handle virt_symlink.
(fhandler_registry::readdir): Return DT_LNK as d_type if this is a
Classes key under the VirtualStore.
(fhandler_registry::fill_filebuf): Handle Classes symlink.
Handle user impersonation in /proc/registry access:
* autoload.cc (RegOpenUserClassesRoot): Define.
(RegOpenCurrentUser): Define.
* fhandler_registry.cc (RegOpenUserClassesRoot): Declare function
missing in w32api.
(RegOpenCurrentUser): Ditto.
(fetch_hkey): New function.
(fhandler_registry::open): Call fetch_hkey to get root registry key.
(open_key): Ditto.
2012-02-01 Christopher Faylor <me.cygwin2012@cgf.cx>
* fcntl.cc (fcntl64): Add introductory debug statement. Call dup3
directly via dtable method to avoid over-incrementing refcnt.
2012-02-01 Christopher Faylor <me.cygwin2012@cgf.cx>
* dtable.cc (dtable::dup_worker): Add comment explaining why refcnt
isn't incremented here.
(dtable::dup3): Simplify slightly. Add comment.
* syscalls.cc (dup3): Increment refcnt here, similarly to dup2.
2012-02-01 Christopher Faylor <me.cygwin2012@cgf.cx>
* fhandler.cc (fhandler_base_overlapped::has_ongoing_io): Don't block
GetOverlappedResult since previous IsEventSignalled will have reset the
handle.
* select.cc (cygwin_select): Remove space before parentheses in syscall
debugging output.
(pipe_data_available): Streamline if block.
2012-01-31 Christopher Faylor <me.cygwin2012@cgf.cx>
* syscalls.cc (dup3): Fix debug typo.
* fhandler.cc (flush_async_io): Assume only called for writer. Call
GetOverlappedResult directly rather than kludging call to
has_ongoing_io.
(fhandler_base_overlapped::close): Only start flush thread when closing
write handle. Only cancel I/O when reading.
2012-01-28 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din: Fix order (DATA first).
2012-01-27 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (is_dos_path): New macro to recognize drive letter and UNC
DOS paths.
(globify): Call is_dos_path instead of isdrive.
2012-01-26 Christopher Faylor <me.cygwin2012@cgf.cx>
* sigproc.cc (child_info::retry_count): Default to 1.
2012-01-23 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (gethostid): Simplify. Just fetch MachineGuid and
create hash from there.
2012-01-22 Christopher Faylor <me.cygwin2012@cgf.cx>
* fhandler.h (fhandler_fifo::arm): Declare new function.
* fhandler_fifo.cc (fhandler_fifo::arm): Define new function.
(fhandler_fifo::open): Fix handling of RDWR pipes to avoid opening a
second handle. Use arm() function to set events.
(fhandler_fifo::raw_read): Correctly go into "connect again logic" when
we detect another writer is available. Use arm() function to set event.
* pipe.cc (fhandler_pipe::create): Add more detail to debugging output.
2012-01-22 Christopher Faylor <me.cygwin2012@cgf.cx>
* cygheap.h (cygheap_fdmanip::release): Simplify.
* dtable.cc (dtable::release): Make void again. Skip not_open check
since it is guaranteed to be open. Don't bother deleting here since
actual deletion will be handled in cygheap_fdget::~cygheap_fdget.
* dtable.h (dtable::release): Make void again.
* syscalls.cc (dup2): Bump fhandler use count on successful dup.
2012-01-22 Christopher Faylor <me.cygwin2012@cgf.cx>
* cygheap.h (cygheap_fdget::~cygheap_fdget): Simplify now that refcnt
reports reference count changes itself.
* fhandler.cc (fhandler_base::reset): Set _refcnt to 0.
* fhandler.h (fhandler_base::refcnt): Report refcnt when debugging.
* select.cc (cygwin_select): Set return_on_signal to indicate when
select should be interrupted.
(select_stuff::wait): Keep looping unless return_on_signal is set.
* select.h (select_stuff::return_on_signal): New variable.
(select_stuff::select_stuff): Zero return_on_signal.
2012-01-20 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_registry::opendir): Declare.
* fhandler_registry.cc (fhandler_registry::opendir): New function.
2012-01-13 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* include/cygwin/config.h (_GLIBC_EXTENSION): Define.
2012-01-11 Christopher Faylor <me.cygwin2012@cgf.cx>
* spawn.cc (child_info_spawn::worker): Delete debugging.
2012-01-11 Christopher Faylor <me.cygwin2012@cgf.cx>
Update copyright on all files checked in so far this year.
* fhandler.h: Use #pragma once rather than ifdef guards.
(fhandler_console::tc_getpgid): Return our pgid if we have never opened
a console.
* fork.cc: Rearrange includes to accommodate fhandler.h use of pinfo.h.
* sigproc.cc: Ditto.
* spawn.cc: Ditto.
(child_info_spawn::worker): Query myself->pgid rather than calling
expensive function.
* thread.h: Use #pragma once rather than ifdef guards.
* pinfo.h: Use #pragma once rather than ifdef guards.
(pinfo::remember): Don't define if sigproc.h has not been included.
(pinfo::reattach): Ditto.
* sigproc.h: Use #pragma once rather than ifdef guards. Use different
test to see if pinfo.h has been included.
2012-01-09 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/process.h: Move here from newlib.
* exec.cc: Change include of process.h to reflect the fact that it's
now in the include/cygwin subfolder.
* spawn.cc: Ditto.
* syscalls.cc: Ditto.
2012-01-09 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc (thread_wrapper): Make sure stack is 16 byte aligned
to make gcc-3 compiled pthread applications happy.
2012-01-08 Christopher Faylor <me.cygwin2012@cgf.cx>
* dtable.cc (dtable::stdio_init): Always initialize console when we
have one.
* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Use a better
method to print tty name for debugging.
(fhandler_termios::bg_check): Ditto.
* pinfo.cc (_pinfo::set_ctty): Remove leftover debugging stuff.
Simplify behavior when setting tty's sid and pgid to avoid overwriting
previously set values.
* spawn.cc (ch_spawn): Cosmetic change.
2012-01-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* cygwin.din (pthread_sigqueue): Export.
* posix.sgml (std-gnu): Add pthread_sigqueue.
* thread.cc (pthread_sigqueue): New function.
* thread.h (pthread_sigqueue): New function.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2012-01-02 Christopher Faylor <me.cygwin2012@cgf.cx>
* path.cc (get_current_dir_name): Avoid memory leak. Don't return PWD
contents if directory doesn't actually exist.
2012-01-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* cygwin.din (get_current_dir_name): Export.
* path.cc (get_current_dir_name): New function.
* posix.sgml (std-gnu): Add get_current_dir_name.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
|