OSDN Git Service

* heap.cc (heap_init): Only commit if allocsize is not zero.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / cygwin / ChangeLog
1 2006-06-12  Pierre Humblet  Pierre.Humblet@ieee.org
2
3         * heap.cc (heap_init): Only commit if allocsize is not zero.
4
5 2006-06-12  Corinna Vinschen  <corinna@vinschen.de>
6
7         * net.cc (fdsock): Disable raising buffer sizes.  Add comment to
8         explain why.
9
10 2006-06-04  Christopher Faylor  <cgf@timesys.com>
11
12         * ioctl.cc (ioctl): Accommodate change in reported pty master device
13         number.
14         * select.cc (peek_pipe): Ditto.
15
16 2006-06-04  Christopher Faylor  <cgf@timesys.com>
17
18         * cygtls.h (CYGTLS_PADSIZE): Reset to a size that XP SP1 seems to like.
19         * tlsoffsets.h: Regenerate.
20
21 2006-06-03  Christopher Faylor  <cgf@timesys.com>
22
23         * cygthread.cc (cygthread::terminate_thread): In debugging output, use
24         name of thread being terminated rather than thread doing the
25         terminating.
26
27         * fhandler.h (fhandler_pty_master::slave): Delete.
28         (fhandler_pty_master::get_unit): Ditto.
29         (fhandler_pty_master::setup): Change argument declaration to
30         accommodate new usage.
31         * fhandler_tty.cc (fhandler_tty_master::init): Remove obsolete slave
32         assignment.  Pass argument to setup indicating that this is a tty.
33         (fhandler_tty_slave::open): Use dev() method rather than referencing
34         pc.dev directly.
35         (fhandler_pty_master::open): Don't create archetype based on ptym
36         device number.  Set device number to use DEV_TTYM_MAJOR and tty number.
37         Pass argument to setup indicating that this is a pty.
38         (fhandler_pty_master::setup): Change single argument to a flag
39         indicating whether we're creating a pty and use appropriately.
40         Calculate 't' variable here rather than in caller.
41
42         * fhandler_dsp.cc (fhandler_dev_dsp::open): Use dev() method rather
43         than referencing pc.dev directly.
44
45 2006-06-03  Christopher Faylor  <cgf@timesys.com>
46
47         * dcrt0.cc (dll_crt0_0): Call tty_list::init_session here.
48         (dll_crt0_1): Reflect renaming from tty_init to tty::init_session.
49         (do_exit): Reflect moving of tty_terminate into tty_list.
50         * exceptions.cc (events_init): Move tty_mutex stuff elsewhere.
51         * fhandler_console.cc (set_console_title): Use lock_ttys class.
52         * fhandler_termios.cc (fhandler_termios::bg_check): Make debug output
53         more accurate.
54         * fhandler_tty.cc (fhandler_tty_slave::open): Reflect move of
55         attach_tty into tty_list class.  Don't attempt to grab master end of
56         pty if master doesn't exist.
57         (fhandler_pty_master::open): Reflect move of allocate_tty into tty_list
58         class.  Use lock_ttys::release to release mutex.  Improve debugging
59         output.
60         (fhandler_pty_master::setup): Remove if 0'ed block.  Fix argument to
61         SetNamedPipeHandleState.
62         * pinfo.cc (_pinfo::set_ctty): Lock ttys before setting sid/pgid.
63         Improve debugging.  Add temporary debugging.
64         * tty.cc (tty_list::init_session): New function.
65         (tty::init_session): Rename from tty_init.  Reflect move of attach_tty
66         to tty_list class.
67         (tty::create_master): Rename from create_tty_master.
68         (tty_list::attach): Rename from attach_tty.  Reflect renaming of
69         connect_tty to connect.  Ditto for allocate_tty.
70         (tty_terminate): Delete.
71         (tty_list::terminate): Subsume tty_terminate.  Use lock_ttys rather
72         than manipulating mutex directly.
73         (tty_list::allocate): Rename from allocate_tty.  Use lock_ttys rather
74         than manipulating mutex directly.  Don't set sid here since linux
75         apparently doesn't do this.  Reflect move of create_tty_master into
76         tty.
77         (lock_ttys::lock_ttys): Define new constructor.
78         (lock_ttys::release): New function.
79         * tty.h (tty::exists): Return false immediately if !master_pid.
80         (tty::set_master_closed): Define new function.
81         (tty::create_master): Ditto.
82         (tty::init_session): Ditto.
83         (tty_list::mutex): New field.
84         (tty_list::allocate): Define new function.
85         (tty_list::connect): Ditto.
86         (tty_list::attach): Ditto.
87         (tty_list::init_session): Ditto.
88         (lock_ttys): New class.
89         (tty_init): Delete declaration.
90         (tty_terminate): Ditto.
91         (attach_tty): Ditto.
92         (create_tty_master): Ditto.
93
94 2006-06-03  Christopher Faylor  <cgf@timesys.com>
95
96         * Makefile.in (libdl.a): New library.
97
98 2006-06-03  Christopher Faylor  <cgf@timesys.com>
99
100         * fhandler_tty.cc (fhandler_pty_master::close): Don't close handles if
101         we don't own them.
102         (fhandler_pty_master::setup): Make sure that original handle is closed
103         when changing inheritance.
104         (fhandler_pty_master::fixup_after_fork): Set from_master/to_master to
105         arch value always.
106         (fhandler_pty_master::fixup_after_exec): Clear from_master/to_master
107         when close_on_exec.
108
109 2006-06-03  Christopher Faylor  <cgf@timesys.com>
110
111         * cygheap.cc (init_cygheap::close_ctty): Remove obsolete code.
112         * dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've
113         run fixup_after_exec.
114         * dtable.cc (dtable::fixup_after_exec): Add debugging output.
115         * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of
116         to_master.
117         (fhandler_tty_common::close): Remove obsolete code.
118         (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done
119         in dtable's fixup_after_exec.  (revisit later?)
120         (fhandler_pty_master::fixup_after_exec): Ditto.
121
122 2006-06-02  Christopher Faylor  <cgf@timesys.com>
123
124         * cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision
125         with the call chain.
126         * tlsoffsets.h: Regenerate.
127
128         * dcrt0.cc (break_here): Define unconditionally for use elsewhere.
129         Call DebugBreak, if appropriate.
130         (initial_env): Rely on break_here() to call DebugBreak.
131         * exceptions.cc (try_to_debug): Ditto.
132
133 2006-06-02  Christopher Faylor  <cgf@timesys.com>
134
135         * fhandler.cc (fhandler_base::fixup_after_exec): Declare here.
136         * fhandler.h (fhandler_base::fixup_after_exec): Make non-inline.
137         (fhandler_termios::fixup_after_fork): Delete declaration.
138         (fhandler_termios::fixup_after_exec): Ditto.
139         (fhandler_tty_common::inuse): Remove.
140         (fhandler_tty_common::dup): Delete declaration.
141         (fhandler_tty_common::fixup_after_fork): Ditto.
142         (fhandler_tty_slave::fixup_after_exec): Declare new function.
143         (fhandler_pty_master::dwProcessId): New variable.
144         (fhandler_pty_master::from_master): Ditto.
145         (fhandler_pty_master::to_master): Ditto.
146         (fhandler_pty_master::setup): New function.
147         (fhandler_pty_master::fixup_after_fork): Ditto.
148         (fhandler_pty_master::fixup_after_exec): Ditto.
149         * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Delete
150         definition.
151         (fhandler_termios::fixup_after_fork): Ditto.
152         * fhandler_tty.cc (fhandler_tty_master::init): Use fhandler_pty_master
153         setup function rather than obsolete tty::common_init.  Delete obsolete
154         inuse setting.
155         (fhandler_tty_slave::fhandler_tty_slave): Set inuse to NULL here.
156         (fhandler_tty_slave::open): Change debugging output for clarity.  Check
157         for different things when doing a sanity check on the tty.  Reflect the
158         fact that master_pid now is the cygwin pid rather than the windows pid.
159         Use "arch" rather than "archetype" for consistency.
160         (fhandler_tty_slave::close): Close inuse here.
161         (fhandler_tty_slave::dup): Remove old if 0'ed code.
162         (fhandler_pty_master::dup): New function.  Handles pty master
163         archetype.
164         (fhandler_pty_master::fhandler_pty_master): Zero pty_master specific
165         fields.
166         (fhandler_pty_master::open): Implement using archetypes, similar to
167         slave.  Use fhandler_pty_master setup function rather than obsolete
168         tty::common_init.  Don't set inuse.
169         (fhandler_tty_common::close): Don't deal with inuse.  Delete old if
170         0'ed code.
171         (fhandler_pty_master::close): Implement using archetypes.  Close
172         from_master and to_master.
173         (fhandler_tty_common::set_close_on_exec): Just set close_on_exec flag
174         here since everything uses archetypes now.
175         (fhandler_tty_common::fixup_after_fork): Delete definition.
176         (fhandler_tty_slave::fixup_after_exec): Define new function.
177         (fhandler_pty_master::setup): New function, derived from
178         tty::common_init.
179         (fhandler_pty_master::fixup_after_fork): New function.
180         (shared_info.h): Reset SHARED_INFO_CB to reflect new tty size.
181         * tty.cc (tty_list::terminate): Close individual handles from
182         tty_master.
183         (tty::master_alive): Delete.
184         (tty::make_pipes): Ditto.
185         (tty::common_init): Ditto.
186         * tty.h (tty::from_slave): Delete.
187         (tty::to_slave): Ditto.
188         (tty::common_init): Delete declaration.
189         (tty::make_pipes): Ditto.
190         (tty::master_pid): Define as pid_t since it is now a cygwin pid.
191
192 2006-06-01  Christopher Faylor  <cgf@timesys.com>
193
194         * cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here.
195         Let the caller do that.
196         * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here
197         to allow fixup_after_exec functions to use it.
198
199         * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with
200         *crt0_1 functions.
201         * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls
202         before seeing if it is initialized.
203         * gendef (_sigfe_maybe): Ditto.
204         * dcrt0.cc (dll_crt0_1): Remove static, use just one argument.
205         * dll_init.cc (dllcrt0_info): New structure.
206         (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that
207         we'll always be assured of having something like a tls.
208         (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0.
209         Unconditionally call _my_tls.init_exception_handler now that we are
210         assured of having a tls.  Change variable name from "linking" to "linked".
211         * winsup.h (dll_crt0_1): Declare.
212         (dll_dllcrt0_1): Ditto.
213
214 2006-05-30  Christopher Faylor  <cgf@timesys.com>
215
216         * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.
217
218 2006-05-29  Christopher Faylor  <cgf@timesys.com>
219
220         * winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork
221         errors.
222
223 2006-05-28  Christopher Faylor  <cgf@timesys.com>
224
225         * sigproc.cc (child_info::proc_retry): Mask all of the bits we're
226         interested in, which includes bits above and below 0xc0000000.
227
228 2006-05-27  Christopher Faylor  <cgf@timesys.com>
229
230         * dll_init.cc (dll_dllcrt0): Previous change didn't work very well with
231         fork.  Semi-revert it but change name of variable to something that
232         makes better sense.
233
234 2006-05-27  Christopher Faylor  <cgf@timesys.com>
235
236         * thread.cc (verifyable_object_isvalid): Check for NULL specifically.
237
238 2006-05-27  Christopher Faylor  <cgf@timesys.com>
239
240         * dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if
241         we've finished initializing (Thanks to Gary Zablackis for noticing this
242         problem).  Just use cygwin_finished_initializing rather than defining a
243         separate variable.
244
245 2006-05-25  Christopher Faylor  <cgf@timesys.com>
246
247         * debug.h (ModifyHandle): Define new macro.
248         (modify_handle): Declare new function.
249         * debug.cc (modify_handle): Define new function.
250         * fhandler.h (fhandler_base::fork_fixup): Change return value from void
251         to bool.
252         * fhandler.cc (fhandler_base::fork_fixup): Return true if fork fixup has
253         been done.
254         * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance of
255         protected handle via ModifyHandle if DEBUGGING.
256         (fhandler_pipe::fixup_after_fork): Protect guard handle if fork fixup
257         has been done.
258
259 2006-05-24  Christopher Faylor  <cgf@timesys.com>
260
261         * cygtls.cc (_cygtls::call): Call call2 using _my_tls.
262         (_cygtls::init_exception_handler): Always replace existing exception
263         handler with cygwin exception handler.
264         * cygtls.h (_cygtls::call2): Remove static designation.
265         * dcrto.cc (dll_crt0_1): Define in a way that allows calling via
266         _cygtls::call.
267         (_initialize_main_tls): Delete.
268         (_dll_crt0): Call dll_crt0_1 via cygtls::call.  Set _main_tls here.
269         * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE.
270         * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define.
271         * tlsoffsets.h: Regenerate.
272
273 2006-05-24  Christopher Faylor  <cgf@timesys.com>
274
275         * configure.in: Update to newer autoconf.
276         (thanks to Steve Ellcey)
277         * configure: Regenerate.
278         * aclocal.m4: New file.
279
280 2006-05-23  Lev Bishop  <lev.bishop+cygwin@gmail.com>
281
282         * fhandler.cc (readv): Remove nonsensical assert.
283
284 2006-05-23  Christopher Faylor  <cgf@timesys.com>
285
286         * select.cc (start_thread_socket): Delay setting thread local exitsock
287         until we know it's correct.  Return correct value on error.
288
289 2006-05-23  Lev Bishop  <lev.bishop+cygwin@gmail.com>
290             Christopher Faylor  <cgf@timesys.com>
291
292         * select.cc (start_thread_socket): Clean up exitsock in case of
293         error.  Use si->exitcode consistently.
294
295 2006-05-21  Christopher Faylor  <cgf@timesys.com>
296
297         * child_info.h (_CI_SAW_CTRL_C): New enum.
298         (CURR_CHILD_INFO_MAGIC): Reset.
299         (saw_ctrl_c): New function.
300         (set_saw_ctrl_c): Ditto.
301         * sigproc.cc (child_info::proc_retry): Return EXITCODE_OK if we get
302         STATUS_CONTROL_C_EXIT and we actually saw a CTRL-C.
303         * spawn.cc (dwExeced): Delete.
304         (chExeced): New variable.
305         (spawn_guts): Set chExeced;
306         * exceptions.cc (dwExeced): Delete declaration.
307         (chExeced): Declare.
308         (ctrl_c_handler): Detect if we're an exec stub process and set a flag,
309         if so.
310
311         * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Add
312         extra DEBUGGING test.
313
314         * pinfo.cc: Fix comment.
315
316 2006-05-21  Christopher Faylor  <cgf@timesys.com>
317
318         * fhandle.h (fhandler_pipe::create_guard): Revert change which
319         eliminated SECURITY_ATTRIBUTES argument.
320         * pipe.cc (fhandler_pipe::open): Duplicate guard from other process and
321         protect it appropriately.  Eliminate unneeded writepipe_exists
322         temporary variable.  Set inheritance appropriately.
323         (fhandler_pipe::set_close_on_exec): Revert change which eliminated
324         handling guard inheritance.
325         (fhandler_pipe::fixup_after_fork): Ditto.  Use correct name of entity
326         being checked by fork_fixup.
327         (fhandler_pipe::fixup_after_exec): Don't bother with guard here.
328         (fhandler_pipe::dup): Cosmetic changes and revert creation of
329         writepipe_exists as noninheritable.
330         (fhandler_pipe::create): Revert change which eliminated
331         SECURITY_ATTRIBUTES argument.  Revert change which always made
332         writepipe_exists noninheritable.
333
334 2006-05-21  Christopher Faylor  <cgf@timesys.com>
335
336         * debug.cc (add_handle): Print handle value when collision detected.
337         * dtable.cc (dtable::stdio_init): Cosmetic change.
338         * fhandler.h (fhandler_base::create_read_state): Protect handle.
339         (fhandler_pipe::create_guard): Ditto.  Always mark the handle as
340         inheritable.
341         (fhandler_pipe::is_slow): Return boolean value rather than numeric 1.
342         * pipe.cc (fhandler_pipe::fhandler_pipe): Always flag that we need fork
343         fixup.
344         (fhandler_pipe::open): Don't pass security attributes to create_guard.
345         (fhandler_pipe::set_close_on_exec): Don't handle guard here.
346         (fhandler_pipe::close): Accommodate now-protected guard handle.
347         (fhandler_pipe::fixup_in_child): Don't protect read_state here.
348         (fhandler_pipe::fixup_after_exec): Close guard handle if close_on_exec.
349         (fhandler_pipe::fixup_after_fork): Don't bother with guard here.
350         (fhandler_pipe::dup): Don't set res to non-error prematurely.  Use
351         boolean values where appropriate.  Protect guard and read_state.
352         (fhandler_pipe::create): Don't call need_fork_fixup since it is now the
353         default.  Don't protect read_state or guard.
354
355         * pipe.cc (fhandler_base::ready_for_read): Use bool values for "avail".
356
357         * spawn.cc (spawn_guts): Set cygheap->pid_handle as inheritable when
358         protecting.
359
360 2006-05-15  Lev Bishop  <lev.bishop+cygwin@gmail.com>
361             Christopher Faylor  <cgf@timesys.com>
362
363         * select.cc (fhandler_pipe::ready_for_read): Actually get the guard
364         mutex for blocking reads.
365
366 2006-05-20  Christopher Faylor  <cgf@timesys.com>
367
368         * fhandler_tty.cc (fhandler_tty::close): Remove problematic hExeced guard.
369
370 2006-05-20  Christopher Faylor  <cgf@timesys.com>
371
372         * fhandler_tty.cc (fhandler_tty_slave::open): Reinstate call to
373         need_invisible on first pty open.
374
375 2006-05-18  Christopher Faylor  <cgf@timesys.com>
376
377         * fhandler_console.cc (fhandler_console::need_invisible): Allocate an
378         invisible window station when ctty != TTY_CONSOLE.
379
380 2006-05-16  Christopher Faylor  <cgf@timesys.com>
381
382         * cygtls.cc (_cygtls::remove): Don't test for initialization since
383         this function will always be called when _my_tls is initialized.
384         * init.cc (dll_entry): Don't attempt to remove tls info if _my_tls is
385         obviously not even available.
386
387 2006-05-15  Christopher Faylor  <cgf@timesys.com>
388
389         * sigproc.cc (no_signals_available): Detect hwait_sig ==
390         INVALID_HANDLE_VALUE.
391         (wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT.
392
393 2006-05-15  Christopher Faylor  <cgf@timesys.com>
394
395         * cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and
396         no more.
397         * cygtls.h (_my_tls::padding): Delete.
398         (CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the
399         end of the stack.
400         * dcrt0.cc (initialize_main_tls): Change return to void.
401         * gentls_offsets: Treat const specially, too.  Keep going after a '}'
402         is found.  Change negative offset calculation to use CYGTLS_PADSIZE.
403         * init.cc (_my_oldfunc): New variable.
404         (threadfunc_fe): Use stored tls value for oldfunc rather than blindly
405         writing to the stack.
406         (munge_threadfunc): Set oldfunc in tls.
407         (dll_entry): Initialize tls allocation.
408         * tlsoffsets.h: Regenerate.
409
410 2006-05-13  Christopher Faylor  <cgf@timesys.com>
411
412         * ntdll.h (STATUS_INVALID_INFO_CLASS): Conditionalize.
413
414 2006-05-10  Brian Dessent  <brian@dessent.net>
415
416         * Makefile.in (clean): Also delete *.dbg.
417
418 2006-05-08  Christian Franke  <Christian.Franke@t-online.de>
419
420         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix typo which
421         caused test for ".." to be skipped.
422
423 2006-05-02  Christopher Faylor  <cgf@timesys.com>
424
425         * external.cc (cygwin_internal): Set errno on failure.
426
427 2006-04-27  Corinna Vinschen  <corinna@vinschen.de>
428
429         * pipe.cc (DEFAULT_PIPEBUFSIZE): Raise to 64K.
430
431 2006-04-26  Corinna Vinschen  <corinna@vinschen.de>
432
433         * fhandler.h (fhandler_base): Change fstat_helper prototype
434         to take file size and inode number as 64 bit values.
435         * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc
436         (FS_IS_SAMBA_WITH_QUOTA): Ditto.
437         (path_conv::hasgood_inode): Delete.
438         (path_conv::is_samba): Delete.
439         (path_conv::isgood_inode): Centralized function to recognize
440         a good inode number.
441         (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size.
442         Accomodate argument change in fstat_helper.
443         (fhandler_base::fstat_by_name): Ditto.
444         (fhandler_base::fstat_helper): Accomodate argument change.  Call
445         path_conv::isgood_inode to recognize good inodes.
446         (fhandler_disk_file::opendir): Explain Samba weirdness here.
447         Call path_conv::fs_is_samba instead of path_conv::is_samba.
448         (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS
449         as valid return code from NtQueryDirectoryFile to indicate that
450         FileIdBothDirectoryInformation is not supported.
451         Call path_conv::isgood_inode to recognize good inodes.
452         * ntdll.h (STATUS_INVALID_INFO_CLASS): Define.
453         * path.cc (fs_info::update): Rework file system recognition
454         and set appropriate flags.
455         * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags.
456         Constify pure read accessors.
457
458 2006-04-24  Christopher Faylor  <cgf@timesys.com>
459
460         * environ.cc (getearly): Force correct dereference order when
461         inspecting environ table.
462
463 2006-04-24  Corinna Vinschen  <corinna@vinschen.de>
464
465         * select.cc (thread_pipe): Raise sleep time only every 8th iteration.
466         (thread_mailslot): Ditto.
467
468 2006-04-23  Corinna Vinschen  <corinna@vinschen.de>
469             Christopher Faylor  <cgf@timesys.com>
470
471         * select.cc (thread_pipe): Raise sleep time dynamically to speed up
472         select on pipes when copying lots of data.
473         (thread_mailslot): Ditto for mailslots.
474
475 2006-04-22  Christopher Faylor  <cgf@timesys.com>
476
477         * signal.cc (abort): On second thought, just set incyg once.
478
479 2006-04-22  Christopher Faylor  <cgf@timesys.com>
480
481         * signal.cc (abort): Set incyg manually to help get a reliable gdb
482         stack trace.
483         * cygwin.din (abort): Make NOSIGFE.
484
485 2006-04-21  Pierre Humblet Pierre.Humblet@ieee.org
486             Christopher Faylor  <cgf@timesys.com>
487
488         * environ.cc (getearly): Use GetEnvironmentVariable and cmalloc instead
489         of GetEnvironmentStrings.
490         (environ_init): Revert rawenv stuff.
491
492 2006-04-21  Christopher Faylor  <cgf@timesys.com>
493
494         * environ.cc (rawenv): Make this variable a file-scope static.
495         (getearly): Rename 's' variable to 'len' since 's' is used fairly
496         consistently throughout cygwin as a string variable.  Remove rawenv
497         declaration.  Perform other minor cleanups.
498         (environ_init): Remove rawenv declaration.  Only set rawenv to
499         GetEnvironmentStrings() if it has not already been set.  Properly free
500         rawenv in all cases.
501
502 2006-04-21  Christopher Faylor  <cgf@timesys.com>
503
504         * tty.h (tty::hwnd): Move to tty_min.
505         (tty::gethwnd): Ditto.
506         (tty::sethwnd): Ditto.
507         (tty_min::hwnd): Receive variable from tty class.
508         (tty_min::gethwnd): Receive function from tty classs.
509         (tty_min::sethwnd): Ditto.
510         * dtable.cc (dtable::stdio_init): Only call init_console_handler when
511         we actually own the console.
512         * fhandler_console.cc (fhandler_console::get_tty_stuff): Set tty's hwnd
513         to non-zero value.
514         * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Semi-reinstate
515         handling of console when pgrp is set.
516
517 2006-04-21  Pierre Humblet  <Pierre.Humblet@ieee.org>
518             Corinna Vinschen  <corinna@vinschen.de>
519
520         * environ.cc (getearly): New function.
521         (findenv_func): New function pointer, predefined to getearly.
522         (getenv): Call findenv function over the findenv_func pointer.
523         (environ_init): Change findenv_func pointer to my_findenv after Cygwin
524         environment is initialized.
525
526 2006-04-21  Lars Munch  <lars@segv.dk>
527
528         * include/asm/byteorder.h (__ntohl): Fix the missing uint32_t.
529
530 2006-04-21  Corinna Vinschen  <corinna@vinschen.de>
531
532         * fhandler_socket.cc (fhandler_socket::wait): Reorder setting
533         WSAError to avoid spurious errors with WSAError set to 0.
534
535 2006-04-21  Corinna Vinschen  <corinna@vinschen.de>
536
537         * include/asm/byteorder.h: Include stdint.h.  Per standard, change
538         datatypes in ntohX and htonX functions to uintXX_t types.
539
540 2006-04-18  Christopher Faylor  <cgf@timesys.com>
541
542         * exceptions.cc (ctrl_c_handler): Only exit TRUE on CTRL_LOGOFF_EVENT
543         when we have actually handled the event.
544
545 2006-04-17  Eric Blake  <ebb9@byu.net>
546
547         * mktemp.cc (_gettemp): Open temp files in binary mode.
548
549 2006-04-14  Corinna Vinschen  <corinna@vinschen.de>
550
551         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use UINT32_MAX
552         instead of UINT_MAX.
553
554 2006-04-14  Corinna Vinschen  <corinna@vinschen.de>
555
556         * fhandler_disk_file.cc (path_conv::hasgood_inode): Make inline.
557         Drop remote fs handling entirely since unreliable inode numbers
558         are now recognized differently.
559         (path_conv::is_samba): Make inline.
560         (fhandler_disk_file::opendir): Reformat comment.
561         (fhandler_base::fstat_helper): Special case remote file systems
562         returning (unreliable) 32 bit inode numbers.
563         (fhandler_disk_file::readdir): Ditto.
564         * fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto.
565
566 2006-04-13  Christopher Faylor  <cgf@timesys.com>
567
568         * spawn.cc (spawn_guts): Move ch.set() call back to where it was
569         supposed to be.
570
571 2006-04-13  Corinna Vinschen  <corinna@vinschen.de>
572
573         * sysconf.cc (sysconf): Add _SC_THREADS, _SC_THREAD_ATTR_STACKSIZE,
574         _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PROCESS_SHARED,
575         _SC_THREAD_SAFE_FUNCTIONS, _SC_TIMERS handling.
576
577 2006-04-12  Corinna Vinschen  <corinna@vinschen.de>
578             Christopher Faylor  <cgf@timesys.com>
579
580         * spawn.cc (spawn_guts): Revert patch which treated derived cygwin
581         programs differently from those which are mounted with -X.  Pass extra
582         argument to linebuf::fromargv.
583         * winf.h (MAXCYGWINCMDLEN): New define.
584         (linebuf::finish): Add a new argument denoting when command line
585         overflow is ok.
586         (linebuf::fromargv): Ditto.
587         * winf.cc (linebuf::finish): Implement above change.
588         (linebuf::fromargv): Ditto.
589
590 2006-04-11  Christopher Faylor  <cgf@timesys.com>
591
592         * Makefile.in (DLL_OFILES): Add winf.o.
593         * spawn.cc: Move command line handling stuff into winf.cc.
594         * winf.h: New file.
595         * winf.cc: New file.
596
597 2006-04-05  Christopher Faylor  <cgf@timesys.com>
598
599         * fhandler_socket.cc: Move iptypes.h include after winsock2 since it
600         now relies on it.
601         * net.cc: Ditto.
602
603 2006-04-05  Christopher Faylor  <cgf@timesys.com>
604
605         * dcrt0.cc (dll_crt0_0): Move user_data->{resourcelocks,threadinterface}
606         initialization here from dll_crt0_1.
607         (dll_crt0_1): See above.
608
609 2006-04-04  Corinna Vinschen  <corinna@vinschen.de>
610
611         * net.cc (fdsock): Raise default SO_RCVBUF/SO_SNDBUF buffer sizes to
612         the same values as on Linux.
613
614 2006-04-03  Christopher Faylor  <cgf@timesys.com>
615
616         * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
617         (child_info_fork::alloc_stack): Move into this class.
618         (child_info_fork::alloc_stack_hard_way): Ditto.
619         * dcrt0.cc (child_info_fork::alloc_stack): Ditto.
620         (child_info_fork::alloc_stack_hard_way): Ditto.
621         (_dll_crt0): Reference alloc_stack via fork_info.
622
623 2006-04-03  Corinna Vinschen  <corinna@vinschen.de>
624
625         * spawn.cc (linebuf::finish): Drop argument.  Don't check command line
626         length.
627         (spawn_guts): Remove wascygexec.  Check real_path.iscygexec instead.
628         Accommodate change to linebuf::finish.
629
630 2006-04-03  Christopher Faylor  <cgf@timesys.com>
631
632         * dcrt0.cc (sm): Delete.
633         (alloc_stack_hard_way): Figure out where the stack lives here rather
634         than relying on previously filled out information which has been
635         invalid since 1.5.19.
636
637 2006-03-31  Corinna Vinschen  <corinna@vinschen.de>
638
639         * fhandler_disk_file.cc (FS_IS_SAMBA_WITH_QUOTA): New define.
640         (path_conv::hasgood_inode): Recognize Samba with quota support
641         compiled in.
642         (path_conv::is_samba): Ditto.  Fix comment to include Samba version
643         numbers for later reference.
644
645 2006-03-30  Corinna Vinschen  <corinna@vinschen.de>
646
647         * security.h (sec_user_nih): Make sid1 argument mandatory.
648         (sec_user): Ditto.
649
650 2006-03-29  Christopher Faylor  <cgf@timesys.com>
651
652         * sigproc.cc (wait_for_sigthread): Use the current user sid when
653         setting up the signal pipe rather than relying on (eventually) the
654         effective sid.
655
656 2006-03-29  Christopher Faylor  <cgf@timesys.com>
657
658         * dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so
659         that it can be used by subsequent startup functions.
660         (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING.
661         (dll_crt0_1): Move user_data->{resourcelocks,threadinterface}
662         initialization here from dll_crt0_0.
663         * fork.cc (frok::child): Tell wait_for_sigthread that this is fork.
664         (frok::parent): Only initialize start_time once.  Tighten time when
665         we're "deimpersonated".
666         * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff.
667         Add debugging output.
668         (wait_for_sigthread): Accept an argument which illustrates whether we
669         are forked or not.
670         (wait_sig): Avoid using myself pointer.
671         * winsup.h ((wait_for_sigthread): Reflect change to argument.
672
673 2006-03-26  Christopher Faylor  <cgf@timesys.com>
674
675         * spawn.cc (spawn_guts): Close handles if we know that we will not be
676         seeing a sync event from the child.
677
678 2006-03-26  Christopher Faylor  <cgf@timesys.com>
679
680         * sigproc.cc (wait_sig): Move myself manipulation...
681         (wait_for_sigthread): ...to here.
682
683 2006-03-24  Corinna Vinschen  <corinna@vinschen.de>
684
685         * fhandler_floppy.cc: Include ntdef.h and ntdll.h.
686         (fhandler_dev_floppy::get_drive_info): Rearrange so that now
687         NtQueryVolumeInformationFile is called on drives which don't support
688         IOCTL_DISK_GET_DRIVE_GEOMETRY.
689         * ntdll.h (struct _FILE_FS_SIZE_INFORMATION): Add.
690         (enum _FSINFOCLASS): Add missing values.
691
692 2006-03-23  Christopher Faylor  <cgf@timesys.com>
693
694         * fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Make
695         error message more explicit.
696         * pinfo.cc (_pinfo::commune_request): Don't lock process unless we're
697         looking for fifos.
698
699 2006-03-23  Christopher Faylor  <cgf@timesys.com>
700
701         * dcrt0.cc (child_info_spawn::handle_spawn): Don't initialize the
702         console handler here.
703         * dtable.cc (dtable::stdio_init): Initialize console handler here.
704
705 2006-03-23  Christopher Faylor  <cgf@timesys.com>
706
707         * sigproc.cc (sigalloc): Don't set SA_RESTART here.
708         * signal.cc (_SA_NORESTART): New flag.
709         (sigaction_worker): New function, derived from sigaction.  Don't set
710         internal flags unless called internally.
711         (sigaction): Use sigaction_worker.
712         (signal): Honor new _SA_NORESTART flag.
713         (siginterrupt): Set _SA_NORESTART flag appropriately.  Use
714         sigaction_worker to set flags.
715         * include/cygwin/signal.h: Define _SA_INTERNAL_MASK here.
716
717 2006-03-22  Corinna Vinschen  <corinna@vinschen.de>
718
719         * thread.cc (pthread_mutex::is_good_initializer_or_bad_object): Delete.
720         (pthread_cond::is_good_initializer_or_bad_object): Delete.
721         (pthread_rwlock::is_good_initializer_or_bad_object): Delete.
722         (pthread_cond::init): Remove disabled code.  Guard assignment to
723         object to initialize against access violation.
724         (pthread_rwlock::init): Ditto.
725         (pthread_mutex::init): Ditto.
726
727 2006-03-22  Eric Blake  <ebb9@byu.net>
728
729         * fhandler.cc (fcntl): Print flags in hex.
730
731 2006-03-22  Christopher Faylor  <cgf@timesys.com>
732
733         * dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved
734         pinfo_init and uinfo_init here.
735         (dll_crt0_1): Ditto.
736         (__dll_crt0): Ditto. Don't call update_envptrs here.
737         (dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0.
738         * environ.cc (environ_init): Call it here instead.
739         * sigproc.cc (my_readsig): New static variable.
740         (wait_for_sigthread): Set up read pipe here since we are assured that
741         we have the proper privileges when this is called.
742         (talktome): Eliminate second argument since it is available as a global
743         now.
744         (wait_sig): Reflect use of my_readsig.
745
746 2006-03-22  Corinna Vinschen  <corinna@vinschen.de>
747
748         * thread.cc (pthread_cond::init): Disable validity test of object
749         to initialize since test of uninitialized content is unreliable.
750         (pthread_rwlock::init): Ditto.
751         (pthread_mutex::init): Ditto.
752
753 2006-03-21  Christopher Faylor  <cgf@timesys.com>
754
755         * signal.cc (signal): Don't set SA_RESTART here.
756         (siginterrupt): White space.
757         * sigproc.cc (sigalloc): Set SA_RESTART here, on initialization.
758
759 2006-03-21  Christopher Faylor  <cgf@timesys.com>
760
761         * child_info.h (child_status): Fix typo which made it impossible to set
762         iscygwin.
763         (child_info::isstraced): Booleanize.
764         (child_info::iscygwin): Ditto.
765         * sigproc.cc (child_info::child_info): Minor cleanup of flag setting.
766         * spawn.cc (spawn_guts): Only close_all_files when we know the process
767         has started successfully.
768
769         * exceptions.cc (init_console_handler): Fix indentation.
770
771 2006-03-20  Christopher Faylor  <cgf@timesys.com>
772
773         * dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier.
774         * pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure.
775         Return previous pipe handle.
776         * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value.
777         * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if
778         process exits before synchronization.
779
780 2006-03-20  Christopher Faylor  <cgf@timesys.com>
781
782         * child_info.h (child_status): New enum.
783         (child_info::flag): Rename from 'straced'.
784         (child_info::isstraced): New function.
785         (child_info::iscygwin): Ditto.
786         (child_info_fork::handle_fork): Reparmize.
787         (child_info_fork::handle_failure): Ditto.
788         (child_info_spawn::handle_spawn): New function.
789         * dcrt0.cc (get_cygwin_startup_info): Use isstraced method.
790         (child_info_spawn::handle_spawn): Define new function from code
791         previously in dll_crt0_0.
792         (dll_crt0_0): Move spawn stuff into handle_spawn.  Only call
793         init_console_handler for fork case.
794         * sigproc.cc (child_info::child_info): Set flag appropriately.
795         (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin
796         process.
797         * spawn.cc (spawn_guts): Remove commented out flag setting.
798
799 2006-03-19  Christopher Faylor  <cgf@timesys.com>
800
801         * pinfo.cc (commune_process): Fix randomly invalid pointer which caused
802         fifos to work incorrectly.
803
804 2006-03-19  Christopher Faylor  <cgf@timesys.com>
805
806         * dcrt0.cc (dll_crt0_0): Oops.  We need to bother with setting
807         init_console_handler in the fork/exec case.
808
809 2006-03-19  Christopher Faylor  <cgf@timesys.com>
810
811         * dcrt0.cc (dll_crt0_0): Don't bother with setting init_console_handler
812         here since it will be set later when we discover if we have a ctty or
813         not.
814         * exceptions.cc (init_console_handler): Properly remove NULL handler.
815
816 2006-03-18  Christopher Faylor  <cgf@timesys.com>
817
818         * pinfo.h (EXITCODE_OK): Define new constant.
819         * sigproc.cc (child_info::sync): Return EXITCODE_OK if entering with
820         exit_code == 0.
821         (sig_send): Don't complain if sending signals while blocked if the
822         sender isn't in the main thread.
823
824 2006-03-18  Christopher Faylor  <cgf@timesys.com>
825
826         * child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate.
827         (child_info::retry): Move here from fork subclass.
828         (child_info::exit_code): New field.
829         (child_info::retry_count): Max retry count for process start.
830         (child_info::proc_retry): Declare new function.
831         (child_info_fork::retry): Move to parent.
832         (child_info_fork::fork_retry): Ditto.
833         * dcrt0.cc (child_info::fork_retry): Rename and move.
834         (child_info_fork::handle_failure): Move.
835         (dll_crt0_0): Initialize console handler based on whether we have a
836         controlling tty or not.  Avoid nonsensical check for fork where it can
837         never occur.
838         * environ.cc (set_proc_retry): Rename from set_fork_retry.  Set
839         retry_count in child_info.
840         (parse_thing): Reflect above change.
841         * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name.
842         (ctrl_c_handler): Always return TRUE for the annoying
843         CTRL_LOGOFF_EVENT.
844         * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to
845         init_console_handler.
846         * fhandler_tty.cc (fhandler_tty_slave::open): Just call
847         mange_console_count here and let it decide what to do with initializing
848         console control handling.
849         * fork.cc (fork_retry): Remove definition.
850         (frok::parent): Define static errbuf and use in error messages (not
851         thread safe yet).  Close pi.hThread as soon as possible.  Protect
852         pi.hProcess as soon as possible.  Don't set retry_count.  That happens
853         automatically in the constructor now.  Accommodate name change from
854         fork_retry to proc_retry.
855         * init.cc (dll_entry): Turn off ctrl-c handling early until we know how
856         it is supposed to be handled.
857         * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value
858         for failure error message.  Tweak debug message slightly.
859         * sigproc.cc (child_info::retry_count): Define.
860         (child_info::child_info): Initialize retry count.
861         (child_info::sync): Set exit code if process dies before
862         synchronization.
863         (child_info::proc_retry): Rename from child_info_fork::fork_retry.  Use
864         previously derived exit code.  Be more defensive about what is
865         classified as an error exit.
866         (child_info_fork::handle_failure): Move here from dcrt0.cc.
867         * spawn.cc (spawn_guts): Maintain error mode when starting new process
868         to avoid annoying pop ups.  Move deimpersonate call within new loop.
869         Move envblock freeing to end.  Loop if process dies prematurely with
870         bad exit code.
871         * syscalls.cc (setpgid): Remove hopefully unneeded call to
872         init_console_handler.
873
874 2006-03-15  Christopher Faylor  <cgf@timesys.com>
875
876         * cygheap.cc (init_cygheap::manage_console_count): Turn console control
877         handler on/off depending on whether we have allocated a console or not.
878         * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry
879         statuses.
880         (dll_crt0_0): Turn on/off console control depending on whether we have
881         a controlling tty or not.
882         * exceptions.cc (init_console_handler): Change BOOL to bool.
883         * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic
884         change.
885         * winsup.h (init_console_handler): Reflect argument type change.
886
887         * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate
888         capability throughout.
889         * wincap.cc: Ditto.
890
891 2006-03-14  Christopher Faylor  <cgf@timesys.com>
892
893         * child_info.h (child_info_fork::fork_retry): Declare new function.
894         * dcrt0.cc (child_info_fork::fork_retry): Define new function.
895         * fork.cc (frok::parent): Move retry decision into
896         child_info_fork::fork_retry and honor what it tells us to do.
897         * sigproc.cc (sig_send): Unhold signals on __SIGEXIT.
898
899 2006-03-14  Christopher Faylor  <cgf@timesys.com>
900
901         * fork.cc (frok::parent): Improve error message.
902
903 2006-03-14  Christopher Faylor  <cgf@timesys.com>
904
905         * dcrt0.cc (main_environ): Initialize to &__cygwin_environment.
906         (dll_crt0_1): Move resourcelocks, thread interface, pinfo_init, and
907         uinfo_init...
908         (dll_crt0_0): ...to here.
909         (_dll_crt0): Call update_envptrs here after setting main_environ.
910         * environ.cc (environ_init): Eliminate initted variable.  Don't call
911         update_envptrs here.
912         * sigproc.cc (wait_sig): Use my_sendsig when calling CreatePipe to
913         avoid a dereference.
914
915 2006-03-13  Christopher Faylor  <cgf@timesys.com>
916
917         * child_info.h (child_info_fork::handle_failure): Declare new function.
918         (child_info_fork::retry): New field.
919         * dcrt0.cc (__api_fatal_exit_val): Define.
920         (child_info_fork::handle_failure): Define new function.
921         (__api_fatal): Exit using __api_fatal_exit_val value.
922         * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN
923         environment variable.
924         (parse_thing): Add "fork_retry" setting.
925         * fork.cc (fork_retry): Define.
926         (frok::parent): Reorganize to allow retry of failed child creation if
927         child signalled that it was ok to do so.
928         * heap.cc (heap_init): Signal parent via handle_failure when
929         VirtualAlloc fails.
930         * pinfo.h (EXITCODE_RETRY): Declare.
931         * sigproc.cc (child_info::sync): Properly exit with failure condition
932         if called for fork and didn't see subproc_ready.
933         * spawn.cc (spawn_guts): Use windows pid as first argument.
934         * winsup.h: Remove obsolete NEW_MACRO_VARARGS define.
935         (__api_fatal_exit_val): Declare.
936         (set_api_fatal_return): Define.
937         (in_dllentry): Declare.
938         * exceptions.cc (inside_kernel): Remove unneeded in_dllentry
939         declaration.
940
941 2006-03-13  Christopher Faylor  <cgf@timesys.com>
942
943         * dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a
944         little later.  Add a comment.
945         * fork.cc (resume_child): Make void.
946         (frok::parent): Only zero pi when necessary.  Explicitly zero si.  Set
947         this_errno when child_copy fails.  Accommodate change to resume_child.
948         * sigproc.cc (sigalloc): Move global_sigs initialization here.
949         (sigproc_init): Move global_sigs.
950         (sig_send): Just check for flush signals once.
951
952         * wincap.h: Define supports_setconsolectrlhandler_null throughout.
953         * wincap.cc: Ditto.
954
955 2006-03-13  Corinna Vinschen  <corinna@vinschen.de>
956
957         * autoload.cc (LoadDLLfuncNt): New define to wrap NT native functions.
958         Use for NT native functions throughout.
959         * dtable.cc (handle_to_fn): Treat return value of NtQueryObject as
960         NTSTATUS value.
961
962 2006-03-12  Christopher Faylor  <cgf@timesys.com>
963
964         * cygtls.cc (_cygtls::remove): Reset initialized flag right away if we
965         were previously initialized.
966         * cygtls.h (_cygtls::initialized): Move nearer to the end to catch
967         situation when Windows 98 mysteriously changes parts of _my_tls when
968         thread is detaching.
969         * gendef (__sigfe_maybe): Simplify slightly.
970         * tlsoffsets.h: Regenerate.
971
972 2006-03-12  Christopher Faylor  <cgf@timesys.com>
973
974         * cygtls.h (CYGTLS_INITIALIZED): Change to a little more unlikely value.
975         (CYGTLSMAGIC): Delete.
976         * dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup.
977         (_dll_crt0): Don't worry about sync_startup.  Just wait for sigthread here.
978         * dll_init.cc (cygwin_detach_dll): Only pick up tls version of retaddr
979         if we have a valid tls.
980         * fork.cc (frok::child): Remove sigproc_init initialization since it
981         happens much earlier now.
982         * gendef: Recognize SIGFE_MAYBE.
983         (fefunc): Generate calls to _sigfe_maybe, if appropriate.
984         (_sigfe_maybe): New function.
985         * init.cc (search_for): Always initialize search_for, even on fork.
986         (calibration_thread): Delete.
987         (calibration_id): Delete.
988         (prime_threads): Delete.
989         (munge_threadfunc): Remove calibration_thread special case.  Avoid
990         calling thread function if we haven't yet hit the "search_for" thread.
991         (dll_entry): Remove prime_threads call.  Only call munge_threadfunc
992         when hwait_sig is active.  Ditto. for _my_tls.remove ();
993         * sigproc.cc (hwait_sig): Make global.
994         (sigproc_init): Don't bother with sync_startup.
995         (sig_send): Treat flush as a no-op when signals are held.
996         (wait_sig): Cause signals to be held after fork.
997
998 2006-03-09  Corinna Vinschen  <corinna@vinschen.de>
999
1000         * syscalls.cc (rename): Move existance check for oldpath further up
1001         to the start of the function.  Avoid another case of a name collision
1002         if oldpath is a shortcut and a file or directory newpath already exists.
1003
1004 2006-03-09  Corinna Vinschen  <corinna@vinschen.de>
1005
1006         * autoload.cc (NtClose): Define.
1007         (NtOpenDirectoryObject): Define.
1008         (NtQueryDirectoryObject): Define.
1009         * fhandler_proc.cc: Include ctype.h and wchar.h.
1010         (format_proc_partitions): Revamp loop over existing harddisks by
1011         scanning the NT native \Device object directory and looking for
1012         Harddisk entries.
1013         * ntdll.h: Rearrange system call declarations alphabetically.
1014         (DIRECTORY_QUERY): Define.
1015         (struct _DIRECTORY_BASIC_INFORMATION): Define.
1016         (NtOpenDirectoryObject): Declare.
1017         (NtQueryDirectoryObject): Declare.
1018
1019 2006-03-08  Christopher Faylor  <cgf@timesys.com>
1020
1021         * cygtls.h (_cygtls::retaddr): New method.
1022         * dll_init.cc (cygwin_detach_dll): Use new tls method to find return
1023         address since this function is now signal guarded.
1024         (update_envptrs): Remove unneeded braces.
1025         * syscalls.cc (statvfs): Coerce full_path to avoid a gcc warning.
1026
1027 2006-03-08  Corinna Vinschen  <corinna@vinschen.de>
1028
1029         * syscalls.cc (statvfs): Simplify path name expression.
1030
1031 2006-03-08  Corinna Vinschen  <corinna@vinschen.de>
1032
1033         * syscalls.cc: Include winioctl.h.
1034         (statvfs): Request correct volume size using DeviceIoControl if
1035         quotas are enforced on the file system.
1036
1037 2006-03-03  Corinna Vinschen  <corinna@vinschen.de>
1038
1039         * dir.cc (opendir): Fix indentation.
1040         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Move storing
1041         fhandler in file descriptor table to some point very late in function
1042         to avoid double free'ing.  Add comment to explain what happens.
1043         Add label free_mounts and don't forget to delete __DIR_mounts structure
1044         if NtOpenFile fails.
1045
1046 2006-03-02  Corinna Vinschen  <corinna@vinschen.de>
1047
1048         * syscalls.cc (chroot): Disallow chroot into special directories.
1049         Return EPERM instead.
1050
1051 2006-03-02  Corinna Vinschen  <corinna@vinschen.de>
1052
1053         * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
1054         cygdrive string length for those who have cygdrive mapped to "/".
1055
1056 2006-03-01  Corinna Vinschen  <corinna@vinschen.de>
1057
1058         * sec_helper.cc (set_cygwin_privileges): Request SE_BACKUP_NAME
1059         privileges.
1060
1061 2006-03-01  Corinna Vinschen  <corinna@vinschen.de>
1062
1063         * fhandler_proc.cc (fhandler_proc::fstat): Always return fixed link
1064         count of 1 for /proc directory instead of incorrect PROC_LINK_COUNT.
1065
1066 2006-03-01  Corinna Vinschen  <corinna@vinschen.de>
1067
1068         * fhandler.h (enum dirent_states): Remove dirent_saw_cygdrive,
1069         dirent_saw_dev and dirent_saw_proc.
1070         (fhandler_cygdrive::open): Declare.
1071         (fhandler_cygdrive::close): Declare.
1072         * fhandler_disk_file.cc (class __DIR_mounts): Move to beginning of file.
1073         (__DIR_mounts::check_mount): New parameter to indicate if inode number
1074         is needed in calling function or not. Add /proc and /cygdrive handling.
1075         (__DIR_mounts::check_missing_mount): Ditto.
1076         (path_conv::ndisk_links): Use __DIR_mounts class to create correct
1077         hardlink count for directories with mount points in them.
1078         (fhandler_disk_file::readdir_helper): Remove /dev, /proc and /cygdrive
1079         handling.
1080         (fhandler_cygdrive::open): New method.
1081         (fhandler_cygdrive::close): New method.
1082         (fhandler_cygdrive::fstat): Always return fixed inode number 2 and
1083         fixed link count of 1. Drop call to set_drives.
1084         (fhandler_cygdrive::opendir): Drop call to get_namehash.
1085         (fhandler_cygdrive::readdir): Handle "." entry to return fixed inode
1086         number 2.
1087
1088 2006-03-01  Christopher Faylor  <cgf@timesys.com>
1089
1090         * cygwin.din: Fix some erroneous SIGFE/NOSIGFE settings.
1091
1092 2006-03-01  Christopher Faylor  <cgf@timesys.com>
1093
1094         * cygthread.cc (cygthread::callfunc): Revert below change.  Make ev a
1095         manual reset event again.  so that it will be reset by WaitFor*Object
1096         as appropriate.
1097         (cygthread::stub): Ditto.
1098         (cygthread::terminate_thread): Reset ev if it was found to have been
1099         set.
1100
1101 2006-03-01  Christopher Faylor  <cgf@timesys.com>
1102
1103         * analyze_sigfe: New script.
1104         * dllfixdbg: Add copyright.
1105         * gendef: Ditto.
1106         * gendevices: Ditto.
1107         * gentls_offsets: Ditto.
1108
1109 2006-03-01  Christopher Faylor  <cgf@timesys.com>
1110
1111         * cygthread.cc (cygthread::callfunc): Create ev as an auto-reset event
1112         so that it will be reset by WaitFor*Object as appropriate.
1113         (cygthread::stub): Ditto.
1114         (cygthread::terminate_thread): Remove forced setting of thread
1115         termination.
1116
1117 2006-03-01  Corinna Vinschen  <corinna@vinschen.de>
1118
1119         * include/sys/dirent.h (struct __DIR): Rename __d_unused to
1120         __d_internal.
1121         * fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef".
1122         (d_dirname): Remove useless "struct".
1123         (d_cachepos): Ditto.
1124         (d_cache): Ditto.
1125         (class __DIR_mounts): New class, implementing mount point tracking
1126         for readdir.
1127         (d_mounts): New macro for easy access to __DIR_mounts structure.
1128         (fhandler_disk_file::opendir): Allocate __DIR_mounts structure and
1129         let __d_internal element of dir point to it.
1130         (fhandler_disk_file::readdir_helper): Add mount points in the current
1131         directory, which don't have a real directory backing them.
1132         Don't generate an inode number for /dev.  Add comment, why.
1133         (fhandler_disk_file::readdir): Move filling fname to an earlier point.
1134         Check if current entry is a mount point and evaluate correct inode
1135         number for it.
1136         (fhandler_disk_file::readdir_9x): Ditto.
1137         (fhandler_disk_file::rewinddir): Set all mount points in this directory
1138         to "not found" so that they are listed again after calling rewinddir().
1139         (fhandler_disk_file::closedir): Deallocate __DIR_mounts structure.
1140         * path.cc (mount_info::get_mounts_here): New method to evaluate a list
1141         of mount points in a given parent directory.
1142         * shared_info.h (class mount_info): Declare get_mounts_here.
1143
1144 2006-02-28  Corinna Vinschen  <corinna@vinschen.de>
1145
1146         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use iscygdrive
1147         instead of isspecial.
1148         * path.h (path_conv::iscygdrive): New method.
1149
1150 2006-02-28  Christopher Faylor  <cgf@timesys.com>
1151
1152         * exceptions.cc (_cygtls::interrupt_now): Remove "inside cygwin" check
1153         since some cygwin functions are meant to be interrupted.
1154
1155 2006-02-28  Corinna Vinschen  <corinna@vinschen.de>
1156
1157         * cygwin.din: Export __isinff, __isinfd, __isnanf, __isnand.
1158         * include/cygwin/version.h: Bump API minor number to 155.
1159
1160 2006-02-28  Corinna Vinschen  <corinna@vinschen.de>
1161
1162         * dir.cc (readdir_worker): Use slash as path separator when evaluating
1163         namehash for paths below /proc.
1164         * fhandler_netdrive.cc (fhandler_netdrive::readdir): Use expensive
1165         inode number evaluation on share names.
1166
1167 2006-02-27  Christopher Faylor  <cgf@timesys.com>
1168
1169         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
1170         d_cachepos under NT or suffer memory corruption.
1171         (fhandler_disk_file::readdir_helper): Avoid else with a return.  Just
1172         calculate extension location once when doing symlink checks.
1173         (fhandler_disk_file::readdir): Make debug output more useful.
1174         (fhandler_disk_file::readdir_9x): Ditto.  Eliminate redundant variable.
1175
1176 2006-02-27  Christopher Faylor  <cgf@timesys.com>
1177
1178         * include/sys/termios.h (cfsetispeed): Just define as a function rather
1179         than resorting to a macro.
1180         (cfsetospeed): Ditto.
1181
1182 2006-02-27  Christopher Faylor  <cgf@timesys.com>
1183
1184         * sigproc.cc: Fix a comment.
1185
1186 2006-02-27  Christopher Faylor  <cgf@timesys.com>
1187
1188         * cygthread.cc (cygthread::release): Add a comment.
1189
1190 2006-02-27  Corinna Vinschen  <corinna@vinschen.de>
1191
1192         * fhandler_netdrive.cc (fhandler_netdrive::fstat): Create unambiguous
1193         inode number.
1194         (fhandler_netdrive::readdir): Ditto.
1195
1196 2006-02-24  Christopher Faylor  <cgf@timesys.com>
1197
1198         * sigproc.cc (sigheld): Define new variable.
1199         (sig_dispatch_pending): Don't check sigq since that's racy.
1200         (sig_send): Set sigheld flag if __SIGHOLD is specified, reset it if
1201         __SIGNOHOLD is specified.  Ignore flush signals if we're holding
1202         signals.
1203
1204 2006-02-23  Christopher Faylor  <cgf@timesys.com>
1205
1206         * cygwin.din (_exit): Use signal front end.
1207         (exit): Ditto.
1208
1209 2006-02-23  Christopher Faylor  <cgf@timesys.com>
1210
1211         * winsup.h (cygwin_hmodule): Declare.
1212         * exceptions.cc (inside_kernel): Reverse return values to reflect
1213         function name.  Return true if we're in cygwin1.dll or if we're
1214         executing in dll_entry.
1215         (_cygtls::interrupt_now): Reflect reversal of inside_kernel return
1216         value.
1217         * hookapi.cc (cygwin_hmodule): Remove declaration.
1218         * init.cc (dll_entry): Use in_dllentry global to record that we are
1219         executing in dllentry.
1220
1221 2006-02-22  Corinna Vinschen  <corinna@vinschen.de>
1222
1223         * exceptions.cc (_cygtls::interrupt_now): Reorder conditional
1224         to call inside_kernel only if this isn't locked.
1225
1226 2006-02-22  Corinna Vinschen  <corinna@vinschen.de>
1227
1228         * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES to
1229         access flags in case of query_read_control case, add FILE_READ_DATA
1230         in case of query_stat_control.
1231
1232 2006-02-20  Christopher Faylor  <cgf@timesys.com>
1233
1234         * spawn.cc (av::fixup): Check for .bat and friends specifically now
1235         since these extensions are no longer automatically detected.
1236
1237 2006-02-19  Christopher Faylor  <cgf@timesys.com>
1238
1239         * exceptions.cc (stackdump): Avoid dumping more than once.
1240
1241 2006-02-19  Christopher Faylor  <cgf@timesys.com>
1242
1243         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use NtOpenFile
1244         to open the directory.
1245         (fhandler_disk_file::readdir): Use NT_SUCCESS to determine if status
1246         represents success.
1247
1248 2006-02-19  Corinna Vinschen  <corinna@vinschen.de>
1249
1250         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop generating
1251         path_conv for root.
1252
1253 2006-02-18  Corinna Vinschen  <corinna@vinschen.de>
1254
1255         * fhandler_disk_file.cc (FS_IS_SAMBA): Move out of
1256         path_conv::hasgood_inode.
1257         (path_conv::is_samba): New method.
1258         (fhandler_base::fstat_by_handle): Don't even try to use
1259         FileIdBothDirectoryInformation on Samba.
1260         * path.h (class path_conv): Declare is_samba method.
1261
1262 2006-02-17  Christopher Faylor  <cgf@timesys.com>
1263
1264         * path.cc (conv_path_list): Eat empty paths when converting to POSIX.
1265         (cygwin_conv_to_win32_path): Deal with Cygwin's necessity of adding a
1266         '/' to the end of a path ending in '.'.
1267
1268 2006-02-16  Corinna Vinschen  <corinna@vinschen.de>
1269
1270         * cygwin.din: Export sigignore and sigset.
1271         * exceptions.cc (sigset): New function.
1272         (sigignore): New function.
1273         * include/cygwin/signal.h (SIG_HOLD): Define.
1274         (sigignore): Declare.
1275         (sigset): Declare.
1276         * include/cygwin/version.h: Bump API minor number to 154.
1277
1278 2006-02-13  Igor Peshansky  <pechtcha@cs.nyu.edu>
1279
1280         * include/mntent.h: Add missing #include.
1281
1282 2006-02-13  Igor Peshansky  <pechtcha@cs.nyu.edu>
1283
1284         * gentls_offsets: Fix typo in error message.
1285
1286 2006-02-10  Christopher Faylor  <cgf@timesys.com>
1287
1288         * fhandler_process.cc (format_process_stat): Use cygwin-derived start
1289         time even on NT since it is the logical start time of the "process".
1290         * pinfo.cc (set_myself): Don't set start time when it should have
1291         already been set previously.
1292
1293 2006-02-10  Brian Ford  <Brian.Ford@FlightSafety.com>
1294
1295         * times.cc (clock_getres): Use correct conversion from milliseconds to
1296         seconds/nanoseconds.
1297         (clock_setres): Use correct conversion to nanoseconds.
1298
1299 2006-02-10  Christopher Faylor  <cgf@timesys.com>
1300
1301         * external.cc (sync_winenv): Rename from "setup_winenv".  Use same
1302         mechanism as spawn to determine environment variables which should be
1303         converted back to windows form.
1304         (cygwin_internal): Reflect setup_winenv -> sync_winenv name change.
1305         * include/sys/cygwin.h: Ditto.
1306
1307 2006-02-09  Corinna Vinschen  <corinna@vinschen.de>
1308
1309         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
1310         the dirent_get_d_ino flag on filesystems having useful File IDs.
1311         Add comment explaining why.
1312
1313 2006-02-07  Corinna Vinschen  <corinna@vinschen.de>
1314
1315         * dtable.cc (handle_to_fn): Accommodate new argument order in call to
1316         sys_wcstombs.
1317         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Call sys_wcstombs
1318         instead of just wcstombs to accommodate OEM codepages.
1319         * miscfuncs.cc (sys_wcstombs): Split len argument in source and target
1320         length.  Always 0-terminate result in target string.
1321         * security.cc (lsa2wchar): Remove unused function.
1322         (lsa2str): Ditto.
1323         (get_lsa_srv_inf): Ditto.
1324         (get_logon_server): Accommodate new argument order in call to
1325         sys_wcstombs.
1326         (get_user_groups): Ditto.
1327         (get_user_local_groups): Ditto.
1328         (get_priv_list): Call sys_wcstombs directly instead of lsa2str.
1329         * uinfo.cc (cygheap_user::ontherange): Accommodate new argument order
1330         in call to sys_wcstombs.
1331         * winsup.h (sys_wcstombs): Change prototype to match new argument order.
1332
1333 2006-02-07  Corinna Vinschen  <corinna@vinschen.de>
1334
1335         * init.cc (respawn_wow64_process): Exit with the exit code returned
1336         by the respawned process.
1337
1338 2006-02-06  Christopher Faylor  <cgf@timesys.com>
1339
1340         Always zero all elements of siginfo_t throughout.
1341         * cygtls.h (_cygtls::thread_context): Declare new field.
1342         (_cygtls::thread_id): Ditto.
1343         (_cygtls::signal_exit): Move into this class.
1344         (_cygtls::copy_context): Declare new function.
1345         (_cygtls::signal_debugger): Ditto.
1346         * cygtls.cc (_cygtls::init_thread): Fill out thread id field.
1347         * exceptions.cc (exception): Change message when exception info is
1348         unknown.  Copy context to thread local storage.
1349         (_cygtls::handle_exceptions): Avoid double test for fault_guarded.
1350         Reflect move of signal_exit to _cygtls class.
1351         (sigpacket::process): Copy context to thread local storage.
1352         (_cygtls::signal_exit): Move to _cygtls class.  Call signal_debugger to
1353         notify debugger of exiting signal (WIP).  Call stackdump here (WIP).
1354         (_cygtls::copy_context): Define new function.
1355         (_cygtls::signal_debugger): Ditto.
1356         * tlsoffsets.h: Regenerate.
1357         * include/cygwin.h (_fpstate): New internal structure.
1358         (ucontext): Declare new structure (WIP).
1359         (__COPY_CONTEXT_SIZE): New define.
1360
1361         * exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field
1362         when there is no sigwaiting thread.
1363         (setup_handler): Move event handling into interrupt_setup.
1364
1365 2006-02-06  Corinna Vinschen  <corinna@vinschen.de>
1366
1367         * fhandler_socket.cc (fhandler_socket::connect): Fix formatting.
1368         (fhandler_socket::wait): Handle SA_RESTART when signal arrives.
1369
1370 2006-02-06  Corinna Vinschen  <corinna@vinschen.de>
1371
1372         * include/cygwin/socket.h (CMSG_FIRSTHDR): Avoid compiler warning.
1373
1374 2006-02-05  Corinna Vinschen  <corinna@vinschen.de>
1375
1376         * include/features.h: Add comment to explain what's going to happen
1377         here at one point.
1378         * include/sys/stdio.h: Guard getline and getdelim prototypes with
1379         _GNU_SOURCE to avoid collision with old-style declarations.
1380
1381 2006-02-05  Corinna Vinschen  <corinna@vinschen.de>
1382
1383         * environ.cc (struct parse_thing): Add transparent_exe option.
1384         * fhandler_disk_file.cc (fhandler_disk_file::link): Accommodate
1385         transparent_exe option.  Add .exe suffix for links to executable files,
1386         if transparent_exe is set.
1387         * fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe
1388         suffix if transparent_exe option is set.
1389         * path.cc (symlink_worker): Accommodate transparent_exe option.
1390         (realpath): Don't tack on .exe suffix if transparent_exe is set.
1391         * syscalls.cc (transparent_exe): New global variable.
1392         (unlink): Accommodate transparent_exe option.
1393         (open): Ditto.
1394         (link): Ditto.
1395         (rename): Ditto. Maybe add .exe suffix when renaming executable files.
1396         (pathconf): Accommodate transparent_exe option.
1397         * winsup.h: Declare transparent_exe.
1398
1399 2006-02-05  Christopher Faylor  <cgf@timesys.com>
1400             Corinna Vinschen  <corinna@vinschen.de>
1401
1402         * fhandler_disk_file.cc (fhandler_disk_file::readdir_9x): Remove
1403         useless code.
1404
1405 2006-02-05  Corinna Vinschen  <corinna@vinschen.de>
1406
1407         * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Remove label
1408         "out".  Move test for NULL __handle ...
1409         (fhandler_disk_file::rewinddir_9x): ... here.
1410
1411 2006-02-05  Corinna Vinschen  <corinna@vinschen.de>
1412
1413         * dir.cc (rewinddir): Keep dirent_get_d_ino and dirent_set_d_ino flags.
1414
1415 2006-02-05  Christopher Faylor  <cgf@timesys.com>
1416
1417         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Don't close dir
1418         handle when we hit EOF since rewwindir may reactivate it.
1419         (fhandler_disk_file::readdir_9x): Eliminate superfluous temporary
1420         variable.
1421         (fhandler_disk_file::closedir): Return EBADF when trying to close
1422         unopened DIR.  Reorganize slightly.  Return actual derived error value
1423         rather than always returning 0.
1424
1425 2006-02-04  Christopher Faylor  <cgf@timesys.com>
1426
1427         * dir.cc (rmdir): Reorganize check for trailing dot to return correct
1428         error when directory does not exist.
1429
1430 2006-02-03  Christopher Faylor  <cgf@timesys.com>
1431
1432         * dir.cc (mkdir): Reorganize check for trailing dot to return correct
1433         error when directory exists.
1434         * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Remove special
1435         test for path ending in '.'.
1436
1437 2006-02-03  Corinna Vinschen  <corinna@vinschen.de>
1438
1439         * path.cc (suffix_scan::lnk_match): Return true beginning with
1440         SCAN_APPENDLNK.
1441         (suffix_scan::next): Rearrange code to make .lnk append order slightly
1442         more deterministic.
1443         * spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align
1444         evaluation with stat_suffixes.
1445         (dll_suffixes): Ditto.
1446
1447 2006-02-02  Christopher Faylor  <cgf@timesys.com>
1448
1449         * cygwin/version.h: Mention CW_SETUP_WINENV in comment for API minor
1450         153.
1451
1452 2006-02-02  Corinna Vinschen  <corinna@vinschen.de>
1453
1454         * cygwin.din (updwtmpx): Export.
1455         * syscalls.cc (updwtmpx): New function.
1456         * include/utmpx.h (updwtmpx): Declare.
1457         * include/cygwin/version.h: Bump API minor number to 153.
1458
1459 2006-02-02  Christopher Faylor  <cgf@timesys.com>
1460
1461         * external.cc (setup_winenv): New function.
1462         (cygwin_internal): Implement CW_SETUP_WINENV.
1463         * sys/cygwin.h (cygwin_getinfo_types): Define CW_SETUP_WINENV.
1464
1465 2006-02-02  Corinna Vinschen  <corinna@vinschen.de>
1466
1467         * security.cc (is_group_member): Fix comment.
1468
1469 2006-02-02  Corinna Vinschen  <corinna@vinschen.de>
1470
1471         * security.cc (is_group_member): Use local group info type 1.  Test
1472         group for being a global group or a well-known SID before adding it
1473         to the group list.  Add comment.
1474
1475 2006-02-01  Corinna Vinschen  <corinna@vinschen.de>
1476
1477         * autoload.cc  (GetTcpTable): Define.
1478         * fhandler_socket.cc (address_in_use): New function to check if
1479         sockaddr_in address is already in use.
1480         (fhandler_socket::bind): Check if address is alreay in use in case of
1481         SO_REUSEADDR, to circumvent WinSock non-standard behaviour.
1482
1483 2006-02-01  Corinna Vinschen  <corinna@vinschen.de>
1484
1485         * spawn.cc (dll_suffixes): Add .exe and "no suffix" to the list.
1486
1487 2006-01-31  Corinna Vinschen  <corinna@vinschen.de>
1488
1489         * dlfcn.cc (check_path_access): Call find_exec with FE_DLL option.
1490         * path.h (enum fe_types): Add FE_DLL value.
1491         * spawn.cc (std_suffixes): Remove.
1492         (exe_suffixes): New suffix_info for executing files.
1493         (dll_suffixes): New suffix_info for searching shared libraries.
1494         (perhaps_suffix): Add opt argument.  Use dll_suffixes if FE_DLL
1495         option is given, exe_suffixes otherwise.
1496         (find_exec): Propagate opt argument to perhaps_suffix.  Drop suffix
1497         check when testing execute permission.
1498         (spawn_guts): Call perhaps_suffix with FE_NADA opt argument.
1499
1500 2006-01-31  Christopher Faylor  <cgf@timesys.com>
1501
1502         * spawn.cc (av::fixup): Remove unused argument.
1503         (spawn_guts): Remove capitalization in debugging.
1504
1505 2006-01-31  Corinna Vinschen  <corinna@vinschen.de>
1506
1507         * spawn.cc (find_exec): Only return files with execute permission set
1508         if ntsec is on.  Don't check execute permission of Windows batch files.
1509         (av::fixup): Handle empty files gracefully.  Drop execute permission
1510         test here.
1511         * path.cc (suffix_scan::next): Don't skip any suffix on first run.
1512
1513 2006-01-31  Corinna Vinschen  <corinna@vinschen.de>
1514
1515         * path.cc (cwdstuff::set): Don't set win32 error, only POSIX errno.
1516
1517 2006-01-31  Corinna Vinschen  <corinna@vinschen.de>
1518
1519         * path.cc (cwdstuff::set): When SetCurrentDirectory returns
1520         ERROR_INVALID_FUNCTION, bend it over to ERROR_FILE_NOT_FOUND.  Add
1521         comment to explain why.
1522
1523 2006-01-31  Corinna Vinschen  <corinna@vinschen.de>
1524
1525         * dir.cc (readdir_worker): Add comment about writing old 32 bit d_ino.
1526         * include/cygwin/version.h: Bump API minor number to 152.
1527         (CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): Remove.
1528
1529 2006-01-30  Corinna Vinschen  <corinna@vinschen.de>
1530
1531         * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Simplify
1532         conditional.
1533
1534 2006-01-30  Corinna Vinschen  <corinna@vinschen.de>
1535
1536         * fhandler_disk_file.cc (d_cachepos): Rename from d_pos to distinct
1537         clearly from __d_position.  Change throughout.
1538         (fhandler_disk_file::rewinddir): Reset readdir cache on NT.
1539
1540 2006-01-29  Corinna Vinschen  <corinna@vinschen.de>
1541
1542         * fhandler_disk_file.cc (readdir_get_ino): Don't follow symlinks.
1543
1544 2006-01-29  Corinna Vinschen  <corinna@vinschen.de>
1545
1546         * fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag.
1547         * fhandler_socket.cc (fhandler_socket::bind): Set socket to
1548         SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR
1549         socket option, on systems supporting SO_EXCLUSIVEADDRUSE.
1550         * net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag
1551         if SO_REUSEADDR socket option has been successsfully set.
1552         * wincap.h (wincaps::has_exclusiveaddruse): New element.
1553         * wincap.cc: Implement above element throughout.
1554
1555 2006-01-28  Corinna Vinschen  <corinna@vinschen.de>
1556
1557         * fhandler_disk_file.cc (fhandler_disk_file::mkdir): In case or error,
1558         check for existance explicitely and set errno to EEXIST.
1559
1560 2006-01-28  Corinna Vinschen  <corinna@vinschen.de>
1561
1562         * fhandler_disk_file.cc (DIR_NUM_ENTRIES): New define determining
1563         minimum number of dir entries which fit into the readdir cache.
1564         (DIR_BUF_SIZE): Define globally as size of readdir cache.
1565         (struct __DIR_cache): New structure used for readdir caching on NT.
1566         (d_dirname): Accessor for struct __DIR_cache, use throughout.
1567         (d_pos): Ditto.
1568         (d_cache): Ditto.
1569         (fhandler_disk_file::opendir): Allocate __d_dirname to contain readdir
1570         cache on NT.
1571         (fhandler_disk_file::readdir): Use buf as pointer into readdir cache.
1572         Implement readdir caching.
1573
1574 2006-01-28  Corinna Vinschen  <corinna@vinschen.de>
1575
1576         * include/sys/dirent.h (struct dirent): Revert misguided attempt to
1577         rename __d_unused1 to __d_fd.
1578
1579 2006-01-27  Corinna Vinschen  <corinna@vinschen.de>
1580
1581         * autoload.cc (NtQueryDirectoryFile): Define.
1582         * dir.cc (__opendir_with_d_ino): Just call opendir.
1583         (opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling.
1584         (readdir_worker): Only try generating d_ino if it's 0.
1585         Utilize namehash of directories fhandler.  Call readdir_get_ino to
1586         generate d_ino for "..".
1587         (seekdir64): Keep dirent_set_d_ino flag.
1588         * fhandler.h (enum dirent_states): Add dirent_get_d_ino.
1589         (class fhandler_disk_file): Declare new private methods readdir_helper
1590         and readdir_9x.
1591         * fhandler_disk_file.cc (path_conv::hasgood_inode): New method to
1592         evaluate if a filesystem has reliable inode numbers.
1593         (fhandler_base::fstat_by_handle): Accommodate structure member name
1594         change from IndexNumber to FileId.
1595         (fhandler_base::fstat_helper): Call hasgood_inode here.
1596         (fhandler_disk_file::opendir): Call fhaccess only for real files.
1597         Don't append '*' to __d_dirname here, move to readdir_9x.  On NT,
1598         open directory handle here.  Set dirent_get_d_ino and dirent_set_d_ino
1599         flags according to wincap and filesystem.
1600         (fhandler_disk_file::readdir_helper): New method to implement readdir
1601         postprocessing only once.
1602         (readdir_get_ino_by_handle): New static function.
1603         (readdir_get_ino): New function to centralize inode number evaluation
1604         in case inode number hasn't been returned by NtQueryDirectoryFile.
1605         (fhandler_disk_file::readdir): Move old functionality to readdir_9x.
1606         Call readdir_9x when on 9x/Me.  Implement NT specific readdir here.
1607         (fhandler_disk_file::readdir_9x): Move 9x specific readdir here.
1608         (fhandler_disk_file::seekdir): Accommodate new NT readdir method.
1609         (fhandler_disk_file::closedir): Ditto.
1610         (fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment.
1611         (fhandler_cygdrive::opendir): Call get_namehash to prepare later
1612         correct evaluation of d_ino.
1613         (fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate
1614         drive's d_ino by calling readdir_get_ino.
1615         * fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and
1616         dirent_saw_dot_dot to avoid seeing . and .. entries twice.
1617         * fhandler_process.cc (fhandler_process::readdir): Ditto.
1618         * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
1619         * ntdll.h (STATUS_INVALID_PARAMETER): New define.
1620         (STATUS_INVALID_LEVEL): New define.
1621         (struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to
1622         FileId (as in Nebbitt).
1623         * path.h (path_conv::hasgood_inode): Now implemented in
1624         fhandler_disk_file.cc.
1625         * wincap.h (wincaps::has_fileid_dirinfo): New element.
1626         * wincap.cc: Implement above element throughout.
1627         * winsup.h (readdir_get_ino): Add declaration.
1628         * include/sys/dirent.h (struct dirent): Slightly rename structure
1629         members to accommodate changes.
1630         Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of
1631         __opendir_with_d_ino.
1632
1633 2006-01-27  Christopher Faylor  <cgf@timesys.com>
1634
1635         * spawn.cc (spawn_guts): Fix potential handle leak when failing exec.
1636
1637 2006-01-27  Christopher Faylor  <cgf@timesys.com>
1638
1639         * exceptions.cc (inside_kernel): Fix to return true if we can't get the
1640         name of the DLL for the given memory block since we are not in kernel
1641         code.
1642
1643 2006-01-26  Corinna Vinschen  <corinna@vinschen.de>
1644
1645         * fhandler.cc (fhandler_base::open): Fix bug in argument order to
1646         InitializeObjectAttributes call.
1647
1648 2006-01-25  Corinna Vinschen  <corinna@vinschen.de>
1649
1650         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix test for
1651         dirent_isroot to use the correct boolean operator.
1652
1653 2006-01-25  Christopher Faylor  <cgf@timesys.com>
1654
1655         * ntdll.h: (temporarily?) Add more functions for querying directory.
1656
1657 2006-01-24  Christopher Faylor  <cgf@timesys.com>
1658
1659         * dir.cc (readdir_worker): Turn off expensive inode calculation.
1660
1661 2006-01-24  Corinna Vinschen  <corinna@vinschen.de>
1662
1663         * fhandler_process.cc (fhandler_process::fill_filebuf): Disable
1664         stripping the .exe suffix from the link target in PROCESS_EXE and
1665         PROCESS_EXENAME case.
1666         * path.cc (realpath): Tack on .exe suffix if necessary.
1667
1668 2006-01-24  Corinna Vinschen  <corinna@vinschen.de>
1669
1670         * fhandler_disk_file.cc (fhandler_base::fstat_helper): Try harder
1671         to determine remote file systems with reliable inode numbers.  Add
1672         longish comment.
1673
1674 2006-01-23  Corinna Vinschen  <corinna@vinschen.de>
1675
1676         * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Reset
1677         inheritance for duplicated socket.
1678
1679 2006-01-20  Christopher Faylor  <cgf@timesys.com>
1680
1681         * include/cygwin/version.h: Bump API minor number to 151.
1682         * dir.cc (__opendir_with_d_ino): New function.
1683         (opendir): Set flag if we should be calculating inodes.
1684         (readdir_worker): Calculate d_ino by calling stat if the user has asked
1685         for it.
1686         (seekdir64): Maintain all persistent flag settings.
1687         * fhandler.h (dirent_states): Add dirent_set_d_ino.
1688         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Reflect changes
1689         to dirent structure.
1690         * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
1691         * include/sys/dirent.h (struct dirent): Coalesce two similar
1692         structures.  Remove all shreds of the apparently highly confusing
1693         references to inodes.  Add support for calculating a real inode if
1694         __USE_EXPENSIVE_CYGWIN_D_INO is defined.
1695
1696 2006-01-20  Christopher Faylor  <cgf@timesys.com>
1697
1698         * include/sys/dirent.h: Add comments for people who are REALLY confused
1699         about whether they should be using something called __invalid_d_ino or
1700         not.
1701
1702 2006-01-20  Corinna Vinschen  <corinna@vinschen.de>
1703
1704         * fhandler_socket.cc (fhandler_socket::prepare): Fix debug output.
1705         (fhandler_socket::release): Add debug output for WSAEventSelect failure.
1706         (fhandler_socket::ioctl): Always cancel WSAEventSelect before switching
1707         to blocking mode.  Only set nonblocking flag if ioctlsocket call
1708         succeeded.  Only print new socket state if ioctlsocket call succeeded.
1709
1710 2006-01-19  Christopher Faylor  <cgf@timesys.com>
1711
1712         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check posix path
1713         for root rather than windows path.
1714
1715 2006-01-19  Christopher Faylor  <cgf@timesys.com>
1716
1717         * dir.cc (readdir_worker): Fill in invalid fields with -1.  Accommodate
1718         name change from __ino32 to __invalid_ino32.
1719         * include/sys/dirent.h (__invalid_ino32): Rename from __ino32.  Don't
1720         define unused d_type macros.
1721
1722 2006-01-18  Christopher Faylor  <cgf@timesys.com>
1723
1724         * heap.cc (heap_init): Remove Sleep.
1725
1726 2006-01-18  Corinna Vinschen  <corinna@vinschen.de>
1727
1728         * net.cc (rresvport): Remove extern declaration.
1729
1730 2006-01-18  Corinna Vinschen  <corinna@vinschen.de>
1731
1732         * autoload.cc (rresvport): Remove.
1733         * net.cc (last_used_rrecvport): New global shared variable.
1734         (cygwin_rresvport): Implement rresvport without using rresvport from
1735         wsock32.
1736
1737 2006-01-18  Corinna Vinschen  <corinna@vinschen.de>
1738
1739         * include/cygwin/socket.h (struct sockaddr_storage): Fix typo in
1740         ss_family member name.
1741
1742 2006-01-16  Christopher Faylor  <cgf@timesys.com>
1743
1744         * include/cygwin/version.h: Bump DLL minor version number to 20.
1745
1746 2006-01-13  Corinna Vinschen  <corinna@vinschen.de>
1747
1748         * uname.cc (uname): Concatenate a "-WOW64" to utsname's sysname
1749         member to see when running under WOW64.
1750
1751 2006-01-13  Corinna Vinschen  <corinna@vinschen.de>
1752
1753         * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS on
1754         Windows 2000 and above. Clarify the comment about IP_TOS and move
1755         to the place where the magic happens.
1756         (get_ifconf): Remove unused code.
1757         * wincap.h (wincaps::has_disabled_user_tos_setting): New element.
1758         * wincap.cc: Implement above element throughout.
1759
1760 2006-01-12  Christopher Faylor  <cgf@timesys.com>
1761
1762         * fhandler_console.cc (set_console_state_for_spawn): Fix to recognize
1763         ttys >= 0.
1764
1765 2006-01-12  Christopher Faylor  <cgf@timesys.com>
1766
1767         * fhandler.h (set_console_state_for_spawn): Whackamole the argument
1768         back to a bool.
1769         * spawn.cc (spawn_guts): Ditto, i.e., once again call
1770         set_console_state_for_spawn with an indication of whether we're about
1771         to start a cygwin process.
1772         * fhandler_console.cc (set_console_state_for_spawn): Don't set the
1773         console state if we know we're starting a cygwin process or if we're
1774         using a "real" tty.
1775
1776 2006-01-10  Corinna Vinschen  <corinna@vinschen.de>
1777
1778         * dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
1779         * init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker.
1780         Call wincap.init here before doing anything else.  Use wincap.is_wow64
1781         to determine if we're running in a WOW64 emulator.
1782         * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's
1783         apparently not supported.
1784         (mmap64): Don't create mappings beyond EOF, which would need to use
1785         AT_ROUND_TO_PAGE, on WOW64.
1786         * wincap.cc (wincap): Throw into the .cygwin_dll_common section.
1787         (wincapc::init): Determine if running in WOW64 and set wow_64 flag.
1788         * wincap.h (class wincapc): Add wow64 member.
1789         (wincapc::is_wow64): New method.
1790
1791 2006-01-10  Christopher Faylor  <cgf@timesys.com>
1792
1793         * fhandler_proc.cc (format_proc_cpuinfo): Avoid leading whitespace in
1794         model name.
1795
1796 2006-01-09  Christopher Faylor  <cgf@timesys.com>
1797
1798         * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is
1799         done prior to check for command.com/cmd.com.  Don't bother setting
1800         CREATE_SUSPENDED flag for a MS-DOS process since it doesn't work
1801         anyway.  Avoid calling remember() when the child process has already
1802         exited.
1803         (av::fixup): Explicitly set cygexec flag to false on a 16 bit process.
1804
1805 2006-01-09  Corinna Vinschen  <corinna@vinschen.de>
1806
1807         * include/getopt.h (getopt_long_only): Declare.
1808
1809 2006-01-09  Eric Blake  <ebb9@byu.net>
1810
1811         * cygwin.din: Export getsubopt.
1812         * include/cygwin/version.h: Bump API minor version.
1813
1814 2006-01-08  Christopher Faylor  <cgf@timesys.com>
1815
1816         * fhandler_tty.cc (fhandler_tty_slave::dup): Don't assign a controlling
1817         terminal to a process when duped.  Linux doesn't do this, so we won't
1818         either.
1819
1820 2006-01-08  Christopher Faylor  <cgf@timesys.com>
1821
1822         * environ.cc (spenvs[]): windir -> WINDIR.
1823
1824 2006-01-07  Christopher Faylor  <cgf@timesys.com>
1825
1826         * fhandler_console.cc (fhandler_console::need_invisible): Remove
1827         duplicate test.
1828
1829 2006-01-07  Christopher Faylor  <cgf@timesys.com>
1830
1831         * fhandler.h (set_console_state_for_spawn): Eliminate argument from
1832         declaration.
1833         * fhandler.cc (set_console_state_for_spawn): Eliminate argument from
1834         definition.  Always check for invisible console.
1835         (fhandler_console::need_invisible): Don't do anything if the windows
1836         station is already not visible.
1837         * spawn.cc (spawn_guts): Accommodate change of argument to
1838         set_console_state_for_spawn.
1839
1840 2006-01-05  Christopher Faylor  <cgf@timesys.com>
1841
1842         * sigproc.cc (no_signals_available): Use existence of signal thread
1843         handle to figure out if we can actually send signals rather than
1844         relying on my_sendsig.
1845         (hwait_sig): Make static.
1846         (sigproc_init): Don't set my_sendsig to anything special.  Use new
1847         global static hwait_sig.
1848         (wait_sig): Set hwait_sig to NULL when we are exiting.
1849
1850 2006-01-05  Christopher Faylor  <cgf@timesys.com>
1851
1852         * include/getopt.h: Accommodate recent unfortunate newlib changes.
1853
1854 2006-01-05  Christopher Faylor  <cgf@timesys.com>
1855
1856         * cygtls.cc (_cygtls::remove): Don't output debugging info if this
1857         isn't a cygwin thread.
1858         * sigproc.cc (sigproc_init): Move clearing of sync_startup here to
1859         lessen the likelihood of trying to deal with non-cygwin threads in
1860         dll_entry.
1861
1862         * fhandler_console: Fix set_console_state_for_spawn comment.
1863
1864 2006-01-05  Igor Peshansky  <pechtcha@cs.nyu.edu>
1865
1866         * spawn.cc (spawn_guts): Invert the argument to
1867         set_console_state_for_spawn.
1868
1869 2006-01-04  Christopher Faylor  <cgf@timesys.com>
1870
1871         * fhandler_console.cc (fhandler_console::need_invisible): Only try to
1872         open "CygwinInvisible" windows station if opening of default station
1873         fails.  Use CloseWindowStation to close window station handle.
1874
1875 2006-01-04  Christopher Faylor  <cgf@timesys.com>
1876
1877         * fhandler_console.cc (fhandler_console::need_invisible): Open up the
1878         security of the newly created windows station.
1879
1880 2006-01-04  Eric Blake  <ebb9@byu.net>
1881
1882         * path.cc (dot_special_chars): Add ", <, >, and |.
1883
1884 2006-01-03  Christopher Faylor  <cgf@timesys.com>
1885
1886         * fhandler_console.cc (beep): Use MB_OK which is documented as using
1887         the default bell rather than -1 which seems to behave differently on
1888         different versions of Windows.
1889
1890 2006-01-03  Christopher Faylor  <cgf@timesys.com>
1891
1892         * fhandler_process.cc (fhandler_process::readdir): Add missing argument
1893         to syscall_printf.
1894
1895         * fhandler_console.cc (fhandler_console::need_invisible): Use made-up
1896         name for windows station rather than asking Windows to create one for
1897         us.
1898
1899         * spawn.cc (spawn_guts): Don't mess with console if we're detaching.
1900
1901 2006-01-03  Christopher Faylor  <cgf@timesys.com>
1902
1903         * dir.cc (readdir_worker): Minor code cleanup.
1904
1905         * fhandler_console.cc (beep): Use a more Windows-generic wav file if
1906         the beep is missing.  Use a more foolproof way to find out whether we
1907         should be recreating the missing key.
1908
1909         * registry.h (reg_key::_disposition): New field.
1910         (reg_key::created): New function.
1911         * registry.cc (reg_key::reg_key): Set _disposition to zero by default.
1912         (reg_key::build_key): Fill in _disposition field.
1913
1914 2006-01-03  Eric Blake  <ebb9@byu.net>
1915
1916         * dir.cc (readdir_worker): Ensure that saw_dot* flags are updated when
1917         not handling inodes.
1918
1919 2006-01-02  Christopher Faylor  <cgf@timesys.com>
1920
1921         * fhandler_console.cc (beep): New function.  Restores missing "Default
1922         Beep", if necessary.
1923         (fhandler_console::write_normal): Use beep().
1924
1925 2006-01-02  Christopher Faylor  <cgf@timesys.com>
1926
1927         * dcrt0.cc (_dll_crt0): Remove more leftover debugging stuff.
1928         (cygwin_dll_init): Remove unneeded initializations.  Call _dll_crt0
1929         rather than dll_crt0_1.
1930
1931 2006-01-02  Corinna Vinschen  <corinna@vinschen.de>
1932
1933         * syslog.cc: Include sys/un.h instead of sys/socket.h.
1934         (syslogd_inited): Convert to enum type noting the exact result of
1935         trying to connect to syslog daemon.  Use this way throughout.
1936         (connect_syslogd): New static function taking over the task to
1937         connect to syslog socket.  Use correct struct sockaddr_un instead of
1938         struct sockaddr.
1939         (try_connect_syslogd): Call connect_syslogd.  If write fails on
1940         connection oriented socket, try to reconnect to syslog socket and
1941         try to write again.
1942
1943 2006-01-01  Christopher Faylor  <cgf@timesys.com>
1944
1945         * pinfo.cc (pinfo::exit): Swap signal and normal exit value when not
1946         started from a cygwin process - just like the good-old-days of B20.
1947
1948 2006-01-01  Christopher Faylor  <cgf@timesys.com>
1949
1950         * strace.cc (strace::write_childpid):  Remove debugging output.
1951
1952 2006-01-01  Christopher Faylor  <cgf@timesys.com>
1953
1954         * cygtls.cc (_cygtls::remove): Remove left over debugging cruft which
1955         caused this function to always return prematurely.
1956
1957 2006-01-01  Christopher Faylor  <cgf@timesys.com>
1958
1959         * exceptions.cc (sigpacket::process): Pass actual reference to signal's
1960         sigaction structure to setup_handler.
1961
1962 2006-01-01  Christopher Faylor  <cgf@timesys.com>
1963
1964         * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.
1965         * include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK.
1966
1967         * dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
1968
1969 2006-01-01  Corinna Vinschen  <corinna@vinschen.de>
1970
1971         * syslog.cc (vklog): Never log kernel messages using the vsyslog
1972         interface.