summaryrefslogtreecommitdiff
path: root/winsup/cygwin/ChangeLog
blob: 54b7cb0efaf5e7221760f3fc83b42ef996375251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
2004-01-26  Christopher Faylor  <cgf@redhat.com>

	* exceptions.cc (sig_handle_tty_stop): Avoid races by waiting for both
	signal_arrived and for sigCONT.
	(sigpacket::process): Enforce sending of both signal_arrived and
	sigCONT, where appropriate.
	* gendef (sigreturn): Save tls pointer in ebx so that it can jump into
	sigdelayed and use the same register.

2004-01-26  Christopher Faylor  <cgf@redhat.com>

	* cygtls.cc (_threadinfo::init_thread): Add more local reent stdio
	initialization.
	* dcrt0.cc (initial_env): Can it really be true that XP doesn't allow
	attaching a debugger during DLL attach?  Add temporary workaround.
	(dll_crt0_0): Ensure that _impure_ptr stdio is initialized before any
	threads.
	(dll_crt0_1): Move _impure_ptr initialization to dll_crt0_0.
	* exceptions.cc (try_to_debug): Reinstate old method for looping while
	debugging.
	* syscalls.cc (_cygwin_istext_for_stdio): Regularize debugging output.
	Remove hopefully extraneous check.
	(setmode_helper): Add debugging output for improbable case.  Use
	"binary" rather "raw" for consistency.

2004-01-25  Christopher Faylor  <cgf@redhat.com>

	* fhandler.cc (fhandler_base::fhaccess): Avoid always setting errno to
	EACCESS when return value is < 0.  Rely on errno being set properly.

2004-01-25  Christopher Faylor  <cgf@redhat.com>

	* sigproc.cc (proc_subproc): Don't protect *child's* handle.

2004-01-24  Christopher Faylor  <cgf@redhat.com>

	* fhandler.h (fhandler_base::fhaccess): Return int for compatibility
	with access.
	* fhandler.cc (fhandler_base::fhaccess): Return int.  Use consistent
	variable name for exit value.  Exit at bottom, printing debugging
	information, like other cygwin functions.

2004-01-23  Christopher Faylor  <cgf@redhat.com>

	* exceptions.cc (sig_handle): Remove extraneous vforkism.

2004-01-23  Christopher Faylor  <cgf@redhat.com>

	* cygheap.cc (init_cygheap::close_ctty): Protect YA vforkism.
	* fhandler.h (fhandler_base::has_acls): Make pass through for path_conv
	method.
	(fhandler_base::isremote): Ditto.
	(fhandler_base::is_fs_special): Ditto.
	(fhandler_base::has_attribute): Ditto.  Define new function.
	(fhandler_base::fhaccess): Declare new function based on access_worker.
	(fhandler_base::set_has_acls): Eliminate obsolete function.
	(fhandler_base::set_isremote): Ditto.
	* fhandler.cc (fhandler_base::fhaccess): Move from syscalls.cc and into
	fhandler_base class.  Use fhandler methods to access data rather than
	path_conv stuff.
	(fhandler_base::device_access_denied): Use fhaccess method.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto.
	(fhandler_base::open_fs): Remove calls to obsolete functions.
	* fhandler_virtual.cc (fhandler_virtual::open): Ditto.
	* winsup.h (access_worker): Remove obsolete access_worker declaration.
	*syscalls.cc (access_worker): Move function to fhandler.cc.
	(access): Use fhaccess method.

	* pinfo.cc (_pinfo::set_ctty): Clarify debugging output.
	* sigproc.cc (sig_dispatch_pending): Ditto.
	* syscalls.cc (setsid): Perform minor rearrangement.

2004-01-23  Pierre Humblet <pierre.humblet@ieee.org>

        * fhandler_socket.cc (fhandler_socket::create_secret_event): Avoid
        creating multiple handles. Always allow event inheritance but set the
        handle inheritance appropriately. Improve error handling.
        (fhandler_socket::check_peer_secret_event): Improve error handling.
        (fhandler_socket::close_secret_event): Simply call CloseHandle.
        (fhandler_socket::set_close_on_exec): Set secret event inheritance.

