OSDN Git Service

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