OSDN Git Service

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