OSDN Git Service

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