OSDN Git Service

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