1 2006-07-04 Christopher Faylor <cgf@timesys.com>
3 * libc/rexec.cc (cygwin_rexec): Obvious (?) fix to correct a gcc
4 warning - set port to zero first thing in the function.
6 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
8 * signal.cc (signal): Set sa_mask to sig.
10 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
12 * Makefile.in (DLL_OFILES): Add rexec.o.
13 * autoload.cc (inet_network): Drop definition.
15 * net.cc (rexec): Drop extern declaration.
16 (inet_network): Ditto.
17 (cygwin_inet_network): Implement using inet_addr.
18 (cygwin_rexec): Remove.
19 * libc/rexec.cc: New file.
21 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
23 * fhandler_socket.cc (fhandler_socket::listen): Allow listening on
26 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
28 * fhandler.h (fhandler_socket::wait): Set default timeout to INFINITE.
30 2006-07-03 Corinna Vinschen <corinna@vinschen.de>
32 * autoload.cc (NtQueryEaFile): Define.
33 (NtSetEaFile): Define.
34 * fhandler.cc (fhandler_base::open): Use appropriate open flags
35 in query case when allow_ntea is set.
36 * ntdll.h (struct _FILE_GET_EA_INFORMATION): Define.
37 (struct _FILE_FULL_EA_INFORMATION): Define.
38 (NtQueryEaFile): Declare.
39 (NtSetEaFile): Declare.
40 * ntea.cc (read_ea): Rename from NTReadEA and rewrite using
42 (write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile.
43 * path.cc (get_symlink_ea): Make static. Add handle parameter to
44 accomodate new read_ea call.
45 (set_symlink_ea): Make static. Add handle parameter to accomodate new
47 (symlink_worker): Call set_symlink_ea while file is still open.
48 (symlink_info::check): Call get_symlink_ea after file has been opened.
49 * security.cc (get_file_attribute): Accomodate new read_ea call.
50 (set_file_attribute): Accomodate new write_ea call.
51 * security.h (read_ea): Change declaration accordingly.
54 2006-07-03 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
56 * fhandler.h (class dev_console): Add `metabit' indicating the
57 current meta key mode.
58 * fhandler_console.cc (fhandler_console::read): Set the top bit of
59 the character if metabit is true.
60 * fhandler_console.cc (fhandler_console::ioctl): Implement
61 KDGKBMETA and KDSKBMETA commands.
62 * fhandler_tty.cc (process_ioctl): Support KDSKBMETA.
63 (fhandler_tty_slave::ioctl): Send KDGKBMETA and KDSKBMETA to the
65 * include/cygwin/kd.h: New file for the meta key mode.
66 * include/sys/kd.h: New file.
68 2006-07-03 Eric Blake <ebb9@byu.net>
70 * include/stdint.h (UINT8_C, UINT16_C): Unsigned types smaller
71 than int promote to signed int.
73 2006-07-03 Corinna Vinschen <corinna@vinschen.de>
75 * net.cc (cygwin_sendto): Define appropriate parameters using
76 socklen_t type according to SUSv3.
77 (cygwin_recvfrom): Ditto.
78 (cygwin_setsockopt): Ditto.
79 (cygwin_getsockopt): Ditto.
80 (cygwin_connect): Ditto.
81 (cygwin_accept): Ditto.
83 (cygwin_getsockname): Ditto.
84 (cygwin_getpeername): Ditto.
87 * include/cygwin/socket.h (socklen_t): Typedef and define.
88 * include/sys/socket.h: Declare socket functions using socklen_t type.
90 2006-07-02 Christopher Faylor <cgf@timesys.com>
92 * include/cygwin/version.h: Bump DLL minor version number to 21.
94 2006-06-30 Corinna Vinschen <corinna@vinschen.de>
96 * net.cc (cygwin_sendto): Allow zero-sized packets.
97 (cygwin_sendmsg): Ditto.
99 2006-06-26 Corinna Vinschen <corinna@vinschen.de>
101 Revert patches from 2005-10-22 and 2006-06-14 to use event driven
102 accept and connect back to using select:
103 * fhandler.h (class fhandler_socket): Remove accept_mtx.
104 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop
105 initializing accept_mtx.
106 (fhandler_socket::accept): Drop event handling.
107 (fhandler_socket.cc (fhandler_socket::connect): Ditto.
108 (fhandler_socket::dup): Drop accept_mtx handling.
109 (fhandler_socket::listen): Ditto.
110 (fhandler_socket::prepare): Ditto.
111 (fhandler_socket::release): Ditto.
112 (fhandler_socket::close): Ditto.
113 * net.cc (cygwin_accept): Revert to calling cygwin_select to
114 implement interuptible accept.
115 (cygwin_connect): Ditto for connect.
117 2006-06-22 Christopher Faylor <cgf@timesys.com>
119 * fhandler_fifo.cc (fhandler_fifo::open): Release process lock and grab
120 a system-wide mutex to prevent a deadlock and a race.
121 * sync.h (lock_process): Make fhandler_fifo a friend.
123 * smallprint.c (__small_vsprintf): Cosmetic change.
125 2006-06-15 Corinna Vinschen <corinna@vinschen.de>
127 * cygwin.din: Export __srget_r, __swbuf_r.
128 * include/cygwin/version.h: Bump API minor number to 156.
130 2006-06-14 Corinna Vinschen <corinna@vinschen.de>
132 * fhandler.h (class fhandler_socket): Add private mutex handle
134 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
136 (fhandler_socket::dup): Duplicate accept_mtx, if available.
137 (fhandler_socket::listen): Create accept_mtx before trying to listen.
138 (fhandler_socket::prepare): Wait for accept_mtx if available to
139 serialize accepts on the same socket.
140 (fhandler_socket::release): Release accept_mtx.
141 (fhandler_socket::close): Close accept_mtx on successful closesocket.
143 2006-06-12 Christopher Faylor <cgf@timesys.com>
145 * fhandler_tty.cc (fhandler_pty_master::close): Always close
146 from_master/to_master since we always have copies of these handles.
148 2006-06-12 Corinna Vinschen <corinna@vinschen.de>
150 * include/sys/wait.h: Move definition of wait constants from here...
151 * include/cygwin/wait.h: ...to here. New file.
152 * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3.
154 2006-06-12 Pierre Humblet Pierre.Humblet@ieee.org
156 * heap.cc (heap_init): Only commit if allocsize is not zero.
158 2006-06-12 Corinna Vinschen <corinna@vinschen.de>
160 * net.cc (fdsock): Disable raising buffer sizes. Add comment to
163 2006-06-04 Christopher Faylor <cgf@timesys.com>
165 * ioctl.cc (ioctl): Accommodate change in reported pty master device
167 * select.cc (peek_pipe): Ditto.
169 2006-06-04 Christopher Faylor <cgf@timesys.com>
171 * cygtls.h (CYGTLS_PADSIZE): Reset to a size that XP SP1 seems to like.
172 * tlsoffsets.h: Regenerate.
174 2006-06-03 Christopher Faylor <cgf@timesys.com>
176 * cygthread.cc (cygthread::terminate_thread): In debugging output, use
177 name of thread being terminated rather than thread doing the
180 * fhandler.h (fhandler_pty_master::slave): Delete.
181 (fhandler_pty_master::get_unit): Ditto.
182 (fhandler_pty_master::setup): Change argument declaration to
183 accommodate new usage.
184 * fhandler_tty.cc (fhandler_tty_master::init): Remove obsolete slave
185 assignment. Pass argument to setup indicating that this is a tty.
186 (fhandler_tty_slave::open): Use dev() method rather than referencing
188 (fhandler_pty_master::open): Don't create archetype based on ptym
189 device number. Set device number to use DEV_TTYM_MAJOR and tty number.
190 Pass argument to setup indicating that this is a pty.
191 (fhandler_pty_master::setup): Change single argument to a flag
192 indicating whether we're creating a pty and use appropriately.
193 Calculate 't' variable here rather than in caller.
195 * fhandler_dsp.cc (fhandler_dev_dsp::open): Use dev() method rather
196 than referencing pc.dev directly.
198 2006-06-03 Christopher Faylor <cgf@timesys.com>
200 * dcrt0.cc (dll_crt0_0): Call tty_list::init_session here.
201 (dll_crt0_1): Reflect renaming from tty_init to tty::init_session.
202 (do_exit): Reflect moving of tty_terminate into tty_list.
203 * exceptions.cc (events_init): Move tty_mutex stuff elsewhere.
204 * fhandler_console.cc (set_console_title): Use lock_ttys class.
205 * fhandler_termios.cc (fhandler_termios::bg_check): Make debug output
207 * fhandler_tty.cc (fhandler_tty_slave::open): Reflect move of
208 attach_tty into tty_list class. Don't attempt to grab master end of
209 pty if master doesn't exist.
210 (fhandler_pty_master::open): Reflect move of allocate_tty into tty_list
211 class. Use lock_ttys::release to release mutex. Improve debugging
213 (fhandler_pty_master::setup): Remove if 0'ed block. Fix argument to
214 SetNamedPipeHandleState.
215 * pinfo.cc (_pinfo::set_ctty): Lock ttys before setting sid/pgid.
216 Improve debugging. Add temporary debugging.
217 * tty.cc (tty_list::init_session): New function.
218 (tty::init_session): Rename from tty_init. Reflect move of attach_tty
220 (tty::create_master): Rename from create_tty_master.
221 (tty_list::attach): Rename from attach_tty. Reflect renaming of
222 connect_tty to connect. Ditto for allocate_tty.
223 (tty_terminate): Delete.
224 (tty_list::terminate): Subsume tty_terminate. Use lock_ttys rather
225 than manipulating mutex directly.
226 (tty_list::allocate): Rename from allocate_tty. Use lock_ttys rather
227 than manipulating mutex directly. Don't set sid here since linux
228 apparently doesn't do this. Reflect move of create_tty_master into
230 (lock_ttys::lock_ttys): Define new constructor.
231 (lock_ttys::release): New function.
232 * tty.h (tty::exists): Return false immediately if !master_pid.
233 (tty::set_master_closed): Define new function.
234 (tty::create_master): Ditto.
235 (tty::init_session): Ditto.
236 (tty_list::mutex): New field.
237 (tty_list::allocate): Define new function.
238 (tty_list::connect): Ditto.
239 (tty_list::attach): Ditto.
240 (tty_list::init_session): Ditto.
241 (lock_ttys): New class.
242 (tty_init): Delete declaration.
243 (tty_terminate): Ditto.
245 (create_tty_master): Ditto.
247 2006-06-03 Christopher Faylor <cgf@timesys.com>
249 * Makefile.in (libdl.a): New library.
251 2006-06-03 Christopher Faylor <cgf@timesys.com>
253 * fhandler_tty.cc (fhandler_pty_master::close): Don't close handles if
255 (fhandler_pty_master::setup): Make sure that original handle is closed
256 when changing inheritance.
257 (fhandler_pty_master::fixup_after_fork): Set from_master/to_master to
259 (fhandler_pty_master::fixup_after_exec): Clear from_master/to_master
262 2006-06-03 Christopher Faylor <cgf@timesys.com>
264 * cygheap.cc (init_cygheap::close_ctty): Remove obsolete code.
265 * dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've
266 run fixup_after_exec.
267 * dtable.cc (dtable::fixup_after_exec): Add debugging output.
268 * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of
270 (fhandler_tty_common::close): Remove obsolete code.
271 (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done
272 in dtable's fixup_after_exec. (revisit later?)
273 (fhandler_pty_master::fixup_after_exec): Ditto.
275 2006-06-02 Christopher Faylor <cgf@timesys.com>
277 * cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision
279 * tlsoffsets.h: Regenerate.
281 * dcrt0.cc (break_here): Define unconditionally for use elsewhere.
282 Call DebugBreak, if appropriate.
283 (initial_env): Rely on break_here() to call DebugBreak.
284 * exceptions.cc (try_to_debug): Ditto.
286 2006-06-02 Christopher Faylor <cgf@timesys.com>
288 * fhandler.cc (fhandler_base::fixup_after_exec): Declare here.
289 * fhandler.h (fhandler_base::fixup_after_exec): Make non-inline.
290 (fhandler_termios::fixup_after_fork): Delete declaration.
291 (fhandler_termios::fixup_after_exec): Ditto.
292 (fhandler_tty_common::inuse): Remove.
293 (fhandler_tty_common::dup): Delete declaration.
294 (fhandler_tty_common::fixup_after_fork): Ditto.
295 (fhandler_tty_slave::fixup_after_exec): Declare new function.
296 (fhandler_pty_master::dwProcessId): New variable.
297 (fhandler_pty_master::from_master): Ditto.
298 (fhandler_pty_master::to_master): Ditto.
299 (fhandler_pty_master::setup): New function.
300 (fhandler_pty_master::fixup_after_fork): Ditto.
301 (fhandler_pty_master::fixup_after_exec): Ditto.
302 * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Delete
304 (fhandler_termios::fixup_after_fork): Ditto.
305 * fhandler_tty.cc (fhandler_tty_master::init): Use fhandler_pty_master
306 setup function rather than obsolete tty::common_init. Delete obsolete
308 (fhandler_tty_slave::fhandler_tty_slave): Set inuse to NULL here.
309 (fhandler_tty_slave::open): Change debugging output for clarity. Check
310 for different things when doing a sanity check on the tty. Reflect the
311 fact that master_pid now is the cygwin pid rather than the windows pid.
312 Use "arch" rather than "archetype" for consistency.
313 (fhandler_tty_slave::close): Close inuse here.
314 (fhandler_tty_slave::dup): Remove old if 0'ed code.
315 (fhandler_pty_master::dup): New function. Handles pty master
317 (fhandler_pty_master::fhandler_pty_master): Zero pty_master specific
319 (fhandler_pty_master::open): Implement using archetypes, similar to
320 slave. Use fhandler_pty_master setup function rather than obsolete
321 tty::common_init. Don't set inuse.
322 (fhandler_tty_common::close): Don't deal with inuse. Delete old if
324 (fhandler_pty_master::close): Implement using archetypes. Close
325 from_master and to_master.
326 (fhandler_tty_common::set_close_on_exec): Just set close_on_exec flag
327 here since everything uses archetypes now.
328 (fhandler_tty_common::fixup_after_fork): Delete definition.
329 (fhandler_tty_slave::fixup_after_exec): Define new function.
330 (fhandler_pty_master::setup): New function, derived from
332 (fhandler_pty_master::fixup_after_fork): New function.
333 (shared_info.h): Reset SHARED_INFO_CB to reflect new tty size.
334 * tty.cc (tty_list::terminate): Close individual handles from
336 (tty::master_alive): Delete.
337 (tty::make_pipes): Ditto.
338 (tty::common_init): Ditto.
339 * tty.h (tty::from_slave): Delete.
340 (tty::to_slave): Ditto.
341 (tty::common_init): Delete declaration.
342 (tty::make_pipes): Ditto.
343 (tty::master_pid): Define as pid_t since it is now a cygwin pid.
345 2006-06-01 Christopher Faylor <cgf@timesys.com>
347 * cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here.
348 Let the caller do that.
349 * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here
350 to allow fixup_after_exec functions to use it.
352 * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with
354 * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls
355 before seeing if it is initialized.
356 * gendef (_sigfe_maybe): Ditto.
357 * dcrt0.cc (dll_crt0_1): Remove static, use just one argument.
358 * dll_init.cc (dllcrt0_info): New structure.
359 (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that
360 we'll always be assured of having something like a tls.
361 (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0.
362 Unconditionally call _my_tls.init_exception_handler now that we are
363 assured of having a tls. Change variable name from "linking" to "linked".
364 * winsup.h (dll_crt0_1): Declare.
365 (dll_dllcrt0_1): Ditto.
367 2006-05-30 Christopher Faylor <cgf@timesys.com>
369 * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.
371 2006-05-29 Christopher Faylor <cgf@timesys.com>
373 * winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork
376 2006-05-28 Christopher Faylor <cgf@timesys.com>
378 * sigproc.cc (child_info::proc_retry): Mask all of the bits we're
379 interested in, which includes bits above and below 0xc0000000.
381 2006-05-27 Christopher Faylor <cgf@timesys.com>
383 * dll_init.cc (dll_dllcrt0): Previous change didn't work very well with
384 fork. Semi-revert it but change name of variable to something that
387 2006-05-27 Christopher Faylor <cgf@timesys.com>
389 * thread.cc (verifyable_object_isvalid): Check for NULL specifically.
391 2006-05-27 Christopher Faylor <cgf@timesys.com>
393 * dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if
394 we've finished initializing (Thanks to Gary Zablackis for noticing this
395 problem). Just use cygwin_finished_initializing rather than defining a
398 2006-05-25 Christopher Faylor <cgf@timesys.com>
400 * debug.h (ModifyHandle): Define new macro.
401 (modify_handle): Declare new function.
402 * debug.cc (modify_handle): Define new function.
403 * fhandler.h (fhandler_base::fork_fixup): Change return value from void
405 * fhandler.cc (fhandler_base::fork_fixup): Return true if fork fixup has
407 * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance of
408 protected handle via ModifyHandle if DEBUGGING.
409 (fhandler_pipe::fixup_after_fork): Protect guard handle if fork fixup
412 2006-05-24 Christopher Faylor <cgf@timesys.com>
414 * cygtls.cc (_cygtls::call): Call call2 using _my_tls.
415 (_cygtls::init_exception_handler): Always replace existing exception
416 handler with cygwin exception handler.
417 * cygtls.h (_cygtls::call2): Remove static designation.
418 * dcrto.cc (dll_crt0_1): Define in a way that allows calling via
420 (_initialize_main_tls): Delete.
421 (_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here.
422 * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE.
423 * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define.
424 * tlsoffsets.h: Regenerate.
426 2006-05-24 Christopher Faylor <cgf@timesys.com>
428 * configure.in: Update to newer autoconf.
429 (thanks to Steve Ellcey)
430 * configure: Regenerate.
431 * aclocal.m4: New file.
433 2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
435 * fhandler.cc (readv): Remove nonsensical assert.
437 2006-05-23 Christopher Faylor <cgf@timesys.com>
439 * select.cc (start_thread_socket): Delay setting thread local exitsock
440 until we know it's correct. Return correct value on error.
442 2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
443 Christopher Faylor <cgf@timesys.com>
445 * select.cc (start_thread_socket): Clean up exitsock in case of error.
446 Use si->exitcode consistently.
448 2006-05-21 Christopher Faylor <cgf@timesys.com>
450 * child_info.h (_CI_SAW_CTRL_C): New enum.
451 (CURR_CHILD_INFO_MAGIC): Reset.
452 (saw_ctrl_c): New function.
453 (set_saw_ctrl_c): Ditto.
454 * sigproc.cc (child_info::proc_retry): Return EXITCODE_OK if we get
455 STATUS_CONTROL_C_EXIT and we actually saw a CTRL-C.
456 * spawn.cc (dwExeced): Delete.
457 (chExeced): New variable.
458 (spawn_guts): Set chExeced;
459 * exceptions.cc (dwExeced): Delete declaration.
461 (ctrl_c_handler): Detect if we're an exec stub process and set a flag,
464 * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Add
465 extra DEBUGGING test.
467 * pinfo.cc: Fix comment.
469 2006-05-21 Christopher Faylor <cgf@timesys.com>
471 * fhandle.h (fhandler_pipe::create_guard): Revert change which
472 eliminated SECURITY_ATTRIBUTES argument.
473 * pipe.cc (fhandler_pipe::open): Duplicate guard from other process and
474 protect it appropriately. Eliminate unneeded writepipe_exists
475 temporary variable. Set inheritance appropriately.
476 (fhandler_pipe::set_close_on_exec): Revert change which eliminated
477 handling guard inheritance.
478 (fhandler_pipe::fixup_after_fork): Ditto. Use correct name of entity
479 being checked by fork_fixup.
480 (fhandler_pipe::fixup_after_exec): Don't bother with guard here.
481 (fhandler_pipe::dup): Cosmetic changes and revert creation of
482 writepipe_exists as noninheritable.
483 (fhandler_pipe::create): Revert change which eliminated
484 SECURITY_ATTRIBUTES argument. Revert change which always made
485 writepipe_exists noninheritable.
487 2006-05-21 Christopher Faylor <cgf@timesys.com>
489 * debug.cc (add_handle): Print handle value when collision detected.
490 * dtable.cc (dtable::stdio_init): Cosmetic change.
491 * fhandler.h (fhandler_base::create_read_state): Protect handle.
492 (fhandler_pipe::create_guard): Ditto. Always mark the handle as
494 (fhandler_pipe::is_slow): Return boolean value rather than numeric 1.
495 * pipe.cc (fhandler_pipe::fhandler_pipe): Always flag that we need fork
497 (fhandler_pipe::open): Don't pass security attributes to create_guard.
498 (fhandler_pipe::set_close_on_exec): Don't handle guard here.
499 (fhandler_pipe::close): Accommodate now-protected guard handle.
500 (fhandler_pipe::fixup_in_child): Don't protect read_state here.
501 (fhandler_pipe::fixup_after_exec): Close guard handle if close_on_exec.
502 (fhandler_pipe::fixup_after_fork): Don't bother with guard here.
503 (fhandler_pipe::dup): Don't set res to non-error prematurely. Use
504 boolean values where appropriate. Protect guard and read_state.
505 (fhandler_pipe::create): Don't call need_fork_fixup since it is now the
506 default. Don't protect read_state or guard.
508 * pipe.cc (fhandler_base::ready_for_read): Use bool values for "avail".
510 * spawn.cc (spawn_guts): Set cygheap->pid_handle as inheritable when
513 2006-05-15 Lev Bishop <lev.bishop+cygwin@gmail.com>
514 Christopher Faylor <cgf@timesys.com>
516 * select.cc (fhandler_pipe::ready_for_read): Actually get the guard
517 mutex for blocking reads.
519 2006-05-20 Christopher Faylor <cgf@timesys.com>
521 * fhandler_tty.cc (fhandler_tty::close): Remove problematic hExeced guard.
523 2006-05-20 Christopher Faylor <cgf@timesys.com>
525 * fhandler_tty.cc (fhandler_tty_slave::open): Reinstate call to
526 need_invisible on first pty open.
528 2006-05-18 Christopher Faylor <cgf@timesys.com>
530 * fhandler_console.cc (fhandler_console::need_invisible): Allocate an
531 invisible window station when ctty != TTY_CONSOLE.
533 2006-05-16 Christopher Faylor <cgf@timesys.com>
535 * cygtls.cc (_cygtls::remove): Don't test for initialization since
536 this function will always be called when _my_tls is initialized.
537 * init.cc (dll_entry): Don't attempt to remove tls info if _my_tls is
538 obviously not even available.
540 2006-05-15 Christopher Faylor <cgf@timesys.com>
542 * sigproc.cc (no_signals_available): Detect hwait_sig ==
543 INVALID_HANDLE_VALUE.
544 (wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT.
546 2006-05-15 Christopher Faylor <cgf@timesys.com>
548 * cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and
550 * cygtls.h (_my_tls::padding): Delete.
551 (CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the
553 * dcrt0.cc (initialize_main_tls): Change return to void.
554 * gentls_offsets: Treat const specially, too. Keep going after a '}'
555 is found. Change negative offset calculation to use CYGTLS_PADSIZE.
556 * init.cc (_my_oldfunc): New variable.
557 (threadfunc_fe): Use stored tls value for oldfunc rather than blindly
558 writing to the stack.
559 (munge_threadfunc): Set oldfunc in tls.
560 (dll_entry): Initialize tls allocation.
561 * tlsoffsets.h: Regenerate.
563 2006-05-13 Christopher Faylor <cgf@timesys.com>
565 * ntdll.h (STATUS_INVALID_INFO_CLASS): Conditionalize.
567 2006-05-10 Brian Dessent <brian@dessent.net>
569 * Makefile.in (clean): Also delete *.dbg.
571 2006-05-08 Christian Franke <Christian.Franke@t-online.de>
573 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix typo which
574 caused test for ".." to be skipped.
576 2006-05-02 Christopher Faylor <cgf@timesys.com>
578 * external.cc (cygwin_internal): Set errno on failure.
580 2006-04-27 Corinna Vinschen <corinna@vinschen.de>
582 * pipe.cc (DEFAULT_PIPEBUFSIZE): Raise to 64K.
584 2006-04-26 Corinna Vinschen <corinna@vinschen.de>
586 * fhandler.h (fhandler_base): Change fstat_helper prototype
587 to take file size and inode number as 64 bit values.
588 * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc
589 (FS_IS_SAMBA_WITH_QUOTA): Ditto.
590 (path_conv::hasgood_inode): Delete.
591 (path_conv::is_samba): Delete.
592 (path_conv::isgood_inode): Centralized function to recognize
594 (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size.
595 Accomodate argument change in fstat_helper.
596 (fhandler_base::fstat_by_name): Ditto.
597 (fhandler_base::fstat_helper): Accomodate argument change. Call
598 path_conv::isgood_inode to recognize good inodes.
599 (fhandler_disk_file::opendir): Explain Samba weirdness here.
600 Call path_conv::fs_is_samba instead of path_conv::is_samba.
601 (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS
602 as valid return code from NtQueryDirectoryFile to indicate that
603 FileIdBothDirectoryInformation is not supported.
604 Call path_conv::isgood_inode to recognize good inodes.
605 * ntdll.h (STATUS_INVALID_INFO_CLASS): Define.
606 * path.cc (fs_info::update): Rework file system recognition
607 and set appropriate flags.
608 * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags.
609 Constify pure read accessors.
611 2006-04-24 Christopher Faylor <cgf@timesys.com>
613 * environ.cc (getearly): Force correct dereference order when
614 inspecting environ table.
616 2006-04-24 Corinna Vinschen <corinna@vinschen.de>
618 * select.cc (thread_pipe): Raise sleep time only every 8th iteration.
619 (thread_mailslot): Ditto.
621 2006-04-23 Corinna Vinschen <corinna@vinschen.de>
622 Christopher Faylor <cgf@timesys.com>
624 * select.cc (thread_pipe): Raise sleep time dynamically to speed up
625 select on pipes when copying lots of data.
626 (thread_mailslot): Ditto for mailslots.
628 2006-04-22 Christopher Faylor <cgf@timesys.com>
630 * signal.cc (abort): On second thought, just set incyg once.
632 2006-04-22 Christopher Faylor <cgf@timesys.com>
634 * signal.cc (abort): Set incyg manually to help get a reliable gdb
636 * cygwin.din (abort): Make NOSIGFE.
638 2006-04-21 Pierre Humblet Pierre.Humblet@ieee.org
639 Christopher Faylor <cgf@timesys.com>
641 * environ.cc (getearly): Use GetEnvironmentVariable and cmalloc instead
642 of GetEnvironmentStrings.
643 (environ_init): Revert rawenv stuff.
645 2006-04-21 Christopher Faylor <cgf@timesys.com>
647 * environ.cc (rawenv): Make this variable a file-scope static.
648 (getearly): Rename 's' variable to 'len' since 's' is used fairly
649 consistently throughout cygwin as a string variable. Remove rawenv
650 declaration. Perform other minor cleanups.
651 (environ_init): Remove rawenv declaration. Only set rawenv to
652 GetEnvironmentStrings() if it has not already been set. Properly free
655 2006-04-21 Christopher Faylor <cgf@timesys.com>
657 * tty.h (tty::hwnd): Move to tty_min.
658 (tty::gethwnd): Ditto.
659 (tty::sethwnd): Ditto.
660 (tty_min::hwnd): Receive variable from tty class.
661 (tty_min::gethwnd): Receive function from tty classs.
662 (tty_min::sethwnd): Ditto.
663 * dtable.cc (dtable::stdio_init): Only call init_console_handler when
664 we actually own the console.
665 * fhandler_console.cc (fhandler_console::get_tty_stuff): Set tty's hwnd
667 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Semi-reinstate
668 handling of console when pgrp is set.
670 2006-04-21 Pierre Humblet <Pierre.Humblet@ieee.org>
671 Corinna Vinschen <corinna@vinschen.de>
673 * environ.cc (getearly): New function.
674 (findenv_func): New function pointer, predefined to getearly.
675 (getenv): Call findenv function over the findenv_func pointer.
676 (environ_init): Change findenv_func pointer to my_findenv after Cygwin
677 environment is initialized.
679 2006-04-21 Lars Munch <lars@segv.dk>
681 * include/asm/byteorder.h (__ntohl): Fix the missing uint32_t.
683 2006-04-21 Corinna Vinschen <corinna@vinschen.de>
685 * fhandler_socket.cc (fhandler_socket::wait): Reorder setting
686 WSAError to avoid spurious errors with WSAError set to 0.
688 2006-04-21 Corinna Vinschen <corinna@vinschen.de>
690 * include/asm/byteorder.h: Include stdint.h. Per standard, change
691 datatypes in ntohX and htonX functions to uintXX_t types.
693 2006-04-18 Christopher Faylor <cgf@timesys.com>
695 * exceptions.cc (ctrl_c_handler): Only exit TRUE on CTRL_LOGOFF_EVENT
696 when we have actually handled the event.
698 2006-04-17 Eric Blake <ebb9@byu.net>
700 * mktemp.cc (_gettemp): Open temp files in binary mode.
702 2006-04-14 Corinna Vinschen <corinna@vinschen.de>
704 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use UINT32_MAX
707 2006-04-14 Corinna Vinschen <corinna@vinschen.de>
709 * fhandler_disk_file.cc (path_conv::hasgood_inode): Make inline.
710 Drop remote fs handling entirely since unreliable inode numbers
711 are now recognized differently.
712 (path_conv::is_samba): Make inline.
713 (fhandler_disk_file::opendir): Reformat comment.
714 (fhandler_base::fstat_helper): Special case remote file systems
715 returning (unreliable) 32 bit inode numbers.
716 (fhandler_disk_file::readdir): Ditto.
717 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto.
719 2006-04-13 Christopher Faylor <cgf@timesys.com>
721 * spawn.cc (spawn_guts): Move ch.set() call back to where it was
724 2006-04-13 Corinna Vinschen <corinna@vinschen.de>
726 * sysconf.cc (sysconf): Add _SC_THREADS, _SC_THREAD_ATTR_STACKSIZE,
727 _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PROCESS_SHARED,
728 _SC_THREAD_SAFE_FUNCTIONS, _SC_TIMERS handling.
730 2006-04-12 Corinna Vinschen <corinna@vinschen.de>
731 Christopher Faylor <cgf@timesys.com>
733 * spawn.cc (spawn_guts): Revert patch which treated derived cygwin
734 programs differently from those which are mounted with -X. Pass extra
735 argument to linebuf::fromargv.
736 * winf.h (MAXCYGWINCMDLEN): New define.
737 (linebuf::finish): Add a new argument denoting when command line
739 (linebuf::fromargv): Ditto.
740 * winf.cc (linebuf::finish): Implement above change.
741 (linebuf::fromargv): Ditto.
743 2006-04-11 Christopher Faylor <cgf@timesys.com>
745 * Makefile.in (DLL_OFILES): Add winf.o.
746 * spawn.cc: Move command line handling stuff into winf.cc.
750 2006-04-05 Christopher Faylor <cgf@timesys.com>
752 * fhandler_socket.cc: Move iptypes.h include after winsock2 since it
756 2006-04-05 Christopher Faylor <cgf@timesys.com>
758 * dcrt0.cc (dll_crt0_0): Move user_data->{resourcelocks,threadinterface}
759 initialization here from dll_crt0_1.
760 (dll_crt0_1): See above.
762 2006-04-04 Corinna Vinschen <corinna@vinschen.de>
764 * net.cc (fdsock): Raise default SO_RCVBUF/SO_SNDBUF buffer sizes to
765 the same values as on Linux.
767 2006-04-03 Christopher Faylor <cgf@timesys.com>
769 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
770 (child_info_fork::alloc_stack): Move into this class.
771 (child_info_fork::alloc_stack_hard_way): Ditto.
772 * dcrt0.cc (child_info_fork::alloc_stack): Ditto.
773 (child_info_fork::alloc_stack_hard_way): Ditto.
774 (_dll_crt0): Reference alloc_stack via fork_info.
776 2006-04-03 Corinna Vinschen <corinna@vinschen.de>
778 * spawn.cc (linebuf::finish): Drop argument. Don't check command line
780 (spawn_guts): Remove wascygexec. Check real_path.iscygexec instead.
781 Accommodate change to linebuf::finish.
783 2006-04-03 Christopher Faylor <cgf@timesys.com>
785 * dcrt0.cc (sm): Delete.
786 (alloc_stack_hard_way): Figure out where the stack lives here rather
787 than relying on previously filled out information which has been
788 invalid since 1.5.19.
790 2006-03-31 Corinna Vinschen <corinna@vinschen.de>
792 * fhandler_disk_file.cc (FS_IS_SAMBA_WITH_QUOTA): New define.
793 (path_conv::hasgood_inode): Recognize Samba with quota support
795 (path_conv::is_samba): Ditto. Fix comment to include Samba version
796 numbers for later reference.
798 2006-03-30 Corinna Vinschen <corinna@vinschen.de>
800 * security.h (sec_user_nih): Make sid1 argument mandatory.
803 2006-03-29 Christopher Faylor <cgf@timesys.com>
805 * sigproc.cc (wait_for_sigthread): Use the current user sid when
806 setting up the signal pipe rather than relying on (eventually) the
809 2006-03-29 Christopher Faylor <cgf@timesys.com>
811 * dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so
812 that it can be used by subsequent startup functions.
813 (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING.
814 (dll_crt0_1): Move user_data->{resourcelocks,threadinterface}
815 initialization here from dll_crt0_0.
816 * fork.cc (frok::child): Tell wait_for_sigthread that this is fork.
817 (frok::parent): Only initialize start_time once. Tighten time when
818 we're "deimpersonated".
819 * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff.
820 Add debugging output.
821 (wait_for_sigthread): Accept an argument which illustrates whether we
823 (wait_sig): Avoid using myself pointer.
824 * winsup.h ((wait_for_sigthread): Reflect change to argument.
826 2006-03-26 Christopher Faylor <cgf@timesys.com>
828 * spawn.cc (spawn_guts): Close handles if we know that we will not be
829 seeing a sync event from the child.
831 2006-03-26 Christopher Faylor <cgf@timesys.com>
833 * sigproc.cc (wait_sig): Move myself manipulation...
834 (wait_for_sigthread): ...to here.
836 2006-03-24 Corinna Vinschen <corinna@vinschen.de>
838 * fhandler_floppy.cc: Include ntdef.h and ntdll.h.
839 (fhandler_dev_floppy::get_drive_info): Rearrange so that now
840 NtQueryVolumeInformationFile is called on drives which don't support
841 IOCTL_DISK_GET_DRIVE_GEOMETRY.
842 * ntdll.h (struct _FILE_FS_SIZE_INFORMATION): Add.
843 (enum _FSINFOCLASS): Add missing values.
845 2006-03-23 Christopher Faylor <cgf@timesys.com>
847 * fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Make
848 error message more explicit.
849 * pinfo.cc (_pinfo::commune_request): Don't lock process unless we're
852 2006-03-23 Christopher Faylor <cgf@timesys.com>
854 * dcrt0.cc (child_info_spawn::handle_spawn): Don't initialize the
855 console handler here.
856 * dtable.cc (dtable::stdio_init): Initialize console handler here.
858 2006-03-23 Christopher Faylor <cgf@timesys.com>
860 * sigproc.cc (sigalloc): Don't set SA_RESTART here.
861 * signal.cc (_SA_NORESTART): New flag.
862 (sigaction_worker): New function, derived from sigaction. Don't set
863 internal flags unless called internally.
864 (sigaction): Use sigaction_worker.
865 (signal): Honor new _SA_NORESTART flag.
866 (siginterrupt): Set _SA_NORESTART flag appropriately. Use
867 sigaction_worker to set flags.
868 * include/cygwin/signal.h: Define _SA_INTERNAL_MASK here.
870 2006-03-22 Corinna Vinschen <corinna@vinschen.de>
872 * thread.cc (pthread_mutex::is_good_initializer_or_bad_object): Delete.
873 (pthread_cond::is_good_initializer_or_bad_object): Delete.
874 (pthread_rwlock::is_good_initializer_or_bad_object): Delete.
875 (pthread_cond::init): Remove disabled code. Guard assignment to
876 object to initialize against access violation.
877 (pthread_rwlock::init): Ditto.
878 (pthread_mutex::init): Ditto.
880 2006-03-22 Eric Blake <ebb9@byu.net>
882 * fhandler.cc (fcntl): Print flags in hex.
884 2006-03-22 Christopher Faylor <cgf@timesys.com>
886 * dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved
887 pinfo_init and uinfo_init here.
889 (__dll_crt0): Ditto. Don't call update_envptrs here.
890 (dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0.
891 * environ.cc (environ_init): Call it here instead.
892 * sigproc.cc (my_readsig): New static variable.
893 (wait_for_sigthread): Set up read pipe here since we are assured that
894 we have the proper privileges when this is called.
895 (talktome): Eliminate second argument since it is available as a global
897 (wait_sig): Reflect use of my_readsig.
899 2006-03-22 Corinna Vinschen <corinna@vinschen.de>
901 * thread.cc (pthread_cond::init): Disable validity test of object
902 to initialize since test of uninitialized content is unreliable.
903 (pthread_rwlock::init): Ditto.
904 (pthread_mutex::init): Ditto.
906 2006-03-21 Christopher Faylor <cgf@timesys.com>
908 * signal.cc (signal): Don't set SA_RESTART here.
909 (siginterrupt): White space.
910 * sigproc.cc (sigalloc): Set SA_RESTART here, on initialization.
912 2006-03-21 Christopher Faylor <cgf@timesys.com>
914 * child_info.h (child_status): Fix typo which made it impossible to set
916 (child_info::isstraced): Booleanize.
917 (child_info::iscygwin): Ditto.
918 * sigproc.cc (child_info::child_info): Minor cleanup of flag setting.
919 * spawn.cc (spawn_guts): Only close_all_files when we know the process
920 has started successfully.
922 * exceptions.cc (init_console_handler): Fix indentation.
924 2006-03-20 Christopher Faylor <cgf@timesys.com>
926 * dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier.
927 * pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure.
928 Return previous pipe handle.
929 * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value.
930 * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if
931 process exits before synchronization.
933 2006-03-20 Christopher Faylor <cgf@timesys.com>
935 * child_info.h (child_status): New enum.
936 (child_info::flag): Rename from 'straced'.
937 (child_info::isstraced): New function.
938 (child_info::iscygwin): Ditto.
939 (child_info_fork::handle_fork): Reparmize.
940 (child_info_fork::handle_failure): Ditto.
941 (child_info_spawn::handle_spawn): New function.
942 * dcrt0.cc (get_cygwin_startup_info): Use isstraced method.
943 (child_info_spawn::handle_spawn): Define new function from code
944 previously in dll_crt0_0.
945 (dll_crt0_0): Move spawn stuff into handle_spawn. Only call
946 init_console_handler for fork case.
947 * sigproc.cc (child_info::child_info): Set flag appropriately.
948 (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin
950 * spawn.cc (spawn_guts): Remove commented out flag setting.
952 2006-03-19 Christopher Faylor <cgf@timesys.com>
954 * pinfo.cc (commune_process): Fix randomly invalid pointer which caused
955 fifos to work incorrectly.
957 2006-03-19 Christopher Faylor <cgf@timesys.com>
959 * dcrt0.cc (dll_crt0_0): Oops. We need to bother with setting
960 init_console_handler in the fork/exec case.
962 2006-03-19 Christopher Faylor <cgf@timesys.com>
964 * dcrt0.cc (dll_crt0_0): Don't bother with setting init_console_handler
965 here since it will be set later when we discover if we have a ctty or
967 * exceptions.cc (init_console_handler): Properly remove NULL handler.
969 2006-03-18 Christopher Faylor <cgf@timesys.com>
971 * pinfo.h (EXITCODE_OK): Define new constant.
972 * sigproc.cc (child_info::sync): Return EXITCODE_OK if entering with
974 (sig_send): Don't complain if sending signals while blocked if the
975 sender isn't in the main thread.
977 2006-03-18 Christopher Faylor <cgf@timesys.com>
979 * child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate.
980 (child_info::retry): Move here from fork subclass.
981 (child_info::exit_code): New field.
982 (child_info::retry_count): Max retry count for process start.
983 (child_info::proc_retry): Declare new function.
984 (child_info_fork::retry): Move to parent.
985 (child_info_fork::fork_retry): Ditto.
986 * dcrt0.cc (child_info::fork_retry): Rename and move.
987 (child_info_fork::handle_failure): Move.
988 (dll_crt0_0): Initialize console handler based on whether we have a
989 controlling tty or not. Avoid nonsensical check for fork where it can
991 * environ.cc (set_proc_retry): Rename from set_fork_retry. Set
992 retry_count in child_info.
993 (parse_thing): Reflect above change.
994 * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name.
995 (ctrl_c_handler): Always return TRUE for the annoying
997 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to
998 init_console_handler.
999 * fhandler_tty.cc (fhandler_tty_slave::open): Just call
1000 mange_console_count here and let it decide what to do with initializing
1001 console control handling.
1002 * fork.cc (fork_retry): Remove definition.
1003 (frok::parent): Define static errbuf and use in error messages (not
1004 thread safe yet). Close pi.hThread as soon as possible. Protect
1005 pi.hProcess as soon as possible. Don't set retry_count. That happens
1006 automatically in the constructor now. Accommodate name change from
1007 fork_retry to proc_retry.
1008 * init.cc (dll_entry): Turn off ctrl-c handling early until we know how
1009 it is supposed to be handled.
1010 * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value
1011 for failure error message. Tweak debug message slightly.
1012 * sigproc.cc (child_info::retry_count): Define.
1013 (child_info::child_info): Initialize retry count.
1014 (child_info::sync): Set exit code if process dies before
1016 (child_info::proc_retry): Rename from child_info_fork::fork_retry. Use
1017 previously derived exit code. Be more defensive about what is
1018 classified as an error exit.
1019 (child_info_fork::handle_failure): Move here from dcrt0.cc.
1020 * spawn.cc (spawn_guts): Maintain error mode when starting new process
1021 to avoid annoying pop ups. Move deimpersonate call within new loop.
1022 Move envblock freeing to end. Loop if process dies prematurely with
1024 * syscalls.cc (setpgid): Remove hopefully unneeded call to
1025 init_console_handler.
1027 2006-03-15 Christopher Faylor <cgf@timesys.com>
1029 * cygheap.cc (init_cygheap::manage_console_count): Turn console control
1030 handler on/off depending on whether we have allocated a console or not.
1031 * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry
1033 (dll_crt0_0): Turn on/off console control depending on whether we have
1034 a controlling tty or not.
1035 * exceptions.cc (init_console_handler): Change BOOL to bool.
1036 * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic
1038 * winsup.h (init_console_handler): Reflect argument type change.
1040 * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate
1041 capability throughout.
1044 2006-03-14 Christopher Faylor <cgf@timesys.com>
1046 * child_info.h (child_info_fork::fork_retry): Declare new function.
1047 * dcrt0.cc (child_info_fork::fork_retry): Define new function.
1048 * fork.cc (frok::parent): Move retry decision into
1049 child_info_fork::fork_retry and honor what it tells us to do.
1050 * sigproc.cc (sig_send): Unhold signals on __SIGEXIT.
1052 2006-03-14 Christopher Faylor <cgf@timesys.com>
1054 * fork.cc (frok::parent): Improve error message.
1056 2006-03-14 Christopher Faylor <cgf@timesys.com>
1058 * dcrt0.cc (main_environ): Initialize to &__cygwin_environment.
1059 (dll_crt0_1): Move resourcelocks, thread interface, pinfo_init, and
1061 (dll_crt0_0): ...to here.
1062 (_dll_crt0): Call update_envptrs here after setting main_environ.
1063 * environ.cc (environ_init): Eliminate initted variable. Don't call
1064 update_envptrs here.
1065 * sigproc.cc (wait_sig): Use my_sendsig when calling CreatePipe to
1066 avoid a dereference.
1068 2006-03-13 Christopher Faylor <cgf@timesys.com>
1070 * child_info.h (child_info_fork::handle_failure): Declare new function.
1071 (child_info_fork::retry): New field.
1072 * dcrt0.cc (__api_fatal_exit_val): Define.
1073 (child_info_fork::handle_failure): Define new function.
1074 (__api_fatal): Exit using __api_fatal_exit_val value.
1075 * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN
1076 environment variable.
1077 (parse_thing): Add "fork_retry" setting.
1078 * fork.cc (fork_retry): Define.
1079 (frok::parent): Reorganize to allow retry of failed child creation if
1080 child signalled that it was ok to do so.
1081 * heap.cc (heap_init): Signal parent via handle_failure when
1083 * pinfo.h (EXITCODE_RETRY): Declare.
1084 * sigproc.cc (child_info::sync): Properly exit with failure condition
1085 if called for fork and didn't see subproc_ready.
1086 * spawn.cc (spawn_guts): Use windows pid as first argument.
1087 * winsup.h: Remove obsolete NEW_MACRO_VARARGS define.
1088 (__api_fatal_exit_val): Declare.
1089 (set_api_fatal_return): Define.
1090 (in_dllentry): Declare.
1091 * exceptions.cc (inside_kernel): Remove unneeded in_dllentry
1094 2006-03-13 Christopher Faylor <cgf@timesys.com>
1096 * dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a
1097 little later. Add a comment.
1098 * fork.cc (resume_child): Make void.
1099 (frok::parent): Only zero pi when necessary. Explicitly zero si. Set
1100 this_errno when child_copy fails. Accommodate change to resume_child.
1101 * sigproc.cc (sigalloc): Move global_sigs initialization here.
1102 (sigproc_init): Move global_sigs.
1103 (sig_send): Just check for flush signals once.
1105 * wincap.h: Define supports_setconsolectrlhandler_null throughout.
1108 2006-03-13 Corinna Vinschen <corinna@vinschen.de>
1110 * autoload.cc (LoadDLLfuncNt): New define to wrap NT native functions.
1111 Use for NT native functions throughout.
1112 * dtable.cc (handle_to_fn): Treat return value of NtQueryObject as
1115 2006-03-12 Christopher Faylor <cgf@timesys.com>
1117 * cygtls.cc (_cygtls::remove): Reset initialized flag right away if we
1118 were previously initialized.
1119 * cygtls.h (_cygtls::initialized): Move nearer to the end to catch
1120 situation when Windows 98 mysteriously changes parts of _my_tls when
1121 thread is detaching.
1122 * gendef (__sigfe_maybe): Simplify slightly.
1123 * tlsoffsets.h: Regenerate.
1125 2006-03-12 Christopher Faylor <cgf@timesys.com>
1127 * cygtls.h (CYGTLS_INITIALIZED): Change to a little more unlikely value.
1128 (CYGTLSMAGIC): Delete.
1129 * dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup.
1130 (_dll_crt0): Don't worry about sync_startup. Just wait for sigthread here.
1131 * dll_init.cc (cygwin_detach_dll): Only pick up tls version of retaddr
1132 if we have a valid tls.
1133 * fork.cc (frok::child): Remove sigproc_init initialization since it
1134 happens much earlier now.
1135 * gendef: Recognize SIGFE_MAYBE.
1136 (fefunc): Generate calls to _sigfe_maybe, if appropriate.
1137 (_sigfe_maybe): New function.
1138 * init.cc (search_for): Always initialize search_for, even on fork.
1139 (calibration_thread): Delete.
1140 (calibration_id): Delete.
1141 (prime_threads): Delete.
1142 (munge_threadfunc): Remove calibration_thread special case. Avoid
1143 calling thread function if we haven't yet hit the "search_for" thread.
1144 (dll_entry): Remove prime_threads call. Only call munge_threadfunc
1145 when hwait_sig is active. Ditto. for _my_tls.remove ();
1146 * sigproc.cc (hwait_sig): Make global.
1147 (sigproc_init): Don't bother with sync_startup.
1148 (sig_send): Treat flush as a no-op when signals are held.
1149 (wait_sig): Cause signals to be held after fork.
1151 2006-03-09 Corinna Vinschen <corinna@vinschen.de>
1153 * syscalls.cc (rename): Move existance check for oldpath further up
1154 to the start of the function. Avoid another case of a name collision
1155 if oldpath is a shortcut and a file or directory newpath already exists.
1157 2006-03-09 Corinna Vinschen <corinna@vinschen.de>
1159 * autoload.cc (NtClose): Define.
1160 (NtOpenDirectoryObject): Define.
1161 (NtQueryDirectoryObject): Define.
1162 * fhandler_proc.cc: Include ctype.h and wchar.h.
1163 (format_proc_partitions): Revamp loop over existing harddisks by
1164 scanning the NT native \Device object directory and looking for
1166 * ntdll.h: Rearrange system call declarations alphabetically.
1167 (DIRECTORY_QUERY): Define.
1168 (struct _DIRECTORY_BASIC_INFORMATION): Define.
1169 (NtOpenDirectoryObject): Declare.
1170 (NtQueryDirectoryObject): Declare.
1172 2006-03-08 Christopher Faylor <cgf@timesys.com>
1174 * cygtls.h (_cygtls::retaddr): New method.
1175 * dll_init.cc (cygwin_detach_dll): Use new tls method to find return
1176 address since this function is now signal guarded.
1177 (update_envptrs): Remove unneeded braces.
1178 * syscalls.cc (statvfs): Coerce full_path to avoid a gcc warning.
1180 2006-03-08 Corinna Vinschen <corinna@vinschen.de>
1182 * syscalls.cc (statvfs): Simplify path name expression.
1184 2006-03-08 Corinna Vinschen <corinna@vinschen.de>
1186 * syscalls.cc: Include winioctl.h.
1187 (statvfs): Request correct volume size using DeviceIoControl if
1188 quotas are enforced on the file system.
1190 2006-03-03 Corinna Vinschen <corinna@vinschen.de>
1192 * dir.cc (opendir): Fix indentation.
1193 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Move storing
1194 fhandler in file descriptor table to some point very late in function
1195 to avoid double free'ing. Add comment to explain what happens.
1196 Add label free_mounts and don't forget to delete __DIR_mounts structure
1197 if NtOpenFile fails.
1199 2006-03-02 Corinna Vinschen <corinna@vinschen.de>
1201 * syscalls.cc (chroot): Disallow chroot into special directories.
1202 Return EPERM instead.
1204 2006-03-02 Corinna Vinschen <corinna@vinschen.de>
1206 * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
1207 cygdrive string length for those who have cygdrive mapped to "/".
1209 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1211 * sec_helper.cc (set_cygwin_privileges): Request SE_BACKUP_NAME
1214 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1216 * fhandler_proc.cc (fhandler_proc::fstat): Always return fixed link
1217 count of 1 for /proc directory instead of incorrect PROC_LINK_COUNT.
1219 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1221 * fhandler.h (enum dirent_states): Remove dirent_saw_cygdrive,
1222 dirent_saw_dev and dirent_saw_proc.
1223 (fhandler_cygdrive::open): Declare.
1224 (fhandler_cygdrive::close): Declare.
1225 * fhandler_disk_file.cc (class __DIR_mounts): Move to beginning of file.
1226 (__DIR_mounts::check_mount): New parameter to indicate if inode number
1227 is needed in calling function or not. Add /proc and /cygdrive handling.
1228 (__DIR_mounts::check_missing_mount): Ditto.
1229 (path_conv::ndisk_links): Use __DIR_mounts class to create correct
1230 hardlink count for directories with mount points in them.
1231 (fhandler_disk_file::readdir_helper): Remove /dev, /proc and /cygdrive
1233 (fhandler_cygdrive::open): New method.
1234 (fhandler_cygdrive::close): New method.
1235 (fhandler_cygdrive::fstat): Always return fixed inode number 2 and
1236 fixed link count of 1. Drop call to set_drives.
1237 (fhandler_cygdrive::opendir): Drop call to get_namehash.
1238 (fhandler_cygdrive::readdir): Handle "." entry to return fixed inode
1241 2006-03-01 Christopher Faylor <cgf@timesys.com>
1243 * cygwin.din: Fix some erroneous SIGFE/NOSIGFE settings.
1245 2006-03-01 Christopher Faylor <cgf@timesys.com>
1247 * cygthread.cc (cygthread::callfunc): Revert below change. Make ev a
1248 manual reset event again. so that it will be reset by WaitFor*Object
1250 (cygthread::stub): Ditto.
1251 (cygthread::terminate_thread): Reset ev if it was found to have been
1254 2006-03-01 Christopher Faylor <cgf@timesys.com>
1256 * analyze_sigfe: New script.
1257 * dllfixdbg: Add copyright.
1259 * gendevices: Ditto.
1260 * gentls_offsets: Ditto.
1262 2006-03-01 Christopher Faylor <cgf@timesys.com>
1264 * cygthread.cc (cygthread::callfunc): Create ev as an auto-reset event
1265 so that it will be reset by WaitFor*Object as appropriate.
1266 (cygthread::stub): Ditto.
1267 (cygthread::terminate_thread): Remove forced setting of thread
1270 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1272 * include/sys/dirent.h (struct __DIR): Rename __d_unused to
1274 * fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef".
1275 (d_dirname): Remove useless "struct".
1276 (d_cachepos): Ditto.
1278 (class __DIR_mounts): New class, implementing mount point tracking
1280 (d_mounts): New macro for easy access to __DIR_mounts structure.
1281 (fhandler_disk_file::opendir): Allocate __DIR_mounts structure and
1282 let __d_internal element of dir point to it.
1283 (fhandler_disk_file::readdir_helper): Add mount points in the current
1284 directory, which don't have a real directory backing them.
1285 Don't generate an inode number for /dev. Add comment, why.
1286 (fhandler_disk_file::readdir): Move filling fname to an earlier point.
1287 Check if current entry is a mount point and evaluate correct inode
1289 (fhandler_disk_file::readdir_9x): Ditto.
1290 (fhandler_disk_file::rewinddir): Set all mount points in this directory
1291 to "not found" so that they are listed again after calling rewinddir().
1292 (fhandler_disk_file::closedir): Deallocate __DIR_mounts structure.
1293 * path.cc (mount_info::get_mounts_here): New method to evaluate a list
1294 of mount points in a given parent directory.
1295 * shared_info.h (class mount_info): Declare get_mounts_here.
1297 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1299 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use iscygdrive
1300 instead of isspecial.
1301 * path.h (path_conv::iscygdrive): New method.
1303 2006-02-28 Christopher Faylor <cgf@timesys.com>
1305 * exceptions.cc (_cygtls::interrupt_now): Remove "inside cygwin" check
1306 since some cygwin functions are meant to be interrupted.
1308 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1310 * cygwin.din: Export __isinff, __isinfd, __isnanf, __isnand.
1311 * include/cygwin/version.h: Bump API minor number to 155.
1313 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1315 * dir.cc (readdir_worker): Use slash as path separator when evaluating
1316 namehash for paths below /proc.
1317 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Use expensive
1318 inode number evaluation on share names.
1320 2006-02-27 Christopher Faylor <cgf@timesys.com>
1322 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
1323 d_cachepos under NT or suffer memory corruption.
1324 (fhandler_disk_file::readdir_helper): Avoid else with a return. Just
1325 calculate extension location once when doing symlink checks.
1326 (fhandler_disk_file::readdir): Make debug output more useful.
1327 (fhandler_disk_file::readdir_9x): Ditto. Eliminate redundant variable.
1329 2006-02-27 Christopher Faylor <cgf@timesys.com>
1331 * include/sys/termios.h (cfsetispeed): Just define as a function rather
1332 than resorting to a macro.
1333 (cfsetospeed): Ditto.
1335 2006-02-27 Christopher Faylor <cgf@timesys.com>
1337 * sigproc.cc: Fix a comment.
1339 2006-02-27 Christopher Faylor <cgf@timesys.com>
1341 * cygthread.cc (cygthread::release): Add a comment.
1343 2006-02-27 Corinna Vinschen <corinna@vinschen.de>
1345 * fhandler_netdrive.cc (fhandler_netdrive::fstat): Create unambiguous
1347 (fhandler_netdrive::readdir): Ditto.
1349 2006-02-24 Christopher Faylor <cgf@timesys.com>
1351 * sigproc.cc (sigheld): Define new variable.
1352 (sig_dispatch_pending): Don't check sigq since that's racy.
1353 (sig_send): Set sigheld flag if __SIGHOLD is specified, reset it if
1354 __SIGNOHOLD is specified. Ignore flush signals if we're holding
1357 2006-02-23 Christopher Faylor <cgf@timesys.com>
1359 * cygwin.din (_exit): Use signal front end.
1362 2006-02-23 Christopher Faylor <cgf@timesys.com>
1364 * winsup.h (cygwin_hmodule): Declare.
1365 * exceptions.cc (inside_kernel): Reverse return values to reflect
1366 function name. Return true if we're in cygwin1.dll or if we're
1367 executing in dll_entry.
1368 (_cygtls::interrupt_now): Reflect reversal of inside_kernel return
1370 * hookapi.cc (cygwin_hmodule): Remove declaration.
1371 * init.cc (dll_entry): Use in_dllentry global to record that we are
1372 executing in dllentry.
1374 2006-02-22 Corinna Vinschen <corinna@vinschen.de>
1376 * exceptions.cc (_cygtls::interrupt_now): Reorder conditional
1377 to call inside_kernel only if this isn't locked.
1379 2006-02-22 Corinna Vinschen <corinna@vinschen.de>
1381 * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES to
1382 access flags in case of query_read_control case, add FILE_READ_DATA
1383 in case of query_stat_control.
1385 2006-02-20 Christopher Faylor <cgf@timesys.com>
1387 * spawn.cc (av::fixup): Check for .bat and friends specifically now
1388 since these extensions are no longer automatically detected.
1390 2006-02-19 Christopher Faylor <cgf@timesys.com>
1392 * exceptions.cc (stackdump): Avoid dumping more than once.
1394 2006-02-19 Christopher Faylor <cgf@timesys.com>
1396 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use NtOpenFile
1397 to open the directory.
1398 (fhandler_disk_file::readdir): Use NT_SUCCESS to determine if status
1401 2006-02-19 Corinna Vinschen <corinna@vinschen.de>
1403 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop generating
1406 2006-02-18 Corinna Vinschen <corinna@vinschen.de>
1408 * fhandler_disk_file.cc (FS_IS_SAMBA): Move out of
1409 path_conv::hasgood_inode.
1410 (path_conv::is_samba): New method.
1411 (fhandler_base::fstat_by_handle): Don't even try to use
1412 FileIdBothDirectoryInformation on Samba.
1413 * path.h (class path_conv): Declare is_samba method.
1415 2006-02-17 Christopher Faylor <cgf@timesys.com>
1417 * path.cc (conv_path_list): Eat empty paths when converting to POSIX.
1418 (cygwin_conv_to_win32_path): Deal with Cygwin's necessity of adding a
1419 '/' to the end of a path ending in '.'.
1421 2006-02-16 Corinna Vinschen <corinna@vinschen.de>
1423 * cygwin.din: Export sigignore and sigset.
1424 * exceptions.cc (sigset): New function.
1425 (sigignore): New function.
1426 * include/cygwin/signal.h (SIG_HOLD): Define.
1427 (sigignore): Declare.
1429 * include/cygwin/version.h: Bump API minor number to 154.
1431 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
1433 * include/mntent.h: Add missing #include.
1435 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
1437 * gentls_offsets: Fix typo in error message.
1439 2006-02-10 Christopher Faylor <cgf@timesys.com>
1441 * fhandler_process.cc (format_process_stat): Use cygwin-derived start
1442 time even on NT since it is the logical start time of the "process".
1443 * pinfo.cc (set_myself): Don't set start time when it should have
1444 already been set previously.
1446 2006-02-10 Brian Ford <Brian.Ford@FlightSafety.com>
1448 * times.cc (clock_getres): Use correct conversion from milliseconds to
1449 seconds/nanoseconds.
1450 (clock_setres): Use correct conversion to nanoseconds.
1452 2006-02-10 Christopher Faylor <cgf@timesys.com>
1454 * external.cc (sync_winenv): Rename from "setup_winenv". Use same
1455 mechanism as spawn to determine environment variables which should be
1456 converted back to windows form.
1457 (cygwin_internal): Reflect setup_winenv -> sync_winenv name change.
1458 * include/sys/cygwin.h: Ditto.
1460 2006-02-09 Corinna Vinschen <corinna@vinschen.de>
1462 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
1463 the dirent_get_d_ino flag on filesystems having useful File IDs.
1464 Add comment explaining why.
1466 2006-02-07 Corinna Vinschen <corinna@vinschen.de>
1468 * dtable.cc (handle_to_fn): Accommodate new argument order in call to
1470 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Call sys_wcstombs
1471 instead of just wcstombs to accommodate OEM codepages.
1472 * miscfuncs.cc (sys_wcstombs): Split len argument in source and target
1473 length. Always 0-terminate result in target string.
1474 * security.cc (lsa2wchar): Remove unused function.
1476 (get_lsa_srv_inf): Ditto.
1477 (get_logon_server): Accommodate new argument order in call to
1479 (get_user_groups): Ditto.
1480 (get_user_local_groups): Ditto.
1481 (get_priv_list): Call sys_wcstombs directly instead of lsa2str.
1482 * uinfo.cc (cygheap_user::ontherange): Accommodate new argument order
1483 in call to sys_wcstombs.
1484 * winsup.h (sys_wcstombs): Change prototype to match new argument order.
1486 2006-02-07 Corinna Vinschen <corinna@vinschen.de>
1488 * init.cc (respawn_wow64_process): Exit with the exit code returned
1489 by the respawned process.
1491 2006-02-06 Christopher Faylor <cgf@timesys.com>
1493 Always zero all elements of siginfo_t throughout.
1494 * cygtls.h (_cygtls::thread_context): Declare new field.
1495 (_cygtls::thread_id): Ditto.
1496 (_cygtls::signal_exit): Move into this class.
1497 (_cygtls::copy_context): Declare new function.
1498 (_cygtls::signal_debugger): Ditto.
1499 * cygtls.cc (_cygtls::init_thread): Fill out thread id field.
1500 * exceptions.cc (exception): Change message when exception info is
1501 unknown. Copy context to thread local storage.
1502 (_cygtls::handle_exceptions): Avoid double test for fault_guarded.
1503 Reflect move of signal_exit to _cygtls class.
1504 (sigpacket::process): Copy context to thread local storage.
1505 (_cygtls::signal_exit): Move to _cygtls class. Call signal_debugger to
1506 notify debugger of exiting signal (WIP). Call stackdump here (WIP).
1507 (_cygtls::copy_context): Define new function.
1508 (_cygtls::signal_debugger): Ditto.
1509 * tlsoffsets.h: Regenerate.
1510 * include/cygwin.h (_fpstate): New internal structure.
1511 (ucontext): Declare new structure (WIP).
1512 (__COPY_CONTEXT_SIZE): New define.
1514 * exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field
1515 when there is no sigwaiting thread.
1516 (setup_handler): Move event handling into interrupt_setup.
1518 2006-02-06 Corinna Vinschen <corinna@vinschen.de>
1520 * fhandler_socket.cc (fhandler_socket::connect): Fix formatting.
1521 (fhandler_socket::wait): Handle SA_RESTART when signal arrives.
1523 2006-02-06 Corinna Vinschen <corinna@vinschen.de>
1525 * include/cygwin/socket.h (CMSG_FIRSTHDR): Avoid compiler warning.
1527 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
1529 * include/features.h: Add comment to explain what's going to happen
1531 * include/sys/stdio.h: Guard getline and getdelim prototypes with
1532 _GNU_SOURCE to avoid collision with old-style declarations.
1534 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
1536 * environ.cc (struct parse_thing): Add transparent_exe option.
1537 * fhandler_disk_file.cc (fhandler_disk_file::link): Accommodate
1538 transparent_exe option. Add .exe suffix for links to executable files,
1539 if transparent_exe is set.
1540 * fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe
1541 suffix if transparent_exe option is set.
1542 * path.cc (symlink_worker): Accommodate transparent_exe option.
1543 (realpath): Don't tack on .exe suffix if transparent_exe is set.
1544 * syscalls.cc (transparent_exe): New global variable.
1545 (unlink): Accommodate transparent_exe option.
1548 (rename): Ditto. Maybe add .exe suffix when renaming executable files.
1549 (pathconf): Accommodate transparent_exe option.
1550 * winsup.h: Declare transparent_exe.
1552 2006-02-05 Christopher Faylor <cgf@timesys.com>
1553 Corinna Vinschen <corinna@vinschen.de>
1555 * fhandler_disk_file.cc (fhandler_disk_file::readdir_9x): Remove
1558 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
1560 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Remove label
1561 "out". Move test for NULL __handle ...
1562 (fhandler_disk_file::rewinddir_9x): ... here.
1564 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
1566 * dir.cc (rewinddir): Keep dirent_get_d_ino and dirent_set_d_ino flags.
1568 2006-02-05 Christopher Faylor <cgf@timesys.com>
1570 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Don't close dir
1571 handle when we hit EOF since rewwindir may reactivate it.
1572 (fhandler_disk_file::readdir_9x): Eliminate superfluous temporary
1574 (fhandler_disk_file::closedir): Return EBADF when trying to close
1575 unopened DIR. Reorganize slightly. Return actual derived error value
1576 rather than always returning 0.
1578 2006-02-04 Christopher Faylor <cgf@timesys.com>
1580 * dir.cc (rmdir): Reorganize check for trailing dot to return correct
1581 error when directory does not exist.
1583 2006-02-03 Christopher Faylor <cgf@timesys.com>
1585 * dir.cc (mkdir): Reorganize check for trailing dot to return correct
1586 error when directory exists.
1587 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Remove special
1588 test for path ending in '.'.
1590 2006-02-03 Corinna Vinschen <corinna@vinschen.de>
1592 * path.cc (suffix_scan::lnk_match): Return true beginning with
1594 (suffix_scan::next): Rearrange code to make .lnk append order slightly
1596 * spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align
1597 evaluation with stat_suffixes.
1598 (dll_suffixes): Ditto.
1600 2006-02-02 Christopher Faylor <cgf@timesys.com>
1602 * cygwin/version.h: Mention CW_SETUP_WINENV in comment for API minor
1605 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
1607 * cygwin.din (updwtmpx): Export.
1608 * syscalls.cc (updwtmpx): New function.
1609 * include/utmpx.h (updwtmpx): Declare.
1610 * include/cygwin/version.h: Bump API minor number to 153.
1612 2006-02-02 Christopher Faylor <cgf@timesys.com>
1614 * external.cc (setup_winenv): New function.
1615 (cygwin_internal): Implement CW_SETUP_WINENV.
1616 * sys/cygwin.h (cygwin_getinfo_types): Define CW_SETUP_WINENV.
1618 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
1620 * security.cc (is_group_member): Fix comment.
1622 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
1624 * security.cc (is_group_member): Use local group info type 1. Test
1625 group for being a global group or a well-known SID before adding it
1626 to the group list. Add comment.
1628 2006-02-01 Corinna Vinschen <corinna@vinschen.de>
1630 * autoload.cc (GetTcpTable): Define.
1631 * fhandler_socket.cc (address_in_use): New function to check if
1632 sockaddr_in address is already in use.
1633 (fhandler_socket::bind): Check if address is alreay in use in case of
1634 SO_REUSEADDR, to circumvent WinSock non-standard behaviour.
1636 2006-02-01 Corinna Vinschen <corinna@vinschen.de>
1638 * spawn.cc (dll_suffixes): Add .exe and "no suffix" to the list.
1640 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
1642 * dlfcn.cc (check_path_access): Call find_exec with FE_DLL option.
1643 * path.h (enum fe_types): Add FE_DLL value.
1644 * spawn.cc (std_suffixes): Remove.
1645 (exe_suffixes): New suffix_info for executing files.
1646 (dll_suffixes): New suffix_info for searching shared libraries.
1647 (perhaps_suffix): Add opt argument. Use dll_suffixes if FE_DLL
1648 option is given, exe_suffixes otherwise.
1649 (find_exec): Propagate opt argument to perhaps_suffix. Drop suffix
1650 check when testing execute permission.
1651 (spawn_guts): Call perhaps_suffix with FE_NADA opt argument.
1653 2006-01-31 Christopher Faylor <cgf@timesys.com>
1655 * spawn.cc (av::fixup): Remove unused argument.
1656 (spawn_guts): Remove capitalization in debugging.
1658 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
1660 * spawn.cc (find_exec): Only return files with execute permission set
1661 if ntsec is on. Don't check execute permission of Windows batch files.
1662 (av::fixup): Handle empty files gracefully. Drop execute permission
1664 * path.cc (suffix_scan::next): Don't skip any suffix on first run.
1666 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
1668 * path.cc (cwdstuff::set): Don't set win32 error, only POSIX errno.
1670 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
1672 * path.cc (cwdstuff::set): When SetCurrentDirectory returns
1673 ERROR_INVALID_FUNCTION, bend it over to ERROR_FILE_NOT_FOUND. Add
1674 comment to explain why.
1676 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
1678 * dir.cc (readdir_worker): Add comment about writing old 32 bit d_ino.
1679 * include/cygwin/version.h: Bump API minor number to 152.
1680 (CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): Remove.
1682 2006-01-30 Corinna Vinschen <corinna@vinschen.de>
1684 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Simplify
1687 2006-01-30 Corinna Vinschen <corinna@vinschen.de>
1689 * fhandler_disk_file.cc (d_cachepos): Rename from d_pos to distinct
1690 clearly from __d_position. Change throughout.
1691 (fhandler_disk_file::rewinddir): Reset readdir cache on NT.
1693 2006-01-29 Corinna Vinschen <corinna@vinschen.de>
1695 * fhandler_disk_file.cc (readdir_get_ino): Don't follow symlinks.
1697 2006-01-29 Corinna Vinschen <corinna@vinschen.de>
1699 * fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag.
1700 * fhandler_socket.cc (fhandler_socket::bind): Set socket to
1701 SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR
1702 socket option, on systems supporting SO_EXCLUSIVEADDRUSE.
1703 * net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag
1704 if SO_REUSEADDR socket option has been successsfully set.
1705 * wincap.h (wincaps::has_exclusiveaddruse): New element.
1706 * wincap.cc: Implement above element throughout.
1708 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
1710 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): In case or error,
1711 check for existance explicitely and set errno to EEXIST.
1713 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
1715 * fhandler_disk_file.cc (DIR_NUM_ENTRIES): New define determining
1716 minimum number of dir entries which fit into the readdir cache.
1717 (DIR_BUF_SIZE): Define globally as size of readdir cache.
1718 (struct __DIR_cache): New structure used for readdir caching on NT.
1719 (d_dirname): Accessor for struct __DIR_cache, use throughout.
1722 (fhandler_disk_file::opendir): Allocate __d_dirname to contain readdir
1724 (fhandler_disk_file::readdir): Use buf as pointer into readdir cache.
1725 Implement readdir caching.
1727 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
1729 * include/sys/dirent.h (struct dirent): Revert misguided attempt to
1730 rename __d_unused1 to __d_fd.
1732 2006-01-27 Corinna Vinschen <corinna@vinschen.de>
1734 * autoload.cc (NtQueryDirectoryFile): Define.
1735 * dir.cc (__opendir_with_d_ino): Just call opendir.
1736 (opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling.
1737 (readdir_worker): Only try generating d_ino if it's 0.
1738 Utilize namehash of directories fhandler. Call readdir_get_ino to
1739 generate d_ino for "..".
1740 (seekdir64): Keep dirent_set_d_ino flag.
1741 * fhandler.h (enum dirent_states): Add dirent_get_d_ino.
1742 (class fhandler_disk_file): Declare new private methods readdir_helper
1744 * fhandler_disk_file.cc (path_conv::hasgood_inode): New method to
1745 evaluate if a filesystem has reliable inode numbers.
1746 (fhandler_base::fstat_by_handle): Accommodate structure member name
1747 change from IndexNumber to FileId.
1748 (fhandler_base::fstat_helper): Call hasgood_inode here.
1749 (fhandler_disk_file::opendir): Call fhaccess only for real files.
1750 Don't append '*' to __d_dirname here, move to readdir_9x. On NT,
1751 open directory handle here. Set dirent_get_d_ino and dirent_set_d_ino
1752 flags according to wincap and filesystem.
1753 (fhandler_disk_file::readdir_helper): New method to implement readdir
1754 postprocessing only once.
1755 (readdir_get_ino_by_handle): New static function.
1756 (readdir_get_ino): New function to centralize inode number evaluation
1757 in case inode number hasn't been returned by NtQueryDirectoryFile.
1758 (fhandler_disk_file::readdir): Move old functionality to readdir_9x.
1759 Call readdir_9x when on 9x/Me. Implement NT specific readdir here.
1760 (fhandler_disk_file::readdir_9x): Move 9x specific readdir here.
1761 (fhandler_disk_file::seekdir): Accommodate new NT readdir method.
1762 (fhandler_disk_file::closedir): Ditto.
1763 (fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment.
1764 (fhandler_cygdrive::opendir): Call get_namehash to prepare later
1765 correct evaluation of d_ino.
1766 (fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate
1767 drive's d_ino by calling readdir_get_ino.
1768 * fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and
1769 dirent_saw_dot_dot to avoid seeing . and .. entries twice.
1770 * fhandler_process.cc (fhandler_process::readdir): Ditto.
1771 * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
1772 * ntdll.h (STATUS_INVALID_PARAMETER): New define.
1773 (STATUS_INVALID_LEVEL): New define.
1774 (struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to
1775 FileId (as in Nebbitt).
1776 * path.h (path_conv::hasgood_inode): Now implemented in
1777 fhandler_disk_file.cc.
1778 * wincap.h (wincaps::has_fileid_dirinfo): New element.
1779 * wincap.cc: Implement above element throughout.
1780 * winsup.h (readdir_get_ino): Add declaration.
1781 * include/sys/dirent.h (struct dirent): Slightly rename structure
1782 members to accommodate changes.
1783 Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of
1784 __opendir_with_d_ino.
1786 2006-01-27 Christopher Faylor <cgf@timesys.com>
1788 * spawn.cc (spawn_guts): Fix potential handle leak when failing exec.
1790 2006-01-27 Christopher Faylor <cgf@timesys.com>
1792 * exceptions.cc (inside_kernel): Fix to return true if we can't get the
1793 name of the DLL for the given memory block since we are not in kernel
1796 2006-01-26 Corinna Vinschen <corinna@vinschen.de>
1798 * fhandler.cc (fhandler_base::open): Fix bug in argument order to
1799 InitializeObjectAttributes call.
1801 2006-01-25 Corinna Vinschen <corinna@vinschen.de>
1803 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix test for
1804 dirent_isroot to use the correct boolean operator.
1806 2006-01-25 Christopher Faylor <cgf@timesys.com>
1808 * ntdll.h: (temporarily?) Add more functions for querying directory.
1810 2006-01-24 Christopher Faylor <cgf@timesys.com>
1812 * dir.cc (readdir_worker): Turn off expensive inode calculation.
1814 2006-01-24 Corinna Vinschen <corinna@vinschen.de>
1816 * fhandler_process.cc (fhandler_process::fill_filebuf): Disable
1817 stripping the .exe suffix from the link target in PROCESS_EXE and
1818 PROCESS_EXENAME case.
1819 * path.cc (realpath): Tack on .exe suffix if necessary.
1821 2006-01-24 Corinna Vinschen <corinna@vinschen.de>
1823 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Try harder
1824 to determine remote file systems with reliable inode numbers. Add
1827 2006-01-23 Corinna Vinschen <corinna@vinschen.de>
1829 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Reset
1830 inheritance for duplicated socket.
1832 2006-01-20 Christopher Faylor <cgf@timesys.com>
1834 * include/cygwin/version.h: Bump API minor number to 151.
1835 * dir.cc (__opendir_with_d_ino): New function.
1836 (opendir): Set flag if we should be calculating inodes.
1837 (readdir_worker): Calculate d_ino by calling stat if the user has asked
1839 (seekdir64): Maintain all persistent flag settings.
1840 * fhandler.h (dirent_states): Add dirent_set_d_ino.
1841 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Reflect changes
1842 to dirent structure.
1843 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
1844 * include/sys/dirent.h (struct dirent): Coalesce two similar
1845 structures. Remove all shreds of the apparently highly confusing
1846 references to inodes. Add support for calculating a real inode if
1847 __USE_EXPENSIVE_CYGWIN_D_INO is defined.
1849 2006-01-20 Christopher Faylor <cgf@timesys.com>
1851 * include/sys/dirent.h: Add comments for people who are REALLY confused
1852 about whether they should be using something called __invalid_d_ino or
1855 2006-01-20 Corinna Vinschen <corinna@vinschen.de>
1857 * fhandler_socket.cc (fhandler_socket::prepare): Fix debug output.
1858 (fhandler_socket::release): Add debug output for WSAEventSelect failure.
1859 (fhandler_socket::ioctl): Always cancel WSAEventSelect before switching
1860 to blocking mode. Only set nonblocking flag if ioctlsocket call
1861 succeeded. Only print new socket state if ioctlsocket call succeeded.
1863 2006-01-19 Christopher Faylor <cgf@timesys.com>
1865 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check posix path
1866 for root rather than windows path.
1868 2006-01-19 Christopher Faylor <cgf@timesys.com>
1870 * dir.cc (readdir_worker): Fill in invalid fields with -1. Accommodate
1871 name change from __ino32 to __invalid_ino32.
1872 * include/sys/dirent.h (__invalid_ino32): Rename from __ino32. Don't
1873 define unused d_type macros.
1875 2006-01-18 Christopher Faylor <cgf@timesys.com>
1877 * heap.cc (heap_init): Remove Sleep.
1879 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
1881 * net.cc (rresvport): Remove extern declaration.
1883 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
1885 * autoload.cc (rresvport): Remove.
1886 * net.cc (last_used_rrecvport): New global shared variable.
1887 (cygwin_rresvport): Implement rresvport without using rresvport from
1890 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
1892 * include/cygwin/socket.h (struct sockaddr_storage): Fix typo in
1893 ss_family member name.
1895 2006-01-16 Christopher Faylor <cgf@timesys.com>
1897 * include/cygwin/version.h: Bump DLL minor version number to 20.
1899 2006-01-13 Corinna Vinschen <corinna@vinschen.de>
1901 * uname.cc (uname): Concatenate a "-WOW64" to utsname's sysname
1902 member to see when running under WOW64.
1904 2006-01-13 Corinna Vinschen <corinna@vinschen.de>
1906 * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS on
1907 Windows 2000 and above. Clarify the comment about IP_TOS and move
1908 to the place where the magic happens.
1909 (get_ifconf): Remove unused code.
1910 * wincap.h (wincaps::has_disabled_user_tos_setting): New element.
1911 * wincap.cc: Implement above element throughout.
1913 2006-01-12 Christopher Faylor <cgf@timesys.com>
1915 * fhandler_console.cc (set_console_state_for_spawn): Fix to recognize
1918 2006-01-12 Christopher Faylor <cgf@timesys.com>
1920 * fhandler.h (set_console_state_for_spawn): Whackamole the argument
1922 * spawn.cc (spawn_guts): Ditto, i.e., once again call
1923 set_console_state_for_spawn with an indication of whether we're about
1924 to start a cygwin process.
1925 * fhandler_console.cc (set_console_state_for_spawn): Don't set the
1926 console state if we know we're starting a cygwin process or if we're
1929 2006-01-10 Corinna Vinschen <corinna@vinschen.de>
1931 * dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
1932 * init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker.
1933 Call wincap.init here before doing anything else. Use wincap.is_wow64
1934 to determine if we're running in a WOW64 emulator.
1935 * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's
1936 apparently not supported.
1937 (mmap64): Don't create mappings beyond EOF, which would need to use
1938 AT_ROUND_TO_PAGE, on WOW64.
1939 * wincap.cc (wincap): Throw into the .cygwin_dll_common section.
1940 (wincapc::init): Determine if running in WOW64 and set wow_64 flag.
1941 * wincap.h (class wincapc): Add wow64 member.
1942 (wincapc::is_wow64): New method.
1944 2006-01-10 Christopher Faylor <cgf@timesys.com>
1946 * fhandler_proc.cc (format_proc_cpuinfo): Avoid leading whitespace in
1949 2006-01-09 Christopher Faylor <cgf@timesys.com>
1951 * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is
1952 done prior to check for command.com/cmd.com. Don't bother setting
1953 CREATE_SUSPENDED flag for a MS-DOS process since it doesn't work
1954 anyway. Avoid calling remember() when the child process has already
1956 (av::fixup): Explicitly set cygexec flag to false on a 16 bit process.
1958 2006-01-09 Corinna Vinschen <corinna@vinschen.de>
1960 * include/getopt.h (getopt_long_only): Declare.
1962 2006-01-09 Eric Blake <ebb9@byu.net>
1964 * cygwin.din: Export getsubopt.
1965 * include/cygwin/version.h: Bump API minor version.
1967 2006-01-08 Christopher Faylor <cgf@timesys.com>
1969 * fhandler_tty.cc (fhandler_tty_slave::dup): Don't assign a controlling
1970 terminal to a process when duped. Linux doesn't do this, so we won't
1973 2006-01-08 Christopher Faylor <cgf@timesys.com>
1975 * environ.cc (spenvs[]): windir -> WINDIR.
1977 2006-01-07 Christopher Faylor <cgf@timesys.com>
1979 * fhandler_console.cc (fhandler_console::need_invisible): Remove
1982 2006-01-07 Christopher Faylor <cgf@timesys.com>
1984 * fhandler.h (set_console_state_for_spawn): Eliminate argument from
1986 * fhandler.cc (set_console_state_for_spawn): Eliminate argument from
1987 definition. Always check for invisible console.
1988 (fhandler_console::need_invisible): Don't do anything if the windows
1989 station is already not visible.
1990 * spawn.cc (spawn_guts): Accommodate change of argument to
1991 set_console_state_for_spawn.
1993 2006-01-05 Christopher Faylor <cgf@timesys.com>
1995 * sigproc.cc (no_signals_available): Use existence of signal thread
1996 handle to figure out if we can actually send signals rather than
1997 relying on my_sendsig.
1998 (hwait_sig): Make static.
1999 (sigproc_init): Don't set my_sendsig to anything special. Use new
2000 global static hwait_sig.
2001 (wait_sig): Set hwait_sig to NULL when we are exiting.
2003 2006-01-05 Christopher Faylor <cgf@timesys.com>
2005 * include/getopt.h: Accommodate recent unfortunate newlib changes.
2007 2006-01-05 Christopher Faylor <cgf@timesys.com>
2009 * cygtls.cc (_cygtls::remove): Don't output debugging info if this
2010 isn't a cygwin thread.
2011 * sigproc.cc (sigproc_init): Move clearing of sync_startup here to
2012 lessen the likelihood of trying to deal with non-cygwin threads in
2015 * fhandler_console: Fix set_console_state_for_spawn comment.
2017 2006-01-05 Igor Peshansky <pechtcha@cs.nyu.edu>
2019 * spawn.cc (spawn_guts): Invert the argument to
2020 set_console_state_for_spawn.
2022 2006-01-04 Christopher Faylor <cgf@timesys.com>
2024 * fhandler_console.cc (fhandler_console::need_invisible): Only try to
2025 open "CygwinInvisible" windows station if opening of default station
2026 fails. Use CloseWindowStation to close window station handle.
2028 2006-01-04 Christopher Faylor <cgf@timesys.com>
2030 * fhandler_console.cc (fhandler_console::need_invisible): Open up the
2031 security of the newly created windows station.
2033 2006-01-04 Eric Blake <ebb9@byu.net>
2035 * path.cc (dot_special_chars): Add ", <, >, and |.
2037 2006-01-03 Christopher Faylor <cgf@timesys.com>
2039 * fhandler_console.cc (beep): Use MB_OK which is documented as using
2040 the default bell rather than -1 which seems to behave differently on
2041 different versions of Windows.
2043 2006-01-03 Christopher Faylor <cgf@timesys.com>
2045 * fhandler_process.cc (fhandler_process::readdir): Add missing argument
2048 * fhandler_console.cc (fhandler_console::need_invisible): Use made-up
2049 name for windows station rather than asking Windows to create one for
2052 * spawn.cc (spawn_guts): Don't mess with console if we're detaching.
2054 2006-01-03 Christopher Faylor <cgf@timesys.com>
2056 * dir.cc (readdir_worker): Minor code cleanup.
2058 * fhandler_console.cc (beep): Use a more Windows-generic wav file if
2059 the beep is missing. Use a more foolproof way to find out whether we
2060 should be recreating the missing key.
2062 * registry.h (reg_key::_disposition): New field.
2063 (reg_key::created): New function.
2064 * registry.cc (reg_key::reg_key): Set _disposition to zero by default.
2065 (reg_key::build_key): Fill in _disposition field.
2067 2006-01-03 Eric Blake <ebb9@byu.net>
2069 * dir.cc (readdir_worker): Ensure that saw_dot* flags are updated when
2070 not handling inodes.
2072 2006-01-02 Christopher Faylor <cgf@timesys.com>
2074 * fhandler_console.cc (beep): New function. Restores missing "Default
2075 Beep", if necessary.
2076 (fhandler_console::write_normal): Use beep().
2078 2006-01-02 Christopher Faylor <cgf@timesys.com>
2080 * dcrt0.cc (_dll_crt0): Remove more leftover debugging stuff.
2081 (cygwin_dll_init): Remove unneeded initializations. Call _dll_crt0
2082 rather than dll_crt0_1.
2084 2006-01-02 Corinna Vinschen <corinna@vinschen.de>
2086 * syslog.cc: Include sys/un.h instead of sys/socket.h.
2087 (syslogd_inited): Convert to enum type noting the exact result of
2088 trying to connect to syslog daemon. Use this way throughout.
2089 (connect_syslogd): New static function taking over the task to
2090 connect to syslog socket. Use correct struct sockaddr_un instead of
2092 (try_connect_syslogd): Call connect_syslogd. If write fails on
2093 connection oriented socket, try to reconnect to syslog socket and
2096 2006-01-01 Christopher Faylor <cgf@timesys.com>
2098 * pinfo.cc (pinfo::exit): Swap signal and normal exit value when not
2099 started from a cygwin process - just like the good-old-days of B20.
2101 2006-01-01 Christopher Faylor <cgf@timesys.com>
2103 * strace.cc (strace::write_childpid): Remove debugging output.
2105 2006-01-01 Christopher Faylor <cgf@timesys.com>
2107 * cygtls.cc (_cygtls::remove): Remove left over debugging cruft which
2108 caused this function to always return prematurely.
2110 2006-01-01 Christopher Faylor <cgf@timesys.com>
2112 * exceptions.cc (sigpacket::process): Pass actual reference to signal's
2113 sigaction structure to setup_handler.
2115 2006-01-01 Christopher Faylor <cgf@timesys.com>
2117 * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.
2118 * include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK.
2120 * dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
2122 2006-01-01 Corinna Vinschen <corinna@vinschen.de>
2124 * syslog.cc (vklog): Never log kernel messages using the vsyslog