2004-01-23  Christopher Faylor  <cgf@redhat.com>

	* configure.in: Remove NEWVFORK default.
	* configure: Regenerate.
	* dcrt0.cc: Conditionalize vfork stuff throughout.
	* dtable.cc: Ditto.
	* perthread.h: Ditto.
	* pipe.cc (fhandler_pipe::close): Ditto.
	* spawn.cc (spawnve): Ditto.
	* syscalls.cc (setsid): Ditto.
	* exceptions.cc (sigpacket::process): Use macro to refer to vfork pid.

	* debug.cc (verify_handle): Define new function.
	* debug.h (VerifyHandle): Define new macro.
	(verify_handle): Declare new function
	* fhandler.cc (fhandler_base::dup): Verify that dup'ed handle is not
	supposed to be in use.
	(fhandler_base::set_inheritance): Ditto.
	(fhandler_base::fork_fixup): Ditto.
	* fhandler_socket.cc (fhandler_socket::dup): Ditto.
	* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
	* net.cc (set_socket_inheritance): Ditto.
	* pinfo.cc (pinfo_fixup_after_exec): Ditto.
	* sigproc.cc (proc_subproc): Ditto.
	(sig_send): Ditto.
	* spawn.cc (spawn_guts): Ditto.
	* thread.cc (pthread::init_mainthread): Ditto.
	* pipe.cc (fhandler_pipe::close): Close read_state with
	ForceCloseHandle since it was protected.
	(fhandler_pipe::fixup_after_exec): Protect read_state handle.
	(fhandler_pipe::dup): Correctly close open handles on error condition.
	Verify that dup'ed handle is not supposed to be in use.
	(fhandler_pipe::create): Protect read_state.

2004-01-23  Christopher Faylor  <cgf@redhat.com>

	* exceptions.cc (sig_handle_tty_stop): Fix boneheaded mistake by using
	correct check for parent state rather than inverted check mistakenly
	introduced on 2003-09-15.

2004-01-22  Brian Ford  <ford@vss.fsi.com>

	* fhandler_serial.cc (fhandler_serial::raw_write): Prevent a deadlock
	when the input buffer overflows.
	(fhandler_serial::raw_read): Correct to print the actual error and only
	call PurgeComm when necessary.

2004-01-22  Christopher Faylor  <cgf@redhat.com>

	* dcrt0.cc (reent_data): Make global.
	* cygwin.din: Reexport reent_data.

2004-01-22  Christopher Faylor  <cgf@redhat.com>

	* cygtls.cc (_threadinfo::remove): Don't assume that we are removing
	_my_tls.
	* exceptions.cc (setup_handler): Improve debugging output.
	(call_signal_handler_now): Remove ill-advised debugger call.
	* sigproc.cc (sigcomplete_main): Delete.
	(sig_send): Honor FIXME and avoid using main thread's completion event
	for everything or suffer races.
	(pending_signals::add): Default stored mask to current process mask
	rather than mask at time of signal send.
	(wait_sig): Add debugging output.
	* sigproc.h (sigpacket::mask_storage): Delete.

2004-01-22  Christopher Faylor  <cgf@redhat.com>

	* fhandler.cc (fhandler_base::open): Revert isfs change.

2004-01-21  Christopher Faylor  <cgf@redhat.com>

	* devices.in: Change raw com device to more correct form.

2004-01-21  Christopher Faylor  <cgf@redhat.com>

	* fhandler.cc (fhandler_base::open): Use major numbers rather than
	device numbers to control special behavior for devices which take
	units.
	* fhandler_raw.cc (fhandler_dev_raw::writebuf): Ditto.
	(fhandler_dev_raw::fstat): Ditto.
	(fhandler_dev_raw::open): Ditto.
	(fhandler_dev_raw::ioctl): Ditto.

2004-01-21  Nicholas Wourms  <nwourms@netscape.net>

	* signal.cc (sigaction): Fix if-statement typo.

2004-01-21  Christopher Faylor  <cgf@redhat.com>

	* cygtls.cc (handle_threadlist_exception): Change logic, improve
	debugging output.

