OSDN Git Service

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