OSDN Git Service

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