1 2006-08-07 Corinna Vinschen <corinna@vinschen.de>
3 * autoload.cc (NtSetInformationFile): Define.
4 * cygwin.din: Export posix_fadvise and posix_fallocate.
5 * fhandler.cc (fhandler_base::fadvise): New method.
6 (fhandler_base::ftruncate): Add allow_truncate parameter.
7 * fhandler.h (class fhandler_base): Add fadvise method. Accomodate
8 new parameter to ftruncate.
9 (class fhandler_pipe): Add fadvise and ftruncate methods.
10 (class fhandler_disk_file): Add fadvise method. Accomodate new
11 parameter to ftruncate.
12 * fhandler_disk_file.cc (fhandler_disk_file::fadvise): New method.
13 (fhandler_disk_file::ftruncate): Accomodate new allow_truncate
14 parameter. Set EOF using NtSetInformationFile on NT.
15 * ntdll.h (struct _FILE_END_OF_FILE_INFORMATION): Define.
16 (NtSetInformationFile): Declare.
17 * pipe.cc (fhandler_pipe::fadvise): New method.
18 (fhandler_pipe::ftruncate): Ditto.
19 * syscalls.cc (posix_fadvise): New function.
20 (posix_fallocate): Ditto.
21 (ftruncate64): Accomodate second parameter to fhandler's ftruncate
23 * include/fcntl.h: Add POSIX_FADV_* flags. Add declarations of
24 posix_fadvise and posix_fallocate.
25 * include/cygwin/version.h: Bump API minor number.
27 2006-08-02 Christopher Faylor <cgf@timesys.com>
29 * environ.cc (env_win32_to_posix_path_list): Declare.
30 (conv_envvars): Use env_win32_to_posix_path_list rather than
31 cygwin_win32_to_posix_path_list.
32 (posify): Translate back to win32 path if errno is EIDRM.
33 * environ.h: Update copyright. Define ENV_CVT.
34 * path.cc (conv_path_list): If converting for the environment and
35 removed an element set errno to ENV_CVT.
36 (env_win32_to_posix_path_list): New function.
38 2006-08-01 Christopher Faylor <cgf@timesys.com>
40 * environ.cc (dos_file_warning): Declare.
41 (parse_thing): Add "dosfilewarning". Alphabetize.
42 * path.cc (normalize_posix_path): Return -1 when MS-DOS path detected.
43 (warn_msdos): New function.
44 (path_conv::check): Call if !PC_NOWARN and MS-DOS path detected.
45 (cygwin_conv_to_win32_path): Set PC_NOWARN when calling path_conv.
46 (cygwin_conv_to_full_win32_path): Ditto.
47 * path.h (pathconv_arg::PC_NOWARN): Define.
48 * shared_info.h (user_info::warned_msdos): New field.
49 (CURR_USER_MAGIC): Reset.
51 2006-07-31 Corinna Vinschen <corinna@vinschen.de>
53 * fhandler_socket.cc (fhandler_socket::recv_internal): Fix a problem
54 with poll(2) after shutdown(SHUT_RD) has been called on the local side.
55 * poll.cc (poll): Use POSIX type nfds_t for second parameter. Drop
56 special socket handling for POLLIN. Add comment to explain why.
57 * include/sys/poll.h: Declare nfds_t. Use as type for second parameter
58 in poll(2) declaration.
60 2006-07-31 Corinna Vinschen <corinna@vinschen.de>
62 * fhandler_socket.cc (fhandler_socket::evaluate_events): Circumvent
63 potential race condition.
64 (fhandler_socket::recv_internal): Fix MSG_PEEK bug on blocking sockets
65 and simplify recv loop.
66 (fhandler_socket::send_internal): Only lock when changing wsock_events.
68 2006-07-31 Corinna Vinschen <corinna@vinschen.de>
70 * autoload.cc: Drop LoadDLLprime for wsock32 since no wsock32 function
71 is used anymore. Drop all unused ws2_32.dll functions.
73 2006-07-28 Corinna Vinschen <corinna@vinschen.de>
75 * fhandler.h (struct wsa_event): Define here.
76 (class fhandler_socket): Make wsock_evt private again.
77 (fhandler_socket::wsock_event): New read accessor for wsock_evt.
78 (fhandler_socket::serial_number): New read accessor to get the
79 socket's serial number.
80 (fhandler_socket::ready_for_read): Just return true.
81 * fhandler_socket.cc (struct wsa_event): Move definition to fhandler.h.
82 * select.cc (struct socketinf): Add serial number vector.
83 (start_thread_socket): Identify duplicate sockets by their serial
84 number, not (wrongly) by their wsock_evt.
86 2006-07-27 Corinna Vinschen <corinna@vinschen.de>
88 * fhandler_socket.cc: Revert misguided attempt to handle FD_CLOSE error
89 conditions in evaluate_events.
90 (search_wsa_event_slot): Move wrongly placed memset in
91 fhandler_socket::init_events here.
92 (fhandler_socket::init_events): Initially set FD_WRITE event for
93 connectionless sockets.
94 * poll.cc (poll): Don't add sockets always to except_fds since select
95 is now supposed to do it right.
96 * select.cc (set_bits): Set connection state correctly for failed
97 af_local_connect on local sockets. Remove socket special handling
98 for except_selected descriptors.
99 (peek_socket): Try to set the read/write/exception bits actually
102 2006-07-27 Brian Ford <Brian.Ford@FlightSafety.com>
104 * fhandler_socket.cc (fhandler_socket::recvmsg): Remove unused tot
105 argument. All callers changed.
106 (fhandler_socket::sendmsg): Likewise.
107 * net.cc (cygwin_recvmsg): Likewise.
108 (cygwin_sendmsg): Likewise, and prevent calling sendmsg whith an
110 * fhandler.h (fhandler_socket::recvmsg): Adjust prototype.
111 (fhandler_socket::sendmsg): Likewise.
113 2006-07-27 Corinna Vinschen <corinna@vinschen.de>
115 * fhandler.h (class fhandler_socket): Remove prot_info_ptr.
116 (fhandler_socket::fixup_before_fork_exec): Remove.
117 (fhandler_socket::fixup_after_exec): Remove.
118 (fhandler_socket::need_fixup_before): Remove.
119 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop
120 initializing prot_info_ptr. Remove unused code.
121 (fhandler_socket::~fhandler_socket): Drop free'ing prot_info_ptr.
122 (struct wsa_event): Rename connect_errorcode to errorcode.
123 (fhandler_socket::evaluate_events): Handle FD_CLOSE error condition
124 as FD_CONNECT error condition, except, never reset an FD_CLOSE error
125 condition. Always set FD_WRITE after successfully recorded FD_CONNECT.
126 (fhandler_socket::fixup_before_fork_exec): Remove.
127 (fhandler_socket::fixup_after_fork): Revert to using handle duplication.
128 (fhandler_socket::fixup_after_exec): Remove.
129 (fhandler_socket::dup): Revert to using handle duplication.
130 (fhandler_socket::send_internal): Only call wait_for_events in case
131 of WSAEWOULDBLOCK condition.
132 (fhandler_socket::set_close_on_exec): Call
133 fhandler_base::set_close_on_exec.
134 * net.cc (fdsock): Just set socket to inheritable on non-NT. Don't
135 call inc_need_fixup_before.
136 * select.cc (peek_socket): Don't set except_ready on every FD_CLOSE,
139 2006-07-26 Brian ford <Brian.Ford@FlightSafety.com>
141 * fhandler.cc (fhandler_base::read): Call get_readahead_into_buffer
142 instead of duplicating it.
144 2006-07-26 Corinna Vinschen <corinna@vinschen.de>
146 * shared.cc (offsets): Define as offsets relative to cygwin_hmodule
147 instead of addresses.
148 (off_addr): New macro.
149 (open_shared): Use offsets array accordingly. Remove unused code.
150 * shared_info.h (cygwin_shared_address): Remove.
152 2006-07-26 Corinna Vinschen <corinna@vinschen.de>
154 * cygheap.h (struct init_cygheap): Remove shared_h and mt_h members.
155 * fhandler_tape.cc (mt): Define as DLL shared area in
156 .cygwin_dll_common instead of as dynamically allocated area.
157 Change referencing throughout.
158 * mtinfo.h (mt_h): Remove entirely.
159 (mt): Remove extern declaration.
160 * shared.cc (cygwin_shared_area): New global cygwin_shared
161 variable located in .cygwin_dll_common.
162 (offsets): Define shared region addresses descending from
163 cygwin_shared_address.
164 (open_shared): Replace usage of SH_CYGWIN_SHARED by SH_USER_SHARED.
165 (memory_init): Set cygwin_shared just by pointing to cygwin_shared_area.
166 * shared_info.h (shared_locations): Remove SH_CYGWIN_SHARED and
168 (cygwin_shared_address): Define as DLL start address.
169 * tty.h (tty_min::tty_min): Remove constructor.
171 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
173 * include/cygwin/in6.h: Guard in_port_t typedef more restrictive to
174 avoid compiler warning.
176 2006-07-25 Christopher Faylor <cgf@timesys.com>
178 * security.cc (get_logon_server): Remove nret and use dret for
179 everything to avoid a g++ warning.
181 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
183 * include/cygwin/version.h: Bump DLL version to 1.7.0.
185 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
188 * fhandler_socket.cc: Don't include select.h.
191 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
193 * cygtls.h: Drop socket related includes.
194 (struct _local_storage): Remove exitsock and exitsock_sin. Add
196 * cygtls.cc: Accomodate above change throughout.
197 * fhandler.h (class fhandler_socket): Make wsock_evt public.
198 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Accomodate
200 (fhandler_socket::evaluate_events): Drop FD_CONNECT event as soon as
201 it gets read once. Never remove FD_WRITE event here.
202 (fhandler_socket::wait_for_events): Wait 50 ms instead of INFINITE for
204 (fhandler_socket::accept): Fix conditional. Set wsock_events members
205 of accepted socket to useful start values.
206 (fhandler_socket::recv_internal): Always drop FD_READ/FD_OOB events from
207 wsock_events after the call to WSARecvFrom.
208 (fhandler_socket::send_internal): Drop FD_WRITE event from wsock_events
209 if the call to WSASendTo fails with WSAEWOULDBLOCK. Fix return value
211 * select.cc (struct socketinf): Change to accomodate using socket event
213 (peek_socket): Use event handling for peeking socket.
214 (thread_socket): Ditto.
215 (start_thread_socket): Ditto.
216 (socket_cleanup): Same here.
217 * tlsoffsets.h: Regenerate.
219 2006-07-23 Christopher Faylor <cgf@timesys.com>
221 * include/cygwin/version.h: Bump DLL minor version number to 22.
223 2006-07-20 Corinna Vinschen <corinna@vinschen.de>
225 * fhandler.h (class fhandler_socket): Rearrange slightly to keep
226 event handling methods and members together. Drop owner status flag.
227 Split wait method. Rename event handling methods for readability.
228 * fhandler_socket.cc (struct wsa_event): Add owner field.
229 (LOCK_EVENTS): New macro.
230 (UNLOCK_EVENTS): Ditto.
231 (fhandler_socket::init_events): rename from prepare.
232 (fhandler_socket::evaluate_events): First half of former wait method.
233 Do everything but wait. Allow specifiying whether or not events from
234 event_mask should be erased from wsock_events->events. Simplify
235 OOB handling. Allow sending SIGURG to any process (group).
236 (fhandler_socket::wait_for_events): Second half of former wait method.
237 Call evaluate_events and wait in a loop if socket is blocking.
238 (fhandler_socket::release_events): Rename from release.
239 (fhandler_socket::connect): Accomodate above name changes.
240 (fhandler_socket::accept): Ditto.
241 (fhandler_socket::recv_internal): Ditto.
242 (fhandler_socket::send_internal): Ditto.
243 (fhandler_socket::close): Ditto.
244 (fhandler_socket::fcntl): Always set owner to given input value on
245 F_SETOWN. Handle F_GETOWN.
246 * net.cc (fdsock): Accomodate above name changes.
248 2006-07-20 Corinna Vinschen <corinna@vinschen.de>
250 * fhandler_socket.cc (fhandler_socket::wait): Set Winsock errno to
251 WSAEWOULDBLOCK instead of WSAEINPROGRESS.
253 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
255 * pinfo.cc (commune_process): Don't add extra \0 to cmdline.
256 (_pinfo::cmdline): Ditto process internal.
258 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
260 * mmap.cc (msync): Disable rounding up len. Fix bug in access check
263 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
265 * path.cc (symlink_worker): Return EEXIST if newpath exists.
267 2006-07-18 Christopher Faylor <cgf@timesys.com>
269 * tty.cc (tty_list::terminate): Don't enter the busy loop if we don't
272 2006-07-18 Silvio Laguzzi <slaguzzi@data-al.de>
274 * sec_acl.cc (acltotext32): Add missing handling of default ACL entry
277 2006-07-18 Brian Ford <Brian.Ford@FlightSafety.com>
278 Corinna Vinschen <corinna@vinschen.de>
280 * winsup.h (mmap_region_status): New enum.
281 (mmap_is_attached_or_noreserve_page): Adjust prototype and rename
283 * mmap.cc (mmap_is_attached_or_noreserve_page): Rename
284 mmap_is_attached_or_noreserve. Add region length parameter.
286 * exceptions.cc (_cygtls::handle_exceptions): Accomodate above.
287 * fhandler.cc (fhandler_base::raw_read): Call above for NOACCESS
288 errors and retry on success to allow reads into untouched
289 MAP_NORESERVE buffers.
291 2006-07-18 Corinna Vinschen <corinna@vinschen.de>
293 * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Fix typo in lint
296 2006-07-18 Corinna Vinschen <corinna@vinschen.de>
298 * cygwin.din (posix_openpt): Export.
299 * tty.cc (posix_openpt): New function.
300 * include/cygwin/stdlib.h (posix_openpt): Declare.
301 * include/cygwin/version.h: Bump API minor number.
303 2006-07-17 Christopher Faylor <cgf@timesys.com>
306 * cygheap.h (cygheap_user): Remove unneeded class names from function
308 * fhandler.h (fhandler_base): Ditto.
309 (fhandler_dev_floppy): Ditto.
310 (fhandler_console): Ditto.
311 * wininfo.h (wininfo): Ditto.
312 * exceptions.cc (sigpacket::process): Avoid compiler errors about gotos
314 * fhandler_fifo.cc (fhandler_fifo::open): Ditto.
315 * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Ditto.
316 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Ditto.
317 * mmap.cc (mmap64): Ditto.
318 * pipe.cc (fhandler_pipe::open): Ditto.
319 * spawn.cc (spawn_guts): Ditto.
321 * sec_helper.cc: Fix some comments.
322 (get_null_sd): Move file-scope static to only function where it is
325 2006-07-14 Christopher Faylor <cgf@timesys.com>
327 * fork.cc (fork): Lock the process before forking to prevent things
328 like new fds from being opened, etc.
329 * sync.h (lock_process::dont_bother): New function.
331 2006-07-14 Christopher Faylor <cgf@timesys.com>
333 * include/cygwin/types.h: Update copyright.
335 2006-07-14 Christopher Faylor <cgf@timesys.com>
337 * cygwin.sc: Make sure there's something in the cygheap.
338 * dllfixdbg: Accommodate newer binutils which put the gnu_debuglink at
339 the end rather than at the beginning.
341 2006-07-14 Corinna Vinschen <corinna@vinschen.de>
343 * security.cc (get_token_group_sidlist): Always add the interactive
344 group to the token. Add comment. Create logon_id group SID by
345 copying it from incoming group list.
346 (create_token): Add subauth_token parameter. Use information in
347 subauth_token if present. Tweak SourceIdentifier if subauth_token
348 is present for debugging purposes.
349 * security.h (create_token): Add subauth_token parameter in declaration.
350 * syscalls.cc (seteuid32): Call subauth first. Call create_token
351 regardless. Use subauth token in call to create_token if subauth
354 2006-07-13 Christopher Faylor <cgf@timesys.com>
356 * sigproc.cc (waitq_head): Don't initialize to zero.
357 * sigproc.h: Update copyright, fix whitespace.
359 2006-07-13 Christopher Faylor <cgf@timesys.com>
361 * fhandler.cc (fhandler_base::raw_read): Only return EISDIR when we're
362 really trying to read a directory.
364 * sigproc.cc: Use "Static" where appropriate.
366 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
368 * include/netinet/in.h: Update copyright.
370 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
372 * fhandler_socket.cc: Update copyright.
373 * include/pthread.h: Ditto.
375 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
377 * fhandler_socket.cc (fhandler_socket::wait): Rework function so that
378 WaitForMultipleObjects is really only called when necessary.
380 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
382 * mmap.cc (mmap64): Drop MAP_NORESERVE flag for non-anonymous,
383 non-private mappings.
384 (mmap_record::unmap_pages): Only check noreserve flag which now implies
385 anonymous and private.
387 (fixup_mmaps_after_fork): Ditto.
389 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
391 * mmap.cc (mmap64): Drop MAP_RESERVED flag for all non-anonymous,
392 non-private mappings.
394 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
396 * exceptions.cc (_cygtls::handle_exceptions): Call new
397 mmap_is_attached_or_noreserve_page function in case of access violation
398 and allow application to retry access on noreserve pages.
399 * mmap.cc (mmap_is_attached_or_noreserve_page): Changed from
400 mmap_is_attached_page. Handle also noreserve pages now. Change
402 * winsup.h (mmap_is_attached_or_noreserve_page): Declare instead of
403 mmap_is_attached_page.
405 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
407 * mmap.cc (mmap_record::alloc_page_map): Don't call VirtualProtect
408 on maps created with MAP_NORESERVE.
410 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
412 * include/netdb.h: Declare rcmd, rcmd_af, rexec, rresvport,
413 rresvport_af, iruserok, iruserok_sa, ruserok.
415 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
417 * Makefile.in (DLL_OFILES): Drop iruserok.o. Add rcmd.o.
418 * autoload.cc (rcmd): Drop definition.
419 * cygwin.din: Export bindresvport, bindresvport_sa, iruserok_sa,
420 rcmd_af, rresvport_af.
421 * net.cc (cygwin_rcmd): Remove.
422 (last_used_bindresvport): Rename from last_used_rrecvport.
423 (cygwin_bindresvport_sa): New function implementing bindresvport_sa.
424 (cygwin_bindresvport): New function implementing bindresvport.
425 (cygwin_rresvport): Remove.
426 * include/cygwin/version.h: Bump API minor number.
427 * include/netinet/in.h: Declare bindresvport and bindresvport_sa.
428 * libc/iruserok.c: Remove file.
429 * libc/rcmd.cc: New file implementing rcmd, rcmd_af, rresvport,
430 rresvport_af, iruserok_sa, iruserok and ruserok.
432 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
434 * include/pthread.h: Define PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT and
435 PTHREAD_PRIO_PROTECT only if _POSIX_THREAD_PRIO_INHERIT is defined.
437 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
439 * fhandler_socket.cc (fhandler_socket::getsockname): Return valid
440 result for unbound sockets.
442 2006-07-11 Corinna Vinschen <corinna@vinschen.de>
444 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Handle
445 wsock_mtx and wsock_evt on fork, thus handling close_on_exec correctly.
446 (fhandler_socket::fixup_after_exec): Drop misguided attempt to handle
448 (fhandler_socket::dup): Call fixup_after_fork with NULL parent.
450 (fhandler_socket::set_close_on_exec): Handle wsock_mtx and wsock_evt.
452 2006-07-10 Corinna Vinschen <corinna@vinschen.de>
454 * fhandler.h (class fhandler_socket): Add wsock_mtx, wsock_evt
455 and wsock_events members. Remove closed status flag, add listener
456 status flag. Accomodate new implementation of socket event handling
457 methods. Declare recv* and send* functions ssize_t as the POSIX
459 (fhandler_socket::recv_internal): Declare.
460 (fhandler_socket::send_internal): Ditto.
461 * fhandler_socket.cc (EVENT_MASK): Define mask of selected events.
462 (fhandler_socket::fhandler_socket): Initialize new members.
463 (fhandler_socket::af_local_setblocking): Don't actually set the
464 socket to blocking mode. Keep sane event selection.
465 (fhandler_socket::af_local_unsetblocking): Don't actually set the
466 socket to previous blocking setting, just remember it.
467 (struct wsa_event): New structure to keep event data per shared
469 (NUM_SOCKS): Define number of shared sockets concurrently handled by
470 all active Cygwin processes.
471 (wsa_events): New shared datastructure keeping all wsa_event records.
472 (socket_serial_number): New shared variable to identify shared sockets.
473 (wsa_slot_mtx): Global mutex to serialize wsa_events access.
474 (search_wsa_event_slot): New static function to select a new wsa_event
475 slot for a new socket.
476 (fhandler_socket::prepare): Rewrite. Prepare event selection
478 (fhandler_socket::wait): Rewrite. Wait for socket events in thread
479 safe and multiple process safe.
480 (fhandler_socket::release): Rewrite. Close per-socket descriptor
481 mutex handle and event handle.
482 (fhandler_socket::dup): Duplicate wsock_mtx and wsock_evt. Fix
483 copy-paste error in debug output.
484 (fhandler_socket::connect): Accomodate new event handling.
485 (fhandler_socket::listen): Set listener flag on successful listen.
486 (fhandler_socket::accept): Accomodate new event handling.
487 (fhandler_socket::recv_internal): New inline method centralizing
489 (fhandler_socket::recvfrom): Call recv_internal now.
490 (fhandler_socket::recvmsg): Ditto. Streamline copying from iovec
492 (fhandler_socket::send_internal): New inline method centralizing
494 (fhandler_socket::sendto): Call send_internal now.
495 (fhandler_socket::sendmsg): Ditto. Streamline copying from iovec
497 (fhandler_socket::close): Call release now.
498 (fhandler_socket::ioctl): Never actually switch to blocking mode.
499 Just keep track of the setting.
500 * net.cc (fdsock): Call prepare now.
501 (cygwin_connect): Revert again to event driven technique.
502 (cygwin_accept): Ditto.
503 * poll.cc (poll): Don't call recvfrom on a listening socket.
504 Remove special case for failing recvfrom.
505 * include/sys/socket.h: Declare recv* and send* functions ssize_t as
508 2006-07-10 Corinna Vinschen <corinna@vinschen.de>
510 * libc/inet_addr.c: Define __INSIDE_CYGWIN_NET__.
511 * libc/inet_network.c: Ditto.
513 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
515 * fhandler_socket.cc (fhandler_socket::wait): Disable SA_RESTART
518 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
520 * net.cc (cygwin_inet_ntop): Fix data type of forth parameter.
522 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
524 * Makefile.in (DLL_OFILES): Add inet_addr.o and inet_network.o.
525 * autoload.cc (inet_addr): Drop definition.
527 * net.cc: Forward declare cygwin_inet_aton and cygwin_inet_ntop.
528 (cygwin_inet_ntoa): Call cygwin_inet_ntop instead of Winsock inet_ntoa.
529 (cygwin_inet_addr): Remove here.
530 (cygwin_inet_aton): Ditto.
531 (cygwin_inet_network): Ditto.
532 * libc/inet_addr.c: New file implementing cygwin_inet_aton and
534 * libc/inet_network.c: New file implementing cygwin_inet_network.
536 2006-07-06 Christopher Faylor <cgf@timesys.com>
538 * hookapi.cc: Add comment header
539 (putmem): Make static.
541 (rvadelta): Ditto. Don't assume that a section which ends where the
542 import_rva begins is the import list.
544 * child_info.h: Update copyright.
547 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
549 * include/cygwin/in6.h (struct in6_addr): Fix typo.
551 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
553 * cygwin.din: Export in6addr_any, in6addr_loopback, freeaddrinfo,
554 gai_strerror, getaddrinfo, getnameinfo.
555 * fhandler_socket.cc: Include cygwin/in6.h.
556 (get_inet_addr): Accomodate AF_INET6 usage.
557 (fhandler_socket::connect): Ditto.
558 (fhandler_socket::listen): Ditto.
559 (fhandler_socket::sendto): Ditto.
560 * net.cc: Include cygwin/in6.h.
561 (in6addr_any): Define.
562 (in6addr_loopback): Define.
563 (cygwin_socket): Accomodate AF_INET6 usage.
564 (socketpair): Bind socketpairs only to loopback for security.
565 (inet_pton4): New static function.
567 (cygwin_inet_pton): New AF_INET6 aware inet_pton implementation.
568 (inet_ntop4): New static function.
570 (cygwin_inet_ntop): New AF_INET6 aware inet_ntop implementation.
571 (ga_aistruct): New static function.
579 (ipv4_freeaddrinfo): Ditto.
580 (ipv4_getaddrinfo): Ditto.
581 (ipv4_getnameinfo): Ditto.
582 (gai_errmap_t): New structure holding error code - error string mapping.
583 (cygwin_gai_strerror): New function implementing gai_strerror.
584 (w32_to_gai_err): New static function.
585 (get_ipv6_funcs): Ditto.
586 (load_ipv6_funcs): Ditto.
587 (cygwin_freeaddrinfo): New function implementing freeaddrinfo.
588 (cygwin_getaddrinfo): New function implementing getaddrinfo.
589 (cygwin_getnameinfo): New function implementing getnameinfo.
590 * include/netdb.h: Include stdint.h and cygwin/socket.h. Define
591 data types and macros used by getaddrinfo and friends. Declare
592 freeaddrinfo, gai_strerror, getaddrinfo and getnameinfo.
593 * include/cygwin/in.h: Add IPv6 related IPPROTOs. Remove definition
594 of struct sockaddr_in6. Include cygwin/in6.h instead.
595 * include/cygwin/in6.h: New header file defining IPv6 releated
596 data types and macros.
597 * include/cygwin/socket.h: Enable AF_INET6 and PF_INET6. Add
598 IPv6 related socket options.
599 * include/cygwin/version.h: Bump API minor number.
601 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
603 * autoload.cc (DsGetDcNameA): Define.
604 (NetGetAnyDCName): Define.
605 * security.cc: Include dsgetdc.h.
606 (DsGetDcNameA): Declare.
607 (DS_FORCE_REDISCOVERY): Define.
608 (get_logon_server): Add bool parameter to control rediscovery of DC.
609 Use DsGetDcNameA function if supported, NetGetDCName/NetGetAnyDCName
611 (get_server_groups): Rediscover DC if get_user_groups fails and
613 (get_reg_security): Use correct error code macro when testing
614 RegGetKeySecurity return value.
615 * security.h (get_logon_server): Remove default vaue from wserver
616 parameter. Add rediscovery parameter.
617 * uinfo.cc (cygheap_user::env_logsrv): Accomodate rediscovery parameter
618 in call to get_logon_server.
620 2006-07-05 Christopher Faylor <cgf@timesys.com>
622 * sortdin: Ignore all leading underscores when deriving a sort key.
623 * cygwin.din: Resort.
625 2006-07-05 Christopher Faylor <cgf@timesys.com>
627 * sortdin: New program.
630 2006-07-05 Corinna Vinschen <corinna@vinschen.de>
632 * fhandler.h (fhandler_socket::wait): Reset default timeout to 10ms.
634 2006-07-05 Corinna Vinschen <corinna@vinschen.de>
636 * path.cc (path_conv::check): Ignore has_ea setting, it's always unset
637 at this point anyway.
638 (get_symlink_ea): Remove.
639 (set_symlink_ea): Remove.
640 (symlink_worker): Drop writing symlink into NTFS extended attributes.
641 (symlink_info::check): Drop reading symlinks from NTFS extended
644 2006-07-04 Christopher Faylor <cgf@timesys.com>
646 * libc/rexec.cc (cygwin_rexec): Obvious (?) fix to correct a gcc
647 warning - set port to zero first thing in the function.
649 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
651 * signal.cc (signal): Set sa_mask to sig.
653 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
655 * Makefile.in (DLL_OFILES): Add rexec.o.
656 * autoload.cc (inet_network): Drop definition.
658 * net.cc (rexec): Drop extern declaration.
659 (inet_network): Ditto.
660 (cygwin_inet_network): Implement using inet_addr.
661 (cygwin_rexec): Remove.
662 * libc/rexec.cc: New file.
664 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
666 * fhandler_socket.cc (fhandler_socket::listen): Allow listening on
669 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
671 * fhandler.h (fhandler_socket::wait): Set default timeout to INFINITE.
673 2006-07-03 Corinna Vinschen <corinna@vinschen.de>
675 * autoload.cc (NtQueryEaFile): Define.
676 (NtSetEaFile): Define.
677 * fhandler.cc (fhandler_base::open): Use appropriate open flags
678 in query case when allow_ntea is set.
679 * ntdll.h (struct _FILE_GET_EA_INFORMATION): Define.
680 (struct _FILE_FULL_EA_INFORMATION): Define.
681 (NtQueryEaFile): Declare.
682 (NtSetEaFile): Declare.
683 * ntea.cc (read_ea): Rename from NTReadEA and rewrite using
685 (write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile.
686 * path.cc (get_symlink_ea): Make static. Add handle parameter to
687 accomodate new read_ea call.
688 (set_symlink_ea): Make static. Add handle parameter to accomodate new
690 (symlink_worker): Call set_symlink_ea while file is still open.
691 (symlink_info::check): Call get_symlink_ea after file has been opened.
692 * security.cc (get_file_attribute): Accomodate new read_ea call.
693 (set_file_attribute): Accomodate new write_ea call.
694 * security.h (read_ea): Change declaration accordingly.
697 2006-07-03 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
699 * fhandler.h (class dev_console): Add `metabit' indicating the
700 current meta key mode.
701 * fhandler_console.cc (fhandler_console::read): Set the top bit of
702 the character if metabit is true.
703 * fhandler_console.cc (fhandler_console::ioctl): Implement
704 KDGKBMETA and KDSKBMETA commands.
705 * fhandler_tty.cc (process_ioctl): Support KDSKBMETA.
706 (fhandler_tty_slave::ioctl): Send KDGKBMETA and KDSKBMETA to the
708 * include/cygwin/kd.h: New file for the meta key mode.
709 * include/sys/kd.h: New file.
711 2006-07-03 Eric Blake <ebb9@byu.net>
713 * include/stdint.h (UINT8_C, UINT16_C): Unsigned types smaller
714 than int promote to signed int.
716 2006-07-03 Corinna Vinschen <corinna@vinschen.de>
718 * net.cc (cygwin_sendto): Define appropriate parameters using
719 socklen_t type according to SUSv3.
720 (cygwin_recvfrom): Ditto.
721 (cygwin_setsockopt): Ditto.
722 (cygwin_getsockopt): Ditto.
723 (cygwin_connect): Ditto.
724 (cygwin_accept): Ditto.
725 (cygwin_bind): Ditto.
726 (cygwin_getsockname): Ditto.
727 (cygwin_getpeername): Ditto.
728 (cygwin_recv): Ditto.
729 (cygwin_send): Ditto.
730 * include/cygwin/socket.h (socklen_t): Typedef and define.
731 * include/sys/socket.h: Declare socket functions using socklen_t type.
733 2006-07-02 Christopher Faylor <cgf@timesys.com>
735 * include/cygwin/version.h: Bump DLL minor version number to 21.
737 2006-06-30 Corinna Vinschen <corinna@vinschen.de>
739 * net.cc (cygwin_sendto): Allow zero-sized packets.
740 (cygwin_sendmsg): Ditto.
742 2006-06-26 Corinna Vinschen <corinna@vinschen.de>
744 Revert patches from 2005-10-22 and 2006-06-14 to use event driven
745 accept and connect back to using select:
746 * fhandler.h (class fhandler_socket): Remove accept_mtx.
747 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop
748 initializing accept_mtx.
749 (fhandler_socket::accept): Drop event handling.
750 (fhandler_socket.cc (fhandler_socket::connect): Ditto.
751 (fhandler_socket::dup): Drop accept_mtx handling.
752 (fhandler_socket::listen): Ditto.
753 (fhandler_socket::prepare): Ditto.
754 (fhandler_socket::release): Ditto.
755 (fhandler_socket::close): Ditto.
756 * net.cc (cygwin_accept): Revert to calling cygwin_select to
757 implement interuptible accept.
758 (cygwin_connect): Ditto for connect.
760 2006-06-22 Christopher Faylor <cgf@timesys.com>
762 * fhandler_fifo.cc (fhandler_fifo::open): Release process lock and grab
763 a system-wide mutex to prevent a deadlock and a race.
764 * sync.h (lock_process): Make fhandler_fifo a friend.
766 * smallprint.c (__small_vsprintf): Cosmetic change.
768 2006-06-15 Corinna Vinschen <corinna@vinschen.de>
770 * cygwin.din: Export __srget_r, __swbuf_r.
771 * include/cygwin/version.h: Bump API minor number to 156.
773 2006-06-14 Corinna Vinschen <corinna@vinschen.de>
775 * fhandler.h (class fhandler_socket): Add private mutex handle
777 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
779 (fhandler_socket::dup): Duplicate accept_mtx, if available.
780 (fhandler_socket::listen): Create accept_mtx before trying to listen.
781 (fhandler_socket::prepare): Wait for accept_mtx if available to
782 serialize accepts on the same socket.
783 (fhandler_socket::release): Release accept_mtx.
784 (fhandler_socket::close): Close accept_mtx on successful closesocket.
786 2006-06-12 Christopher Faylor <cgf@timesys.com>
788 * fhandler_tty.cc (fhandler_pty_master::close): Always close
789 from_master/to_master since we always have copies of these handles.
791 2006-06-12 Corinna Vinschen <corinna@vinschen.de>
793 * include/sys/wait.h: Move definition of wait constants from here...
794 * include/cygwin/wait.h: ...to here. New file.
795 * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3.
797 2006-06-12 Pierre Humblet Pierre.Humblet@ieee.org
799 * heap.cc (heap_init): Only commit if allocsize is not zero.
801 2006-06-12 Corinna Vinschen <corinna@vinschen.de>
803 * net.cc (fdsock): Disable raising buffer sizes. Add comment to
806 2006-06-04 Christopher Faylor <cgf@timesys.com>
808 * ioctl.cc (ioctl): Accommodate change in reported pty master device
810 * select.cc (peek_pipe): Ditto.
812 2006-06-04 Christopher Faylor <cgf@timesys.com>
814 * cygtls.h (CYGTLS_PADSIZE): Reset to a size that XP SP1 seems to like.
815 * tlsoffsets.h: Regenerate.
817 2006-06-03 Christopher Faylor <cgf@timesys.com>
819 * cygthread.cc (cygthread::terminate_thread): In debugging output, use
820 name of thread being terminated rather than thread doing the
823 * fhandler.h (fhandler_pty_master::slave): Delete.
824 (fhandler_pty_master::get_unit): Ditto.
825 (fhandler_pty_master::setup): Change argument declaration to
826 accommodate new usage.
827 * fhandler_tty.cc (fhandler_tty_master::init): Remove obsolete slave
828 assignment. Pass argument to setup indicating that this is a tty.
829 (fhandler_tty_slave::open): Use dev() method rather than referencing
831 (fhandler_pty_master::open): Don't create archetype based on ptym
832 device number. Set device number to use DEV_TTYM_MAJOR and tty number.
833 Pass argument to setup indicating that this is a pty.
834 (fhandler_pty_master::setup): Change single argument to a flag
835 indicating whether we're creating a pty and use appropriately.
836 Calculate 't' variable here rather than in caller.
838 * fhandler_dsp.cc (fhandler_dev_dsp::open): Use dev() method rather
839 than referencing pc.dev directly.
841 2006-06-03 Christopher Faylor <cgf@timesys.com>
843 * dcrt0.cc (dll_crt0_0): Call tty_list::init_session here.
844 (dll_crt0_1): Reflect renaming from tty_init to tty::init_session.
845 (do_exit): Reflect moving of tty_terminate into tty_list.
846 * exceptions.cc (events_init): Move tty_mutex stuff elsewhere.
847 * fhandler_console.cc (set_console_title): Use lock_ttys class.
848 * fhandler_termios.cc (fhandler_termios::bg_check): Make debug output
850 * fhandler_tty.cc (fhandler_tty_slave::open): Reflect move of
851 attach_tty into tty_list class. Don't attempt to grab master end of
852 pty if master doesn't exist.
853 (fhandler_pty_master::open): Reflect move of allocate_tty into tty_list
854 class. Use lock_ttys::release to release mutex. Improve debugging
856 (fhandler_pty_master::setup): Remove if 0'ed block. Fix argument to
857 SetNamedPipeHandleState.
858 * pinfo.cc (_pinfo::set_ctty): Lock ttys before setting sid/pgid.
859 Improve debugging. Add temporary debugging.
860 * tty.cc (tty_list::init_session): New function.
861 (tty::init_session): Rename from tty_init. Reflect move of attach_tty
863 (tty::create_master): Rename from create_tty_master.
864 (tty_list::attach): Rename from attach_tty. Reflect renaming of
865 connect_tty to connect. Ditto for allocate_tty.
866 (tty_terminate): Delete.
867 (tty_list::terminate): Subsume tty_terminate. Use lock_ttys rather
868 than manipulating mutex directly.
869 (tty_list::allocate): Rename from allocate_tty. Use lock_ttys rather
870 than manipulating mutex directly. Don't set sid here since linux
871 apparently doesn't do this. Reflect move of create_tty_master into
873 (lock_ttys::lock_ttys): Define new constructor.
874 (lock_ttys::release): New function.
875 * tty.h (tty::exists): Return false immediately if !master_pid.
876 (tty::set_master_closed): Define new function.
877 (tty::create_master): Ditto.
878 (tty::init_session): Ditto.
879 (tty_list::mutex): New field.
880 (tty_list::allocate): Define new function.
881 (tty_list::connect): Ditto.
882 (tty_list::attach): Ditto.
883 (tty_list::init_session): Ditto.
884 (lock_ttys): New class.
885 (tty_init): Delete declaration.
886 (tty_terminate): Ditto.
888 (create_tty_master): Ditto.
890 2006-06-03 Christopher Faylor <cgf@timesys.com>
892 * Makefile.in (libdl.a): New library.
894 2006-06-03 Christopher Faylor <cgf@timesys.com>
896 * fhandler_tty.cc (fhandler_pty_master::close): Don't close handles if
898 (fhandler_pty_master::setup): Make sure that original handle is closed
899 when changing inheritance.
900 (fhandler_pty_master::fixup_after_fork): Set from_master/to_master to
902 (fhandler_pty_master::fixup_after_exec): Clear from_master/to_master
905 2006-06-03 Christopher Faylor <cgf@timesys.com>
907 * cygheap.cc (init_cygheap::close_ctty): Remove obsolete code.
908 * dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've
909 run fixup_after_exec.
910 * dtable.cc (dtable::fixup_after_exec): Add debugging output.
911 * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of
913 (fhandler_tty_common::close): Remove obsolete code.
914 (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done
915 in dtable's fixup_after_exec. (revisit later?)
916 (fhandler_pty_master::fixup_after_exec): Ditto.
918 2006-06-02 Christopher Faylor <cgf@timesys.com>
920 * cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision
922 * tlsoffsets.h: Regenerate.
924 * dcrt0.cc (break_here): Define unconditionally for use elsewhere.
925 Call DebugBreak, if appropriate.
926 (initial_env): Rely on break_here() to call DebugBreak.
927 * exceptions.cc (try_to_debug): Ditto.
929 2006-06-02 Christopher Faylor <cgf@timesys.com>
931 * fhandler.cc (fhandler_base::fixup_after_exec): Declare here.
932 * fhandler.h (fhandler_base::fixup_after_exec): Make non-inline.
933 (fhandler_termios::fixup_after_fork): Delete declaration.
934 (fhandler_termios::fixup_after_exec): Ditto.
935 (fhandler_tty_common::inuse): Remove.
936 (fhandler_tty_common::dup): Delete declaration.
937 (fhandler_tty_common::fixup_after_fork): Ditto.
938 (fhandler_tty_slave::fixup_after_exec): Declare new function.
939 (fhandler_pty_master::dwProcessId): New variable.
940 (fhandler_pty_master::from_master): Ditto.
941 (fhandler_pty_master::to_master): Ditto.
942 (fhandler_pty_master::setup): New function.
943 (fhandler_pty_master::fixup_after_fork): Ditto.
944 (fhandler_pty_master::fixup_after_exec): Ditto.
945 * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Delete
947 (fhandler_termios::fixup_after_fork): Ditto.
948 * fhandler_tty.cc (fhandler_tty_master::init): Use fhandler_pty_master
949 setup function rather than obsolete tty::common_init. Delete obsolete
951 (fhandler_tty_slave::fhandler_tty_slave): Set inuse to NULL here.
952 (fhandler_tty_slave::open): Change debugging output for clarity. Check
953 for different things when doing a sanity check on the tty. Reflect the
954 fact that master_pid now is the cygwin pid rather than the windows pid.
955 Use "arch" rather than "archetype" for consistency.
956 (fhandler_tty_slave::close): Close inuse here.
957 (fhandler_tty_slave::dup): Remove old if 0'ed code.
958 (fhandler_pty_master::dup): New function. Handles pty master
960 (fhandler_pty_master::fhandler_pty_master): Zero pty_master specific
962 (fhandler_pty_master::open): Implement using archetypes, similar to
963 slave. Use fhandler_pty_master setup function rather than obsolete
964 tty::common_init. Don't set inuse.
965 (fhandler_tty_common::close): Don't deal with inuse. Delete old if
967 (fhandler_pty_master::close): Implement using archetypes. Close
968 from_master and to_master.
969 (fhandler_tty_common::set_close_on_exec): Just set close_on_exec flag
970 here since everything uses archetypes now.
971 (fhandler_tty_common::fixup_after_fork): Delete definition.
972 (fhandler_tty_slave::fixup_after_exec): Define new function.
973 (fhandler_pty_master::setup): New function, derived from
975 (fhandler_pty_master::fixup_after_fork): New function.
976 (shared_info.h): Reset SHARED_INFO_CB to reflect new tty size.
977 * tty.cc (tty_list::terminate): Close individual handles from
979 (tty::master_alive): Delete.
980 (tty::make_pipes): Ditto.
981 (tty::common_init): Ditto.
982 * tty.h (tty::from_slave): Delete.
983 (tty::to_slave): Ditto.
984 (tty::common_init): Delete declaration.
985 (tty::make_pipes): Ditto.
986 (tty::master_pid): Define as pid_t since it is now a cygwin pid.
988 2006-06-01 Christopher Faylor <cgf@timesys.com>
990 * cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here.
991 Let the caller do that.
992 * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here
993 to allow fixup_after_exec functions to use it.
995 * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with
997 * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls
998 before seeing if it is initialized.
999 * gendef (_sigfe_maybe): Ditto.
1000 * dcrt0.cc (dll_crt0_1): Remove static, use just one argument.
1001 * dll_init.cc (dllcrt0_info): New structure.
1002 (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that
1003 we'll always be assured of having something like a tls.
1004 (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0.
1005 Unconditionally call _my_tls.init_exception_handler now that we are
1006 assured of having a tls. Change variable name from "linking" to "linked".
1007 * winsup.h (dll_crt0_1): Declare.
1008 (dll_dllcrt0_1): Ditto.
1010 2006-05-30 Christopher Faylor <cgf@timesys.com>
1012 * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.
1014 2006-05-29 Christopher Faylor <cgf@timesys.com>
1016 * winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork
1019 2006-05-28 Christopher Faylor <cgf@timesys.com>
1021 * sigproc.cc (child_info::proc_retry): Mask all of the bits we're
1022 interested in, which includes bits above and below 0xc0000000.
1024 2006-05-27 Christopher Faylor <cgf@timesys.com>
1026 * dll_init.cc (dll_dllcrt0): Previous change didn't work very well with
1027 fork. Semi-revert it but change name of variable to something that
1030 2006-05-27 Christopher Faylor <cgf@timesys.com>
1032 * thread.cc (verifyable_object_isvalid): Check for NULL specifically.
1034 2006-05-27 Christopher Faylor <cgf@timesys.com>
1036 * dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if
1037 we've finished initializing (Thanks to Gary Zablackis for noticing this
1038 problem). Just use cygwin_finished_initializing rather than defining a
1041 2006-05-25 Christopher Faylor <cgf@timesys.com>
1043 * debug.h (ModifyHandle): Define new macro.
1044 (modify_handle): Declare new function.
1045 * debug.cc (modify_handle): Define new function.
1046 * fhandler.h (fhandler_base::fork_fixup): Change return value from void
1048 * fhandler.cc (fhandler_base::fork_fixup): Return true if fork fixup has
1050 * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance of
1051 protected handle via ModifyHandle if DEBUGGING.
1052 (fhandler_pipe::fixup_after_fork): Protect guard handle if fork fixup
1055 2006-05-24 Christopher Faylor <cgf@timesys.com>
1057 * cygtls.cc (_cygtls::call): Call call2 using _my_tls.
1058 (_cygtls::init_exception_handler): Always replace existing exception
1059 handler with cygwin exception handler.
1060 * cygtls.h (_cygtls::call2): Remove static designation.
1061 * dcrto.cc (dll_crt0_1): Define in a way that allows calling via
1063 (_initialize_main_tls): Delete.
1064 (_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here.
1065 * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE.
1066 * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define.
1067 * tlsoffsets.h: Regenerate.
1069 2006-05-24 Christopher Faylor <cgf@timesys.com>
1071 * configure.in: Update to newer autoconf.
1072 (thanks to Steve Ellcey)
1073 * configure: Regenerate.
1074 * aclocal.m4: New file.
1076 2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
1078 * fhandler.cc (readv): Remove nonsensical assert.
1080 2006-05-23 Christopher Faylor <cgf@timesys.com>
1082 * select.cc (start_thread_socket): Delay setting thread local exitsock
1083 until we know it's correct. Return correct value on error.
1085 2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
1086 Christopher Faylor <cgf@timesys.com>
1088 * select.cc (start_thread_socket): Clean up exitsock in case of error.
1089 Use si->exitcode consistently.
1091 2006-05-21 Christopher Faylor <cgf@timesys.com>
1093 * child_info.h (_CI_SAW_CTRL_C): New enum.
1094 (CURR_CHILD_INFO_MAGIC): Reset.
1095 (saw_ctrl_c): New function.
1096 (set_saw_ctrl_c): Ditto.
1097 * sigproc.cc (child_info::proc_retry): Return EXITCODE_OK if we get
1098 STATUS_CONTROL_C_EXIT and we actually saw a CTRL-C.
1099 * spawn.cc (dwExeced): Delete.
1100 (chExeced): New variable.
1101 (spawn_guts): Set chExeced;
1102 * exceptions.cc (dwExeced): Delete declaration.
1103 (chExeced): Declare.
1104 (ctrl_c_handler): Detect if we're an exec stub process and set a flag,
1107 * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Add
1108 extra DEBUGGING test.
1110 * pinfo.cc: Fix comment.
1112 2006-05-21 Christopher Faylor <cgf@timesys.com>
1114 * fhandle.h (fhandler_pipe::create_guard): Revert change which
1115 eliminated SECURITY_ATTRIBUTES argument.
1116 * pipe.cc (fhandler_pipe::open): Duplicate guard from other process and
1117 protect it appropriately. Eliminate unneeded writepipe_exists
1118 temporary variable. Set inheritance appropriately.
1119 (fhandler_pipe::set_close_on_exec): Revert change which eliminated
1120 handling guard inheritance.
1121 (fhandler_pipe::fixup_after_fork): Ditto. Use correct name of entity
1122 being checked by fork_fixup.
1123 (fhandler_pipe::fixup_after_exec): Don't bother with guard here.
1124 (fhandler_pipe::dup): Cosmetic changes and revert creation of
1125 writepipe_exists as noninheritable.
1126 (fhandler_pipe::create): Revert change which eliminated
1127 SECURITY_ATTRIBUTES argument. Revert change which always made
1128 writepipe_exists noninheritable.
1130 2006-05-21 Christopher Faylor <cgf@timesys.com>
1132 * debug.cc (add_handle): Print handle value when collision detected.
1133 * dtable.cc (dtable::stdio_init): Cosmetic change.
1134 * fhandler.h (fhandler_base::create_read_state): Protect handle.
1135 (fhandler_pipe::create_guard): Ditto. Always mark the handle as
1137 (fhandler_pipe::is_slow): Return boolean value rather than numeric 1.
1138 * pipe.cc (fhandler_pipe::fhandler_pipe): Always flag that we need fork
1140 (fhandler_pipe::open): Don't pass security attributes to create_guard.
1141 (fhandler_pipe::set_close_on_exec): Don't handle guard here.
1142 (fhandler_pipe::close): Accommodate now-protected guard handle.
1143 (fhandler_pipe::fixup_in_child): Don't protect read_state here.
1144 (fhandler_pipe::fixup_after_exec): Close guard handle if close_on_exec.
1145 (fhandler_pipe::fixup_after_fork): Don't bother with guard here.
1146 (fhandler_pipe::dup): Don't set res to non-error prematurely. Use
1147 boolean values where appropriate. Protect guard and read_state.
1148 (fhandler_pipe::create): Don't call need_fork_fixup since it is now the
1149 default. Don't protect read_state or guard.
1151 * pipe.cc (fhandler_base::ready_for_read): Use bool values for "avail".
1153 * spawn.cc (spawn_guts): Set cygheap->pid_handle as inheritable when
1156 2006-05-15 Lev Bishop <lev.bishop+cygwin@gmail.com>
1157 Christopher Faylor <cgf@timesys.com>
1159 * select.cc (fhandler_pipe::ready_for_read): Actually get the guard
1160 mutex for blocking reads.
1162 2006-05-20 Christopher Faylor <cgf@timesys.com>
1164 * fhandler_tty.cc (fhandler_tty::close): Remove problematic hExeced guard.
1166 2006-05-20 Christopher Faylor <cgf@timesys.com>
1168 * fhandler_tty.cc (fhandler_tty_slave::open): Reinstate call to
1169 need_invisible on first pty open.
1171 2006-05-18 Christopher Faylor <cgf@timesys.com>
1173 * fhandler_console.cc (fhandler_console::need_invisible): Allocate an
1174 invisible window station when ctty != TTY_CONSOLE.
1176 2006-05-16 Christopher Faylor <cgf@timesys.com>
1178 * cygtls.cc (_cygtls::remove): Don't test for initialization since
1179 this function will always be called when _my_tls is initialized.
1180 * init.cc (dll_entry): Don't attempt to remove tls info if _my_tls is
1181 obviously not even available.
1183 2006-05-15 Christopher Faylor <cgf@timesys.com>
1185 * sigproc.cc (no_signals_available): Detect hwait_sig ==
1186 INVALID_HANDLE_VALUE.
1187 (wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT.
1189 2006-05-15 Christopher Faylor <cgf@timesys.com>
1191 * cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and
1193 * cygtls.h (_my_tls::padding): Delete.
1194 (CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the
1196 * dcrt0.cc (initialize_main_tls): Change return to void.
1197 * gentls_offsets: Treat const specially, too. Keep going after a '}'
1198 is found. Change negative offset calculation to use CYGTLS_PADSIZE.
1199 * init.cc (_my_oldfunc): New variable.
1200 (threadfunc_fe): Use stored tls value for oldfunc rather than blindly
1201 writing to the stack.
1202 (munge_threadfunc): Set oldfunc in tls.
1203 (dll_entry): Initialize tls allocation.
1204 * tlsoffsets.h: Regenerate.
1206 2006-05-13 Christopher Faylor <cgf@timesys.com>
1208 * ntdll.h (STATUS_INVALID_INFO_CLASS): Conditionalize.
1210 2006-05-10 Brian Dessent <brian@dessent.net>
1212 * Makefile.in (clean): Also delete *.dbg.
1214 2006-05-08 Christian Franke <Christian.Franke@t-online.de>
1216 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix typo which
1217 caused test for ".." to be skipped.
1219 2006-05-02 Christopher Faylor <cgf@timesys.com>
1221 * external.cc (cygwin_internal): Set errno on failure.
1223 2006-04-27 Corinna Vinschen <corinna@vinschen.de>
1225 * pipe.cc (DEFAULT_PIPEBUFSIZE): Raise to 64K.
1227 2006-04-26 Corinna Vinschen <corinna@vinschen.de>
1229 * fhandler.h (fhandler_base): Change fstat_helper prototype
1230 to take file size and inode number as 64 bit values.
1231 * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc
1232 (FS_IS_SAMBA_WITH_QUOTA): Ditto.
1233 (path_conv::hasgood_inode): Delete.
1234 (path_conv::is_samba): Delete.
1235 (path_conv::isgood_inode): Centralized function to recognize
1236 a good inode number.
1237 (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size.
1238 Accomodate argument change in fstat_helper.
1239 (fhandler_base::fstat_by_name): Ditto.
1240 (fhandler_base::fstat_helper): Accomodate argument change. Call
1241 path_conv::isgood_inode to recognize good inodes.
1242 (fhandler_disk_file::opendir): Explain Samba weirdness here.
1243 Call path_conv::fs_is_samba instead of path_conv::is_samba.
1244 (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS
1245 as valid return code from NtQueryDirectoryFile to indicate that
1246 FileIdBothDirectoryInformation is not supported.
1247 Call path_conv::isgood_inode to recognize good inodes.
1248 * ntdll.h (STATUS_INVALID_INFO_CLASS): Define.
1249 * path.cc (fs_info::update): Rework file system recognition
1250 and set appropriate flags.
1251 * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags.
1252 Constify pure read accessors.
1254 2006-04-24 Christopher Faylor <cgf@timesys.com>
1256 * environ.cc (getearly): Force correct dereference order when
1257 inspecting environ table.
1259 2006-04-24 Corinna Vinschen <corinna@vinschen.de>
1261 * select.cc (thread_pipe): Raise sleep time only every 8th iteration.
1262 (thread_mailslot): Ditto.
1264 2006-04-23 Corinna Vinschen <corinna@vinschen.de>
1265 Christopher Faylor <cgf@timesys.com>
1267 * select.cc (thread_pipe): Raise sleep time dynamically to speed up
1268 select on pipes when copying lots of data.
1269 (thread_mailslot): Ditto for mailslots.
1271 2006-04-22 Christopher Faylor <cgf@timesys.com>
1273 * signal.cc (abort): On second thought, just set incyg once.
1275 2006-04-22 Christopher Faylor <cgf@timesys.com>
1277 * signal.cc (abort): Set incyg manually to help get a reliable gdb
1279 * cygwin.din (abort): Make NOSIGFE.
1281 2006-04-21 Pierre Humblet Pierre.Humblet@ieee.org
1282 Christopher Faylor <cgf@timesys.com>
1284 * environ.cc (getearly): Use GetEnvironmentVariable and cmalloc instead
1285 of GetEnvironmentStrings.
1286 (environ_init): Revert rawenv stuff.
1288 2006-04-21 Christopher Faylor <cgf@timesys.com>
1290 * environ.cc (rawenv): Make this variable a file-scope static.
1291 (getearly): Rename 's' variable to 'len' since 's' is used fairly
1292 consistently throughout cygwin as a string variable. Remove rawenv
1293 declaration. Perform other minor cleanups.
1294 (environ_init): Remove rawenv declaration. Only set rawenv to
1295 GetEnvironmentStrings() if it has not already been set. Properly free
1296 rawenv in all cases.
1298 2006-04-21 Christopher Faylor <cgf@timesys.com>
1300 * tty.h (tty::hwnd): Move to tty_min.
1301 (tty::gethwnd): Ditto.
1302 (tty::sethwnd): Ditto.
1303 (tty_min::hwnd): Receive variable from tty class.
1304 (tty_min::gethwnd): Receive function from tty classs.
1305 (tty_min::sethwnd): Ditto.
1306 * dtable.cc (dtable::stdio_init): Only call init_console_handler when
1307 we actually own the console.
1308 * fhandler_console.cc (fhandler_console::get_tty_stuff): Set tty's hwnd
1310 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Semi-reinstate
1311 handling of console when pgrp is set.
1313 2006-04-21 Pierre Humblet <Pierre.Humblet@ieee.org>
1314 Corinna Vinschen <corinna@vinschen.de>
1316 * environ.cc (getearly): New function.
1317 (findenv_func): New function pointer, predefined to getearly.
1318 (getenv): Call findenv function over the findenv_func pointer.
1319 (environ_init): Change findenv_func pointer to my_findenv after Cygwin
1320 environment is initialized.
1322 2006-04-21 Lars Munch <lars@segv.dk>
1324 * include/asm/byteorder.h (__ntohl): Fix the missing uint32_t.
1326 2006-04-21 Corinna Vinschen <corinna@vinschen.de>
1328 * fhandler_socket.cc (fhandler_socket::wait): Reorder setting
1329 WSAError to avoid spurious errors with WSAError set to 0.
1331 2006-04-21 Corinna Vinschen <corinna@vinschen.de>
1333 * include/asm/byteorder.h: Include stdint.h. Per standard, change
1334 datatypes in ntohX and htonX functions to uintXX_t types.
1336 2006-04-18 Christopher Faylor <cgf@timesys.com>
1338 * exceptions.cc (ctrl_c_handler): Only exit TRUE on CTRL_LOGOFF_EVENT
1339 when we have actually handled the event.
1341 2006-04-17 Eric Blake <ebb9@byu.net>
1343 * mktemp.cc (_gettemp): Open temp files in binary mode.
1345 2006-04-14 Corinna Vinschen <corinna@vinschen.de>
1347 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use UINT32_MAX
1348 instead of UINT_MAX.
1350 2006-04-14 Corinna Vinschen <corinna@vinschen.de>
1352 * fhandler_disk_file.cc (path_conv::hasgood_inode): Make inline.
1353 Drop remote fs handling entirely since unreliable inode numbers
1354 are now recognized differently.
1355 (path_conv::is_samba): Make inline.
1356 (fhandler_disk_file::opendir): Reformat comment.
1357 (fhandler_base::fstat_helper): Special case remote file systems
1358 returning (unreliable) 32 bit inode numbers.
1359 (fhandler_disk_file::readdir): Ditto.
1360 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto.
1362 2006-04-13 Christopher Faylor <cgf@timesys.com>
1364 * spawn.cc (spawn_guts): Move ch.set() call back to where it was
1367 2006-04-13 Corinna Vinschen <corinna@vinschen.de>
1369 * sysconf.cc (sysconf): Add _SC_THREADS, _SC_THREAD_ATTR_STACKSIZE,
1370 _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PROCESS_SHARED,
1371 _SC_THREAD_SAFE_FUNCTIONS, _SC_TIMERS handling.
1373 2006-04-12 Corinna Vinschen <corinna@vinschen.de>
1374 Christopher Faylor <cgf@timesys.com>
1376 * spawn.cc (spawn_guts): Revert patch which treated derived cygwin
1377 programs differently from those which are mounted with -X. Pass extra
1378 argument to linebuf::fromargv.
1379 * winf.h (MAXCYGWINCMDLEN): New define.
1380 (linebuf::finish): Add a new argument denoting when command line
1382 (linebuf::fromargv): Ditto.
1383 * winf.cc (linebuf::finish): Implement above change.
1384 (linebuf::fromargv): Ditto.
1386 2006-04-11 Christopher Faylor <cgf@timesys.com>
1388 * Makefile.in (DLL_OFILES): Add winf.o.
1389 * spawn.cc: Move command line handling stuff into winf.cc.
1391 * winf.cc: New file.
1393 2006-04-05 Christopher Faylor <cgf@timesys.com>
1395 * fhandler_socket.cc: Move iptypes.h include after winsock2 since it
1399 2006-04-05 Christopher Faylor <cgf@timesys.com>
1401 * dcrt0.cc (dll_crt0_0): Move user_data->{resourcelocks,threadinterface}
1402 initialization here from dll_crt0_1.
1403 (dll_crt0_1): See above.
1405 2006-04-04 Corinna Vinschen <corinna@vinschen.de>
1407 * net.cc (fdsock): Raise default SO_RCVBUF/SO_SNDBUF buffer sizes to
1408 the same values as on Linux.
1410 2006-04-03 Christopher Faylor <cgf@timesys.com>
1412 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
1413 (child_info_fork::alloc_stack): Move into this class.
1414 (child_info_fork::alloc_stack_hard_way): Ditto.
1415 * dcrt0.cc (child_info_fork::alloc_stack): Ditto.
1416 (child_info_fork::alloc_stack_hard_way): Ditto.
1417 (_dll_crt0): Reference alloc_stack via fork_info.
1419 2006-04-03 Corinna Vinschen <corinna@vinschen.de>
1421 * spawn.cc (linebuf::finish): Drop argument. Don't check command line
1423 (spawn_guts): Remove wascygexec. Check real_path.iscygexec instead.
1424 Accommodate change to linebuf::finish.
1426 2006-04-03 Christopher Faylor <cgf@timesys.com>
1428 * dcrt0.cc (sm): Delete.
1429 (alloc_stack_hard_way): Figure out where the stack lives here rather
1430 than relying on previously filled out information which has been
1431 invalid since 1.5.19.
1433 2006-03-31 Corinna Vinschen <corinna@vinschen.de>
1435 * fhandler_disk_file.cc (FS_IS_SAMBA_WITH_QUOTA): New define.
1436 (path_conv::hasgood_inode): Recognize Samba with quota support
1438 (path_conv::is_samba): Ditto. Fix comment to include Samba version
1439 numbers for later reference.
1441 2006-03-30 Corinna Vinschen <corinna@vinschen.de>
1443 * security.h (sec_user_nih): Make sid1 argument mandatory.
1446 2006-03-29 Christopher Faylor <cgf@timesys.com>
1448 * sigproc.cc (wait_for_sigthread): Use the current user sid when
1449 setting up the signal pipe rather than relying on (eventually) the
1452 2006-03-29 Christopher Faylor <cgf@timesys.com>
1454 * dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so
1455 that it can be used by subsequent startup functions.
1456 (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING.
1457 (dll_crt0_1): Move user_data->{resourcelocks,threadinterface}
1458 initialization here from dll_crt0_0.
1459 * fork.cc (frok::child): Tell wait_for_sigthread that this is fork.
1460 (frok::parent): Only initialize start_time once. Tighten time when
1461 we're "deimpersonated".
1462 * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff.
1463 Add debugging output.
1464 (wait_for_sigthread): Accept an argument which illustrates whether we
1466 (wait_sig): Avoid using myself pointer.
1467 * winsup.h ((wait_for_sigthread): Reflect change to argument.
1469 2006-03-26 Christopher Faylor <cgf@timesys.com>
1471 * spawn.cc (spawn_guts): Close handles if we know that we will not be
1472 seeing a sync event from the child.
1474 2006-03-26 Christopher Faylor <cgf@timesys.com>
1476 * sigproc.cc (wait_sig): Move myself manipulation...
1477 (wait_for_sigthread): ...to here.
1479 2006-03-24 Corinna Vinschen <corinna@vinschen.de>
1481 * fhandler_floppy.cc: Include ntdef.h and ntdll.h.
1482 (fhandler_dev_floppy::get_drive_info): Rearrange so that now
1483 NtQueryVolumeInformationFile is called on drives which don't support
1484 IOCTL_DISK_GET_DRIVE_GEOMETRY.
1485 * ntdll.h (struct _FILE_FS_SIZE_INFORMATION): Add.
1486 (enum _FSINFOCLASS): Add missing values.
1488 2006-03-23 Christopher Faylor <cgf@timesys.com>
1490 * fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Make
1491 error message more explicit.
1492 * pinfo.cc (_pinfo::commune_request): Don't lock process unless we're
1495 2006-03-23 Christopher Faylor <cgf@timesys.com>
1497 * dcrt0.cc (child_info_spawn::handle_spawn): Don't initialize the
1498 console handler here.
1499 * dtable.cc (dtable::stdio_init): Initialize console handler here.
1501 2006-03-23 Christopher Faylor <cgf@timesys.com>
1503 * sigproc.cc (sigalloc): Don't set SA_RESTART here.
1504 * signal.cc (_SA_NORESTART): New flag.
1505 (sigaction_worker): New function, derived from sigaction. Don't set
1506 internal flags unless called internally.
1507 (sigaction): Use sigaction_worker.
1508 (signal): Honor new _SA_NORESTART flag.
1509 (siginterrupt): Set _SA_NORESTART flag appropriately. Use
1510 sigaction_worker to set flags.
1511 * include/cygwin/signal.h: Define _SA_INTERNAL_MASK here.
1513 2006-03-22 Corinna Vinschen <corinna@vinschen.de>
1515 * thread.cc (pthread_mutex::is_good_initializer_or_bad_object): Delete.
1516 (pthread_cond::is_good_initializer_or_bad_object): Delete.
1517 (pthread_rwlock::is_good_initializer_or_bad_object): Delete.
1518 (pthread_cond::init): Remove disabled code. Guard assignment to
1519 object to initialize against access violation.
1520 (pthread_rwlock::init): Ditto.
1521 (pthread_mutex::init): Ditto.
1523 2006-03-22 Eric Blake <ebb9@byu.net>
1525 * fhandler.cc (fcntl): Print flags in hex.
1527 2006-03-22 Christopher Faylor <cgf@timesys.com>
1529 * dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved
1530 pinfo_init and uinfo_init here.
1531 (dll_crt0_1): Ditto.
1532 (__dll_crt0): Ditto. Don't call update_envptrs here.
1533 (dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0.
1534 * environ.cc (environ_init): Call it here instead.
1535 * sigproc.cc (my_readsig): New static variable.
1536 (wait_for_sigthread): Set up read pipe here since we are assured that
1537 we have the proper privileges when this is called.
1538 (talktome): Eliminate second argument since it is available as a global
1540 (wait_sig): Reflect use of my_readsig.
1542 2006-03-22 Corinna Vinschen <corinna@vinschen.de>
1544 * thread.cc (pthread_cond::init): Disable validity test of object
1545 to initialize since test of uninitialized content is unreliable.
1546 (pthread_rwlock::init): Ditto.
1547 (pthread_mutex::init): Ditto.
1549 2006-03-21 Christopher Faylor <cgf@timesys.com>
1551 * signal.cc (signal): Don't set SA_RESTART here.
1552 (siginterrupt): White space.
1553 * sigproc.cc (sigalloc): Set SA_RESTART here, on initialization.
1555 2006-03-21 Christopher Faylor <cgf@timesys.com>
1557 * child_info.h (child_status): Fix typo which made it impossible to set
1559 (child_info::isstraced): Booleanize.
1560 (child_info::iscygwin): Ditto.
1561 * sigproc.cc (child_info::child_info): Minor cleanup of flag setting.
1562 * spawn.cc (spawn_guts): Only close_all_files when we know the process
1563 has started successfully.
1565 * exceptions.cc (init_console_handler): Fix indentation.
1567 2006-03-20 Christopher Faylor <cgf@timesys.com>
1569 * dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier.
1570 * pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure.
1571 Return previous pipe handle.
1572 * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value.
1573 * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if
1574 process exits before synchronization.
1576 2006-03-20 Christopher Faylor <cgf@timesys.com>
1578 * child_info.h (child_status): New enum.
1579 (child_info::flag): Rename from 'straced'.
1580 (child_info::isstraced): New function.
1581 (child_info::iscygwin): Ditto.
1582 (child_info_fork::handle_fork): Reparmize.
1583 (child_info_fork::handle_failure): Ditto.
1584 (child_info_spawn::handle_spawn): New function.
1585 * dcrt0.cc (get_cygwin_startup_info): Use isstraced method.
1586 (child_info_spawn::handle_spawn): Define new function from code
1587 previously in dll_crt0_0.
1588 (dll_crt0_0): Move spawn stuff into handle_spawn. Only call
1589 init_console_handler for fork case.
1590 * sigproc.cc (child_info::child_info): Set flag appropriately.
1591 (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin
1593 * spawn.cc (spawn_guts): Remove commented out flag setting.
1595 2006-03-19 Christopher Faylor <cgf@timesys.com>
1597 * pinfo.cc (commune_process): Fix randomly invalid pointer which caused
1598 fifos to work incorrectly.
1600 2006-03-19 Christopher Faylor <cgf@timesys.com>
1602 * dcrt0.cc (dll_crt0_0): Oops. We need to bother with setting
1603 init_console_handler in the fork/exec case.
1605 2006-03-19 Christopher Faylor <cgf@timesys.com>
1607 * dcrt0.cc (dll_crt0_0): Don't bother with setting init_console_handler
1608 here since it will be set later when we discover if we have a ctty or
1610 * exceptions.cc (init_console_handler): Properly remove NULL handler.
1612 2006-03-18 Christopher Faylor <cgf@timesys.com>
1614 * pinfo.h (EXITCODE_OK): Define new constant.
1615 * sigproc.cc (child_info::sync): Return EXITCODE_OK if entering with
1617 (sig_send): Don't complain if sending signals while blocked if the
1618 sender isn't in the main thread.
1620 2006-03-18 Christopher Faylor <cgf@timesys.com>
1622 * child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate.
1623 (child_info::retry): Move here from fork subclass.
1624 (child_info::exit_code): New field.
1625 (child_info::retry_count): Max retry count for process start.
1626 (child_info::proc_retry): Declare new function.
1627 (child_info_fork::retry): Move to parent.
1628 (child_info_fork::fork_retry): Ditto.
1629 * dcrt0.cc (child_info::fork_retry): Rename and move.
1630 (child_info_fork::handle_failure): Move.
1631 (dll_crt0_0): Initialize console handler based on whether we have a
1632 controlling tty or not. Avoid nonsensical check for fork where it can
1634 * environ.cc (set_proc_retry): Rename from set_fork_retry. Set
1635 retry_count in child_info.
1636 (parse_thing): Reflect above change.
1637 * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name.
1638 (ctrl_c_handler): Always return TRUE for the annoying
1640 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to
1641 init_console_handler.
1642 * fhandler_tty.cc (fhandler_tty_slave::open): Just call
1643 mange_console_count here and let it decide what to do with initializing
1644 console control handling.
1645 * fork.cc (fork_retry): Remove definition.
1646 (frok::parent): Define static errbuf and use in error messages (not
1647 thread safe yet). Close pi.hThread as soon as possible. Protect
1648 pi.hProcess as soon as possible. Don't set retry_count. That happens
1649 automatically in the constructor now. Accommodate name change from
1650 fork_retry to proc_retry.
1651 * init.cc (dll_entry): Turn off ctrl-c handling early until we know how
1652 it is supposed to be handled.
1653 * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value
1654 for failure error message. Tweak debug message slightly.
1655 * sigproc.cc (child_info::retry_count): Define.
1656 (child_info::child_info): Initialize retry count.
1657 (child_info::sync): Set exit code if process dies before
1659 (child_info::proc_retry): Rename from child_info_fork::fork_retry. Use
1660 previously derived exit code. Be more defensive about what is
1661 classified as an error exit.
1662 (child_info_fork::handle_failure): Move here from dcrt0.cc.
1663 * spawn.cc (spawn_guts): Maintain error mode when starting new process
1664 to avoid annoying pop ups. Move deimpersonate call within new loop.
1665 Move envblock freeing to end. Loop if process dies prematurely with
1667 * syscalls.cc (setpgid): Remove hopefully unneeded call to
1668 init_console_handler.
1670 2006-03-15 Christopher Faylor <cgf@timesys.com>
1672 * cygheap.cc (init_cygheap::manage_console_count): Turn console control
1673 handler on/off depending on whether we have allocated a console or not.
1674 * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry
1676 (dll_crt0_0): Turn on/off console control depending on whether we have
1677 a controlling tty or not.
1678 * exceptions.cc (init_console_handler): Change BOOL to bool.
1679 * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic
1681 * winsup.h (init_console_handler): Reflect argument type change.
1683 * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate
1684 capability throughout.
1687 2006-03-14 Christopher Faylor <cgf@timesys.com>
1689 * child_info.h (child_info_fork::fork_retry): Declare new function.
1690 * dcrt0.cc (child_info_fork::fork_retry): Define new function.
1691 * fork.cc (frok::parent): Move retry decision into
1692 child_info_fork::fork_retry and honor what it tells us to do.
1693 * sigproc.cc (sig_send): Unhold signals on __SIGEXIT.
1695 2006-03-14 Christopher Faylor <cgf@timesys.com>
1697 * fork.cc (frok::parent): Improve error message.
1699 2006-03-14 Christopher Faylor <cgf@timesys.com>
1701 * dcrt0.cc (main_environ): Initialize to &__cygwin_environment.
1702 (dll_crt0_1): Move resourcelocks, thread interface, pinfo_init, and
1704 (dll_crt0_0): ...to here.
1705 (_dll_crt0): Call update_envptrs here after setting main_environ.
1706 * environ.cc (environ_init): Eliminate initted variable. Don't call
1707 update_envptrs here.
1708 * sigproc.cc (wait_sig): Use my_sendsig when calling CreatePipe to
1709 avoid a dereference.
1711 2006-03-13 Christopher Faylor <cgf@timesys.com>
1713 * child_info.h (child_info_fork::handle_failure): Declare new function.
1714 (child_info_fork::retry): New field.
1715 * dcrt0.cc (__api_fatal_exit_val): Define.
1716 (child_info_fork::handle_failure): Define new function.
1717 (__api_fatal): Exit using __api_fatal_exit_val value.
1718 * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN
1719 environment variable.
1720 (parse_thing): Add "fork_retry" setting.
1721 * fork.cc (fork_retry): Define.
1722 (frok::parent): Reorganize to allow retry of failed child creation if
1723 child signalled that it was ok to do so.
1724 * heap.cc (heap_init): Signal parent via handle_failure when
1726 * pinfo.h (EXITCODE_RETRY): Declare.
1727 * sigproc.cc (child_info::sync): Properly exit with failure condition
1728 if called for fork and didn't see subproc_ready.
1729 * spawn.cc (spawn_guts): Use windows pid as first argument.
1730 * winsup.h: Remove obsolete NEW_MACRO_VARARGS define.
1731 (__api_fatal_exit_val): Declare.
1732 (set_api_fatal_return): Define.
1733 (in_dllentry): Declare.
1734 * exceptions.cc (inside_kernel): Remove unneeded in_dllentry
1737 2006-03-13 Christopher Faylor <cgf@timesys.com>
1739 * dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a
1740 little later. Add a comment.
1741 * fork.cc (resume_child): Make void.
1742 (frok::parent): Only zero pi when necessary. Explicitly zero si. Set
1743 this_errno when child_copy fails. Accommodate change to resume_child.
1744 * sigproc.cc (sigalloc): Move global_sigs initialization here.
1745 (sigproc_init): Move global_sigs.
1746 (sig_send): Just check for flush signals once.
1748 * wincap.h: Define supports_setconsolectrlhandler_null throughout.
1751 2006-03-13 Corinna Vinschen <corinna@vinschen.de>
1753 * autoload.cc (LoadDLLfuncNt): New define to wrap NT native functions.
1754 Use for NT native functions throughout.
1755 * dtable.cc (handle_to_fn): Treat return value of NtQueryObject as
1758 2006-03-12 Christopher Faylor <cgf@timesys.com>
1760 * cygtls.cc (_cygtls::remove): Reset initialized flag right away if we
1761 were previously initialized.
1762 * cygtls.h (_cygtls::initialized): Move nearer to the end to catch
1763 situation when Windows 98 mysteriously changes parts of _my_tls when
1764 thread is detaching.
1765 * gendef (__sigfe_maybe): Simplify slightly.
1766 * tlsoffsets.h: Regenerate.
1768 2006-03-12 Christopher Faylor <cgf@timesys.com>
1770 * cygtls.h (CYGTLS_INITIALIZED): Change to a little more unlikely value.
1771 (CYGTLSMAGIC): Delete.
1772 * dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup.
1773 (_dll_crt0): Don't worry about sync_startup. Just wait for sigthread here.
1774 * dll_init.cc (cygwin_detach_dll): Only pick up tls version of retaddr
1775 if we have a valid tls.
1776 * fork.cc (frok::child): Remove sigproc_init initialization since it
1777 happens much earlier now.
1778 * gendef: Recognize SIGFE_MAYBE.
1779 (fefunc): Generate calls to _sigfe_maybe, if appropriate.
1780 (_sigfe_maybe): New function.
1781 * init.cc (search_for): Always initialize search_for, even on fork.
1782 (calibration_thread): Delete.
1783 (calibration_id): Delete.
1784 (prime_threads): Delete.
1785 (munge_threadfunc): Remove calibration_thread special case. Avoid
1786 calling thread function if we haven't yet hit the "search_for" thread.
1787 (dll_entry): Remove prime_threads call. Only call munge_threadfunc
1788 when hwait_sig is active. Ditto. for _my_tls.remove ();
1789 * sigproc.cc (hwait_sig): Make global.
1790 (sigproc_init): Don't bother with sync_startup.
1791 (sig_send): Treat flush as a no-op when signals are held.
1792 (wait_sig): Cause signals to be held after fork.
1794 2006-03-09 Corinna Vinschen <corinna@vinschen.de>
1796 * syscalls.cc (rename): Move existance check for oldpath further up
1797 to the start of the function. Avoid another case of a name collision
1798 if oldpath is a shortcut and a file or directory newpath already exists.
1800 2006-03-09 Corinna Vinschen <corinna@vinschen.de>
1802 * autoload.cc (NtClose): Define.
1803 (NtOpenDirectoryObject): Define.
1804 (NtQueryDirectoryObject): Define.
1805 * fhandler_proc.cc: Include ctype.h and wchar.h.
1806 (format_proc_partitions): Revamp loop over existing harddisks by
1807 scanning the NT native \Device object directory and looking for
1809 * ntdll.h: Rearrange system call declarations alphabetically.
1810 (DIRECTORY_QUERY): Define.
1811 (struct _DIRECTORY_BASIC_INFORMATION): Define.
1812 (NtOpenDirectoryObject): Declare.
1813 (NtQueryDirectoryObject): Declare.
1815 2006-03-08 Christopher Faylor <cgf@timesys.com>
1817 * cygtls.h (_cygtls::retaddr): New method.
1818 * dll_init.cc (cygwin_detach_dll): Use new tls method to find return
1819 address since this function is now signal guarded.
1820 (update_envptrs): Remove unneeded braces.
1821 * syscalls.cc (statvfs): Coerce full_path to avoid a gcc warning.
1823 2006-03-08 Corinna Vinschen <corinna@vinschen.de>
1825 * syscalls.cc (statvfs): Simplify path name expression.
1827 2006-03-08 Corinna Vinschen <corinna@vinschen.de>
1829 * syscalls.cc: Include winioctl.h.
1830 (statvfs): Request correct volume size using DeviceIoControl if
1831 quotas are enforced on the file system.
1833 2006-03-03 Corinna Vinschen <corinna@vinschen.de>
1835 * dir.cc (opendir): Fix indentation.
1836 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Move storing
1837 fhandler in file descriptor table to some point very late in function
1838 to avoid double free'ing. Add comment to explain what happens.
1839 Add label free_mounts and don't forget to delete __DIR_mounts structure
1840 if NtOpenFile fails.
1842 2006-03-02 Corinna Vinschen <corinna@vinschen.de>
1844 * syscalls.cc (chroot): Disallow chroot into special directories.
1845 Return EPERM instead.
1847 2006-03-02 Corinna Vinschen <corinna@vinschen.de>
1849 * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
1850 cygdrive string length for those who have cygdrive mapped to "/".
1852 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1854 * sec_helper.cc (set_cygwin_privileges): Request SE_BACKUP_NAME
1857 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1859 * fhandler_proc.cc (fhandler_proc::fstat): Always return fixed link
1860 count of 1 for /proc directory instead of incorrect PROC_LINK_COUNT.
1862 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1864 * fhandler.h (enum dirent_states): Remove dirent_saw_cygdrive,
1865 dirent_saw_dev and dirent_saw_proc.
1866 (fhandler_cygdrive::open): Declare.
1867 (fhandler_cygdrive::close): Declare.
1868 * fhandler_disk_file.cc (class __DIR_mounts): Move to beginning of file.
1869 (__DIR_mounts::check_mount): New parameter to indicate if inode number
1870 is needed in calling function or not. Add /proc and /cygdrive handling.
1871 (__DIR_mounts::check_missing_mount): Ditto.
1872 (path_conv::ndisk_links): Use __DIR_mounts class to create correct
1873 hardlink count for directories with mount points in them.
1874 (fhandler_disk_file::readdir_helper): Remove /dev, /proc and /cygdrive
1876 (fhandler_cygdrive::open): New method.
1877 (fhandler_cygdrive::close): New method.
1878 (fhandler_cygdrive::fstat): Always return fixed inode number 2 and
1879 fixed link count of 1. Drop call to set_drives.
1880 (fhandler_cygdrive::opendir): Drop call to get_namehash.
1881 (fhandler_cygdrive::readdir): Handle "." entry to return fixed inode
1884 2006-03-01 Christopher Faylor <cgf@timesys.com>
1886 * cygwin.din: Fix some erroneous SIGFE/NOSIGFE settings.
1888 2006-03-01 Christopher Faylor <cgf@timesys.com>
1890 * cygthread.cc (cygthread::callfunc): Revert below change. Make ev a
1891 manual reset event again. so that it will be reset by WaitFor*Object
1893 (cygthread::stub): Ditto.
1894 (cygthread::terminate_thread): Reset ev if it was found to have been
1897 2006-03-01 Christopher Faylor <cgf@timesys.com>
1899 * analyze_sigfe: New script.
1900 * dllfixdbg: Add copyright.
1902 * gendevices: Ditto.
1903 * gentls_offsets: Ditto.
1905 2006-03-01 Christopher Faylor <cgf@timesys.com>
1907 * cygthread.cc (cygthread::callfunc): Create ev as an auto-reset event
1908 so that it will be reset by WaitFor*Object as appropriate.
1909 (cygthread::stub): Ditto.
1910 (cygthread::terminate_thread): Remove forced setting of thread
1913 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1915 * include/sys/dirent.h (struct __DIR): Rename __d_unused to
1917 * fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef".
1918 (d_dirname): Remove useless "struct".
1919 (d_cachepos): Ditto.
1921 (class __DIR_mounts): New class, implementing mount point tracking
1923 (d_mounts): New macro for easy access to __DIR_mounts structure.
1924 (fhandler_disk_file::opendir): Allocate __DIR_mounts structure and
1925 let __d_internal element of dir point to it.
1926 (fhandler_disk_file::readdir_helper): Add mount points in the current
1927 directory, which don't have a real directory backing them.
1928 Don't generate an inode number for /dev. Add comment, why.
1929 (fhandler_disk_file::readdir): Move filling fname to an earlier point.
1930 Check if current entry is a mount point and evaluate correct inode
1932 (fhandler_disk_file::readdir_9x): Ditto.
1933 (fhandler_disk_file::rewinddir): Set all mount points in this directory
1934 to "not found" so that they are listed again after calling rewinddir().
1935 (fhandler_disk_file::closedir): Deallocate __DIR_mounts structure.
1936 * path.cc (mount_info::get_mounts_here): New method to evaluate a list
1937 of mount points in a given parent directory.
1938 * shared_info.h (class mount_info): Declare get_mounts_here.
1940 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1942 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use iscygdrive
1943 instead of isspecial.
1944 * path.h (path_conv::iscygdrive): New method.
1946 2006-02-28 Christopher Faylor <cgf@timesys.com>
1948 * exceptions.cc (_cygtls::interrupt_now): Remove "inside cygwin" check
1949 since some cygwin functions are meant to be interrupted.
1951 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1953 * cygwin.din: Export __isinff, __isinfd, __isnanf, __isnand.
1954 * include/cygwin/version.h: Bump API minor number to 155.
1956 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1958 * dir.cc (readdir_worker): Use slash as path separator when evaluating
1959 namehash for paths below /proc.
1960 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Use expensive
1961 inode number evaluation on share names.
1963 2006-02-27 Christopher Faylor <cgf@timesys.com>
1965 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
1966 d_cachepos under NT or suffer memory corruption.
1967 (fhandler_disk_file::readdir_helper): Avoid else with a return. Just
1968 calculate extension location once when doing symlink checks.
1969 (fhandler_disk_file::readdir): Make debug output more useful.
1970 (fhandler_disk_file::readdir_9x): Ditto. Eliminate redundant variable.
1972 2006-02-27 Christopher Faylor <cgf@timesys.com>
1974 * include/sys/termios.h (cfsetispeed): Just define as a function rather
1975 than resorting to a macro.
1976 (cfsetospeed): Ditto.
1978 2006-02-27 Christopher Faylor <cgf@timesys.com>
1980 * sigproc.cc: Fix a comment.
1982 2006-02-27 Christopher Faylor <cgf@timesys.com>
1984 * cygthread.cc (cygthread::release): Add a comment.
1986 2006-02-27 Corinna Vinschen <corinna@vinschen.de>
1988 * fhandler_netdrive.cc (fhandler_netdrive::fstat): Create unambiguous
1990 (fhandler_netdrive::readdir): Ditto.
1992 2006-02-24 Christopher Faylor <cgf@timesys.com>
1994 * sigproc.cc (sigheld): Define new variable.
1995 (sig_dispatch_pending): Don't check sigq since that's racy.
1996 (sig_send): Set sigheld flag if __SIGHOLD is specified, reset it if
1997 __SIGNOHOLD is specified. Ignore flush signals if we're holding
2000 2006-02-23 Christopher Faylor <cgf@timesys.com>
2002 * cygwin.din (_exit): Use signal front end.
2005 2006-02-23 Christopher Faylor <cgf@timesys.com>
2007 * winsup.h (cygwin_hmodule): Declare.
2008 * exceptions.cc (inside_kernel): Reverse return values to reflect
2009 function name. Return true if we're in cygwin1.dll or if we're
2010 executing in dll_entry.
2011 (_cygtls::interrupt_now): Reflect reversal of inside_kernel return
2013 * hookapi.cc (cygwin_hmodule): Remove declaration.
2014 * init.cc (dll_entry): Use in_dllentry global to record that we are
2015 executing in dllentry.
2017 2006-02-22 Corinna Vinschen <corinna@vinschen.de>
2019 * exceptions.cc (_cygtls::interrupt_now): Reorder conditional
2020 to call inside_kernel only if this isn't locked.
2022 2006-02-22 Corinna Vinschen <corinna@vinschen.de>
2024 * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES to
2025 access flags in case of query_read_control case, add FILE_READ_DATA
2026 in case of query_stat_control.
2028 2006-02-20 Christopher Faylor <cgf@timesys.com>
2030 * spawn.cc (av::fixup): Check for .bat and friends specifically now
2031 since these extensions are no longer automatically detected.
2033 2006-02-19 Christopher Faylor <cgf@timesys.com>
2035 * exceptions.cc (stackdump): Avoid dumping more than once.
2037 2006-02-19 Christopher Faylor <cgf@timesys.com>
2039 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use NtOpenFile
2040 to open the directory.
2041 (fhandler_disk_file::readdir): Use NT_SUCCESS to determine if status
2044 2006-02-19 Corinna Vinschen <corinna@vinschen.de>
2046 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop generating
2049 2006-02-18 Corinna Vinschen <corinna@vinschen.de>
2051 * fhandler_disk_file.cc (FS_IS_SAMBA): Move out of
2052 path_conv::hasgood_inode.
2053 (path_conv::is_samba): New method.
2054 (fhandler_base::fstat_by_handle): Don't even try to use
2055 FileIdBothDirectoryInformation on Samba.
2056 * path.h (class path_conv): Declare is_samba method.
2058 2006-02-17 Christopher Faylor <cgf@timesys.com>
2060 * path.cc (conv_path_list): Eat empty paths when converting to POSIX.
2061 (cygwin_conv_to_win32_path): Deal with Cygwin's necessity of adding a
2062 '/' to the end of a path ending in '.'.
2064 2006-02-16 Corinna Vinschen <corinna@vinschen.de>
2066 * cygwin.din: Export sigignore and sigset.
2067 * exceptions.cc (sigset): New function.
2068 (sigignore): New function.
2069 * include/cygwin/signal.h (SIG_HOLD): Define.
2070 (sigignore): Declare.
2072 * include/cygwin/version.h: Bump API minor number to 154.
2074 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
2076 * include/mntent.h: Add missing #include.
2078 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
2080 * gentls_offsets: Fix typo in error message.
2082 2006-02-10 Christopher Faylor <cgf@timesys.com>
2084 * fhandler_process.cc (format_process_stat): Use cygwin-derived start
2085 time even on NT since it is the logical start time of the "process".
2086 * pinfo.cc (set_myself): Don't set start time when it should have
2087 already been set previously.
2089 2006-02-10 Brian Ford <Brian.Ford@FlightSafety.com>
2091 * times.cc (clock_getres): Use correct conversion from milliseconds to
2092 seconds/nanoseconds.
2093 (clock_setres): Use correct conversion to nanoseconds.
2095 2006-02-10 Christopher Faylor <cgf@timesys.com>
2097 * external.cc (sync_winenv): Rename from "setup_winenv". Use same
2098 mechanism as spawn to determine environment variables which should be
2099 converted back to windows form.
2100 (cygwin_internal): Reflect setup_winenv -> sync_winenv name change.
2101 * include/sys/cygwin.h: Ditto.
2103 2006-02-09 Corinna Vinschen <corinna@vinschen.de>
2105 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
2106 the dirent_get_d_ino flag on filesystems having useful File IDs.
2107 Add comment explaining why.
2109 2006-02-07 Corinna Vinschen <corinna@vinschen.de>
2111 * dtable.cc (handle_to_fn): Accommodate new argument order in call to
2113 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Call sys_wcstombs
2114 instead of just wcstombs to accommodate OEM codepages.
2115 * miscfuncs.cc (sys_wcstombs): Split len argument in source and target
2116 length. Always 0-terminate result in target string.
2117 * security.cc (lsa2wchar): Remove unused function.
2119 (get_lsa_srv_inf): Ditto.
2120 (get_logon_server): Accommodate new argument order in call to
2122 (get_user_groups): Ditto.
2123 (get_user_local_groups): Ditto.
2124 (get_priv_list): Call sys_wcstombs directly instead of lsa2str.
2125 * uinfo.cc (cygheap_user::ontherange): Accommodate new argument order
2126 in call to sys_wcstombs.
2127 * winsup.h (sys_wcstombs): Change prototype to match new argument order.
2129 2006-02-07 Corinna Vinschen <corinna@vinschen.de>
2131 * init.cc (respawn_wow64_process): Exit with the exit code returned
2132 by the respawned process.
2134 2006-02-06 Christopher Faylor <cgf@timesys.com>
2136 Always zero all elements of siginfo_t throughout.
2137 * cygtls.h (_cygtls::thread_context): Declare new field.
2138 (_cygtls::thread_id): Ditto.
2139 (_cygtls::signal_exit): Move into this class.
2140 (_cygtls::copy_context): Declare new function.
2141 (_cygtls::signal_debugger): Ditto.
2142 * cygtls.cc (_cygtls::init_thread): Fill out thread id field.
2143 * exceptions.cc (exception): Change message when exception info is
2144 unknown. Copy context to thread local storage.
2145 (_cygtls::handle_exceptions): Avoid double test for fault_guarded.
2146 Reflect move of signal_exit to _cygtls class.
2147 (sigpacket::process): Copy context to thread local storage.
2148 (_cygtls::signal_exit): Move to _cygtls class. Call signal_debugger to
2149 notify debugger of exiting signal (WIP). Call stackdump here (WIP).
2150 (_cygtls::copy_context): Define new function.
2151 (_cygtls::signal_debugger): Ditto.
2152 * tlsoffsets.h: Regenerate.
2153 * include/cygwin.h (_fpstate): New internal structure.
2154 (ucontext): Declare new structure (WIP).
2155 (__COPY_CONTEXT_SIZE): New define.
2157 * exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field
2158 when there is no sigwaiting thread.
2159 (setup_handler): Move event handling into interrupt_setup.
2161 2006-02-06 Corinna Vinschen <corinna@vinschen.de>
2163 * fhandler_socket.cc (fhandler_socket::connect): Fix formatting.
2164 (fhandler_socket::wait): Handle SA_RESTART when signal arrives.
2166 2006-02-06 Corinna Vinschen <corinna@vinschen.de>
2168 * include/cygwin/socket.h (CMSG_FIRSTHDR): Avoid compiler warning.
2170 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2172 * include/features.h: Add comment to explain what's going to happen
2174 * include/sys/stdio.h: Guard getline and getdelim prototypes with
2175 _GNU_SOURCE to avoid collision with old-style declarations.
2177 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2179 * environ.cc (struct parse_thing): Add transparent_exe option.
2180 * fhandler_disk_file.cc (fhandler_disk_file::link): Accommodate
2181 transparent_exe option. Add .exe suffix for links to executable files,
2182 if transparent_exe is set.
2183 * fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe
2184 suffix if transparent_exe option is set.
2185 * path.cc (symlink_worker): Accommodate transparent_exe option.
2186 (realpath): Don't tack on .exe suffix if transparent_exe is set.
2187 * syscalls.cc (transparent_exe): New global variable.
2188 (unlink): Accommodate transparent_exe option.
2191 (rename): Ditto. Maybe add .exe suffix when renaming executable files.
2192 (pathconf): Accommodate transparent_exe option.
2193 * winsup.h: Declare transparent_exe.
2195 2006-02-05 Christopher Faylor <cgf@timesys.com>
2196 Corinna Vinschen <corinna@vinschen.de>
2198 * fhandler_disk_file.cc (fhandler_disk_file::readdir_9x): Remove
2201 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2203 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Remove label
2204 "out". Move test for NULL __handle ...
2205 (fhandler_disk_file::rewinddir_9x): ... here.
2207 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2209 * dir.cc (rewinddir): Keep dirent_get_d_ino and dirent_set_d_ino flags.
2211 2006-02-05 Christopher Faylor <cgf@timesys.com>
2213 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Don't close dir
2214 handle when we hit EOF since rewwindir may reactivate it.
2215 (fhandler_disk_file::readdir_9x): Eliminate superfluous temporary
2217 (fhandler_disk_file::closedir): Return EBADF when trying to close
2218 unopened DIR. Reorganize slightly. Return actual derived error value
2219 rather than always returning 0.
2221 2006-02-04 Christopher Faylor <cgf@timesys.com>
2223 * dir.cc (rmdir): Reorganize check for trailing dot to return correct
2224 error when directory does not exist.
2226 2006-02-03 Christopher Faylor <cgf@timesys.com>
2228 * dir.cc (mkdir): Reorganize check for trailing dot to return correct
2229 error when directory exists.
2230 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Remove special
2231 test for path ending in '.'.
2233 2006-02-03 Corinna Vinschen <corinna@vinschen.de>
2235 * path.cc (suffix_scan::lnk_match): Return true beginning with
2237 (suffix_scan::next): Rearrange code to make .lnk append order slightly
2239 * spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align
2240 evaluation with stat_suffixes.
2241 (dll_suffixes): Ditto.
2243 2006-02-02 Christopher Faylor <cgf@timesys.com>
2245 * cygwin/version.h: Mention CW_SETUP_WINENV in comment for API minor
2248 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2250 * cygwin.din (updwtmpx): Export.
2251 * syscalls.cc (updwtmpx): New function.
2252 * include/utmpx.h (updwtmpx): Declare.
2253 * include/cygwin/version.h: Bump API minor number to 153.
2255 2006-02-02 Christopher Faylor <cgf@timesys.com>
2257 * external.cc (setup_winenv): New function.
2258 (cygwin_internal): Implement CW_SETUP_WINENV.
2259 * sys/cygwin.h (cygwin_getinfo_types): Define CW_SETUP_WINENV.
2261 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2263 * security.cc (is_group_member): Fix comment.
2265 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2267 * security.cc (is_group_member): Use local group info type 1. Test
2268 group for being a global group or a well-known SID before adding it
2269 to the group list. Add comment.
2271 2006-02-01 Corinna Vinschen <corinna@vinschen.de>
2273 * autoload.cc (GetTcpTable): Define.
2274 * fhandler_socket.cc (address_in_use): New function to check if
2275 sockaddr_in address is already in use.
2276 (fhandler_socket::bind): Check if address is alreay in use in case of
2277 SO_REUSEADDR, to circumvent WinSock non-standard behaviour.
2279 2006-02-01 Corinna Vinschen <corinna@vinschen.de>
2281 * spawn.cc (dll_suffixes): Add .exe and "no suffix" to the list.
2283 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2285 * dlfcn.cc (check_path_access): Call find_exec with FE_DLL option.
2286 * path.h (enum fe_types): Add FE_DLL value.
2287 * spawn.cc (std_suffixes): Remove.
2288 (exe_suffixes): New suffix_info for executing files.
2289 (dll_suffixes): New suffix_info for searching shared libraries.
2290 (perhaps_suffix): Add opt argument. Use dll_suffixes if FE_DLL
2291 option is given, exe_suffixes otherwise.
2292 (find_exec): Propagate opt argument to perhaps_suffix. Drop suffix
2293 check when testing execute permission.
2294 (spawn_guts): Call perhaps_suffix with FE_NADA opt argument.
2296 2006-01-31 Christopher Faylor <cgf@timesys.com>
2298 * spawn.cc (av::fixup): Remove unused argument.
2299 (spawn_guts): Remove capitalization in debugging.
2301 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2303 * spawn.cc (find_exec): Only return files with execute permission set
2304 if ntsec is on. Don't check execute permission of Windows batch files.
2305 (av::fixup): Handle empty files gracefully. Drop execute permission
2307 * path.cc (suffix_scan::next): Don't skip any suffix on first run.
2309 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2311 * path.cc (cwdstuff::set): Don't set win32 error, only POSIX errno.
2313 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2315 * path.cc (cwdstuff::set): When SetCurrentDirectory returns
2316 ERROR_INVALID_FUNCTION, bend it over to ERROR_FILE_NOT_FOUND. Add
2317 comment to explain why.
2319 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2321 * dir.cc (readdir_worker): Add comment about writing old 32 bit d_ino.
2322 * include/cygwin/version.h: Bump API minor number to 152.
2323 (CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): Remove.
2325 2006-01-30 Corinna Vinschen <corinna@vinschen.de>
2327 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Simplify
2330 2006-01-30 Corinna Vinschen <corinna@vinschen.de>
2332 * fhandler_disk_file.cc (d_cachepos): Rename from d_pos to distinct
2333 clearly from __d_position. Change throughout.
2334 (fhandler_disk_file::rewinddir): Reset readdir cache on NT.
2336 2006-01-29 Corinna Vinschen <corinna@vinschen.de>
2338 * fhandler_disk_file.cc (readdir_get_ino): Don't follow symlinks.
2340 2006-01-29 Corinna Vinschen <corinna@vinschen.de>
2342 * fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag.
2343 * fhandler_socket.cc (fhandler_socket::bind): Set socket to
2344 SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR
2345 socket option, on systems supporting SO_EXCLUSIVEADDRUSE.
2346 * net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag
2347 if SO_REUSEADDR socket option has been successsfully set.
2348 * wincap.h (wincaps::has_exclusiveaddruse): New element.
2349 * wincap.cc: Implement above element throughout.
2351 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2353 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): In case or error,
2354 check for existance explicitely and set errno to EEXIST.
2356 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2358 * fhandler_disk_file.cc (DIR_NUM_ENTRIES): New define determining
2359 minimum number of dir entries which fit into the readdir cache.
2360 (DIR_BUF_SIZE): Define globally as size of readdir cache.
2361 (struct __DIR_cache): New structure used for readdir caching on NT.
2362 (d_dirname): Accessor for struct __DIR_cache, use throughout.
2365 (fhandler_disk_file::opendir): Allocate __d_dirname to contain readdir
2367 (fhandler_disk_file::readdir): Use buf as pointer into readdir cache.
2368 Implement readdir caching.
2370 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2372 * include/sys/dirent.h (struct dirent): Revert misguided attempt to
2373 rename __d_unused1 to __d_fd.
2375 2006-01-27 Corinna Vinschen <corinna@vinschen.de>
2377 * autoload.cc (NtQueryDirectoryFile): Define.
2378 * dir.cc (__opendir_with_d_ino): Just call opendir.
2379 (opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling.
2380 (readdir_worker): Only try generating d_ino if it's 0.
2381 Utilize namehash of directories fhandler. Call readdir_get_ino to
2382 generate d_ino for "..".
2383 (seekdir64): Keep dirent_set_d_ino flag.
2384 * fhandler.h (enum dirent_states): Add dirent_get_d_ino.
2385 (class fhandler_disk_file): Declare new private methods readdir_helper
2387 * fhandler_disk_file.cc (path_conv::hasgood_inode): New method to
2388 evaluate if a filesystem has reliable inode numbers.
2389 (fhandler_base::fstat_by_handle): Accommodate structure member name
2390 change from IndexNumber to FileId.
2391 (fhandler_base::fstat_helper): Call hasgood_inode here.
2392 (fhandler_disk_file::opendir): Call fhaccess only for real files.
2393 Don't append '*' to __d_dirname here, move to readdir_9x. On NT,
2394 open directory handle here. Set dirent_get_d_ino and dirent_set_d_ino
2395 flags according to wincap and filesystem.
2396 (fhandler_disk_file::readdir_helper): New method to implement readdir
2397 postprocessing only once.
2398 (readdir_get_ino_by_handle): New static function.
2399 (readdir_get_ino): New function to centralize inode number evaluation
2400 in case inode number hasn't been returned by NtQueryDirectoryFile.
2401 (fhandler_disk_file::readdir): Move old functionality to readdir_9x.
2402 Call readdir_9x when on 9x/Me. Implement NT specific readdir here.
2403 (fhandler_disk_file::readdir_9x): Move 9x specific readdir here.
2404 (fhandler_disk_file::seekdir): Accommodate new NT readdir method.
2405 (fhandler_disk_file::closedir): Ditto.
2406 (fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment.
2407 (fhandler_cygdrive::opendir): Call get_namehash to prepare later
2408 correct evaluation of d_ino.
2409 (fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate
2410 drive's d_ino by calling readdir_get_ino.
2411 * fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and
2412 dirent_saw_dot_dot to avoid seeing . and .. entries twice.
2413 * fhandler_process.cc (fhandler_process::readdir): Ditto.
2414 * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
2415 * ntdll.h (STATUS_INVALID_PARAMETER): New define.
2416 (STATUS_INVALID_LEVEL): New define.
2417 (struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to
2418 FileId (as in Nebbitt).
2419 * path.h (path_conv::hasgood_inode): Now implemented in
2420 fhandler_disk_file.cc.
2421 * wincap.h (wincaps::has_fileid_dirinfo): New element.
2422 * wincap.cc: Implement above element throughout.
2423 * winsup.h (readdir_get_ino): Add declaration.
2424 * include/sys/dirent.h (struct dirent): Slightly rename structure
2425 members to accommodate changes.
2426 Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of
2427 __opendir_with_d_ino.
2429 2006-01-27 Christopher Faylor <cgf@timesys.com>
2431 * spawn.cc (spawn_guts): Fix potential handle leak when failing exec.
2433 2006-01-27 Christopher Faylor <cgf@timesys.com>
2435 * exceptions.cc (inside_kernel): Fix to return true if we can't get the
2436 name of the DLL for the given memory block since we are not in kernel
2439 2006-01-26 Corinna Vinschen <corinna@vinschen.de>
2441 * fhandler.cc (fhandler_base::open): Fix bug in argument order to
2442 InitializeObjectAttributes call.
2444 2006-01-25 Corinna Vinschen <corinna@vinschen.de>
2446 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix test for
2447 dirent_isroot to use the correct boolean operator.
2449 2006-01-25 Christopher Faylor <cgf@timesys.com>
2451 * ntdll.h: (temporarily?) Add more functions for querying directory.
2453 2006-01-24 Christopher Faylor <cgf@timesys.com>
2455 * dir.cc (readdir_worker): Turn off expensive inode calculation.
2457 2006-01-24 Corinna Vinschen <corinna@vinschen.de>
2459 * fhandler_process.cc (fhandler_process::fill_filebuf): Disable
2460 stripping the .exe suffix from the link target in PROCESS_EXE and
2461 PROCESS_EXENAME case.
2462 * path.cc (realpath): Tack on .exe suffix if necessary.
2464 2006-01-24 Corinna Vinschen <corinna@vinschen.de>
2466 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Try harder
2467 to determine remote file systems with reliable inode numbers. Add
2470 2006-01-23 Corinna Vinschen <corinna@vinschen.de>
2472 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Reset
2473 inheritance for duplicated socket.
2475 2006-01-20 Christopher Faylor <cgf@timesys.com>
2477 * include/cygwin/version.h: Bump API minor number to 151.
2478 * dir.cc (__opendir_with_d_ino): New function.
2479 (opendir): Set flag if we should be calculating inodes.
2480 (readdir_worker): Calculate d_ino by calling stat if the user has asked
2482 (seekdir64): Maintain all persistent flag settings.
2483 * fhandler.h (dirent_states): Add dirent_set_d_ino.
2484 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Reflect changes
2485 to dirent structure.
2486 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
2487 * include/sys/dirent.h (struct dirent): Coalesce two similar
2488 structures. Remove all shreds of the apparently highly confusing
2489 references to inodes. Add support for calculating a real inode if
2490 __USE_EXPENSIVE_CYGWIN_D_INO is defined.
2492 2006-01-20 Christopher Faylor <cgf@timesys.com>
2494 * include/sys/dirent.h: Add comments for people who are REALLY confused
2495 about whether they should be using something called __invalid_d_ino or
2498 2006-01-20 Corinna Vinschen <corinna@vinschen.de>
2500 * fhandler_socket.cc (fhandler_socket::prepare): Fix debug output.
2501 (fhandler_socket::release): Add debug output for WSAEventSelect failure.
2502 (fhandler_socket::ioctl): Always cancel WSAEventSelect before switching
2503 to blocking mode. Only set nonblocking flag if ioctlsocket call
2504 succeeded. Only print new socket state if ioctlsocket call succeeded.
2506 2006-01-19 Christopher Faylor <cgf@timesys.com>
2508 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check posix path
2509 for root rather than windows path.
2511 2006-01-19 Christopher Faylor <cgf@timesys.com>
2513 * dir.cc (readdir_worker): Fill in invalid fields with -1. Accommodate
2514 name change from __ino32 to __invalid_ino32.
2515 * include/sys/dirent.h (__invalid_ino32): Rename from __ino32. Don't
2516 define unused d_type macros.
2518 2006-01-18 Christopher Faylor <cgf@timesys.com>
2520 * heap.cc (heap_init): Remove Sleep.
2522 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2524 * net.cc (rresvport): Remove extern declaration.
2526 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2528 * autoload.cc (rresvport): Remove.
2529 * net.cc (last_used_rrecvport): New global shared variable.
2530 (cygwin_rresvport): Implement rresvport without using rresvport from
2533 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2535 * include/cygwin/socket.h (struct sockaddr_storage): Fix typo in
2536 ss_family member name.
2538 2006-01-16 Christopher Faylor <cgf@timesys.com>
2540 * include/cygwin/version.h: Bump DLL minor version number to 20.
2542 2006-01-13 Corinna Vinschen <corinna@vinschen.de>
2544 * uname.cc (uname): Concatenate a "-WOW64" to utsname's sysname
2545 member to see when running under WOW64.
2547 2006-01-13 Corinna Vinschen <corinna@vinschen.de>
2549 * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS on
2550 Windows 2000 and above. Clarify the comment about IP_TOS and move
2551 to the place where the magic happens.
2552 (get_ifconf): Remove unused code.
2553 * wincap.h (wincaps::has_disabled_user_tos_setting): New element.
2554 * wincap.cc: Implement above element throughout.
2556 2006-01-12 Christopher Faylor <cgf@timesys.com>
2558 * fhandler_console.cc (set_console_state_for_spawn): Fix to recognize
2561 2006-01-12 Christopher Faylor <cgf@timesys.com>
2563 * fhandler.h (set_console_state_for_spawn): Whackamole the argument
2565 * spawn.cc (spawn_guts): Ditto, i.e., once again call
2566 set_console_state_for_spawn with an indication of whether we're about
2567 to start a cygwin process.
2568 * fhandler_console.cc (set_console_state_for_spawn): Don't set the
2569 console state if we know we're starting a cygwin process or if we're
2572 2006-01-10 Corinna Vinschen <corinna@vinschen.de>
2574 * dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
2575 * init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker.
2576 Call wincap.init here before doing anything else. Use wincap.is_wow64
2577 to determine if we're running in a WOW64 emulator.
2578 * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's
2579 apparently not supported.
2580 (mmap64): Don't create mappings beyond EOF, which would need to use
2581 AT_ROUND_TO_PAGE, on WOW64.
2582 * wincap.cc (wincap): Throw into the .cygwin_dll_common section.
2583 (wincapc::init): Determine if running in WOW64 and set wow_64 flag.
2584 * wincap.h (class wincapc): Add wow64 member.
2585 (wincapc::is_wow64): New method.
2587 2006-01-10 Christopher Faylor <cgf@timesys.com>
2589 * fhandler_proc.cc (format_proc_cpuinfo): Avoid leading whitespace in
2592 2006-01-09 Christopher Faylor <cgf@timesys.com>
2594 * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is
2595 done prior to check for command.com/cmd.com. Don't bother setting
2596 CREATE_SUSPENDED flag for a MS-DOS process since it doesn't work
2597 anyway. Avoid calling remember() when the child process has already
2599 (av::fixup): Explicitly set cygexec flag to false on a 16 bit process.
2601 2006-01-09 Corinna Vinschen <corinna@vinschen.de>
2603 * include/getopt.h (getopt_long_only): Declare.
2605 2006-01-09 Eric Blake <ebb9@byu.net>
2607 * cygwin.din: Export getsubopt.
2608 * include/cygwin/version.h: Bump API minor version.
2610 2006-01-08 Christopher Faylor <cgf@timesys.com>
2612 * fhandler_tty.cc (fhandler_tty_slave::dup): Don't assign a controlling
2613 terminal to a process when duped. Linux doesn't do this, so we won't
2616 2006-01-08 Christopher Faylor <cgf@timesys.com>
2618 * environ.cc (spenvs[]): windir -> WINDIR.
2620 2006-01-07 Christopher Faylor <cgf@timesys.com>
2622 * fhandler_console.cc (fhandler_console::need_invisible): Remove
2625 2006-01-07 Christopher Faylor <cgf@timesys.com>
2627 * fhandler.h (set_console_state_for_spawn): Eliminate argument from
2629 * fhandler.cc (set_console_state_for_spawn): Eliminate argument from
2630 definition. Always check for invisible console.
2631 (fhandler_console::need_invisible): Don't do anything if the windows
2632 station is already not visible.
2633 * spawn.cc (spawn_guts): Accommodate change of argument to
2634 set_console_state_for_spawn.
2636 2006-01-05 Christopher Faylor <cgf@timesys.com>
2638 * sigproc.cc (no_signals_available): Use existence of signal thread
2639 handle to figure out if we can actually send signals rather than
2640 relying on my_sendsig.
2641 (hwait_sig): Make static.
2642 (sigproc_init): Don't set my_sendsig to anything special. Use new
2643 global static hwait_sig.
2644 (wait_sig): Set hwait_sig to NULL when we are exiting.
2646 2006-01-05 Christopher Faylor <cgf@timesys.com>
2648 * include/getopt.h: Accommodate recent unfortunate newlib changes.
2650 2006-01-05 Christopher Faylor <cgf@timesys.com>
2652 * cygtls.cc (_cygtls::remove): Don't output debugging info if this
2653 isn't a cygwin thread.
2654 * sigproc.cc (sigproc_init): Move clearing of sync_startup here to
2655 lessen the likelihood of trying to deal with non-cygwin threads in
2658 * fhandler_console: Fix set_console_state_for_spawn comment.
2660 2006-01-05 Igor Peshansky <pechtcha@cs.nyu.edu>
2662 * spawn.cc (spawn_guts): Invert the argument to
2663 set_console_state_for_spawn.
2665 2006-01-04 Christopher Faylor <cgf@timesys.com>
2667 * fhandler_console.cc (fhandler_console::need_invisible): Only try to
2668 open "CygwinInvisible" windows station if opening of default station
2669 fails. Use CloseWindowStation to close window station handle.
2671 2006-01-04 Christopher Faylor <cgf@timesys.com>
2673 * fhandler_console.cc (fhandler_console::need_invisible): Open up the
2674 security of the newly created windows station.
2676 2006-01-04 Eric Blake <ebb9@byu.net>
2678 * path.cc (dot_special_chars): Add ", <, >, and |.
2680 2006-01-03 Christopher Faylor <cgf@timesys.com>
2682 * fhandler_console.cc (beep): Use MB_OK which is documented as using
2683 the default bell rather than -1 which seems to behave differently on
2684 different versions of Windows.
2686 2006-01-03 Christopher Faylor <cgf@timesys.com>
2688 * fhandler_process.cc (fhandler_process::readdir): Add missing argument
2691 * fhandler_console.cc (fhandler_console::need_invisible): Use made-up
2692 name for windows station rather than asking Windows to create one for
2695 * spawn.cc (spawn_guts): Don't mess with console if we're detaching.
2697 2006-01-03 Christopher Faylor <cgf@timesys.com>
2699 * dir.cc (readdir_worker): Minor code cleanup.
2701 * fhandler_console.cc (beep): Use a more Windows-generic wav file if
2702 the beep is missing. Use a more foolproof way to find out whether we
2703 should be recreating the missing key.
2705 * registry.h (reg_key::_disposition): New field.
2706 (reg_key::created): New function.
2707 * registry.cc (reg_key::reg_key): Set _disposition to zero by default.
2708 (reg_key::build_key): Fill in _disposition field.
2710 2006-01-03 Eric Blake <ebb9@byu.net>
2712 * dir.cc (readdir_worker): Ensure that saw_dot* flags are updated when
2713 not handling inodes.
2715 2006-01-02 Christopher Faylor <cgf@timesys.com>
2717 * fhandler_console.cc (beep): New function. Restores missing "Default
2718 Beep", if necessary.
2719 (fhandler_console::write_normal): Use beep().
2721 2006-01-02 Christopher Faylor <cgf@timesys.com>
2723 * dcrt0.cc (_dll_crt0): Remove more leftover debugging stuff.
2724 (cygwin_dll_init): Remove unneeded initializations. Call _dll_crt0
2725 rather than dll_crt0_1.
2727 2006-01-02 Corinna Vinschen <corinna@vinschen.de>
2729 * syslog.cc: Include sys/un.h instead of sys/socket.h.
2730 (syslogd_inited): Convert to enum type noting the exact result of
2731 trying to connect to syslog daemon. Use this way throughout.
2732 (connect_syslogd): New static function taking over the task to
2733 connect to syslog socket. Use correct struct sockaddr_un instead of
2735 (try_connect_syslogd): Call connect_syslogd. If write fails on
2736 connection oriented socket, try to reconnect to syslog socket and
2739 2006-01-01 Christopher Faylor <cgf@timesys.com>
2741 * pinfo.cc (pinfo::exit): Swap signal and normal exit value when not
2742 started from a cygwin process - just like the good-old-days of B20.
2744 2006-01-01 Christopher Faylor <cgf@timesys.com>
2746 * strace.cc (strace::write_childpid): Remove debugging output.
2748 2006-01-01 Christopher Faylor <cgf@timesys.com>
2750 * cygtls.cc (_cygtls::remove): Remove left over debugging cruft which
2751 caused this function to always return prematurely.
2753 2006-01-01 Christopher Faylor <cgf@timesys.com>
2755 * exceptions.cc (sigpacket::process): Pass actual reference to signal's
2756 sigaction structure to setup_handler.
2758 2006-01-01 Christopher Faylor <cgf@timesys.com>
2760 * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.
2761 * include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK.
2763 * dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
2765 2006-01-01 Corinna Vinschen <corinna@vinschen.de>
2767 * syslog.cc (vklog): Never log kernel messages using the vsyslog