OSDN Git Service

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