OSDN Git Service

Add fexecve, execvpe.
[pf3gnuchains/pf3gnuchains3x.git] / winsup / cygwin / ChangeLog
1 2009-09-26  Eric Blake  <ebb9@byu.net>
2
3         * exec.cc (fexecve): New function.
4         * cygwin.din (execvpe, fexecve): Export new fexecve and existing
5         execvpe.
6         * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
7         * posix.sgml: Mention them.
8
9 2009-09-26  Eric Blake  <ebb9@byu.net>
10
11         * syscalls.cc (link): Delete obsolete comment.  Reject directories
12         and missing source up front.
13         (rename): Use correct errno for trailing '.'.  Detect empty
14         strings.  Allow trailing slash to newpath iff oldpath is
15         directory.
16         * dir.cc (mkdir): Reject dangling symlink with trailing slash.
17         * fhandler_disk_file.cc (fhandler_disk_file::link): Reject
18         trailing slash.
19         * fhandler.cc (fhandler_base::link): Match Linux errno.
20
21 2009-09-25  Eric Blake  <ebb9@byu.net>
22
23         * syscalls.cc (fchmodat): lchmod is not yet implemented.
24         (euidaccess): New function.
25         * path.cc (realpath): Update comment.
26         (canonicalize_file_name): New function.
27         * include/cygwin/stdlib.h (canonicalize_file_name): Declare it.
28         * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
29         * cygwin.din: Export canonicalize_file_name, eaccess, euidaccess.
30         * posix.sgml: Mention them.
31
32 2009-09-25  Eric Blake  <ebb9@byu.net>
33
34         * fhandler.h (fhandler_base::fhaccess): Add parameter.
35         * security.h (check_file_access, check_registry_access): Likewise.
36         * security.cc (check_file_access, check_registry_access)
37         (check_access): Implement new parameter.
38         * fhandler.cc (fhandler_base::fhaccess): Likewise.
39         (device_access_denied): Update caller.
40         * syscalls.cc (access, faccessat): Update callers.
41         * spawn.cc (find_exec, fixup): Likewise.
42
43 2009-09-24  Corinna Vinschen  <corinna@vinschen.de>
44
45         * posix_ipc.cc (mq_open): Avoid closing the same descriptor twice in
46         case of errors.
47         (sem_open): Ditto.
48
49 2009-09-24  Corinna Vinschen  <corinna@vinschen.de>
50
51         * kernel32.cc (CreateMutexW): Use correct access mask.
52         (CreateSemaphoreW): Ditto.
53
54 2009-09-23  Corinna Vinschen  <corinna@vinschen.de>
55
56         * strfuncs.cc (__set_charset_from_codepage): Fetch current ANSI
57         codepage if cp is 0.
58
59 2009-09-23  Corinna Vinschen  <corinna@vinschen.de>
60
61         * strfuncs.cc (sys_cp_wcstombs): Convert lone surrogate pair
62         second halves to unambiguous ASCII SO sequence.  When converting
63         chars invalid in current codepage to ASCII SO sequence, make
64         sure to check for surrogate pair second half only if at least
65         one wide characters is left.  Decrement nwc if valid second half has
66         been converted.
67         (sys_cp_mbstowcs): Improve ASCII SO handling.  Never break from loop
68         if invalid character has been found.  Recognize ASCII SO sequence
69         representing originally invalid mulitbyte char converted into a
70         lone surrogate pair second half.  Convert accordingly.
71
72 2009-09-22  Corinna Vinschen  <corinna@vinschen.de>
73
74         * autoload.cc (WSARecv): Define.
75         * fhandler_socket.cc (fhandler_socket::recv_internal): Call WSARecv
76         instead of WSARecvFrom if no name parameter is given.  Explain why.
77
78 2009-09-22  Eric Blake  <ebb9@byu.net>
79
80         * syscalls.cc (faccessat): Fix typo, reject bad flags.
81         (fchmodat, fchownat, fstatat, utimensat, linkat, unlinkat): Reject
82         bad flags.
83
84 2009-09-22  Corinna Vinschen  <corinna@vinschen.de>
85
86         * strfuncs.cc (sys_cp_mbstowcs): Reset shift state after handling
87         invalid multibyte sequence.
88
89 2009-09-22  Corinna Vinschen  <corinna@vinschen.de>
90
91         * path.cc (symlink_worker): Rework error handling to generate Linux
92         compatible errno in case of trailing slash in newpath.
93
94 2009-09-22  Eric Blake  <ebb9@byu.net>
95
96         * dtable.h (OPEN_MAX_MAX): New macro.
97         * resource.cc (getrlimit) [RLIMIT_NOFILE]: Use it.
98         * dtable.cc (dtable::extend): Likewise.
99         * fcntl.cc (fcntl64): Obey POSIX rule with too-large F_DUPFD.
100         * syscalls.cc (dup2): Likewise.
101
102 2009-09-21  Corinna Vinschen  <corinna@vinschen.de>
103
104         * cygheap.h (cwdstuff::get_posix): Convert to const inline method just
105         returning pointer to posix path.
106         (cwdstuff::reset_posix): Convert to non-inline method taking a wchar_t
107         pointer.
108         * path.cc (cwdstuff::set): Revert change from 2009-05-13.  Set posix
109         to valid incoming path again.
110         (cwdstuff::reset_posix): New implementation setting posix path from
111         incoming wchar_t path.  Explain usage.
112         (cwdstuff::get_posix): Drop implementation.
113         (cwdstuff::get): Drop special case to handle empty posix path.
114         * syscalls.cc (internal_setlocale): Store old posix cwd as wide char
115         path.  Restore posix cwd using new charset.  Explain why.
116
117 2009-09-21  Corinna Vinschen  <corinna@vinschen.de>
118
119         * fhandler_disk_file.cc (fhandler_disk_file::link): Drop faking hardlink
120         creation on filesystems not supporting hardlinks.
121
122 2009-09-20  Christopher Faylor  <me+cygwin@cgf.cx>
123
124         * dcrt0.cc (dll_crt0_1): Add another hack to REALLY make sure that
125         cxx_malloc is always set to the cygwin version.
126
127 2009-09-20  Christopher Faylor  <me+cygwin@cgf.cx>
128
129         * external.cc (cygwin_internal): Add hack to always reset cxx_malloc to
130         proper value.
131
132         * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Relocate wayward
133         comment.
134
135 2009-09-19  Christopher Faylor  <me+cygwin@cgf.cx>
136
137         * exceptions.cc (sigpacket::process): Explicitly set thread-specific
138         handler function to zero to avoid transferring to incorrect location.
139         (_cygtls::call_signal_handler): Don't transfer to handler if there is
140         no handler to transfer to.
141
142 2009-09-18  Christopher Faylor  <me+cygwin@cgf.cx>
143
144         * exceptions.cc (sigpacket::process): Give sigwait() processing
145         precedence even when a handler is present.
146
147         * syscalls.cc (getpagesize): Change return to 'int'.
148
149 2009-09-16  Christopher Faylor  <me+cygwin@cgf.cx>
150
151         * ntea.c (write_ea): Don't abort if not-samba.
152
153 2009-09-01  Christopher Faylor  <me+cygwin@cgf.cx>
154
155         * select.cc (peek_console): Always check window size when there is ANY
156         keyboard activity.
157
158 2009-08-26  Corinna Vinschen  <corinna@vinschen.de>
159
160         * path.h (INTERIX_SYMLINK_COOKIE): Define.
161         * path.cc (symlink_info::check_sysfile): Read Interix symlinks as well.
162
163 2009-08-26  Corinna Vinschen  <corinna@vinschen.de>
164
165         * fhandler.cc (fhandler_base::open): Only set R/O attribute if ACLs
166         are not used.
167
168 2009-08-24  Corinna Vinschen  <corinna@vinschen.de>
169
170         * mount.cc (fs_info::update): Add comment.
171         * path.cc (symlink_info::check_reparse_point): Return -1 for volume
172         mount points.  Explain why.
173         (symlink_info::check): Call fs.update again for volume mount points.
174         Explain why.
175
176 2009-08-24  Corinna Vinschen  <corinna@vinschen.de>
177
178         * globals.cc (ro_u_volume): New R/O unicode string.
179         * path.cc (symlink_info::check_reparse_point): Fix check for volume
180         mount points to work on Vista and later as well.
181
182 2009-08-22  Corinna Vinschen  <corinna@vinschen.de>
183
184         * strfuncs.cc (__set_charset_from_codepage): Add codepages 20866
185         (KOI8-R) and 21866 (KOI8-U).
186
187 2009-08-21  Christopher Faylor  <me+cygwin@cgf.cx>
188
189         * dll_init.h (has_dtors): New flag.
190         (run_dtors): New wrapper function which avoids calling dtors more than
191         once.
192         * dll_init.cc (dll_global_dtors): Use dll.run_dtors wrapper.
193         (dll_list::detach): Ditto.
194         (dll_list::alloc): Set has_dtors flag.
195
196 2009-08-21  Christopher Faylor  <me+cygwin@cgf.cx>
197
198         * fcntl.cc (fcntl64): Detect negative fd as error.
199
200 2009-08-21  Corinna Vinschen  <corinna@vinschen.de>
201
202         * mmap.cc (mmap64): Allocate fh_disk_file on cygheap.  Delete
203         explicitely before returning.
204
205 2009-08-20  Corinna Vinschen  <corinna@vinschen.de>
206
207         * dtable.cc (build_fh_dev): Take additional bool parameter indicating
208         whether set_name should be called or not.
209         (dtable::dup_worker): Call build_fh_pc with new second parameter set
210         to false.  Explain why.  If fhandler's dup failed, delete rather than
211         cfree newfh and set newfh to NULL to indicate failure correctly.
212         * dtable.h (build_fh_pc): Change declaration according to above change.
213         Default set_name parameter to true.
214         * mmap.cc (mmap_record::free_fh): Delete rather than cfree fh.
215
216 2009-08-18  Christopher Faylor  <me+cygwin@cgf.cx>
217
218         * dtable.cc (dtable::fixup_after_exec): Close any popen'ed file handles here.
219         * fhandler.h (fhandler_*::ispipe): New function.
220         (fhandler_base::get_popen_pid): Define virtual function.
221         (fhandler_*::isdevice): Make const.
222         (fhandler_*::isfifo): Ditto.
223
224 2009-08-17  Christopher Faylor  <me+cygwin@cgf.cx>
225
226         * syscalls.cc (popen): Reorganize slightly for clarity.  Fix a comment.
227
228 2009-08-17  Christopher Faylor  <me+cygwin@cgf.cx>
229
230         * syscalls.cc (popen): Rewrite to accommodate situations where stdin,
231         stdout, or stderr are closed.
232
233 2009-08-17  Christopher Faylor  <me+cygwin@cgf.cx>
234
235         * pipe.cc (fhandler_pipe::create_selectable): Add -pipe to default pipe names.
236
237         * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Use bool/true/false
238         for what is actually a boolean variable.
239
240 2009-08-14  Corinna Vinschen  <corinna@vinschen.de>
241
242         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix length
243         check for ".." dir.
244
245 2009-08-14  Corinna Vinschen  <corinna@vinschen.de>
246
247         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Change comment
248         to be fair.
249
250 2009-08-14  Corinna Vinschen  <corinna@vinschen.de>
251
252         * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Remove
253         ill-advised attempt to optimize "." and ".." handling by checking for
254         specific position in directory listing.  Explain why.
255         (fhandler_disk_file.cc (fhandler_disk_file::readdir): Ditto.
256         Special-case opening file on NFS to fetch inode number and add longish
257         comment to explain why.
258
259 2009-08-14  Corinna Vinschen  <corinna@vinschen.de>
260
261         * (fhandler_socket::getsockname): Fix length returned for unbound
262         AF_LOCAL sockets.
263         (fhandler_socket::getpeername): Ditto.
264         * net.cc (socketpair): Don't set sun_path and peer_sun_path to
265         make sure getsockname and getpeername return the correct values
266         for AF_LOCAL sockets.
267
268 2009-08-13  Corinna Vinschen  <corinna@vinschen.de>
269
270         * fhandler_socket.cc (fhandler_socket::accept): Use sizeof rather
271         then constant size.  Truncate returned data, but return full address
272         length as per POSIX.
273         (fhandler_socket::getsockname): Truncate returned data, but return full
274         address length as per POSIX.
275         (fhandler_socket::getpeername): Ditto.
276
277 2009-08-13  Corinna Vinschen  <corinna@vinschen.de>
278
279         * fhandler.h (class fhandler_socket): Add peer_sun_path member.
280         (fhandler_socket::set_peer_sun_path): New method.
281         (fhandler_socket::get_peer_sun_path): New method.
282         * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
283         peer_sun_path to NULL.
284         (fhandler_socket::~fhandler_socket): Free peer_sun_path if necessary.
285         (fhandler_socket::dup): Duplicate peer_sun_path.
286         (fhandler_socket::accept): Ditto.  Return fake unbound peer content
287         and len in case of AF_LOCAL sockets.
288         (fhandler_socket::getsockname): Always use local sockaddr_storage to
289         store socket address and copy over to incoming address.  Handle every
290         namelen correctly per POSIX.
291         (fhandler_socket::getpeername): Ditto.  Add code path to return
292         correct value for AF_LOCAL sockets.
293         (fhandler_socket::set_peer_sun_path): New method.
294         * net.cc (socketpair): Set peer_sun_path to empty string, just like
295         sun_path.
296
297 2009-08-13  Corinna Vinschen  <corinna@vinschen.de>
298             Dave Korn <dave.korn.cygwin@googlemail.com>
299
300         * cxx.cc (default_cygwin_cxx_malloc): Enhance commenting.
301         * dll_init.cc (dll_dllcrt0_1): Likewise.
302         * dlfcn.cc (dlopen): Prevent dlopen()'d DLL from installing any
303         cxx malloc overrides.
304         * include/cygwin/cygwin_dll.h (__dynamically_loaded): New variable.
305         * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Check it and only
306         install cxx malloc overrides when statically loaded.  Extend comments.
307
308 2009-08-12  Corinna Vinschen  <corinna@vinschen.de>
309
310         * fhandler_socket.cc (fhandler_socket::accept): Always use local
311         sockaddr_storage to store peer address and copy over to incoming
312         peer address if available.  Truncate data as necessary according
313         to POSIX.
314
315 2009-08-11  Corinna Vinschen  <corinna@vinschen.de>
316
317         * include/limits.h (NGROUPS_MAX): Set to a more sane value.
318         * include/sys/param.h (NGROUPS): Ditto.
319
320 2009-08-10  Corinna Vinschen  <corinna@vinschen.de>
321
322         * spawn.cc (av::fixup): Check shell scripts for executability only on
323         filesystems/mounts supporting real permissions.
324
325 2009-08-10  Corinna Vinschen  <corinna@vinschen.de>
326
327         * dtable.cc (DEV_SOCKET): New static WCHAR string.  Name of
328         the native NT socket device.
329         (dtable::init_std_file_from_handle): Remove unused tmp_pathbuf
330         variable.  Move check for sockets into FILE_TYPE_PIPE clause.
331         Rely on handle_to_fn having recognized socket, or check if
332         getsockopt works to accommodate NT4 shortcoming.
333         (handle_to_fn): Use tmp_pathbuf for OBJECT_NAME_INFORMATION
334         buffer and simplify code due to that.  Check name returned by
335         NtQueryObject for socket device.
336
337 2009-08-10  Christopher Faylor  <me+cygwin@cgf.cx>
338
339         * fhandler_console.cc (create_invisible_console_workaround): Fix size
340         of cmd in the way originally intended.
341
342 2009-08-10  Corinna Vinschen  <corinna@vinschen.de>
343
344         * fhandler_console.cc (create_invisible_console_workaround):  Fix
345         size of cmd to take spaces into account.
346
347 2009-08-08  Corinna Vinschen  <corinna@vinschen.de>
348
349         * dtable.cc (dtable::init_std_file_from_handle): Fix comment to
350         document change in the Windows 7 workaround.
351         * wincap.cc (wincapc::init): Don't set has_console_handle_problem
352         to false on 32 bit systems.
353
354 2009-08-06  Corinna Vinschen  <corinna@vinschen.de>
355
356         * net.cc (cygwin_getnameinfo): Force setting NI_NUMERICSERV only
357         on Windows 2003 and earlier, only if the port number doesn't
358         resolve to a well-known service.  Change comment accordingly.
359
360 2009-08-05  Christopher Faylor  <me+cygwin@cgf.cx>
361
362         * cygheap.h (cygheap_debug::endh): Delete.
363         * debug.cc (lock_debug::acquired): Delete.
364         (lock_debug::lock_debug): Simplify.
365         (lock_debug::unlock): Ditto.
366         (find_handle): Don't set endh here.
367         (add_handle): Add new handle to beginning of the list rather than
368         trying to maintain an end list pointer.
369         (delete_handle): Minor optimization.
370         (mark_closed): Make logic clearer.
371         (verify_handle): Lock handle list before scanning.
372         (setclexec): Ditto.
373         (modify_handle): Ditto.
374         (newh): Don't lock handle list here.  Assume caller did this.
375         (mark_closed): Ditto.
376         (close_handle): Remove unneeded #if.
377         * dtable.cc (dtable::dup2): Tweak debug output.
378
379 2009-08-04  Christopher Faylor  <me+cygwin@cgf.cx>
380
381         * path.cc (patch_conv::check): Zero path before setting it.
382
383 2009-08-04  Christopher Faylor  <me+cygwin@cgf.cx>
384
385         * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem
386         size if the length exceeds it.
387         * net.cc (fdsock): Use 65535 as window size, just like the comment
388         says or we run into problems with DuplicateHandle.
389
390         * path.cc (patch_conv::check): Use set_path to set invalid filename.
391         * path.h (path_conv::path_conv): Ditto.
392
393 2009-08-04  Christopher Faylor  <me+cygwin@cgf.cx>
394
395         * fhandler.h (pdrive_buf): Defensively allocate one extra byte.
396
397 2009-08-04  Christopher Faylor  <me+cygwin@cgf.cx>
398
399         * fhandler.h (fhandler_cygdrive:DRVSZ): New enum.
400         (pdrive_buf): New place to hold information about cygdrive.
401         * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Store drive
402         info in pdrive_buf since get_win32_name() could now be too small to
403         hold everything.
404         (fhandler_cygdrive::rewinddir): Reset pdrive to pdrive_buf.
405         (fhandler_cygdrive::closedir): Ditto.
406         * pipe.cc (fhandler_pipe::init): Be more defensive when referencing
407         get_win32_name().  Rework logic which made a copy of the POSIX path and
408         then never used it.
409
410 2009-08-02  Christopher Faylor  <me+cygwin@cgf.cx>
411
412         * sigproc.cc (stopped_or_terminated): Don't return a match when stopsig
413         == SIGCONT and not WCONTINUED.
414         * termios.cc (tcsetpgrp): Improve debugging output.
415
416 2009-08-01  Christopher Faylor  <me+cygwin@cgf.cx>
417
418         * cygheap_malloc.h: New file.
419         * cygheap.h: Remove stuff now included in cygheap_malloc.h and include
420         that file.  Make cygheap_init a standard c++ function.  Remove unneeded
421         child_info declaration.
422         * path.h: Include cygheap_malloc.h. Remove extra cstrdup declaration.
423         (path_conv): Reorganize to group variables together.
424         (path_conv::path): Make const char *.
425         (path_conv::known_suffix): Ditto.
426         (path_conv::normalized_path): Ditto.
427         (path_conv::path_conv): Reorganize initializers to reflect new element
428         ordering.
429         (path_conv::get_win32): Change return value to const char *.
430         (path_conv::set_path): Move back here from spawn.cc.
431         (parh_conv::modifiable_path): New function.
432         * path.cc (path_conv::add_ext_from_sym): Accommodate const'ness of
433         known_suffixes.
434         (path_conv::set_normalized_path): Ditto for normalized_path.
435         (path_conv::check): Use modifiable_path whereever we need to modify the
436         path element.  Use set_path to set the path.
437         (path_conv::~path_conv): Accommodate new const'ness.
438         * spawn.cc (perhaps_suffix): Declare ext as const since that's what is
439         being returned.
440         (path_conv::set_path): Move back to path.h.
441         * winf.f (linebuf): Perform minor cleanup.
442         (linebuf::fromargv): Change second parameter to const.
443         * winf.cc (linebuf::fromargv): Ditto.
444
445 2009-08-01  Christopher Faylor  <me+cygwin@cgf.cx>
446
447         * path.h (path_conv::set_path): Change return value.
448         * spawn.cc (path_conv::set_path): Return newly set value.
449         (find_exec): Set retval to newly set value when calling set_path.
450
451 2009-07-31  Christopher Faylor  <me+cygwin@cgf.cx>
452
453         * spawn.cc (find_exec): Fix one more path where retval was not set.
454
455 2009-07-31  Christopher Faylor  <me+cygwin@cgf.cx>
456
457         * spawn.cc (find_exec): Stop relying on the ability to set retval to a
458         fixed path_conv buffer and set it on the fly instead.
459
460 2009-07-30  Corinna Vinschen  <corinna@vinschen.de>
461
462         * path.h (cstrdup): Fix declaration.
463
464 2009-07-29  Dave Korn  <dave.korn.cygwin@googlemail.com>
465
466         * globals.cc (enum exit_states::ES_GLOBAL_DTORS): Delete.
467         * dcrt0.cc (__main): Schedule dll_global_dtors to run
468         atexit before global dtors.
469         (do_exit): Delete test for ES_GLOBAL_DTORS and call to
470         dll_global_dtors.
471
472 2009-07-29  Corinna Vinschen  <corinna@vinschen.de>
473
474         * path.h (class path_conv): Convert path from char array to char *.
475         Initialize to NULL in constructors.  Drop normalized_path_size member.
476         (path_conv::size): Remove.
477         (path_conv::operator =): Always copy with sizeof path_conv.  Always
478         duplicate path on cygheap.
479         (path_conv::set_path): Move implementation to spawn.cc.
480         * path.cc (path_conv::set_normalized_path): Always allocate
481         normalized_path on cygheap.
482         (path_conv::check): Don't work on path, rather allocate THIS_path in
483         TLS and use it throughout.  When finished, allocate path on cygheap
484         and copy over.  Defer tacking on extension after having copied path.
485         * spawn.cc (path_conv::set_path): Implement here.
486
487 2009-07-27  Corinna Vinschen  <corinna@vinschen.de>
488
489         * mount.h (enum fs_info_type): New type.
490         (IMPLEMENT_FS_FLAG): New define.
491         (class fs_info): Convert filesystem type status flags into an enum
492         fs_info_type.  Add cifs FS.  Revert change to has_buggy_open and
493         has_buggy_fileid_dirinfo.  Make them normal; status flags again.
494         Implement is_FS functions using IMPLEMENT_FS_FLAG.
495         * mount.cc (fs_info::update): Define MINIMAL_WIN_NTFS_FLAGS and
496         FS_IS_WINDOWS_NTFS.  Add comment.  Only test remote filesystems
497         for "NTFS" once.  Add is_cifs check using FS_IS_WINDOWS_NTFS.
498         Set has_buggy_open flag for SUNWNFS.  Set has_buggy_fileid_dirinfo
499         flag for UNIXFS and all cifs type filesystems.  Only check for
500         caseinsensitivity once.
501         (fillout_mntent): Create locale fs_names array.  Use for setting
502         _my_tls.locals.mnt_type.
503
504 2009-07-27  Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
505
506         * posix.sgml (std-notes): Remove obsolete reference to CYGWIN=server.
507
508 2009-07-25  Corinna Vinschen  <corinna@vinschen.de>
509
510         * posix.sgml (std-notes): Add flock restriction.
511
512 2009-07-25  Corinna Vinschen  <corinna@vinschen.de>
513
514         * fhandler_console.cc (set_console_title): Set buffer size to
515         TITLESIZE + 1.  Call sys_mbstowcs with correct destination length.
516
517 2009-07-24  Christopher Faylor  <me+cygwin@cgf.cx>
518
519         * sigproc.h (wait_for_sigthread): Eliminate parameter.
520         * sigproc.cc (wait_for_sigthread): Ditto.  Don't synchronize with
521         wait_sig after receiving an event that it is ready to go.
522         (init_sig_pipe): New function.
523         (wait_sig): Call init_sig_pipe to create pipes for communicating
524         signals to this process.  Don't send sigCONT signal when initializing.
525         * fork.cc (frok::child): Accommodate wait_for_sigpipe parameter change.
526
527 2009-07-24  Christopher Faylor  <me+cygwin@cgf.cx>
528
529         * fhandler.h (fhandler_*::write): Make ssize_t/__stdcall.
530         (fhandler_*::write_overlapped): Ditto.
531         (fhandler_*::raw_write): Ditto.
532         (fhandler_*::readv): Ditto.
533         (fhandler_*::writev): Ditto.
534         (fhandler_*::raw_read): Make __stdcall.
535         * fhandler: Accommodate changes to read/write functions throughout.
536         * fhandler_clipboard.cc: Ditto.
537         * fhandler_console.cc: Ditto.
538         * fhandler_dsp.cc: Ditto.
539         * fhandler_fifo.cc: Ditto.
540         * fhandler_mailslot.cc: Ditto.
541         * fhandler_mem.cc: Ditto.
542         * fhandler_mem.cc: Ditto.
543         * fhandler_random.cc: Ditto.
544         * fhandler_tape.cc: Ditto.
545         * fhandler_tty.cc: Ditto.
546         * fhandler_virtual.cc: Ditto.
547         * fhandler_windows.cc: Ditto.
548         * fhandler_zero.cc: Ditto.
549         * syscalls.cc (readv): Use ssize_t as temp variable.
550
551         * fhandler.cc (fhandler_base::read): Coerce returned len to signed or
552         it will never be treated as < 0.
553         (fhandler_base::wait_overlapped): Minimize calls to GetLastError.
554         Remove duplicate debugging test.  Fix error return.
555
556         * fhandler.h (fhandler_fifo::fifo_name): Declare new function.
557         (fhandler_fifo::close): Ditto.
558         (fhandler_fifo::dup): Ditto.
559         (fhandler_fifo::close_on_exec): Ditto.
560         * fhandler.cc (fhandler_fifo::fifo_name): Define new function.
561         (FIFO_BUF_SIZE): New define.
562         (cnp): Ditto.
563         (fhandler_fifo::open): Rework.  Use cnp to open named pipe.  Always
564         open write side as a client.  Open dummy client when writing and can't
565         connect.
566         (wait): Rework.  Implement fifo_wait_for_next_client.  Handle signals
567         during connect better.  Add new fifo_wait_for_server code which polls
568         (sigh) waiting for server.
569         (fhandler_fifo::raw_read): Handle transition states when one client
570         closes and another is available.
571         (fhandler_fifo::close): Define.
572         (fhandler_fifo::dup): Ditto.
573         (fhandler_fifo::close_on_exec): Ditto.
574
575 2009-07-24  Corinna Vinschen  <corinna@vinschen.de>
576
577         * syscalls.cc (internal_setlocale): Fix typo in GBK codepage.
578
579 2009-07-24  Corinna Vinschen  <corinna@vinschen.de>
580
581         * syscalls.cc (unlink_nt): Ignore sharing violation on NFS.  Align
582         comments.
583
584 2009-07-23  Corinna Vinschen  <corinna@vinschen.de>
585
586         * mount.h (fs_info::fsn): New member.
587         (fs_info::clear): Clear fsn.
588         (fs_info::fsname): New read accessor for fsn.
589         * mount.cc (fs_info::update): Fill in fsn member with lowercased
590         filesystem name if filesystem is not well-known.  Fall back to
591         "unknown" if filesystem name is missing.
592         (fillout_mntent): Print filesystem name retrieved in fs_info::update
593         rather than static string "unknown".
594
595 2009-07-23  Corinna Vinschen  <corinna@vinschen.de>
596
597         * mount.cc (fs_info::update): Revert to open filesystem with access set
598         to READ_CONTROL.  If that fails, try additionally with FILE_READ_DATA.
599
600 2009-07-22  Eric Blake  <ebb9@byu.net>
601
602         * exceptions.cc (handle_exceptions): Set si_addr according to
603         POSIX for SIGSEGV.
604
605 2009-07-22  Corinna Vinschen  <corinna@vinschen.de>
606
607         * mount.cc (fs_info::update): Open filesystem with access set to 0.
608         Explain why.
609
610 2009-07-22  Corinna Vinschen  <corinna@vinschen.de>
611
612         * mount.cc: Revert accidental checkin.
613
614 2009-07-22  Corinna Vinschen  <corinna@vinschen.de>
615
616         * path.cc (symlink_info::check): Handle STATUS_NOT_SUPPORTED from
617         NtCreateFile just like STATUS_EAS_NOT_SUPPORTED.
618
619 2009-07-22  Corinna Vinschen  <corinna@vinschen.de>
620
621         * mount.cc (fillout_mntent): Fix typo (noexec -> notexec).
622
623 2009-07-22  Corinna Vinschen  <corinna@vinschen.de>
624
625         * path.cc (symlink_info::check): Fix typo in comment.
626
627 2009-07-22  Corinna Vinschen  <corinna@vinschen.de>
628
629         * fhandler.h (enum del_lock_called_from): New enumeration.
630         (fhandler_base::del_my_locks): Declare taking a del_lock_called_from
631         as argument.
632         * fhandler.cc (fhandler_base::close): Call del_my_locks with "on_close".
633         (fhandler_base::fixup_after_fork): Call del_my_locks with "after_fork".
634         (fhandler_base::fixup_after_exec): Call del_my_locks with "after_exec".
635         * flock.cc (fhandler_base::del_my_locks): Take del_lock_called_from
636         as argument.  Call node->del_my_locks with NULL handle in after_exec
637         case.  Explain why.
638
639 2009-07-21  Eric Blake  <ebb9@byu.net>
640
641         * dtable.cc (dup2): Correct return value for no-op.
642
643 2009-07-21  Corinna Vinschen  <corinna@vinschen.de>
644             Eric Blake  <ebb9@byu.net>
645
646         * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Add special case
647         for MVFS.  Explain why.
648         (fhandler_disk_file::utimens): Drop local variables lastaccess and
649         lastwrite.  Copy timestamps right into FILE_BASIC_INFORMATION structure
650         to avoid copying them twice.
651
652 2009-07-20  Corinna Vinschen  <corinna@vinschen.de>
653
654         * wincap.h (wincaps::has_always_all_codepages): New element.
655         * wincap.cc: Implement above element throughout.
656         * wchar.h (__sjis_mbtowc): Declare.
657         (__eucjp_mbtowc): Ditto.
658         (__gbk_mbtowc): Ditto.
659         (__kr_mbtowc): Ditto.
660         (__big5_mbtowc): Ditto.
661         * syscalls.cc (internal_setlocale): Convert to char * function.
662         Return parameter by default.  Return NULL if request to use a
663         charset can't be satisfied due to missing codepage support in the
664         underlying OS.  Fix comment.
665         (setlocale): Store original locale.  Restore to original locale if
666         internal_setlocale returns NULL.
667
668 2009-07-20  Corinna Vinschen  <corinna@vinschen.de>
669
670         * fork.cc (fork): Create local tmp_pathbuf.  Explain why.
671
672 2009-07-18  Christopher Faylor  <me+cygwin@cgf.cx>
673
674         * exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when
675         continuing.
676         (stopped_or_terminated): Honor WCONTINUED.
677         * wait.cc (wait4): Ditto.
678         * include/cygwin/wait.h (WCONTINUED): Define.
679         (__W_CONTINUED): Ditto.
680         (WIFCONTINUED): Ditto.
681
682 2009-07-18  Dave Korn  <dave.korn.cygwin@gmail.com>
683
684         * libstdcxx_wrapper.cc (operator delete): Remove stray space in
685         asm name.
686
687 2009-07-17  Christopher Faylor  <me+cygwin@cgf.cx>
688
689         * cygtls.cc (_cygtls::init_exception_handler): Test for e, not e->prev
690         or we could still end up adding our handler twice.  Add comment
691         explaining what we're doing.
692         * dll_init.cc (dll_dllcrt0_1): Clarify comment.
693
694 2009-07-17  Christopher Faylor  <me+cygwin@cgf.cx>
695
696         * cygtls.cc (_cygtls::init_exception_handler): Avoid adding our
697         exception handler twice.
698
699 2009-07-17  Corinna Vinschen  <corinna@vinschen.de>
700
701         * syscalls.cc (unlink_nt): Just return when a sharing violation
702         occurs on remote filesystems.
703
704 2009-07-17  Corinna Vinschen  <corinna@vinschen.de>
705
706         * globals.cc: Improve comment on R/O UNICODE_STRINGs.
707         * mount.h (class fs_info): Add is_mvfs bit.
708         * mount.cc (fs_info::update): Recognize MVFS remote filesystem.
709         (fillout_mntent): Reorder filesystem checks for speed.  Add
710         mvfs, unixfs, and sunwnfs filesystem types.
711         * path.h (class path_conv): Add fs_is_mvfs method.
712         * path.cc (symlink_worker): On MVFS, always create symlinks as
713         Windows shortcuts.  Explain why.
714
715 2009-07-16  Corinna Vinschen  <corinna@vinschen.de>
716
717         * syscalls.cc (unlink_nt): First remove the R/O DOS attribute with
718         FILE_WRITE_ATTRIBUTES access only, then re-open the file for DELETE.
719         Explain why.
720
721 2009-07-16  Corinna Vinschen  <corinna@vinschen.de>
722
723         * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Remove file
724         attribute check already done in NtSetAttributesFile.
725
726 2009-07-15  Corinna Vinschen  <corinna@vinschen.de>
727
728         * globals.cc: Reorder constant UNICODE_STRINGs for clarity.
729         * mount.h (fs_info::sttaus): Move filesystem type flags into
730         substructure.  Add union to allow simple test for having set any
731         one filesystem type flag.  Replace has_buggy_open flag with is_sunwnfs
732         flag.  Replace has_buggy_fileid_dirinfo with is_unixfs flag.
733         (fs_info::got_fs): New private method.
734         (fs_info::has_buggy_open): New explicit implementation.
735         (fs_info::has_buggy_fileid_dirinfo): Ditto.
736         * mount.cc (fs_info::update): Optimize filesystem checks for speed.
737         * winsup.h (IMPLEMENT_STATUS_FLAG): Change write accessor to return
738         value just set.
739
740 2009-07-15  Corinna Vinschen  <corinna@vinschen.de>
741
742         * fhandler_netdrive.cc (GET_RESOURCE_INFO): Remove.
743         (thread_netdrive): Drop GET_RESOURCE_INFO case.
744         (fhandler_netdrive::exists): Use GET_RESOURCE_OPENENUM info class
745         to check for existance.
746
747 2009-07-15  Corinna Vinschen  <corinna@vinschen.de>
748
749         * fhandler_netdrive.cc (fhandler_netdrive::readdir): Remove useless
750         alloca.
751
752 2009-07-15  Corinna Vinschen  <corinna@vinschen.de>
753
754         * path.cc (cwdstuff::set): Only fix up UNC path in win32 so as not
755         to overwrite incoming path.
756
757 2009-07-14  Corinna Vinschen  <corinna@vinschen.de>
758
759         Throughout avoid having to initialize constant UNICODE_STRINGs.
760         * globals.cc: Define constant UNICODE_STRINGs and store in .rdata
761         section.
762         * fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs
763         rather then initializing local UNICODE_STRING variable where
764         applicable.
765         * fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
766         * flock.cc (inode_t::inode_t): Ditto.
767         * mmap.cc: Ditto.
768         * syscalls.cc: Ditto.
769         * mount.cc (fs_info::update): Ditto.
770         * path.cc: Ditto.
771
772         * ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as
773         UNICODE_STRING.
774         (RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING.
775         * fhandler_disk_file.cc: Accommodate throughout.
776         * mount.cc (fs_info::update): Ditto.
777         * path.cc (cwdstuff::set): Ditto.
778         * syscalls.cc: Ditto.
779
780 2009-07-14  Corinna Vinschen  <corinna@vinschen.de>
781
782         * globals.cc (active_codepage): Remove.
783
784 2009-07-12  Christopher Faylor  <me+cygwin@cgf.cx>
785
786         * how-spawn-works.txt: Add "out of date" note.
787         * how-vfork-works.txt: Ditto.
788
789 2009-07-12  Christopher Faylor  <me+cygwin@cgf.cx>
790
791         * Makefile.in: Don't do anything special with any RCS directories.
792
793         * ntdll.h (PROCESSINFOCLASS): Remove unneeded trailing comma.
794
795         * pinfo.cc (_pinfo::dup_proc_pipe): Remove unneeded assignment.
796
797         * sigproc.cc (sig_send): Don't send signal to myself if this is an exec
798         stub.
799
800 2009-07-12  Corinna Vinschen  <corinna@vinschen.de>
801
802         * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Don't use
803         FileAllInformation info class since it needs a big buffer.  Add a
804         comment.
805
806 2009-07-07  Dave Korn  <dave.korn.cygwin@gmail.com>
807
808         * winbase.h (ilockexch): Avoid making 'ret' volatile.
809         (ilockcmpexch): Likewise.
810
811 2009-07-07  Dave Korn  <dave.korn.cygwin@gmail.com>
812
813         * Makefile.in (DLL_OFILES): Add libstdcxx_wrapper.o
814         (libstdcxx_wrapper_CFLAGS): Add flags for new module.
815         (_cygwin_crt0_common_STDINCFLAGS): Define per-file override.
816         (libstdcxx_wrapper_STDINCFLAGS, cxx_STDINCFLAGS): Likewise.
817         * cxx.cc: Include "cygwin-cxx.h".
818         (operator new): Tweak prototype for full standards compliance.
819         (operator new[]): Likewise.
820         (operator new (nothrow)): New fallback function.
821         (operator new[] (nothrow), operator delete (nothrow),
822         operator delete[] (nothrow)): Likewise.
823         (default_cygwin_cxx_malloc): New struct of pointers to the above,
824         for final last-resort fallback default.
825         * cygwin-cxx.h: New file.
826         (struct per_process_cxx_malloc): Define.
827         (default_cygwin_cxx_malloc): Declare extern.
828         * cygwin.din (__wrap__ZdaPv): Export new wrapper.
829         (__wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
830         __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
831         __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
832         __wrap__ZnwjRKSt9nothrow_t): Likewise.
833         * globals.cc (__cygwin_user_data): Init newly-repurposed 'forkee'
834         field (now 'cxx_malloc') to point to default_cygwin_cxx_malloc.
835         * libstdcxx_wrapper.cc: New file.
836         (__wrap__ZdaPv, __wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
837         __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
838         __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
839         __wrap__ZnwjRKSt9nothrow_t): Define wrapper functions for libstdc++
840         malloc operators and their overrides.
841         * winsup.h (default_cygwin_cxx_malloc): Declare extern.
842         * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
843         * include/sys/cygwin.h (struct per_process_cxx_malloc): Forward
844         declare here.
845         (struct per_process::forkee): Rename and repurpose from this ...
846         (struct per_process::cxx_malloc): ... to this.
847         * lib/_cygwin_crt0_common.cc: Include cygwin-cxx.h.
848         (WEAK): Define shorthand helper macro.
849         (__cygwin_cxx_malloc): Define and populate with weak references
850         to whatever libstdc++ malloc operators will be visible at final
851         link time for Cygwin apps and dlls.
852         (_cygwin_crt0_common): Always look up cygwin DLL's internal
853         per_process data, and don't test for (impossible) failure.  Inherit
854         any members of __cygwin_cxx_malloc that we don't have overrides
855         for from the DLL's default and store the resulting overall set of
856         overrides back into the DLL's global per_process data.
857
858 2009-07-07  Corinna Vinschen  <corinna@vinschen.de>
859
860         * cygtls.cc (_cygtls::remove): Fix typo.
861
862 2009-07-06  Christopher Faylor  <me+cygwin@cgf.cx>
863
864         * Makefile.in (clean): Clean generated files in srcdir.
865         * tlsoffsets.h: Regenerate.
866
867 2009-07-06  Christopher Faylor  <me+cygwin@cgf.cx>
868
869         * cygtls.cc (_cygtls::remove): Avoid closing a NULL handle.
870
871 2009-07-06  Corinna Vinschen  <corinna@vinschen.de>
872
873         * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabuf
874         and wsacnt to references.  Fix handling of WSAEMSGSIZE.
875
876 2009-07-06  Corinna Vinschen  <corinna@vinschen.de>
877
878         * cygtls.h (struct _local_storage): Add thread storage pointers for
879         memory used by socket select functions.  Combine them into a single
880         struct select.
881         * cygtls.cc: Accommodate above change throughout.
882         (_cygtls::init_thread): Drop initalizing of sockevt to
883         INVALID_HANDLE_VALUE.
884         (_cygtls::fixup_after_fork): Reset sockevt to NULL.
885         (_cygtls::remove): Don't use sockevt value to bail out prematurely.
886         Set sockevt to NULL.  Free malloced select members.
887         * select.h (struct select_socket_info): Drop max_w4 member.
888         * select.cc (thread_socket): Use INFINITE timeout value if number of
889         objects to wait for is <= MAXIMUM_WAIT_OBJECTS.  Use num_w4 member
890         of select_socket_info struct rather than dropped max_w4.
891         (init_tls_select_info): New inline function to initialize TLS select
892         members.
893         (start_thread_socket): Just call init_tls_select_info to initialize TLS
894         select members and use them later on.
895         (socket_cleanup): Don't free select_socket_info pointer members since
896         they are thread local now.
897
898 2009-07-06  Christopher Faylor  <me+cygwin@cgf.cx>
899
900         * dtable.cc (handle_to_fn): Detect failing NtQueryObject.
901
902 2009-07-06  Corinna Vinschen  <corinna@vinschen.de>
903
904         * autoload.cc: Delete stray CR.
905
906 2009-07-05  Christopher Faylor  <me+cygwin@cgf.cx>
907
908         * fhandler_console.cc: Change workstation -> windows station
909         throughout.
910
911 2009-07-04  Christopher Faylor  <me+cygwin@cgf.cx>
912
913         * autoload.cc (SetParent): Add new import.
914         * fhandler.h (fhandler_console::create_invisible_console): Declare new
915         function.
916         (create_invisible_console_workaround): Ditto.
917         * fhandler_console.cc (fhandler_console::create_invisible_console):
918         Define new function.
919         (create_invisible_console_workaround): Ditto.  Add too much code to
920         deal with broken Windows 7.  Use a helper app to start an invisible
921         console window.
922         (fhandler_console::need_invisible): Reorganize to use helper functions
923         to create invisible console.
924
925         * spawn.cc (spawn_guts): Avoid zeroing already zeroed fields in si.
926
927 2009-07-04  Dave Korn  <dave.korn.cygwin@gmail.com>
928
929         * autoload.cc (AttachConsole): Correct size of args.
930
931 2009-07-03  Christopher Faylor  <me+cygwin@cgf.cx>
932
933         * dcrt0.cc (jit_debug): New global.
934         (initial_env): Set jit_debug when we are automatically starting a gdb
935         process.
936         * dtable.cc (dtable::get_debugger_info): Don't tty tricks when we are
937         being debugged by our own captive gdb, as determined by jit_debug ==
938         true.
939         (dtable::init_std_file_from_handle): Detect errors when initializing a
940         tty early rather than at random points later.
941         * fhandler.h (fhandler_*::init): Return int to indicate
942         success/failure.
943         * fhandler.cc (fhandler_base::init): Reflect change in return value.
944         * pipe.cc (fhandler_pipe::init): Ditto.
945         (fhandler_pipe::create_selectable): Don't say we're retrying when we
946         aren't.
947         * fhandler_console.cc (fhandler_console::init): Ditto.  Return
948         success/failure.
949         * fhandler_serial.cc (fhandler_serial::init): Ditto.
950         * fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
951         (fhandler_tty_slave::open): Make debugging output more detailed.
952         * tty.cc (tty_list::terminate): Don't close I/O handles before all
953         slaves have checked in.
954         (tty::slave_alive): Make a non-inlined function.  Check if tty pipe
955         handles can be created as an additional exists check.
956         * tty.h (tty::slave_alive): Just define here.
957
958 2009-07-03  Corinna Vinschen  <corinna@vinschen.de>
959
960         * posix.sgml: Add fpurge and mkstemps to BSD list.
961
962 2009-07-03  Eric Blake  <ebb9@byu.net>
963
964         * cygwin.din (fpurge, mkstemps): New exports.
965         * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
966         * mktemp.cc (_gettemp): Add parameter.
967         (mkstemps): New function.
968         (mkstemp, mkdtemp, mktemp): Adjust clients.
969
970 2009-07-03  Corinna Vinschen  <corinna@vinschen.de>
971
972         * autoload.cc: Fix typo in comment.
973         (ShowWindowAsync): Define.
974         (AttachConsole): Define.
975         * fhandler_console.cc (fhandler_console::need_invisible): Add band-aid
976         for Windows 7 AllocConsole bug.
977
978 2009-07-01  Corinna Vinschen  <corinna@vinschen.de>
979
980         * net.cc (get_xp_ifs): Fix typo in comment.
981
982 2009-07-01  Corinna Vinschen  <corinna@vinschen.de>
983
984         * fhandler.h (class fhandler_socket): Add class members and methods
985         to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes.
986         * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members.
987         (fhandler_socket::send_internal): Check for SO_SNDBUF size and
988         restrict send to 1 byte less per KB 823764.  Leave loop immediately
989         if WSASendMsg has been used.
990         * net.cc (fdsock): Change comment again.  Set buffer sizes to 65536.
991         Store values in fhandler_socket.
992         (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in
993         fhandler_socket.
994         (cygwin_sendto): Drop call to sig_dispatch_pending.
995         (cygwin_recvfrom): Ditto.
996         (cygwin_recvmsg): Ditto.
997         (cygwin_sendmsg): Ditto.
998
999 2009-06-30  Christopher Faylor  <me+cygwin@cgf.cx>
1000
1001         * select.h: New file split from fhandler.h.
1002         (select_record::select_record): Define do-nothing constructor for "new"
1003         to avoid gratuitous zeroing.
1004         (select_info): New base class.
1005         (select_pipe_info): New class with methods for dealing with pipes.
1006         (select_socket_info): New class with methods for dealing with sockets.
1007         (select_serial_info): Dummy class for serial.
1008         (select_mailslot_info): Dummy class for mailslots.
1009         (select_stuff): Define device_specific_* as actual classes rather than
1010         void *.
1011         * dtable.h (dtable::select_read): Accommodate return value change to
1012         'bool' and argument change to "select_stuff".
1013         (dtable::select_write): Ditto.
1014         (dtable::select_except): Ditto.
1015         * dtable.cc (dtable::select_read): Accommodate return value change to
1016         'bool' and argument change to "select_stuff".
1017         (dtable::select_write): Ditto.
1018         (dtable::select_except): Ditto.
1019         * fhandler.h: Excise select-related classes.
1020         (fhandler_*::select_read): Change argument to select_stuff.
1021         (fhandler_*::select_write): Ditto.
1022         (fhandler_*::select_except): Ditto.
1023         * select.cc (UNIX_FD_ZERO): Use memset rather than bzero.
1024         (select_stuff::test_and_set): Change return type to bool.  Allocate
1025         select_record on entry and let fhandler_*::select_* operate on the
1026         start.next field of select_stuff.
1027         (pipeinf): Delete.
1028         (select_pipe_info::select_pipe_info): New constructor.  Allocates event
1029         for controlling pipe waits.
1030         (select_pipe_info::~select_pipe_info): New destructor.  Destroy event.
1031         Stop thread.
1032         (select_pipe_info::add_watch_handle): New function.
1033         (thread_pipe): Wait for the hEvent part of any overlapped pipes before
1034         peeking.
1035         (start_thread_pipe): Don't allocate device_specific_pipe stuff here.
1036         Assume that it has been allocated earlier.
1037         (pipe_cleanup): Rely on select_pipe_info destructor to clean up pipe
1038         paraphenalia.
1039         (fhandler_*::select_*): Derive select_record from new select_stuff
1040         argument.
1041         (fhandler_pipe::select_*): Ditto.  Allocate pipe-specific field if not
1042         already allocated.
1043         (serialinf): Delete.
1044         (thread_serial): serialinf -> select_serial_info.
1045         (fhandler_base::ready_for_read): Rewrite to accommodate change in
1046         argument to fhandler_*::select_*.
1047         (socketinf): Delete.
1048         (thread_socket): socketinf -> select_socket_info.
1049         (mailslotinf): Delete.
1050         (thread_mailslot): mailslotinf -> select_mailslot_info.
1051
1052 2009-06-30  Christopher Faylor  <me+cygwin@cgf.cx>
1053
1054         * fhandler.cc (fhandler_base::has_ongoing_io): Accept an argument
1055         indicating whether the overlapped event should be tested.
1056         (fhandler_base::read_overlapped): Pass is_overlapped state to
1057         has_ongoing_io.
1058         (fhandler_base::write_overlapped): Ditto.
1059         * fhandler.h (fhandler_base::has_ongoing_io): Accommodate argument
1060         change.
1061         * select.cc (peek_pipe): Ditto.
1062
1063 2009-06-30  Corinna Vinschen  <corinna@vinschen.de>
1064
1065         * net.cc (fdsock): Set default socket buffer sizes to 65520.  Change
1066         comment accordingly.
1067         * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum
1068         send size to 65520 as well.
1069
1070 2009-06-29  Christopher Faylor  <me+cygwin@cgf.cx>
1071
1072         * select.cc (peek_pipe): Turn on (temporarily?) the experimental code
1073         which tries to determine when a pipe is writable.
1074
1075 2009-06-28  Christopher Faylor  <me+cygwin@cgf.cx>
1076
1077         * select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe
1078         is ready for writing rather than performing brute-force checks.
1079
1080 2009-06-28  Christopher Faylor  <me+cygwin@cgf.cx>
1081
1082         * fhandler.h (fhandler_base::has_ongoing_io): Declare new function.
1083         * fhandler.cc (fhandler_base::has_ongoing_io): Define new function.
1084         (fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing
1085         when handle has not completed last I/O.
1086         (fhandler_base::write_overlapped): Ditto.
1087         * select.cc (peek_pipe): Be more careful about accessing hEvent field
1088         from get_overlapped().
1089
1090 2009-06-28  Christopher Faylor  <me+cygwin@cgf.cx>
1091
1092         * gendef (cleanup): Rename from 'nocr'.  Remove comments and trailing
1093         spaces.
1094         * cygwin.din: Add long-needed comment describing what
1095         dll_crt0__FP11per_process demangles to.
1096
1097         * select.cc (peek_pipe): Flag handle as not ready for write if event is
1098         not signalled.
1099         * fhandler.cc (fhandler_base::setup_overlapped): Establish event as
1100         already signalled.
1101         (fhandler_base::wait_overlapped): Don't reset event after we've
1102         successfully waited.  MSDN documentation says that this happens
1103         automatically after a WriteFileEx/ReadFileEx.
1104
1105 2009-06-26  Corinna Vinschen  <corinna@vinschen.de>
1106
1107         * wincap.h (wincaps::has_broken_alloc_console): New element.
1108         * wincap.cc: Implement above element throughout.
1109
1110 2009-06-25  Corinna Vinschen  <corinna@vinschen.de>
1111
1112         * sec_auth.cc (lsaauth): Close unused handle.
1113         (lsaprivkeyauth): Ditto.
1114
1115 2009-06-23  Corinna Vinschen  <corinna@vinschen.de>
1116
1117         * sec_auth.cc (get_server_groups): Ignore errors from
1118         get_user_local_groups.
1119
1120 2009-06-22  Corinna Vinschen  <corinna@vinschen.de>
1121
1122         * spawn.cc (spawn_guts): Don't run additional check for Win32
1123         incompatible CWD if newargv.fixup bailed out already.
1124         (av::fixup): Check shell scripts for executability.
1125
1126 2009-06-18  Corinna Vinschen  <corinna@vinschen.de>
1127
1128         * path.cc (chdir): Check error conditions first.
1129
1130 2009-06-17  Corinna Vinschen  <corinna@vinschen.de>
1131
1132         * fhandler_socket.cc (fhandler_socket::recv_internal): Mark WSARecvMsg
1133         as NO_COPY.
1134
1135 2009-06-16  Christopher Faylor  <me+cygwin@cgf.cx>
1136
1137         * fhandler.cc (fhandler_base::read_overlapped): Use a better variable
1138         name.
1139
1140 2009-06-16  Christopher Faylor  <me+cygwin@cgf.cx>
1141
1142         * fhandler.cc (fhandler_base::read_overlapped): Preserve len when
1143         looping due to received signal.
1144
1145 2009-06-15  Corinna Vinschen  <corinna@vinschen.de>
1146
1147         * net.cc (get_flags): New static function to generate interface flags
1148         value.
1149         (get_ipv4fromreg_ipcnt): New static function to fetch number of
1150         configured IPv4 addresses for a given NIC from registry.
1151         (get_ipv4fromreg): New static function to fetch configured IPv4
1152         addresses for a given NIC from registry.
1153         (get_friendlyname): New static function to generate friendly name.
1154         (get_hwaddr): New static function to copy hardware address.
1155         (get_xp_ifs): Restructure slightly.  Add code to generate IPv4 entries
1156         entries for interfaces which are disconnected.
1157
1158 2009-06-14  Christopher Faylor  <me+cygwin@cgf.cx>
1159
1160         * errno.cc (errmap): Add mapping for ERROR_IO_INCOMPLETE.
1161         * fhandler.cc (fhandler_base::fcntl): Fix comment.
1162         (fhandler_base::wait_overlapped): Accept an optional len parameter.
1163         Use the len parameter when WriteFile fails with ERROR_IO_PENDING.  Make
1164         debug output less alarming.
1165         (fhandler_base::write_overlapped): Pass len to wait_overlapped.
1166         * fhandler.h (fhandler_base::wait_overlapped): Add an optional argument
1167         denoting the number of characters intended to be written.
1168
1169         * fhandler_tty.cc (fhandler_pty_master::close): Don't close archetype
1170         handles when cygwin is still initializing since the handles aren't
1171         actually opened at that point.
1172
1173 2009-06-14  Corinna Vinschen  <corinna@vinschen.de>
1174
1175         * localtime.cc (time2): Take another stab at fixing a compiler warning.
1176
1177 2009-06-14  Christopher Faylor  <me+cygwin@cgf.cx>
1178
1179         * localtime.cc (time2): Take a stab at fixing a compiler warning.
1180
1181 2009-06-14  Christopher Faylor  <me+cygwin@cgf.cx>
1182
1183         * fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag
1184         for writes.  Don't reset event handle when we see a ERROR_IO_PENDING.
1185
1186         * sigproc.cc (stopped_or_terminated): Use bool constants for
1187         consistency.
1188
1189         * wait.cc (wait4): Remove nonsensical comment.
1190
1191 2009-06-13  Corinna Vinschen  <corinna@vinschen.de>
1192
1193         * fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen
1194         pointer to NULL if name pointer is NULL.  Explain why.
1195
1196 2009-06-12  Corinna Vinschen  <corinna@vinschen.de>
1197
1198         * localtime.cc (time2): Change "spring gap" to "spring forward gap"
1199         in comment.
1200
1201 2009-06-12  Corinna Vinschen  <corinna@vinschen.de>
1202
1203         * localtime.cc (time2): Add workaround for spring forward gap problem.
1204         Add explaining comment.
1205
1206 2009-06-12  Corinna Vinschen  <corinna@vinschen.de>
1207
1208         * Makefile.in (SUBLIBS): Add librt.a.
1209         (librt.a): New rule to build librt.a.
1210
1211 2009-06-12  Corinna Vinschen  <corinna@vinschen.de>
1212
1213         * posix_ipc.cc (check_path): Fix typo in comment.  Align naming
1214         convention rules to Linux.  Handle backslash same as slash.  Add
1215         comment.
1216
1217 2009-06-09  Corinna Vinschen  <corinna@vinschen.de>
1218
1219         * autoload.cc (GetSystemTimes): Remove.
1220         * fhandler_proc.cc (format_proc_uptime): Use global system_info rather
1221         than retrieving a local copy of the SYSTEM_INFO.  Drop call to
1222         GetSystemTimes and retrieve SystemPerformanceInformation on all systems
1223         again with buffer size big enough for 64 bit systems.
1224         (format_proc_stat): Use global system_info rather than retrieving a
1225         local copy of the SYSTEM_INFO.  Retrieve SystemPerformanceInformation
1226         with buffer size big enough for 64 bit systems.
1227
1228 2009-06-08  Corinna Vinschen  <corinna@vinschen.de>
1229
1230         * autoload.cc (GetSystemTimes): Define.
1231         * fhandler_proc.cc (format_proc_uptime): Use GetSystemInfo to retrieve
1232         processor count.  Use GetSystemTimes when available to retrieve system
1233         idle time.  Improve debug output.
1234         (format_proc_stat): Use GetSystemInfo to retrieve processor
1235         count.  Improve debug output.  Ignore if SystemPerformanceInformation
1236         returns error.  Explain why.
1237
1238 2009-06-08  Corinna Vinschen  <corinna@vinschen.de>
1239
1240         * fork.cc (frok::parent): Remove ancient code erroneously flushing
1241         stdout.
1242
1243 2009-06-08  Corinna Vinschen  <corinna@vinschen.de>
1244
1245         * cygerrno.h (save_errno::~save_errno): Set errno directly to avoid
1246         flooding debug output.
1247
1248 2009-06-08  Corinna Vinschen  <corinna@vinschen.de>
1249
1250         * path.cc (symlink_info::check): Return with error set to ENOENT if
1251         STATUS_NO_MEDIA_IN_DEVICE is returned.
1252
1253 2009-06-07  Christopher Faylor  <me+cygwin@cgf.cx>
1254
1255         * cygheap.h (mini_cygheap): New struct.
1256         (init_cygheap): Inherit locale field via mini_cygheap.
1257         * cygheap.cc (cygheap_at_start): Define new variable.
1258         (cygheap): Initialize as cygheap_at_start so that locale information is
1259         always available.
1260         (cygheap_init): Initialize cygheap iff it is set to cygheap_at_start.
1261         * shared_info.h (memory_init): Accommodate argument change.
1262         * memory.cc (memory_init): Accept an argument indicating whether
1263         cygheap should be initialized or not.
1264         * dcrt0.cc (child_info_fork::handle_fork): Pass false to memory_init().
1265         (child_info_spawn::handle_spawn): Ditto.
1266         (dll_crt0_0): Pass true to memory_init when not forking or execing.
1267
1268         * cygheap.h (cygheap_types::HEAP_2_DLL): New enum.
1269         * dll_init.h (dll): Remove unused namelen field.
1270         (dll_list::load_after_fork): Accommodate change in arguments.
1271         * dll_init.cc (dll_list::alloc): Allocate dll information in the cygwin
1272         heap.
1273         (dll_list::detach): Free dll information from the cygwin heap.
1274         (dll_list::load_after_fork): Use dll information in the cygwin heap
1275         directly rather than querying parent.
1276         * fork.cc (frok::first_dll): Delete.
1277         (frok::child): Don't report on first_dll.  Don't pass it to
1278         load_on_fork.
1279         (frok::parent): Don't set first_dll.
1280         (fork): Ditto.
1281
1282 2009-06-06  Corinna Vinschen  <corinna@vinschen.de>
1283
1284         * dll_init.cc (dll_list::alloc): Allocate memory using a section
1285         object.  Explain why.  Drop call to GetSystemInfo, rather call
1286         getpagesize to get allocation granularity.  Only align to allocation
1287         granularity under WOW64.  Use roundup2 to align.
1288         (dll_list::detach): Call NtUnmapViewOfSection instead of VirtualFree.
1289
1290 2009-06-06  Corinna Vinschen  <corinna@vinschen.de>
1291
1292         * mmap.cc: Use NtUnmapViewOfSection instead of UnmapViewOfFile
1293         throughout for symmetry.
1294         (fhandler_dev_mem::munmap): Use correct process handle in call to
1295         NtUnmapViewOfSection.
1296
1297 2009-06-06  Corinna Vinschen  <corinna@vinschen.de>
1298
1299         * dll_init.h (struct dll): Set size of name element to ANYSIZE_ARRAY.
1300         * dll_init.cc: Fix formatting.
1301         (dll_list::alloc): Only allocate as much memory for struct dll as
1302         necessary for given DLL name.
1303         (dll_list::load_after_fork): Only read a single page of parent memory.
1304         Only read more if namelen indicates that it's necessary.
1305
1306 2009-06-05  Dave Korn  <dave.korn.cygwin@gmail.com>
1307
1308         * winbase.h (ilockexch): Fix asm constraints.
1309         (ilockcmpexch): Likewise.
1310
1311 2009-06-05  Corinna Vinschen  <corinna@vinschen.de>
1312
1313         * heap.cc (heap_init): Fix typo in comment.
1314
1315 2009-06-04  Corinna Vinschen  <corinna@vinschen.de>
1316
1317         * fhandler_clipboard.cc: Avoid calling system_printf.
1318         (set_clipboard): Add basic error checking.  Set errno here.  Per MSDN,
1319         don't call GlobalFree on data block transferred to clipboard.
1320         (fhandler_dev_clipboard::write): Drop setting errno after call to
1321         set_clipboard.
1322         (fhandler_dev_clipboard::read): Add basic error checking. Simplify code.
1323
1324 2009-06-04  Corinna Vinschen  <corinna@vinschen.de>
1325
1326         * fhandler_console.cc (set_console_title): Convert title string to
1327         wchar_t and call SetConsoleTitleW.
1328
1329 2009-06-04  Corinna Vinschen  <corinna@vinschen.de>
1330
1331         * fhandler_console.cc (fhandler_console::read): Allow Ctrl-Space to
1332         emit a NUL byte.
1333
1334 2009-06-04  Dave Korn  <dave.korn.cygwin@gmail.com>
1335
1336         * thread.cc (__cygwin_lock_lock): Delete racy optimisation.
1337         (__cygwin_lock_unlock): Likewise.
1338
1339 2009-06-03  IWAMURO Motnori  <deenheart@gmail.com>
1340
1341         * strfuncs.cc (sys_cp_mbstowcs): Fix condition.
1342
1343 2009-06-03  Corinna Vinschen  <corinna@vinschen.de>
1344
1345         * strfuncs.cc (sys_cp_wcstombs): Implement reverse functionality
1346         of the change to sys_cp_mbstowcs from 2009-05-30.
1347         (sys_cp_mbstowcs): Slightly reformat.  Fix comment to accommodate
1348         change to sys_cp_wcstombs.  Don't write to *ptr if dst is NULL.
1349
1350 2009-06-03  Corinna Vinschen  <corinna@vinschen.de>
1351
1352         * fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace
1353         to \033\177 or to \377 dependent on the setting of dev_state->metabit.
1354
1355 2009-06-02  Corinna Vinschen  <corinna@vinschen.de>
1356
1357         * path.cc (path_conv::check): Don't call set_exec for files on "noacl"
1358         mount points.
1359
1360 2009-05-30  Christopher Faylor  <me+cygwin@cgf.cx>
1361
1362         * strfuncs.cc (sys_cp_mbstowcs): Treat src as unsigned char *.  Convert
1363         failure of f_mbtowc into a single malformed utf-16 value.
1364
1365 2009-05-30  Christopher Faylor  <me+cygwin@cgf.cx>
1366
1367         * cygwin/include/sys/termios.h: Make default erase character "^?".
1368
1369 2009-05-30  Christopher Faylor  <me+cygwin@cgf.cx>
1370
1371         * fhandler_console.cc (fhandler_console::read): Convert backspace key
1372         to DEL.
1373
1374 2009-05-29  Christopher Faylor  <me+cygwin@cgf.cx>
1375
1376         * path.cc (cwdstuff::set): Rewrite previous change to properly test the
1377         end of the buffer.
1378
1379 2009-05-28  Christopher Faylor  <me+cygwin@cgf.cx>
1380
1381         * path.cc (cwdstuff::set): Avoid removing a nonexistent trailing slash.
1382
1383 2009-05-20  Eric Blake  <ebb9@byu.net>
1384
1385         * net.cc (gethostby_helper): Use correct signedness.
1386
1387 2009-05-18  Christopher Faylor  <me+cygwin@cgf.cx>
1388
1389         * mount.cc (mount_info::add_item): Avoid using any-old '/' as
1390         indicating root.
1391
1392 2009-05-18  Christopher Faylor  <me+cygwin@cgf.cx>
1393
1394         * mount.cc (mount_info::got_usr_bin): Mark as NO_COPY.
1395         (mount_info::got_usr_lib): Ditto.
1396         (mount_info::root_idx): Ditto.
1397
1398 2009-05-14  Corinna Vinschen  <corinna@vinschen.de>
1399
1400         * wchar.h (sys_mbstowcs): Add missing __stdcall attribute.
1401
1402 2009-05-14  Corinna Vinschen  <corinna@vinschen.de>
1403
1404         * cygheap.cc (cygheap_init): Set Cygwin default locale values.
1405         * cygheap.h (struct cygheap_locale): New structure.
1406         (struct user_heap_info): Add cygheap_locale member locale.
1407         * dcrt0.cc (dll_crt0_1): Revert to calling _setlocale_r so that only
1408         the applications locale is reverted to "C".
1409         * environ.cc (environ_init): Remove unused got_lc variable.
1410         * fhandler.h (class dev_console): Remove now unsed locale variables.
1411         * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove
1412         setting dev_console's locale members.
1413         (dev_console::con_to_str): Use internal locale settings.  Default to
1414         __ascii_wctomb if charset is "ASCII".
1415         (fhandler_console::write_normal): Ditto.
1416         * strfuncs.cc (__ascii_wctomb): Drop declaration.
1417         (__db_wctomb): Use fixed value 2 instead of not
1418         necessarily matching MB_CUR_MAX.
1419         (__eucjp_wctomb): Use 3 instead of MB_CUR_MAX.
1420         (sys_cp_wcstombs): Remove special case for "C" locale.
1421         (sys_wcstombs): Implement here.  Use internal locale data stored on
1422         cygheap.
1423         (sys_cp_mbstowcs): Remove special case for "C" locale.
1424         (sys_mbstowcs): Implement here.  Use internal locale data stored on
1425         cygheap.
1426         * syscalls.cc (internal_setlocale): New function to set cygheap locale
1427         data and to reset CWD posix path.
1428         (setlocale): Just call internal_setlocale from here if necessary.
1429         * wchar.h (__ascii_wctomb): Declare.
1430         (sys_wcstombs): Don't define inline, just declare.
1431         (sys_mbstowcs): Ditto.
1432
1433 2009-05-14  Christopher Faylor  <me+cygwin@cgf.cx>
1434
1435         * mount.cc (mount_info::init): Remove MOUNT_CYGWIN_EXEC setting when
1436         auto-mounting /usr/bin.
1437
1438 2009-05-14  Corinna Vinschen  <corinna@vinschen.de>
1439
1440         * mount.cc (oopts): Add a no-op "auto" option.
1441         (mount_info::create_root_entry): Set root dir to MOUNT_IMMUTABLE rather
1442         than to MOUNT_OVERRIDE.
1443
1444 2009-05-13  Corinna Vinschen  <corinna@vinschen.de>
1445             Christopher Faylor  <me+cygwin@cgf.cx>
1446
1447         * mount.cc (mount_info::got_usr_bin): Define.
1448         (mount_info::got_usr_lib): Ditto.
1449         (mount_info::root_idx): Ditto.
1450         (mount_info::create_root_entry): Create root entry as immutable and
1451         flag as automatic.
1452         (mount_info::init): Remove "Huh?  No /etc/fstab..." warning.
1453         Unconditionally call from_fstab for user and system tables.  Fill in
1454         /usr/bin and /usr/lib if they have not been specified in /etc/fstab.
1455         (oopts): Alphabetize.  Add "override" option to allow overriding
1456         immutable mount points.
1457         (mount_info::add_item): Accommodate new MOUNT_IMMUTABLE flag intended
1458         for root mount.
1459         (mount_info::add_item): Detect "/usr/bin", "/usr/lib", and "/" and set
1460         appropriate global state.
1461         (fillout_mntent): Add ,auto to mount points added by Cygwin DLL.
1462         (mount): Remove masking of MOUNT_SYSTEM.  Allow user to shoot
1463         themselves.  Add comment.
1464         * mount.h (mount_info::got_usr_bin): Declare.
1465         (mount_info::got_usr_lib): Ditto.
1466         (mount_info::root_idx): Ditto.
1467         * include/sys/mount.h: Reformat enum.
1468         Add MOUNT_{OVERRIDE,IMMUTABLE,AUTOMATIC}.
1469
1470 2009-05-13  Corinna Vinschen  <corinna@vinschen.de>
1471
1472         * cygheap.h (cwdstuff): Convert to class.  Make posix and dir private.
1473         (cwdstuff::get_posix): New method.
1474         (cwdstuff::reset_posix): New method.
1475         * dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r.
1476         * environ.cc (environ_init): Ditto.  Prefer "C" locale over current
1477         codepage default locale.
1478         * path.cc (chdir): Use cwdstuff::get_posix method instead of accessing
1479         cwdstuff::posix directly.
1480         (cwdstuff::set): Defer creating posix path to first usage.
1481         (cwdstuff::get_posix): Create posix path if it's empty, and return it.
1482         (cwdstuff::get): Create posix path if it's empty.
1483         * strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C"
1484         locale.
1485         (sys_cp_mbstowcs): Ditto.
1486         * syscalls.cc (gen_full_path_at): Fetch CWD posix path locked.
1487         (setlocale): Implement here.  Reset CWD posix path.
1488
1489 2009-05-09  Christopher Faylor  <me+cygwin@cgf.cx>
1490
1491         * cygwin/version.h (CYGWIN_VERSION_CYGWIN_CONV): New define.
1492
1493 2009-05-09  Corinna Vinschen  <corinna@vinschen.de>
1494
1495         * dtable.cc (dtable::init_std_file_from_handle): Add workaround for
1496         Windows 7 64 bit issue.  Add lengthy comment to explain what happens.
1497         * wincap.h (wincaps::has_console_handle_problem): New element.
1498         * wincap.cc: Implement above element throughout.
1499         (wincap_7): New wincaps structure for NT 6.1 kernels.
1500         (wincapc::init): Set has_console_handle_problem to false for 32 bit
1501         systems.
1502
1503 2009-05-09  Corinna Vinschen  <corinna@vinschen.de>
1504
1505         * sec_auth.cc (str2uni_cat): Move from here...
1506         * path.cc (str2uni_cat): ...to here.  Simplify.  Make static inline.
1507         (get_nt_native_path): Use RtlAppendUnicodeToString rather than
1508         str2uni_cat for constant strings for speed.
1509         * security.h (str2uni_cat): Drop declaration.
1510
1511 2009-05-08  Corinna Vinschen  <corinna@vinschen.de>
1512             IWAMURO Motonori <deenheart@gmail.com>
1513
1514         * strfuncs.cc (sys_cp_wcstombs): save and restore previous errno value.
1515         (sys_cp_mbstowcs): Ditto.
1516
1517 2009-05-08  IWAMURO Motonori <deenheart@gmail.com>
1518
1519         * strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting
1520         wide char to SO/UTF-8 sequence.
1521
1522 2009-05-08  Corinna Vinschen  <corinna@vinschen.de>
1523
1524         * include/sys/select.h: Guard definitions with __USE_W32_SOCKETS as
1525         the accompanying fd_set definitions in newlib's sys/types.h.
1526
1527 2009-05-06  Christopher Faylor  <me+cygwin@cgf.cx>
1528
1529         * fhandler_console.cc (fhandler_console::ioctl): Properly treat
1530         TIOCLINUX argument as a char.
1531         * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use coercion to properly
1532         set char value.
1533
1534 2009-05-06  Corinna Vinschen  <corinna@vinschen.de>
1535
1536         * libc/minires.c (scanline): Fix type in calls to ctype functions
1537         to stay in unsigned char range for char values >= 0x80.
1538         * regex/regcomp.c: Ditto, throughout.
1539         * regex/regex2.h (ISWORD): Ditto.
1540
1541 2009-05-06  Corinna Vinschen  <corinna@vinschen.de>
1542
1543         * cygheap.cc (cygheap_init): Set umask to a sane default.
1544         * uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH
1545         to set HOME.  Default to /home/USERNAME.
1546
1547 2009-05-03  Corinna Vinschen  <corinna@vinschen.de>
1548
1549         * security.cc (set_file_sd): Drop using FILE_OPEN_FOR_RECOVERY flag in
1550         call to NtOpenFile.
1551         * exceptions.cc (open_stackdumpfile): Ditto in call to NtCreateFile.
1552         * fhandler.cc (fhandler_base::open): Ditto.  Simplify setting
1553         create_options.
1554
1555         * mount.cc (fs_info::update): Recognize offline storage.
1556         (fillout_mntent): Report UDF and offline storage.
1557         * mount.h (class fs_info): Add is_csc_cache status flag.
1558
1559 2009-05-04  Christopher Faylor  <me+cygwin@cgf.cx>
1560
1561         * fhandler_console.cc (fhandler_console::write_console): Eliminate
1562         unneeded debugging output.
1563         (fhandler_console::write_normal): Eliminate unneeded __seterrno.
1564
1565 2009-05-04  Christopher Faylor  <me+cygwin@cgf.cx>
1566
1567         * libc/minires.c (scanline): Accommodate ctype changes which disallow
1568         use of an unadorned char argument to is* macros.
1569         * regex/regcomp.c: Ditto, throughout.
1570         * regex/regex2.h (ISWORD): Ditto.
1571
1572 2009-05-03  Christopher Faylor  <me+cygwin@cgf.cx>
1573
1574         * fhandler.h (fhandler_console::MAX_WRITE_CHARS): Declare.
1575         (fhandler_console::write_replacement_char): Declare as inline.
1576         (fhandler_console::write_console): Declare new function.
1577         * fhandler_console.cc (fhandler_console::MAX_WRITE_CHARS): Define.
1578         (handler_console::write_console): Define.
1579         (fhandler_console::write_replacement_char): Define as inline.
1580         (fhandler_console::write_normal): Use write_console when writing
1581         buffers of unknown length.
1582
1583 2009-04-26  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
1584
1585         * include/cygwin/socket.h: Define SOL_IPV6.
1586
1587 2009-04-21  Corinna Vinschen  <corinna@vinschen.de>
1588
1589         * ctype.cc (__set_ctype): Copy exact part of the current active
1590         character class array.
1591
1592 2009-04-20  Corinna Vinschen  <corinna@vinschen.de>
1593
1594         * flock.cc (lf_setlock): Handle border case which results in WFMO loop
1595         exiting with ret == WAIT_TIMEOUT gracefully.  Add a system_printf to
1596         uncover other potential problems with WFMO loop.
1597
1598 2009-04-18  Christopher Faylor  <me+cygwin@cgf.cx>
1599
1600         * mkimport: Specify .text for stub explicitly.
1601         * speclib: Add a dummy '.idata$7' section referring to the dll
1602         associated with the real import library.
1603
1604 2009-04-18  Corinna Vinschen  <corinna@vinschen.de>
1605
1606         * dcrt0.cc (globify): Only call mbtowc for non-ascii chars.
1607
1608 2009-04-17  Corinna Vinschen  <corinna@vinschen.de>
1609
1610         * dcrt0.cc (globify): Make multibyte-aware.
1611
1612 2009-04-17  Corinna Vinschen  <corinna@vinschen.de>
1613
1614         * flock.cc (class inode_t): Add i_wait member and matching methods
1615         wait(), unwait(), and waiting().
1616         (inode_t::inode_t): Initialize i_wait to 0.
1617         (fhandler_disk_file::lock): Only remove node if no other thread is
1618         waiting for a blocking lock.
1619         (lf_setlock): Manipulate node->i_wait to signal that a thread is
1620         waiting for a blocking lock in this node.
1621         (lf_findoverlap): Reinstantiate SELF test as in original code.
1622
1623 2009-04-16  Corinna Vinschen  <corinna@vinschen.de>
1624
1625         * dlfcn.cc (get_full_path_of_dll): Just return a bool value.  Drop
1626         local path_conv in favor of getting it as parameter.  Add local string
1627         buffer instead of getting it as parameter.
1628         (dlopen): Accommodate get_full_path_of_dll change.  Fetch WCHAR Windows
1629         path from path_conv variable and call LoadLibraryW.
1630
1631 2009-04-16  Corinna Vinschen  <corinna@vinschen.de>
1632
1633         * ntdll.h (STATUS_LOCK_NOT_GRANTED): Define.
1634         * syscalls.cc (unlink_nt): Handle STATUS_LOCK_NOT_GRANTED same as
1635         STATUS_SHARING_VIOLATION.  Add lengthy comment to explain why.
1636
1637 2009-04-15  Corinna Vinschen  <corinna@vinschen.de>
1638
1639         * path.cc (path_conv::get_wide_win32_path): Allow relative paths.
1640         (cygwin_conv_path): In case of CCP_POSIX_TO_WIN_W, convert relative
1641         paths to absolute paths if the relative pathname length exceeds
1642         MAX_PATH.
1643
1644 2009-04-15  Corinna Vinschen  <corinna@vinschen.de>
1645
1646         * libc/bsdlib.cc: Align copyright with upstream.
1647         * libc/fnmatch.c: Ditto.
1648         * libc/fts.c: Ditto.
1649         * libc/inet_addr.c: Ditto.
1650         * libc/inet_network.c: Ditto.
1651         * libc/rcmd.cc: Ditto.
1652         * libc/rexec.cc: Ditto.
1653
1654 2009-04-14  Christopher Faylor  <me+cygwin@cgf.cx>
1655
1656         * speclib: Really revert to using tempdir.
1657
1658 2009-04-14  Christopher Faylor  <me+cygwin@cgf.cx>
1659
1660         * speclib: Revert to using tempdir.
1661
1662 2009-04-14  Corinna Vinschen  <corinna@vinschen.de>
1663
1664         * localtime.cc (tzload): Implement setting __tzrule's offset member
1665         using newlib's __gettzinfo () interface also when tzload returns
1666         successfully.
1667
1668 2009-04-13  Dave Korn  <dave.korn.cygwin@gmail.com>
1669
1670         * include/stdint.h (intptr_t): Remove long from type.
1671         (uintptr_t): Likewise.
1672         (INTPTR_MIN): Remove 'L' suffix.
1673         (INTPTR_MAX, UINTPTR_MAX): Likewise.
1674
1675 2009-04-12  Christopher Faylor  <me+cygwin@cgf.cx>
1676
1677         * speclib: Initial stab at cleaning up temp files.  More work needed.
1678         * mkimport: Ditto.
1679
1680 2009-04-12  Christopher Faylor  <me+cygwin@cgf.cx>
1681
1682         * Makefile.in (clean): Clean globals.h.
1683         (LIBCOS): Depend on globals.h.
1684
1685 2009-04-11  Christopher Faylor  <me+cygwin@cgf.cx>
1686
1687         * mkimport: New script to perform all operations necessary to create
1688         libcygwin.a.
1689         * rmsym: Delete.
1690         * newsym: Delete.
1691         * Makefile.in (toolopts): New variable which holds options relating to
1692         binutils/gcc tools.
1693         (speclib): Use toolopts.  Add symbols to avoid copying to special
1694         libraries.
1695         (OBSOLETE_FUNCTIONS): Delete.
1696         (NEW_FUNCTIONS): Change to represent an argument to new mkimport
1697         script.
1698         (libcygwin.a): Use only new mkimport script to create libcygwin.a.
1699         Only rely on ${LIBCOS}.
1700         (*/lib*.a): Simplify speclib dependencies.
1701         (speclib): Accept toolchain options.  Convert every argument to
1702         absolute path.  Simplify parsing of nm output.  Accommodate new
1703         exclude option.
1704
1705 2009-04-11  Dave Korn <dave.korn.cygwin@googlemail.com>
1706
1707         * include/stdint.h (INTPTR_MIN, INTPTR_MAX): Add 'L' suffix.
1708         (WINT_MAX): Add 'U' suffix.
1709
1710 2009-04-10  Christopher Faylor  <me+cygwin@cgf.cx>
1711
1712         * speclib: Use a more robust method to derive full file path.
1713
1714 2009-04-09  Christopher Faylor  <me+cygwin@cgf.cx>
1715
1716         * speclib: Semi-revert to previous version but don't try to generate
1717         well-formed import library.  Instead, just extract appropriate symbols
1718         and let later libcygwin.a on link line fill in the rest of the import
1719         stuff.
1720         * gendef: Hopefully no-op modification to allow easier post-processing
1721         on symbol values.
1722
1723 2009-04-09  Corinna Vinschen  <corinna@vinschen.de>
1724
1725         * syscalls.cc (try_to_bin): Use tmp_pathbuf buffer to allocate infobuf
1726         rather than using the stack.
1727
1728 2009-04-09  Corinna Vinschen  <corinna@vinschen.de>
1729
1730         * syscalls.cc (try_to_bin): Fix alignment of infobuf.
1731
1732 2009-04-09  Corinna Vinschen  <corinna@vinschen.de>
1733
1734         * fhandler_disk_file.cc (fhandler_disk_file::fchown): Catch an
1735         error when changing the user account on a standalone Samba server.
1736         Explain why.
1737         * sec_acl.cc (setacl): Accommodate additional parameter to set_file_sd.
1738         * sec_helper.cc (SECURITY_SAMBA_UNIX_AUTHORITY): Define.
1739         (well_known_samba_unix_user_fake_sid): Define.
1740         * security.cc (set_file_sd): Take additional parameter if ownership
1741         should be changed.  Restrict requested permissions accordingly.
1742         (set_file_attribute): Accommodate additional parameter to set_file_sd.
1743         * security.h (well_known_samba_unix_user_fake_sid): Declare.
1744         (set_file_sd): Align declaration to above change.
1745
1746 2009-04-07  Corinna Vinschen  <corinna@vinschen.de>
1747
1748         * include/stdint.h (int_least32_t): Define as int.
1749         (uint_least32_t): Ditto, unsigned.
1750         (int_fast16_t): Define as int.
1751         (int_fast32_t): Ditto.
1752         (uint_fast16_t): Ditto, unsigned.
1753         (uint_fast32_t): Ditto.
1754         (UINT32_MAX): Remove `L' long marker.
1755         (UINT_LEAST32_MAX): Ditto.
1756         (UINT_FAST16_MAX): Ditto.
1757         (UINT_FAST32_MAX): Ditto.
1758         (INT32_C): Ditto.
1759         (UINT32_C): Ditto.
1760
1761 2009-04-07  Corinna Vinschen  <corinna@vinschen.de>
1762
1763         * strfuncs.cc: Change WCHAR to wchar_t in multibyte<->widechar
1764         conversion functions throughout.
1765         * wchar.h: Ditto in declarations.  Guard them __INSIDE_CYGWIN__.
1766
1767 2009-04-07  Corinna Vinschen  <corinna@vinschen.de>
1768
1769         * fhandler.h (class dev_console): Add members con_mbtowc, con_wctomb,
1770         and con_charset.
1771         (dev_console::str_to_con): Take mbtowc function pointer and charset
1772         as additional parameters.
1773         * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
1774         aforementioned new members.  Explain why.
1775         (dev_console::con_to_str): Remove useless comment.  Call new
1776         sys_cp_wcstombs function rather than sys_wcstombs.
1777         (dev_console::str_to_con): Take mbtowc function pointer and charset
1778         as additional parameters.  Call sys_cp_mbstowcs accordingly.
1779         (fhandler_console::write_normal): Only initialize f_mbtowc and charset
1780         once.  Accommodate changed str_to_con.
1781         * strfuncs.cc (sys_cp_wcstombs): Renamed from sys_wcstombs.  Take
1782         wctomb function pointer and charset as parameters.  Use throughout.
1783         (sys_cp_mbstowcs): Take wctomb function pointer and charset as
1784         parameters instead of codepage.  Remove matching local variables and
1785         their initialization.
1786         * wchar.h (ENCODING_LEN): Define as in newlib.
1787         (__mbtowc): Use mbtowc_p typedef for declaration.
1788         (wctomb_f): New type.
1789         (wctomb_p): New type.
1790         (__wctomb): Declare.
1791         (__utf8_wctomb): Use wctomb_f typedef for declaration.
1792         (sys_cp_wcstombs): Move declaration from winsup.h here.
1793         (sys_wcstombs): Ditto.
1794         (sys_wcstombs_alloc): Ditto.
1795         (sys_cp_mbstowcs): Ditto.
1796         (sys_mbstowcs): Ditto.
1797         (sys_mbstowcs_alloc): Ditto.
1798         * winsup.h: Move declaration of sys_FOO functions to wchar.h.  Include
1799         wchar.h instead.
1800
1801 2009-04-06  Earl Chew <earl_chew@agilent.com>
1802
1803         * libc/rexec.cc (ruserpass): Use fstat64 instead of fstat.
1804
1805 2009-04-06  Corinna Vinschen  <corinna@vinschen.de>
1806
1807         * strfuncs.cc: Add comment to explain why we can't support JIS
1808         for now.
1809         (__db_wctomb): Alwaus use WC_NO_BEST_FIT_CHARS.
1810         (__jis_wctomb): Just call __ascii_wctomb from here.
1811         (__eucjp_wctomb): Convert to standalone implementation to fix up the
1812         difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
1813         Explain.
1814         (__kr_wctomb): Use codepage 949.
1815         (__db_mbtowc): Reorder code slightly.  Always use MB_ERR_INVALID_CHARS
1816         in call to MultiByteToWideChar.  Fix a problem with singlebyte
1817         sequences.  Fix a bug in '\0' handling.  Reset state->__count on
1818         successful return from non-zero state.
1819         (__jis_mbtowc): Just call __ascii_mbtowc from here.
1820         (__eucjp_mbtowc): Convert to standalone implementation to fix up the
1821         difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
1822         (__kr_mbtowc): Use codepage 949.
1823         (__set_charset_from_codepage): Handle codepage 20932 as eucJP.
1824
1825 2009-04-05  Christopher Faylor  <me+cygwin@cgf.cx>
1826
1827         * Makefile.in: Use all compile options when calculating magic values.
1828         * shared_info.h (CURR_SHARED_MAGIC): Revert erroneous value.
1829         * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
1830
1831         * fhandler.h (acquire_output_mutex): Remove unneeded ';'.
1832         (release_output_mutex): Ditto.
1833
1834 2009-04-05  Christopher Faylor  <me+cygwin@cgf.cx>
1835
1836         * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings.
1837         * shared_info.h (CURR_SHARED_MAGIC): Update.
1838         * spawn.cc (spawn_guts): Avoid copying one line command line argument
1839         if it hasn't been filled out.
1840
1841 2009-04-04  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
1842             Corinna Vinschen  <corinna@vinschen.de>
1843
1844         * include/asm/byteorder.h (__ntohl): Prototype before define to avoid
1845         a warning with -Wmissing-prototypes.  Use _ELIDABLE_INLINE macro from
1846         _ansi.h.
1847         (__ntohs): Ditto.
1848
1849 2009-04-02  Corinna Vinschen  <corinna@vinschen.de>
1850
1851         * environ.cc (build_env): Fix length calculation of resulting
1852         wide char environment string.
1853
1854 2009-04-02  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
1855
1856         * include/netdb.h: #include <inttypes.h>, <netinet/in.h>,
1857         and <sys/socket.h> per SUSv3.
1858
1859 2009-04-01  Corinna Vinschen  <corinna@vinschen.de>
1860
1861         * strfuncs.cc (sys_cp_mbstowcs): Check if ASCII SO is followed by at
1862         least two chars and the next byte is a valid UTF-8 start byte before
1863         trying to convert the followup bytes as UTF-8 sequence.
1864
1865 2009-03-31  Corinna Vinschen  <corinna@vinschen.de>
1866
1867         * shm.cc (struct shm_attached_list): Convert access type to ULONG.
1868         (fixup_shms_after_fork): Fix comment.  Use NtMapViewOfSection rather
1869         than MapViewOfFileEx to recreate shared memory regions.  Add function
1870         name to api_fatal output.
1871         (shmat): Use NtMapViewOfSection to create shared memory region
1872         top-down.
1873
1874 2009-03-31  Corinna Vinschen  <corinna@vinschen.de>
1875
1876         * ctype.cc: Remove implementation of ctype functions in favor of
1877         pointer-based newlib implementation.
1878         (_ctype_b): Declare.
1879         (__ctype_cp): Move to newlib. Declare.
1880         (__ctype_iso): Ditto.
1881         (__set_ctype): Implement changing __ctype_ptr__.  Only copy character
1882         class data in applications built under older Cygwin.
1883         * cygwin.din (__ctype_ptr__): Export.
1884         * include/ctype.h: Remove in favor of newlib implementation.
1885         * include/cygwin/config.h (__EXPORT): Define alongside __IMPORT.
1886         * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE):
1887         Define check for old vs. new ctype implementation.
1888         Bump API minor number.
1889
1890 2009-03-28  Christopher Faylor  <me+cygwin@cgf.cx>
1891
1892         * Makefile.in: Perform some minor cleanup.  Revamp speclib handling.
1893         * speclib: Rewrite to create libraries with dlltool rather than
1894         attempting surgery on libcygwin.a.
1895
1896 2009-03-27  Corinna Vinschen  <corinna@vinschen.de>
1897
1898         * net.cc (inet_ntop6): Convert to lowercase hex digits on the fly.
1899
1900 2009-03-27  Corinna Vinschen  <corinna@vinschen.de>
1901
1902         * net.cc (cygwin_getaddrinfo): Check hints for non-NULL before
1903         checking its content.
1904
1905 2009-03-27  Corinna Vinschen  <corinna@vinschen.de>
1906
1907         * fhandler.h (class fhandler_fifo): Rename read/write methods to
1908         raw_read/raw_write.
1909         * fhandler_fifo.cc: Ditto.
1910
1911 2009-03-27  Corinna Vinschen  <corinna@vinschen.de>
1912
1913         * syscalls.cc (pathconf): Fix memory leak.
1914
1915 2009-03-26  Corinna Vinschen  <corinna@vinschen.de>
1916
1917         * path.cc (symlink_worker): Write target filename as UTF-16 string
1918         with leading BOM marker.
1919         (symlink_info::check_shortcut): If check for leading BOM marker
1920         succeeds, read filename as UTF-16 string.
1921         (symlink_info::check_sysfile): Ditto.
1922
1923 2009-03-26  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
1924
1925         * include/asm/byteorder.h (__ntohl): Align definition to ISO C99.
1926         (__ntohs): Ditto.
1927
1928 2009-03-26  Corinna Vinschen  <corinna@vinschen.de>
1929
1930         * strfuncs.cc (__set_charset_from_codepage): Revert to translating
1931         codepage 936 to "GBK".
1932
1933 2009-03-25  Corinna Vinschen  <corinna@vinschen.de>
1934
1935         * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two
1936         ASCII SO's.
1937
1938 2009-03-25  Corinna Vinschen  <corinna@vinschen.de>
1939
1940         * environ.cc (environ_init): Break from locale loop after first hit.
1941         * fhandler_console.cc (fhandler_console::write_normal): Print a SO
1942         sequence using always valid Unicode chars.
1943
1944 2009-03-25  Corinna Vinschen  <corinna@vinschen.de>
1945
1946         * strfuncs.cc (__kr_wctomb): Use codepage 51949 rather than 50949.
1947         (__kr_mbtowc): Ditto.
1948         (__set_charset_from_codepage): Ditto.  Translate codepage 936 to
1949         "GB2312" and drop the charset name "GBK".
1950
1951 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
1952
1953         * strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949.
1954         (__kr_mbtowc): Ditto.
1955         (__set_charset_from_codepage): Translate codepages 949 and 50949 to
1956         "EUCKR" and drop the charset name "CP949".
1957
1958 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
1959
1960         * strfuncs.cc (sys_cp_mbstowcs): Don't read beyond src + nms.
1961
1962 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
1963
1964         * shared_info.h (CURR_SHARED_MAGIC): Update.
1965
1966 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
1967
1968         * wchar.h: Replace UINT with unsigned int.
1969
1970 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
1971
1972         * wchar.h: Remove erroneous "C" specifier from extern declaration.
1973
1974 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
1975
1976         * ctype.cc (_CTYPE_DATA_0_127): Add _B class to TAB character.
1977         (__ctype_default): New character class array for default ASCII
1978         character set.
1979         (__ctype_iso): New array of character class array for ISO charsets.
1980         (__ctype_cp): Ditto for singlebyte Windows codepages.
1981         (tolower): Implement as distinct function to support any singlebyte
1982         charset.
1983         (toupper): Ditto.
1984         (__set_ctype): New function to copy singlebyte character classes
1985         corresponding to current charset to ctype_b array.
1986         Align copyright text to upstream.
1987         * dcrt0.cc (dll_crt0_1): Reset current locale to "C" per POSIX.
1988         * environ.cc (set_file_api_mode): Remove.
1989         (codepage_init): Remove.
1990         (parse_thing): Remove "codepage" setting.
1991         (environ_init): Set locale according to environment settings, or
1992         to current codepage, before converting environment to multibyte.
1993         * fhandler.h (fhandler_console::write_replacement_char): Drop argument.
1994         * fhandler_console.cc (dev_console::str_to_con): Call sys_cp_mbstowcs
1995         rather than MultiByteToWideChar.
1996         (fhandler_console::write_replacement_char): Always print a funny
1997         half filled square if a character isn't in the current charset.
1998         (fhandler_console::write_normal): Convert to using __mbtowc
1999         rather than next_char.
2000         * fork.cc (frok::child): Drop call to set_file_api_mode.
2001         * globals.cc (enum codepage_type) Remove.
2002         (current_codepage): Remove.
2003         * miscfuncs.cc (cygwin_wcslwr): Unused, dangerous.  Remove.
2004         (cygwin_wcsupr): Ditto.
2005         (is_cp_multibyte): Remove.
2006         (next_char): Remove.
2007         * miscfuncs.h (is_cp_multibyte): Drop declaration.
2008         (next_char): Ditto.
2009         * strfuncs.cc (get_cp): Remove.
2010         (__db_wctomb): New function to implement _wctomb_r functionality for
2011         doublebyte charsets using WideCharToMultiByte.
2012         (__sjis_wctomb): New function to replace unusable newlib function.
2013         (__jis_wctomb): Ditto.
2014         (__eucjp_wctomb): Ditto.
2015         (__gbk_wctomb): New function.
2016         (__kr_wctomb): Ditto.
2017         (__big5_wctomb): Ditto.
2018         (__db_mbtowc): New function to implement _mbtowc_r functionality for
2019         doublebyte charsets using MultiByteToWideChar.
2020         (__sjis_mbtowc): New function to replace unusable newlib function.
2021         (__jis_mbtowc): Ditto.
2022         (__eucjp_mbtowc): Ditto.
2023         (__gbk_mbtowc): New function.
2024         (__kr_mbtowc): New function
2025         (__big5_mbtowc): New function
2026         (__set_charset_from_codepage): New function.
2027         (sys_wcstombs): Reimplement, basically using same wide char to multibyte
2028         conversion as newlib's application level functions.  Plus extras.
2029         Add lengthy comment to explain.  Change return type to size_t.
2030         (sys_wcstombs_alloc): Just use sys_wcstombs.  Change return type to
2031         size_t.
2032         (sys_cp_mbstowcs): Replace sys_mbstowcs, take additional codepage
2033         argument.  Explain why.  Change return type to size_t.
2034         (sys_mbstowcs_alloc): Just use sys_mbstowcs.  Change return type to
2035         size_t.
2036         * wchar.h: Declare internal functions implemented in strfuncs.cc.
2037         (wcscasecmp): Remove.
2038         (wcsncasecmp): Remove.
2039         (wcslwr): Remove.
2040         (wcsupr): Remove.
2041         * winsup.h (codepage_init): Remove declaration.
2042         (get_cp): Ditto.
2043         (sys_wcstombs): Align declaration to new implementation.
2044         (sys_wcstombs_alloc): Ditto.
2045         (sys_cp_mbstowcs): Add declaration.
2046         (sys_mbstowcs): Define as inline function.
2047         (sys_mbstowcs_alloc): Align declaration to new implementation.
2048         (set_file_api_mode): Remove declaration.
2049         * include/ctype.h (isblank): Redefine to use _B character class.
2050         (toupper): Remove ASCII-only definition.
2051         (tolower): Ditto.
2052
2053 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
2054
2055         * sec_auth.cc (str2buf2uni): Remove.
2056         * security.h (str2buf2uni): Remove declaration.
2057
2058 2009-03-24  Yaakov Selkowitz  <yselkowitz@cygwin.com>
2059
2060         * include/mntent.h: Remove declarations of nonexistant addmntent
2061         and hasmntopt.  Update and clarify the /etc/mtab comment.
2062
2063 2009-03-23  Corinna Vinschen  <corinna@vinschen.de>
2064
2065         * smallprint.cc (__small_vsprintf): Handle NULL PWCHAR and
2066         PUNICODE_STRING arguments.
2067         (__small_vswprintf): Ditto.
2068
2069 2009-03-23  Corinna Vinschen  <corinna@vinschen.de>
2070
2071         * include/asm/byteorder.h (__constant_ntohs): Remove declaration.
2072         (__constant_ntohl): Ditto.
2073
2074 2009-03-23  Corinna Vinschen  <corinna@vinschen.de>
2075
2076         * cygwin.din: Export wordexp, wordfree.
2077         * posix.sgml: Move them to SUSv4 list.
2078         * include/cygwin/version.h: Bump API minor number.
2079
2080 2009-03-22  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
2081
2082         * include/sys/un.h: #include <string.h> for strlen.
2083
2084 2009-03-19  Corinna Vinschen  <corinna@vinschen.de>
2085
2086         * dlfcn.cc (get_full_path_of_dll): Revert patch from 2008-07-16.
2087
2088 2009-03-19  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
2089
2090         * cygwin.din: Export log2, log2f as functions.
2091         * posix.sgml: Add them to SUSv4 list.
2092         * include/cygwin/version.h: Bump API minor number.
2093
2094 2009-03-18  Corinna Vinschen  <corinna@vinschen.de>
2095
2096         * sec_auth.cc (lsaauth): Remove local definitions of struct
2097         _TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions
2098         from winnt.h.
2099         (lsaprivkeyauth): As in lsaauth, fetch linked token if available and
2100         return that in favor of default token.
2101
2102 2009-03-15  Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2103
2104         * errno.cc (_sys_errlist): Add ESTRPIPE.
2105
2106 2009-03-15  Corinna Vinschen  <corinna@vinschen.de>
2107
2108         * cygwin.din: Export wcsdup.
2109         * posix.sgml: Add wcsdup to SUSv4 list.
2110         * include/cygwin/version.h: Bump API minor number.
2111
2112 2009-03-15  Corinna Vinschen  <corinna@vinschen.de>
2113
2114         * include/inttypes.h: Remove "l" size specifier from all 16 and 32 bit
2115         definitions.
2116
2117 2009-03-14  Christopher Faylor  <me+cygwin@cgf.cx>
2118
2119         * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered
2120         during initialization.
2121
2122 2009-03-14  Corinna Vinschen  <corinna@vinschen.de>
2123
2124         * gendef: Remove STABS directives.
2125
2126 2009-03-13  Corinna Vinschen  <corinna@vinschen.de>
2127
2128         * mktemp.cc: Remove STABS specific link-time warning.  Align copyright
2129         text to upstream.
2130
2131 2009-03-13  Corinna Vinschen  <corinna@vinschen.de>
2132
2133         * flock.cc: Fix lockf copyright to latest version.
2134
2135 2009-03-12  Corinna Vinschen  <corinna@vinschen.de>
2136
2137         * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined
2138         earlier.
2139         (get_ino_by_handle): Take additional path_conv argument, accommodate
2140         throughout.  Only use FileId if isgood_inode check is true.
2141         (fhandler_base::open_fs): Simplify setting ino due to above change.
2142         (readdir_get_ino): Make sure to return always a non-zero inode number.
2143         (fhandler_disk_file::readdir): Always open file in dir with
2144         FILE_OPEN_REPARSE_POINT so as not to open wrong file.
2145         Drop call to isgood_inode here.
2146         * path.cc (symlink_info::check): Call fs.update in case we're fetching
2147         file information from call to NtQueryDirectoryFile.
2148
2149 2009-03-12  Corinna Vinschen  <corinna@vinschen.de>
2150
2151         * flock.cc (fhandler_disk_file::lock): Don't test file open mode in
2152         case of flock-type locks.  Explain why.
2153
2154 2009-03-12  Brian Ford <Brian.Ford@FlightSafety.com>
2155
2156         * gethostby_helper: Fix typos in DEBUGGING case.
2157
2158 2009-03-11  Corinna Vinschen  <corinna@vinschen.de>
2159
2160         * cygwin.din: Export wcscasecmp, wcsncasecmp.
2161         * posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list.
2162         * include/cygwin/version.h: Bump API minor number.
2163
2164 2009-03-11  Corinna Vinschen  <corinna@vinschen.de>
2165
2166         * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf,
2167         vswscanf.
2168         * posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf
2169         to SUSv4 list.
2170         * include/cygwin/version.h: Bump API minor number.
2171
2172 2009-03-09  Corinna Vinschen  <corinna@vinschen.de>
2173
2174         * fhandler.h (fhandler_socket::wait_for_events): Take additional
2175         parameter "dontwait".
2176         * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the
2177         socket is non-blocking if dontwait is true.
2178         (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to
2179         set the wait_for_events dontwait parameter.
2180         (fhandler_socket::send_internal): Ditto.  Optimize code slightly.
2181         * include/cygwin/socket.h (MSG_DONTWAIT): Define.
2182         * include/cygwin/version.h: Bump API minor number.
2183
2184 2009-03-09  Corinna Vinschen  <corinna@vinschen.de>
2185
2186         * cygwin.din: Export wcsftime.
2187         * posix.sgml: Move wcsftime to SUSv4 list.
2188         * include/cygwin/version.h: Bump API minor number.
2189
2190 2009-03-06  Pierre A. Humblet <pierre@phumblet.no-ip.org>
2191
2192         * cygwin.din: Export gethostbyname2.
2193         * net.cc: define _CYGWIN_IN_H and include resolv.h.
2194         (realloc_ent): New function.
2195         (dup_ent): Call realloc_ent.
2196         (memcpy4to6): New function.
2197         (dn_length1): New function.
2198         (gethostby_helper): New function.
2199         (gethostbyname2): New function.
2200         * posix.sgml: Add gethostbyname2.
2201         * include/cygwin/version.h: Bump API minor number.
2202         * libc/minires.c (get_options): Look for "inet6" and apply bounds
2203         to "retry" and "retrans".
2204         (res_ninit): Set the default options at the beginning.
2205         (dn_expand): Fix "off by one".
2206
2207 2009-03-06  Corinna Vinschen  <corinna@vinschen.de>
2208
2209         * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf,
2210         vswprintf.  Sort.
2211         * posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf
2212         to SUSv4 list.  Sort SUSv4 list.
2213         * include/cygwin/version.h: Bump API minor number.
2214
2215 2009-03-04  Corinna Vinschen  <corinna@vinschen.de>
2216
2217         * dcrt0.cc (disable_dep): Disable.  Explain why.
2218         (dll_crt0_0): Disable calling disable_dep.  Explain why.
2219
2220 2009-03-03  Corinna Vinschen  <corinna@vinschen.de>
2221
2222         * net.cc: Include asm/byteorder.h.
2223         (htonl): Move to end of file.  Add comment to explain why.  Align
2224         definition to POSIX.  Use related macro from asm/byteorder.h.
2225         (ntohl): Ditto.
2226         (htons): Ditto.
2227         (ntohs): Ditto.
2228         * include/asm/byteorder.h: Revert previous patch.
2229
2230 2009-03-03  Corinna Vinschen  <corinna@vinschen.de>
2231
2232         * include/asm/byteorder.h: Disable optimization when building
2233         Cygwin network code.
2234
2235 2009-02-26  Christopher Faylor  <me+cygwin@cgf.cx>
2236
2237         * dtable.cc (dtable::select_read): Add ability to override fh.
2238         * fhandler.h (fhandler_fifo::select_read): Declare new function.
2239         (fhandler_fifo::select_write): Ditto.
2240         (fhandler_fifo::select_except): Ditto.
2241         * select.cc (peek_pipe): Treat certain classes of pipe errors as "no
2242         data".
2243         (fhandler_fifo::select_read): Define new function.
2244         (fhandler_fifo::select_write): Ditto.
2245         (fhandler_fifo::select_except): Ditto.
2246
2247         * shared_info.h (CURR_SHARED_MAGIC): Update.
2248
2249 2009-02-23  Sjors Gielen <mailinglist@dazjorz.com>
2250
2251         * Makefile.in: Add DESTDIR functionality.
2252
2253 2009-02-23  Corinna Vinschen  <corinna@vinschen.de>
2254
2255         * sec_auth.cc (get_user_local_groups): Simplify LookupAccountName code.
2256
2257 2009-02-20  Corinna Vinschen  <corinna@vinschen.de>
2258
2259         * autoload.cc (NetLocalGroupEnum): Remove.
2260         (NetLocalGroupGetMembers): Remove.
2261         (NetUserGetLocalGroups): Add.
2262         * sec_auth.cc (is_group_member): Remove function.
2263         (get_user_local_groups): Get user as string instead of as SID.
2264         Call NetUserGetLocalGroups instead of NetLocalGroupEnum.  Drop call
2265         to is_group_member.
2266         (get_server_groups): Call get_user_local_groups with user name instead
2267         of user SID.
2268
2269 2009-02-19  Corinna Vinschen  <corinna@vinschen.de>
2270
2271         * winver.rc: Fix Copyright date.
2272
2273 2009-02-19  Corinna Vinschen  <corinna@vinschen.de>
2274
2275         * cygwin.din: Export mbsnrtowcs and wcsnrtombs.
2276         * posix.sgml: Move mbsnrtowcs and wcsnrtombs to SUSv4 section.
2277         * include/cygwin/version.h: Bump API minor number.
2278
2279 2009-02-18  Corinna Vinschen  <corinna@vinschen.de>
2280
2281         * cygwin.din: Export open_wmemstream.
2282         * posix.sgml: Move open_wmemstream to SUSv4 section.
2283         * include/cygwin/version.h: Bump API minor number.
2284
2285 2009-02-16  Corinna Vinschen  <corinna@vinschen.de>
2286
2287         * cygwin.din: Export reallocf.
2288         * malloc_wrapper.cc( reallocf): New function.
2289         * posix.sgml: Add reallocf to BSD section.
2290         * include/cygwin/version.h: Bump API minor number.
2291         * libc/fts.c: Remove erroneous reallocf definition.
2292
2293 2009-02-16  Corinna Vinschen  <corinna@vinschen.de>
2294
2295         * cygwin.din: Export wcstoimax, wcstoumax.
2296         * posix.sgml: Move wcstoimax and wcstoumax to SUSv4 section.
2297         * include/inttypes.h: Declare wcstoimax and wcstoumax.
2298         * include/cygwin/version.h: Bump API minor number.
2299
2300 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
2301
2302         * cygwin.din: Export wcsnlen.
2303         * posix.sgml: Move wcsnlen to SUSv4 section.
2304         * include/cygwin/version.h: Bump API minor number.
2305
2306 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
2307
2308         * environ.cc (_getenv_r): New function.
2309
2310 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
2311
2312         * posix.sgml: Move dirfd to SUSv4 section.
2313
2314 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
2315
2316         * posix.sgml: Move interfaces deprecated in SUSv4 to deprecated
2317         interfaces section.  Move interfaces added in SUSv4 to SUSv4
2318         section or, if unimplemented, add them to the unimplemented interfaces
2319         section.
2320
2321 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
2322
2323         * posix.sgml: Merge SUSv3 and SUSv4 section into a single SUSv4 section.
2324         Move Solaris calls now in SUSv4 to SUSv4 section.  Rename unimplemented
2325         section to refer to SUSv4.  Add note about missing interfaces.
2326         Move wcstod and wcstof from unimplemented to SUSv4 section.
2327
2328 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
2329
2330         * mount.cc (mount_info::from_fstab_line): Make cygdrive posix=0 by
2331         default as documented.
2332
2333 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
2334
2335         * cygwin.din: Export wcstod and wcstof.
2336         * include/cygwin/version.h: Bump API minor number.
2337
2338 2009-02-11  Corinna Vinschen  <corinna@vinschen.de>
2339
2340         * syscalls.cc (open): Handle O_DIRECTORY flag.
2341         * include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH.
2342         * include/cygwin/version.h: Bump API minor number.
2343
2344 2009-02-09  Corinna Vinschen  <corinna@vinschen.de>
2345
2346         * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix format.  Add
2347         code to allow to read disk and CD/DVD devices in full length.  Explain
2348         why.
2349         (fhandler_dev_floppy::raw_read): Add current position to debug output.
2350
2351         * include/sys/sched.h: New stub file to override newlib file with
2352         clashing definitions.
2353
2354 2009-02-05  Corinna Vinschen  <corinna@vinschen.de>
2355
2356         * cygwin.din: Export wcstok.
2357         * posix.sgml: Move wcstok from unimplemented to susv3.
2358         * include/cygwin/version.h: Bump API minor number.
2359
2360 2009-02-04  Corinna Vinschen  <corinna@vinschen.de>
2361
2362         * fhandler_proc.cc (proc_tab): Add entry for mounts symlink.
2363         (format_proc_mounts): New function to implement mounts symlink.
2364         * fhandler_process.cc (process_tab): Add entry for mounts file.
2365         (format_process_mounts): New function to implement mounts file.
2366
2367 2009-02-04  Corinna Vinschen  <corinna@vinschen.de>
2368
2369         * security.cc (alloc_sd): Disable generating default permission entries
2370         for directories.
2371
2372 2009-01-29  Corinna Vinschen  <corinna@vinschen.de>
2373
2374         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number
2375         evaluation for faked "." entry.
2376
2377         * mount.cc (fs_info::update): Move setting of is_cdrom after checking
2378         for caseinsensitivity.  Recognize UDF in is_cdrom case and set
2379         caseinsensitive flag according to UDF brokenness determined by OS.
2380         Add comment to explain why.
2381         * mount.h (class fs_info): Add is_udf status flag.
2382         * path.cc (symlink_info::check): Add workaround for UDF bug in
2383         terms of casesensitivity on certain OSes.
2384         * wincap.h (wincaps::has_broken_udf): New element.
2385         * wincap.cc: Implement above element throughout.
2386
2387 2009-01-27  Christopher Faylor  <me+cygwin@cgf.cx>
2388
2389         * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on
2390         EINTR or real error.
2391         (fhandler_base::write_overlapped): Assume that bytes_written will
2392         contain proper error value.
2393         * pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since
2394         signals are handled by pipe functions now.
2395
2396 2009-01-26  Corinna Vinschen  <corinna@vinschen.de>
2397
2398         * shared.cc (shared_name): New function for WCHAR names.
2399         (open_shared): Take name parameter as WCHAR.  Accommodate throughout.
2400         * shared_info.h ((CURR_SHARED_MAGIC): Redefine.
2401         (shared_name): Add declaration for function taking a WCHAR name.
2402         (open_shared): Change declaration according to above change.
2403         * pinfo.cc (pinfo::init) : Accommodate above change.
2404
2405 2009-01-26  Corinna Vinschen  <corinna@vinschen.de>
2406
2407         * grp.cc (getgrgid_r): Simplify code by using stpcpy.
2408         (getgrnam_r): Ditto.
2409         * passwd.cc (getpwuid_r32): Simplify code by using stpcpy.
2410         (getpwnam_r): Ditto.
2411
2412 2009-01-26  Corinna Vinschen  <corinna@vinschen.de>
2413
2414         * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENT
2415         flag.
2416
2417 2009-01-24  Corinna Vinschen  <corinna@vinschen.de>
2418
2419         * mount.cc (mount_info::from_fstab): Open fstab file with
2420         FILE_OPEN_FOR_BACKUP_INTENT flag.
2421
2422 2009-01-23  Corinna Vinschen  <corinna@vinschen.de>
2423
2424         * smallprint.cc (__small_vsprintf): Use already available buffer tmp
2425         in wfillin case.
2426
2427 2009-01-22  Christopher Faylor  <me+cygwin@cgf.cx>
2428
2429         * select.cc (peek_serial): Add hack to allow proper operation with
2430         com0com driver.
2431
2432 2009-01-21  Corinna Vinschen  <corinna@vinschen.de>
2433
2434         Remove USE_SERVER define.  Accommodate throughout.
2435         * configure.in: Remove --enable-server option.
2436         * configure: Regenerate.
2437         * environ.cc: Remove CYGWIN=server setting.
2438
2439 2009-01-20  Corinna Vinschen  <corinna@vinschen.de>
2440
2441         * fhandler_procnet.cc: Reorganize global procnet content data into a
2442         new struct virt_tab_t.  Accommodate throughout.
2443
2444         * fhandler.h: Fix copyright dates.
2445         * fhandler_process.cc: Ditto.
2446         * fhandler_registry.cc: Ditto.
2447
2448 2009-01-20  Corinna Vinschen  <corinna@vinschen.de>
2449
2450         * devices.h (FH_PROCESSFD): New device type.
2451         * dtable.cc (build_fh_pc): Add case for FH_PROCESSFD.
2452         * fhandler.h (class fhandler_virtual): Drop bufalloc member.
2453         * fhandler_virtual.h: New header.
2454         * fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor
2455         of types virt_type_t and virt_tab_t from fhandler_virtual.h.
2456         Change prototypes of format_XXX functions accordingly.
2457         (proc_tab): Drop size member info.
2458         (fhandler_proc::fill_filebuf): Don't allocate filebuf here.  Allocate
2459         it in the format_XXX functions.
2460         * fhandler_process.cc: Reorganize global process content data into a
2461         new struct virt_tab_t.  Accommodate throughout.
2462         (format_process_winexename): New function.
2463         (format_process_winpid): New function.
2464         (format_process_exename): New function.
2465         (format_process_root): New function.
2466         (format_process_cwd): New function.
2467         (format_process_cmdline): New function.
2468         (format_process_ppid): New function.
2469         (format_process_uid): New function.
2470         (format_process_pgid): New function.
2471         (format_process_sid): New function.
2472         (format_process_gid): New function.
2473         (format_process_ctty): New function.
2474         (format_process_fd): New function.
2475         * fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use
2476         bufalloc.
2477         * fhandler_registry.cc (fhandler_registry::fill_filebuf): Define
2478         bufalloc locally.
2479         * fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop
2480         initialization of bufalloc.
2481         (fhandler_virtual::dup): Drop copying bufalloc.
2482
2483 2009-01-20  Corinna Vinschen  <corinna@vinschen.de>
2484
2485         * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.
2486         * thread.cc (pthread_rwlock::rdlock): If a thread already owns a
2487         read lock, just count the number of locks for it, per SUSv4.
2488         (pthread_rwlock::tryrdlock): Ditto.
2489         (pthread_rwlock::unlock): If a thread has more than one concurrent
2490         read locks, just count down.
2491
2492 2009-01-20  Corinna Vinschen  <corinna@vinschen.de>
2493
2494         * autoload.cc (WSAIoctl): Reintroduce.
2495         (WSASendMsg): Define.
2496         * fhandler.h (class fhandler_socket): Change definition of recv_internal
2497         and send_internal to take WSAMSG pointer as parameter.
2498         * fhandler_socket.cc (WSAID_WSARECVMSG): Define.
2499         (LPFN_WSARECVMSG): Define.
2500         (WSASendMsg): Declare.
2501         (get_ext_funcptr): New function to fetch address of WSARecvMsg.
2502         (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter.
2503         Change code accordingly.  If control information is requested,
2504         fetch address of WSARecvMsg and use that instead of WSARecvFrom.
2505         (fhandler_socket::recvfrom): Change return type to ssize_t as
2506         declared in fhandler.h.  Accommodate changes to recv_internal.
2507         (fhandler_socket::recvmsg): Ditto.  Make sure that control information
2508         is only requested if system, address family, and socket type support it.
2509         (fhandler_socket::send_internal): Take just a LPWSAMSG parameter
2510         and the flags.  Change code accordingly.  If control information is
2511         provided, use WSASendMsg instead of WSASendTo.
2512         (fhandler_socket::sendto): Drop useless comment.  Accommodate changes
2513         to send_internal.
2514         (fhandler_socket::sendmsg): Ditto.  Make sure that control information
2515         is only provided if system, address family, and socket type support it.
2516         * wincap.h (wincaps::has_recvmsg): New element.
2517         (wincaps::has_sendmsg): New element
2518         * wincap.cc: Implement above elements throughout.
2519         * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment
2520         of type struct cmsghdr.
2521
2522 2009-01-17  Corinna Vinschen  <corinna@vinschen.de>
2523
2524         * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond
2525         EOF is required.
2526
2527 2009-01-17  Corinna Vinschen  <corinna@vinschen.de>
2528
2529         * fhandler_proc.cc: Reorganize global proc content data into a new
2530         struct proc_tab_t.  Accommodate throughout.
2531         (format_proc_version): New function.
2532         (format_proc_loadavg): New function.
2533         (format_proc_self): New function.
2534
2535         * resource.cc (getrlimit): Return correct rlim_max value for
2536         RLIMIT_NOFILE.
2537
2538 2009-01-16  Corinna Vinschen  <corinna@vinschen.de>
2539
2540         * Fix copyright dates.
2541
2542 2009-01-13  Corinna Vinschen  <corinna@vinschen.de>
2543
2544         * libc/getopt.c (parse_long_options): Use fix from NetBSD's getopt
2545         to avoid false ambiguities.
2546
2547 2009-01-12  Corinna Vinschen  <corinna@vinschen.de>
2548
2549         * syscalls.cc (enum bin_status): New type.
2550         (try_to_bin): Return bin_status.  Rename win32_path to pc.  Rename h
2551         to fh.  Rename fh to tmp_fh.  Add code to set delete dispostion and
2552         more code to replace file moved to bin by another, temporary file.
2553         Add comments to explain why.
2554         (unlink_nt): Replace move_to_bin with bin_stat.  Only set bin_stat
2555         to move_to_bin for non-remote files.  As a last resort, call try_to_bin
2556         if setting delete-on-close failed.  Only re-set R/O DOS attribute
2557         and only close handle if it's still valid.
2558
2559 2009-01-11  Corinna Vinschen  <corinna@vinschen.de>
2560
2561         * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.
2562         * path.cc (path_conv::check): Set to and check for ENOENT instead of
2563         ENOSHARE.
2564
2565         * path.cc (symlink_info::check): Fix Samba 3.2.x comment.
2566
2567 2009-01-09  Corinna Vinschen  <corinna@vinschen.de>
2568
2569         * mount.cc (mount_info::from_fstab_line): Always convert drive
2570         letter in native path to uppercase.
2571         * path.cc (normalize_win32_path): Ditto.
2572         (path_prefix_p): Revert previous patch.
2573
2574         * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
2575         return code to circumvent weird behaviour of Samba 3.2.x shares.
2576
2577 2009-01-09  Christopher Faylor  <me+cygwin@cgf.cx>
2578
2579         * include/sys/cygwin.h (CW_SETERRNO): Define.
2580         * external.cc (CW_SETERRNO): Implement.
2581         * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to
2582         reflect the above change.
2583
2584         * path.cc (path_prefix_p): Treat X: as equivalent to x:.
2585
2586         * mkglobals_h: Remove unneeded #define.
2587
2588         * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
2589
2590 2009-01-08  Corinna Vinschen  <corinna@vinschen.de>
2591
2592         * libc/fts.c (fts_build): Use DT_DIR case on Cygwin.
2593         (fts_ufslinks): Fix using wrong structure member in Cygwin-specific
2594         code.
2595
2596 2009-01-07  Corinna Vinschen  <corinna@vinschen.de>
2597
2598         * ntdll.h: Reorder NT status flags.  Fix a case difference. Add
2599         STATUS_CANNOT_DELETE flag.
2600         * syscalls.cc (unlink_nt): Change initial NtOpenFile to request
2601         FILE_SHARE_DELETE sharing mode.  Change comment accordingly.
2602         If setting delete disposition failed with STATUS_CANNOT_DELETE, try
2603         to delete using delete-on-close.  Explain why.
2604         Rearrange setting R/O DOS attribute after trying to delete.  Simplify
2605         comment.
2606
2607 2009-01-07  Corinna Vinschen  <corinna@vinschen.de>
2608
2609         * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe if
2610         original file has .exe as well.
2611         * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit
2612         apps as binaries.
2613
2614 2009-01-02  Christopher Faylor  <me+cygwin@cgf.cx>
2615
2616         Remove unneeded header files from source files throughout.
2617         Update copyrights where appropriate.
2618
2619         * globals.cc: New file for generic global variables.
2620         * mkglobals_h: New script to generate globals.h.
2621         * mkstatic: New script used to build a (currently non-working) static
2622         libcygwin_s.a.
2623         * Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
2624         (DLL_OFILES): Add globals.o.  Make all objects rely on globals.h.
2625         (globals.h): New target.  Generate globals.h.
2626         * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE
2627         operator is allowed in _cygtls.
2628         * dcrt0.cc: Move most globals to globals.cc.
2629         * init.cc: Ditto.
2630         * environ.cc (strip_title_path): Remove now-unneeded extern.
2631         * fhandler_serial.cc (fhandler_serial::open): Ditto.
2632         * pinfo.cc: Ditto.
2633         (commune_process): Ditto.
2634         * shared.cc: Ditto.
2635         * glob.cc: Ditto.
2636         * strace.cc: Ditto.
2637         * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
2638         * path.cc (stat_suffixes): Move here.
2639         * security.h: Add forward class path_conv declaration.
2640         * smallprint.cc (__small_vsprintf): Make a true c++ function.
2641         (__small_sprintf): Ditto.
2642         (small_printf): Ditto.
2643         (console_printf): Ditto.
2644         (__small_vswprintf): Ditto.
2645         (__small_swprintf): Ditto.
2646         * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of
2647         regparm.
2648         (hExeced): Move to globals.cc
2649         * strfuncs.cc (current_codepage): Ditto.
2650         (active_codepage): Ditto.
2651         * sync.cc (lock_process::locker): Move here from dcrt0.cc.
2652         * syscalls.cc (stat_suffixes): Move to path.cc.
2653         * tty.cc (tty::create_master): Uncapitalize fatal warning for
2654         consistency.
2655         * winsup.h: Include globals.h to declare most of the grab bag list of
2656         globals which were previously defined here.
2657
2658         * mount.h: Move USER_* defines back to shared_info.h.
2659
2660         * speclib: Force temporary directory cleanup.
2661
2662 2009-01-02  Christopher Faylor  <me+cygwin@cgf.cx>
2663
2664         * speclib: Rewrite completely in perl.  Avoid multiple nm calls.