1 2006-07-27 Corinna Vinschen <corinna@vinschen.de>
3 * fhandler.h (class fhandler_socket): Remove prot_info_ptr.
4 (fhandler_socket::fixup_before_fork_exec): Remove.
5 (fhandler_socket::fixup_after_exec): Remove.
6 (fhandler_socket::need_fixup_before): Remove.
7 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop
8 initializing prot_info_ptr. Remove unused code.
9 (fhandler_socket::~fhandler_socket): Drop free'ing prot_info_ptr.
10 (struct wsa_event): Rename connect_errorcode to errorcode.
11 (fhandler_socket::evaluate_events): Handle FD_CLOSE error condition
12 as FD_CONNECT error condition, except, never reset an FD_CLOSE error
13 condition. Always set FD_WRITE after successfully recorded FD_CONNECT.
14 (fhandler_socket::fixup_before_fork_exec): Remove.
15 (fhandler_socket::fixup_after_fork): Revert to using handle duplication.
16 (fhandler_socket::fixup_after_exec): Remove.
17 (fhandler_socket::dup): Revert to using handle duplication.
18 (fhandler_socket::send_internal): Only call wait_for_events in case
19 of WSAEWOULDBLOCK condition.
20 (fhandler_socket::set_close_on_exec): Call
21 fhandler_base::set_close_on_exec.
22 * net.cc (fdsock): Just set socket to inheritable on non-NT. Don't
23 call inc_need_fixup_before.
24 * select.cc (peek_socket): Don't set except_ready on every FD_CLOSE,
27 2006-07-26 Brian ford <Brian.Ford@FlightSafety.com>
29 * fhandler.cc (fhandler_base::read): Call get_readahead_into_buffer
30 instead of duplicating it.
32 2006-07-26 Corinna Vinschen <corinna@vinschen.de>
34 * shared.cc (offsets): Define as offsets relative to cygwin_hmodule
36 (off_addr): New macro.
37 (open_shared): Use offsets array accordingly. Remove unused code.
38 * shared_info.h (cygwin_shared_address): Remove.
40 2006-07-26 Corinna Vinschen <corinna@vinschen.de>
42 * cygheap.h (struct init_cygheap): Remove shared_h and mt_h members.
43 * fhandler_tape.cc (mt): Define as DLL shared area in
44 .cygwin_dll_common instead of as dynamically allocated area.
45 Change referencing throughout.
46 * mtinfo.h (mt_h): Remove entirely.
47 (mt): Remove extern declaration.
48 * shared.cc (cygwin_shared_area): New global cygwin_shared
49 variable located in .cygwin_dll_common.
50 (offsets): Define shared region addresses descending from
51 cygwin_shared_address.
52 (open_shared): Replace usage of SH_CYGWIN_SHARED by SH_USER_SHARED.
53 (memory_init): Set cygwin_shared just by pointing to cygwin_shared_area.
54 * shared_info.h (shared_locations): Remove SH_CYGWIN_SHARED and
56 (cygwin_shared_address): Define as DLL start address.
57 * tty.h (tty_min::tty_min): Remove constructor.
59 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
61 * include/cygwin/in6.h: Guard in_port_t typedef more restrictive to
62 avoid compiler warning.
64 2006-07-25 Christopher Faylor <cgf@timesys.com>
66 * security.cc (get_logon_server): Remove nret and use dret for
67 everything to avoid a g++ warning.
69 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
71 * include/cygwin/version.h: Bump DLL version to 1.7.0.
73 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
76 * fhandler_socket.cc: Don't include select.h.
79 2006-07-25 Corinna Vinschen <corinna@vinschen.de>
81 * cygtls.h: Drop socket related includes.
82 (struct _local_storage): Remove exitsock and exitsock_sin. Add
84 * cygtls.cc: Accomodate above change throughout.
85 * fhandler.h (class fhandler_socket): Make wsock_evt public.
86 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Accomodate
88 (fhandler_socket::evaluate_events): Drop FD_CONNECT event as soon as
89 it gets read once. Never remove FD_WRITE event here.
90 (fhandler_socket::wait_for_events): Wait 50 ms instead of INFINITE for
92 (fhandler_socket::accept): Fix conditional. Set wsock_events members
93 of accepted socket to useful start values.
94 (fhandler_socket::recv_internal): Always drop FD_READ/FD_OOB events from
95 wsock_events after the call to WSARecvFrom.
96 (fhandler_socket::send_internal): Drop FD_WRITE event from wsock_events
97 if the call to WSASendTo fails with WSAEWOULDBLOCK. Fix return value
99 * select.cc (struct socketinf): Change to accomodate using socket event
101 (peek_socket): Use event handling for peeking socket.
102 (thread_socket): Ditto.
103 (start_thread_socket): Ditto.
104 (socket_cleanup): Same here.
105 * tlsoffsets.h: Regenerate.
107 2006-07-23 Christopher Faylor <cgf@timesys.com>
109 * include/cygwin/version.h: Bump DLL minor version number to 22.
111 2006-07-20 Corinna Vinschen <corinna@vinschen.de>
113 * fhandler.h (class fhandler_socket): Rearrange slightly to keep
114 event handling methods and members together. Drop owner status flag.
115 Split wait method. Rename event handling methods for readability.
116 * fhandler_socket.cc (struct wsa_event): Add owner field.
117 (LOCK_EVENTS): New macro.
118 (UNLOCK_EVENTS): Ditto.
119 (fhandler_socket::init_events): rename from prepare.
120 (fhandler_socket::evaluate_events): First half of former wait method.
121 Do everything but wait. Allow specifiying whether or not events from
122 event_mask should be erased from wsock_events->events. Simplify
123 OOB handling. Allow sending SIGURG to any process (group).
124 (fhandler_socket::wait_for_events): Second half of former wait method.
125 Call evaluate_events and wait in a loop if socket is blocking.
126 (fhandler_socket::release_events): Rename from release.
127 (fhandler_socket::connect): Accomodate above name changes.
128 (fhandler_socket::accept): Ditto.
129 (fhandler_socket::recv_internal): Ditto.
130 (fhandler_socket::send_internal): Ditto.
131 (fhandler_socket::close): Ditto.
132 (fhandler_socket::fcntl): Always set owner to given input value on
133 F_SETOWN. Handle F_GETOWN.
134 * net.cc (fdsock): Accomodate above name changes.
136 2006-07-20 Corinna Vinschen <corinna@vinschen.de>
138 * fhandler_socket.cc (fhandler_socket::wait): Set Winsock errno to
139 WSAEWOULDBLOCK instead of WSAEINPROGRESS.
141 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
143 * pinfo.cc (commune_process): Don't add extra \0 to cmdline.
144 (_pinfo::cmdline): Ditto process internal.
146 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
148 * mmap.cc (msync): Disable rounding up len. Fix bug in access check
151 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
153 * path.cc (symlink_worker): Return EEXIST if newpath exists.
155 2006-07-18 Christopher Faylor <cgf@timesys.com>
157 * tty.cc (tty_list::terminate): Don't enter the busy loop if we don't
160 2006-07-18 Silvio Laguzzi <slaguzzi@data-al.de>
162 * sec_acl.cc (acltotext32): Add missing handling of default ACL entry
165 2006-07-18 Brian Ford <Brian.Ford@FlightSafety.com>
166 Corinna Vinschen <corinna@vinschen.de>
168 * winsup.h (mmap_region_status): New enum.
169 (mmap_is_attached_or_noreserve_page): Adjust prototype and rename
171 * mmap.cc (mmap_is_attached_or_noreserve_page): Rename
172 mmap_is_attached_or_noreserve. Add region length parameter.
174 * exceptions.cc (_cygtls::handle_exceptions): Accomodate above.
175 * fhandler.cc (fhandler_base::raw_read): Call above for NOACCESS
176 errors and retry on success to allow reads into untouched
177 MAP_NORESERVE buffers.
179 2006-07-18 Corinna Vinschen <corinna@vinschen.de>
181 * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Fix typo in lint
184 2006-07-18 Corinna Vinschen <corinna@vinschen.de>
186 * cygwin.din (posix_openpt): Export.
187 * tty.cc (posix_openpt): New function.
188 * include/cygwin/stdlib.h (posix_openpt): Declare.
189 * include/cygwin/version.h: Bump API minor number.
191 2006-07-17 Christopher Faylor <cgf@timesys.com>
194 * cygheap.h (cygheap_user): Remove unneeded class names from function
196 * fhandler.h (fhandler_base): Ditto.
197 (fhandler_dev_floppy): Ditto.
198 (fhandler_console): Ditto.
199 * wininfo.h (wininfo): Ditto.
200 * exceptions.cc (sigpacket::process): Avoid compiler errors about gotos
202 * fhandler_fifo.cc (fhandler_fifo::open): Ditto.
203 * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Ditto.
204 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Ditto.
205 * mmap.cc (mmap64): Ditto.
206 * pipe.cc (fhandler_pipe::open): Ditto.
207 * spawn.cc (spawn_guts): Ditto.
209 * sec_helper.cc: Fix some comments.
210 (get_null_sd): Move file-scope static to only function where it is
213 2006-07-14 Christopher Faylor <cgf@timesys.com>
215 * fork.cc (fork): Lock the process before forking to prevent things
216 like new fds from being opened, etc.
217 * sync.h (lock_process::dont_bother): New function.
219 2006-07-14 Christopher Faylor <cgf@timesys.com>
221 * include/cygwin/types.h: Update copyright.
223 2006-07-14 Christopher Faylor <cgf@timesys.com>
225 * cygwin.sc: Make sure there's something in the cygheap.
226 * dllfixdbg: Accommodate newer binutils which put the gnu_debuglink at
227 the end rather than at the beginning.
229 2006-07-14 Corinna Vinschen <corinna@vinschen.de>
231 * security.cc (get_token_group_sidlist): Always add the interactive
232 group to the token. Add comment. Create logon_id group SID by
233 copying it from incoming group list.
234 (create_token): Add subauth_token parameter. Use information in
235 subauth_token if present. Tweak SourceIdentifier if subauth_token
236 is present for debugging purposes.
237 * security.h (create_token): Add subauth_token parameter in declaration.
238 * syscalls.cc (seteuid32): Call subauth first. Call create_token
239 regardless. Use subauth token in call to create_token if subauth
242 2006-07-13 Christopher Faylor <cgf@timesys.com>
244 * sigproc.cc (waitq_head): Don't initialize to zero.
245 * sigproc.h: Update copyright, fix whitespace.
247 2006-07-13 Christopher Faylor <cgf@timesys.com>
249 * fhandler.cc (fhandler_base::raw_read): Only return EISDIR when we're
250 really trying to read a directory.
252 * sigproc.cc: Use "Static" where appropriate.
254 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
256 * include/netinet/in.h: Update copyright.
258 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
260 * fhandler_socket.cc: Update copyright.
261 * include/pthread.h: Ditto.
263 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
265 * fhandler_socket.cc (fhandler_socket::wait): Rework function so that
266 WaitForMultipleObjects is really only called when necessary.
268 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
270 * mmap.cc (mmap64): Drop MAP_NORESERVE flag for non-anonymous,
271 non-private mappings.
272 (mmap_record::unmap_pages): Only check noreserve flag which now implies
273 anonymous and private.
275 (fixup_mmaps_after_fork): Ditto.
277 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
279 * mmap.cc (mmap64): Drop MAP_RESERVED flag for all non-anonymous,
280 non-private mappings.
282 2006-07-13 Corinna Vinschen <corinna@vinschen.de>
284 * exceptions.cc (_cygtls::handle_exceptions): Call new
285 mmap_is_attached_or_noreserve_page function in case of access violation
286 and allow application to retry access on noreserve pages.
287 * mmap.cc (mmap_is_attached_or_noreserve_page): Changed from
288 mmap_is_attached_page. Handle also noreserve pages now. Change
290 * winsup.h (mmap_is_attached_or_noreserve_page): Declare instead of
291 mmap_is_attached_page.
293 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
295 * mmap.cc (mmap_record::alloc_page_map): Don't call VirtualProtect
296 on maps created with MAP_NORESERVE.
298 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
300 * include/netdb.h: Declare rcmd, rcmd_af, rexec, rresvport,
301 rresvport_af, iruserok, iruserok_sa, ruserok.
303 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
305 * Makefile.in (DLL_OFILES): Drop iruserok.o. Add rcmd.o.
306 * autoload.cc (rcmd): Drop definition.
307 * cygwin.din: Export bindresvport, bindresvport_sa, iruserok_sa,
308 rcmd_af, rresvport_af.
309 * net.cc (cygwin_rcmd): Remove.
310 (last_used_bindresvport): Rename from last_used_rrecvport.
311 (cygwin_bindresvport_sa): New function implementing bindresvport_sa.
312 (cygwin_bindresvport): New function implementing bindresvport.
313 (cygwin_rresvport): Remove.
314 * include/cygwin/version.h: Bump API minor number.
315 * include/netinet/in.h: Declare bindresvport and bindresvport_sa.
316 * libc/iruserok.c: Remove file.
317 * libc/rcmd.cc: New file implementing rcmd, rcmd_af, rresvport,
318 rresvport_af, iruserok_sa, iruserok and ruserok.
320 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
322 * include/pthread.h: Define PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT and
323 PTHREAD_PRIO_PROTECT only if _POSIX_THREAD_PRIO_INHERIT is defined.
325 2006-07-12 Corinna Vinschen <corinna@vinschen.de>
327 * fhandler_socket.cc (fhandler_socket::getsockname): Return valid
328 result for unbound sockets.
330 2006-07-11 Corinna Vinschen <corinna@vinschen.de>
332 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Handle
333 wsock_mtx and wsock_evt on fork, thus handling close_on_exec correctly.
334 (fhandler_socket::fixup_after_exec): Drop misguided attempt to handle
336 (fhandler_socket::dup): Call fixup_after_fork with NULL parent.
338 (fhandler_socket::set_close_on_exec): Handle wsock_mtx and wsock_evt.
340 2006-07-10 Corinna Vinschen <corinna@vinschen.de>
342 * fhandler.h (class fhandler_socket): Add wsock_mtx, wsock_evt
343 and wsock_events members. Remove closed status flag, add listener
344 status flag. Accomodate new implementation of socket event handling
345 methods. Declare recv* and send* functions ssize_t as the POSIX
347 (fhandler_socket::recv_internal): Declare.
348 (fhandler_socket::send_internal): Ditto.
349 * fhandler_socket.cc (EVENT_MASK): Define mask of selected events.
350 (fhandler_socket::fhandler_socket): Initialize new members.
351 (fhandler_socket::af_local_setblocking): Don't actually set the
352 socket to blocking mode. Keep sane event selection.
353 (fhandler_socket::af_local_unsetblocking): Don't actually set the
354 socket to previous blocking setting, just remember it.
355 (struct wsa_event): New structure to keep event data per shared
357 (NUM_SOCKS): Define number of shared sockets concurrently handled by
358 all active Cygwin processes.
359 (wsa_events): New shared datastructure keeping all wsa_event records.
360 (socket_serial_number): New shared variable to identify shared sockets.
361 (wsa_slot_mtx): Global mutex to serialize wsa_events access.
362 (search_wsa_event_slot): New static function to select a new wsa_event
363 slot for a new socket.
364 (fhandler_socket::prepare): Rewrite. Prepare event selection
366 (fhandler_socket::wait): Rewrite. Wait for socket events in thread
367 safe and multiple process safe.
368 (fhandler_socket::release): Rewrite. Close per-socket descriptor
369 mutex handle and event handle.
370 (fhandler_socket::dup): Duplicate wsock_mtx and wsock_evt. Fix
371 copy-paste error in debug output.
372 (fhandler_socket::connect): Accomodate new event handling.
373 (fhandler_socket::listen): Set listener flag on successful listen.
374 (fhandler_socket::accept): Accomodate new event handling.
375 (fhandler_socket::recv_internal): New inline method centralizing
377 (fhandler_socket::recvfrom): Call recv_internal now.
378 (fhandler_socket::recvmsg): Ditto. Streamline copying from iovec
380 (fhandler_socket::send_internal): New inline method centralizing
382 (fhandler_socket::sendto): Call send_internal now.
383 (fhandler_socket::sendmsg): Ditto. Streamline copying from iovec
385 (fhandler_socket::close): Call release now.
386 (fhandler_socket::ioctl): Never actually switch to blocking mode.
387 Just keep track of the setting.
388 * net.cc (fdsock): Call prepare now.
389 (cygwin_connect): Revert again to event driven technique.
390 (cygwin_accept): Ditto.
391 * poll.cc (poll): Don't call recvfrom on a listening socket.
392 Remove special case for failing recvfrom.
393 * include/sys/socket.h: Declare recv* and send* functions ssize_t as
396 2006-07-10 Corinna Vinschen <corinna@vinschen.de>
398 * libc/inet_addr.c: Define __INSIDE_CYGWIN_NET__.
399 * libc/inet_network.c: Ditto.
401 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
403 * fhandler_socket.cc (fhandler_socket::wait): Disable SA_RESTART
406 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
408 * net.cc (cygwin_inet_ntop): Fix data type of forth parameter.
410 2006-07-07 Corinna Vinschen <corinna@vinschen.de>
412 * Makefile.in (DLL_OFILES): Add inet_addr.o and inet_network.o.
413 * autoload.cc (inet_addr): Drop definition.
415 * net.cc: Forward declare cygwin_inet_aton and cygwin_inet_ntop.
416 (cygwin_inet_ntoa): Call cygwin_inet_ntop instead of Winsock inet_ntoa.
417 (cygwin_inet_addr): Remove here.
418 (cygwin_inet_aton): Ditto.
419 (cygwin_inet_network): Ditto.
420 * libc/inet_addr.c: New file implementing cygwin_inet_aton and
422 * libc/inet_network.c: New file implementing cygwin_inet_network.
424 2006-07-06 Christopher Faylor <cgf@timesys.com>
426 * hookapi.cc: Add comment header
427 (putmem): Make static.
429 (rvadelta): Ditto. Don't assume that a section which ends where the
430 import_rva begins is the import list.
432 * child_info.h: Update copyright.
435 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
437 * include/cygwin/in6.h (struct in6_addr): Fix typo.
439 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
441 * cygwin.din: Export in6addr_any, in6addr_loopback, freeaddrinfo,
442 gai_strerror, getaddrinfo, getnameinfo.
443 * fhandler_socket.cc: Include cygwin/in6.h.
444 (get_inet_addr): Accomodate AF_INET6 usage.
445 (fhandler_socket::connect): Ditto.
446 (fhandler_socket::listen): Ditto.
447 (fhandler_socket::sendto): Ditto.
448 * net.cc: Include cygwin/in6.h.
449 (in6addr_any): Define.
450 (in6addr_loopback): Define.
451 (cygwin_socket): Accomodate AF_INET6 usage.
452 (socketpair): Bind socketpairs only to loopback for security.
453 (inet_pton4): New static function.
455 (cygwin_inet_pton): New AF_INET6 aware inet_pton implementation.
456 (inet_ntop4): New static function.
458 (cygwin_inet_ntop): New AF_INET6 aware inet_ntop implementation.
459 (ga_aistruct): New static function.
467 (ipv4_freeaddrinfo): Ditto.
468 (ipv4_getaddrinfo): Ditto.
469 (ipv4_getnameinfo): Ditto.
470 (gai_errmap_t): New structure holding error code - error string mapping.
471 (cygwin_gai_strerror): New function implementing gai_strerror.
472 (w32_to_gai_err): New static function.
473 (get_ipv6_funcs): Ditto.
474 (load_ipv6_funcs): Ditto.
475 (cygwin_freeaddrinfo): New function implementing freeaddrinfo.
476 (cygwin_getaddrinfo): New function implementing getaddrinfo.
477 (cygwin_getnameinfo): New function implementing getnameinfo.
478 * include/netdb.h: Include stdint.h and cygwin/socket.h. Define
479 data types and macros used by getaddrinfo and friends. Declare
480 freeaddrinfo, gai_strerror, getaddrinfo and getnameinfo.
481 * include/cygwin/in.h: Add IPv6 related IPPROTOs. Remove definition
482 of struct sockaddr_in6. Include cygwin/in6.h instead.
483 * include/cygwin/in6.h: New header file defining IPv6 releated
484 data types and macros.
485 * include/cygwin/socket.h: Enable AF_INET6 and PF_INET6. Add
486 IPv6 related socket options.
487 * include/cygwin/version.h: Bump API minor number.
489 2006-07-06 Corinna Vinschen <corinna@vinschen.de>
491 * autoload.cc (DsGetDcNameA): Define.
492 (NetGetAnyDCName): Define.
493 * security.cc: Include dsgetdc.h.
494 (DsGetDcNameA): Declare.
495 (DS_FORCE_REDISCOVERY): Define.
496 (get_logon_server): Add bool parameter to control rediscovery of DC.
497 Use DsGetDcNameA function if supported, NetGetDCName/NetGetAnyDCName
499 (get_server_groups): Rediscover DC if get_user_groups fails and
501 (get_reg_security): Use correct error code macro when testing
502 RegGetKeySecurity return value.
503 * security.h (get_logon_server): Remove default vaue from wserver
504 parameter. Add rediscovery parameter.
505 * uinfo.cc (cygheap_user::env_logsrv): Accomodate rediscovery parameter
506 in call to get_logon_server.
508 2006-07-05 Christopher Faylor <cgf@timesys.com>
510 * sortdin: Ignore all leading underscores when deriving a sort key.
511 * cygwin.din: Resort.
513 2006-07-05 Christopher Faylor <cgf@timesys.com>
515 * sortdin: New program.
518 2006-07-05 Corinna Vinschen <corinna@vinschen.de>
520 * fhandler.h (fhandler_socket::wait): Reset default timeout to 10ms.
522 2006-07-05 Corinna Vinschen <corinna@vinschen.de>
524 * path.cc (path_conv::check): Ignore has_ea setting, it's always unset
525 at this point anyway.
526 (get_symlink_ea): Remove.
527 (set_symlink_ea): Remove.
528 (symlink_worker): Drop writing symlink into NTFS extended attributes.
529 (symlink_info::check): Drop reading symlinks from NTFS extended
532 2006-07-04 Christopher Faylor <cgf@timesys.com>
534 * libc/rexec.cc (cygwin_rexec): Obvious (?) fix to correct a gcc
535 warning - set port to zero first thing in the function.
537 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
539 * signal.cc (signal): Set sa_mask to sig.
541 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
543 * Makefile.in (DLL_OFILES): Add rexec.o.
544 * autoload.cc (inet_network): Drop definition.
546 * net.cc (rexec): Drop extern declaration.
547 (inet_network): Ditto.
548 (cygwin_inet_network): Implement using inet_addr.
549 (cygwin_rexec): Remove.
550 * libc/rexec.cc: New file.
552 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
554 * fhandler_socket.cc (fhandler_socket::listen): Allow listening on
557 2006-07-04 Corinna Vinschen <corinna@vinschen.de>
559 * fhandler.h (fhandler_socket::wait): Set default timeout to INFINITE.
561 2006-07-03 Corinna Vinschen <corinna@vinschen.de>
563 * autoload.cc (NtQueryEaFile): Define.
564 (NtSetEaFile): Define.
565 * fhandler.cc (fhandler_base::open): Use appropriate open flags
566 in query case when allow_ntea is set.
567 * ntdll.h (struct _FILE_GET_EA_INFORMATION): Define.
568 (struct _FILE_FULL_EA_INFORMATION): Define.
569 (NtQueryEaFile): Declare.
570 (NtSetEaFile): Declare.
571 * ntea.cc (read_ea): Rename from NTReadEA and rewrite using
573 (write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile.
574 * path.cc (get_symlink_ea): Make static. Add handle parameter to
575 accomodate new read_ea call.
576 (set_symlink_ea): Make static. Add handle parameter to accomodate new
578 (symlink_worker): Call set_symlink_ea while file is still open.
579 (symlink_info::check): Call get_symlink_ea after file has been opened.
580 * security.cc (get_file_attribute): Accomodate new read_ea call.
581 (set_file_attribute): Accomodate new write_ea call.
582 * security.h (read_ea): Change declaration accordingly.
585 2006-07-03 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
587 * fhandler.h (class dev_console): Add `metabit' indicating the
588 current meta key mode.
589 * fhandler_console.cc (fhandler_console::read): Set the top bit of
590 the character if metabit is true.
591 * fhandler_console.cc (fhandler_console::ioctl): Implement
592 KDGKBMETA and KDSKBMETA commands.
593 * fhandler_tty.cc (process_ioctl): Support KDSKBMETA.
594 (fhandler_tty_slave::ioctl): Send KDGKBMETA and KDSKBMETA to the
596 * include/cygwin/kd.h: New file for the meta key mode.
597 * include/sys/kd.h: New file.
599 2006-07-03 Eric Blake <ebb9@byu.net>
601 * include/stdint.h (UINT8_C, UINT16_C): Unsigned types smaller
602 than int promote to signed int.
604 2006-07-03 Corinna Vinschen <corinna@vinschen.de>
606 * net.cc (cygwin_sendto): Define appropriate parameters using
607 socklen_t type according to SUSv3.
608 (cygwin_recvfrom): Ditto.
609 (cygwin_setsockopt): Ditto.
610 (cygwin_getsockopt): Ditto.
611 (cygwin_connect): Ditto.
612 (cygwin_accept): Ditto.
613 (cygwin_bind): Ditto.
614 (cygwin_getsockname): Ditto.
615 (cygwin_getpeername): Ditto.
616 (cygwin_recv): Ditto.
617 (cygwin_send): Ditto.
618 * include/cygwin/socket.h (socklen_t): Typedef and define.
619 * include/sys/socket.h: Declare socket functions using socklen_t type.
621 2006-07-02 Christopher Faylor <cgf@timesys.com>
623 * include/cygwin/version.h: Bump DLL minor version number to 21.
625 2006-06-30 Corinna Vinschen <corinna@vinschen.de>
627 * net.cc (cygwin_sendto): Allow zero-sized packets.
628 (cygwin_sendmsg): Ditto.
630 2006-06-26 Corinna Vinschen <corinna@vinschen.de>
632 Revert patches from 2005-10-22 and 2006-06-14 to use event driven
633 accept and connect back to using select:
634 * fhandler.h (class fhandler_socket): Remove accept_mtx.
635 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop
636 initializing accept_mtx.
637 (fhandler_socket::accept): Drop event handling.
638 (fhandler_socket.cc (fhandler_socket::connect): Ditto.
639 (fhandler_socket::dup): Drop accept_mtx handling.
640 (fhandler_socket::listen): Ditto.
641 (fhandler_socket::prepare): Ditto.
642 (fhandler_socket::release): Ditto.
643 (fhandler_socket::close): Ditto.
644 * net.cc (cygwin_accept): Revert to calling cygwin_select to
645 implement interuptible accept.
646 (cygwin_connect): Ditto for connect.
648 2006-06-22 Christopher Faylor <cgf@timesys.com>
650 * fhandler_fifo.cc (fhandler_fifo::open): Release process lock and grab
651 a system-wide mutex to prevent a deadlock and a race.
652 * sync.h (lock_process): Make fhandler_fifo a friend.
654 * smallprint.c (__small_vsprintf): Cosmetic change.
656 2006-06-15 Corinna Vinschen <corinna@vinschen.de>
658 * cygwin.din: Export __srget_r, __swbuf_r.
659 * include/cygwin/version.h: Bump API minor number to 156.
661 2006-06-14 Corinna Vinschen <corinna@vinschen.de>
663 * fhandler.h (class fhandler_socket): Add private mutex handle
665 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
667 (fhandler_socket::dup): Duplicate accept_mtx, if available.
668 (fhandler_socket::listen): Create accept_mtx before trying to listen.
669 (fhandler_socket::prepare): Wait for accept_mtx if available to
670 serialize accepts on the same socket.
671 (fhandler_socket::release): Release accept_mtx.
672 (fhandler_socket::close): Close accept_mtx on successful closesocket.
674 2006-06-12 Christopher Faylor <cgf@timesys.com>
676 * fhandler_tty.cc (fhandler_pty_master::close): Always close
677 from_master/to_master since we always have copies of these handles.
679 2006-06-12 Corinna Vinschen <corinna@vinschen.de>
681 * include/sys/wait.h: Move definition of wait constants from here...
682 * include/cygwin/wait.h: ...to here. New file.
683 * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3.
685 2006-06-12 Pierre Humblet Pierre.Humblet@ieee.org
687 * heap.cc (heap_init): Only commit if allocsize is not zero.
689 2006-06-12 Corinna Vinschen <corinna@vinschen.de>
691 * net.cc (fdsock): Disable raising buffer sizes. Add comment to
694 2006-06-04 Christopher Faylor <cgf@timesys.com>
696 * ioctl.cc (ioctl): Accommodate change in reported pty master device
698 * select.cc (peek_pipe): Ditto.
700 2006-06-04 Christopher Faylor <cgf@timesys.com>
702 * cygtls.h (CYGTLS_PADSIZE): Reset to a size that XP SP1 seems to like.
703 * tlsoffsets.h: Regenerate.
705 2006-06-03 Christopher Faylor <cgf@timesys.com>
707 * cygthread.cc (cygthread::terminate_thread): In debugging output, use
708 name of thread being terminated rather than thread doing the
711 * fhandler.h (fhandler_pty_master::slave): Delete.
712 (fhandler_pty_master::get_unit): Ditto.
713 (fhandler_pty_master::setup): Change argument declaration to
714 accommodate new usage.
715 * fhandler_tty.cc (fhandler_tty_master::init): Remove obsolete slave
716 assignment. Pass argument to setup indicating that this is a tty.
717 (fhandler_tty_slave::open): Use dev() method rather than referencing
719 (fhandler_pty_master::open): Don't create archetype based on ptym
720 device number. Set device number to use DEV_TTYM_MAJOR and tty number.
721 Pass argument to setup indicating that this is a pty.
722 (fhandler_pty_master::setup): Change single argument to a flag
723 indicating whether we're creating a pty and use appropriately.
724 Calculate 't' variable here rather than in caller.
726 * fhandler_dsp.cc (fhandler_dev_dsp::open): Use dev() method rather
727 than referencing pc.dev directly.
729 2006-06-03 Christopher Faylor <cgf@timesys.com>
731 * dcrt0.cc (dll_crt0_0): Call tty_list::init_session here.
732 (dll_crt0_1): Reflect renaming from tty_init to tty::init_session.
733 (do_exit): Reflect moving of tty_terminate into tty_list.
734 * exceptions.cc (events_init): Move tty_mutex stuff elsewhere.
735 * fhandler_console.cc (set_console_title): Use lock_ttys class.
736 * fhandler_termios.cc (fhandler_termios::bg_check): Make debug output
738 * fhandler_tty.cc (fhandler_tty_slave::open): Reflect move of
739 attach_tty into tty_list class. Don't attempt to grab master end of
740 pty if master doesn't exist.
741 (fhandler_pty_master::open): Reflect move of allocate_tty into tty_list
742 class. Use lock_ttys::release to release mutex. Improve debugging
744 (fhandler_pty_master::setup): Remove if 0'ed block. Fix argument to
745 SetNamedPipeHandleState.
746 * pinfo.cc (_pinfo::set_ctty): Lock ttys before setting sid/pgid.
747 Improve debugging. Add temporary debugging.
748 * tty.cc (tty_list::init_session): New function.
749 (tty::init_session): Rename from tty_init. Reflect move of attach_tty
751 (tty::create_master): Rename from create_tty_master.
752 (tty_list::attach): Rename from attach_tty. Reflect renaming of
753 connect_tty to connect. Ditto for allocate_tty.
754 (tty_terminate): Delete.
755 (tty_list::terminate): Subsume tty_terminate. Use lock_ttys rather
756 than manipulating mutex directly.
757 (tty_list::allocate): Rename from allocate_tty. Use lock_ttys rather
758 than manipulating mutex directly. Don't set sid here since linux
759 apparently doesn't do this. Reflect move of create_tty_master into
761 (lock_ttys::lock_ttys): Define new constructor.
762 (lock_ttys::release): New function.
763 * tty.h (tty::exists): Return false immediately if !master_pid.
764 (tty::set_master_closed): Define new function.
765 (tty::create_master): Ditto.
766 (tty::init_session): Ditto.
767 (tty_list::mutex): New field.
768 (tty_list::allocate): Define new function.
769 (tty_list::connect): Ditto.
770 (tty_list::attach): Ditto.
771 (tty_list::init_session): Ditto.
772 (lock_ttys): New class.
773 (tty_init): Delete declaration.
774 (tty_terminate): Ditto.
776 (create_tty_master): Ditto.
778 2006-06-03 Christopher Faylor <cgf@timesys.com>
780 * Makefile.in (libdl.a): New library.
782 2006-06-03 Christopher Faylor <cgf@timesys.com>
784 * fhandler_tty.cc (fhandler_pty_master::close): Don't close handles if
786 (fhandler_pty_master::setup): Make sure that original handle is closed
787 when changing inheritance.
788 (fhandler_pty_master::fixup_after_fork): Set from_master/to_master to
790 (fhandler_pty_master::fixup_after_exec): Clear from_master/to_master
793 2006-06-03 Christopher Faylor <cgf@timesys.com>
795 * cygheap.cc (init_cygheap::close_ctty): Remove obsolete code.
796 * dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've
797 run fixup_after_exec.
798 * dtable.cc (dtable::fixup_after_exec): Add debugging output.
799 * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of
801 (fhandler_tty_common::close): Remove obsolete code.
802 (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done
803 in dtable's fixup_after_exec. (revisit later?)
804 (fhandler_pty_master::fixup_after_exec): Ditto.
806 2006-06-02 Christopher Faylor <cgf@timesys.com>
808 * cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision
810 * tlsoffsets.h: Regenerate.
812 * dcrt0.cc (break_here): Define unconditionally for use elsewhere.
813 Call DebugBreak, if appropriate.
814 (initial_env): Rely on break_here() to call DebugBreak.
815 * exceptions.cc (try_to_debug): Ditto.
817 2006-06-02 Christopher Faylor <cgf@timesys.com>
819 * fhandler.cc (fhandler_base::fixup_after_exec): Declare here.
820 * fhandler.h (fhandler_base::fixup_after_exec): Make non-inline.
821 (fhandler_termios::fixup_after_fork): Delete declaration.
822 (fhandler_termios::fixup_after_exec): Ditto.
823 (fhandler_tty_common::inuse): Remove.
824 (fhandler_tty_common::dup): Delete declaration.
825 (fhandler_tty_common::fixup_after_fork): Ditto.
826 (fhandler_tty_slave::fixup_after_exec): Declare new function.
827 (fhandler_pty_master::dwProcessId): New variable.
828 (fhandler_pty_master::from_master): Ditto.
829 (fhandler_pty_master::to_master): Ditto.
830 (fhandler_pty_master::setup): New function.
831 (fhandler_pty_master::fixup_after_fork): Ditto.
832 (fhandler_pty_master::fixup_after_exec): Ditto.
833 * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Delete
835 (fhandler_termios::fixup_after_fork): Ditto.
836 * fhandler_tty.cc (fhandler_tty_master::init): Use fhandler_pty_master
837 setup function rather than obsolete tty::common_init. Delete obsolete
839 (fhandler_tty_slave::fhandler_tty_slave): Set inuse to NULL here.
840 (fhandler_tty_slave::open): Change debugging output for clarity. Check
841 for different things when doing a sanity check on the tty. Reflect the
842 fact that master_pid now is the cygwin pid rather than the windows pid.
843 Use "arch" rather than "archetype" for consistency.
844 (fhandler_tty_slave::close): Close inuse here.
845 (fhandler_tty_slave::dup): Remove old if 0'ed code.
846 (fhandler_pty_master::dup): New function. Handles pty master
848 (fhandler_pty_master::fhandler_pty_master): Zero pty_master specific
850 (fhandler_pty_master::open): Implement using archetypes, similar to
851 slave. Use fhandler_pty_master setup function rather than obsolete
852 tty::common_init. Don't set inuse.
853 (fhandler_tty_common::close): Don't deal with inuse. Delete old if
855 (fhandler_pty_master::close): Implement using archetypes. Close
856 from_master and to_master.
857 (fhandler_tty_common::set_close_on_exec): Just set close_on_exec flag
858 here since everything uses archetypes now.
859 (fhandler_tty_common::fixup_after_fork): Delete definition.
860 (fhandler_tty_slave::fixup_after_exec): Define new function.
861 (fhandler_pty_master::setup): New function, derived from
863 (fhandler_pty_master::fixup_after_fork): New function.
864 (shared_info.h): Reset SHARED_INFO_CB to reflect new tty size.
865 * tty.cc (tty_list::terminate): Close individual handles from
867 (tty::master_alive): Delete.
868 (tty::make_pipes): Ditto.
869 (tty::common_init): Ditto.
870 * tty.h (tty::from_slave): Delete.
871 (tty::to_slave): Ditto.
872 (tty::common_init): Delete declaration.
873 (tty::make_pipes): Ditto.
874 (tty::master_pid): Define as pid_t since it is now a cygwin pid.
876 2006-06-01 Christopher Faylor <cgf@timesys.com>
878 * cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here.
879 Let the caller do that.
880 * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here
881 to allow fixup_after_exec functions to use it.
883 * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with
885 * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls
886 before seeing if it is initialized.
887 * gendef (_sigfe_maybe): Ditto.
888 * dcrt0.cc (dll_crt0_1): Remove static, use just one argument.
889 * dll_init.cc (dllcrt0_info): New structure.
890 (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that
891 we'll always be assured of having something like a tls.
892 (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0.
893 Unconditionally call _my_tls.init_exception_handler now that we are
894 assured of having a tls. Change variable name from "linking" to "linked".
895 * winsup.h (dll_crt0_1): Declare.
896 (dll_dllcrt0_1): Ditto.
898 2006-05-30 Christopher Faylor <cgf@timesys.com>
900 * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.
902 2006-05-29 Christopher Faylor <cgf@timesys.com>
904 * winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork
907 2006-05-28 Christopher Faylor <cgf@timesys.com>
909 * sigproc.cc (child_info::proc_retry): Mask all of the bits we're
910 interested in, which includes bits above and below 0xc0000000.
912 2006-05-27 Christopher Faylor <cgf@timesys.com>
914 * dll_init.cc (dll_dllcrt0): Previous change didn't work very well with
915 fork. Semi-revert it but change name of variable to something that
918 2006-05-27 Christopher Faylor <cgf@timesys.com>
920 * thread.cc (verifyable_object_isvalid): Check for NULL specifically.
922 2006-05-27 Christopher Faylor <cgf@timesys.com>
924 * dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if
925 we've finished initializing (Thanks to Gary Zablackis for noticing this
926 problem). Just use cygwin_finished_initializing rather than defining a
929 2006-05-25 Christopher Faylor <cgf@timesys.com>
931 * debug.h (ModifyHandle): Define new macro.
932 (modify_handle): Declare new function.
933 * debug.cc (modify_handle): Define new function.
934 * fhandler.h (fhandler_base::fork_fixup): Change return value from void
936 * fhandler.cc (fhandler_base::fork_fixup): Return true if fork fixup has
938 * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance of
939 protected handle via ModifyHandle if DEBUGGING.
940 (fhandler_pipe::fixup_after_fork): Protect guard handle if fork fixup
943 2006-05-24 Christopher Faylor <cgf@timesys.com>
945 * cygtls.cc (_cygtls::call): Call call2 using _my_tls.
946 (_cygtls::init_exception_handler): Always replace existing exception
947 handler with cygwin exception handler.
948 * cygtls.h (_cygtls::call2): Remove static designation.
949 * dcrto.cc (dll_crt0_1): Define in a way that allows calling via
951 (_initialize_main_tls): Delete.
952 (_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here.
953 * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE.
954 * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define.
955 * tlsoffsets.h: Regenerate.
957 2006-05-24 Christopher Faylor <cgf@timesys.com>
959 * configure.in: Update to newer autoconf.
960 (thanks to Steve Ellcey)
961 * configure: Regenerate.
962 * aclocal.m4: New file.
964 2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
966 * fhandler.cc (readv): Remove nonsensical assert.
968 2006-05-23 Christopher Faylor <cgf@timesys.com>
970 * select.cc (start_thread_socket): Delay setting thread local exitsock
971 until we know it's correct. Return correct value on error.
973 2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>
974 Christopher Faylor <cgf@timesys.com>
976 * select.cc (start_thread_socket): Clean up exitsock in case of error.
977 Use si->exitcode consistently.
979 2006-05-21 Christopher Faylor <cgf@timesys.com>
981 * child_info.h (_CI_SAW_CTRL_C): New enum.
982 (CURR_CHILD_INFO_MAGIC): Reset.
983 (saw_ctrl_c): New function.
984 (set_saw_ctrl_c): Ditto.
985 * sigproc.cc (child_info::proc_retry): Return EXITCODE_OK if we get
986 STATUS_CONTROL_C_EXIT and we actually saw a CTRL-C.
987 * spawn.cc (dwExeced): Delete.
988 (chExeced): New variable.
989 (spawn_guts): Set chExeced;
990 * exceptions.cc (dwExeced): Delete declaration.
992 (ctrl_c_handler): Detect if we're an exec stub process and set a flag,
995 * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Add
996 extra DEBUGGING test.
998 * pinfo.cc: Fix comment.
1000 2006-05-21 Christopher Faylor <cgf@timesys.com>
1002 * fhandle.h (fhandler_pipe::create_guard): Revert change which
1003 eliminated SECURITY_ATTRIBUTES argument.
1004 * pipe.cc (fhandler_pipe::open): Duplicate guard from other process and
1005 protect it appropriately. Eliminate unneeded writepipe_exists
1006 temporary variable. Set inheritance appropriately.
1007 (fhandler_pipe::set_close_on_exec): Revert change which eliminated
1008 handling guard inheritance.
1009 (fhandler_pipe::fixup_after_fork): Ditto. Use correct name of entity
1010 being checked by fork_fixup.
1011 (fhandler_pipe::fixup_after_exec): Don't bother with guard here.
1012 (fhandler_pipe::dup): Cosmetic changes and revert creation of
1013 writepipe_exists as noninheritable.
1014 (fhandler_pipe::create): Revert change which eliminated
1015 SECURITY_ATTRIBUTES argument. Revert change which always made
1016 writepipe_exists noninheritable.
1018 2006-05-21 Christopher Faylor <cgf@timesys.com>
1020 * debug.cc (add_handle): Print handle value when collision detected.
1021 * dtable.cc (dtable::stdio_init): Cosmetic change.
1022 * fhandler.h (fhandler_base::create_read_state): Protect handle.
1023 (fhandler_pipe::create_guard): Ditto. Always mark the handle as
1025 (fhandler_pipe::is_slow): Return boolean value rather than numeric 1.
1026 * pipe.cc (fhandler_pipe::fhandler_pipe): Always flag that we need fork
1028 (fhandler_pipe::open): Don't pass security attributes to create_guard.
1029 (fhandler_pipe::set_close_on_exec): Don't handle guard here.
1030 (fhandler_pipe::close): Accommodate now-protected guard handle.
1031 (fhandler_pipe::fixup_in_child): Don't protect read_state here.
1032 (fhandler_pipe::fixup_after_exec): Close guard handle if close_on_exec.
1033 (fhandler_pipe::fixup_after_fork): Don't bother with guard here.
1034 (fhandler_pipe::dup): Don't set res to non-error prematurely. Use
1035 boolean values where appropriate. Protect guard and read_state.
1036 (fhandler_pipe::create): Don't call need_fork_fixup since it is now the
1037 default. Don't protect read_state or guard.
1039 * pipe.cc (fhandler_base::ready_for_read): Use bool values for "avail".
1041 * spawn.cc (spawn_guts): Set cygheap->pid_handle as inheritable when
1044 2006-05-15 Lev Bishop <lev.bishop+cygwin@gmail.com>
1045 Christopher Faylor <cgf@timesys.com>
1047 * select.cc (fhandler_pipe::ready_for_read): Actually get the guard
1048 mutex for blocking reads.
1050 2006-05-20 Christopher Faylor <cgf@timesys.com>
1052 * fhandler_tty.cc (fhandler_tty::close): Remove problematic hExeced guard.
1054 2006-05-20 Christopher Faylor <cgf@timesys.com>
1056 * fhandler_tty.cc (fhandler_tty_slave::open): Reinstate call to
1057 need_invisible on first pty open.
1059 2006-05-18 Christopher Faylor <cgf@timesys.com>
1061 * fhandler_console.cc (fhandler_console::need_invisible): Allocate an
1062 invisible window station when ctty != TTY_CONSOLE.
1064 2006-05-16 Christopher Faylor <cgf@timesys.com>
1066 * cygtls.cc (_cygtls::remove): Don't test for initialization since
1067 this function will always be called when _my_tls is initialized.
1068 * init.cc (dll_entry): Don't attempt to remove tls info if _my_tls is
1069 obviously not even available.
1071 2006-05-15 Christopher Faylor <cgf@timesys.com>
1073 * sigproc.cc (no_signals_available): Detect hwait_sig ==
1074 INVALID_HANDLE_VALUE.
1075 (wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT.
1077 2006-05-15 Christopher Faylor <cgf@timesys.com>
1079 * cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and
1081 * cygtls.h (_my_tls::padding): Delete.
1082 (CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the
1084 * dcrt0.cc (initialize_main_tls): Change return to void.
1085 * gentls_offsets: Treat const specially, too. Keep going after a '}'
1086 is found. Change negative offset calculation to use CYGTLS_PADSIZE.
1087 * init.cc (_my_oldfunc): New variable.
1088 (threadfunc_fe): Use stored tls value for oldfunc rather than blindly
1089 writing to the stack.
1090 (munge_threadfunc): Set oldfunc in tls.
1091 (dll_entry): Initialize tls allocation.
1092 * tlsoffsets.h: Regenerate.
1094 2006-05-13 Christopher Faylor <cgf@timesys.com>
1096 * ntdll.h (STATUS_INVALID_INFO_CLASS): Conditionalize.
1098 2006-05-10 Brian Dessent <brian@dessent.net>
1100 * Makefile.in (clean): Also delete *.dbg.
1102 2006-05-08 Christian Franke <Christian.Franke@t-online.de>
1104 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix typo which
1105 caused test for ".." to be skipped.
1107 2006-05-02 Christopher Faylor <cgf@timesys.com>
1109 * external.cc (cygwin_internal): Set errno on failure.
1111 2006-04-27 Corinna Vinschen <corinna@vinschen.de>
1113 * pipe.cc (DEFAULT_PIPEBUFSIZE): Raise to 64K.
1115 2006-04-26 Corinna Vinschen <corinna@vinschen.de>
1117 * fhandler.h (fhandler_base): Change fstat_helper prototype
1118 to take file size and inode number as 64 bit values.
1119 * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc
1120 (FS_IS_SAMBA_WITH_QUOTA): Ditto.
1121 (path_conv::hasgood_inode): Delete.
1122 (path_conv::is_samba): Delete.
1123 (path_conv::isgood_inode): Centralized function to recognize
1124 a good inode number.
1125 (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size.
1126 Accomodate argument change in fstat_helper.
1127 (fhandler_base::fstat_by_name): Ditto.
1128 (fhandler_base::fstat_helper): Accomodate argument change. Call
1129 path_conv::isgood_inode to recognize good inodes.
1130 (fhandler_disk_file::opendir): Explain Samba weirdness here.
1131 Call path_conv::fs_is_samba instead of path_conv::is_samba.
1132 (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS
1133 as valid return code from NtQueryDirectoryFile to indicate that
1134 FileIdBothDirectoryInformation is not supported.
1135 Call path_conv::isgood_inode to recognize good inodes.
1136 * ntdll.h (STATUS_INVALID_INFO_CLASS): Define.
1137 * path.cc (fs_info::update): Rework file system recognition
1138 and set appropriate flags.
1139 * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags.
1140 Constify pure read accessors.
1142 2006-04-24 Christopher Faylor <cgf@timesys.com>
1144 * environ.cc (getearly): Force correct dereference order when
1145 inspecting environ table.
1147 2006-04-24 Corinna Vinschen <corinna@vinschen.de>
1149 * select.cc (thread_pipe): Raise sleep time only every 8th iteration.
1150 (thread_mailslot): Ditto.
1152 2006-04-23 Corinna Vinschen <corinna@vinschen.de>
1153 Christopher Faylor <cgf@timesys.com>
1155 * select.cc (thread_pipe): Raise sleep time dynamically to speed up
1156 select on pipes when copying lots of data.
1157 (thread_mailslot): Ditto for mailslots.
1159 2006-04-22 Christopher Faylor <cgf@timesys.com>
1161 * signal.cc (abort): On second thought, just set incyg once.
1163 2006-04-22 Christopher Faylor <cgf@timesys.com>
1165 * signal.cc (abort): Set incyg manually to help get a reliable gdb
1167 * cygwin.din (abort): Make NOSIGFE.
1169 2006-04-21 Pierre Humblet Pierre.Humblet@ieee.org
1170 Christopher Faylor <cgf@timesys.com>
1172 * environ.cc (getearly): Use GetEnvironmentVariable and cmalloc instead
1173 of GetEnvironmentStrings.
1174 (environ_init): Revert rawenv stuff.
1176 2006-04-21 Christopher Faylor <cgf@timesys.com>
1178 * environ.cc (rawenv): Make this variable a file-scope static.
1179 (getearly): Rename 's' variable to 'len' since 's' is used fairly
1180 consistently throughout cygwin as a string variable. Remove rawenv
1181 declaration. Perform other minor cleanups.
1182 (environ_init): Remove rawenv declaration. Only set rawenv to
1183 GetEnvironmentStrings() if it has not already been set. Properly free
1184 rawenv in all cases.
1186 2006-04-21 Christopher Faylor <cgf@timesys.com>
1188 * tty.h (tty::hwnd): Move to tty_min.
1189 (tty::gethwnd): Ditto.
1190 (tty::sethwnd): Ditto.
1191 (tty_min::hwnd): Receive variable from tty class.
1192 (tty_min::gethwnd): Receive function from tty classs.
1193 (tty_min::sethwnd): Ditto.
1194 * dtable.cc (dtable::stdio_init): Only call init_console_handler when
1195 we actually own the console.
1196 * fhandler_console.cc (fhandler_console::get_tty_stuff): Set tty's hwnd
1198 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Semi-reinstate
1199 handling of console when pgrp is set.
1201 2006-04-21 Pierre Humblet <Pierre.Humblet@ieee.org>
1202 Corinna Vinschen <corinna@vinschen.de>
1204 * environ.cc (getearly): New function.
1205 (findenv_func): New function pointer, predefined to getearly.
1206 (getenv): Call findenv function over the findenv_func pointer.
1207 (environ_init): Change findenv_func pointer to my_findenv after Cygwin
1208 environment is initialized.
1210 2006-04-21 Lars Munch <lars@segv.dk>
1212 * include/asm/byteorder.h (__ntohl): Fix the missing uint32_t.
1214 2006-04-21 Corinna Vinschen <corinna@vinschen.de>
1216 * fhandler_socket.cc (fhandler_socket::wait): Reorder setting
1217 WSAError to avoid spurious errors with WSAError set to 0.
1219 2006-04-21 Corinna Vinschen <corinna@vinschen.de>
1221 * include/asm/byteorder.h: Include stdint.h. Per standard, change
1222 datatypes in ntohX and htonX functions to uintXX_t types.
1224 2006-04-18 Christopher Faylor <cgf@timesys.com>
1226 * exceptions.cc (ctrl_c_handler): Only exit TRUE on CTRL_LOGOFF_EVENT
1227 when we have actually handled the event.
1229 2006-04-17 Eric Blake <ebb9@byu.net>
1231 * mktemp.cc (_gettemp): Open temp files in binary mode.
1233 2006-04-14 Corinna Vinschen <corinna@vinschen.de>
1235 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use UINT32_MAX
1236 instead of UINT_MAX.
1238 2006-04-14 Corinna Vinschen <corinna@vinschen.de>
1240 * fhandler_disk_file.cc (path_conv::hasgood_inode): Make inline.
1241 Drop remote fs handling entirely since unreliable inode numbers
1242 are now recognized differently.
1243 (path_conv::is_samba): Make inline.
1244 (fhandler_disk_file::opendir): Reformat comment.
1245 (fhandler_base::fstat_helper): Special case remote file systems
1246 returning (unreliable) 32 bit inode numbers.
1247 (fhandler_disk_file::readdir): Ditto.
1248 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto.
1250 2006-04-13 Christopher Faylor <cgf@timesys.com>
1252 * spawn.cc (spawn_guts): Move ch.set() call back to where it was
1255 2006-04-13 Corinna Vinschen <corinna@vinschen.de>
1257 * sysconf.cc (sysconf): Add _SC_THREADS, _SC_THREAD_ATTR_STACKSIZE,
1258 _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PROCESS_SHARED,
1259 _SC_THREAD_SAFE_FUNCTIONS, _SC_TIMERS handling.
1261 2006-04-12 Corinna Vinschen <corinna@vinschen.de>
1262 Christopher Faylor <cgf@timesys.com>
1264 * spawn.cc (spawn_guts): Revert patch which treated derived cygwin
1265 programs differently from those which are mounted with -X. Pass extra
1266 argument to linebuf::fromargv.
1267 * winf.h (MAXCYGWINCMDLEN): New define.
1268 (linebuf::finish): Add a new argument denoting when command line
1270 (linebuf::fromargv): Ditto.
1271 * winf.cc (linebuf::finish): Implement above change.
1272 (linebuf::fromargv): Ditto.
1274 2006-04-11 Christopher Faylor <cgf@timesys.com>
1276 * Makefile.in (DLL_OFILES): Add winf.o.
1277 * spawn.cc: Move command line handling stuff into winf.cc.
1279 * winf.cc: New file.
1281 2006-04-05 Christopher Faylor <cgf@timesys.com>
1283 * fhandler_socket.cc: Move iptypes.h include after winsock2 since it
1287 2006-04-05 Christopher Faylor <cgf@timesys.com>
1289 * dcrt0.cc (dll_crt0_0): Move user_data->{resourcelocks,threadinterface}
1290 initialization here from dll_crt0_1.
1291 (dll_crt0_1): See above.
1293 2006-04-04 Corinna Vinschen <corinna@vinschen.de>
1295 * net.cc (fdsock): Raise default SO_RCVBUF/SO_SNDBUF buffer sizes to
1296 the same values as on Linux.
1298 2006-04-03 Christopher Faylor <cgf@timesys.com>
1300 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
1301 (child_info_fork::alloc_stack): Move into this class.
1302 (child_info_fork::alloc_stack_hard_way): Ditto.
1303 * dcrt0.cc (child_info_fork::alloc_stack): Ditto.
1304 (child_info_fork::alloc_stack_hard_way): Ditto.
1305 (_dll_crt0): Reference alloc_stack via fork_info.
1307 2006-04-03 Corinna Vinschen <corinna@vinschen.de>
1309 * spawn.cc (linebuf::finish): Drop argument. Don't check command line
1311 (spawn_guts): Remove wascygexec. Check real_path.iscygexec instead.
1312 Accommodate change to linebuf::finish.
1314 2006-04-03 Christopher Faylor <cgf@timesys.com>
1316 * dcrt0.cc (sm): Delete.
1317 (alloc_stack_hard_way): Figure out where the stack lives here rather
1318 than relying on previously filled out information which has been
1319 invalid since 1.5.19.
1321 2006-03-31 Corinna Vinschen <corinna@vinschen.de>
1323 * fhandler_disk_file.cc (FS_IS_SAMBA_WITH_QUOTA): New define.
1324 (path_conv::hasgood_inode): Recognize Samba with quota support
1326 (path_conv::is_samba): Ditto. Fix comment to include Samba version
1327 numbers for later reference.
1329 2006-03-30 Corinna Vinschen <corinna@vinschen.de>
1331 * security.h (sec_user_nih): Make sid1 argument mandatory.
1334 2006-03-29 Christopher Faylor <cgf@timesys.com>
1336 * sigproc.cc (wait_for_sigthread): Use the current user sid when
1337 setting up the signal pipe rather than relying on (eventually) the
1340 2006-03-29 Christopher Faylor <cgf@timesys.com>
1342 * dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so
1343 that it can be used by subsequent startup functions.
1344 (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING.
1345 (dll_crt0_1): Move user_data->{resourcelocks,threadinterface}
1346 initialization here from dll_crt0_0.
1347 * fork.cc (frok::child): Tell wait_for_sigthread that this is fork.
1348 (frok::parent): Only initialize start_time once. Tighten time when
1349 we're "deimpersonated".
1350 * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff.
1351 Add debugging output.
1352 (wait_for_sigthread): Accept an argument which illustrates whether we
1354 (wait_sig): Avoid using myself pointer.
1355 * winsup.h ((wait_for_sigthread): Reflect change to argument.
1357 2006-03-26 Christopher Faylor <cgf@timesys.com>
1359 * spawn.cc (spawn_guts): Close handles if we know that we will not be
1360 seeing a sync event from the child.
1362 2006-03-26 Christopher Faylor <cgf@timesys.com>
1364 * sigproc.cc (wait_sig): Move myself manipulation...
1365 (wait_for_sigthread): ...to here.
1367 2006-03-24 Corinna Vinschen <corinna@vinschen.de>
1369 * fhandler_floppy.cc: Include ntdef.h and ntdll.h.
1370 (fhandler_dev_floppy::get_drive_info): Rearrange so that now
1371 NtQueryVolumeInformationFile is called on drives which don't support
1372 IOCTL_DISK_GET_DRIVE_GEOMETRY.
1373 * ntdll.h (struct _FILE_FS_SIZE_INFORMATION): Add.
1374 (enum _FSINFOCLASS): Add missing values.
1376 2006-03-23 Christopher Faylor <cgf@timesys.com>
1378 * fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Make
1379 error message more explicit.
1380 * pinfo.cc (_pinfo::commune_request): Don't lock process unless we're
1383 2006-03-23 Christopher Faylor <cgf@timesys.com>
1385 * dcrt0.cc (child_info_spawn::handle_spawn): Don't initialize the
1386 console handler here.
1387 * dtable.cc (dtable::stdio_init): Initialize console handler here.
1389 2006-03-23 Christopher Faylor <cgf@timesys.com>
1391 * sigproc.cc (sigalloc): Don't set SA_RESTART here.
1392 * signal.cc (_SA_NORESTART): New flag.
1393 (sigaction_worker): New function, derived from sigaction. Don't set
1394 internal flags unless called internally.
1395 (sigaction): Use sigaction_worker.
1396 (signal): Honor new _SA_NORESTART flag.
1397 (siginterrupt): Set _SA_NORESTART flag appropriately. Use
1398 sigaction_worker to set flags.
1399 * include/cygwin/signal.h: Define _SA_INTERNAL_MASK here.
1401 2006-03-22 Corinna Vinschen <corinna@vinschen.de>
1403 * thread.cc (pthread_mutex::is_good_initializer_or_bad_object): Delete.
1404 (pthread_cond::is_good_initializer_or_bad_object): Delete.
1405 (pthread_rwlock::is_good_initializer_or_bad_object): Delete.
1406 (pthread_cond::init): Remove disabled code. Guard assignment to
1407 object to initialize against access violation.
1408 (pthread_rwlock::init): Ditto.
1409 (pthread_mutex::init): Ditto.
1411 2006-03-22 Eric Blake <ebb9@byu.net>
1413 * fhandler.cc (fcntl): Print flags in hex.
1415 2006-03-22 Christopher Faylor <cgf@timesys.com>
1417 * dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved
1418 pinfo_init and uinfo_init here.
1419 (dll_crt0_1): Ditto.
1420 (__dll_crt0): Ditto. Don't call update_envptrs here.
1421 (dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0.
1422 * environ.cc (environ_init): Call it here instead.
1423 * sigproc.cc (my_readsig): New static variable.
1424 (wait_for_sigthread): Set up read pipe here since we are assured that
1425 we have the proper privileges when this is called.
1426 (talktome): Eliminate second argument since it is available as a global
1428 (wait_sig): Reflect use of my_readsig.
1430 2006-03-22 Corinna Vinschen <corinna@vinschen.de>
1432 * thread.cc (pthread_cond::init): Disable validity test of object
1433 to initialize since test of uninitialized content is unreliable.
1434 (pthread_rwlock::init): Ditto.
1435 (pthread_mutex::init): Ditto.
1437 2006-03-21 Christopher Faylor <cgf@timesys.com>
1439 * signal.cc (signal): Don't set SA_RESTART here.
1440 (siginterrupt): White space.
1441 * sigproc.cc (sigalloc): Set SA_RESTART here, on initialization.
1443 2006-03-21 Christopher Faylor <cgf@timesys.com>
1445 * child_info.h (child_status): Fix typo which made it impossible to set
1447 (child_info::isstraced): Booleanize.
1448 (child_info::iscygwin): Ditto.
1449 * sigproc.cc (child_info::child_info): Minor cleanup of flag setting.
1450 * spawn.cc (spawn_guts): Only close_all_files when we know the process
1451 has started successfully.
1453 * exceptions.cc (init_console_handler): Fix indentation.
1455 2006-03-20 Christopher Faylor <cgf@timesys.com>
1457 * dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier.
1458 * pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure.
1459 Return previous pipe handle.
1460 * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value.
1461 * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if
1462 process exits before synchronization.
1464 2006-03-20 Christopher Faylor <cgf@timesys.com>
1466 * child_info.h (child_status): New enum.
1467 (child_info::flag): Rename from 'straced'.
1468 (child_info::isstraced): New function.
1469 (child_info::iscygwin): Ditto.
1470 (child_info_fork::handle_fork): Reparmize.
1471 (child_info_fork::handle_failure): Ditto.
1472 (child_info_spawn::handle_spawn): New function.
1473 * dcrt0.cc (get_cygwin_startup_info): Use isstraced method.
1474 (child_info_spawn::handle_spawn): Define new function from code
1475 previously in dll_crt0_0.
1476 (dll_crt0_0): Move spawn stuff into handle_spawn. Only call
1477 init_console_handler for fork case.
1478 * sigproc.cc (child_info::child_info): Set flag appropriately.
1479 (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin
1481 * spawn.cc (spawn_guts): Remove commented out flag setting.
1483 2006-03-19 Christopher Faylor <cgf@timesys.com>
1485 * pinfo.cc (commune_process): Fix randomly invalid pointer which caused
1486 fifos to work incorrectly.
1488 2006-03-19 Christopher Faylor <cgf@timesys.com>
1490 * dcrt0.cc (dll_crt0_0): Oops. We need to bother with setting
1491 init_console_handler in the fork/exec case.
1493 2006-03-19 Christopher Faylor <cgf@timesys.com>
1495 * dcrt0.cc (dll_crt0_0): Don't bother with setting init_console_handler
1496 here since it will be set later when we discover if we have a ctty or
1498 * exceptions.cc (init_console_handler): Properly remove NULL handler.
1500 2006-03-18 Christopher Faylor <cgf@timesys.com>
1502 * pinfo.h (EXITCODE_OK): Define new constant.
1503 * sigproc.cc (child_info::sync): Return EXITCODE_OK if entering with
1505 (sig_send): Don't complain if sending signals while blocked if the
1506 sender isn't in the main thread.
1508 2006-03-18 Christopher Faylor <cgf@timesys.com>
1510 * child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate.
1511 (child_info::retry): Move here from fork subclass.
1512 (child_info::exit_code): New field.
1513 (child_info::retry_count): Max retry count for process start.
1514 (child_info::proc_retry): Declare new function.
1515 (child_info_fork::retry): Move to parent.
1516 (child_info_fork::fork_retry): Ditto.
1517 * dcrt0.cc (child_info::fork_retry): Rename and move.
1518 (child_info_fork::handle_failure): Move.
1519 (dll_crt0_0): Initialize console handler based on whether we have a
1520 controlling tty or not. Avoid nonsensical check for fork where it can
1522 * environ.cc (set_proc_retry): Rename from set_fork_retry. Set
1523 retry_count in child_info.
1524 (parse_thing): Reflect above change.
1525 * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name.
1526 (ctrl_c_handler): Always return TRUE for the annoying
1528 * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to
1529 init_console_handler.
1530 * fhandler_tty.cc (fhandler_tty_slave::open): Just call
1531 mange_console_count here and let it decide what to do with initializing
1532 console control handling.
1533 * fork.cc (fork_retry): Remove definition.
1534 (frok::parent): Define static errbuf and use in error messages (not
1535 thread safe yet). Close pi.hThread as soon as possible. Protect
1536 pi.hProcess as soon as possible. Don't set retry_count. That happens
1537 automatically in the constructor now. Accommodate name change from
1538 fork_retry to proc_retry.
1539 * init.cc (dll_entry): Turn off ctrl-c handling early until we know how
1540 it is supposed to be handled.
1541 * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value
1542 for failure error message. Tweak debug message slightly.
1543 * sigproc.cc (child_info::retry_count): Define.
1544 (child_info::child_info): Initialize retry count.
1545 (child_info::sync): Set exit code if process dies before
1547 (child_info::proc_retry): Rename from child_info_fork::fork_retry. Use
1548 previously derived exit code. Be more defensive about what is
1549 classified as an error exit.
1550 (child_info_fork::handle_failure): Move here from dcrt0.cc.
1551 * spawn.cc (spawn_guts): Maintain error mode when starting new process
1552 to avoid annoying pop ups. Move deimpersonate call within new loop.
1553 Move envblock freeing to end. Loop if process dies prematurely with
1555 * syscalls.cc (setpgid): Remove hopefully unneeded call to
1556 init_console_handler.
1558 2006-03-15 Christopher Faylor <cgf@timesys.com>
1560 * cygheap.cc (init_cygheap::manage_console_count): Turn console control
1561 handler on/off depending on whether we have allocated a console or not.
1562 * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry
1564 (dll_crt0_0): Turn on/off console control depending on whether we have
1565 a controlling tty or not.
1566 * exceptions.cc (init_console_handler): Change BOOL to bool.
1567 * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic
1569 * winsup.h (init_console_handler): Reflect argument type change.
1571 * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate
1572 capability throughout.
1575 2006-03-14 Christopher Faylor <cgf@timesys.com>
1577 * child_info.h (child_info_fork::fork_retry): Declare new function.
1578 * dcrt0.cc (child_info_fork::fork_retry): Define new function.
1579 * fork.cc (frok::parent): Move retry decision into
1580 child_info_fork::fork_retry and honor what it tells us to do.
1581 * sigproc.cc (sig_send): Unhold signals on __SIGEXIT.
1583 2006-03-14 Christopher Faylor <cgf@timesys.com>
1585 * fork.cc (frok::parent): Improve error message.
1587 2006-03-14 Christopher Faylor <cgf@timesys.com>
1589 * dcrt0.cc (main_environ): Initialize to &__cygwin_environment.
1590 (dll_crt0_1): Move resourcelocks, thread interface, pinfo_init, and
1592 (dll_crt0_0): ...to here.
1593 (_dll_crt0): Call update_envptrs here after setting main_environ.
1594 * environ.cc (environ_init): Eliminate initted variable. Don't call
1595 update_envptrs here.
1596 * sigproc.cc (wait_sig): Use my_sendsig when calling CreatePipe to
1597 avoid a dereference.
1599 2006-03-13 Christopher Faylor <cgf@timesys.com>
1601 * child_info.h (child_info_fork::handle_failure): Declare new function.
1602 (child_info_fork::retry): New field.
1603 * dcrt0.cc (__api_fatal_exit_val): Define.
1604 (child_info_fork::handle_failure): Define new function.
1605 (__api_fatal): Exit using __api_fatal_exit_val value.
1606 * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN
1607 environment variable.
1608 (parse_thing): Add "fork_retry" setting.
1609 * fork.cc (fork_retry): Define.
1610 (frok::parent): Reorganize to allow retry of failed child creation if
1611 child signalled that it was ok to do so.
1612 * heap.cc (heap_init): Signal parent via handle_failure when
1614 * pinfo.h (EXITCODE_RETRY): Declare.
1615 * sigproc.cc (child_info::sync): Properly exit with failure condition
1616 if called for fork and didn't see subproc_ready.
1617 * spawn.cc (spawn_guts): Use windows pid as first argument.
1618 * winsup.h: Remove obsolete NEW_MACRO_VARARGS define.
1619 (__api_fatal_exit_val): Declare.
1620 (set_api_fatal_return): Define.
1621 (in_dllentry): Declare.
1622 * exceptions.cc (inside_kernel): Remove unneeded in_dllentry
1625 2006-03-13 Christopher Faylor <cgf@timesys.com>
1627 * dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a
1628 little later. Add a comment.
1629 * fork.cc (resume_child): Make void.
1630 (frok::parent): Only zero pi when necessary. Explicitly zero si. Set
1631 this_errno when child_copy fails. Accommodate change to resume_child.
1632 * sigproc.cc (sigalloc): Move global_sigs initialization here.
1633 (sigproc_init): Move global_sigs.
1634 (sig_send): Just check for flush signals once.
1636 * wincap.h: Define supports_setconsolectrlhandler_null throughout.
1639 2006-03-13 Corinna Vinschen <corinna@vinschen.de>
1641 * autoload.cc (LoadDLLfuncNt): New define to wrap NT native functions.
1642 Use for NT native functions throughout.
1643 * dtable.cc (handle_to_fn): Treat return value of NtQueryObject as
1646 2006-03-12 Christopher Faylor <cgf@timesys.com>
1648 * cygtls.cc (_cygtls::remove): Reset initialized flag right away if we
1649 were previously initialized.
1650 * cygtls.h (_cygtls::initialized): Move nearer to the end to catch
1651 situation when Windows 98 mysteriously changes parts of _my_tls when
1652 thread is detaching.
1653 * gendef (__sigfe_maybe): Simplify slightly.
1654 * tlsoffsets.h: Regenerate.
1656 2006-03-12 Christopher Faylor <cgf@timesys.com>
1658 * cygtls.h (CYGTLS_INITIALIZED): Change to a little more unlikely value.
1659 (CYGTLSMAGIC): Delete.
1660 * dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup.
1661 (_dll_crt0): Don't worry about sync_startup. Just wait for sigthread here.
1662 * dll_init.cc (cygwin_detach_dll): Only pick up tls version of retaddr
1663 if we have a valid tls.
1664 * fork.cc (frok::child): Remove sigproc_init initialization since it
1665 happens much earlier now.
1666 * gendef: Recognize SIGFE_MAYBE.
1667 (fefunc): Generate calls to _sigfe_maybe, if appropriate.
1668 (_sigfe_maybe): New function.
1669 * init.cc (search_for): Always initialize search_for, even on fork.
1670 (calibration_thread): Delete.
1671 (calibration_id): Delete.
1672 (prime_threads): Delete.
1673 (munge_threadfunc): Remove calibration_thread special case. Avoid
1674 calling thread function if we haven't yet hit the "search_for" thread.
1675 (dll_entry): Remove prime_threads call. Only call munge_threadfunc
1676 when hwait_sig is active. Ditto. for _my_tls.remove ();
1677 * sigproc.cc (hwait_sig): Make global.
1678 (sigproc_init): Don't bother with sync_startup.
1679 (sig_send): Treat flush as a no-op when signals are held.
1680 (wait_sig): Cause signals to be held after fork.
1682 2006-03-09 Corinna Vinschen <corinna@vinschen.de>
1684 * syscalls.cc (rename): Move existance check for oldpath further up
1685 to the start of the function. Avoid another case of a name collision
1686 if oldpath is a shortcut and a file or directory newpath already exists.
1688 2006-03-09 Corinna Vinschen <corinna@vinschen.de>
1690 * autoload.cc (NtClose): Define.
1691 (NtOpenDirectoryObject): Define.
1692 (NtQueryDirectoryObject): Define.
1693 * fhandler_proc.cc: Include ctype.h and wchar.h.
1694 (format_proc_partitions): Revamp loop over existing harddisks by
1695 scanning the NT native \Device object directory and looking for
1697 * ntdll.h: Rearrange system call declarations alphabetically.
1698 (DIRECTORY_QUERY): Define.
1699 (struct _DIRECTORY_BASIC_INFORMATION): Define.
1700 (NtOpenDirectoryObject): Declare.
1701 (NtQueryDirectoryObject): Declare.
1703 2006-03-08 Christopher Faylor <cgf@timesys.com>
1705 * cygtls.h (_cygtls::retaddr): New method.
1706 * dll_init.cc (cygwin_detach_dll): Use new tls method to find return
1707 address since this function is now signal guarded.
1708 (update_envptrs): Remove unneeded braces.
1709 * syscalls.cc (statvfs): Coerce full_path to avoid a gcc warning.
1711 2006-03-08 Corinna Vinschen <corinna@vinschen.de>
1713 * syscalls.cc (statvfs): Simplify path name expression.
1715 2006-03-08 Corinna Vinschen <corinna@vinschen.de>
1717 * syscalls.cc: Include winioctl.h.
1718 (statvfs): Request correct volume size using DeviceIoControl if
1719 quotas are enforced on the file system.
1721 2006-03-03 Corinna Vinschen <corinna@vinschen.de>
1723 * dir.cc (opendir): Fix indentation.
1724 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Move storing
1725 fhandler in file descriptor table to some point very late in function
1726 to avoid double free'ing. Add comment to explain what happens.
1727 Add label free_mounts and don't forget to delete __DIR_mounts structure
1728 if NtOpenFile fails.
1730 2006-03-02 Corinna Vinschen <corinna@vinschen.de>
1732 * syscalls.cc (chroot): Disallow chroot into special directories.
1733 Return EPERM instead.
1735 2006-03-02 Corinna Vinschen <corinna@vinschen.de>
1737 * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check
1738 cygdrive string length for those who have cygdrive mapped to "/".
1740 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1742 * sec_helper.cc (set_cygwin_privileges): Request SE_BACKUP_NAME
1745 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1747 * fhandler_proc.cc (fhandler_proc::fstat): Always return fixed link
1748 count of 1 for /proc directory instead of incorrect PROC_LINK_COUNT.
1750 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1752 * fhandler.h (enum dirent_states): Remove dirent_saw_cygdrive,
1753 dirent_saw_dev and dirent_saw_proc.
1754 (fhandler_cygdrive::open): Declare.
1755 (fhandler_cygdrive::close): Declare.
1756 * fhandler_disk_file.cc (class __DIR_mounts): Move to beginning of file.
1757 (__DIR_mounts::check_mount): New parameter to indicate if inode number
1758 is needed in calling function or not. Add /proc and /cygdrive handling.
1759 (__DIR_mounts::check_missing_mount): Ditto.
1760 (path_conv::ndisk_links): Use __DIR_mounts class to create correct
1761 hardlink count for directories with mount points in them.
1762 (fhandler_disk_file::readdir_helper): Remove /dev, /proc and /cygdrive
1764 (fhandler_cygdrive::open): New method.
1765 (fhandler_cygdrive::close): New method.
1766 (fhandler_cygdrive::fstat): Always return fixed inode number 2 and
1767 fixed link count of 1. Drop call to set_drives.
1768 (fhandler_cygdrive::opendir): Drop call to get_namehash.
1769 (fhandler_cygdrive::readdir): Handle "." entry to return fixed inode
1772 2006-03-01 Christopher Faylor <cgf@timesys.com>
1774 * cygwin.din: Fix some erroneous SIGFE/NOSIGFE settings.
1776 2006-03-01 Christopher Faylor <cgf@timesys.com>
1778 * cygthread.cc (cygthread::callfunc): Revert below change. Make ev a
1779 manual reset event again. so that it will be reset by WaitFor*Object
1781 (cygthread::stub): Ditto.
1782 (cygthread::terminate_thread): Reset ev if it was found to have been
1785 2006-03-01 Christopher Faylor <cgf@timesys.com>
1787 * analyze_sigfe: New script.
1788 * dllfixdbg: Add copyright.
1790 * gendevices: Ditto.
1791 * gentls_offsets: Ditto.
1793 2006-03-01 Christopher Faylor <cgf@timesys.com>
1795 * cygthread.cc (cygthread::callfunc): Create ev as an auto-reset event
1796 so that it will be reset by WaitFor*Object as appropriate.
1797 (cygthread::stub): Ditto.
1798 (cygthread::terminate_thread): Remove forced setting of thread
1801 2006-03-01 Corinna Vinschen <corinna@vinschen.de>
1803 * include/sys/dirent.h (struct __DIR): Rename __d_unused to
1805 * fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef".
1806 (d_dirname): Remove useless "struct".
1807 (d_cachepos): Ditto.
1809 (class __DIR_mounts): New class, implementing mount point tracking
1811 (d_mounts): New macro for easy access to __DIR_mounts structure.
1812 (fhandler_disk_file::opendir): Allocate __DIR_mounts structure and
1813 let __d_internal element of dir point to it.
1814 (fhandler_disk_file::readdir_helper): Add mount points in the current
1815 directory, which don't have a real directory backing them.
1816 Don't generate an inode number for /dev. Add comment, why.
1817 (fhandler_disk_file::readdir): Move filling fname to an earlier point.
1818 Check if current entry is a mount point and evaluate correct inode
1820 (fhandler_disk_file::readdir_9x): Ditto.
1821 (fhandler_disk_file::rewinddir): Set all mount points in this directory
1822 to "not found" so that they are listed again after calling rewinddir().
1823 (fhandler_disk_file::closedir): Deallocate __DIR_mounts structure.
1824 * path.cc (mount_info::get_mounts_here): New method to evaluate a list
1825 of mount points in a given parent directory.
1826 * shared_info.h (class mount_info): Declare get_mounts_here.
1828 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1830 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use iscygdrive
1831 instead of isspecial.
1832 * path.h (path_conv::iscygdrive): New method.
1834 2006-02-28 Christopher Faylor <cgf@timesys.com>
1836 * exceptions.cc (_cygtls::interrupt_now): Remove "inside cygwin" check
1837 since some cygwin functions are meant to be interrupted.
1839 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1841 * cygwin.din: Export __isinff, __isinfd, __isnanf, __isnand.
1842 * include/cygwin/version.h: Bump API minor number to 155.
1844 2006-02-28 Corinna Vinschen <corinna@vinschen.de>
1846 * dir.cc (readdir_worker): Use slash as path separator when evaluating
1847 namehash for paths below /proc.
1848 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Use expensive
1849 inode number evaluation on share names.
1851 2006-02-27 Christopher Faylor <cgf@timesys.com>
1853 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
1854 d_cachepos under NT or suffer memory corruption.
1855 (fhandler_disk_file::readdir_helper): Avoid else with a return. Just
1856 calculate extension location once when doing symlink checks.
1857 (fhandler_disk_file::readdir): Make debug output more useful.
1858 (fhandler_disk_file::readdir_9x): Ditto. Eliminate redundant variable.
1860 2006-02-27 Christopher Faylor <cgf@timesys.com>
1862 * include/sys/termios.h (cfsetispeed): Just define as a function rather
1863 than resorting to a macro.
1864 (cfsetospeed): Ditto.
1866 2006-02-27 Christopher Faylor <cgf@timesys.com>
1868 * sigproc.cc: Fix a comment.
1870 2006-02-27 Christopher Faylor <cgf@timesys.com>
1872 * cygthread.cc (cygthread::release): Add a comment.
1874 2006-02-27 Corinna Vinschen <corinna@vinschen.de>
1876 * fhandler_netdrive.cc (fhandler_netdrive::fstat): Create unambiguous
1878 (fhandler_netdrive::readdir): Ditto.
1880 2006-02-24 Christopher Faylor <cgf@timesys.com>
1882 * sigproc.cc (sigheld): Define new variable.
1883 (sig_dispatch_pending): Don't check sigq since that's racy.
1884 (sig_send): Set sigheld flag if __SIGHOLD is specified, reset it if
1885 __SIGNOHOLD is specified. Ignore flush signals if we're holding
1888 2006-02-23 Christopher Faylor <cgf@timesys.com>
1890 * cygwin.din (_exit): Use signal front end.
1893 2006-02-23 Christopher Faylor <cgf@timesys.com>
1895 * winsup.h (cygwin_hmodule): Declare.
1896 * exceptions.cc (inside_kernel): Reverse return values to reflect
1897 function name. Return true if we're in cygwin1.dll or if we're
1898 executing in dll_entry.
1899 (_cygtls::interrupt_now): Reflect reversal of inside_kernel return
1901 * hookapi.cc (cygwin_hmodule): Remove declaration.
1902 * init.cc (dll_entry): Use in_dllentry global to record that we are
1903 executing in dllentry.
1905 2006-02-22 Corinna Vinschen <corinna@vinschen.de>
1907 * exceptions.cc (_cygtls::interrupt_now): Reorder conditional
1908 to call inside_kernel only if this isn't locked.
1910 2006-02-22 Corinna Vinschen <corinna@vinschen.de>
1912 * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES to
1913 access flags in case of query_read_control case, add FILE_READ_DATA
1914 in case of query_stat_control.
1916 2006-02-20 Christopher Faylor <cgf@timesys.com>
1918 * spawn.cc (av::fixup): Check for .bat and friends specifically now
1919 since these extensions are no longer automatically detected.
1921 2006-02-19 Christopher Faylor <cgf@timesys.com>
1923 * exceptions.cc (stackdump): Avoid dumping more than once.
1925 2006-02-19 Christopher Faylor <cgf@timesys.com>
1927 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use NtOpenFile
1928 to open the directory.
1929 (fhandler_disk_file::readdir): Use NT_SUCCESS to determine if status
1932 2006-02-19 Corinna Vinschen <corinna@vinschen.de>
1934 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop generating
1937 2006-02-18 Corinna Vinschen <corinna@vinschen.de>
1939 * fhandler_disk_file.cc (FS_IS_SAMBA): Move out of
1940 path_conv::hasgood_inode.
1941 (path_conv::is_samba): New method.
1942 (fhandler_base::fstat_by_handle): Don't even try to use
1943 FileIdBothDirectoryInformation on Samba.
1944 * path.h (class path_conv): Declare is_samba method.
1946 2006-02-17 Christopher Faylor <cgf@timesys.com>
1948 * path.cc (conv_path_list): Eat empty paths when converting to POSIX.
1949 (cygwin_conv_to_win32_path): Deal with Cygwin's necessity of adding a
1950 '/' to the end of a path ending in '.'.
1952 2006-02-16 Corinna Vinschen <corinna@vinschen.de>
1954 * cygwin.din: Export sigignore and sigset.
1955 * exceptions.cc (sigset): New function.
1956 (sigignore): New function.
1957 * include/cygwin/signal.h (SIG_HOLD): Define.
1958 (sigignore): Declare.
1960 * include/cygwin/version.h: Bump API minor number to 154.
1962 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
1964 * include/mntent.h: Add missing #include.
1966 2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu>
1968 * gentls_offsets: Fix typo in error message.
1970 2006-02-10 Christopher Faylor <cgf@timesys.com>
1972 * fhandler_process.cc (format_process_stat): Use cygwin-derived start
1973 time even on NT since it is the logical start time of the "process".
1974 * pinfo.cc (set_myself): Don't set start time when it should have
1975 already been set previously.
1977 2006-02-10 Brian Ford <Brian.Ford@FlightSafety.com>
1979 * times.cc (clock_getres): Use correct conversion from milliseconds to
1980 seconds/nanoseconds.
1981 (clock_setres): Use correct conversion to nanoseconds.
1983 2006-02-10 Christopher Faylor <cgf@timesys.com>
1985 * external.cc (sync_winenv): Rename from "setup_winenv". Use same
1986 mechanism as spawn to determine environment variables which should be
1987 converted back to windows form.
1988 (cygwin_internal): Reflect setup_winenv -> sync_winenv name change.
1989 * include/sys/cygwin.h: Ditto.
1991 2006-02-09 Corinna Vinschen <corinna@vinschen.de>
1993 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set
1994 the dirent_get_d_ino flag on filesystems having useful File IDs.
1995 Add comment explaining why.
1997 2006-02-07 Corinna Vinschen <corinna@vinschen.de>
1999 * dtable.cc (handle_to_fn): Accommodate new argument order in call to
2001 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Call sys_wcstombs
2002 instead of just wcstombs to accommodate OEM codepages.
2003 * miscfuncs.cc (sys_wcstombs): Split len argument in source and target
2004 length. Always 0-terminate result in target string.
2005 * security.cc (lsa2wchar): Remove unused function.
2007 (get_lsa_srv_inf): Ditto.
2008 (get_logon_server): Accommodate new argument order in call to
2010 (get_user_groups): Ditto.
2011 (get_user_local_groups): Ditto.
2012 (get_priv_list): Call sys_wcstombs directly instead of lsa2str.
2013 * uinfo.cc (cygheap_user::ontherange): Accommodate new argument order
2014 in call to sys_wcstombs.
2015 * winsup.h (sys_wcstombs): Change prototype to match new argument order.
2017 2006-02-07 Corinna Vinschen <corinna@vinschen.de>
2019 * init.cc (respawn_wow64_process): Exit with the exit code returned
2020 by the respawned process.
2022 2006-02-06 Christopher Faylor <cgf@timesys.com>
2024 Always zero all elements of siginfo_t throughout.
2025 * cygtls.h (_cygtls::thread_context): Declare new field.
2026 (_cygtls::thread_id): Ditto.
2027 (_cygtls::signal_exit): Move into this class.
2028 (_cygtls::copy_context): Declare new function.
2029 (_cygtls::signal_debugger): Ditto.
2030 * cygtls.cc (_cygtls::init_thread): Fill out thread id field.
2031 * exceptions.cc (exception): Change message when exception info is
2032 unknown. Copy context to thread local storage.
2033 (_cygtls::handle_exceptions): Avoid double test for fault_guarded.
2034 Reflect move of signal_exit to _cygtls class.
2035 (sigpacket::process): Copy context to thread local storage.
2036 (_cygtls::signal_exit): Move to _cygtls class. Call signal_debugger to
2037 notify debugger of exiting signal (WIP). Call stackdump here (WIP).
2038 (_cygtls::copy_context): Define new function.
2039 (_cygtls::signal_debugger): Ditto.
2040 * tlsoffsets.h: Regenerate.
2041 * include/cygwin.h (_fpstate): New internal structure.
2042 (ucontext): Declare new structure (WIP).
2043 (__COPY_CONTEXT_SIZE): New define.
2045 * exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field
2046 when there is no sigwaiting thread.
2047 (setup_handler): Move event handling into interrupt_setup.
2049 2006-02-06 Corinna Vinschen <corinna@vinschen.de>
2051 * fhandler_socket.cc (fhandler_socket::connect): Fix formatting.
2052 (fhandler_socket::wait): Handle SA_RESTART when signal arrives.
2054 2006-02-06 Corinna Vinschen <corinna@vinschen.de>
2056 * include/cygwin/socket.h (CMSG_FIRSTHDR): Avoid compiler warning.
2058 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2060 * include/features.h: Add comment to explain what's going to happen
2062 * include/sys/stdio.h: Guard getline and getdelim prototypes with
2063 _GNU_SOURCE to avoid collision with old-style declarations.
2065 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2067 * environ.cc (struct parse_thing): Add transparent_exe option.
2068 * fhandler_disk_file.cc (fhandler_disk_file::link): Accommodate
2069 transparent_exe option. Add .exe suffix for links to executable files,
2070 if transparent_exe is set.
2071 * fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe
2072 suffix if transparent_exe option is set.
2073 * path.cc (symlink_worker): Accommodate transparent_exe option.
2074 (realpath): Don't tack on .exe suffix if transparent_exe is set.
2075 * syscalls.cc (transparent_exe): New global variable.
2076 (unlink): Accommodate transparent_exe option.
2079 (rename): Ditto. Maybe add .exe suffix when renaming executable files.
2080 (pathconf): Accommodate transparent_exe option.
2081 * winsup.h: Declare transparent_exe.
2083 2006-02-05 Christopher Faylor <cgf@timesys.com>
2084 Corinna Vinschen <corinna@vinschen.de>
2086 * fhandler_disk_file.cc (fhandler_disk_file::readdir_9x): Remove
2089 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2091 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Remove label
2092 "out". Move test for NULL __handle ...
2093 (fhandler_disk_file::rewinddir_9x): ... here.
2095 2006-02-05 Corinna Vinschen <corinna@vinschen.de>
2097 * dir.cc (rewinddir): Keep dirent_get_d_ino and dirent_set_d_ino flags.
2099 2006-02-05 Christopher Faylor <cgf@timesys.com>
2101 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Don't close dir
2102 handle when we hit EOF since rewwindir may reactivate it.
2103 (fhandler_disk_file::readdir_9x): Eliminate superfluous temporary
2105 (fhandler_disk_file::closedir): Return EBADF when trying to close
2106 unopened DIR. Reorganize slightly. Return actual derived error value
2107 rather than always returning 0.
2109 2006-02-04 Christopher Faylor <cgf@timesys.com>
2111 * dir.cc (rmdir): Reorganize check for trailing dot to return correct
2112 error when directory does not exist.
2114 2006-02-03 Christopher Faylor <cgf@timesys.com>
2116 * dir.cc (mkdir): Reorganize check for trailing dot to return correct
2117 error when directory exists.
2118 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Remove special
2119 test for path ending in '.'.
2121 2006-02-03 Corinna Vinschen <corinna@vinschen.de>
2123 * path.cc (suffix_scan::lnk_match): Return true beginning with
2125 (suffix_scan::next): Rearrange code to make .lnk append order slightly
2127 * spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align
2128 evaluation with stat_suffixes.
2129 (dll_suffixes): Ditto.
2131 2006-02-02 Christopher Faylor <cgf@timesys.com>
2133 * cygwin/version.h: Mention CW_SETUP_WINENV in comment for API minor
2136 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2138 * cygwin.din (updwtmpx): Export.
2139 * syscalls.cc (updwtmpx): New function.
2140 * include/utmpx.h (updwtmpx): Declare.
2141 * include/cygwin/version.h: Bump API minor number to 153.
2143 2006-02-02 Christopher Faylor <cgf@timesys.com>
2145 * external.cc (setup_winenv): New function.
2146 (cygwin_internal): Implement CW_SETUP_WINENV.
2147 * sys/cygwin.h (cygwin_getinfo_types): Define CW_SETUP_WINENV.
2149 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2151 * security.cc (is_group_member): Fix comment.
2153 2006-02-02 Corinna Vinschen <corinna@vinschen.de>
2155 * security.cc (is_group_member): Use local group info type 1. Test
2156 group for being a global group or a well-known SID before adding it
2157 to the group list. Add comment.
2159 2006-02-01 Corinna Vinschen <corinna@vinschen.de>
2161 * autoload.cc (GetTcpTable): Define.
2162 * fhandler_socket.cc (address_in_use): New function to check if
2163 sockaddr_in address is already in use.
2164 (fhandler_socket::bind): Check if address is alreay in use in case of
2165 SO_REUSEADDR, to circumvent WinSock non-standard behaviour.
2167 2006-02-01 Corinna Vinschen <corinna@vinschen.de>
2169 * spawn.cc (dll_suffixes): Add .exe and "no suffix" to the list.
2171 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2173 * dlfcn.cc (check_path_access): Call find_exec with FE_DLL option.
2174 * path.h (enum fe_types): Add FE_DLL value.
2175 * spawn.cc (std_suffixes): Remove.
2176 (exe_suffixes): New suffix_info for executing files.
2177 (dll_suffixes): New suffix_info for searching shared libraries.
2178 (perhaps_suffix): Add opt argument. Use dll_suffixes if FE_DLL
2179 option is given, exe_suffixes otherwise.
2180 (find_exec): Propagate opt argument to perhaps_suffix. Drop suffix
2181 check when testing execute permission.
2182 (spawn_guts): Call perhaps_suffix with FE_NADA opt argument.
2184 2006-01-31 Christopher Faylor <cgf@timesys.com>
2186 * spawn.cc (av::fixup): Remove unused argument.
2187 (spawn_guts): Remove capitalization in debugging.
2189 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2191 * spawn.cc (find_exec): Only return files with execute permission set
2192 if ntsec is on. Don't check execute permission of Windows batch files.
2193 (av::fixup): Handle empty files gracefully. Drop execute permission
2195 * path.cc (suffix_scan::next): Don't skip any suffix on first run.
2197 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2199 * path.cc (cwdstuff::set): Don't set win32 error, only POSIX errno.
2201 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2203 * path.cc (cwdstuff::set): When SetCurrentDirectory returns
2204 ERROR_INVALID_FUNCTION, bend it over to ERROR_FILE_NOT_FOUND. Add
2205 comment to explain why.
2207 2006-01-31 Corinna Vinschen <corinna@vinschen.de>
2209 * dir.cc (readdir_worker): Add comment about writing old 32 bit d_ino.
2210 * include/cygwin/version.h: Bump API minor number to 152.
2211 (CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): Remove.
2213 2006-01-30 Corinna Vinschen <corinna@vinschen.de>
2215 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Simplify
2218 2006-01-30 Corinna Vinschen <corinna@vinschen.de>
2220 * fhandler_disk_file.cc (d_cachepos): Rename from d_pos to distinct
2221 clearly from __d_position. Change throughout.
2222 (fhandler_disk_file::rewinddir): Reset readdir cache on NT.
2224 2006-01-29 Corinna Vinschen <corinna@vinschen.de>
2226 * fhandler_disk_file.cc (readdir_get_ino): Don't follow symlinks.
2228 2006-01-29 Corinna Vinschen <corinna@vinschen.de>
2230 * fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag.
2231 * fhandler_socket.cc (fhandler_socket::bind): Set socket to
2232 SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR
2233 socket option, on systems supporting SO_EXCLUSIVEADDRUSE.
2234 * net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag
2235 if SO_REUSEADDR socket option has been successsfully set.
2236 * wincap.h (wincaps::has_exclusiveaddruse): New element.
2237 * wincap.cc: Implement above element throughout.
2239 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2241 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): In case or error,
2242 check for existance explicitely and set errno to EEXIST.
2244 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2246 * fhandler_disk_file.cc (DIR_NUM_ENTRIES): New define determining
2247 minimum number of dir entries which fit into the readdir cache.
2248 (DIR_BUF_SIZE): Define globally as size of readdir cache.
2249 (struct __DIR_cache): New structure used for readdir caching on NT.
2250 (d_dirname): Accessor for struct __DIR_cache, use throughout.
2253 (fhandler_disk_file::opendir): Allocate __d_dirname to contain readdir
2255 (fhandler_disk_file::readdir): Use buf as pointer into readdir cache.
2256 Implement readdir caching.
2258 2006-01-28 Corinna Vinschen <corinna@vinschen.de>
2260 * include/sys/dirent.h (struct dirent): Revert misguided attempt to
2261 rename __d_unused1 to __d_fd.
2263 2006-01-27 Corinna Vinschen <corinna@vinschen.de>
2265 * autoload.cc (NtQueryDirectoryFile): Define.
2266 * dir.cc (__opendir_with_d_ino): Just call opendir.
2267 (opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling.
2268 (readdir_worker): Only try generating d_ino if it's 0.
2269 Utilize namehash of directories fhandler. Call readdir_get_ino to
2270 generate d_ino for "..".
2271 (seekdir64): Keep dirent_set_d_ino flag.
2272 * fhandler.h (enum dirent_states): Add dirent_get_d_ino.
2273 (class fhandler_disk_file): Declare new private methods readdir_helper
2275 * fhandler_disk_file.cc (path_conv::hasgood_inode): New method to
2276 evaluate if a filesystem has reliable inode numbers.
2277 (fhandler_base::fstat_by_handle): Accommodate structure member name
2278 change from IndexNumber to FileId.
2279 (fhandler_base::fstat_helper): Call hasgood_inode here.
2280 (fhandler_disk_file::opendir): Call fhaccess only for real files.
2281 Don't append '*' to __d_dirname here, move to readdir_9x. On NT,
2282 open directory handle here. Set dirent_get_d_ino and dirent_set_d_ino
2283 flags according to wincap and filesystem.
2284 (fhandler_disk_file::readdir_helper): New method to implement readdir
2285 postprocessing only once.
2286 (readdir_get_ino_by_handle): New static function.
2287 (readdir_get_ino): New function to centralize inode number evaluation
2288 in case inode number hasn't been returned by NtQueryDirectoryFile.
2289 (fhandler_disk_file::readdir): Move old functionality to readdir_9x.
2290 Call readdir_9x when on 9x/Me. Implement NT specific readdir here.
2291 (fhandler_disk_file::readdir_9x): Move 9x specific readdir here.
2292 (fhandler_disk_file::seekdir): Accommodate new NT readdir method.
2293 (fhandler_disk_file::closedir): Ditto.
2294 (fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment.
2295 (fhandler_cygdrive::opendir): Call get_namehash to prepare later
2296 correct evaluation of d_ino.
2297 (fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate
2298 drive's d_ino by calling readdir_get_ino.
2299 * fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and
2300 dirent_saw_dot_dot to avoid seeing . and .. entries twice.
2301 * fhandler_process.cc (fhandler_process::readdir): Ditto.
2302 * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
2303 * ntdll.h (STATUS_INVALID_PARAMETER): New define.
2304 (STATUS_INVALID_LEVEL): New define.
2305 (struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to
2306 FileId (as in Nebbitt).
2307 * path.h (path_conv::hasgood_inode): Now implemented in
2308 fhandler_disk_file.cc.
2309 * wincap.h (wincaps::has_fileid_dirinfo): New element.
2310 * wincap.cc: Implement above element throughout.
2311 * winsup.h (readdir_get_ino): Add declaration.
2312 * include/sys/dirent.h (struct dirent): Slightly rename structure
2313 members to accommodate changes.
2314 Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of
2315 __opendir_with_d_ino.
2317 2006-01-27 Christopher Faylor <cgf@timesys.com>
2319 * spawn.cc (spawn_guts): Fix potential handle leak when failing exec.
2321 2006-01-27 Christopher Faylor <cgf@timesys.com>
2323 * exceptions.cc (inside_kernel): Fix to return true if we can't get the
2324 name of the DLL for the given memory block since we are not in kernel
2327 2006-01-26 Corinna Vinschen <corinna@vinschen.de>
2329 * fhandler.cc (fhandler_base::open): Fix bug in argument order to
2330 InitializeObjectAttributes call.
2332 2006-01-25 Corinna Vinschen <corinna@vinschen.de>
2334 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix test for
2335 dirent_isroot to use the correct boolean operator.
2337 2006-01-25 Christopher Faylor <cgf@timesys.com>
2339 * ntdll.h: (temporarily?) Add more functions for querying directory.
2341 2006-01-24 Christopher Faylor <cgf@timesys.com>
2343 * dir.cc (readdir_worker): Turn off expensive inode calculation.
2345 2006-01-24 Corinna Vinschen <corinna@vinschen.de>
2347 * fhandler_process.cc (fhandler_process::fill_filebuf): Disable
2348 stripping the .exe suffix from the link target in PROCESS_EXE and
2349 PROCESS_EXENAME case.
2350 * path.cc (realpath): Tack on .exe suffix if necessary.
2352 2006-01-24 Corinna Vinschen <corinna@vinschen.de>
2354 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Try harder
2355 to determine remote file systems with reliable inode numbers. Add
2358 2006-01-23 Corinna Vinschen <corinna@vinschen.de>
2360 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Reset
2361 inheritance for duplicated socket.
2363 2006-01-20 Christopher Faylor <cgf@timesys.com>
2365 * include/cygwin/version.h: Bump API minor number to 151.
2366 * dir.cc (__opendir_with_d_ino): New function.
2367 (opendir): Set flag if we should be calculating inodes.
2368 (readdir_worker): Calculate d_ino by calling stat if the user has asked
2370 (seekdir64): Maintain all persistent flag settings.
2371 * fhandler.h (dirent_states): Add dirent_set_d_ino.
2372 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Reflect changes
2373 to dirent structure.
2374 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
2375 * include/sys/dirent.h (struct dirent): Coalesce two similar
2376 structures. Remove all shreds of the apparently highly confusing
2377 references to inodes. Add support for calculating a real inode if
2378 __USE_EXPENSIVE_CYGWIN_D_INO is defined.
2380 2006-01-20 Christopher Faylor <cgf@timesys.com>
2382 * include/sys/dirent.h: Add comments for people who are REALLY confused
2383 about whether they should be using something called __invalid_d_ino or
2386 2006-01-20 Corinna Vinschen <corinna@vinschen.de>
2388 * fhandler_socket.cc (fhandler_socket::prepare): Fix debug output.
2389 (fhandler_socket::release): Add debug output for WSAEventSelect failure.
2390 (fhandler_socket::ioctl): Always cancel WSAEventSelect before switching
2391 to blocking mode. Only set nonblocking flag if ioctlsocket call
2392 succeeded. Only print new socket state if ioctlsocket call succeeded.
2394 2006-01-19 Christopher Faylor <cgf@timesys.com>
2396 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check posix path
2397 for root rather than windows path.
2399 2006-01-19 Christopher Faylor <cgf@timesys.com>
2401 * dir.cc (readdir_worker): Fill in invalid fields with -1. Accommodate
2402 name change from __ino32 to __invalid_ino32.
2403 * include/sys/dirent.h (__invalid_ino32): Rename from __ino32. Don't
2404 define unused d_type macros.
2406 2006-01-18 Christopher Faylor <cgf@timesys.com>
2408 * heap.cc (heap_init): Remove Sleep.
2410 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2412 * net.cc (rresvport): Remove extern declaration.
2414 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2416 * autoload.cc (rresvport): Remove.
2417 * net.cc (last_used_rrecvport): New global shared variable.
2418 (cygwin_rresvport): Implement rresvport without using rresvport from
2421 2006-01-18 Corinna Vinschen <corinna@vinschen.de>
2423 * include/cygwin/socket.h (struct sockaddr_storage): Fix typo in
2424 ss_family member name.
2426 2006-01-16 Christopher Faylor <cgf@timesys.com>
2428 * include/cygwin/version.h: Bump DLL minor version number to 20.
2430 2006-01-13 Corinna Vinschen <corinna@vinschen.de>
2432 * uname.cc (uname): Concatenate a "-WOW64" to utsname's sysname
2433 member to see when running under WOW64.
2435 2006-01-13 Corinna Vinschen <corinna@vinschen.de>
2437 * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS on
2438 Windows 2000 and above. Clarify the comment about IP_TOS and move
2439 to the place where the magic happens.
2440 (get_ifconf): Remove unused code.
2441 * wincap.h (wincaps::has_disabled_user_tos_setting): New element.
2442 * wincap.cc: Implement above element throughout.
2444 2006-01-12 Christopher Faylor <cgf@timesys.com>
2446 * fhandler_console.cc (set_console_state_for_spawn): Fix to recognize
2449 2006-01-12 Christopher Faylor <cgf@timesys.com>
2451 * fhandler.h (set_console_state_for_spawn): Whackamole the argument
2453 * spawn.cc (spawn_guts): Ditto, i.e., once again call
2454 set_console_state_for_spawn with an indication of whether we're about
2455 to start a cygwin process.
2456 * fhandler_console.cc (set_console_state_for_spawn): Don't set the
2457 console state if we know we're starting a cygwin process or if we're
2460 2006-01-10 Corinna Vinschen <corinna@vinschen.de>
2462 * dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
2463 * init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker.
2464 Call wincap.init here before doing anything else. Use wincap.is_wow64
2465 to determine if we're running in a WOW64 emulator.
2466 * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's
2467 apparently not supported.
2468 (mmap64): Don't create mappings beyond EOF, which would need to use
2469 AT_ROUND_TO_PAGE, on WOW64.
2470 * wincap.cc (wincap): Throw into the .cygwin_dll_common section.
2471 (wincapc::init): Determine if running in WOW64 and set wow_64 flag.
2472 * wincap.h (class wincapc): Add wow64 member.
2473 (wincapc::is_wow64): New method.
2475 2006-01-10 Christopher Faylor <cgf@timesys.com>
2477 * fhandler_proc.cc (format_proc_cpuinfo): Avoid leading whitespace in
2480 2006-01-09 Christopher Faylor <cgf@timesys.com>
2482 * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is
2483 done prior to check for command.com/cmd.com. Don't bother setting
2484 CREATE_SUSPENDED flag for a MS-DOS process since it doesn't work
2485 anyway. Avoid calling remember() when the child process has already
2487 (av::fixup): Explicitly set cygexec flag to false on a 16 bit process.
2489 2006-01-09 Corinna Vinschen <corinna@vinschen.de>
2491 * include/getopt.h (getopt_long_only): Declare.
2493 2006-01-09 Eric Blake <ebb9@byu.net>
2495 * cygwin.din: Export getsubopt.
2496 * include/cygwin/version.h: Bump API minor version.
2498 2006-01-08 Christopher Faylor <cgf@timesys.com>
2500 * fhandler_tty.cc (fhandler_tty_slave::dup): Don't assign a controlling
2501 terminal to a process when duped. Linux doesn't do this, so we won't
2504 2006-01-08 Christopher Faylor <cgf@timesys.com>
2506 * environ.cc (spenvs[]): windir -> WINDIR.
2508 2006-01-07 Christopher Faylor <cgf@timesys.com>
2510 * fhandler_console.cc (fhandler_console::need_invisible): Remove
2513 2006-01-07 Christopher Faylor <cgf@timesys.com>
2515 * fhandler.h (set_console_state_for_spawn): Eliminate argument from
2517 * fhandler.cc (set_console_state_for_spawn): Eliminate argument from
2518 definition. Always check for invisible console.
2519 (fhandler_console::need_invisible): Don't do anything if the windows
2520 station is already not visible.
2521 * spawn.cc (spawn_guts): Accommodate change of argument to
2522 set_console_state_for_spawn.
2524 2006-01-05 Christopher Faylor <cgf@timesys.com>
2526 * sigproc.cc (no_signals_available): Use existence of signal thread
2527 handle to figure out if we can actually send signals rather than
2528 relying on my_sendsig.
2529 (hwait_sig): Make static.
2530 (sigproc_init): Don't set my_sendsig to anything special. Use new
2531 global static hwait_sig.
2532 (wait_sig): Set hwait_sig to NULL when we are exiting.
2534 2006-01-05 Christopher Faylor <cgf@timesys.com>
2536 * include/getopt.h: Accommodate recent unfortunate newlib changes.
2538 2006-01-05 Christopher Faylor <cgf@timesys.com>
2540 * cygtls.cc (_cygtls::remove): Don't output debugging info if this
2541 isn't a cygwin thread.
2542 * sigproc.cc (sigproc_init): Move clearing of sync_startup here to
2543 lessen the likelihood of trying to deal with non-cygwin threads in
2546 * fhandler_console: Fix set_console_state_for_spawn comment.
2548 2006-01-05 Igor Peshansky <pechtcha@cs.nyu.edu>
2550 * spawn.cc (spawn_guts): Invert the argument to
2551 set_console_state_for_spawn.
2553 2006-01-04 Christopher Faylor <cgf@timesys.com>
2555 * fhandler_console.cc (fhandler_console::need_invisible): Only try to
2556 open "CygwinInvisible" windows station if opening of default station
2557 fails. Use CloseWindowStation to close window station handle.
2559 2006-01-04 Christopher Faylor <cgf@timesys.com>
2561 * fhandler_console.cc (fhandler_console::need_invisible): Open up the
2562 security of the newly created windows station.
2564 2006-01-04 Eric Blake <ebb9@byu.net>
2566 * path.cc (dot_special_chars): Add ", <, >, and |.
2568 2006-01-03 Christopher Faylor <cgf@timesys.com>
2570 * fhandler_console.cc (beep): Use MB_OK which is documented as using
2571 the default bell rather than -1 which seems to behave differently on
2572 different versions of Windows.
2574 2006-01-03 Christopher Faylor <cgf@timesys.com>
2576 * fhandler_process.cc (fhandler_process::readdir): Add missing argument
2579 * fhandler_console.cc (fhandler_console::need_invisible): Use made-up
2580 name for windows station rather than asking Windows to create one for
2583 * spawn.cc (spawn_guts): Don't mess with console if we're detaching.
2585 2006-01-03 Christopher Faylor <cgf@timesys.com>
2587 * dir.cc (readdir_worker): Minor code cleanup.
2589 * fhandler_console.cc (beep): Use a more Windows-generic wav file if
2590 the beep is missing. Use a more foolproof way to find out whether we
2591 should be recreating the missing key.
2593 * registry.h (reg_key::_disposition): New field.
2594 (reg_key::created): New function.
2595 * registry.cc (reg_key::reg_key): Set _disposition to zero by default.
2596 (reg_key::build_key): Fill in _disposition field.
2598 2006-01-03 Eric Blake <ebb9@byu.net>
2600 * dir.cc (readdir_worker): Ensure that saw_dot* flags are updated when
2601 not handling inodes.
2603 2006-01-02 Christopher Faylor <cgf@timesys.com>
2605 * fhandler_console.cc (beep): New function. Restores missing "Default
2606 Beep", if necessary.
2607 (fhandler_console::write_normal): Use beep().
2609 2006-01-02 Christopher Faylor <cgf@timesys.com>
2611 * dcrt0.cc (_dll_crt0): Remove more leftover debugging stuff.
2612 (cygwin_dll_init): Remove unneeded initializations. Call _dll_crt0
2613 rather than dll_crt0_1.
2615 2006-01-02 Corinna Vinschen <corinna@vinschen.de>
2617 * syslog.cc: Include sys/un.h instead of sys/socket.h.
2618 (syslogd_inited): Convert to enum type noting the exact result of
2619 trying to connect to syslog daemon. Use this way throughout.
2620 (connect_syslogd): New static function taking over the task to
2621 connect to syslog socket. Use correct struct sockaddr_un instead of
2623 (try_connect_syslogd): Call connect_syslogd. If write fails on
2624 connection oriented socket, try to reconnect to syslog socket and
2627 2006-01-01 Christopher Faylor <cgf@timesys.com>
2629 * pinfo.cc (pinfo::exit): Swap signal and normal exit value when not
2630 started from a cygwin process - just like the good-old-days of B20.
2632 2006-01-01 Christopher Faylor <cgf@timesys.com>
2634 * strace.cc (strace::write_childpid): Remove debugging output.
2636 2006-01-01 Christopher Faylor <cgf@timesys.com>
2638 * cygtls.cc (_cygtls::remove): Remove left over debugging cruft which
2639 caused this function to always return prematurely.
2641 2006-01-01 Christopher Faylor <cgf@timesys.com>
2643 * exceptions.cc (sigpacket::process): Pass actual reference to signal's
2644 sigaction structure to setup_handler.
2646 2006-01-01 Christopher Faylor <cgf@timesys.com>
2648 * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.
2649 * include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK.
2651 * dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
2653 2006-01-01 Corinna Vinschen <corinna@vinschen.de>
2655 * syslog.cc (vklog): Never log kernel messages using the vsyslog