1 2009-12-28 Corinna Vinschen <corinna@vinschen.de>
3 * fhandler.h (fhandler_socket::wait_for_events): Drop parameter default
5 * fhandler_socket.cc (fhandler_socket::connect): Add false as second
6 parameter to wait_for_events call.
7 (fhandler_socket::accept): Ditto.
8 (fhandler_socket::send_internal): Fix typo in call to wait_for_events.
10 2009-12-26 Eric Blake <ebb9@byu.net>
12 * include/pty.h (openpty, forkpty): Mark last two arguments const,
14 * libc/bsdlib.cc (openpty, forkpty): Likewise.
16 2009-12-25 Andy Koppe <andy.koppe@gmail.com>
18 * fhandler_console.cc (handler_console::read): Use the tty's VERASE
19 character as the backspace keycode.
21 2009-12-24 Corinna Vinschen <corinna@vinschen.de>
23 * path.cc (symlink_info::check): Set fileattr to
24 FILE_ATTRIBUTE_DIRECTORY in a certain error condition. Explain why.
26 2009-12-22 Christopher Faylor <me+cygwin@cgf.cx>
28 * select.cc (fhandler_fifo::select_read): Fill in device specific
30 (fhandler_fifo::select_write): Ditto.
31 (fhandler_fifo::select_except): Ditto.
33 2009-12-21 Corinna Vinschen <corinna@vinschen.de>
35 * path.cc (cygwin_conv_path): Add band-aid including comment to avoid
36 conversion from POSIX "." to Win32 ".\\".
38 2009-12-21 Corinna Vinschen <corinna@vinschen.de>
40 * exec.cc (execvp): Call find_exec with FE_NNF flag to enforce
41 a NULL return when executable isn't found in $PATH. Convert NULL
44 * spawn.cc (spawn_guts): Return with EFAULT if prog_arg is NULL.
45 Return with ENOENT if prog_arg is empty string. Add a comment.
47 2009-12-21 Thomas Wolff <towo@towo.net>
49 * fhandler_console.cc (get_nonascii_key): Generate ESC prefix
50 for Alt modifier generically for function keys and keypad keys.
51 Distinguish Normal, Ctrl, Shift, Ctrl-Shift rather
52 than Normal, Ctrl, Shift, Alt, so that in combination with generic
53 Alt handling all 8 combinations of these modifiers are distinguished.
54 (keytable): Add escape sequences for remaining modified
55 function keys as a compatible extension using rxvt escape codes.
56 Also distinguish keypad keys modified with Ctrl, Shift, Ctrl-Shift
57 using xterm-style modifier coding.
59 2009-12-21 Corinna Vinschen <corinna@vinschen.de>
61 Throughout, revert ill-conceived replacement of hMainThread with
62 GetCurrentThread/NtCurrentThread.
63 * dcrt0.cc (dll_crt0_0): Duplicate main thread handle to hMainThread
66 2009-12-19 Corinna Vinschen <corinna@vinschen.de>
68 * fhandler_console.cc (__vt100_conv): Minor formatting change.
70 2009-12-19 Thomas Wolff <towo@towo.net>
72 * fhandler_console.cc (write_console): Check for VT100
73 graphics mode and transform wide characters in ASCII small
74 letter range to corresponding graphics.
75 (__vt100_conv): Table to transform small ASCII letters to line
76 drawing graphics for use in VT100 graphics mode.
77 (write_normal): Check for SO/SI control characters to
78 enable/disable VT100 graphics mode.
79 (base_chars): Enable SO/SI control characters for detection.
80 (write): Check for ESC ( 0 / ESC ( B escape sequences to
81 enable/disable VT100 graphics mode. Also detect ">" while
82 parsing ESC [ sequences to distinguish specific requests.
83 (char_command): Distinguish Secondary from Primary Device Attribute
84 request to report more details about cygwin console terminal version.
85 * fhandler.h (vt100_graphics_mode_active): New flag to indicate mode.
86 (saw_greater_than_sign): New parse flag for ESC [ > sequences.
87 (gotparen, gotrparen): New state values to parse ESC ( / ) sequences.
89 * fhandler_console.cc (read): Allow combined Alt-AltGr modifiers
90 to also produce an ESC prefix like a plain Alt modifier, e.g. to make
91 Alt-@ work on a keyboard where @ is AltGr-q.
93 2009-12-18 Eric Blake <ebb9@byu.net>
95 * signal.cc (nanosleep): Fix bug in previous patch.
97 2009-12-18 Corinna Vinschen <corinna@vinschen.de>
99 Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcess
100 according to context. Throughout, replace hMainThread with
101 GetCurrentThread/NtCurrentThread according to context.
102 * dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to
103 hMainProc. Drop duplication of GetCurrentThread to hMainThread.
104 * dtable.cc (dtable::stdio_init): Remove useless comment.
105 * globals.cc (hMainProc): Remove.
106 (hMainThread): Remove.
107 * ntdll.h (NtCurrentProcess): Define.
108 (NtCurrentThread: Define.
110 2009-12-18 Corinna Vinschen <corinna@vinschen.de>
112 * fhandler.h (fhandler_registry::value_name): Convert to wchar_t*.
113 * fhandler_registry.cc: Call UNICODE registry functions throughout
114 and convert to multibyte using current locale's charset. Accommodate
116 (must_encode): Take wchar_t.
117 (encode_regname): Convert from wchar_t *.
118 (decode_regname): Convert to wchar_t *.
120 2009-12-18 Corinna Vinschen <corinna@vinschen.de>
122 * path.sgml (func-cygwin-conv-path): Clarify meaning of size parameter.
123 (func-cygwin-conv-path-list): Fix typo.
124 (func-cygwin-posix-path-list-p): Ditto.
126 2009-12-17 Corinna Vinschen <corinna@vinschen.de>
128 * syscalls.cc (try_to_bin): Handle remote shares as well. Just rename
129 files in this case, instead of moving them to the recycler. Create
130 even more unique filename. Add comment to explain filename.
131 (unlink_nt): Remove code returning with EBUSY on remote shares.
132 Set bin_stat to move_to_bin except on NFS. Add comment to explain.
134 2009-12-17 Eric Blake <ebb9@byu.net>
136 * signal.cc (nanosleep): Support 'infinite' sleep times.
137 (sleep): Avoid uninitialized memory.
139 2009-12-16 Thomas Wolff <towo@towo.net>
141 * fhandler_console.cc (read): Detect and handle mouse wheel scrolling
142 events (for completion of mouse reporting mode 1000) and mouse
143 movement events (for additional mouse reporting modes 1002 and 1003).
144 Use mouse_aware() as a guard and only condition for mouse
145 reporting in order to enforce consistence of read() and select().
146 Add focus reports (for additional focus reporting mode 1004).
147 (mouse_aware): Enable detection of additional mouse events for select().
148 Tune function to precisely match actual reporting criteria.
149 Move adjustment of mouse position (by window scroll offset)
150 here to avoid duplicate code.
151 (char_command): Initialization of enhanced mouse reporting modes.
152 Initialization of focus reporting mode.
153 * fhandler.h (use_mouse): Change flag (bool->int) to indicate
154 additional mouse modes. Add flag to indicate focus reporting.
155 (mouse_aware): Move enhanced function into fhandler_console.cc.
156 * select.cc (peek_console): Use modified mouse_aware() for more
157 general detection of mouse events. Also check for focus reports.
159 2009-12-16 Corinna Vinschen <corinna@vinschen.de>
161 * registry.cc (cygnus_class): Remove.
162 (reg_key::build_reg): Don't set class when creating key.
164 2009-12-15 Corinna Vinschen <corinna@vinschen.de>
166 * net.cc (cygwin_setsockopt): Only skip calling setsockopt(SO_REUSEADDR)
167 on stream sockets under systems supporting enhanced socket security.
169 2009-12-15 Thomas Wolff <towo@towo.net>
171 * fhandler_console.cc (char_command): Fix code to select dim mode
172 to 2 rather than 9. Add entries for mode 22 (normal, not bold)
173 28 (visible, not invisible), 25 (not blinking).
175 2009-12-14 Corinna Vinschen <corinna@vinschen.de>
177 * libc/getopt.c (getopt_internal): Set optreset according to optind
178 setting earlier. Reevaluate POSIXLY_CORRECT if optreset is set to !0.
179 Handle a leading '-' in options independently of posixly_correct.
181 2009-12-09 Christopher Faylor <me+cygwin@cgf.cx>
183 * fhandler_fifo.cc (fhandler_fifo::open): Avoid resetting errno after
184 it has been explicitly set.
186 * include/cygwin/version.h: Bump DLL minor version number to 2.
188 2009-12-06 Corinna Vinschen <corinna@vinschen.de>
190 * include/cygwin/version.h: Bump DLL minor version number to 1.
192 2009-12-02 Corinna Vinschen <corinna@vinschen.de>
194 * fhandler_socket.cc (send_internal): Don't split datagram messages
197 * syslog.cc (vsyslog): Set default facility to LOG_USER if it hasn't
200 2009-12-01 Corinna Vinschen <corinna@vinschen.de>
202 * fhandler_registry.cc (fhandler_registry::open): Mark /proc/registry
203 directory and siblings as nohandle fhandler.
205 2009-11-30 Christopher Faylor <me+cygwin@cgf.cx>
207 * speclib: Use last dll found since that's the real name of the cygwin
210 2009-11-27 Corinna Vinschen <corinna@vinschen.de>
212 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix typos in
213 comments. Always open file synchronized when reading header bytes,
214 otherwise suffer stack corruption.
216 2009-11-26 Corinna Vinschen <corinna@vinschen.de>
218 * dtable.cc (dtable::stdio_init): Use GetCurrentProcess() rather than
219 hMainProc as process handle when duplicating the stdout handle.
220 Explain why. Add Win32 error code to debug output.
222 2009-11-23 Corinna Vinschen <corinna@vinschen.de>
224 * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add
225 socket handle value to debug output.
226 (fhandler_socket::fixup_after_fork): Ditto. Make new socket handle
227 OVERLAPPED, just as if it has been created with socket().
228 * net.cc (fdsock): Close duplicated socket and explain why. Disable
229 the entire WSADuplicateSocket test for now and explain why.
231 2009-11-23 Corinna Vinschen <corinna@vinschen.de>
233 * fhandler_socket.cc (fhandler_socket::set_close_on_exec): Only call
234 fhandler_base::set_close_on_exec for inheritable sockets.
236 2009-11-21 Corinna Vinschen <corinna@vinschen.de>
238 * globals.cc (ro_u_dll): New R/O unicode string.
239 * syscalls.cc (nt_path_has_executable_suffix): Add ro_u_dll to
240 blessed_executable_suffixes array. Explain why.
242 2009-11-18 Corinna Vinschen <corinna@vinschen.de>
244 * flock.cc (fhandler_disk_file::lock): Disable a shortcut from the
245 original BSD code, but keep it in and documented why we can't use it.
247 2009-11-18 Corinna Vinschen <corinna@vinschen.de>
249 * ntea.cc (read_ea): Always add length of "user." prefix, not only
250 on Samba. Change comment.
252 2009-11-18 Corinna Vinschen <corinna@vinschen.de>
254 * ntea.cc (read_ea): Try to open file first to have more sensible
255 error codes. Always refuse non "user." EAs for Linux compatibility
256 and return EOPNOTSUPP. Fix handling of empty (== non-existant) EAs.
257 Always prepend "user." prefix to EA names.
258 (write_ea): Try to open file first to have more sensible error codes.
259 Always refuse non "user." EAs for Linux compatibility and return
260 EOPNOTSUPP. Delay skipping "user." prefix until after potential call
263 2009-11-17 Corinna Vinschen <corinna@vinschen.de>
265 Reintegrate socket duplication via WSADuplicateSocket/WSASocket.
266 * autoload.cc (WSADuplicateSocketW): Define.
267 (WSASocketW): Define.
268 * dtable.cc (dtable::release): Call dec_need_fixup_before if necessary.
269 (dtable::fixup_before_fork): New function.
270 (dtable::fixup_before_exec): New function.
271 * dtable.h (class dtable): Add member cnt_need_fixup_before. Add
272 declarations for above new functions.
273 (dtable::dec_need_fixup_before): New inline method.
274 (dtable::inc_need_fixup_before): New inline method.
275 (dtable::need_fixup_before): New inline method.
276 * fhandler.h (fhandler_base::fixup_before_fork_exec): New virtual
278 (fhandler_base::need_fixup_before): New virtual method.
279 (class fhandler_socket): Add member prot_info_ptr.
280 (fhandler_socket::init_fixup_before): Declare.
281 (fhandler_socket::need_fixup_before): New inline method.
282 (fhandler_socket::fixup_before_fork_exec): Declare.
283 (fhandler_socket::fixup_after_exec): Declare.
284 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
285 prot_info_ptr to NULL.
286 (fhandler_socket::~fhandler_socket): Free prot_info_ptr conditionally.
287 (fhandler_socket::init_fixup_before): New method.
288 (fhandler_socket::fixup_before_fork_exec): Ditto.
289 (fhandler_socket::fixup_after_fork): Use WSASocketW to duplicate
291 (fhandler_socket::fixup_after_exec): New method.
292 (fhandler_socket::dup): Use fixup_before_fork_exec/fixup_after_fork
293 to duplicate socket if necessary.
294 * fork.cc (frok::parent): Start child suspended if some fhandler
295 needs fixup before fork. If so, call dtable::fixup_before_fork after
296 CreateProcess and resume child.
297 * net.cc (fdsock): Try to find out if socket needs fixup before and
298 initialize socket accordingly. Add HUGE comment to explain what happens
300 * spawn.cc (spawn_guts): Start child suspended if some fhandler needs
301 fixup before exec. If so, call dtable::fixup_before_exec after
304 2009-11-16 Eric Blake <ebb9@byu.net>
306 * environ.cc (setenv): Detect invalid argument.
307 (unsetenv): Distinguish EFAULT from EINVAL.
309 2009-11-13 Corinna Vinschen <corinna@vinschen.de>
311 * net.cc (fdsock): Fill _rmem and _wmem with valid values returned
312 from getsockopt if setsockopt with desired values failed.
314 2009-11-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
315 Corinna Vinschen <corinna@vinschen.de>
317 * sysconf.cc (get_nprocs): New function.
318 (get_nprocs_conf): Ditto.
319 (get_avphys_pages): Ditto.
320 (get_phys_pages): Ditto.
321 * cygwin.din: Export them.
322 * include/sys/sysinfo.h: New header, decalre above new functions.
323 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
324 * posix.sgml: Mention them as GNU extensions.
326 2009-11-11 Corinna Vinschen <corinna@vinschen.de>
328 * fhandler.h (class fhandler_mailslot): Declare new private method
330 * fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Implement.
331 (fhandler_mailslot::open): Replace calls to path_conv::get_object_attr
332 with calls to fhandler_mailslot::get_object_attr.
334 2009-11-10 Corinna Vinschen <corinna@vinschen.de>
336 * fhandler_console.cc (fhandler_console::read): Revert change from
339 2009-11-10 Corinna Vinschen <corinna@vinschen.de>
341 * fhandler_disk_file.cc (is_volume_mountpoint): Align check with
342 symlink_info::check_reparse_point().
343 * path.cc (symlink_info::check_reparse_point): Rearrange slightly.
344 Add code path for unrecognized repare point types. Add comment.
346 2009-11-09 Corinna Vinschen <corinna@vinschen.de>
348 * path.cc (symlink_info::check_reparse_point): Always check
349 SubstituteName for volume string to recognize volume mount points.
350 Reuse subst when calling sys_wcstombs.
351 * syscalls.cc (rename): Set errno to EBUSY when trying to rename
352 volume mount points. Explain why.
354 2009-11-09 Corinna Vinschen <corinna@vinschen.de>
356 * fhandler_console.cc (fhandler_console::read): Restrict generating
357 META key sequences to singlebyte input chars.
359 2009-11-08 Corinna Vinschen <corinna@vinschen.de>
361 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Drop all "other"
362 permissions from st_mode, if the reading the file's security descriptor
365 2009-11-06 Corinna Vinschen <corinna@vinschen.de>
367 * globals.cc (ro_u_scr): New R/O unicode string.
369 * syscalls.cc (nt_path_has_suffix): Replace with ...
370 (nt_path_has_executable_suffix): New function checking for explicit
372 (rename): Call nt_path_has_executable_suffix instead of
373 nt_path_has_suffix. Check oldpath for nt_path_has_executable_suffix
374 as well to set old_explicit_suffix.
376 2009-11-06 Corinna Vinschen <corinna@vinschen.de>
378 * shared.cc (inst_root_inited): New static bool variable.
379 (init_installation_root): Set inst_root_inited to true.
380 (memory_init): Print installation root debug output only if
381 inst_root_inited is true.
383 2009-11-05 Corinna Vinschen <corinna@vinschen.de>
385 * syscalls.cc (nt_path_has_suffix): New function.
386 (rename): Don't append .exe suffix if binary target name has any suffix
389 2009-11-05 Corinna Vinschen <corinna@vinschen.de>
391 * spawn.cc (dll_suffixes): Disable. Explain why.
392 (perhaps_suffix): Use stat_suffixes instead of dll_suffixes.
394 2009-11-03 Corinna Vinschen <corinna@vinschen.de>
396 * security.cc (alloc_sd): Re-introduce setting the SE_DACL_PROTECTED
397 flag. Remove INHERITED_ACE flag from all inherited ACEs. Add comment.
398 Fix ace_off counter in unrelated ACE loop.
399 * wincap.cc: Re-add has_dacl_protect throughout.
402 2009-11-02 Corinna Vinschen <corinna@vinschen.de>
404 * security.cc (alloc_sd): Re-enable generating default permission
405 entries for directories.
407 2009-11-02 Corinna Vinschen <corinna@vinschen.de>
409 * dlfcn.cc (get_full_path_of_dll): Drop enforcing a .dll suffix.
410 (dlopen): If last path component has no dot, append one to override
411 automatic .dll suffix in LoadLibrary.
413 2009-11-02 Corinna Vinschen <corinna@vinschen.de>
415 * miscfuncs.h (transform_chars): Declare. Define inline variation here.
416 * mount.cc (mount_info::from_fstab): Remove extern declaration of
418 * path.cc (tfx_chars): Move to strfuncs.cc.
419 (transform_chars): Ditto.
420 * strfunc.cc (tfx_chars): Moved here from path.cc.
421 (transform_chars): Ditto.
422 (sys_cp_wcstombs): Make UNICODE private use area conversion roundtrip
423 save for all characters.
424 (sys_cp_mbstowcs): Ditto, by removing special case for UTF-8 sequences
425 representing U+F0xx UNICODE chars. Fix typo in comment.
427 2009-11-02 Corinna Vinschen <corinna@vinschen.de>
429 * path.cc (tfx_chars): Constify.
431 2009-10-31 Corinna Vinschen <corinna@vinschen.de>
433 * cygprops.h: New file.
434 * dtable.cc (handle_to_fn): Add check for correct installation_key
435 string in object name for pipes and ttys.
436 * external.cc (cygwin_internal): Add CW_GET_INSTKEY to allow fetching
437 the installation_key from cygserver.
438 * fhandler_fifo.cc (fhandler_fifo::fifo_name): Add installation_key
440 * globals.cc: Include cygprops.h.
441 (_RDATA): Move slightly and add comment.
442 (cygwin_props): Define.
443 * mount.cc (mount_info::init): Accommodate the fact that
444 installation_root is now a global variable in DLL common shared memory,
445 rather than a member of cygwin_shared.
446 * pipe.cc (fhandler_pipe::create_selectable): Add installation_key to
448 * shared.cc (installation_root): Define here for storage in DLL
449 common shared memory.
450 (installation_key): Ditto.
451 (installation_key_buf): Ditto.
452 (init_installation_root): Convert from shared_info method to ordinary
453 function. Add initializing installation_key. Invalidate
454 installation_key depending of value of disable_key property. Add
456 (get_shared_parent_dir): Add installation_key to directory name.
457 (get_session_parent_dir): Ditto.
458 (shared_info::initialize): Move call to init_installation_root from
460 (memory_init): ...to here. Add debug output to print installation root
461 and installation key. Add comment to explain why.
462 * shared_info.h (SHARED_INFO_CB): Recalculate.
463 (CURR_SHARED_MAGIC): Ditto.
464 (class shared_info): Remove definition of installation_root and
465 declaration of init_installation_root.
466 (init_installation_root): Declare.
467 (installation_root): Declare.
468 (installation_key): Declare.
469 * uinfo.cc (pwdgrp::load): Accommodate the fact that installation_root
470 is now a global variable in DLL common shared memory.
471 * include/cygwin/version.h: Bump API minor number.
472 (CYGWIN_INFO_INSTALLATIONS_NAME): Add.
473 * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_INSTKEY.
475 2009-10-31 Corinna Vinschen <corinna@vinschen.de>
477 * sec_helper.cc (security_descriptor::realloc): Call free first if
478 current security desriptor has been allocated by GetSecurityInfo.
480 2009-10-30 Corinna Vinschen <corinna@vinschen.de>
482 * sec_helper.cc (security_descriptor::free): If sd_size is 0, call
483 LocalFree instead of ::free.
485 * sec_acl.cc: Throughout replace old ACE flag definitions with current
486 definitions as used in MSDN man pages.
487 * security.cc: Ditto.
489 * fhandler.cc (fhandler_base::open): Make sure file has really been
490 just created before fixing file permissions. Add S_JUSTCREATED
491 attribute to set_file_attribute call.
492 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Always create dir
493 with default security descriptor and fix descriptor afterwards.
494 Add S_JUSTCREATED flag to set_file_attribute call.
495 * fhandler_socket.cc (fhandler_socket::bind): Ditto for AF_LOCAL
497 * path.cc (symlink_worker): Ditto for symlinks.
498 * security.cc (get_file_sd): Call GetSecurityInfo rather than
499 NtQuerySecurityObject. Explain why. Change error handling accordingly.
500 (alloc_sd): Skip non-inherited, non-standard entries in ACL if
501 S_JUSTCREATED attribute is set. Explain why. Minor format fixes.
502 * security.h (S_JUSTCREATED): New define.
503 (security_descriptor::operator=): New operator.
505 2009-10-30 Corinna Vinschen <corinna@vinschen.de>
507 * fhandler_random.cc (fhandler_dev_random::lseek): Revert change from
510 2009-10-30 Corinna Vinschen <corinna@vinschen.de>
512 * smallprint.cc (hex_str): New const string.
513 (__rn): Drop str and use hex_str instead.
514 (__small_vsprintf): If 'l' modifier has been found, print subsequent
515 multibyte or wide char string using the s, S, or W options in extended
518 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Print WCHAR
519 and resulting multibyte filename in extended hex value layout in
522 2009-10-26 Charles Wilson <cygwin@cwilson.fastmail.fm>
524 * lib/pseudo-reloc.c (__report_error) [CYGWIN]: Correct size bug
525 regarding error messages.
527 2009-10-25 Charles Wilson <cygwin@cwilson.fastmail.fm>
529 Sync pseudo-reloc.c with mingw64
530 * lib/psuedo-reloc.c: Remove unnecessary includes.
531 Forward declare _pei386_runtime_relocator.
532 Decorate _image_base__ symbol with macro for
533 mingw64 compatibility. Whitespace changes.
534 (__print_reloc_error): Renamed to...
535 (__report_error): This. "Returns" void, and
536 always aborts. Now used on all platforms.
537 (__write_memory): Remove special case error handling
538 for different platforms - always call __report_error.
539 (do_pseudo_reloc): Remove special case error handling
540 for different platforms - always call __report_error.
541 (_pei386_runtime_relocator): Decorate _image_base__
542 symbol with mingw64 compatibility macro.
544 2009-10-24 Corinna Vinschen <corinna@vinschen.de>
546 * fhandler.cc (fhandler_base::open): Remove unused variables sa and sd.
548 2009-10-23 Corinna Vinschen <corinna@vinschen.de>
550 * fhandler.cc (fhandler_base::open): Always create file with default
551 security descriptor and fix descriptor afterwards. Change comment to
553 * security.cc (alloc_sd): Drop setting the SE_DACL_PROTECTED flag.
554 * wincap.cc: Remove has_dacl_protect throughout.
557 2009-10-23 Corinna Vinschen <corinna@vinschen.de>
559 * fhandler_random.cc (fhandler_dev_random::lseek): Allow negative
560 dummy file positions as on Linux.
562 2009-10-20 Corinna Vinschen <corinna@vinschen.de>
564 * registry.cc (reg_key::get_int): Add alternative implementation
565 taking WCHAR strings.
566 (reg_key::set_int): Ditto.
567 (reg_key::get_string): Ditto.
568 (reg_key::set_string): Ditto.
569 * registry.h (struct reg_key): Add prototypes for added methods.
571 2009-10-20 Corinna Vinschen <corinna@vinschen.de>
573 * smallprint.cc (__small_vsprintf): Simplify UNICODE string handling
574 and allow empty strings.
576 2009-10-20 Corinna Vinschen <corinna@vinschen.de>
578 * fhandler_disk_file.cc (fhander_disk_file::readdir): Handle a status
579 code STATUS_NOT_SUPPORTED. Add matching comment.
581 2009-10-19 Corinna Vinschen <corinna@vinschen.de>
583 * syscalls.cc (internal_setlocale): Only convert $PATH if there is a
586 2009-10-19 Corinna Vinschen <corinna@vinschen.de>
588 * spawn.cc (av::fixup): Treat non-readable, but executable files as
591 2009-10-18 Corinna Vinschen <corinna@vinschen.de>
593 * uinfo.cc (uinfo_init): Deimpersonate, don't reimpersonate, if
594 not in a setuid condition.
596 2009-10-13 Eric Blake <ebb9@byu.net>
598 * external.cc (cygwin_internal): Use va_end.
599 * fork.cc (child_copy): Likewise.
600 * libc/bsdlib.cc (warn, warnx, err, errx): Likewise.
601 * pinfo.cc (commune_request): Likewise.
602 * strace.cc (strace::prntf, strace_printf): Likewise.
604 2009-10-13 Corinna Vinschen <corinna@vinschen.de>
606 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
608 2009-10-13 Christian Franke <franke@computer.org>
609 Corinna Vinschen <corinna@vinschen.de>
611 * include/sys/cygwin.h: Add new cygwin_getinfo_type
612 CW_SET_EXTERNAL_TOKEN.
613 Add new enum CW_TOKEN_IMPERSONATION, CW_TOKEN_RESTRICTED.
614 * cygheap.h (cyguser): New flags ext_token_is_restricted,
615 curr_token_is_restricted and setuid_to_restricted.
616 * external.cc (cygwin_internal): Add CW_SET_EXTERNAL_TOKEN.
617 * sec_auth.cc (set_imp_token): New function.
618 (cygwin_set_impersonation_token): Call set_imp_token ().
619 * security.h (set_imp_token): New prototype.
620 * spawn.cc (spawn_guts): Use CreateProcessAsUserW if restricted token
621 was enabled by setuid(). Do not create new window station in this case.
622 * syscalls.cc (seteuid32): Add handling of restricted external tokens.
623 Set HANDLE_FLAG_INHERIT for primary token.
624 (setuid32): Set setuid_to_restricted flag.
625 * uinfo.cc (uinfo_init): Do not reimpersonate if restricted token was
626 enabled by setuid (). Initialize user.*_restricted flags.
628 2009-10-13 Eric Blake <ebb9@byu.net>
630 * hires.h (hires_ms): Change initime_us to initime_ns, with 10x
632 (hires_ms::nsecs): New prototype.
633 (hires_ms::usecs, hires_ms::msecs, hires_ms::uptime): Adjust.
634 * times.cc (systime_ns): New helper function.
635 (hires_ms::prime): Use it for more resolution.
636 (hires_ms::usecs): Change to...
637 (hires_ms::nsecs): ...with more resolution.
638 (clock_gettime): Use more resolution.
639 (systime): Rewrite in terms of systime_ns.
640 (timespec_to_filetime): Rewrite math to reflect true operation.
641 * fhandler_disk_file.cc (utimens_fs): Use higher resolution.
643 2009-10-12 Corinna Vinschen <corinna@vinschen.de>
645 * external.cc (cygwin_internal): Return 0 in CW_SET_DOS_FILE_WARNING
646 and CW_SETERRNO cases.
648 2009-10-12 Corinna Vinschen <corinna@vinschen.de>
650 * fhandler_disk_file.cc (fhandler_disk_file::link): Only append .lnk
651 if the original device had one, too. Add comment.
653 * fhandler_socket.cc (fhandler_socket::fstat): Always return a size of
656 2009-10-09 Corinna Vinschen <corinna@vinschen.de>
658 * path.cc (tfx_chars): Convert all ASCII control characters except
659 ASCII NUL as well. Change layout to make the conversions more clear.
662 2009-10-09 Corinna Vinschen <corinna@vinschen.de>
664 * include/cygwin/config.h (DEFAULT_LOCALE): Define as "C.UTF-8".
666 2009-10-08 Christopher Faylor <me+cygwin@cgf.cx>
668 * exceptions.cc (_cygtls::signal_exit): There's no need to set
669 signal_arrived if we're exiting.
671 2009-10-08 Eric Blake <ebb9@byu.net>
673 * fhandler_disk_file.cc (utimens_fs): Plug fd leak on EINVAL.
675 2009-10-07 Charles Wilson <cygwin@cwilson.fastmail.fm>
677 Additional pseudo-reloc-v2 support
678 * ntdll.h: Add custom NTSTATUS value for pseudo-reloc
679 errors STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION.
680 * pinfo.cc (status_exit): Map custom pseudo-reloc
681 error value STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION to 127.
682 * sigproc.cc (child_info::proc_retry): Return exit code when
683 STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION.
685 Cygwin modifications to pseudo-reloc.c
686 * lib/pseudo-reloc.c: Added comments throughout and various
687 whitespace fixes. Exploit cygwin_internal(CW_EXIT_PROCESS,...)
688 for fatal error handling that is consistent with cygwin process
689 life-cycle. Ensure state variable (in _pei386_runtime_relocator)
690 is unique to each address space, across fork().
691 (__print_reloc_error): New function for reporting errors in a
692 manner supported by cygwin at this early stage of the process
694 (_pei386_runtime_relocator): Ensure relocations performed
695 only once for each address space, but are repeated after fork()
696 in the new address space.
697 only once for each address space (e.g. across fork()).
698 (__write_memory) [MINGW]: Ensure that b is always initialized
699 by call to VirtualQuery, even if -DNDEBUG.
701 * lib/pseudo-reloc.c: Import new implementation to support
702 v2 pseudo-relocs implemented by Kai Tietz from mingw.
704 2009-10-07 Corinna Vinschen <corinna@vinschen.de>
706 * syscalls.cc (seteuid32): Call set_cygwin_privileges on primary token
709 2009-10-07 Corinna Vinschen <corinna@vinschen.de>
711 * fhandler.h (fhandler_pty_master::tcgetpgrp): Declare.
712 * fhandler_termios.cc (fhandler_termios::tcgetpgrp): Only return
713 valid pgid if tty is controlling tty. Set errno to ENOTTY and
715 (fhandler_pty_master::tcgetpgrp): New function. Return 0 for
716 master side of pty if it's not the controlling tty of the process.
718 2009-10-05 Charles Wilson <cygwin@cwilson.fastmail.fm>
720 Add cygwin wrapper for ExitProcess and TerminateProcess.
721 * include/sys/cygwin.h: Declare new cygwin_getinfo_type
723 * external.cc (exit_process): New function.
724 (cygwin_internal): Handle CW_EXIT_PROCESS.
725 * pinfo.h (pinfo::set_exit_code): New method.
726 * pinfo.cc (pinfo::set_exit_code): New, refactored from...
727 (pinfo::maybe_set_exit_code_from_windows): here. Call it.
728 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR
729 to 215 to reflect the above change.
731 2009-10-05 Charles Wilson <cygwin@cwilson.fastmail.fm>
733 * exceptions.cc: Move global variable sigExeced...
735 * pinfo.cc (pinfo::maybe_set_exit_code_from_windows): Remove now
736 unneeded declaration.
738 2009-10-04 Dave Korn <dave.korn.cygwin@gmail.com>
740 * Makefile.in (CFLAGS): Add -mno-use-libstdc-wrappers.
742 2009-10-04 Corinna Vinschen <corinna@vinschen.de>
744 * syscalls.cc (internal_setlocale): Add comment.
746 2009-10-02 Corinna Vinschen <corinna@vinschen.de>
748 * dcrt0.cc (dll_crt0_1): Drop calls to setlocale/_setlocale_r. Just
749 call initial_setlocale from here.
750 * syscalls.cc (initial_setlocale): Set internal charset and revert
751 application locale to "C".
752 (setlocale): Don't set Cygwin's internal charset here.
754 2009-10-02 Christopher Faylor <me+cygwin@cgf.cx>
756 * dcrt0.cc (dll_crt0_1): Move cxx_malloc reset kluge from here.
757 (check_sanity_and_sync): to here.
759 2009-09-30 Christopher Faylor <me+cygwin@cgf.cx>
761 * path.cc (has_dot_last_component): Rewrite to detect some corner cases
762 that were previously uncaught.
764 2009-09-30 Corinna Vinschen <corinna@vinschen.de>
766 * fhandler_console.cc (beep): Move up to avoid forward declaration.
767 (fhandler_console::read): Just beep on characters invalid in current
768 charset. Add comment.
770 2009-09-29 Eric Blake <ebb9@byu.net>
772 * syscalls.cc (rename): Fix regression in rename("dir","d/").
774 2009-09-29 Corinna Vinschen <corinna@vinschen.de>
776 * fhandler_socket.cc (fhandler_socket::recv_internal): Always call
777 WSARecv on SOCK_STREAM sockets.
779 2009-09-28 Corinna Vinschen <corinna@vinschen.de>
781 * fhandler.h (class dev_console): Constify charset parameter of
783 * fhandler_console.cc (dev_console::con_to_str): Simplify. Always
784 default to the current internal locale.
785 (dev_console::get_console_cp): Always use codepage 437 for alternate
787 (dev_console::str_to_con): Constify charset parameter.
788 (fhandler_console::write_normal): Always use codepage 437 for alternate
789 charset. Otherwise always default to the current internal locale.
790 Replace ASCII SO with ASCII CAN.
791 * strfuncs.cc: Tweak comments according to below changes.
792 (sys_cp_wcstombs): Constify charset parameter. Convert all wchar_t
793 values in the Unicode private use area U+F0xx to the singlebyte
794 counterpart. Drop special handling creating ASCII SO sequence from
795 U+DCxx value. Rearrange for performance. Replace ASCII SO with
797 (sys_cp_mbstowcs): Constify charset parameter. Replace ASCII SO with
798 ASCII CAN. Drop special case for U+DCxx ASCII SO sequences. Always
799 create a replacement from the Unicode private use area U+F0xx for
800 invalid byte values in a multibyte sequence. Do the same for wchar_t
801 values from the U+F0xx range to make them roundtrip safe.
802 * wchar.h (sys_cp_wcstombs): Constify charset parameter.
803 (sys_cp_mbstowcs): Ditto.
805 2009-09-28 Corinna Vinschen <corinna@vinschen.de>
807 * cygheap.cc (cygheap_init): Default locale.charset to "UTF-8".
808 * dcrt0.cc (dll_crt0_1): Call setlocale (LC_CTYPE, "") here, just
809 before resetting application locale to "C".
810 * environ.cc (environ_init): Drop code setting locale here.
811 * syscalls.cc (check_codepage): Break out check for required codepage
812 from internal_setlocale.
813 (internal_setlocale): Just convert CWD and $PATH from old charset to
814 new charset and set internal charset.
815 (setlocale): Change accordingly. Don't require LC_ALL or LC_CTYPE to
816 store old locale value. Always call internal_setlocale if charset
817 changed due to locale environment changes.
819 2009-09-26 Eric Blake <ebb9@byu.net>
821 * exec.cc (fexecve): New function.
822 * cygwin.din (execvpe, fexecve): Export new fexecve and existing
824 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
825 * posix.sgml: Mention them.
827 2009-09-26 Eric Blake <ebb9@byu.net>
829 * syscalls.cc (link): Delete obsolete comment. Reject directories
830 and missing source up front.
831 (rename): Use correct errno for trailing '.'. Detect empty
832 strings. Allow trailing slash to newpath iff oldpath is
834 * dir.cc (mkdir): Reject dangling symlink with trailing slash.
835 * fhandler_disk_file.cc (fhandler_disk_file::link): Reject
837 * fhandler.cc (fhandler_base::link): Match Linux errno.
839 2009-09-25 Eric Blake <ebb9@byu.net>
841 * syscalls.cc (fchmodat): lchmod is not yet implemented.
842 (euidaccess): New function.
843 * path.cc (realpath): Update comment.
844 (canonicalize_file_name): New function.
845 * include/cygwin/stdlib.h (canonicalize_file_name): Declare it.
846 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
847 * cygwin.din: Export canonicalize_file_name, eaccess, euidaccess.
848 * posix.sgml: Mention them.
850 2009-09-25 Eric Blake <ebb9@byu.net>
852 * fhandler.h (fhandler_base::fhaccess): Add parameter.
853 * security.h (check_file_access, check_registry_access): Likewise.
854 * security.cc (check_file_access, check_registry_access)
855 (check_access): Implement new parameter.
856 * fhandler.cc (fhandler_base::fhaccess): Likewise.
857 (device_access_denied): Update caller.
858 * syscalls.cc (access, faccessat): Update callers.
859 * spawn.cc (find_exec, fixup): Likewise.
861 2009-09-24 Corinna Vinschen <corinna@vinschen.de>
863 * posix_ipc.cc (mq_open): Avoid closing the same descriptor twice in
867 2009-09-24 Corinna Vinschen <corinna@vinschen.de>
869 * kernel32.cc (CreateMutexW): Use correct access mask.
870 (CreateSemaphoreW): Ditto.
872 2009-09-23 Corinna Vinschen <corinna@vinschen.de>
874 * strfuncs.cc (__set_charset_from_codepage): Fetch current ANSI
877 2009-09-23 Corinna Vinschen <corinna@vinschen.de>
879 * strfuncs.cc (sys_cp_wcstombs): Convert lone surrogate pair
880 second halves to unambiguous ASCII SO sequence. When converting
881 chars invalid in current codepage to ASCII SO sequence, make
882 sure to check for surrogate pair second half only if at least
883 one wide characters is left. Decrement nwc if valid second half has
885 (sys_cp_mbstowcs): Improve ASCII SO handling. Never break from loop
886 if invalid character has been found. Recognize ASCII SO sequence
887 representing originally invalid mulitbyte char converted into a
888 lone surrogate pair second half. Convert accordingly.
890 2009-09-22 Corinna Vinschen <corinna@vinschen.de>
892 * autoload.cc (WSARecv): Define.
893 * fhandler_socket.cc (fhandler_socket::recv_internal): Call WSARecv
894 instead of WSARecvFrom if no name parameter is given. Explain why.
896 2009-09-22 Eric Blake <ebb9@byu.net>
898 * syscalls.cc (faccessat): Fix typo, reject bad flags.
899 (fchmodat, fchownat, fstatat, utimensat, linkat, unlinkat): Reject
902 2009-09-22 Corinna Vinschen <corinna@vinschen.de>
904 * strfuncs.cc (sys_cp_mbstowcs): Reset shift state after handling
905 invalid multibyte sequence.
907 2009-09-22 Corinna Vinschen <corinna@vinschen.de>
909 * path.cc (symlink_worker): Rework error handling to generate Linux
910 compatible errno in case of trailing slash in newpath.
912 2009-09-22 Eric Blake <ebb9@byu.net>
914 * dtable.h (OPEN_MAX_MAX): New macro.
915 * resource.cc (getrlimit) [RLIMIT_NOFILE]: Use it.
916 * dtable.cc (dtable::extend): Likewise.
917 * fcntl.cc (fcntl64): Obey POSIX rule with too-large F_DUPFD.
918 * syscalls.cc (dup2): Likewise.
920 2009-09-21 Corinna Vinschen <corinna@vinschen.de>
922 * cygheap.h (cwdstuff::get_posix): Convert to const inline method just
923 returning pointer to posix path.
924 (cwdstuff::reset_posix): Convert to non-inline method taking a wchar_t
926 * path.cc (cwdstuff::set): Revert change from 2009-05-13. Set posix
927 to valid incoming path again.
928 (cwdstuff::reset_posix): New implementation setting posix path from
929 incoming wchar_t path. Explain usage.
930 (cwdstuff::get_posix): Drop implementation.
931 (cwdstuff::get): Drop special case to handle empty posix path.
932 * syscalls.cc (internal_setlocale): Store old posix cwd as wide char
933 path. Restore posix cwd using new charset. Explain why.
935 2009-09-21 Corinna Vinschen <corinna@vinschen.de>
937 * fhandler_disk_file.cc (fhandler_disk_file::link): Drop faking hardlink
938 creation on filesystems not supporting hardlinks.
940 2009-09-20 Christopher Faylor <me+cygwin@cgf.cx>
942 * dcrt0.cc (dll_crt0_1): Add another hack to REALLY make sure that
943 cxx_malloc is always set to the cygwin version.
945 2009-09-20 Christopher Faylor <me+cygwin@cgf.cx>
947 * external.cc (cygwin_internal): Add hack to always reset cxx_malloc to
950 * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Relocate wayward
953 2009-09-19 Christopher Faylor <me+cygwin@cgf.cx>
955 * exceptions.cc (sigpacket::process): Explicitly set thread-specific
956 handler function to zero to avoid transferring to incorrect location.
957 (_cygtls::call_signal_handler): Don't transfer to handler if there is
958 no handler to transfer to.
960 2009-09-18 Christopher Faylor <me+cygwin@cgf.cx>
962 * exceptions.cc (sigpacket::process): Give sigwait() processing
963 precedence even when a handler is present.
965 * syscalls.cc (getpagesize): Change return to 'int'.
967 2009-09-16 Christopher Faylor <me+cygwin@cgf.cx>
969 * ntea.c (write_ea): Don't abort if not-samba.
971 2009-09-01 Christopher Faylor <me+cygwin@cgf.cx>
973 * select.cc (peek_console): Always check window size when there is ANY
976 2009-08-26 Corinna Vinschen <corinna@vinschen.de>
978 * path.h (INTERIX_SYMLINK_COOKIE): Define.
979 * path.cc (symlink_info::check_sysfile): Read Interix symlinks as well.
981 2009-08-26 Corinna Vinschen <corinna@vinschen.de>
983 * fhandler.cc (fhandler_base::open): Only set R/O attribute if ACLs
986 2009-08-24 Corinna Vinschen <corinna@vinschen.de>
988 * mount.cc (fs_info::update): Add comment.
989 * path.cc (symlink_info::check_reparse_point): Return -1 for volume
990 mount points. Explain why.
991 (symlink_info::check): Call fs.update again for volume mount points.
994 2009-08-24 Corinna Vinschen <corinna@vinschen.de>
996 * globals.cc (ro_u_volume): New R/O unicode string.
997 * path.cc (symlink_info::check_reparse_point): Fix check for volume
998 mount points to work on Vista and later as well.
1000 2009-08-22 Corinna Vinschen <corinna@vinschen.de>
1002 * strfuncs.cc (__set_charset_from_codepage): Add codepages 20866
1003 (KOI8-R) and 21866 (KOI8-U).
1005 2009-08-21 Christopher Faylor <me+cygwin@cgf.cx>
1007 * dll_init.h (has_dtors): New flag.
1008 (run_dtors): New wrapper function which avoids calling dtors more than
1010 * dll_init.cc (dll_global_dtors): Use dll.run_dtors wrapper.
1011 (dll_list::detach): Ditto.
1012 (dll_list::alloc): Set has_dtors flag.
1014 2009-08-21 Christopher Faylor <me+cygwin@cgf.cx>
1016 * fcntl.cc (fcntl64): Detect negative fd as error.
1018 2009-08-21 Corinna Vinschen <corinna@vinschen.de>
1020 * mmap.cc (mmap64): Allocate fh_disk_file on cygheap. Delete
1021 explicitely before returning.
1023 2009-08-20 Corinna Vinschen <corinna@vinschen.de>
1025 * dtable.cc (build_fh_dev): Take additional bool parameter indicating
1026 whether set_name should be called or not.
1027 (dtable::dup_worker): Call build_fh_pc with new second parameter set
1028 to false. Explain why. If fhandler's dup failed, delete rather than
1029 cfree newfh and set newfh to NULL to indicate failure correctly.
1030 * dtable.h (build_fh_pc): Change declaration according to above change.
1031 Default set_name parameter to true.
1032 * mmap.cc (mmap_record::free_fh): Delete rather than cfree fh.
1034 2009-08-18 Christopher Faylor <me+cygwin@cgf.cx>
1036 * dtable.cc (dtable::fixup_after_exec): Close any popen'ed file handles here.
1037 * fhandler.h (fhandler_*::ispipe): New function.
1038 (fhandler_base::get_popen_pid): Define virtual function.
1039 (fhandler_*::isdevice): Make const.
1040 (fhandler_*::isfifo): Ditto.
1042 2009-08-17 Christopher Faylor <me+cygwin@cgf.cx>
1044 * syscalls.cc (popen): Reorganize slightly for clarity. Fix a comment.
1046 2009-08-17 Christopher Faylor <me+cygwin@cgf.cx>
1048 * syscalls.cc (popen): Rewrite to accommodate situations where stdin,
1049 stdout, or stderr are closed.
1051 2009-08-17 Christopher Faylor <me+cygwin@cgf.cx>
1053 * pipe.cc (fhandler_pipe::create_selectable): Add -pipe to default pipe names.
1055 * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Use bool/true/false
1056 for what is actually a boolean variable.
1058 2009-08-14 Corinna Vinschen <corinna@vinschen.de>
1060 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix length
1063 2009-08-14 Corinna Vinschen <corinna@vinschen.de>
1065 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Change comment
1068 2009-08-14 Corinna Vinschen <corinna@vinschen.de>
1070 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Remove
1071 ill-advised attempt to optimize "." and ".." handling by checking for
1072 specific position in directory listing. Explain why.
1073 (fhandler_disk_file.cc (fhandler_disk_file::readdir): Ditto.
1074 Special-case opening file on NFS to fetch inode number and add longish
1075 comment to explain why.
1077 2009-08-14 Corinna Vinschen <corinna@vinschen.de>
1079 * (fhandler_socket::getsockname): Fix length returned for unbound
1081 (fhandler_socket::getpeername): Ditto.
1082 * net.cc (socketpair): Don't set sun_path and peer_sun_path to
1083 make sure getsockname and getpeername return the correct values
1084 for AF_LOCAL sockets.
1086 2009-08-13 Corinna Vinschen <corinna@vinschen.de>
1088 * fhandler_socket.cc (fhandler_socket::accept): Use sizeof rather
1089 then constant size. Truncate returned data, but return full address
1090 length as per POSIX.
1091 (fhandler_socket::getsockname): Truncate returned data, but return full
1092 address length as per POSIX.
1093 (fhandler_socket::getpeername): Ditto.
1095 2009-08-13 Corinna Vinschen <corinna@vinschen.de>
1097 * fhandler.h (class fhandler_socket): Add peer_sun_path member.
1098 (fhandler_socket::set_peer_sun_path): New method.
1099 (fhandler_socket::get_peer_sun_path): New method.
1100 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
1101 peer_sun_path to NULL.
1102 (fhandler_socket::~fhandler_socket): Free peer_sun_path if necessary.
1103 (fhandler_socket::dup): Duplicate peer_sun_path.
1104 (fhandler_socket::accept): Ditto. Return fake unbound peer content
1105 and len in case of AF_LOCAL sockets.
1106 (fhandler_socket::getsockname): Always use local sockaddr_storage to
1107 store socket address and copy over to incoming address. Handle every
1108 namelen correctly per POSIX.
1109 (fhandler_socket::getpeername): Ditto. Add code path to return
1110 correct value for AF_LOCAL sockets.
1111 (fhandler_socket::set_peer_sun_path): New method.
1112 * net.cc (socketpair): Set peer_sun_path to empty string, just like
1115 2009-08-13 Corinna Vinschen <corinna@vinschen.de>
1116 Dave Korn <dave.korn.cygwin@googlemail.com>
1118 * cxx.cc (default_cygwin_cxx_malloc): Enhance commenting.
1119 * dll_init.cc (dll_dllcrt0_1): Likewise.
1120 * dlfcn.cc (dlopen): Prevent dlopen()'d DLL from installing any
1121 cxx malloc overrides.
1122 * include/cygwin/cygwin_dll.h (__dynamically_loaded): New variable.
1123 * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Check it and only
1124 install cxx malloc overrides when statically loaded. Extend comments.
1126 2009-08-12 Corinna Vinschen <corinna@vinschen.de>
1128 * fhandler_socket.cc (fhandler_socket::accept): Always use local
1129 sockaddr_storage to store peer address and copy over to incoming
1130 peer address if available. Truncate data as necessary according
1133 2009-08-11 Corinna Vinschen <corinna@vinschen.de>
1135 * include/limits.h (NGROUPS_MAX): Set to a more sane value.
1136 * include/sys/param.h (NGROUPS): Ditto.
1138 2009-08-10 Corinna Vinschen <corinna@vinschen.de>
1140 * spawn.cc (av::fixup): Check shell scripts for executability only on
1141 filesystems/mounts supporting real permissions.
1143 2009-08-10 Corinna Vinschen <corinna@vinschen.de>
1145 * dtable.cc (DEV_SOCKET): New static WCHAR string. Name of
1146 the native NT socket device.
1147 (dtable::init_std_file_from_handle): Remove unused tmp_pathbuf
1148 variable. Move check for sockets into FILE_TYPE_PIPE clause.
1149 Rely on handle_to_fn having recognized socket, or check if
1150 getsockopt works to accommodate NT4 shortcoming.
1151 (handle_to_fn): Use tmp_pathbuf for OBJECT_NAME_INFORMATION
1152 buffer and simplify code due to that. Check name returned by
1153 NtQueryObject for socket device.
1155 2009-08-10 Christopher Faylor <me+cygwin@cgf.cx>
1157 * fhandler_console.cc (create_invisible_console_workaround): Fix size
1158 of cmd in the way originally intended.
1160 2009-08-10 Corinna Vinschen <corinna@vinschen.de>
1162 * fhandler_console.cc (create_invisible_console_workaround): Fix
1163 size of cmd to take spaces into account.
1165 2009-08-08 Corinna Vinschen <corinna@vinschen.de>
1167 * dtable.cc (dtable::init_std_file_from_handle): Fix comment to
1168 document change in the Windows 7 workaround.
1169 * wincap.cc (wincapc::init): Don't set has_console_handle_problem
1170 to false on 32 bit systems.
1172 2009-08-06 Corinna Vinschen <corinna@vinschen.de>
1174 * net.cc (cygwin_getnameinfo): Force setting NI_NUMERICSERV only
1175 on Windows 2003 and earlier, only if the port number doesn't
1176 resolve to a well-known service. Change comment accordingly.
1178 2009-08-05 Christopher Faylor <me+cygwin@cgf.cx>
1180 * cygheap.h (cygheap_debug::endh): Delete.
1181 * debug.cc (lock_debug::acquired): Delete.
1182 (lock_debug::lock_debug): Simplify.
1183 (lock_debug::unlock): Ditto.
1184 (find_handle): Don't set endh here.
1185 (add_handle): Add new handle to beginning of the list rather than
1186 trying to maintain an end list pointer.
1187 (delete_handle): Minor optimization.
1188 (mark_closed): Make logic clearer.
1189 (verify_handle): Lock handle list before scanning.
1191 (modify_handle): Ditto.
1192 (newh): Don't lock handle list here. Assume caller did this.
1193 (mark_closed): Ditto.
1194 (close_handle): Remove unneeded #if.
1195 * dtable.cc (dtable::dup2): Tweak debug output.
1197 2009-08-04 Christopher Faylor <me+cygwin@cgf.cx>
1199 * path.cc (patch_conv::check): Zero path before setting it.
1201 2009-08-04 Christopher Faylor <me+cygwin@cgf.cx>
1203 * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem
1204 size if the length exceeds it.
1205 * net.cc (fdsock): Use 65535 as window size, just like the comment
1206 says or we run into problems with DuplicateHandle.
1208 * path.cc (patch_conv::check): Use set_path to set invalid filename.
1209 * path.h (path_conv::path_conv): Ditto.
1211 2009-08-04 Christopher Faylor <me+cygwin@cgf.cx>
1213 * fhandler.h (pdrive_buf): Defensively allocate one extra byte.
1215 2009-08-04 Christopher Faylor <me+cygwin@cgf.cx>
1217 * fhandler.h (fhandler_cygdrive:DRVSZ): New enum.
1218 (pdrive_buf): New place to hold information about cygdrive.
1219 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Store drive
1220 info in pdrive_buf since get_win32_name() could now be too small to
1222 (fhandler_cygdrive::rewinddir): Reset pdrive to pdrive_buf.
1223 (fhandler_cygdrive::closedir): Ditto.
1224 * pipe.cc (fhandler_pipe::init): Be more defensive when referencing
1225 get_win32_name(). Rework logic which made a copy of the POSIX path and
1228 2009-08-02 Christopher Faylor <me+cygwin@cgf.cx>
1230 * sigproc.cc (stopped_or_terminated): Don't return a match when stopsig
1231 == SIGCONT and not WCONTINUED.
1232 * termios.cc (tcsetpgrp): Improve debugging output.
1234 2009-08-01 Christopher Faylor <me+cygwin@cgf.cx>
1236 * cygheap_malloc.h: New file.
1237 * cygheap.h: Remove stuff now included in cygheap_malloc.h and include
1238 that file. Make cygheap_init a standard c++ function. Remove unneeded
1239 child_info declaration.
1240 * path.h: Include cygheap_malloc.h. Remove extra cstrdup declaration.
1241 (path_conv): Reorganize to group variables together.
1242 (path_conv::path): Make const char *.
1243 (path_conv::known_suffix): Ditto.
1244 (path_conv::normalized_path): Ditto.
1245 (path_conv::path_conv): Reorganize initializers to reflect new element
1247 (path_conv::get_win32): Change return value to const char *.
1248 (path_conv::set_path): Move back here from spawn.cc.
1249 (parh_conv::modifiable_path): New function.
1250 * path.cc (path_conv::add_ext_from_sym): Accommodate const'ness of
1252 (path_conv::set_normalized_path): Ditto for normalized_path.
1253 (path_conv::check): Use modifiable_path whereever we need to modify the
1254 path element. Use set_path to set the path.
1255 (path_conv::~path_conv): Accommodate new const'ness.
1256 * spawn.cc (perhaps_suffix): Declare ext as const since that's what is
1258 (path_conv::set_path): Move back to path.h.
1259 * winf.f (linebuf): Perform minor cleanup.
1260 (linebuf::fromargv): Change second parameter to const.
1261 * winf.cc (linebuf::fromargv): Ditto.
1263 2009-08-01 Christopher Faylor <me+cygwin@cgf.cx>
1265 * path.h (path_conv::set_path): Change return value.
1266 * spawn.cc (path_conv::set_path): Return newly set value.
1267 (find_exec): Set retval to newly set value when calling set_path.
1269 2009-07-31 Christopher Faylor <me+cygwin@cgf.cx>
1271 * spawn.cc (find_exec): Fix one more path where retval was not set.
1273 2009-07-31 Christopher Faylor <me+cygwin@cgf.cx>
1275 * spawn.cc (find_exec): Stop relying on the ability to set retval to a
1276 fixed path_conv buffer and set it on the fly instead.
1278 2009-07-30 Corinna Vinschen <corinna@vinschen.de>
1280 * path.h (cstrdup): Fix declaration.
1282 2009-07-29 Dave Korn <dave.korn.cygwin@googlemail.com>
1284 * globals.cc (enum exit_states::ES_GLOBAL_DTORS): Delete.
1285 * dcrt0.cc (__main): Schedule dll_global_dtors to run
1286 atexit before global dtors.
1287 (do_exit): Delete test for ES_GLOBAL_DTORS and call to
1290 2009-07-29 Corinna Vinschen <corinna@vinschen.de>
1292 * path.h (class path_conv): Convert path from char array to char *.
1293 Initialize to NULL in constructors. Drop normalized_path_size member.
1294 (path_conv::size): Remove.
1295 (path_conv::operator =): Always copy with sizeof path_conv. Always
1296 duplicate path on cygheap.
1297 (path_conv::set_path): Move implementation to spawn.cc.
1298 * path.cc (path_conv::set_normalized_path): Always allocate
1299 normalized_path on cygheap.
1300 (path_conv::check): Don't work on path, rather allocate THIS_path in
1301 TLS and use it throughout. When finished, allocate path on cygheap
1302 and copy over. Defer tacking on extension after having copied path.
1303 * spawn.cc (path_conv::set_path): Implement here.
1305 2009-07-27 Corinna Vinschen <corinna@vinschen.de>
1307 * mount.h (enum fs_info_type): New type.
1308 (IMPLEMENT_FS_FLAG): New define.
1309 (class fs_info): Convert filesystem type status flags into an enum
1310 fs_info_type. Add cifs FS. Revert change to has_buggy_open and
1311 has_buggy_fileid_dirinfo. Make them normal; status flags again.
1312 Implement is_FS functions using IMPLEMENT_FS_FLAG.
1313 * mount.cc (fs_info::update): Define MINIMAL_WIN_NTFS_FLAGS and
1314 FS_IS_WINDOWS_NTFS. Add comment. Only test remote filesystems
1315 for "NTFS" once. Add is_cifs check using FS_IS_WINDOWS_NTFS.
1316 Set has_buggy_open flag for SUNWNFS. Set has_buggy_fileid_dirinfo
1317 flag for UNIXFS and all cifs type filesystems. Only check for
1318 caseinsensitivity once.
1319 (fillout_mntent): Create locale fs_names array. Use for setting
1320 _my_tls.locals.mnt_type.
1322 2009-07-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1324 * posix.sgml (std-notes): Remove obsolete reference to CYGWIN=server.
1326 2009-07-25 Corinna Vinschen <corinna@vinschen.de>
1328 * posix.sgml (std-notes): Add flock restriction.
1330 2009-07-25 Corinna Vinschen <corinna@vinschen.de>
1332 * fhandler_console.cc (set_console_title): Set buffer size to
1333 TITLESIZE + 1. Call sys_mbstowcs with correct destination length.
1335 2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
1337 * sigproc.h (wait_for_sigthread): Eliminate parameter.
1338 * sigproc.cc (wait_for_sigthread): Ditto. Don't synchronize with
1339 wait_sig after receiving an event that it is ready to go.
1340 (init_sig_pipe): New function.
1341 (wait_sig): Call init_sig_pipe to create pipes for communicating
1342 signals to this process. Don't send sigCONT signal when initializing.
1343 * fork.cc (frok::child): Accommodate wait_for_sigpipe parameter change.
1345 2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
1347 * fhandler.h (fhandler_*::write): Make ssize_t/__stdcall.
1348 (fhandler_*::write_overlapped): Ditto.
1349 (fhandler_*::raw_write): Ditto.
1350 (fhandler_*::readv): Ditto.
1351 (fhandler_*::writev): Ditto.
1352 (fhandler_*::raw_read): Make __stdcall.
1353 * fhandler: Accommodate changes to read/write functions throughout.
1354 * fhandler_clipboard.cc: Ditto.
1355 * fhandler_console.cc: Ditto.
1356 * fhandler_dsp.cc: Ditto.
1357 * fhandler_fifo.cc: Ditto.
1358 * fhandler_mailslot.cc: Ditto.
1359 * fhandler_mem.cc: Ditto.
1360 * fhandler_mem.cc: Ditto.
1361 * fhandler_random.cc: Ditto.
1362 * fhandler_tape.cc: Ditto.
1363 * fhandler_tty.cc: Ditto.
1364 * fhandler_virtual.cc: Ditto.
1365 * fhandler_windows.cc: Ditto.
1366 * fhandler_zero.cc: Ditto.
1367 * syscalls.cc (readv): Use ssize_t as temp variable.
1369 * fhandler.cc (fhandler_base::read): Coerce returned len to signed or
1370 it will never be treated as < 0.
1371 (fhandler_base::wait_overlapped): Minimize calls to GetLastError.
1372 Remove duplicate debugging test. Fix error return.
1374 * fhandler.h (fhandler_fifo::fifo_name): Declare new function.
1375 (fhandler_fifo::close): Ditto.
1376 (fhandler_fifo::dup): Ditto.
1377 (fhandler_fifo::close_on_exec): Ditto.
1378 * fhandler.cc (fhandler_fifo::fifo_name): Define new function.
1379 (FIFO_BUF_SIZE): New define.
1381 (fhandler_fifo::open): Rework. Use cnp to open named pipe. Always
1382 open write side as a client. Open dummy client when writing and can't
1384 (wait): Rework. Implement fifo_wait_for_next_client. Handle signals
1385 during connect better. Add new fifo_wait_for_server code which polls
1386 (sigh) waiting for server.
1387 (fhandler_fifo::raw_read): Handle transition states when one client
1388 closes and another is available.
1389 (fhandler_fifo::close): Define.
1390 (fhandler_fifo::dup): Ditto.
1391 (fhandler_fifo::close_on_exec): Ditto.
1393 2009-07-24 Corinna Vinschen <corinna@vinschen.de>
1395 * syscalls.cc (internal_setlocale): Fix typo in GBK codepage.
1397 2009-07-24 Corinna Vinschen <corinna@vinschen.de>
1399 * syscalls.cc (unlink_nt): Ignore sharing violation on NFS. Align
1402 2009-07-23 Corinna Vinschen <corinna@vinschen.de>
1404 * mount.h (fs_info::fsn): New member.
1405 (fs_info::clear): Clear fsn.
1406 (fs_info::fsname): New read accessor for fsn.
1407 * mount.cc (fs_info::update): Fill in fsn member with lowercased
1408 filesystem name if filesystem is not well-known. Fall back to
1409 "unknown" if filesystem name is missing.
1410 (fillout_mntent): Print filesystem name retrieved in fs_info::update
1411 rather than static string "unknown".
1413 2009-07-23 Corinna Vinschen <corinna@vinschen.de>
1415 * mount.cc (fs_info::update): Revert to open filesystem with access set
1416 to READ_CONTROL. If that fails, try additionally with FILE_READ_DATA.
1418 2009-07-22 Eric Blake <ebb9@byu.net>
1420 * exceptions.cc (handle_exceptions): Set si_addr according to
1423 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
1425 * mount.cc (fs_info::update): Open filesystem with access set to 0.
1428 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
1430 * mount.cc: Revert accidental checkin.
1432 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
1434 * path.cc (symlink_info::check): Handle STATUS_NOT_SUPPORTED from
1435 NtCreateFile just like STATUS_EAS_NOT_SUPPORTED.
1437 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
1439 * mount.cc (fillout_mntent): Fix typo (noexec -> notexec).
1441 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
1443 * path.cc (symlink_info::check): Fix typo in comment.
1445 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
1447 * fhandler.h (enum del_lock_called_from): New enumeration.
1448 (fhandler_base::del_my_locks): Declare taking a del_lock_called_from
1450 * fhandler.cc (fhandler_base::close): Call del_my_locks with "on_close".
1451 (fhandler_base::fixup_after_fork): Call del_my_locks with "after_fork".
1452 (fhandler_base::fixup_after_exec): Call del_my_locks with "after_exec".
1453 * flock.cc (fhandler_base::del_my_locks): Take del_lock_called_from
1454 as argument. Call node->del_my_locks with NULL handle in after_exec
1457 2009-07-21 Eric Blake <ebb9@byu.net>
1459 * dtable.cc (dup2): Correct return value for no-op.
1461 2009-07-21 Corinna Vinschen <corinna@vinschen.de>
1462 Eric Blake <ebb9@byu.net>
1464 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Add special case
1465 for MVFS. Explain why.
1466 (fhandler_disk_file::utimens): Drop local variables lastaccess and
1467 lastwrite. Copy timestamps right into FILE_BASIC_INFORMATION structure
1468 to avoid copying them twice.
1470 2009-07-20 Corinna Vinschen <corinna@vinschen.de>
1472 * wincap.h (wincaps::has_always_all_codepages): New element.
1473 * wincap.cc: Implement above element throughout.
1474 * wchar.h (__sjis_mbtowc): Declare.
1475 (__eucjp_mbtowc): Ditto.
1476 (__gbk_mbtowc): Ditto.
1477 (__kr_mbtowc): Ditto.
1478 (__big5_mbtowc): Ditto.
1479 * syscalls.cc (internal_setlocale): Convert to char * function.
1480 Return parameter by default. Return NULL if request to use a
1481 charset can't be satisfied due to missing codepage support in the
1482 underlying OS. Fix comment.
1483 (setlocale): Store original locale. Restore to original locale if
1484 internal_setlocale returns NULL.
1486 2009-07-20 Corinna Vinschen <corinna@vinschen.de>
1488 * fork.cc (fork): Create local tmp_pathbuf. Explain why.
1490 2009-07-18 Christopher Faylor <me+cygwin@cgf.cx>
1492 * exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when
1494 (stopped_or_terminated): Honor WCONTINUED.
1495 * wait.cc (wait4): Ditto.
1496 * include/cygwin/wait.h (WCONTINUED): Define.
1497 (__W_CONTINUED): Ditto.
1498 (WIFCONTINUED): Ditto.
1500 2009-07-18 Dave Korn <dave.korn.cygwin@gmail.com>
1502 * libstdcxx_wrapper.cc (operator delete): Remove stray space in
1505 2009-07-17 Christopher Faylor <me+cygwin@cgf.cx>
1507 * cygtls.cc (_cygtls::init_exception_handler): Test for e, not e->prev
1508 or we could still end up adding our handler twice. Add comment
1509 explaining what we're doing.
1510 * dll_init.cc (dll_dllcrt0_1): Clarify comment.
1512 2009-07-17 Christopher Faylor <me+cygwin@cgf.cx>
1514 * cygtls.cc (_cygtls::init_exception_handler): Avoid adding our
1515 exception handler twice.
1517 2009-07-17 Corinna Vinschen <corinna@vinschen.de>
1519 * syscalls.cc (unlink_nt): Just return when a sharing violation
1520 occurs on remote filesystems.
1522 2009-07-17 Corinna Vinschen <corinna@vinschen.de>
1524 * globals.cc: Improve comment on R/O UNICODE_STRINGs.
1525 * mount.h (class fs_info): Add is_mvfs bit.
1526 * mount.cc (fs_info::update): Recognize MVFS remote filesystem.
1527 (fillout_mntent): Reorder filesystem checks for speed. Add
1528 mvfs, unixfs, and sunwnfs filesystem types.
1529 * path.h (class path_conv): Add fs_is_mvfs method.
1530 * path.cc (symlink_worker): On MVFS, always create symlinks as
1531 Windows shortcuts. Explain why.
1533 2009-07-16 Corinna Vinschen <corinna@vinschen.de>
1535 * syscalls.cc (unlink_nt): First remove the R/O DOS attribute with
1536 FILE_WRITE_ATTRIBUTES access only, then re-open the file for DELETE.
1539 2009-07-16 Corinna Vinschen <corinna@vinschen.de>
1541 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Remove file
1542 attribute check already done in NtSetAttributesFile.
1544 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
1546 * globals.cc: Reorder constant UNICODE_STRINGs for clarity.
1547 * mount.h (fs_info::sttaus): Move filesystem type flags into
1548 substructure. Add union to allow simple test for having set any
1549 one filesystem type flag. Replace has_buggy_open flag with is_sunwnfs
1550 flag. Replace has_buggy_fileid_dirinfo with is_unixfs flag.
1551 (fs_info::got_fs): New private method.
1552 (fs_info::has_buggy_open): New explicit implementation.
1553 (fs_info::has_buggy_fileid_dirinfo): Ditto.
1554 * mount.cc (fs_info::update): Optimize filesystem checks for speed.
1555 * winsup.h (IMPLEMENT_STATUS_FLAG): Change write accessor to return
1558 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
1560 * fhandler_netdrive.cc (GET_RESOURCE_INFO): Remove.
1561 (thread_netdrive): Drop GET_RESOURCE_INFO case.
1562 (fhandler_netdrive::exists): Use GET_RESOURCE_OPENENUM info class
1563 to check for existance.
1565 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
1567 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Remove useless
1570 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
1572 * path.cc (cwdstuff::set): Only fix up UNC path in win32 so as not
1573 to overwrite incoming path.
1575 2009-07-14 Corinna Vinschen <corinna@vinschen.de>
1577 Throughout avoid having to initialize constant UNICODE_STRINGs.
1578 * globals.cc: Define constant UNICODE_STRINGs and store in .rdata
1580 * fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs
1581 rather then initializing local UNICODE_STRING variable where
1583 * fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
1584 * flock.cc (inode_t::inode_t): Ditto.
1586 * syscalls.cc: Ditto.
1587 * mount.cc (fs_info::update): Ditto.
1590 * ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as
1592 (RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING.
1593 * fhandler_disk_file.cc: Accommodate throughout.
1594 * mount.cc (fs_info::update): Ditto.
1595 * path.cc (cwdstuff::set): Ditto.
1596 * syscalls.cc: Ditto.
1598 2009-07-14 Corinna Vinschen <corinna@vinschen.de>
1600 * globals.cc (active_codepage): Remove.
1602 2009-07-12 Christopher Faylor <me+cygwin@cgf.cx>
1604 * how-spawn-works.txt: Add "out of date" note.
1605 * how-vfork-works.txt: Ditto.
1607 2009-07-12 Christopher Faylor <me+cygwin@cgf.cx>
1609 * Makefile.in: Don't do anything special with any RCS directories.
1611 * ntdll.h (PROCESSINFOCLASS): Remove unneeded trailing comma.
1613 * pinfo.cc (_pinfo::dup_proc_pipe): Remove unneeded assignment.
1615 * sigproc.cc (sig_send): Don't send signal to myself if this is an exec
1618 2009-07-12 Corinna Vinschen <corinna@vinschen.de>
1620 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Don't use
1621 FileAllInformation info class since it needs a big buffer. Add a
1624 2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com>
1626 * winbase.h (ilockexch): Avoid making 'ret' volatile.
1627 (ilockcmpexch): Likewise.
1629 2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com>
1631 * Makefile.in (DLL_OFILES): Add libstdcxx_wrapper.o
1632 (libstdcxx_wrapper_CFLAGS): Add flags for new module.
1633 (_cygwin_crt0_common_STDINCFLAGS): Define per-file override.
1634 (libstdcxx_wrapper_STDINCFLAGS, cxx_STDINCFLAGS): Likewise.
1635 * cxx.cc: Include "cygwin-cxx.h".
1636 (operator new): Tweak prototype for full standards compliance.
1637 (operator new[]): Likewise.
1638 (operator new (nothrow)): New fallback function.
1639 (operator new[] (nothrow), operator delete (nothrow),
1640 operator delete[] (nothrow)): Likewise.
1641 (default_cygwin_cxx_malloc): New struct of pointers to the above,
1642 for final last-resort fallback default.
1643 * cygwin-cxx.h: New file.
1644 (struct per_process_cxx_malloc): Define.
1645 (default_cygwin_cxx_malloc): Declare extern.
1646 * cygwin.din (__wrap__ZdaPv): Export new wrapper.
1647 (__wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
1648 __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
1649 __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
1650 __wrap__ZnwjRKSt9nothrow_t): Likewise.
1651 * globals.cc (__cygwin_user_data): Init newly-repurposed 'forkee'
1652 field (now 'cxx_malloc') to point to default_cygwin_cxx_malloc.
1653 * libstdcxx_wrapper.cc: New file.
1654 (__wrap__ZdaPv, __wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
1655 __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
1656 __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
1657 __wrap__ZnwjRKSt9nothrow_t): Define wrapper functions for libstdc++
1658 malloc operators and their overrides.
1659 * winsup.h (default_cygwin_cxx_malloc): Declare extern.
1660 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
1661 * include/sys/cygwin.h (struct per_process_cxx_malloc): Forward
1663 (struct per_process::forkee): Rename and repurpose from this ...
1664 (struct per_process::cxx_malloc): ... to this.
1665 * lib/_cygwin_crt0_common.cc: Include cygwin-cxx.h.
1666 (WEAK): Define shorthand helper macro.
1667 (__cygwin_cxx_malloc): Define and populate with weak references
1668 to whatever libstdc++ malloc operators will be visible at final
1669 link time for Cygwin apps and dlls.
1670 (_cygwin_crt0_common): Always look up cygwin DLL's internal
1671 per_process data, and don't test for (impossible) failure. Inherit
1672 any members of __cygwin_cxx_malloc that we don't have overrides
1673 for from the DLL's default and store the resulting overall set of
1674 overrides back into the DLL's global per_process data.
1676 2009-07-07 Corinna Vinschen <corinna@vinschen.de>
1678 * cygtls.cc (_cygtls::remove): Fix typo.
1680 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
1682 * Makefile.in (clean): Clean generated files in srcdir.
1683 * tlsoffsets.h: Regenerate.
1685 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
1687 * cygtls.cc (_cygtls::remove): Avoid closing a NULL handle.
1689 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
1691 * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabuf
1692 and wsacnt to references. Fix handling of WSAEMSGSIZE.
1694 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
1696 * cygtls.h (struct _local_storage): Add thread storage pointers for
1697 memory used by socket select functions. Combine them into a single
1699 * cygtls.cc: Accommodate above change throughout.
1700 (_cygtls::init_thread): Drop initalizing of sockevt to
1701 INVALID_HANDLE_VALUE.
1702 (_cygtls::fixup_after_fork): Reset sockevt to NULL.
1703 (_cygtls::remove): Don't use sockevt value to bail out prematurely.
1704 Set sockevt to NULL. Free malloced select members.
1705 * select.h (struct select_socket_info): Drop max_w4 member.
1706 * select.cc (thread_socket): Use INFINITE timeout value if number of
1707 objects to wait for is <= MAXIMUM_WAIT_OBJECTS. Use num_w4 member
1708 of select_socket_info struct rather than dropped max_w4.
1709 (init_tls_select_info): New inline function to initialize TLS select
1711 (start_thread_socket): Just call init_tls_select_info to initialize TLS
1712 select members and use them later on.
1713 (socket_cleanup): Don't free select_socket_info pointer members since
1714 they are thread local now.
1716 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
1718 * dtable.cc (handle_to_fn): Detect failing NtQueryObject.
1720 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
1722 * autoload.cc: Delete stray CR.
1724 2009-07-05 Christopher Faylor <me+cygwin@cgf.cx>
1726 * fhandler_console.cc: Change workstation -> windows station
1729 2009-07-04 Christopher Faylor <me+cygwin@cgf.cx>
1731 * autoload.cc (SetParent): Add new import.
1732 * fhandler.h (fhandler_console::create_invisible_console): Declare new
1734 (create_invisible_console_workaround): Ditto.
1735 * fhandler_console.cc (fhandler_console::create_invisible_console):
1736 Define new function.
1737 (create_invisible_console_workaround): Ditto. Add too much code to
1738 deal with broken Windows 7. Use a helper app to start an invisible
1740 (fhandler_console::need_invisible): Reorganize to use helper functions
1741 to create invisible console.
1743 * spawn.cc (spawn_guts): Avoid zeroing already zeroed fields in si.
1745 2009-07-04 Dave Korn <dave.korn.cygwin@gmail.com>
1747 * autoload.cc (AttachConsole): Correct size of args.
1749 2009-07-03 Christopher Faylor <me+cygwin@cgf.cx>
1751 * dcrt0.cc (jit_debug): New global.
1752 (initial_env): Set jit_debug when we are automatically starting a gdb
1754 * dtable.cc (dtable::get_debugger_info): Don't tty tricks when we are
1755 being debugged by our own captive gdb, as determined by jit_debug ==
1757 (dtable::init_std_file_from_handle): Detect errors when initializing a
1758 tty early rather than at random points later.
1759 * fhandler.h (fhandler_*::init): Return int to indicate
1761 * fhandler.cc (fhandler_base::init): Reflect change in return value.
1762 * pipe.cc (fhandler_pipe::init): Ditto.
1763 (fhandler_pipe::create_selectable): Don't say we're retrying when we
1765 * fhandler_console.cc (fhandler_console::init): Ditto. Return
1767 * fhandler_serial.cc (fhandler_serial::init): Ditto.
1768 * fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
1769 (fhandler_tty_slave::open): Make debugging output more detailed.
1770 * tty.cc (tty_list::terminate): Don't close I/O handles before all
1771 slaves have checked in.
1772 (tty::slave_alive): Make a non-inlined function. Check if tty pipe
1773 handles can be created as an additional exists check.
1774 * tty.h (tty::slave_alive): Just define here.
1776 2009-07-03 Corinna Vinschen <corinna@vinschen.de>
1778 * posix.sgml: Add fpurge and mkstemps to BSD list.
1780 2009-07-03 Eric Blake <ebb9@byu.net>
1782 * cygwin.din (fpurge, mkstemps): New exports.
1783 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
1784 * mktemp.cc (_gettemp): Add parameter.
1785 (mkstemps): New function.
1786 (mkstemp, mkdtemp, mktemp): Adjust clients.
1788 2009-07-03 Corinna Vinschen <corinna@vinschen.de>
1790 * autoload.cc: Fix typo in comment.
1791 (ShowWindowAsync): Define.
1792 (AttachConsole): Define.
1793 * fhandler_console.cc (fhandler_console::need_invisible): Add band-aid
1794 for Windows 7 AllocConsole bug.
1796 2009-07-01 Corinna Vinschen <corinna@vinschen.de>
1798 * net.cc (get_xp_ifs): Fix typo in comment.
1800 2009-07-01 Corinna Vinschen <corinna@vinschen.de>
1802 * fhandler.h (class fhandler_socket): Add class members and methods
1803 to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes.
1804 * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members.
1805 (fhandler_socket::send_internal): Check for SO_SNDBUF size and
1806 restrict send to 1 byte less per KB 823764. Leave loop immediately
1807 if WSASendMsg has been used.
1808 * net.cc (fdsock): Change comment again. Set buffer sizes to 65536.
1809 Store values in fhandler_socket.
1810 (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in
1812 (cygwin_sendto): Drop call to sig_dispatch_pending.
1813 (cygwin_recvfrom): Ditto.
1814 (cygwin_recvmsg): Ditto.
1815 (cygwin_sendmsg): Ditto.
1817 2009-06-30 Christopher Faylor <me+cygwin@cgf.cx>
1819 * select.h: New file split from fhandler.h.
1820 (select_record::select_record): Define do-nothing constructor for "new"
1821 to avoid gratuitous zeroing.
1822 (select_info): New base class.
1823 (select_pipe_info): New class with methods for dealing with pipes.
1824 (select_socket_info): New class with methods for dealing with sockets.
1825 (select_serial_info): Dummy class for serial.
1826 (select_mailslot_info): Dummy class for mailslots.
1827 (select_stuff): Define device_specific_* as actual classes rather than
1829 * dtable.h (dtable::select_read): Accommodate return value change to
1830 'bool' and argument change to "select_stuff".
1831 (dtable::select_write): Ditto.
1832 (dtable::select_except): Ditto.
1833 * dtable.cc (dtable::select_read): Accommodate return value change to
1834 'bool' and argument change to "select_stuff".
1835 (dtable::select_write): Ditto.
1836 (dtable::select_except): Ditto.
1837 * fhandler.h: Excise select-related classes.
1838 (fhandler_*::select_read): Change argument to select_stuff.
1839 (fhandler_*::select_write): Ditto.
1840 (fhandler_*::select_except): Ditto.
1841 * select.cc (UNIX_FD_ZERO): Use memset rather than bzero.
1842 (select_stuff::test_and_set): Change return type to bool. Allocate
1843 select_record on entry and let fhandler_*::select_* operate on the
1844 start.next field of select_stuff.
1846 (select_pipe_info::select_pipe_info): New constructor. Allocates event
1847 for controlling pipe waits.
1848 (select_pipe_info::~select_pipe_info): New destructor. Destroy event.
1850 (select_pipe_info::add_watch_handle): New function.
1851 (thread_pipe): Wait for the hEvent part of any overlapped pipes before
1853 (start_thread_pipe): Don't allocate device_specific_pipe stuff here.
1854 Assume that it has been allocated earlier.
1855 (pipe_cleanup): Rely on select_pipe_info destructor to clean up pipe
1857 (fhandler_*::select_*): Derive select_record from new select_stuff
1859 (fhandler_pipe::select_*): Ditto. Allocate pipe-specific field if not
1861 (serialinf): Delete.
1862 (thread_serial): serialinf -> select_serial_info.
1863 (fhandler_base::ready_for_read): Rewrite to accommodate change in
1864 argument to fhandler_*::select_*.
1865 (socketinf): Delete.
1866 (thread_socket): socketinf -> select_socket_info.
1867 (mailslotinf): Delete.
1868 (thread_mailslot): mailslotinf -> select_mailslot_info.
1870 2009-06-30 Christopher Faylor <me+cygwin@cgf.cx>
1872 * fhandler.cc (fhandler_base::has_ongoing_io): Accept an argument
1873 indicating whether the overlapped event should be tested.
1874 (fhandler_base::read_overlapped): Pass is_overlapped state to
1876 (fhandler_base::write_overlapped): Ditto.
1877 * fhandler.h (fhandler_base::has_ongoing_io): Accommodate argument
1879 * select.cc (peek_pipe): Ditto.
1881 2009-06-30 Corinna Vinschen <corinna@vinschen.de>
1883 * net.cc (fdsock): Set default socket buffer sizes to 65520. Change
1884 comment accordingly.
1885 * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum
1886 send size to 65520 as well.
1888 2009-06-29 Christopher Faylor <me+cygwin@cgf.cx>
1890 * select.cc (peek_pipe): Turn on (temporarily?) the experimental code
1891 which tries to determine when a pipe is writable.
1893 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
1895 * select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe
1896 is ready for writing rather than performing brute-force checks.
1898 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
1900 * fhandler.h (fhandler_base::has_ongoing_io): Declare new function.
1901 * fhandler.cc (fhandler_base::has_ongoing_io): Define new function.
1902 (fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing
1903 when handle has not completed last I/O.
1904 (fhandler_base::write_overlapped): Ditto.
1905 * select.cc (peek_pipe): Be more careful about accessing hEvent field
1906 from get_overlapped().
1908 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
1910 * gendef (cleanup): Rename from 'nocr'. Remove comments and trailing
1912 * cygwin.din: Add long-needed comment describing what
1913 dll_crt0__FP11per_process demangles to.
1915 * select.cc (peek_pipe): Flag handle as not ready for write if event is
1917 * fhandler.cc (fhandler_base::setup_overlapped): Establish event as
1919 (fhandler_base::wait_overlapped): Don't reset event after we've
1920 successfully waited. MSDN documentation says that this happens
1921 automatically after a WriteFileEx/ReadFileEx.
1923 2009-06-26 Corinna Vinschen <corinna@vinschen.de>
1925 * wincap.h (wincaps::has_broken_alloc_console): New element.
1926 * wincap.cc: Implement above element throughout.
1928 2009-06-25 Corinna Vinschen <corinna@vinschen.de>
1930 * sec_auth.cc (lsaauth): Close unused handle.
1931 (lsaprivkeyauth): Ditto.
1933 2009-06-23 Corinna Vinschen <corinna@vinschen.de>
1935 * sec_auth.cc (get_server_groups): Ignore errors from
1936 get_user_local_groups.
1938 2009-06-22 Corinna Vinschen <corinna@vinschen.de>
1940 * spawn.cc (spawn_guts): Don't run additional check for Win32
1941 incompatible CWD if newargv.fixup bailed out already.
1942 (av::fixup): Check shell scripts for executability.
1944 2009-06-18 Corinna Vinschen <corinna@vinschen.de>
1946 * path.cc (chdir): Check error conditions first.
1948 2009-06-17 Corinna Vinschen <corinna@vinschen.de>
1950 * fhandler_socket.cc (fhandler_socket::recv_internal): Mark WSARecvMsg
1953 2009-06-16 Christopher Faylor <me+cygwin@cgf.cx>
1955 * fhandler.cc (fhandler_base::read_overlapped): Use a better variable
1958 2009-06-16 Christopher Faylor <me+cygwin@cgf.cx>
1960 * fhandler.cc (fhandler_base::read_overlapped): Preserve len when
1961 looping due to received signal.
1963 2009-06-15 Corinna Vinschen <corinna@vinschen.de>
1965 * net.cc (get_flags): New static function to generate interface flags
1967 (get_ipv4fromreg_ipcnt): New static function to fetch number of
1968 configured IPv4 addresses for a given NIC from registry.
1969 (get_ipv4fromreg): New static function to fetch configured IPv4
1970 addresses for a given NIC from registry.
1971 (get_friendlyname): New static function to generate friendly name.
1972 (get_hwaddr): New static function to copy hardware address.
1973 (get_xp_ifs): Restructure slightly. Add code to generate IPv4 entries
1974 entries for interfaces which are disconnected.
1976 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
1978 * errno.cc (errmap): Add mapping for ERROR_IO_INCOMPLETE.
1979 * fhandler.cc (fhandler_base::fcntl): Fix comment.
1980 (fhandler_base::wait_overlapped): Accept an optional len parameter.
1981 Use the len parameter when WriteFile fails with ERROR_IO_PENDING. Make
1982 debug output less alarming.
1983 (fhandler_base::write_overlapped): Pass len to wait_overlapped.
1984 * fhandler.h (fhandler_base::wait_overlapped): Add an optional argument
1985 denoting the number of characters intended to be written.
1987 * fhandler_tty.cc (fhandler_pty_master::close): Don't close archetype
1988 handles when cygwin is still initializing since the handles aren't
1989 actually opened at that point.
1991 2009-06-14 Corinna Vinschen <corinna@vinschen.de>
1993 * localtime.cc (time2): Take another stab at fixing a compiler warning.
1995 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
1997 * localtime.cc (time2): Take a stab at fixing a compiler warning.
1999 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
2001 * fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag
2002 for writes. Don't reset event handle when we see a ERROR_IO_PENDING.
2004 * sigproc.cc (stopped_or_terminated): Use bool constants for
2007 * wait.cc (wait4): Remove nonsensical comment.
2009 2009-06-13 Corinna Vinschen <corinna@vinschen.de>
2011 * fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen
2012 pointer to NULL if name pointer is NULL. Explain why.
2014 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
2016 * localtime.cc (time2): Change "spring gap" to "spring forward gap"
2019 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
2021 * localtime.cc (time2): Add workaround for spring forward gap problem.
2022 Add explaining comment.
2024 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
2026 * Makefile.in (SUBLIBS): Add librt.a.
2027 (librt.a): New rule to build librt.a.
2029 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
2031 * posix_ipc.cc (check_path): Fix typo in comment. Align naming
2032 convention rules to Linux. Handle backslash same as slash. Add
2035 2009-06-09 Corinna Vinschen <corinna@vinschen.de>
2037 * autoload.cc (GetSystemTimes): Remove.
2038 * fhandler_proc.cc (format_proc_uptime): Use global system_info rather
2039 than retrieving a local copy of the SYSTEM_INFO. Drop call to
2040 GetSystemTimes and retrieve SystemPerformanceInformation on all systems
2041 again with buffer size big enough for 64 bit systems.
2042 (format_proc_stat): Use global system_info rather than retrieving a
2043 local copy of the SYSTEM_INFO. Retrieve SystemPerformanceInformation
2044 with buffer size big enough for 64 bit systems.
2046 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
2048 * autoload.cc (GetSystemTimes): Define.
2049 * fhandler_proc.cc (format_proc_uptime): Use GetSystemInfo to retrieve
2050 processor count. Use GetSystemTimes when available to retrieve system
2051 idle time. Improve debug output.
2052 (format_proc_stat): Use GetSystemInfo to retrieve processor
2053 count. Improve debug output. Ignore if SystemPerformanceInformation
2054 returns error. Explain why.
2056 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
2058 * fork.cc (frok::parent): Remove ancient code erroneously flushing
2061 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
2063 * cygerrno.h (save_errno::~save_errno): Set errno directly to avoid
2064 flooding debug output.
2066 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
2068 * path.cc (symlink_info::check): Return with error set to ENOENT if
2069 STATUS_NO_MEDIA_IN_DEVICE is returned.
2071 2009-06-07 Christopher Faylor <me+cygwin@cgf.cx>
2073 * cygheap.h (mini_cygheap): New struct.
2074 (init_cygheap): Inherit locale field via mini_cygheap.
2075 * cygheap.cc (cygheap_at_start): Define new variable.
2076 (cygheap): Initialize as cygheap_at_start so that locale information is
2078 (cygheap_init): Initialize cygheap iff it is set to cygheap_at_start.
2079 * shared_info.h (memory_init): Accommodate argument change.
2080 * memory.cc (memory_init): Accept an argument indicating whether
2081 cygheap should be initialized or not.
2082 * dcrt0.cc (child_info_fork::handle_fork): Pass false to memory_init().
2083 (child_info_spawn::handle_spawn): Ditto.
2084 (dll_crt0_0): Pass true to memory_init when not forking or execing.
2086 * cygheap.h (cygheap_types::HEAP_2_DLL): New enum.
2087 * dll_init.h (dll): Remove unused namelen field.
2088 (dll_list::load_after_fork): Accommodate change in arguments.
2089 * dll_init.cc (dll_list::alloc): Allocate dll information in the cygwin
2091 (dll_list::detach): Free dll information from the cygwin heap.
2092 (dll_list::load_after_fork): Use dll information in the cygwin heap
2093 directly rather than querying parent.
2094 * fork.cc (frok::first_dll): Delete.
2095 (frok::child): Don't report on first_dll. Don't pass it to
2097 (frok::parent): Don't set first_dll.
2100 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
2102 * dll_init.cc (dll_list::alloc): Allocate memory using a section
2103 object. Explain why. Drop call to GetSystemInfo, rather call
2104 getpagesize to get allocation granularity. Only align to allocation
2105 granularity under WOW64. Use roundup2 to align.
2106 (dll_list::detach): Call NtUnmapViewOfSection instead of VirtualFree.
2108 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
2110 * mmap.cc: Use NtUnmapViewOfSection instead of UnmapViewOfFile
2111 throughout for symmetry.
2112 (fhandler_dev_mem::munmap): Use correct process handle in call to
2113 NtUnmapViewOfSection.
2115 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
2117 * dll_init.h (struct dll): Set size of name element to ANYSIZE_ARRAY.
2118 * dll_init.cc: Fix formatting.
2119 (dll_list::alloc): Only allocate as much memory for struct dll as
2120 necessary for given DLL name.
2121 (dll_list::load_after_fork): Only read a single page of parent memory.
2122 Only read more if namelen indicates that it's necessary.
2124 2009-06-05 Dave Korn <dave.korn.cygwin@gmail.com>
2126 * winbase.h (ilockexch): Fix asm constraints.
2127 (ilockcmpexch): Likewise.
2129 2009-06-05 Corinna Vinschen <corinna@vinschen.de>
2131 * heap.cc (heap_init): Fix typo in comment.
2133 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
2135 * fhandler_clipboard.cc: Avoid calling system_printf.
2136 (set_clipboard): Add basic error checking. Set errno here. Per MSDN,
2137 don't call GlobalFree on data block transferred to clipboard.
2138 (fhandler_dev_clipboard::write): Drop setting errno after call to
2140 (fhandler_dev_clipboard::read): Add basic error checking. Simplify code.
2142 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
2144 * fhandler_console.cc (set_console_title): Convert title string to
2145 wchar_t and call SetConsoleTitleW.
2147 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
2149 * fhandler_console.cc (fhandler_console::read): Allow Ctrl-Space to
2152 2009-06-04 Dave Korn <dave.korn.cygwin@gmail.com>
2154 * thread.cc (__cygwin_lock_lock): Delete racy optimisation.
2155 (__cygwin_lock_unlock): Likewise.
2157 2009-06-03 IWAMURO Motnori <deenheart@gmail.com>
2159 * strfuncs.cc (sys_cp_mbstowcs): Fix condition.
2161 2009-06-03 Corinna Vinschen <corinna@vinschen.de>
2163 * strfuncs.cc (sys_cp_wcstombs): Implement reverse functionality
2164 of the change to sys_cp_mbstowcs from 2009-05-30.
2165 (sys_cp_mbstowcs): Slightly reformat. Fix comment to accommodate
2166 change to sys_cp_wcstombs. Don't write to *ptr if dst is NULL.
2168 2009-06-03 Corinna Vinschen <corinna@vinschen.de>
2170 * fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace
2171 to \033\177 or to \377 dependent on the setting of dev_state->metabit.
2173 2009-06-02 Corinna Vinschen <corinna@vinschen.de>
2175 * path.cc (path_conv::check): Don't call set_exec for files on "noacl"
2178 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
2180 * strfuncs.cc (sys_cp_mbstowcs): Treat src as unsigned char *. Convert
2181 failure of f_mbtowc into a single malformed utf-16 value.
2183 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
2185 * cygwin/include/sys/termios.h: Make default erase character "^?".
2187 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
2189 * fhandler_console.cc (fhandler_console::read): Convert backspace key
2192 2009-05-29 Christopher Faylor <me+cygwin@cgf.cx>
2194 * path.cc (cwdstuff::set): Rewrite previous change to properly test the
2197 2009-05-28 Christopher Faylor <me+cygwin@cgf.cx>
2199 * path.cc (cwdstuff::set): Avoid removing a nonexistent trailing slash.
2201 2009-05-20 Eric Blake <ebb9@byu.net>
2203 * net.cc (gethostby_helper): Use correct signedness.
2205 2009-05-18 Christopher Faylor <me+cygwin@cgf.cx>
2207 * mount.cc (mount_info::add_item): Avoid using any-old '/' as
2210 2009-05-18 Christopher Faylor <me+cygwin@cgf.cx>
2212 * mount.cc (mount_info::got_usr_bin): Mark as NO_COPY.
2213 (mount_info::got_usr_lib): Ditto.
2214 (mount_info::root_idx): Ditto.
2216 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
2218 * wchar.h (sys_mbstowcs): Add missing __stdcall attribute.
2220 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
2222 * cygheap.cc (cygheap_init): Set Cygwin default locale values.
2223 * cygheap.h (struct cygheap_locale): New structure.
2224 (struct user_heap_info): Add cygheap_locale member locale.
2225 * dcrt0.cc (dll_crt0_1): Revert to calling _setlocale_r so that only
2226 the applications locale is reverted to "C".
2227 * environ.cc (environ_init): Remove unused got_lc variable.
2228 * fhandler.h (class dev_console): Remove now unsed locale variables.
2229 * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove
2230 setting dev_console's locale members.
2231 (dev_console::con_to_str): Use internal locale settings. Default to
2232 __ascii_wctomb if charset is "ASCII".
2233 (fhandler_console::write_normal): Ditto.
2234 * strfuncs.cc (__ascii_wctomb): Drop declaration.
2235 (__db_wctomb): Use fixed value 2 instead of not
2236 necessarily matching MB_CUR_MAX.
2237 (__eucjp_wctomb): Use 3 instead of MB_CUR_MAX.
2238 (sys_cp_wcstombs): Remove special case for "C" locale.
2239 (sys_wcstombs): Implement here. Use internal locale data stored on
2241 (sys_cp_mbstowcs): Remove special case for "C" locale.
2242 (sys_mbstowcs): Implement here. Use internal locale data stored on
2244 * syscalls.cc (internal_setlocale): New function to set cygheap locale
2245 data and to reset CWD posix path.
2246 (setlocale): Just call internal_setlocale from here if necessary.
2247 * wchar.h (__ascii_wctomb): Declare.
2248 (sys_wcstombs): Don't define inline, just declare.
2249 (sys_mbstowcs): Ditto.
2251 2009-05-14 Christopher Faylor <me+cygwin@cgf.cx>
2253 * mount.cc (mount_info::init): Remove MOUNT_CYGWIN_EXEC setting when
2254 auto-mounting /usr/bin.
2256 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
2258 * mount.cc (oopts): Add a no-op "auto" option.
2259 (mount_info::create_root_entry): Set root dir to MOUNT_IMMUTABLE rather
2260 than to MOUNT_OVERRIDE.
2262 2009-05-13 Corinna Vinschen <corinna@vinschen.de>
2263 Christopher Faylor <me+cygwin@cgf.cx>
2265 * mount.cc (mount_info::got_usr_bin): Define.
2266 (mount_info::got_usr_lib): Ditto.
2267 (mount_info::root_idx): Ditto.
2268 (mount_info::create_root_entry): Create root entry as immutable and
2270 (mount_info::init): Remove "Huh? No /etc/fstab..." warning.
2271 Unconditionally call from_fstab for user and system tables. Fill in
2272 /usr/bin and /usr/lib if they have not been specified in /etc/fstab.
2273 (oopts): Alphabetize. Add "override" option to allow overriding
2274 immutable mount points.
2275 (mount_info::add_item): Accommodate new MOUNT_IMMUTABLE flag intended
2277 (mount_info::add_item): Detect "/usr/bin", "/usr/lib", and "/" and set
2278 appropriate global state.
2279 (fillout_mntent): Add ,auto to mount points added by Cygwin DLL.
2280 (mount): Remove masking of MOUNT_SYSTEM. Allow user to shoot
2281 themselves. Add comment.
2282 * mount.h (mount_info::got_usr_bin): Declare.
2283 (mount_info::got_usr_lib): Ditto.
2284 (mount_info::root_idx): Ditto.
2285 * include/sys/mount.h: Reformat enum.
2286 Add MOUNT_{OVERRIDE,IMMUTABLE,AUTOMATIC}.
2288 2009-05-13 Corinna Vinschen <corinna@vinschen.de>
2290 * cygheap.h (cwdstuff): Convert to class. Make posix and dir private.
2291 (cwdstuff::get_posix): New method.
2292 (cwdstuff::reset_posix): New method.
2293 * dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r.
2294 * environ.cc (environ_init): Ditto. Prefer "C" locale over current
2295 codepage default locale.
2296 * path.cc (chdir): Use cwdstuff::get_posix method instead of accessing
2297 cwdstuff::posix directly.
2298 (cwdstuff::set): Defer creating posix path to first usage.
2299 (cwdstuff::get_posix): Create posix path if it's empty, and return it.
2300 (cwdstuff::get): Create posix path if it's empty.
2301 * strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C"
2303 (sys_cp_mbstowcs): Ditto.
2304 * syscalls.cc (gen_full_path_at): Fetch CWD posix path locked.
2305 (setlocale): Implement here. Reset CWD posix path.
2307 2009-05-09 Christopher Faylor <me+cygwin@cgf.cx>
2309 * cygwin/version.h (CYGWIN_VERSION_CYGWIN_CONV): New define.
2311 2009-05-09 Corinna Vinschen <corinna@vinschen.de>
2313 * dtable.cc (dtable::init_std_file_from_handle): Add workaround for
2314 Windows 7 64 bit issue. Add lengthy comment to explain what happens.
2315 * wincap.h (wincaps::has_console_handle_problem): New element.
2316 * wincap.cc: Implement above element throughout.
2317 (wincap_7): New wincaps structure for NT 6.1 kernels.
2318 (wincapc::init): Set has_console_handle_problem to false for 32 bit
2321 2009-05-09 Corinna Vinschen <corinna@vinschen.de>
2323 * sec_auth.cc (str2uni_cat): Move from here...
2324 * path.cc (str2uni_cat): ...to here. Simplify. Make static inline.
2325 (get_nt_native_path): Use RtlAppendUnicodeToString rather than
2326 str2uni_cat for constant strings for speed.
2327 * security.h (str2uni_cat): Drop declaration.
2329 2009-05-08 Corinna Vinschen <corinna@vinschen.de>
2330 IWAMURO Motonori <deenheart@gmail.com>
2332 * strfuncs.cc (sys_cp_wcstombs): save and restore previous errno value.
2333 (sys_cp_mbstowcs): Ditto.
2335 2009-05-08 IWAMURO Motonori <deenheart@gmail.com>
2337 * strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting
2338 wide char to SO/UTF-8 sequence.
2340 2009-05-08 Corinna Vinschen <corinna@vinschen.de>
2342 * include/sys/select.h: Guard definitions with __USE_W32_SOCKETS as
2343 the accompanying fd_set definitions in newlib's sys/types.h.
2345 2009-05-06 Christopher Faylor <me+cygwin@cgf.cx>
2347 * fhandler_console.cc (fhandler_console::ioctl): Properly treat
2348 TIOCLINUX argument as a char.
2349 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use coercion to properly
2352 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
2354 * libc/minires.c (scanline): Fix type in calls to ctype functions
2355 to stay in unsigned char range for char values >= 0x80.
2356 * regex/regcomp.c: Ditto, throughout.
2357 * regex/regex2.h (ISWORD): Ditto.
2359 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
2361 * cygheap.cc (cygheap_init): Set umask to a sane default.
2362 * uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH
2363 to set HOME. Default to /home/USERNAME.
2365 2009-05-03 Corinna Vinschen <corinna@vinschen.de>
2367 * security.cc (set_file_sd): Drop using FILE_OPEN_FOR_RECOVERY flag in
2369 * exceptions.cc (open_stackdumpfile): Ditto in call to NtCreateFile.
2370 * fhandler.cc (fhandler_base::open): Ditto. Simplify setting
2373 * mount.cc (fs_info::update): Recognize offline storage.
2374 (fillout_mntent): Report UDF and offline storage.
2375 * mount.h (class fs_info): Add is_csc_cache status flag.
2377 2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
2379 * fhandler_console.cc (fhandler_console::write_console): Eliminate
2380 unneeded debugging output.
2381 (fhandler_console::write_normal): Eliminate unneeded __seterrno.
2383 2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
2385 * libc/minires.c (scanline): Accommodate ctype changes which disallow
2386 use of an unadorned char argument to is* macros.
2387 * regex/regcomp.c: Ditto, throughout.
2388 * regex/regex2.h (ISWORD): Ditto.
2390 2009-05-03 Christopher Faylor <me+cygwin@cgf.cx>
2392 * fhandler.h (fhandler_console::MAX_WRITE_CHARS): Declare.
2393 (fhandler_console::write_replacement_char): Declare as inline.
2394 (fhandler_console::write_console): Declare new function.
2395 * fhandler_console.cc (fhandler_console::MAX_WRITE_CHARS): Define.
2396 (handler_console::write_console): Define.
2397 (fhandler_console::write_replacement_char): Define as inline.
2398 (fhandler_console::write_normal): Use write_console when writing
2399 buffers of unknown length.
2401 2009-04-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2403 * include/cygwin/socket.h: Define SOL_IPV6.
2405 2009-04-21 Corinna Vinschen <corinna@vinschen.de>
2407 * ctype.cc (__set_ctype): Copy exact part of the current active
2408 character class array.
2410 2009-04-20 Corinna Vinschen <corinna@vinschen.de>
2412 * flock.cc (lf_setlock): Handle border case which results in WFMO loop
2413 exiting with ret == WAIT_TIMEOUT gracefully. Add a system_printf to
2414 uncover other potential problems with WFMO loop.
2416 2009-04-18 Christopher Faylor <me+cygwin@cgf.cx>
2418 * mkimport: Specify .text for stub explicitly.
2419 * speclib: Add a dummy '.idata$7' section referring to the dll
2420 associated with the real import library.
2422 2009-04-18 Corinna Vinschen <corinna@vinschen.de>
2424 * dcrt0.cc (globify): Only call mbtowc for non-ascii chars.
2426 2009-04-17 Corinna Vinschen <corinna@vinschen.de>
2428 * dcrt0.cc (globify): Make multibyte-aware.
2430 2009-04-17 Corinna Vinschen <corinna@vinschen.de>
2432 * flock.cc (class inode_t): Add i_wait member and matching methods
2433 wait(), unwait(), and waiting().
2434 (inode_t::inode_t): Initialize i_wait to 0.
2435 (fhandler_disk_file::lock): Only remove node if no other thread is
2436 waiting for a blocking lock.
2437 (lf_setlock): Manipulate node->i_wait to signal that a thread is
2438 waiting for a blocking lock in this node.
2439 (lf_findoverlap): Reinstantiate SELF test as in original code.
2441 2009-04-16 Corinna Vinschen <corinna@vinschen.de>
2443 * dlfcn.cc (get_full_path_of_dll): Just return a bool value. Drop
2444 local path_conv in favor of getting it as parameter. Add local string
2445 buffer instead of getting it as parameter.
2446 (dlopen): Accommodate get_full_path_of_dll change. Fetch WCHAR Windows
2447 path from path_conv variable and call LoadLibraryW.
2449 2009-04-16 Corinna Vinschen <corinna@vinschen.de>
2451 * ntdll.h (STATUS_LOCK_NOT_GRANTED): Define.
2452 * syscalls.cc (unlink_nt): Handle STATUS_LOCK_NOT_GRANTED same as
2453 STATUS_SHARING_VIOLATION. Add lengthy comment to explain why.
2455 2009-04-15 Corinna Vinschen <corinna@vinschen.de>
2457 * path.cc (path_conv::get_wide_win32_path): Allow relative paths.
2458 (cygwin_conv_path): In case of CCP_POSIX_TO_WIN_W, convert relative
2459 paths to absolute paths if the relative pathname length exceeds
2462 2009-04-15 Corinna Vinschen <corinna@vinschen.de>
2464 * libc/bsdlib.cc: Align copyright with upstream.
2465 * libc/fnmatch.c: Ditto.
2466 * libc/fts.c: Ditto.
2467 * libc/inet_addr.c: Ditto.
2468 * libc/inet_network.c: Ditto.
2469 * libc/rcmd.cc: Ditto.
2470 * libc/rexec.cc: Ditto.
2472 2009-04-14 Christopher Faylor <me+cygwin@cgf.cx>
2474 * speclib: Really revert to using tempdir.
2476 2009-04-14 Christopher Faylor <me+cygwin@cgf.cx>
2478 * speclib: Revert to using tempdir.
2480 2009-04-14 Corinna Vinschen <corinna@vinschen.de>
2482 * localtime.cc (tzload): Implement setting __tzrule's offset member
2483 using newlib's __gettzinfo () interface also when tzload returns
2486 2009-04-13 Dave Korn <dave.korn.cygwin@gmail.com>
2488 * include/stdint.h (intptr_t): Remove long from type.
2489 (uintptr_t): Likewise.
2490 (INTPTR_MIN): Remove 'L' suffix.
2491 (INTPTR_MAX, UINTPTR_MAX): Likewise.
2493 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
2495 * speclib: Initial stab at cleaning up temp files. More work needed.
2498 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
2500 * Makefile.in (clean): Clean globals.h.
2501 (LIBCOS): Depend on globals.h.
2503 2009-04-11 Christopher Faylor <me+cygwin@cgf.cx>
2505 * mkimport: New script to perform all operations necessary to create
2509 * Makefile.in (toolopts): New variable which holds options relating to
2511 (speclib): Use toolopts. Add symbols to avoid copying to special
2513 (OBSOLETE_FUNCTIONS): Delete.
2514 (NEW_FUNCTIONS): Change to represent an argument to new mkimport
2516 (libcygwin.a): Use only new mkimport script to create libcygwin.a.
2517 Only rely on ${LIBCOS}.
2518 (*/lib*.a): Simplify speclib dependencies.
2519 (speclib): Accept toolchain options. Convert every argument to
2520 absolute path. Simplify parsing of nm output. Accommodate new
2523 2009-04-11 Dave Korn <dave.korn.cygwin@googlemail.com>
2525 * include/stdint.h (INTPTR_MIN, INTPTR_MAX): Add 'L' suffix.
2526 (WINT_MAX): Add 'U' suffix.
2528 2009-04-10 Christopher Faylor <me+cygwin@cgf.cx>
2530 * speclib: Use a more robust method to derive full file path.
2532 2009-04-09 Christopher Faylor <me+cygwin@cgf.cx>
2534 * speclib: Semi-revert to previous version but don't try to generate
2535 well-formed import library. Instead, just extract appropriate symbols
2536 and let later libcygwin.a on link line fill in the rest of the import
2538 * gendef: Hopefully no-op modification to allow easier post-processing
2541 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
2543 * syscalls.cc (try_to_bin): Use tmp_pathbuf buffer to allocate infobuf
2544 rather than using the stack.
2546 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
2548 * syscalls.cc (try_to_bin): Fix alignment of infobuf.
2550 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
2552 * fhandler_disk_file.cc (fhandler_disk_file::fchown): Catch an
2553 error when changing the user account on a standalone Samba server.
2555 * sec_acl.cc (setacl): Accommodate additional parameter to set_file_sd.
2556 * sec_helper.cc (SECURITY_SAMBA_UNIX_AUTHORITY): Define.
2557 (well_known_samba_unix_user_fake_sid): Define.
2558 * security.cc (set_file_sd): Take additional parameter if ownership
2559 should be changed. Restrict requested permissions accordingly.
2560 (set_file_attribute): Accommodate additional parameter to set_file_sd.
2561 * security.h (well_known_samba_unix_user_fake_sid): Declare.
2562 (set_file_sd): Align declaration to above change.
2564 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
2566 * include/stdint.h (int_least32_t): Define as int.
2567 (uint_least32_t): Ditto, unsigned.
2568 (int_fast16_t): Define as int.
2569 (int_fast32_t): Ditto.
2570 (uint_fast16_t): Ditto, unsigned.
2571 (uint_fast32_t): Ditto.
2572 (UINT32_MAX): Remove `L' long marker.
2573 (UINT_LEAST32_MAX): Ditto.
2574 (UINT_FAST16_MAX): Ditto.
2575 (UINT_FAST32_MAX): Ditto.
2579 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
2581 * strfuncs.cc: Change WCHAR to wchar_t in multibyte<->widechar
2582 conversion functions throughout.
2583 * wchar.h: Ditto in declarations. Guard them __INSIDE_CYGWIN__.
2585 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
2587 * fhandler.h (class dev_console): Add members con_mbtowc, con_wctomb,
2589 (dev_console::str_to_con): Take mbtowc function pointer and charset
2590 as additional parameters.
2591 * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
2592 aforementioned new members. Explain why.
2593 (dev_console::con_to_str): Remove useless comment. Call new
2594 sys_cp_wcstombs function rather than sys_wcstombs.
2595 (dev_console::str_to_con): Take mbtowc function pointer and charset
2596 as additional parameters. Call sys_cp_mbstowcs accordingly.
2597 (fhandler_console::write_normal): Only initialize f_mbtowc and charset
2598 once. Accommodate changed str_to_con.
2599 * strfuncs.cc (sys_cp_wcstombs): Renamed from sys_wcstombs. Take
2600 wctomb function pointer and charset as parameters. Use throughout.
2601 (sys_cp_mbstowcs): Take wctomb function pointer and charset as
2602 parameters instead of codepage. Remove matching local variables and
2603 their initialization.
2604 * wchar.h (ENCODING_LEN): Define as in newlib.
2605 (__mbtowc): Use mbtowc_p typedef for declaration.
2606 (wctomb_f): New type.
2607 (wctomb_p): New type.
2608 (__wctomb): Declare.
2609 (__utf8_wctomb): Use wctomb_f typedef for declaration.
2610 (sys_cp_wcstombs): Move declaration from winsup.h here.
2611 (sys_wcstombs): Ditto.
2612 (sys_wcstombs_alloc): Ditto.
2613 (sys_cp_mbstowcs): Ditto.
2614 (sys_mbstowcs): Ditto.
2615 (sys_mbstowcs_alloc): Ditto.
2616 * winsup.h: Move declaration of sys_FOO functions to wchar.h. Include
2619 2009-04-06 Earl Chew <earl_chew@agilent.com>
2621 * libc/rexec.cc (ruserpass): Use fstat64 instead of fstat.
2623 2009-04-06 Corinna Vinschen <corinna@vinschen.de>
2625 * strfuncs.cc: Add comment to explain why we can't support JIS
2627 (__db_wctomb): Alwaus use WC_NO_BEST_FIT_CHARS.
2628 (__jis_wctomb): Just call __ascii_wctomb from here.
2629 (__eucjp_wctomb): Convert to standalone implementation to fix up the
2630 difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
2632 (__kr_wctomb): Use codepage 949.
2633 (__db_mbtowc): Reorder code slightly. Always use MB_ERR_INVALID_CHARS
2634 in call to MultiByteToWideChar. Fix a problem with singlebyte
2635 sequences. Fix a bug in '\0' handling. Reset state->__count on
2636 successful return from non-zero state.
2637 (__jis_mbtowc): Just call __ascii_mbtowc from here.
2638 (__eucjp_mbtowc): Convert to standalone implementation to fix up the
2639 difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
2640 (__kr_mbtowc): Use codepage 949.
2641 (__set_charset_from_codepage): Handle codepage 20932 as eucJP.
2643 2009-04-05 Christopher Faylor <me+cygwin@cgf.cx>
2645 * Makefile.in: Use all compile options when calculating magic values.
2646 * shared_info.h (CURR_SHARED_MAGIC): Revert erroneous value.
2647 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
2649 * fhandler.h (acquire_output_mutex): Remove unneeded ';'.
2650 (release_output_mutex): Ditto.
2652 2009-04-05 Christopher Faylor <me+cygwin@cgf.cx>
2654 * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings.
2655 * shared_info.h (CURR_SHARED_MAGIC): Update.
2656 * spawn.cc (spawn_guts): Avoid copying one line command line argument
2657 if it hasn't been filled out.
2659 2009-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2660 Corinna Vinschen <corinna@vinschen.de>
2662 * include/asm/byteorder.h (__ntohl): Prototype before define to avoid
2663 a warning with -Wmissing-prototypes. Use _ELIDABLE_INLINE macro from
2667 2009-04-02 Corinna Vinschen <corinna@vinschen.de>
2669 * environ.cc (build_env): Fix length calculation of resulting
2670 wide char environment string.
2672 2009-04-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2674 * include/netdb.h: #include <inttypes.h>, <netinet/in.h>,
2675 and <sys/socket.h> per SUSv3.
2677 2009-04-01 Corinna Vinschen <corinna@vinschen.de>
2679 * strfuncs.cc (sys_cp_mbstowcs): Check if ASCII SO is followed by at
2680 least two chars and the next byte is a valid UTF-8 start byte before
2681 trying to convert the followup bytes as UTF-8 sequence.
2683 2009-03-31 Corinna Vinschen <corinna@vinschen.de>
2685 * shm.cc (struct shm_attached_list): Convert access type to ULONG.
2686 (fixup_shms_after_fork): Fix comment. Use NtMapViewOfSection rather
2687 than MapViewOfFileEx to recreate shared memory regions. Add function
2688 name to api_fatal output.
2689 (shmat): Use NtMapViewOfSection to create shared memory region
2692 2009-03-31 Corinna Vinschen <corinna@vinschen.de>
2694 * ctype.cc: Remove implementation of ctype functions in favor of
2695 pointer-based newlib implementation.
2696 (_ctype_b): Declare.
2697 (__ctype_cp): Move to newlib. Declare.
2698 (__ctype_iso): Ditto.
2699 (__set_ctype): Implement changing __ctype_ptr__. Only copy character
2700 class data in applications built under older Cygwin.
2701 * cygwin.din (__ctype_ptr__): Export.
2702 * include/ctype.h: Remove in favor of newlib implementation.
2703 * include/cygwin/config.h (__EXPORT): Define alongside __IMPORT.
2704 * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE):
2705 Define check for old vs. new ctype implementation.
2706 Bump API minor number.
2708 2009-03-28 Christopher Faylor <me+cygwin@cgf.cx>
2710 * Makefile.in: Perform some minor cleanup. Revamp speclib handling.
2711 * speclib: Rewrite to create libraries with dlltool rather than
2712 attempting surgery on libcygwin.a.
2714 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
2716 * net.cc (inet_ntop6): Convert to lowercase hex digits on the fly.
2718 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
2720 * net.cc (cygwin_getaddrinfo): Check hints for non-NULL before
2721 checking its content.
2723 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
2725 * fhandler.h (class fhandler_fifo): Rename read/write methods to
2727 * fhandler_fifo.cc: Ditto.
2729 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
2731 * syscalls.cc (pathconf): Fix memory leak.
2733 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
2735 * path.cc (symlink_worker): Write target filename as UTF-16 string
2736 with leading BOM marker.
2737 (symlink_info::check_shortcut): If check for leading BOM marker
2738 succeeds, read filename as UTF-16 string.
2739 (symlink_info::check_sysfile): Ditto.
2741 2009-03-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2743 * include/asm/byteorder.h (__ntohl): Align definition to ISO C99.
2746 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
2748 * strfuncs.cc (__set_charset_from_codepage): Revert to translating
2749 codepage 936 to "GBK".
2751 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
2753 * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two
2756 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
2758 * environ.cc (environ_init): Break from locale loop after first hit.
2759 * fhandler_console.cc (fhandler_console::write_normal): Print a SO
2760 sequence using always valid Unicode chars.
2762 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
2764 * strfuncs.cc (__kr_wctomb): Use codepage 51949 rather than 50949.
2765 (__kr_mbtowc): Ditto.
2766 (__set_charset_from_codepage): Ditto. Translate codepage 936 to
2767 "GB2312" and drop the charset name "GBK".
2769 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2771 * strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949.
2772 (__kr_mbtowc): Ditto.
2773 (__set_charset_from_codepage): Translate codepages 949 and 50949 to
2774 "EUCKR" and drop the charset name "CP949".
2776 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2778 * strfuncs.cc (sys_cp_mbstowcs): Don't read beyond src + nms.
2780 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2782 * shared_info.h (CURR_SHARED_MAGIC): Update.
2784 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2786 * wchar.h: Replace UINT with unsigned int.
2788 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2790 * wchar.h: Remove erroneous "C" specifier from extern declaration.
2792 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2794 * ctype.cc (_CTYPE_DATA_0_127): Add _B class to TAB character.
2795 (__ctype_default): New character class array for default ASCII
2797 (__ctype_iso): New array of character class array for ISO charsets.
2798 (__ctype_cp): Ditto for singlebyte Windows codepages.
2799 (tolower): Implement as distinct function to support any singlebyte
2802 (__set_ctype): New function to copy singlebyte character classes
2803 corresponding to current charset to ctype_b array.
2804 Align copyright text to upstream.
2805 * dcrt0.cc (dll_crt0_1): Reset current locale to "C" per POSIX.
2806 * environ.cc (set_file_api_mode): Remove.
2807 (codepage_init): Remove.
2808 (parse_thing): Remove "codepage" setting.
2809 (environ_init): Set locale according to environment settings, or
2810 to current codepage, before converting environment to multibyte.
2811 * fhandler.h (fhandler_console::write_replacement_char): Drop argument.
2812 * fhandler_console.cc (dev_console::str_to_con): Call sys_cp_mbstowcs
2813 rather than MultiByteToWideChar.
2814 (fhandler_console::write_replacement_char): Always print a funny
2815 half filled square if a character isn't in the current charset.
2816 (fhandler_console::write_normal): Convert to using __mbtowc
2817 rather than next_char.
2818 * fork.cc (frok::child): Drop call to set_file_api_mode.
2819 * globals.cc (enum codepage_type) Remove.
2820 (current_codepage): Remove.
2821 * miscfuncs.cc (cygwin_wcslwr): Unused, dangerous. Remove.
2822 (cygwin_wcsupr): Ditto.
2823 (is_cp_multibyte): Remove.
2824 (next_char): Remove.
2825 * miscfuncs.h (is_cp_multibyte): Drop declaration.
2827 * strfuncs.cc (get_cp): Remove.
2828 (__db_wctomb): New function to implement _wctomb_r functionality for
2829 doublebyte charsets using WideCharToMultiByte.
2830 (__sjis_wctomb): New function to replace unusable newlib function.
2831 (__jis_wctomb): Ditto.
2832 (__eucjp_wctomb): Ditto.
2833 (__gbk_wctomb): New function.
2834 (__kr_wctomb): Ditto.
2835 (__big5_wctomb): Ditto.
2836 (__db_mbtowc): New function to implement _mbtowc_r functionality for
2837 doublebyte charsets using MultiByteToWideChar.
2838 (__sjis_mbtowc): New function to replace unusable newlib function.
2839 (__jis_mbtowc): Ditto.
2840 (__eucjp_mbtowc): Ditto.
2841 (__gbk_mbtowc): New function.
2842 (__kr_mbtowc): New function
2843 (__big5_mbtowc): New function
2844 (__set_charset_from_codepage): New function.
2845 (sys_wcstombs): Reimplement, basically using same wide char to multibyte
2846 conversion as newlib's application level functions. Plus extras.
2847 Add lengthy comment to explain. Change return type to size_t.
2848 (sys_wcstombs_alloc): Just use sys_wcstombs. Change return type to
2850 (sys_cp_mbstowcs): Replace sys_mbstowcs, take additional codepage
2851 argument. Explain why. Change return type to size_t.
2852 (sys_mbstowcs_alloc): Just use sys_mbstowcs. Change return type to
2854 * wchar.h: Declare internal functions implemented in strfuncs.cc.
2855 (wcscasecmp): Remove.
2856 (wcsncasecmp): Remove.
2859 * winsup.h (codepage_init): Remove declaration.
2861 (sys_wcstombs): Align declaration to new implementation.
2862 (sys_wcstombs_alloc): Ditto.
2863 (sys_cp_mbstowcs): Add declaration.
2864 (sys_mbstowcs): Define as inline function.
2865 (sys_mbstowcs_alloc): Align declaration to new implementation.
2866 (set_file_api_mode): Remove declaration.
2867 * include/ctype.h (isblank): Redefine to use _B character class.
2868 (toupper): Remove ASCII-only definition.
2871 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2873 * sec_auth.cc (str2buf2uni): Remove.
2874 * security.h (str2buf2uni): Remove declaration.
2876 2009-03-24 Yaakov Selkowitz <yselkowitz@cygwin.com>
2878 * include/mntent.h: Remove declarations of nonexistant addmntent
2879 and hasmntopt. Update and clarify the /etc/mtab comment.
2881 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
2883 * smallprint.cc (__small_vsprintf): Handle NULL PWCHAR and
2884 PUNICODE_STRING arguments.
2885 (__small_vswprintf): Ditto.
2887 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
2889 * include/asm/byteorder.h (__constant_ntohs): Remove declaration.
2890 (__constant_ntohl): Ditto.
2892 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
2894 * cygwin.din: Export wordexp, wordfree.
2895 * posix.sgml: Move them to SUSv4 list.
2896 * include/cygwin/version.h: Bump API minor number.
2898 2009-03-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2900 * include/sys/un.h: #include <string.h> for strlen.
2902 2009-03-19 Corinna Vinschen <corinna@vinschen.de>
2904 * dlfcn.cc (get_full_path_of_dll): Revert patch from 2008-07-16.
2906 2009-03-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2908 * cygwin.din: Export log2, log2f as functions.
2909 * posix.sgml: Add them to SUSv4 list.
2910 * include/cygwin/version.h: Bump API minor number.
2912 2009-03-18 Corinna Vinschen <corinna@vinschen.de>
2914 * sec_auth.cc (lsaauth): Remove local definitions of struct
2915 _TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions
2917 (lsaprivkeyauth): As in lsaauth, fetch linked token if available and
2918 return that in favor of default token.
2920 2009-03-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2922 * errno.cc (_sys_errlist): Add ESTRPIPE.
2924 2009-03-15 Corinna Vinschen <corinna@vinschen.de>
2926 * cygwin.din: Export wcsdup.
2927 * posix.sgml: Add wcsdup to SUSv4 list.
2928 * include/cygwin/version.h: Bump API minor number.
2930 2009-03-15 Corinna Vinschen <corinna@vinschen.de>
2932 * include/inttypes.h: Remove "l" size specifier from all 16 and 32 bit
2935 2009-03-14 Christopher Faylor <me+cygwin@cgf.cx>
2937 * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered
2938 during initialization.
2940 2009-03-14 Corinna Vinschen <corinna@vinschen.de>
2942 * gendef: Remove STABS directives.
2944 2009-03-13 Corinna Vinschen <corinna@vinschen.de>
2946 * mktemp.cc: Remove STABS specific link-time warning. Align copyright
2949 2009-03-13 Corinna Vinschen <corinna@vinschen.de>
2951 * flock.cc: Fix lockf copyright to latest version.
2953 2009-03-12 Corinna Vinschen <corinna@vinschen.de>
2955 * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined
2957 (get_ino_by_handle): Take additional path_conv argument, accommodate
2958 throughout. Only use FileId if isgood_inode check is true.
2959 (fhandler_base::open_fs): Simplify setting ino due to above change.
2960 (readdir_get_ino): Make sure to return always a non-zero inode number.
2961 (fhandler_disk_file::readdir): Always open file in dir with
2962 FILE_OPEN_REPARSE_POINT so as not to open wrong file.
2963 Drop call to isgood_inode here.
2964 * path.cc (symlink_info::check): Call fs.update in case we're fetching
2965 file information from call to NtQueryDirectoryFile.
2967 2009-03-12 Corinna Vinschen <corinna@vinschen.de>
2969 * flock.cc (fhandler_disk_file::lock): Don't test file open mode in
2970 case of flock-type locks. Explain why.
2972 2009-03-12 Brian Ford <Brian.Ford@FlightSafety.com>
2974 * gethostby_helper: Fix typos in DEBUGGING case.
2976 2009-03-11 Corinna Vinschen <corinna@vinschen.de>
2978 * cygwin.din: Export wcscasecmp, wcsncasecmp.
2979 * posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list.
2980 * include/cygwin/version.h: Bump API minor number.
2982 2009-03-11 Corinna Vinschen <corinna@vinschen.de>
2984 * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf,
2986 * posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf
2988 * include/cygwin/version.h: Bump API minor number.
2990 2009-03-09 Corinna Vinschen <corinna@vinschen.de>
2992 * fhandler.h (fhandler_socket::wait_for_events): Take additional
2993 parameter "dontwait".
2994 * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the
2995 socket is non-blocking if dontwait is true.
2996 (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to
2997 set the wait_for_events dontwait parameter.
2998 (fhandler_socket::send_internal): Ditto. Optimize code slightly.
2999 * include/cygwin/socket.h (MSG_DONTWAIT): Define.
3000 * include/cygwin/version.h: Bump API minor number.
3002 2009-03-09 Corinna Vinschen <corinna@vinschen.de>
3004 * cygwin.din: Export wcsftime.
3005 * posix.sgml: Move wcsftime to SUSv4 list.
3006 * include/cygwin/version.h: Bump API minor number.
3008 2009-03-06 Pierre A. Humblet <pierre@phumblet.no-ip.org>
3010 * cygwin.din: Export gethostbyname2.
3011 * net.cc: define _CYGWIN_IN_H and include resolv.h.
3012 (realloc_ent): New function.
3013 (dup_ent): Call realloc_ent.
3014 (memcpy4to6): New function.
3015 (dn_length1): New function.
3016 (gethostby_helper): New function.
3017 (gethostbyname2): New function.
3018 * posix.sgml: Add gethostbyname2.
3019 * include/cygwin/version.h: Bump API minor number.
3020 * libc/minires.c (get_options): Look for "inet6" and apply bounds
3021 to "retry" and "retrans".
3022 (res_ninit): Set the default options at the beginning.
3023 (dn_expand): Fix "off by one".
3025 2009-03-06 Corinna Vinschen <corinna@vinschen.de>
3027 * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf,
3029 * posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf
3030 to SUSv4 list. Sort SUSv4 list.
3031 * include/cygwin/version.h: Bump API minor number.
3033 2009-03-04 Corinna Vinschen <corinna@vinschen.de>
3035 * dcrt0.cc (disable_dep): Disable. Explain why.
3036 (dll_crt0_0): Disable calling disable_dep. Explain why.
3038 2009-03-03 Corinna Vinschen <corinna@vinschen.de>
3040 * net.cc: Include asm/byteorder.h.
3041 (htonl): Move to end of file. Add comment to explain why. Align
3042 definition to POSIX. Use related macro from asm/byteorder.h.
3046 * include/asm/byteorder.h: Revert previous patch.
3048 2009-03-03 Corinna Vinschen <corinna@vinschen.de>
3050 * include/asm/byteorder.h: Disable optimization when building
3051 Cygwin network code.
3053 2009-02-26 Christopher Faylor <me+cygwin@cgf.cx>
3055 * dtable.cc (dtable::select_read): Add ability to override fh.
3056 * fhandler.h (fhandler_fifo::select_read): Declare new function.
3057 (fhandler_fifo::select_write): Ditto.
3058 (fhandler_fifo::select_except): Ditto.
3059 * select.cc (peek_pipe): Treat certain classes of pipe errors as "no
3061 (fhandler_fifo::select_read): Define new function.
3062 (fhandler_fifo::select_write): Ditto.
3063 (fhandler_fifo::select_except): Ditto.
3065 * shared_info.h (CURR_SHARED_MAGIC): Update.
3067 2009-02-23 Sjors Gielen <mailinglist@dazjorz.com>
3069 * Makefile.in: Add DESTDIR functionality.
3071 2009-02-23 Corinna Vinschen <corinna@vinschen.de>
3073 * sec_auth.cc (get_user_local_groups): Simplify LookupAccountName code.
3075 2009-02-20 Corinna Vinschen <corinna@vinschen.de>
3077 * autoload.cc (NetLocalGroupEnum): Remove.
3078 (NetLocalGroupGetMembers): Remove.
3079 (NetUserGetLocalGroups): Add.
3080 * sec_auth.cc (is_group_member): Remove function.
3081 (get_user_local_groups): Get user as string instead of as SID.
3082 Call NetUserGetLocalGroups instead of NetLocalGroupEnum. Drop call
3084 (get_server_groups): Call get_user_local_groups with user name instead
3087 2009-02-19 Corinna Vinschen <corinna@vinschen.de>
3089 * winver.rc: Fix Copyright date.
3091 2009-02-19 Corinna Vinschen <corinna@vinschen.de>
3093 * cygwin.din: Export mbsnrtowcs and wcsnrtombs.
3094 * posix.sgml: Move mbsnrtowcs and wcsnrtombs to SUSv4 section.
3095 * include/cygwin/version.h: Bump API minor number.
3097 2009-02-18 Corinna Vinschen <corinna@vinschen.de>
3099 * cygwin.din: Export open_wmemstream.
3100 * posix.sgml: Move open_wmemstream to SUSv4 section.
3101 * include/cygwin/version.h: Bump API minor number.
3103 2009-02-16 Corinna Vinschen <corinna@vinschen.de>
3105 * cygwin.din: Export reallocf.
3106 * malloc_wrapper.cc( reallocf): New function.
3107 * posix.sgml: Add reallocf to BSD section.
3108 * include/cygwin/version.h: Bump API minor number.
3109 * libc/fts.c: Remove erroneous reallocf definition.
3111 2009-02-16 Corinna Vinschen <corinna@vinschen.de>
3113 * cygwin.din: Export wcstoimax, wcstoumax.
3114 * posix.sgml: Move wcstoimax and wcstoumax to SUSv4 section.
3115 * include/inttypes.h: Declare wcstoimax and wcstoumax.
3116 * include/cygwin/version.h: Bump API minor number.
3118 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
3120 * cygwin.din: Export wcsnlen.
3121 * posix.sgml: Move wcsnlen to SUSv4 section.
3122 * include/cygwin/version.h: Bump API minor number.
3124 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
3126 * environ.cc (_getenv_r): New function.
3128 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
3130 * posix.sgml: Move dirfd to SUSv4 section.
3132 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
3134 * posix.sgml: Move interfaces deprecated in SUSv4 to deprecated
3135 interfaces section. Move interfaces added in SUSv4 to SUSv4
3136 section or, if unimplemented, add them to the unimplemented interfaces
3139 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
3141 * posix.sgml: Merge SUSv3 and SUSv4 section into a single SUSv4 section.
3142 Move Solaris calls now in SUSv4 to SUSv4 section. Rename unimplemented
3143 section to refer to SUSv4. Add note about missing interfaces.
3144 Move wcstod and wcstof from unimplemented to SUSv4 section.
3146 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
3148 * mount.cc (mount_info::from_fstab_line): Make cygdrive posix=0 by
3149 default as documented.
3151 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
3153 * cygwin.din: Export wcstod and wcstof.
3154 * include/cygwin/version.h: Bump API minor number.
3156 2009-02-11 Corinna Vinschen <corinna@vinschen.de>
3158 * syscalls.cc (open): Handle O_DIRECTORY flag.
3159 * include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH.
3160 * include/cygwin/version.h: Bump API minor number.
3162 2009-02-09 Corinna Vinschen <corinna@vinschen.de>
3164 * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix format. Add
3165 code to allow to read disk and CD/DVD devices in full length. Explain
3167 (fhandler_dev_floppy::raw_read): Add current position to debug output.
3169 * include/sys/sched.h: New stub file to override newlib file with
3170 clashing definitions.
3172 2009-02-05 Corinna Vinschen <corinna@vinschen.de>
3174 * cygwin.din: Export wcstok.
3175 * posix.sgml: Move wcstok from unimplemented to susv3.
3176 * include/cygwin/version.h: Bump API minor number.
3178 2009-02-04 Corinna Vinschen <corinna@vinschen.de>
3180 * fhandler_proc.cc (proc_tab): Add entry for mounts symlink.
3181 (format_proc_mounts): New function to implement mounts symlink.
3182 * fhandler_process.cc (process_tab): Add entry for mounts file.
3183 (format_process_mounts): New function to implement mounts file.
3185 2009-02-04 Corinna Vinschen <corinna@vinschen.de>
3187 * security.cc (alloc_sd): Disable generating default permission entries
3190 2009-01-29 Corinna Vinschen <corinna@vinschen.de>
3192 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number
3193 evaluation for faked "." entry.
3195 * mount.cc (fs_info::update): Move setting of is_cdrom after checking
3196 for caseinsensitivity. Recognize UDF in is_cdrom case and set
3197 caseinsensitive flag according to UDF brokenness determined by OS.
3198 Add comment to explain why.
3199 * mount.h (class fs_info): Add is_udf status flag.
3200 * path.cc (symlink_info::check): Add workaround for UDF bug in
3201 terms of casesensitivity on certain OSes.
3202 * wincap.h (wincaps::has_broken_udf): New element.
3203 * wincap.cc: Implement above element throughout.
3205 2009-01-27 Christopher Faylor <me+cygwin@cgf.cx>
3207 * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on
3208 EINTR or real error.
3209 (fhandler_base::write_overlapped): Assume that bytes_written will
3210 contain proper error value.
3211 * pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since
3212 signals are handled by pipe functions now.
3214 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
3216 * shared.cc (shared_name): New function for WCHAR names.
3217 (open_shared): Take name parameter as WCHAR. Accommodate throughout.
3218 * shared_info.h ((CURR_SHARED_MAGIC): Redefine.
3219 (shared_name): Add declaration for function taking a WCHAR name.
3220 (open_shared): Change declaration according to above change.
3221 * pinfo.cc (pinfo::init) : Accommodate above change.
3223 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
3225 * grp.cc (getgrgid_r): Simplify code by using stpcpy.
3226 (getgrnam_r): Ditto.
3227 * passwd.cc (getpwuid_r32): Simplify code by using stpcpy.
3228 (getpwnam_r): Ditto.
3230 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
3232 * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENT
3235 2009-01-24 Corinna Vinschen <corinna@vinschen.de>
3237 * mount.cc (mount_info::from_fstab): Open fstab file with
3238 FILE_OPEN_FOR_BACKUP_INTENT flag.
3240 2009-01-23 Corinna Vinschen <corinna@vinschen.de>
3242 * smallprint.cc (__small_vsprintf): Use already available buffer tmp
3245 2009-01-22 Christopher Faylor <me+cygwin@cgf.cx>
3247 * select.cc (peek_serial): Add hack to allow proper operation with
3250 2009-01-21 Corinna Vinschen <corinna@vinschen.de>
3252 Remove USE_SERVER define. Accommodate throughout.
3253 * configure.in: Remove --enable-server option.
3254 * configure: Regenerate.
3255 * environ.cc: Remove CYGWIN=server setting.
3257 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
3259 * fhandler_procnet.cc: Reorganize global procnet content data into a
3260 new struct virt_tab_t. Accommodate throughout.
3262 * fhandler.h: Fix copyright dates.
3263 * fhandler_process.cc: Ditto.
3264 * fhandler_registry.cc: Ditto.
3266 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
3268 * devices.h (FH_PROCESSFD): New device type.
3269 * dtable.cc (build_fh_pc): Add case for FH_PROCESSFD.
3270 * fhandler.h (class fhandler_virtual): Drop bufalloc member.
3271 * fhandler_virtual.h: New header.
3272 * fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor
3273 of types virt_type_t and virt_tab_t from fhandler_virtual.h.
3274 Change prototypes of format_XXX functions accordingly.
3275 (proc_tab): Drop size member info.
3276 (fhandler_proc::fill_filebuf): Don't allocate filebuf here. Allocate
3277 it in the format_XXX functions.
3278 * fhandler_process.cc: Reorganize global process content data into a
3279 new struct virt_tab_t. Accommodate throughout.
3280 (format_process_winexename): New function.
3281 (format_process_winpid): New function.
3282 (format_process_exename): New function.
3283 (format_process_root): New function.
3284 (format_process_cwd): New function.
3285 (format_process_cmdline): New function.
3286 (format_process_ppid): New function.
3287 (format_process_uid): New function.
3288 (format_process_pgid): New function.
3289 (format_process_sid): New function.
3290 (format_process_gid): New function.
3291 (format_process_ctty): New function.
3292 (format_process_fd): New function.
3293 * fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use
3295 * fhandler_registry.cc (fhandler_registry::fill_filebuf): Define
3297 * fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop
3298 initialization of bufalloc.
3299 (fhandler_virtual::dup): Drop copying bufalloc.
3301 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
3303 * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.
3304 * thread.cc (pthread_rwlock::rdlock): If a thread already owns a
3305 read lock, just count the number of locks for it, per SUSv4.
3306 (pthread_rwlock::tryrdlock): Ditto.
3307 (pthread_rwlock::unlock): If a thread has more than one concurrent
3308 read locks, just count down.
3310 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
3312 * autoload.cc (WSAIoctl): Reintroduce.
3313 (WSASendMsg): Define.
3314 * fhandler.h (class fhandler_socket): Change definition of recv_internal
3315 and send_internal to take WSAMSG pointer as parameter.
3316 * fhandler_socket.cc (WSAID_WSARECVMSG): Define.
3317 (LPFN_WSARECVMSG): Define.
3318 (WSASendMsg): Declare.
3319 (get_ext_funcptr): New function to fetch address of WSARecvMsg.
3320 (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter.
3321 Change code accordingly. If control information is requested,
3322 fetch address of WSARecvMsg and use that instead of WSARecvFrom.
3323 (fhandler_socket::recvfrom): Change return type to ssize_t as
3324 declared in fhandler.h. Accommodate changes to recv_internal.
3325 (fhandler_socket::recvmsg): Ditto. Make sure that control information
3326 is only requested if system, address family, and socket type support it.
3327 (fhandler_socket::send_internal): Take just a LPWSAMSG parameter
3328 and the flags. Change code accordingly. If control information is
3329 provided, use WSASendMsg instead of WSASendTo.
3330 (fhandler_socket::sendto): Drop useless comment. Accommodate changes
3332 (fhandler_socket::sendmsg): Ditto. Make sure that control information
3333 is only provided if system, address family, and socket type support it.
3334 * wincap.h (wincaps::has_recvmsg): New element.
3335 (wincaps::has_sendmsg): New element
3336 * wincap.cc: Implement above elements throughout.
3337 * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment
3338 of type struct cmsghdr.
3340 2009-01-17 Corinna Vinschen <corinna@vinschen.de>
3342 * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond
3345 2009-01-17 Corinna Vinschen <corinna@vinschen.de>
3347 * fhandler_proc.cc: Reorganize global proc content data into a new
3348 struct proc_tab_t. Accommodate throughout.
3349 (format_proc_version): New function.
3350 (format_proc_loadavg): New function.
3351 (format_proc_self): New function.
3353 * resource.cc (getrlimit): Return correct rlim_max value for
3356 2009-01-16 Corinna Vinschen <corinna@vinschen.de>
3358 * Fix copyright dates.
3360 2009-01-13 Corinna Vinschen <corinna@vinschen.de>
3362 * libc/getopt.c (parse_long_options): Use fix from NetBSD's getopt
3363 to avoid false ambiguities.
3365 2009-01-12 Corinna Vinschen <corinna@vinschen.de>
3367 * syscalls.cc (enum bin_status): New type.
3368 (try_to_bin): Return bin_status. Rename win32_path to pc. Rename h
3369 to fh. Rename fh to tmp_fh. Add code to set delete dispostion and
3370 more code to replace file moved to bin by another, temporary file.
3371 Add comments to explain why.
3372 (unlink_nt): Replace move_to_bin with bin_stat. Only set bin_stat
3373 to move_to_bin for non-remote files. As a last resort, call try_to_bin
3374 if setting delete-on-close failed. Only re-set R/O DOS attribute
3375 and only close handle if it's still valid.
3377 2009-01-11 Corinna Vinschen <corinna@vinschen.de>
3379 * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.
3380 * path.cc (path_conv::check): Set to and check for ENOENT instead of
3383 * path.cc (symlink_info::check): Fix Samba 3.2.x comment.
3385 2009-01-09 Corinna Vinschen <corinna@vinschen.de>
3387 * mount.cc (mount_info::from_fstab_line): Always convert drive
3388 letter in native path to uppercase.
3389 * path.cc (normalize_win32_path): Ditto.
3390 (path_prefix_p): Revert previous patch.
3392 * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
3393 return code to circumvent weird behaviour of Samba 3.2.x shares.
3395 2009-01-09 Christopher Faylor <me+cygwin@cgf.cx>
3397 * include/sys/cygwin.h (CW_SETERRNO): Define.
3398 * external.cc (CW_SETERRNO): Implement.
3399 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to
3400 reflect the above change.
3402 * path.cc (path_prefix_p): Treat X: as equivalent to x:.
3404 * mkglobals_h: Remove unneeded #define.
3406 * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
3408 2009-01-08 Corinna Vinschen <corinna@vinschen.de>
3410 * libc/fts.c (fts_build): Use DT_DIR case on Cygwin.
3411 (fts_ufslinks): Fix using wrong structure member in Cygwin-specific
3414 2009-01-07 Corinna Vinschen <corinna@vinschen.de>
3416 * ntdll.h: Reorder NT status flags. Fix a case difference. Add
3417 STATUS_CANNOT_DELETE flag.
3418 * syscalls.cc (unlink_nt): Change initial NtOpenFile to request
3419 FILE_SHARE_DELETE sharing mode. Change comment accordingly.
3420 If setting delete disposition failed with STATUS_CANNOT_DELETE, try
3421 to delete using delete-on-close. Explain why.
3422 Rearrange setting R/O DOS attribute after trying to delete. Simplify
3425 2009-01-07 Corinna Vinschen <corinna@vinschen.de>
3427 * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe if
3428 original file has .exe as well.
3429 * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit
3432 2009-01-02 Christopher Faylor <me+cygwin@cgf.cx>
3434 Remove unneeded header files from source files throughout.
3435 Update copyrights where appropriate.
3437 * globals.cc: New file for generic global variables.
3438 * mkglobals_h: New script to generate globals.h.
3439 * mkstatic: New script used to build a (currently non-working) static
3441 * Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
3442 (DLL_OFILES): Add globals.o. Make all objects rely on globals.h.
3443 (globals.h): New target. Generate globals.h.
3444 * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE
3445 operator is allowed in _cygtls.
3446 * dcrt0.cc: Move most globals to globals.cc.
3448 * environ.cc (strip_title_path): Remove now-unneeded extern.
3449 * fhandler_serial.cc (fhandler_serial::open): Ditto.
3451 (commune_process): Ditto.
3455 * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
3456 * path.cc (stat_suffixes): Move here.
3457 * security.h: Add forward class path_conv declaration.
3458 * smallprint.cc (__small_vsprintf): Make a true c++ function.
3459 (__small_sprintf): Ditto.
3460 (small_printf): Ditto.
3461 (console_printf): Ditto.
3462 (__small_vswprintf): Ditto.
3463 (__small_swprintf): Ditto.
3464 * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of
3466 (hExeced): Move to globals.cc
3467 * strfuncs.cc (current_codepage): Ditto.
3468 (active_codepage): Ditto.
3469 * sync.cc (lock_process::locker): Move here from dcrt0.cc.
3470 * syscalls.cc (stat_suffixes): Move to path.cc.
3471 * tty.cc (tty::create_master): Uncapitalize fatal warning for
3473 * winsup.h: Include globals.h to declare most of the grab bag list of
3474 globals which were previously defined here.
3476 * mount.h: Move USER_* defines back to shared_info.h.
3478 * speclib: Force temporary directory cleanup.
3480 2009-01-02 Christopher Faylor <me+cygwin@cgf.cx>
3482 * speclib: Rewrite completely in perl. Avoid multiple nm calls.