OSDN Git Service

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