OSDN Git Service

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