2004-01-21  Christopher Faylor  <cgf@redhat.com>

	* fhandler_tty.cc (fhandler_tty::ioctl): Semi-revert 2003-09-26 change
	for TIOCSWINSZ.  It is not an error for ioctl_request_event to be
	missing.

2004-01-20  Christopher Faylor  <cgf@redhat.com>

	* sigproc.cc (pending_signals::save): New function.
	(pending_signals::restore): Ditto.
	(sig_clear): Save/restore current queue pointer.
	(wait_sig): Delete signals marked as such.
	* sigproc.h (__SIGDELETE): New enum.

2004-01-16  Christopher Faylor  <cgf@redhat.com>

	* fhandler_console.cc (fhandler_console::close): Remove obsolete test
	for vfork_cleanup.
	* pipe.cc (fhandler_pipe::close): Add comment.

2004-01-16  Christopher Faylor  <cgf@redhat.com>

	* cygheap.cc (init_cygheap::close_ctty): Don't NULL ctty if it is still
	active.

2004-01-16  Christopher Faylor  <cgf@redhat.com>

	* dtable.cc (dtable::vfork_parent_restore): Store ctty_on_hold prior to
	calling close_all_files since it will be zeroed.

2004-01-15  Christopher Faylor  <cgf@redhat.com>

	* gentls_offsets: Reinstate unlink of temp files.

2004-01-14  Christopher Faylor  <cgf@redhat.com>

	* fhandler_console.cc (fhandler_console::close): Fix debugging output.
	(fhandler_console::fixup_after_fork): Decrement open_fhs prior to call
	to fhandler_console::open since this would cause incrementing too much
	incrementing in child processes.  (Probably needs to be handled more
	elegantly someday)
	(fhandler_console::fixup_after_exec): Ditto.

2004-01-14  Christopher Faylor  <cgf@redhat.com>

	* cygtls.h (_threadinfo::call): Remove regparm declaration to work
	around compiler bug.

2004-01-13  Christopher Faylor  <cgf@redhat.com>

	* autoload.cc (TryEnterCriticalSection): Remove.
	* dcrt0.cc (dll_crt0_0): Delete inappropriate setting of
	_my_tls.stackptr to NULL since it has really bad consequences.  Make
	'si' an automatic variable.

2004-01-13  Christopher Faylor  <cgf@redhat.com>

	* cygtls.cc (_threadinfo::init_thread): Correct thinko which caused
	thread list to be allocated every time.
	* cygtls.h (CYGTLS_PADSIZE): Define as const int.
	* sync.h: Make multiple inclusion safe.
	(muto::next): Eliminate.
	(muto::exiting_thread): New variable.
	(muto::set_exiting_thread): New function.
	(new_muto): Change to use different section for mutos since c++ give
	inexplicable warning in some cases otherwise.
	(new_muto1): Ditto.
	* dcrt0.cc (do_exit): Call muto::set_exiting_thread here.
	* sync.cc (muto_start): Eliminate.
	(muto::acquire): Always give exiting thread a lock.  Never give thread
	a lock if exiting.
	(muto::release): Ditto for releasing.
	* dtable.cc (dtable::init_lock): Unline function and define here.
	* dtable.h (lock_cs): Define as a muto since critical sections seem to
	work oddly on Windows Me.
	(lock): Accommodate switch to muto.
	(unlock): Ditto.
	* exceptions.cc (setup_handler): Don't worry about acquiring mutos
	since that hasn't mattered for a long time.
	(signal_exit): Ditto: muto stuff will be handled automatically on exit
	now.

