OSDN Git Service

* strfuncs.cc (sys_cp_mbstowcs): Don't read beyond src + nms.
[pf3gnuchains/pf3gnuchains3x.git] / winsup / cygwin / ChangeLog
1 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
2
3         * strfuncs.cc (sys_cp_mbstowcs): Don't read beyond src + nms.
4
5 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
6
7         * shared_info.h (CURR_SHARED_MAGIC): Update.
8
9 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
10
11         * wchar.h: Replace UINT with unsigned int.
12
13 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
14
15         * wchar.h: Remove erroneous "C" specifier from extern declaration.
16
17 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
18
19         * ctype.cc (_CTYPE_DATA_0_127): Add _B class to TAB character.
20         (__ctype_default): New character class array for default ASCII
21         character set.
22         (__ctype_iso): New array of character class array for ISO charsets.
23         (__ctype_cp): Ditto for singlebyte Windows codepages.
24         (tolower): Implement as distinct function to support any singlebyte
25         charset.
26         (toupper): Ditto.
27         (__set_ctype): New function to copy singlebyte character classes
28         corresponding to current charset to ctype_b array.
29         Align copyright text to upstream.
30         * dcrt0.cc (dll_crt0_1): Reset current locale to "C" per POSIX.
31         * environ.cc (set_file_api_mode): Remove.
32         (codepage_init): Remove.
33         (parse_thing): Remove "codepage" setting.
34         (environ_init): Set locale according to environment settings, or
35         to current codepage, before converting environment to multibyte.
36         * fhandler.h (fhandler_console::write_replacement_char): Drop argument.
37         * fhandler_console.cc (dev_console::str_to_con): Call sys_cp_mbstowcs
38         rather than MultiByteToWideChar.
39         (fhandler_console::write_replacement_char): Always print a funny
40         half filled square if a character isn't in the current charset.
41         (fhandler_console::write_normal): Convert to using __mbtowc
42         rather than next_char.
43         * fork.cc (frok::child): Drop call to set_file_api_mode.
44         * globals.cc (enum codepage_type) Remove.
45         (current_codepage): Remove.
46         * miscfuncs.cc (cygwin_wcslwr): Unused, dangerous.  Remove.
47         (cygwin_wcsupr): Ditto.
48         (is_cp_multibyte): Remove.
49         (next_char): Remove.
50         * miscfuncs.h (is_cp_multibyte): Drop declaration.
51         (next_char): Ditto.
52         * strfuncs.cc (get_cp): Remove.
53         (__db_wctomb): New function to implement _wctomb_r functionality for
54         doublebyte charsets using WideCharToMultiByte.
55         (__sjis_wctomb): New function to replace unusable newlib function.
56         (__jis_wctomb): Ditto.
57         (__eucjp_wctomb): Ditto.
58         (__gbk_wctomb): New function.
59         (__kr_wctomb): Ditto.
60         (__big5_wctomb): Ditto.
61         (__db_mbtowc): New function to implement _mbtowc_r functionality for
62         doublebyte charsets using MultiByteToWideChar.
63         (__sjis_mbtowc): New function to replace unusable newlib function.
64         (__jis_mbtowc): Ditto.
65         (__eucjp_mbtowc): Ditto.
66         (__gbk_mbtowc): New function.
67         (__kr_mbtowc): New function
68         (__big5_mbtowc): New function
69         (__set_charset_from_codepage): New function.
70         (sys_wcstombs): Reimplement, basically using same wide char to multibyte
71         conversion as newlib's application level functions.  Plus extras.
72         Add lengthy comment to explain.  Change return type to size_t.
73         (sys_wcstombs_alloc): Just use sys_wcstombs.  Change return type to
74         size_t.
75         (sys_cp_mbstowcs): Replace sys_mbstowcs, take additional codepage
76         argument.  Explain why.  Change return type to size_t.
77         (sys_mbstowcs_alloc): Just use sys_mbstowcs.  Change return type to
78         size_t.
79         * wchar.h: Declare internal functions implemented in strfuncs.cc.
80         (wcscasecmp): Remove.
81         (wcsncasecmp): Remove.
82         (wcslwr): Remove.
83         (wcsupr): Remove.
84         * winsup.h (codepage_init): Remove declaration.
85         (get_cp): Ditto.
86         (sys_wcstombs): Align declaration to new implementation.
87         (sys_wcstombs_alloc): Ditto.
88         (sys_cp_mbstowcs): Add declaration.
89         (sys_mbstowcs): Define as inline function.
90         (sys_mbstowcs_alloc): Align declaration to new implementation.
91         (set_file_api_mode): Remove declaration.
92         * include/ctype.h (isblank): Redefine to use _B character class.
93         (toupper): Remove ASCII-only definition.
94         (tolower): Ditto.
95
96 2009-03-24  Corinna Vinschen  <corinna@vinschen.de>
97
98         * sec_auth.cc (str2buf2uni): Remove.
99         * security.h (str2buf2uni): Remove declaration.
100
101 2009-03-24  Yaakov Selkowitz  <yselkowitz@cygwin.com>
102
103         * include/mntent.h: Remove declarations of nonexistant addmntent
104         and hasmntopt.  Update and clarify the /etc/mtab comment.
105
106 2009-03-23  Corinna Vinschen  <corinna@vinschen.de>
107
108         * smallprint.cc (__small_vsprintf): Handle NULL PWCHAR and
109         PUNICODE_STRING arguments.
110         (__small_vswprintf): Ditto.
111
112 2009-03-23  Corinna Vinschen  <corinna@vinschen.de>
113
114         * include/asm/byteorder.h (__constant_ntohs): Remove declaration.
115         (__constant_ntohl): Ditto.
116
117 2009-03-23  Corinna Vinschen  <corinna@vinschen.de>
118
119         * cygwin.din: Export wordexp, wordfree.
120         * posix.sgml: Move them to SUSv4 list.
121         * include/cygwin/version.h: Bump API minor number.
122
123 2009-03-22  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
124
125         * include/sys/un.h: #include <string.h> for strlen.
126
127 2009-03-19  Corinna Vinschen  <corinna@vinschen.de>
128
129         * dlfcn.cc (get_full_path_of_dll): Revert patch from 2008-07-16.
130
131 2009-03-19  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
132
133         * cygwin.din: Export log2, log2f as functions.
134         * posix.sgml: Add them to SUSv4 list.
135         * include/cygwin/version.h: Bump API minor number.
136
137 2009-03-18  Corinna Vinschen  <corinna@vinschen.de>
138
139         * sec_auth.cc (lsaauth): Remove local definitions of struct
140         _TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions
141         from winnt.h.
142         (lsaprivkeyauth): As in lsaauth, fetch linked token if available and
143         return that in favor of default token.
144
145 2009-03-15  Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
146
147         * errno.cc (_sys_errlist): Add ESTRPIPE.
148
149 2009-03-15  Corinna Vinschen  <corinna@vinschen.de>
150
151         * cygwin.din: Export wcsdup.
152         * posix.sgml: Add wcsdup to SUSv4 list.
153         * include/cygwin/version.h: Bump API minor number.
154
155 2009-03-15  Corinna Vinschen  <corinna@vinschen.de>
156
157         * include/inttypes.h: Remove "l" size specifier from all 16 and 32 bit
158         definitions.
159
160 2009-03-14  Christopher Faylor  <me+cygwin@cgf.cx>
161
162         * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered
163         during initialization.
164
165 2009-03-14  Corinna Vinschen  <corinna@vinschen.de>
166
167         * gendef: Remove STABS directives.
168
169 2009-03-13  Corinna Vinschen  <corinna@vinschen.de>
170
171         * mktemp.cc: Remove STABS specific link-time warning.  Align copyright
172         text to upstream.
173
174 2009-03-13  Corinna Vinschen  <corinna@vinschen.de>
175
176         * flock.cc: Fix lockf copyright to latest version.
177
178 2009-03-12  Corinna Vinschen  <corinna@vinschen.de>
179
180         * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined
181         earlier.
182         (get_ino_by_handle): Take additional path_conv argument, accommodate
183         throughout.  Only use FileId if isgood_inode check is true.
184         (fhandler_base::open_fs): Simplify setting ino due to above change.
185         (readdir_get_ino): Make sure to return always a non-zero inode number.
186         (fhandler_disk_file::readdir): Always open file in dir with
187         FILE_OPEN_REPARSE_POINT so as not to open wrong file.
188         Drop call to isgood_inode here.
189         * path.cc (symlink_info::check): Call fs.update in case we're fetching
190         file information from call to NtQueryDirectoryFile.
191
192 2009-03-12  Corinna Vinschen  <corinna@vinschen.de>
193
194         * flock.cc (fhandler_disk_file::lock): Don't test file open mode in
195         case of flock-type locks.  Explain why.
196
197 2009-03-12  Brian Ford <Brian.Ford@FlightSafety.com>
198
199         * gethostby_helper: Fix typos in DEBUGGING case.
200
201 2009-03-11  Corinna Vinschen  <corinna@vinschen.de>
202
203         * cygwin.din: Export wcscasecmp, wcsncasecmp.
204         * posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list.
205         * include/cygwin/version.h: Bump API minor number.
206
207 2009-03-11  Corinna Vinschen  <corinna@vinschen.de>
208
209         * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf,
210         vswscanf.
211         * posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf
212         to SUSv4 list.
213         * include/cygwin/version.h: Bump API minor number.
214
215 2009-03-09  Corinna Vinschen  <corinna@vinschen.de>
216
217         * fhandler.h (fhandler_socket::wait_for_events): Take additional
218         parameter "dontwait".
219         * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the
220         socket is non-blocking if dontwait is true.
221         (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to
222         set the wait_for_events dontwait parameter.
223         (fhandler_socket::send_internal): Ditto.  Optimize code slightly.
224         * include/cygwin/socket.h (MSG_DONTWAIT): Define.
225         * include/cygwin/version.h: Bump API minor number.
226
227 2009-03-09  Corinna Vinschen  <corinna@vinschen.de>
228
229         * cygwin.din: Export wcsftime.
230         * posix.sgml: Move wcsftime to SUSv4 list.
231         * include/cygwin/version.h: Bump API minor number.
232
233 2009-03-06  Pierre A. Humblet <pierre@phumblet.no-ip.org>
234
235         * cygwin.din: Export gethostbyname2.
236         * net.cc: define _CYGWIN_IN_H and include resolv.h.
237         (realloc_ent): New function.
238         (dup_ent): Call realloc_ent.
239         (memcpy4to6): New function.
240         (dn_length1): New function.
241         (gethostby_helper): New function.
242         (gethostbyname2): New function.
243         * posix.sgml: Add gethostbyname2.
244         * include/cygwin/version.h: Bump API minor number.
245         * libc/minires.c (get_options): Look for "inet6" and apply bounds
246         to "retry" and "retrans".
247         (res_ninit): Set the default options at the beginning.
248         (dn_expand): Fix "off by one".
249
250 2009-03-06  Corinna Vinschen  <corinna@vinschen.de>
251
252         * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf,
253         vswprintf.  Sort.
254         * posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf
255         to SUSv4 list.  Sort SUSv4 list.
256         * include/cygwin/version.h: Bump API minor number.
257
258 2009-03-04  Corinna Vinschen  <corinna@vinschen.de>
259
260         * dcrt0.cc (disable_dep): Disable.  Explain why.
261         (dll_crt0_0): Disable calling disable_dep.  Explain why.
262
263 2009-03-03  Corinna Vinschen  <corinna@vinschen.de>
264
265         * net.cc: Include asm/byteorder.h.
266         (htonl): Move to end of file.  Add comment to explain why.  Align
267         definition to POSIX.  Use related macro from asm/byteorder.h.
268         (ntohl): Ditto.
269         (htons): Ditto.
270         (ntohs): Ditto.
271         * include/asm/byteorder.h: Revert previous patch.
272
273 2009-03-03  Corinna Vinschen  <corinna@vinschen.de>
274
275         * include/asm/byteorder.h: Disable optimization when building
276         Cygwin network code.
277
278 2009-02-26  Christopher Faylor  <me+cygwin@cgf.cx>
279
280         * dtable.cc (dtable::select_read): Add ability to override fh.
281         * fhandler.h (fhandler_fifo::select_read): Declare new function.
282         (fhandler_fifo::select_write): Ditto.
283         (fhandler_fifo::select_except): Ditto.
284         * select.cc (peek_pipe): Treat certain classes of pipe errors as "no
285         data".
286         (fhandler_fifo::select_read): Define new function.
287         (fhandler_fifo::select_write): Ditto.
288         (fhandler_fifo::select_except): Ditto.
289
290         * shared_info.h (CURR_SHARED_MAGIC): Update.
291
292 2009-02-23  Sjors Gielen <mailinglist@dazjorz.com>
293
294         * Makefile.in: Add DESTDIR functionality.
295
296 2009-02-23  Corinna Vinschen  <corinna@vinschen.de>
297
298         * sec_auth.cc (get_user_local_groups): Simplify LookupAccountName code.
299
300 2009-02-20  Corinna Vinschen  <corinna@vinschen.de>
301
302         * autoload.cc (NetLocalGroupEnum): Remove.
303         (NetLocalGroupGetMembers): Remove.
304         (NetUserGetLocalGroups): Add.
305         * sec_auth.cc (is_group_member): Remove function.
306         (get_user_local_groups): Get user as string instead of as SID.
307         Call NetUserGetLocalGroups instead of NetLocalGroupEnum.  Drop call
308         to is_group_member.
309         (get_server_groups): Call get_user_local_groups with user name instead
310         of user SID.
311
312 2009-02-19  Corinna Vinschen  <corinna@vinschen.de>
313
314         * winver.rc: Fix Copyright date.
315
316 2009-02-19  Corinna Vinschen  <corinna@vinschen.de>
317
318         * cygwin.din: Export mbsnrtowcs and wcsnrtombs.
319         * posix.sgml: Move mbsnrtowcs and wcsnrtombs to SUSv4 section.
320         * include/cygwin/version.h: Bump API minor number.
321
322 2009-02-18  Corinna Vinschen  <corinna@vinschen.de>
323
324         * cygwin.din: Export open_wmemstream.
325         * posix.sgml: Move open_wmemstream to SUSv4 section.
326         * include/cygwin/version.h: Bump API minor number.
327
328 2009-02-16  Corinna Vinschen  <corinna@vinschen.de>
329
330         * cygwin.din: Export reallocf.
331         * malloc_wrapper.cc( reallocf): New function.
332         * posix.sgml: Add reallocf to BSD section.
333         * include/cygwin/version.h: Bump API minor number.
334         * libc/fts.c: Remove erroneous reallocf definition.
335
336 2009-02-16  Corinna Vinschen  <corinna@vinschen.de>
337
338         * cygwin.din: Export wcstoimax, wcstoumax.
339         * posix.sgml: Move wcstoimax and wcstoumax to SUSv4 section.
340         * include/inttypes.h: Declare wcstoimax and wcstoumax.
341         * include/cygwin/version.h: Bump API minor number.
342
343 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
344
345         * cygwin.din: Export wcsnlen.
346         * posix.sgml: Move wcsnlen to SUSv4 section.
347         * include/cygwin/version.h: Bump API minor number.
348
349 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
350
351         * environ.cc (_getenv_r): New function.
352
353 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
354
355         * posix.sgml: Move dirfd to SUSv4 section.
356
357 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
358
359         * posix.sgml: Move interfaces deprecated in SUSv4 to deprecated
360         interfaces section.  Move interfaces added in SUSv4 to SUSv4
361         section or, if unimplemented, add them to the unimplemented interfaces
362         section.
363
364 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
365
366         * posix.sgml: Merge SUSv3 and SUSv4 section into a single SUSv4 section.
367         Move Solaris calls now in SUSv4 to SUSv4 section.  Rename unimplemented
368         section to refer to SUSv4.  Add note about missing interfaces.
369         Move wcstod and wcstof from unimplemented to SUSv4 section.
370
371 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
372
373         * mount.cc (mount_info::from_fstab_line): Make cygdrive posix=0 by
374         default as documented.
375
376 2009-02-13  Corinna Vinschen  <corinna@vinschen.de>
377
378         * cygwin.din: Export wcstod and wcstof.
379         * include/cygwin/version.h: Bump API minor number.
380
381 2009-02-11  Corinna Vinschen  <corinna@vinschen.de>
382
383         * syscalls.cc (open): Handle O_DIRECTORY flag.
384         * include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH.
385         * include/cygwin/version.h: Bump API minor number.
386
387 2009-02-09  Corinna Vinschen  <corinna@vinschen.de>
388
389         * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix format.  Add
390         code to allow to read disk and CD/DVD devices in full length.  Explain
391         why.
392         (fhandler_dev_floppy::raw_read): Add current position to debug output.
393
394         * include/sys/sched.h: New stub file to override newlib file with
395         clashing definitions.
396
397 2009-02-05  Corinna Vinschen  <corinna@vinschen.de>
398
399         * cygwin.din: Export wcstok.
400         * posix.sgml: Move wcstok from unimplemented to susv3.
401         * include/cygwin/version.h: Bump API minor number.
402
403 2009-02-04  Corinna Vinschen  <corinna@vinschen.de>
404
405         * fhandler_proc.cc (proc_tab): Add entry for mounts symlink.
406         (format_proc_mounts): New function to implement mounts symlink.
407         * fhandler_process.cc (process_tab): Add entry for mounts file.
408         (format_process_mounts): New function to implement mounts file.
409
410 2009-02-04  Corinna Vinschen  <corinna@vinschen.de>
411
412         * security.cc (alloc_sd): Disable generating default permission entries
413         for directories.
414
415 2009-01-29  Corinna Vinschen  <corinna@vinschen.de>
416
417         * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number
418         evaluation for faked "." entry.
419
420         * mount.cc (fs_info::update): Move setting of is_cdrom after checking
421         for caseinsensitivity.  Recognize UDF in is_cdrom case and set
422         caseinsensitive flag according to UDF brokenness determined by OS.
423         Add comment to explain why.
424         * mount.h (class fs_info): Add is_udf status flag.
425         * path.cc (symlink_info::check): Add workaround for UDF bug in
426         terms of casesensitivity on certain OSes.
427         * wincap.h (wincaps::has_broken_udf): New element.
428         (wincaps::has_broken_udf): New element
429
430 2009-01-27  Christopher Faylor  <me+cygwin@cgf.cx>
431
432         * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on
433         EINTR or real error.
434         (fhandler_base::write_overlapped): Assume that bytes_written will
435         contain proper error value.
436         * pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since
437         signals are handled by pipe functions now.
438
439 2009-01-26  Corinna Vinschen  <corinna@vinschen.de>
440
441         * shared.cc (shared_name): New function for WCHAR names.
442         (open_shared): Take name parameter as WCHAR.  Accommodate throughout.
443         * shared_info.h ((CURR_SHARED_MAGIC): Redefine.
444         (shared_name): Add declaration for function taking a WCHAR name.
445         (open_shared): Change declaration according to above change.
446         * pinfo.cc (pinfo::init) : Accommodate above change.
447
448 2009-01-26  Corinna Vinschen  <corinna@vinschen.de>
449
450         * grp.cc (getgrgid_r): Simplify code by using stpcpy.
451         (getgrnam_r): Ditto.
452         * passwd.cc (getpwuid_r32): Simplify code by using stpcpy.
453         (getpwnam_r): Ditto.
454
455 2009-01-26  Corinna Vinschen  <corinna@vinschen.de>
456
457         * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENT
458         flag.
459
460 2009-01-24  Corinna Vinschen  <corinna@vinschen.de>
461
462         * mount.cc (mount_info::from_fstab): Open fstab file with
463         FILE_OPEN_FOR_BACKUP_INTENT flag.
464
465 2009-01-23  Corinna Vinschen  <corinna@vinschen.de>
466
467         * smallprint.cc (__small_vsprintf): Use already available buffer tmp
468         in wfillin case.
469
470 2009-01-22  Christopher Faylor  <me+cygwin@cgf.cx>
471
472         * select.cc (peek_serial): Add hack to allow proper operation with
473         com0com driver.
474
475 2009-01-21  Corinna Vinschen  <corinna@vinschen.de>
476
477         Remove USE_SERVER define.  Accommodate throughout.
478         * configure.in: Remove --enable-server option.
479         * configure: Regenerate.
480         * environ.cc: Remove CYGWIN=server setting.
481
482 2009-01-20  Corinna Vinschen  <corinna@vinschen.de>
483
484         * fhandler_procnet.cc: Reorganize global procnet content data into a
485         new struct virt_tab_t.  Accommodate throughout.
486
487         * fhandler.h: Fix copyright dates.
488         * fhandler_process.cc: Ditto.
489         * fhandler_registry.cc: Ditto.
490
491 2009-01-20  Corinna Vinschen  <corinna@vinschen.de>
492
493         * devices.h (FH_PROCESSFD): New device type.
494         * dtable.cc (build_fh_pc): Add case for FH_PROCESSFD.
495         * fhandler.h (class fhandler_virtual): Drop bufalloc member.
496         * fhandler_virtual.h: New header.
497         * fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor
498         of types virt_type_t and virt_tab_t from fhandler_virtual.h.
499         Change prototypes of format_XXX functions accordingly.
500         (proc_tab): Drop size member info.
501         (fhandler_proc::fill_filebuf): Don't allocate filebuf here.  Allocate
502         it in the format_XXX functions.
503         * fhandler_process.cc: Reorganize global process content data into a
504         new struct virt_tab_t.  Accommodate throughout.
505         (format_process_winexename): New function.
506         (format_process_winpid): New function.
507         (format_process_exename): New function.
508         (format_process_root): New function.
509         (format_process_cwd): New function.
510         (format_process_cmdline): New function.
511         (format_process_ppid): New function.
512         (format_process_uid): New function.
513         (format_process_pgid): New function.
514         (format_process_sid): New function.
515         (format_process_gid): New function.
516         (format_process_ctty): New function.
517         (format_process_fd): New function.
518         * fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use
519         bufalloc.
520         * fhandler_registry.cc (fhandler_registry::fill_filebuf): Define
521         bufalloc locally.
522         * fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop
523         initialization of bufalloc.
524         (fhandler_virtual::dup): Drop copying bufalloc.
525
526 2009-01-20  Corinna Vinschen  <corinna@vinschen.de>
527
528         * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.
529         * thread.cc (pthread_rwlock::rdlock): If a thread already owns a
530         read lock, just count the number of locks for it, per SUSv4.
531         (pthread_rwlock::tryrdlock): Ditto.
532         (pthread_rwlock::unlock): If a thread has more than one concurrent
533         read locks, just count down.
534
535 2009-01-20  Corinna Vinschen  <corinna@vinschen.de>
536
537         * autoload.cc (WSAIoctl): Reintroduce.
538         (WSASendMsg): Define.
539         * fhandler.h (class fhandler_socket): Change definition of recv_internal
540         and send_internal to take WSAMSG pointer as parameter.
541         * fhandler_socket.cc (WSAID_WSARECVMSG): Define.
542         (LPFN_WSARECVMSG): Define.
543         (WSASendMsg): Declare.
544         (get_ext_funcptr): New function to fetch address of WSARecvMsg.
545         (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter.
546         Change code accordingly.  If control information is requested,
547         fetch address of WSARecvMsg and use that instead of WSARecvFrom.
548         (fhandler_socket::recvfrom): Change return type to ssize_t as
549         declared in fhandler.h.  Accommodate changes to recv_internal.
550         (fhandler_socket::recvmsg): Ditto.  Make sure that control information
551         is only requested if system, address family, and socket type support it.
552         (fhandler_socket::send_internal): Take just a LPWSAMSG parameter
553         and the flags.  Change code accordingly.  If control information is
554         provided, use WSASendMsg instead of WSASendTo.
555         (fhandler_socket::sendto): Drop useless comment.  Accommodate changes
556         to send_internal.
557         (fhandler_socket::sendmsg): Ditto.  Make sure that control information
558         is only provided if system, address family, and socket type support it.
559         * wincap.h (wincaps::has_recvmsg): New element.
560         (wincaps::has_sendmsg): New element
561         * wincap.cc: Implement above elements throughout.
562         * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment
563         of type struct cmsghdr.
564
565 2009-01-17  Corinna Vinschen  <corinna@vinschen.de>
566
567         * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond
568         EOF is required.
569
570 2009-01-17  Corinna Vinschen  <corinna@vinschen.de>
571
572         * fhandler_proc.cc: Reorganize global proc content data into a new
573         struct proc_tab_t.  Accommodate throughout.
574         (format_proc_version): New function.
575         (format_proc_loadavg): New function.
576         (format_proc_self): New function.
577
578         * resource.cc (getrlimit): Return correct rlim_max value for
579         RLIMIT_NOFILE.
580
581 2009-01-16  Corinna Vinschen  <corinna@vinschen.de>
582
583         * Fix copyright dates.
584
585 2009-01-13  Corinna Vinschen  <corinna@vinschen.de>
586
587         * libc/getopt.c (parse_long_options): Use fix from NetBSD's getopt
588         to avoid false ambiguities.
589
590 2009-01-12  Corinna Vinschen  <corinna@vinschen.de>
591
592         * syscalls.cc (enum bin_status): New type.
593         (try_to_bin): Return bin_status.  Rename win32_path to pc.  Rename h
594         to fh.  Rename fh to tmp_fh.  Add code to set delete dispostion and
595         more code to replace file moved to bin by another, temporary file.
596         Add comments to explain why.
597         (unlink_nt): Replace move_to_bin with bin_stat.  Only set bin_stat
598         to move_to_bin for non-remote files.  As a last resort, call try_to_bin
599         if setting delete-on-close failed.  Only re-set R/O DOS attribute
600         and only close handle if it's still valid.
601
602 2009-01-11  Corinna Vinschen  <corinna@vinschen.de>
603
604         * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.
605         * path.cc (path_conv::check): Set to and check for ENOENT instead of
606         ENOSHARE.
607
608         * path.cc (symlink_info::check): Fix Samba 3.2.x comment.
609
610 2009-01-09  Corinna Vinschen  <corinna@vinschen.de>
611
612         * mount.cc (mount_info::from_fstab_line): Always convert drive
613         letter in native path to uppercase.
614         * path.cc (normalize_win32_path): Ditto.
615         (path_prefix_p): Revert previous patch.
616
617         * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
618         return code to circumvent weird behaviour of Samba 3.2.x shares.
619
620 2009-01-09  Christopher Faylor  <me+cygwin@cgf.cx>
621
622         * include/sys/cygwin.h (CW_SETERRNO): Define.
623         * external.cc (CW_SETERRNO): Implement.
624         * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to
625         reflect the above change.
626
627         * path.cc (path_prefix_p): Treat X: as equivalent to x:.
628
629         * mkglobals_h: Remove unneeded #define.
630
631         * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
632
633 2009-01-08  Corinna Vinschen  <corinna@vinschen.de>
634
635         * libc/fts.c (fts_build): Use DT_DIR case on Cygwin.
636         (fts_ufslinks): Fix using wrong structure member in Cygwin-specific
637         code.
638
639 2009-01-07  Corinna Vinschen  <corinna@vinschen.de>
640
641         * ntdll.h: Reorder NT status flags.  Fix a case difference. Add
642         STATUS_CANNOT_DELETE flag.
643         * syscalls.cc (unlink_nt): Change initial NtOpenFile to request
644         FILE_SHARE_DELETE sharing mode.  Change comment accordingly.
645         If setting delete disposition failed with STATUS_CANNOT_DELETE, try
646         to delete using delete-on-close.  Explain why.
647         Rearrange setting R/O DOS attribute after trying to delete.  Simplify
648         comment.
649
650 2009-01-07  Corinna Vinschen  <corinna@vinschen.de>
651
652         * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe if
653         original file has .exe as well.
654         * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit
655         apps as binaries.
656
657 2009-01-02  Christopher Faylor  <me+cygwin@cgf.cx>
658
659         Remove unneeded header files from source files throughout.
660         Update copyrights where appropriate.
661
662         * globals.cc: New file for generic global variables.
663         * mkglobals_h: New script to generate globals.h.
664         * mkstatic: New script used to build a (currently non-working) static
665         libcygwin_s.a.
666         * Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
667         (DLL_OFILES): Add globals.o.  Make all objects rely on globals.h.
668         (globals.h): New target.  Generate globals.h.
669         * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE
670         operator is allowed in _cygtls.
671         * dcrt0.cc: Move most globals to globals.cc.
672         * init.cc: Ditto.
673         * environ.cc (strip_title_path): Remove now-unneeded extern.
674         * fhandler_serial.cc (fhandler_serial::open): Ditto.
675         * pinfo.cc: Ditto.
676         (commune_process): Ditto.
677         * shared.cc: Ditto.
678         * glob.cc: Ditto.
679         * strace.cc: Ditto.
680         * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
681         * path.cc (stat_suffixes): Move here.
682         * security.h: Add forward class path_conv declaration.
683         * smallprint.cc (__small_vsprintf): Make a true c++ function.
684         (__small_sprintf): Ditto.
685         (small_printf): Ditto.
686         (console_printf): Ditto.
687         (__small_vswprintf): Ditto.
688         (__small_swprintf): Ditto.
689         * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of
690         regparm.
691         (hExeced): Move to globals.cc
692         * strfuncs.cc (current_codepage): Ditto.
693         (active_codepage): Ditto.
694         * sync.cc (lock_process::locker): Move here from dcrt0.cc.
695         * syscalls.cc (stat_suffixes): Move to path.cc.
696         * tty.cc (tty::create_master): Uncapitalize fatal warning for
697         consistency.
698         * winsup.h: Include globals.h to declare most of the grab bag list of
699         globals which were previously defined here.
700
701         * mount.h: Move USER_* defines back to shared_info.h.
702
703         * speclib: Force temporary directory cleanup.
704
705 2009-01-02  Christopher Faylor  <me+cygwin@cgf.cx>
706
707         * speclib: Rewrite completely in perl.  Avoid multiple nm calls.