OSDN Git Service

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