2004-01-12  Christopher Faylor  <cgf@redhat.com>

	* Makefile.in (DLL_IMPORTS): Link advapi32 to ensure proper DLL
	initialization.
	* autoload.cc (RegCloseKey): Arbitrarily choose this function as a
	"seed" to pull the advapi32 link library in.  So, comment out the
	autoloading.
	* cygtls.cc (_threadinfo::init_thread): Just clear CYGTLS_PADSIZE.
	(_threadinfo::remove): Add debugging.
	(_threadinfo::find_tls): Ditto.
	* cygtls.h (_threadinfo::padding): Make zero length (for now?).
	* dcrt0.cc (dll_crt0_0): Move more initialization here from dll_crt0_1.
	(dll_crt0_1): See above.
	* dtable.h (dtable::lock): Remove commented out critical section
	locking.
	* dtable.h (dtable::init_lock): Remove commented out critical section
	locking.
	* dtable.h (dtable::unlock): Remove commented out critical section
	locking.
	* exceptions.cc (interruptible): bool'ize.
	* init.cc (threadfunc_fe): Revert to storing threadfunc at stack
	bottom.
	(munge_threadfunc): Ditto.  Avoid adding overhead to
	calibration_thread.
	(prime_threads): Don't initialize tls stuff.
	(dll_entry): Make minor change to initialization order.
	* tlsoffsets.h: Regenerate.

	* sigproc.cc (wait_sig): Add sanity check for end of process thread
	exit.

	* select.h: Make minor formatting change.

2004-01-10  Christopher Faylor  <cgf@redhat.com>

	* Makefile.in: Add still more -fomit-frame-pointer functions.
	* dtable.h (dtable::lock): New function.
	(dtable::unlock): New function.
	(dtable::init_lock): New function.
	* cygheap.h (HEAP_TLS): Declare new enum value.
	(init_cygheap::threadlist): Declare new array.
	(init_cygheap::sthreads): Declare new variable.
	(cygheap_fdmanip::~cygheap_fdmanip): Use new dtable lock/unlock
	functions.
	(cygheap_fdnew::cygheap_fdnew): Ditto.
	(cygheap_fdget::cygheap_fdget): Ditto.
	* dtable.cc (dtable_init): Initialize fdtab critical section.
	(dtable::fixup_after_fork): Ditto.
	(dtable::fixup_after_exec): Ditto.
	(dtable::dup2): Use lock/unlock calls to protect access to fdtab.
	(dtable::find_fifo): Ditto.
	(dtable::fixup_before_fork): Ditto.
	(dtable::fixup_before_exec): Ditto.
	(dtable::set_file_pointers_for_exec): Ditto.
	(dtable::vfork_child_dup): Ditto.
	(dtable::vfork_parent_restore): Ditto.
	* syscalls.cc (close_all_files): Ditto.
	* sync.h (muto::acquired): Declare new function.
	(new_muto1): Declare new macro used to specify name of muto storage.
	* sync.cc (muto::acquired): Define new function.

	* cygthread.cc (cygthread::stub): Remove signal chain removal call
	since it is handled during initialization now.
	* cygthread.cc (cygthread::simplestub): Remove signal chain removal
	call since it is handled during initialization now.
	* cygtls.cc (sentry): New class used for locking.  Use throughout.
	(_threadinfo::reset_exception): Don't pop stack.
	(_threadinfo::find_tls): Move from exceptions.cc.
	(_threadinfo::init_thread): Initialize array of threads rather than
	linked list.  Take second argument indicating thread function for this
	thread.
	(_threadinfo::remove): Search thread array rather than linked list.
	Use sentry to lock.  Only unlock if we got the lock.
	(_threadinfo::find_tls): Ditto for first two.
	(handle_threadlist_exception): Handle exceptions when manipulating the
	thread list in case of premature thread termination.
	(_threadinfo::init_threadlist_exceptions): Ditto.
	* cygtls.h (TLS_STACK_SIZE): Decrease size.
	(_threadinfo::padding): Add element to avoid overwriting lower part of
	stack.
	(_threadinfo::remove): Add a "wait" argument to control how long we
	wait for a lock before removing.
	* exceptions.cc (init_exception_handler): Make global.  Take argument
	to control exception handler being set.
	(ctrl_c_handler): Wait forever when removing self from signal chain.
	(_threadinfo::find_tls): Move to cygtls.cc.
	(sig_handle): Reorganize detection for thread-specific signals.
	* heap.cc (heap_init): Rework slightly.  Make fatal error more verbose.
	Remove malloc initialization since it can't happen during dll attach.
	* init.cc (search_for): Move address to search for on stack here.
	(threadfunc_ix): Ditto for stack offset.  Make shared so that stack
	walk potentially only has to be done once when cygwin processes are
	running.
	(threadfunc_fe): Use standard tls to store thread function (may change
	back later).
	(calibration_thread): New function.  Potentially called to find
	threadfunc_ix.
	(munge_threadfunc): Search for "search_for" value on stack.  Output
	warning when thread func not found on stack.  Use standard tls to store
	thread function.
	(prime_threads): New function.  Called to prime thread front end.
	(dll_entry): Call dll_crt0_0 here when DLL_PROCESS_ATTACH.  Call
	prime_threads here.  Try to remove thread from signal list here.
	* sigproc.cc (wait_sig): Initialize threadlist exception stuff here.
	* thread.cc (pthread::exit): Pass argument to signal list remove
	function.
	* thread.h: Remove obsolete *ResourceLock defines.

	* tlsoffsets.h: Regenerate.

	* winsup.h (spf): Define temporary debug macro to be deleted later.

	* dcrt0.cc (dll_crt0_0): New function, called during DLL
	initialization.  Mainly consists of code pulled from dll_crt0_1.
	(dll_crt0_1): See above.
	(_dll_crt0): Wait for initial calibration thread to complete, if
	appropriate.  Move some stuff to dll_crt0_0.
	(initialize_main_tls): Accommodate argument change to
	_thread_info::init_thread.
	* fork.cc (fork_child): Ditto.
	(sync_with_child): Fix debug message.
	* external.cc (cygwin_internal): Remove special considerations for
	uninitialized dll since initialization happens during dll attach now.

	* dlfcn.cc (dlopen): Remove obsolete *ResourceLock calls.
	(dlclose): Ditto.

2004-01-05  Christopher Faylor  <cgf@redhat.com>

	* cygheap.h (init_cygheap::close_ctty): Declare new function.
	* cygheap.cc (init_cygheap::close_ctty): Define new function.
	* syscalls.cc (close_all_files): Use close_ctty.
	(setsid): Ditto.

	* cygthread.cc (cygthread::stub): Remove exception initialization.
	* cygthread.cc (cygthread::stub): Remove exception initialization.
	(cygthread::simplestub): Ditto.
	* thread.cc (pthread::thread_init_wrapper): Ditto.
	* cygtls.cc (_last_thread): Make static.
	(_threadinfo::call2): Initialize exception handler here.
	(_threadinfo::find_tls): Move here.
	* exceptions.cc (_threadinfo::find_tls): Move.

	* dcrt0.cc (__api_fatal): Add prefix info to message here rather than
	including it in every call to function.
	* winsup.h (api_fatal): Accommodate above change.
	* debug.cc (add_handle): Don't do anything if cygheap not around.
	(mark_closed): Ditto.

	* dll_init.cc (dll_list::detach): Fix debug output.
	* fork.cc (sync_with_child): Ditto.
	(vfork): Improve debug output.
	* heap.cc (heap_init): Ditto.

	* exceptions.cc (try_to_debug): Clarify message when debugger attaches.

2004-01-03  Christopher Faylor  <cgf@redhat.com>

	* exceptions.cc (_threadinfo::interrupt_now): Avoid double call to
	sigdelayed.
	* pinfo.cc (_pinfo::commune_send): Avoid inexplicable test which caused
	most pids to be shown as "<defunct>" on Win9x.

2004-01-02  Christopher Faylor  <cgf@redhat.com>

	* cygheap.h (init_cygheap): Play more vfork shell games and move
	ctty_on_hold and open_fhs_on_hold (back) here.
	* dcrt0.cc (_dll_crt0): Just set impure_ptr_ptr here and let later
	initialization deal with tls.
	* dtable.cc (dtable::vfork_child_fixup): Move ctty considerations here.
	(dtable:vfork_parent_restore): And here.
	* fork.cc (vfork): Reflect change to ctty handling.
	* perthread.h (vfork_save::fhctty): Eliminate.

	* cygwin.din: Make more exports NOSIGFE that will never be interrupted
	by a signal.

	* init.cc (dll_entry): Set stackptr to NULL to catch problems earlier.