1 2009-09-28 Corinna Vinschen <corinna@vinschen.de>
3 * fhandler.h (class dev_console): Constify charset parameter of
5 * fhandler_console.cc (dev_console::con_to_str): Simplify. Always
6 default to the current internal locale.
7 (dev_console::get_console_cp): Always use codepage 437 for alternate
9 (dev_console::str_to_con): Constify charset parameter.
10 (fhandler_console::write_normal): Always use codepage 437 for alternate
11 charset. Otherwise always default to the current internal locale.
12 Replace ASCII SO with ASCII CAN.
13 * strfuncs.cc: Tweka comments according to below changes.
14 (sys_cp_wcstombs): Constify charset parameter. Convert all wchar_t
15 values in the Unicode private use area U+F0xx to the singlebyte
16 counterpart. Drop special handling creating ASCII SO sequence from
17 U+DCxx value. Rearrange for performance. Replace ASCII SO with
19 (sys_cp_mbstowcs): Constify charset parameter. Replace ASCII SO with
20 ASCII CAN. Drop special case for U+DCxx ASCII SO sequences. Always
21 create a replacement from the Unicode private use area U+F0xx for
22 invalid byte values in a multibyte sequence. Do the same for wchar_t
23 values from the U+F0xx range to make them roundtrip safe.
24 * wchar.h (sys_cp_wcstombs): Constify charset parameter.
25 (sys_cp_mbstowcs): Ditto.
27 2009-09-28 Corinna Vinschen <corinna@vinschen.de>
29 * cygheap.cc (cygheap_init): Default locale.charset to "UTF-8".
30 * dcrt0.cc (dll_crt0_1): Call setlocale (LC_CTYPE, "") here, just
31 before resetting application locale to "C".
32 * environ.cc (environ_init): Drop code setting locale here.
33 * syscalls.cc (check_codepage): Break out check for required codepage
34 from internal_setlocale.
35 (internal_setlocale): Just convert CWD and $PATH from old charset to
36 new charset and set internal charset.
37 (setlocale): Change accordingly. Don't require LC_ALL or LC_CTYPE to
38 store old locale value. Always call internal_setlocale if charset
39 changed due to locale environment changes.
41 2009-09-26 Eric Blake <ebb9@byu.net>
43 * exec.cc (fexecve): New function.
44 * cygwin.din (execvpe, fexecve): Export new fexecve and existing
46 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
47 * posix.sgml: Mention them.
49 2009-09-26 Eric Blake <ebb9@byu.net>
51 * syscalls.cc (link): Delete obsolete comment. Reject directories
52 and missing source up front.
53 (rename): Use correct errno for trailing '.'. Detect empty
54 strings. Allow trailing slash to newpath iff oldpath is
56 * dir.cc (mkdir): Reject dangling symlink with trailing slash.
57 * fhandler_disk_file.cc (fhandler_disk_file::link): Reject
59 * fhandler.cc (fhandler_base::link): Match Linux errno.
61 2009-09-25 Eric Blake <ebb9@byu.net>
63 * syscalls.cc (fchmodat): lchmod is not yet implemented.
64 (euidaccess): New function.
65 * path.cc (realpath): Update comment.
66 (canonicalize_file_name): New function.
67 * include/cygwin/stdlib.h (canonicalize_file_name): Declare it.
68 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
69 * cygwin.din: Export canonicalize_file_name, eaccess, euidaccess.
70 * posix.sgml: Mention them.
72 2009-09-25 Eric Blake <ebb9@byu.net>
74 * fhandler.h (fhandler_base::fhaccess): Add parameter.
75 * security.h (check_file_access, check_registry_access): Likewise.
76 * security.cc (check_file_access, check_registry_access)
77 (check_access): Implement new parameter.
78 * fhandler.cc (fhandler_base::fhaccess): Likewise.
79 (device_access_denied): Update caller.
80 * syscalls.cc (access, faccessat): Update callers.
81 * spawn.cc (find_exec, fixup): Likewise.
83 2009-09-24 Corinna Vinschen <corinna@vinschen.de>
85 * posix_ipc.cc (mq_open): Avoid closing the same descriptor twice in
89 2009-09-24 Corinna Vinschen <corinna@vinschen.de>
91 * kernel32.cc (CreateMutexW): Use correct access mask.
92 (CreateSemaphoreW): Ditto.
94 2009-09-23 Corinna Vinschen <corinna@vinschen.de>
96 * strfuncs.cc (__set_charset_from_codepage): Fetch current ANSI
99 2009-09-23 Corinna Vinschen <corinna@vinschen.de>
101 * strfuncs.cc (sys_cp_wcstombs): Convert lone surrogate pair
102 second halves to unambiguous ASCII SO sequence. When converting
103 chars invalid in current codepage to ASCII SO sequence, make
104 sure to check for surrogate pair second half only if at least
105 one wide characters is left. Decrement nwc if valid second half has
107 (sys_cp_mbstowcs): Improve ASCII SO handling. Never break from loop
108 if invalid character has been found. Recognize ASCII SO sequence
109 representing originally invalid mulitbyte char converted into a
110 lone surrogate pair second half. Convert accordingly.
112 2009-09-22 Corinna Vinschen <corinna@vinschen.de>
114 * autoload.cc (WSARecv): Define.
115 * fhandler_socket.cc (fhandler_socket::recv_internal): Call WSARecv
116 instead of WSARecvFrom if no name parameter is given. Explain why.
118 2009-09-22 Eric Blake <ebb9@byu.net>
120 * syscalls.cc (faccessat): Fix typo, reject bad flags.
121 (fchmodat, fchownat, fstatat, utimensat, linkat, unlinkat): Reject
124 2009-09-22 Corinna Vinschen <corinna@vinschen.de>
126 * strfuncs.cc (sys_cp_mbstowcs): Reset shift state after handling
127 invalid multibyte sequence.
129 2009-09-22 Corinna Vinschen <corinna@vinschen.de>
131 * path.cc (symlink_worker): Rework error handling to generate Linux
132 compatible errno in case of trailing slash in newpath.
134 2009-09-22 Eric Blake <ebb9@byu.net>
136 * dtable.h (OPEN_MAX_MAX): New macro.
137 * resource.cc (getrlimit) [RLIMIT_NOFILE]: Use it.
138 * dtable.cc (dtable::extend): Likewise.
139 * fcntl.cc (fcntl64): Obey POSIX rule with too-large F_DUPFD.
140 * syscalls.cc (dup2): Likewise.
142 2009-09-21 Corinna Vinschen <corinna@vinschen.de>
144 * cygheap.h (cwdstuff::get_posix): Convert to const inline method just
145 returning pointer to posix path.
146 (cwdstuff::reset_posix): Convert to non-inline method taking a wchar_t
148 * path.cc (cwdstuff::set): Revert change from 2009-05-13. Set posix
149 to valid incoming path again.
150 (cwdstuff::reset_posix): New implementation setting posix path from
151 incoming wchar_t path. Explain usage.
152 (cwdstuff::get_posix): Drop implementation.
153 (cwdstuff::get): Drop special case to handle empty posix path.
154 * syscalls.cc (internal_setlocale): Store old posix cwd as wide char
155 path. Restore posix cwd using new charset. Explain why.
157 2009-09-21 Corinna Vinschen <corinna@vinschen.de>
159 * fhandler_disk_file.cc (fhandler_disk_file::link): Drop faking hardlink
160 creation on filesystems not supporting hardlinks.
162 2009-09-20 Christopher Faylor <me+cygwin@cgf.cx>
164 * dcrt0.cc (dll_crt0_1): Add another hack to REALLY make sure that
165 cxx_malloc is always set to the cygwin version.
167 2009-09-20 Christopher Faylor <me+cygwin@cgf.cx>
169 * external.cc (cygwin_internal): Add hack to always reset cxx_malloc to
172 * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Relocate wayward
175 2009-09-19 Christopher Faylor <me+cygwin@cgf.cx>
177 * exceptions.cc (sigpacket::process): Explicitly set thread-specific
178 handler function to zero to avoid transferring to incorrect location.
179 (_cygtls::call_signal_handler): Don't transfer to handler if there is
180 no handler to transfer to.
182 2009-09-18 Christopher Faylor <me+cygwin@cgf.cx>
184 * exceptions.cc (sigpacket::process): Give sigwait() processing
185 precedence even when a handler is present.
187 * syscalls.cc (getpagesize): Change return to 'int'.
189 2009-09-16 Christopher Faylor <me+cygwin@cgf.cx>
191 * ntea.c (write_ea): Don't abort if not-samba.
193 2009-09-01 Christopher Faylor <me+cygwin@cgf.cx>
195 * select.cc (peek_console): Always check window size when there is ANY
198 2009-08-26 Corinna Vinschen <corinna@vinschen.de>
200 * path.h (INTERIX_SYMLINK_COOKIE): Define.
201 * path.cc (symlink_info::check_sysfile): Read Interix symlinks as well.
203 2009-08-26 Corinna Vinschen <corinna@vinschen.de>
205 * fhandler.cc (fhandler_base::open): Only set R/O attribute if ACLs
208 2009-08-24 Corinna Vinschen <corinna@vinschen.de>
210 * mount.cc (fs_info::update): Add comment.
211 * path.cc (symlink_info::check_reparse_point): Return -1 for volume
212 mount points. Explain why.
213 (symlink_info::check): Call fs.update again for volume mount points.
216 2009-08-24 Corinna Vinschen <corinna@vinschen.de>
218 * globals.cc (ro_u_volume): New R/O unicode string.
219 * path.cc (symlink_info::check_reparse_point): Fix check for volume
220 mount points to work on Vista and later as well.
222 2009-08-22 Corinna Vinschen <corinna@vinschen.de>
224 * strfuncs.cc (__set_charset_from_codepage): Add codepages 20866
225 (KOI8-R) and 21866 (KOI8-U).
227 2009-08-21 Christopher Faylor <me+cygwin@cgf.cx>
229 * dll_init.h (has_dtors): New flag.
230 (run_dtors): New wrapper function which avoids calling dtors more than
232 * dll_init.cc (dll_global_dtors): Use dll.run_dtors wrapper.
233 (dll_list::detach): Ditto.
234 (dll_list::alloc): Set has_dtors flag.
236 2009-08-21 Christopher Faylor <me+cygwin@cgf.cx>
238 * fcntl.cc (fcntl64): Detect negative fd as error.
240 2009-08-21 Corinna Vinschen <corinna@vinschen.de>
242 * mmap.cc (mmap64): Allocate fh_disk_file on cygheap. Delete
243 explicitely before returning.
245 2009-08-20 Corinna Vinschen <corinna@vinschen.de>
247 * dtable.cc (build_fh_dev): Take additional bool parameter indicating
248 whether set_name should be called or not.
249 (dtable::dup_worker): Call build_fh_pc with new second parameter set
250 to false. Explain why. If fhandler's dup failed, delete rather than
251 cfree newfh and set newfh to NULL to indicate failure correctly.
252 * dtable.h (build_fh_pc): Change declaration according to above change.
253 Default set_name parameter to true.
254 * mmap.cc (mmap_record::free_fh): Delete rather than cfree fh.
256 2009-08-18 Christopher Faylor <me+cygwin@cgf.cx>
258 * dtable.cc (dtable::fixup_after_exec): Close any popen'ed file handles here.
259 * fhandler.h (fhandler_*::ispipe): New function.
260 (fhandler_base::get_popen_pid): Define virtual function.
261 (fhandler_*::isdevice): Make const.
262 (fhandler_*::isfifo): Ditto.
264 2009-08-17 Christopher Faylor <me+cygwin@cgf.cx>
266 * syscalls.cc (popen): Reorganize slightly for clarity. Fix a comment.
268 2009-08-17 Christopher Faylor <me+cygwin@cgf.cx>
270 * syscalls.cc (popen): Rewrite to accommodate situations where stdin,
271 stdout, or stderr are closed.
273 2009-08-17 Christopher Faylor <me+cygwin@cgf.cx>
275 * pipe.cc (fhandler_pipe::create_selectable): Add -pipe to default pipe names.
277 * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Use bool/true/false
278 for what is actually a boolean variable.
280 2009-08-14 Corinna Vinschen <corinna@vinschen.de>
282 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix length
285 2009-08-14 Corinna Vinschen <corinna@vinschen.de>
287 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Change comment
290 2009-08-14 Corinna Vinschen <corinna@vinschen.de>
292 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Remove
293 ill-advised attempt to optimize "." and ".." handling by checking for
294 specific position in directory listing. Explain why.
295 (fhandler_disk_file.cc (fhandler_disk_file::readdir): Ditto.
296 Special-case opening file on NFS to fetch inode number and add longish
297 comment to explain why.
299 2009-08-14 Corinna Vinschen <corinna@vinschen.de>
301 * (fhandler_socket::getsockname): Fix length returned for unbound
303 (fhandler_socket::getpeername): Ditto.
304 * net.cc (socketpair): Don't set sun_path and peer_sun_path to
305 make sure getsockname and getpeername return the correct values
306 for AF_LOCAL sockets.
308 2009-08-13 Corinna Vinschen <corinna@vinschen.de>
310 * fhandler_socket.cc (fhandler_socket::accept): Use sizeof rather
311 then constant size. Truncate returned data, but return full address
313 (fhandler_socket::getsockname): Truncate returned data, but return full
314 address length as per POSIX.
315 (fhandler_socket::getpeername): Ditto.
317 2009-08-13 Corinna Vinschen <corinna@vinschen.de>
319 * fhandler.h (class fhandler_socket): Add peer_sun_path member.
320 (fhandler_socket::set_peer_sun_path): New method.
321 (fhandler_socket::get_peer_sun_path): New method.
322 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
323 peer_sun_path to NULL.
324 (fhandler_socket::~fhandler_socket): Free peer_sun_path if necessary.
325 (fhandler_socket::dup): Duplicate peer_sun_path.
326 (fhandler_socket::accept): Ditto. Return fake unbound peer content
327 and len in case of AF_LOCAL sockets.
328 (fhandler_socket::getsockname): Always use local sockaddr_storage to
329 store socket address and copy over to incoming address. Handle every
330 namelen correctly per POSIX.
331 (fhandler_socket::getpeername): Ditto. Add code path to return
332 correct value for AF_LOCAL sockets.
333 (fhandler_socket::set_peer_sun_path): New method.
334 * net.cc (socketpair): Set peer_sun_path to empty string, just like
337 2009-08-13 Corinna Vinschen <corinna@vinschen.de>
338 Dave Korn <dave.korn.cygwin@googlemail.com>
340 * cxx.cc (default_cygwin_cxx_malloc): Enhance commenting.
341 * dll_init.cc (dll_dllcrt0_1): Likewise.
342 * dlfcn.cc (dlopen): Prevent dlopen()'d DLL from installing any
343 cxx malloc overrides.
344 * include/cygwin/cygwin_dll.h (__dynamically_loaded): New variable.
345 * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Check it and only
346 install cxx malloc overrides when statically loaded. Extend comments.
348 2009-08-12 Corinna Vinschen <corinna@vinschen.de>
350 * fhandler_socket.cc (fhandler_socket::accept): Always use local
351 sockaddr_storage to store peer address and copy over to incoming
352 peer address if available. Truncate data as necessary according
355 2009-08-11 Corinna Vinschen <corinna@vinschen.de>
357 * include/limits.h (NGROUPS_MAX): Set to a more sane value.
358 * include/sys/param.h (NGROUPS): Ditto.
360 2009-08-10 Corinna Vinschen <corinna@vinschen.de>
362 * spawn.cc (av::fixup): Check shell scripts for executability only on
363 filesystems/mounts supporting real permissions.
365 2009-08-10 Corinna Vinschen <corinna@vinschen.de>
367 * dtable.cc (DEV_SOCKET): New static WCHAR string. Name of
368 the native NT socket device.
369 (dtable::init_std_file_from_handle): Remove unused tmp_pathbuf
370 variable. Move check for sockets into FILE_TYPE_PIPE clause.
371 Rely on handle_to_fn having recognized socket, or check if
372 getsockopt works to accommodate NT4 shortcoming.
373 (handle_to_fn): Use tmp_pathbuf for OBJECT_NAME_INFORMATION
374 buffer and simplify code due to that. Check name returned by
375 NtQueryObject for socket device.
377 2009-08-10 Christopher Faylor <me+cygwin@cgf.cx>
379 * fhandler_console.cc (create_invisible_console_workaround): Fix size
380 of cmd in the way originally intended.
382 2009-08-10 Corinna Vinschen <corinna@vinschen.de>
384 * fhandler_console.cc (create_invisible_console_workaround): Fix
385 size of cmd to take spaces into account.
387 2009-08-08 Corinna Vinschen <corinna@vinschen.de>
389 * dtable.cc (dtable::init_std_file_from_handle): Fix comment to
390 document change in the Windows 7 workaround.
391 * wincap.cc (wincapc::init): Don't set has_console_handle_problem
392 to false on 32 bit systems.
394 2009-08-06 Corinna Vinschen <corinna@vinschen.de>
396 * net.cc (cygwin_getnameinfo): Force setting NI_NUMERICSERV only
397 on Windows 2003 and earlier, only if the port number doesn't
398 resolve to a well-known service. Change comment accordingly.
400 2009-08-05 Christopher Faylor <me+cygwin@cgf.cx>
402 * cygheap.h (cygheap_debug::endh): Delete.
403 * debug.cc (lock_debug::acquired): Delete.
404 (lock_debug::lock_debug): Simplify.
405 (lock_debug::unlock): Ditto.
406 (find_handle): Don't set endh here.
407 (add_handle): Add new handle to beginning of the list rather than
408 trying to maintain an end list pointer.
409 (delete_handle): Minor optimization.
410 (mark_closed): Make logic clearer.
411 (verify_handle): Lock handle list before scanning.
413 (modify_handle): Ditto.
414 (newh): Don't lock handle list here. Assume caller did this.
415 (mark_closed): Ditto.
416 (close_handle): Remove unneeded #if.
417 * dtable.cc (dtable::dup2): Tweak debug output.
419 2009-08-04 Christopher Faylor <me+cygwin@cgf.cx>
421 * path.cc (patch_conv::check): Zero path before setting it.
423 2009-08-04 Christopher Faylor <me+cygwin@cgf.cx>
425 * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem
426 size if the length exceeds it.
427 * net.cc (fdsock): Use 65535 as window size, just like the comment
428 says or we run into problems with DuplicateHandle.
430 * path.cc (patch_conv::check): Use set_path to set invalid filename.
431 * path.h (path_conv::path_conv): Ditto.
433 2009-08-04 Christopher Faylor <me+cygwin@cgf.cx>
435 * fhandler.h (pdrive_buf): Defensively allocate one extra byte.
437 2009-08-04 Christopher Faylor <me+cygwin@cgf.cx>
439 * fhandler.h (fhandler_cygdrive:DRVSZ): New enum.
440 (pdrive_buf): New place to hold information about cygdrive.
441 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Store drive
442 info in pdrive_buf since get_win32_name() could now be too small to
444 (fhandler_cygdrive::rewinddir): Reset pdrive to pdrive_buf.
445 (fhandler_cygdrive::closedir): Ditto.
446 * pipe.cc (fhandler_pipe::init): Be more defensive when referencing
447 get_win32_name(). Rework logic which made a copy of the POSIX path and
450 2009-08-02 Christopher Faylor <me+cygwin@cgf.cx>
452 * sigproc.cc (stopped_or_terminated): Don't return a match when stopsig
453 == SIGCONT and not WCONTINUED.
454 * termios.cc (tcsetpgrp): Improve debugging output.
456 2009-08-01 Christopher Faylor <me+cygwin@cgf.cx>
458 * cygheap_malloc.h: New file.
459 * cygheap.h: Remove stuff now included in cygheap_malloc.h and include
460 that file. Make cygheap_init a standard c++ function. Remove unneeded
461 child_info declaration.
462 * path.h: Include cygheap_malloc.h. Remove extra cstrdup declaration.
463 (path_conv): Reorganize to group variables together.
464 (path_conv::path): Make const char *.
465 (path_conv::known_suffix): Ditto.
466 (path_conv::normalized_path): Ditto.
467 (path_conv::path_conv): Reorganize initializers to reflect new element
469 (path_conv::get_win32): Change return value to const char *.
470 (path_conv::set_path): Move back here from spawn.cc.
471 (parh_conv::modifiable_path): New function.
472 * path.cc (path_conv::add_ext_from_sym): Accommodate const'ness of
474 (path_conv::set_normalized_path): Ditto for normalized_path.
475 (path_conv::check): Use modifiable_path whereever we need to modify the
476 path element. Use set_path to set the path.
477 (path_conv::~path_conv): Accommodate new const'ness.
478 * spawn.cc (perhaps_suffix): Declare ext as const since that's what is
480 (path_conv::set_path): Move back to path.h.
481 * winf.f (linebuf): Perform minor cleanup.
482 (linebuf::fromargv): Change second parameter to const.
483 * winf.cc (linebuf::fromargv): Ditto.
485 2009-08-01 Christopher Faylor <me+cygwin@cgf.cx>
487 * path.h (path_conv::set_path): Change return value.
488 * spawn.cc (path_conv::set_path): Return newly set value.
489 (find_exec): Set retval to newly set value when calling set_path.
491 2009-07-31 Christopher Faylor <me+cygwin@cgf.cx>
493 * spawn.cc (find_exec): Fix one more path where retval was not set.
495 2009-07-31 Christopher Faylor <me+cygwin@cgf.cx>
497 * spawn.cc (find_exec): Stop relying on the ability to set retval to a
498 fixed path_conv buffer and set it on the fly instead.
500 2009-07-30 Corinna Vinschen <corinna@vinschen.de>
502 * path.h (cstrdup): Fix declaration.
504 2009-07-29 Dave Korn <dave.korn.cygwin@googlemail.com>
506 * globals.cc (enum exit_states::ES_GLOBAL_DTORS): Delete.
507 * dcrt0.cc (__main): Schedule dll_global_dtors to run
508 atexit before global dtors.
509 (do_exit): Delete test for ES_GLOBAL_DTORS and call to
512 2009-07-29 Corinna Vinschen <corinna@vinschen.de>
514 * path.h (class path_conv): Convert path from char array to char *.
515 Initialize to NULL in constructors. Drop normalized_path_size member.
516 (path_conv::size): Remove.
517 (path_conv::operator =): Always copy with sizeof path_conv. Always
518 duplicate path on cygheap.
519 (path_conv::set_path): Move implementation to spawn.cc.
520 * path.cc (path_conv::set_normalized_path): Always allocate
521 normalized_path on cygheap.
522 (path_conv::check): Don't work on path, rather allocate THIS_path in
523 TLS and use it throughout. When finished, allocate path on cygheap
524 and copy over. Defer tacking on extension after having copied path.
525 * spawn.cc (path_conv::set_path): Implement here.
527 2009-07-27 Corinna Vinschen <corinna@vinschen.de>
529 * mount.h (enum fs_info_type): New type.
530 (IMPLEMENT_FS_FLAG): New define.
531 (class fs_info): Convert filesystem type status flags into an enum
532 fs_info_type. Add cifs FS. Revert change to has_buggy_open and
533 has_buggy_fileid_dirinfo. Make them normal; status flags again.
534 Implement is_FS functions using IMPLEMENT_FS_FLAG.
535 * mount.cc (fs_info::update): Define MINIMAL_WIN_NTFS_FLAGS and
536 FS_IS_WINDOWS_NTFS. Add comment. Only test remote filesystems
537 for "NTFS" once. Add is_cifs check using FS_IS_WINDOWS_NTFS.
538 Set has_buggy_open flag for SUNWNFS. Set has_buggy_fileid_dirinfo
539 flag for UNIXFS and all cifs type filesystems. Only check for
540 caseinsensitivity once.
541 (fillout_mntent): Create locale fs_names array. Use for setting
542 _my_tls.locals.mnt_type.
544 2009-07-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
546 * posix.sgml (std-notes): Remove obsolete reference to CYGWIN=server.
548 2009-07-25 Corinna Vinschen <corinna@vinschen.de>
550 * posix.sgml (std-notes): Add flock restriction.
552 2009-07-25 Corinna Vinschen <corinna@vinschen.de>
554 * fhandler_console.cc (set_console_title): Set buffer size to
555 TITLESIZE + 1. Call sys_mbstowcs with correct destination length.
557 2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
559 * sigproc.h (wait_for_sigthread): Eliminate parameter.
560 * sigproc.cc (wait_for_sigthread): Ditto. Don't synchronize with
561 wait_sig after receiving an event that it is ready to go.
562 (init_sig_pipe): New function.
563 (wait_sig): Call init_sig_pipe to create pipes for communicating
564 signals to this process. Don't send sigCONT signal when initializing.
565 * fork.cc (frok::child): Accommodate wait_for_sigpipe parameter change.
567 2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
569 * fhandler.h (fhandler_*::write): Make ssize_t/__stdcall.
570 (fhandler_*::write_overlapped): Ditto.
571 (fhandler_*::raw_write): Ditto.
572 (fhandler_*::readv): Ditto.
573 (fhandler_*::writev): Ditto.
574 (fhandler_*::raw_read): Make __stdcall.
575 * fhandler: Accommodate changes to read/write functions throughout.
576 * fhandler_clipboard.cc: Ditto.
577 * fhandler_console.cc: Ditto.
578 * fhandler_dsp.cc: Ditto.
579 * fhandler_fifo.cc: Ditto.
580 * fhandler_mailslot.cc: Ditto.
581 * fhandler_mem.cc: Ditto.
582 * fhandler_mem.cc: Ditto.
583 * fhandler_random.cc: Ditto.
584 * fhandler_tape.cc: Ditto.
585 * fhandler_tty.cc: Ditto.
586 * fhandler_virtual.cc: Ditto.
587 * fhandler_windows.cc: Ditto.
588 * fhandler_zero.cc: Ditto.
589 * syscalls.cc (readv): Use ssize_t as temp variable.
591 * fhandler.cc (fhandler_base::read): Coerce returned len to signed or
592 it will never be treated as < 0.
593 (fhandler_base::wait_overlapped): Minimize calls to GetLastError.
594 Remove duplicate debugging test. Fix error return.
596 * fhandler.h (fhandler_fifo::fifo_name): Declare new function.
597 (fhandler_fifo::close): Ditto.
598 (fhandler_fifo::dup): Ditto.
599 (fhandler_fifo::close_on_exec): Ditto.
600 * fhandler.cc (fhandler_fifo::fifo_name): Define new function.
601 (FIFO_BUF_SIZE): New define.
603 (fhandler_fifo::open): Rework. Use cnp to open named pipe. Always
604 open write side as a client. Open dummy client when writing and can't
606 (wait): Rework. Implement fifo_wait_for_next_client. Handle signals
607 during connect better. Add new fifo_wait_for_server code which polls
608 (sigh) waiting for server.
609 (fhandler_fifo::raw_read): Handle transition states when one client
610 closes and another is available.
611 (fhandler_fifo::close): Define.
612 (fhandler_fifo::dup): Ditto.
613 (fhandler_fifo::close_on_exec): Ditto.
615 2009-07-24 Corinna Vinschen <corinna@vinschen.de>
617 * syscalls.cc (internal_setlocale): Fix typo in GBK codepage.
619 2009-07-24 Corinna Vinschen <corinna@vinschen.de>
621 * syscalls.cc (unlink_nt): Ignore sharing violation on NFS. Align
624 2009-07-23 Corinna Vinschen <corinna@vinschen.de>
626 * mount.h (fs_info::fsn): New member.
627 (fs_info::clear): Clear fsn.
628 (fs_info::fsname): New read accessor for fsn.
629 * mount.cc (fs_info::update): Fill in fsn member with lowercased
630 filesystem name if filesystem is not well-known. Fall back to
631 "unknown" if filesystem name is missing.
632 (fillout_mntent): Print filesystem name retrieved in fs_info::update
633 rather than static string "unknown".
635 2009-07-23 Corinna Vinschen <corinna@vinschen.de>
637 * mount.cc (fs_info::update): Revert to open filesystem with access set
638 to READ_CONTROL. If that fails, try additionally with FILE_READ_DATA.
640 2009-07-22 Eric Blake <ebb9@byu.net>
642 * exceptions.cc (handle_exceptions): Set si_addr according to
645 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
647 * mount.cc (fs_info::update): Open filesystem with access set to 0.
650 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
652 * mount.cc: Revert accidental checkin.
654 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
656 * path.cc (symlink_info::check): Handle STATUS_NOT_SUPPORTED from
657 NtCreateFile just like STATUS_EAS_NOT_SUPPORTED.
659 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
661 * mount.cc (fillout_mntent): Fix typo (noexec -> notexec).
663 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
665 * path.cc (symlink_info::check): Fix typo in comment.
667 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
669 * fhandler.h (enum del_lock_called_from): New enumeration.
670 (fhandler_base::del_my_locks): Declare taking a del_lock_called_from
672 * fhandler.cc (fhandler_base::close): Call del_my_locks with "on_close".
673 (fhandler_base::fixup_after_fork): Call del_my_locks with "after_fork".
674 (fhandler_base::fixup_after_exec): Call del_my_locks with "after_exec".
675 * flock.cc (fhandler_base::del_my_locks): Take del_lock_called_from
676 as argument. Call node->del_my_locks with NULL handle in after_exec
679 2009-07-21 Eric Blake <ebb9@byu.net>
681 * dtable.cc (dup2): Correct return value for no-op.
683 2009-07-21 Corinna Vinschen <corinna@vinschen.de>
684 Eric Blake <ebb9@byu.net>
686 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Add special case
687 for MVFS. Explain why.
688 (fhandler_disk_file::utimens): Drop local variables lastaccess and
689 lastwrite. Copy timestamps right into FILE_BASIC_INFORMATION structure
690 to avoid copying them twice.
692 2009-07-20 Corinna Vinschen <corinna@vinschen.de>
694 * wincap.h (wincaps::has_always_all_codepages): New element.
695 * wincap.cc: Implement above element throughout.
696 * wchar.h (__sjis_mbtowc): Declare.
697 (__eucjp_mbtowc): Ditto.
698 (__gbk_mbtowc): Ditto.
699 (__kr_mbtowc): Ditto.
700 (__big5_mbtowc): Ditto.
701 * syscalls.cc (internal_setlocale): Convert to char * function.
702 Return parameter by default. Return NULL if request to use a
703 charset can't be satisfied due to missing codepage support in the
704 underlying OS. Fix comment.
705 (setlocale): Store original locale. Restore to original locale if
706 internal_setlocale returns NULL.
708 2009-07-20 Corinna Vinschen <corinna@vinschen.de>
710 * fork.cc (fork): Create local tmp_pathbuf. Explain why.
712 2009-07-18 Christopher Faylor <me+cygwin@cgf.cx>
714 * exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when
716 (stopped_or_terminated): Honor WCONTINUED.
717 * wait.cc (wait4): Ditto.
718 * include/cygwin/wait.h (WCONTINUED): Define.
719 (__W_CONTINUED): Ditto.
720 (WIFCONTINUED): Ditto.
722 2009-07-18 Dave Korn <dave.korn.cygwin@gmail.com>
724 * libstdcxx_wrapper.cc (operator delete): Remove stray space in
727 2009-07-17 Christopher Faylor <me+cygwin@cgf.cx>
729 * cygtls.cc (_cygtls::init_exception_handler): Test for e, not e->prev
730 or we could still end up adding our handler twice. Add comment
731 explaining what we're doing.
732 * dll_init.cc (dll_dllcrt0_1): Clarify comment.
734 2009-07-17 Christopher Faylor <me+cygwin@cgf.cx>
736 * cygtls.cc (_cygtls::init_exception_handler): Avoid adding our
737 exception handler twice.
739 2009-07-17 Corinna Vinschen <corinna@vinschen.de>
741 * syscalls.cc (unlink_nt): Just return when a sharing violation
742 occurs on remote filesystems.
744 2009-07-17 Corinna Vinschen <corinna@vinschen.de>
746 * globals.cc: Improve comment on R/O UNICODE_STRINGs.
747 * mount.h (class fs_info): Add is_mvfs bit.
748 * mount.cc (fs_info::update): Recognize MVFS remote filesystem.
749 (fillout_mntent): Reorder filesystem checks for speed. Add
750 mvfs, unixfs, and sunwnfs filesystem types.
751 * path.h (class path_conv): Add fs_is_mvfs method.
752 * path.cc (symlink_worker): On MVFS, always create symlinks as
753 Windows shortcuts. Explain why.
755 2009-07-16 Corinna Vinschen <corinna@vinschen.de>
757 * syscalls.cc (unlink_nt): First remove the R/O DOS attribute with
758 FILE_WRITE_ATTRIBUTES access only, then re-open the file for DELETE.
761 2009-07-16 Corinna Vinschen <corinna@vinschen.de>
763 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Remove file
764 attribute check already done in NtSetAttributesFile.
766 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
768 * globals.cc: Reorder constant UNICODE_STRINGs for clarity.
769 * mount.h (fs_info::sttaus): Move filesystem type flags into
770 substructure. Add union to allow simple test for having set any
771 one filesystem type flag. Replace has_buggy_open flag with is_sunwnfs
772 flag. Replace has_buggy_fileid_dirinfo with is_unixfs flag.
773 (fs_info::got_fs): New private method.
774 (fs_info::has_buggy_open): New explicit implementation.
775 (fs_info::has_buggy_fileid_dirinfo): Ditto.
776 * mount.cc (fs_info::update): Optimize filesystem checks for speed.
777 * winsup.h (IMPLEMENT_STATUS_FLAG): Change write accessor to return
780 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
782 * fhandler_netdrive.cc (GET_RESOURCE_INFO): Remove.
783 (thread_netdrive): Drop GET_RESOURCE_INFO case.
784 (fhandler_netdrive::exists): Use GET_RESOURCE_OPENENUM info class
785 to check for existance.
787 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
789 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Remove useless
792 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
794 * path.cc (cwdstuff::set): Only fix up UNC path in win32 so as not
795 to overwrite incoming path.
797 2009-07-14 Corinna Vinschen <corinna@vinschen.de>
799 Throughout avoid having to initialize constant UNICODE_STRINGs.
800 * globals.cc: Define constant UNICODE_STRINGs and store in .rdata
802 * fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs
803 rather then initializing local UNICODE_STRING variable where
805 * fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
806 * flock.cc (inode_t::inode_t): Ditto.
808 * syscalls.cc: Ditto.
809 * mount.cc (fs_info::update): Ditto.
812 * ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as
814 (RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING.
815 * fhandler_disk_file.cc: Accommodate throughout.
816 * mount.cc (fs_info::update): Ditto.
817 * path.cc (cwdstuff::set): Ditto.
818 * syscalls.cc: Ditto.
820 2009-07-14 Corinna Vinschen <corinna@vinschen.de>
822 * globals.cc (active_codepage): Remove.
824 2009-07-12 Christopher Faylor <me+cygwin@cgf.cx>
826 * how-spawn-works.txt: Add "out of date" note.
827 * how-vfork-works.txt: Ditto.
829 2009-07-12 Christopher Faylor <me+cygwin@cgf.cx>
831 * Makefile.in: Don't do anything special with any RCS directories.
833 * ntdll.h (PROCESSINFOCLASS): Remove unneeded trailing comma.
835 * pinfo.cc (_pinfo::dup_proc_pipe): Remove unneeded assignment.
837 * sigproc.cc (sig_send): Don't send signal to myself if this is an exec
840 2009-07-12 Corinna Vinschen <corinna@vinschen.de>
842 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Don't use
843 FileAllInformation info class since it needs a big buffer. Add a
846 2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com>
848 * winbase.h (ilockexch): Avoid making 'ret' volatile.
849 (ilockcmpexch): Likewise.
851 2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com>
853 * Makefile.in (DLL_OFILES): Add libstdcxx_wrapper.o
854 (libstdcxx_wrapper_CFLAGS): Add flags for new module.
855 (_cygwin_crt0_common_STDINCFLAGS): Define per-file override.
856 (libstdcxx_wrapper_STDINCFLAGS, cxx_STDINCFLAGS): Likewise.
857 * cxx.cc: Include "cygwin-cxx.h".
858 (operator new): Tweak prototype for full standards compliance.
859 (operator new[]): Likewise.
860 (operator new (nothrow)): New fallback function.
861 (operator new[] (nothrow), operator delete (nothrow),
862 operator delete[] (nothrow)): Likewise.
863 (default_cygwin_cxx_malloc): New struct of pointers to the above,
864 for final last-resort fallback default.
865 * cygwin-cxx.h: New file.
866 (struct per_process_cxx_malloc): Define.
867 (default_cygwin_cxx_malloc): Declare extern.
868 * cygwin.din (__wrap__ZdaPv): Export new wrapper.
869 (__wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
870 __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
871 __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
872 __wrap__ZnwjRKSt9nothrow_t): Likewise.
873 * globals.cc (__cygwin_user_data): Init newly-repurposed 'forkee'
874 field (now 'cxx_malloc') to point to default_cygwin_cxx_malloc.
875 * libstdcxx_wrapper.cc: New file.
876 (__wrap__ZdaPv, __wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
877 __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
878 __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
879 __wrap__ZnwjRKSt9nothrow_t): Define wrapper functions for libstdc++
880 malloc operators and their overrides.
881 * winsup.h (default_cygwin_cxx_malloc): Declare extern.
882 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
883 * include/sys/cygwin.h (struct per_process_cxx_malloc): Forward
885 (struct per_process::forkee): Rename and repurpose from this ...
886 (struct per_process::cxx_malloc): ... to this.
887 * lib/_cygwin_crt0_common.cc: Include cygwin-cxx.h.
888 (WEAK): Define shorthand helper macro.
889 (__cygwin_cxx_malloc): Define and populate with weak references
890 to whatever libstdc++ malloc operators will be visible at final
891 link time for Cygwin apps and dlls.
892 (_cygwin_crt0_common): Always look up cygwin DLL's internal
893 per_process data, and don't test for (impossible) failure. Inherit
894 any members of __cygwin_cxx_malloc that we don't have overrides
895 for from the DLL's default and store the resulting overall set of
896 overrides back into the DLL's global per_process data.
898 2009-07-07 Corinna Vinschen <corinna@vinschen.de>
900 * cygtls.cc (_cygtls::remove): Fix typo.
902 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
904 * Makefile.in (clean): Clean generated files in srcdir.
905 * tlsoffsets.h: Regenerate.
907 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
909 * cygtls.cc (_cygtls::remove): Avoid closing a NULL handle.
911 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
913 * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabuf
914 and wsacnt to references. Fix handling of WSAEMSGSIZE.
916 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
918 * cygtls.h (struct _local_storage): Add thread storage pointers for
919 memory used by socket select functions. Combine them into a single
921 * cygtls.cc: Accommodate above change throughout.
922 (_cygtls::init_thread): Drop initalizing of sockevt to
923 INVALID_HANDLE_VALUE.
924 (_cygtls::fixup_after_fork): Reset sockevt to NULL.
925 (_cygtls::remove): Don't use sockevt value to bail out prematurely.
926 Set sockevt to NULL. Free malloced select members.
927 * select.h (struct select_socket_info): Drop max_w4 member.
928 * select.cc (thread_socket): Use INFINITE timeout value if number of
929 objects to wait for is <= MAXIMUM_WAIT_OBJECTS. Use num_w4 member
930 of select_socket_info struct rather than dropped max_w4.
931 (init_tls_select_info): New inline function to initialize TLS select
933 (start_thread_socket): Just call init_tls_select_info to initialize TLS
934 select members and use them later on.
935 (socket_cleanup): Don't free select_socket_info pointer members since
936 they are thread local now.
938 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
940 * dtable.cc (handle_to_fn): Detect failing NtQueryObject.
942 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
944 * autoload.cc: Delete stray CR.
946 2009-07-05 Christopher Faylor <me+cygwin@cgf.cx>
948 * fhandler_console.cc: Change workstation -> windows station
951 2009-07-04 Christopher Faylor <me+cygwin@cgf.cx>
953 * autoload.cc (SetParent): Add new import.
954 * fhandler.h (fhandler_console::create_invisible_console): Declare new
956 (create_invisible_console_workaround): Ditto.
957 * fhandler_console.cc (fhandler_console::create_invisible_console):
959 (create_invisible_console_workaround): Ditto. Add too much code to
960 deal with broken Windows 7. Use a helper app to start an invisible
962 (fhandler_console::need_invisible): Reorganize to use helper functions
963 to create invisible console.
965 * spawn.cc (spawn_guts): Avoid zeroing already zeroed fields in si.
967 2009-07-04 Dave Korn <dave.korn.cygwin@gmail.com>
969 * autoload.cc (AttachConsole): Correct size of args.
971 2009-07-03 Christopher Faylor <me+cygwin@cgf.cx>
973 * dcrt0.cc (jit_debug): New global.
974 (initial_env): Set jit_debug when we are automatically starting a gdb
976 * dtable.cc (dtable::get_debugger_info): Don't tty tricks when we are
977 being debugged by our own captive gdb, as determined by jit_debug ==
979 (dtable::init_std_file_from_handle): Detect errors when initializing a
980 tty early rather than at random points later.
981 * fhandler.h (fhandler_*::init): Return int to indicate
983 * fhandler.cc (fhandler_base::init): Reflect change in return value.
984 * pipe.cc (fhandler_pipe::init): Ditto.
985 (fhandler_pipe::create_selectable): Don't say we're retrying when we
987 * fhandler_console.cc (fhandler_console::init): Ditto. Return
989 * fhandler_serial.cc (fhandler_serial::init): Ditto.
990 * fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
991 (fhandler_tty_slave::open): Make debugging output more detailed.
992 * tty.cc (tty_list::terminate): Don't close I/O handles before all
993 slaves have checked in.
994 (tty::slave_alive): Make a non-inlined function. Check if tty pipe
995 handles can be created as an additional exists check.
996 * tty.h (tty::slave_alive): Just define here.
998 2009-07-03 Corinna Vinschen <corinna@vinschen.de>
1000 * posix.sgml: Add fpurge and mkstemps to BSD list.
1002 2009-07-03 Eric Blake <ebb9@byu.net>
1004 * cygwin.din (fpurge, mkstemps): New exports.
1005 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
1006 * mktemp.cc (_gettemp): Add parameter.
1007 (mkstemps): New function.
1008 (mkstemp, mkdtemp, mktemp): Adjust clients.
1010 2009-07-03 Corinna Vinschen <corinna@vinschen.de>
1012 * autoload.cc: Fix typo in comment.
1013 (ShowWindowAsync): Define.
1014 (AttachConsole): Define.
1015 * fhandler_console.cc (fhandler_console::need_invisible): Add band-aid
1016 for Windows 7 AllocConsole bug.
1018 2009-07-01 Corinna Vinschen <corinna@vinschen.de>
1020 * net.cc (get_xp_ifs): Fix typo in comment.
1022 2009-07-01 Corinna Vinschen <corinna@vinschen.de>
1024 * fhandler.h (class fhandler_socket): Add class members and methods
1025 to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes.
1026 * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members.
1027 (fhandler_socket::send_internal): Check for SO_SNDBUF size and
1028 restrict send to 1 byte less per KB 823764. Leave loop immediately
1029 if WSASendMsg has been used.
1030 * net.cc (fdsock): Change comment again. Set buffer sizes to 65536.
1031 Store values in fhandler_socket.
1032 (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in
1034 (cygwin_sendto): Drop call to sig_dispatch_pending.
1035 (cygwin_recvfrom): Ditto.
1036 (cygwin_recvmsg): Ditto.
1037 (cygwin_sendmsg): Ditto.
1039 2009-06-30 Christopher Faylor <me+cygwin@cgf.cx>
1041 * select.h: New file split from fhandler.h.
1042 (select_record::select_record): Define do-nothing constructor for "new"
1043 to avoid gratuitous zeroing.
1044 (select_info): New base class.
1045 (select_pipe_info): New class with methods for dealing with pipes.
1046 (select_socket_info): New class with methods for dealing with sockets.
1047 (select_serial_info): Dummy class for serial.
1048 (select_mailslot_info): Dummy class for mailslots.
1049 (select_stuff): Define device_specific_* as actual classes rather than
1051 * dtable.h (dtable::select_read): Accommodate return value change to
1052 'bool' and argument change to "select_stuff".
1053 (dtable::select_write): Ditto.
1054 (dtable::select_except): Ditto.
1055 * dtable.cc (dtable::select_read): Accommodate return value change to
1056 'bool' and argument change to "select_stuff".
1057 (dtable::select_write): Ditto.
1058 (dtable::select_except): Ditto.
1059 * fhandler.h: Excise select-related classes.
1060 (fhandler_*::select_read): Change argument to select_stuff.
1061 (fhandler_*::select_write): Ditto.
1062 (fhandler_*::select_except): Ditto.
1063 * select.cc (UNIX_FD_ZERO): Use memset rather than bzero.
1064 (select_stuff::test_and_set): Change return type to bool. Allocate
1065 select_record on entry and let fhandler_*::select_* operate on the
1066 start.next field of select_stuff.
1068 (select_pipe_info::select_pipe_info): New constructor. Allocates event
1069 for controlling pipe waits.
1070 (select_pipe_info::~select_pipe_info): New destructor. Destroy event.
1072 (select_pipe_info::add_watch_handle): New function.
1073 (thread_pipe): Wait for the hEvent part of any overlapped pipes before
1075 (start_thread_pipe): Don't allocate device_specific_pipe stuff here.
1076 Assume that it has been allocated earlier.
1077 (pipe_cleanup): Rely on select_pipe_info destructor to clean up pipe
1079 (fhandler_*::select_*): Derive select_record from new select_stuff
1081 (fhandler_pipe::select_*): Ditto. Allocate pipe-specific field if not
1083 (serialinf): Delete.
1084 (thread_serial): serialinf -> select_serial_info.
1085 (fhandler_base::ready_for_read): Rewrite to accommodate change in
1086 argument to fhandler_*::select_*.
1087 (socketinf): Delete.
1088 (thread_socket): socketinf -> select_socket_info.
1089 (mailslotinf): Delete.
1090 (thread_mailslot): mailslotinf -> select_mailslot_info.
1092 2009-06-30 Christopher Faylor <me+cygwin@cgf.cx>
1094 * fhandler.cc (fhandler_base::has_ongoing_io): Accept an argument
1095 indicating whether the overlapped event should be tested.
1096 (fhandler_base::read_overlapped): Pass is_overlapped state to
1098 (fhandler_base::write_overlapped): Ditto.
1099 * fhandler.h (fhandler_base::has_ongoing_io): Accommodate argument
1101 * select.cc (peek_pipe): Ditto.
1103 2009-06-30 Corinna Vinschen <corinna@vinschen.de>
1105 * net.cc (fdsock): Set default socket buffer sizes to 65520. Change
1106 comment accordingly.
1107 * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum
1108 send size to 65520 as well.
1110 2009-06-29 Christopher Faylor <me+cygwin@cgf.cx>
1112 * select.cc (peek_pipe): Turn on (temporarily?) the experimental code
1113 which tries to determine when a pipe is writable.
1115 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
1117 * select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe
1118 is ready for writing rather than performing brute-force checks.
1120 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
1122 * fhandler.h (fhandler_base::has_ongoing_io): Declare new function.
1123 * fhandler.cc (fhandler_base::has_ongoing_io): Define new function.
1124 (fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing
1125 when handle has not completed last I/O.
1126 (fhandler_base::write_overlapped): Ditto.
1127 * select.cc (peek_pipe): Be more careful about accessing hEvent field
1128 from get_overlapped().
1130 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
1132 * gendef (cleanup): Rename from 'nocr'. Remove comments and trailing
1134 * cygwin.din: Add long-needed comment describing what
1135 dll_crt0__FP11per_process demangles to.
1137 * select.cc (peek_pipe): Flag handle as not ready for write if event is
1139 * fhandler.cc (fhandler_base::setup_overlapped): Establish event as
1141 (fhandler_base::wait_overlapped): Don't reset event after we've
1142 successfully waited. MSDN documentation says that this happens
1143 automatically after a WriteFileEx/ReadFileEx.
1145 2009-06-26 Corinna Vinschen <corinna@vinschen.de>
1147 * wincap.h (wincaps::has_broken_alloc_console): New element.
1148 * wincap.cc: Implement above element throughout.
1150 2009-06-25 Corinna Vinschen <corinna@vinschen.de>
1152 * sec_auth.cc (lsaauth): Close unused handle.
1153 (lsaprivkeyauth): Ditto.
1155 2009-06-23 Corinna Vinschen <corinna@vinschen.de>
1157 * sec_auth.cc (get_server_groups): Ignore errors from
1158 get_user_local_groups.
1160 2009-06-22 Corinna Vinschen <corinna@vinschen.de>
1162 * spawn.cc (spawn_guts): Don't run additional check for Win32
1163 incompatible CWD if newargv.fixup bailed out already.
1164 (av::fixup): Check shell scripts for executability.
1166 2009-06-18 Corinna Vinschen <corinna@vinschen.de>
1168 * path.cc (chdir): Check error conditions first.
1170 2009-06-17 Corinna Vinschen <corinna@vinschen.de>
1172 * fhandler_socket.cc (fhandler_socket::recv_internal): Mark WSARecvMsg
1175 2009-06-16 Christopher Faylor <me+cygwin@cgf.cx>
1177 * fhandler.cc (fhandler_base::read_overlapped): Use a better variable
1180 2009-06-16 Christopher Faylor <me+cygwin@cgf.cx>
1182 * fhandler.cc (fhandler_base::read_overlapped): Preserve len when
1183 looping due to received signal.
1185 2009-06-15 Corinna Vinschen <corinna@vinschen.de>
1187 * net.cc (get_flags): New static function to generate interface flags
1189 (get_ipv4fromreg_ipcnt): New static function to fetch number of
1190 configured IPv4 addresses for a given NIC from registry.
1191 (get_ipv4fromreg): New static function to fetch configured IPv4
1192 addresses for a given NIC from registry.
1193 (get_friendlyname): New static function to generate friendly name.
1194 (get_hwaddr): New static function to copy hardware address.
1195 (get_xp_ifs): Restructure slightly. Add code to generate IPv4 entries
1196 entries for interfaces which are disconnected.
1198 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
1200 * errno.cc (errmap): Add mapping for ERROR_IO_INCOMPLETE.
1201 * fhandler.cc (fhandler_base::fcntl): Fix comment.
1202 (fhandler_base::wait_overlapped): Accept an optional len parameter.
1203 Use the len parameter when WriteFile fails with ERROR_IO_PENDING. Make
1204 debug output less alarming.
1205 (fhandler_base::write_overlapped): Pass len to wait_overlapped.
1206 * fhandler.h (fhandler_base::wait_overlapped): Add an optional argument
1207 denoting the number of characters intended to be written.
1209 * fhandler_tty.cc (fhandler_pty_master::close): Don't close archetype
1210 handles when cygwin is still initializing since the handles aren't
1211 actually opened at that point.
1213 2009-06-14 Corinna Vinschen <corinna@vinschen.de>
1215 * localtime.cc (time2): Take another stab at fixing a compiler warning.
1217 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
1219 * localtime.cc (time2): Take a stab at fixing a compiler warning.
1221 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
1223 * fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag
1224 for writes. Don't reset event handle when we see a ERROR_IO_PENDING.
1226 * sigproc.cc (stopped_or_terminated): Use bool constants for
1229 * wait.cc (wait4): Remove nonsensical comment.
1231 2009-06-13 Corinna Vinschen <corinna@vinschen.de>
1233 * fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen
1234 pointer to NULL if name pointer is NULL. Explain why.
1236 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
1238 * localtime.cc (time2): Change "spring gap" to "spring forward gap"
1241 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
1243 * localtime.cc (time2): Add workaround for spring forward gap problem.
1244 Add explaining comment.
1246 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
1248 * Makefile.in (SUBLIBS): Add librt.a.
1249 (librt.a): New rule to build librt.a.
1251 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
1253 * posix_ipc.cc (check_path): Fix typo in comment. Align naming
1254 convention rules to Linux. Handle backslash same as slash. Add
1257 2009-06-09 Corinna Vinschen <corinna@vinschen.de>
1259 * autoload.cc (GetSystemTimes): Remove.
1260 * fhandler_proc.cc (format_proc_uptime): Use global system_info rather
1261 than retrieving a local copy of the SYSTEM_INFO. Drop call to
1262 GetSystemTimes and retrieve SystemPerformanceInformation on all systems
1263 again with buffer size big enough for 64 bit systems.
1264 (format_proc_stat): Use global system_info rather than retrieving a
1265 local copy of the SYSTEM_INFO. Retrieve SystemPerformanceInformation
1266 with buffer size big enough for 64 bit systems.
1268 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
1270 * autoload.cc (GetSystemTimes): Define.
1271 * fhandler_proc.cc (format_proc_uptime): Use GetSystemInfo to retrieve
1272 processor count. Use GetSystemTimes when available to retrieve system
1273 idle time. Improve debug output.
1274 (format_proc_stat): Use GetSystemInfo to retrieve processor
1275 count. Improve debug output. Ignore if SystemPerformanceInformation
1276 returns error. Explain why.
1278 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
1280 * fork.cc (frok::parent): Remove ancient code erroneously flushing
1283 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
1285 * cygerrno.h (save_errno::~save_errno): Set errno directly to avoid
1286 flooding debug output.
1288 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
1290 * path.cc (symlink_info::check): Return with error set to ENOENT if
1291 STATUS_NO_MEDIA_IN_DEVICE is returned.
1293 2009-06-07 Christopher Faylor <me+cygwin@cgf.cx>
1295 * cygheap.h (mini_cygheap): New struct.
1296 (init_cygheap): Inherit locale field via mini_cygheap.
1297 * cygheap.cc (cygheap_at_start): Define new variable.
1298 (cygheap): Initialize as cygheap_at_start so that locale information is
1300 (cygheap_init): Initialize cygheap iff it is set to cygheap_at_start.
1301 * shared_info.h (memory_init): Accommodate argument change.
1302 * memory.cc (memory_init): Accept an argument indicating whether
1303 cygheap should be initialized or not.
1304 * dcrt0.cc (child_info_fork::handle_fork): Pass false to memory_init().
1305 (child_info_spawn::handle_spawn): Ditto.
1306 (dll_crt0_0): Pass true to memory_init when not forking or execing.
1308 * cygheap.h (cygheap_types::HEAP_2_DLL): New enum.
1309 * dll_init.h (dll): Remove unused namelen field.
1310 (dll_list::load_after_fork): Accommodate change in arguments.
1311 * dll_init.cc (dll_list::alloc): Allocate dll information in the cygwin
1313 (dll_list::detach): Free dll information from the cygwin heap.
1314 (dll_list::load_after_fork): Use dll information in the cygwin heap
1315 directly rather than querying parent.
1316 * fork.cc (frok::first_dll): Delete.
1317 (frok::child): Don't report on first_dll. Don't pass it to
1319 (frok::parent): Don't set first_dll.
1322 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
1324 * dll_init.cc (dll_list::alloc): Allocate memory using a section
1325 object. Explain why. Drop call to GetSystemInfo, rather call
1326 getpagesize to get allocation granularity. Only align to allocation
1327 granularity under WOW64. Use roundup2 to align.
1328 (dll_list::detach): Call NtUnmapViewOfSection instead of VirtualFree.
1330 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
1332 * mmap.cc: Use NtUnmapViewOfSection instead of UnmapViewOfFile
1333 throughout for symmetry.
1334 (fhandler_dev_mem::munmap): Use correct process handle in call to
1335 NtUnmapViewOfSection.
1337 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
1339 * dll_init.h (struct dll): Set size of name element to ANYSIZE_ARRAY.
1340 * dll_init.cc: Fix formatting.
1341 (dll_list::alloc): Only allocate as much memory for struct dll as
1342 necessary for given DLL name.
1343 (dll_list::load_after_fork): Only read a single page of parent memory.
1344 Only read more if namelen indicates that it's necessary.
1346 2009-06-05 Dave Korn <dave.korn.cygwin@gmail.com>
1348 * winbase.h (ilockexch): Fix asm constraints.
1349 (ilockcmpexch): Likewise.
1351 2009-06-05 Corinna Vinschen <corinna@vinschen.de>
1353 * heap.cc (heap_init): Fix typo in comment.
1355 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
1357 * fhandler_clipboard.cc: Avoid calling system_printf.
1358 (set_clipboard): Add basic error checking. Set errno here. Per MSDN,
1359 don't call GlobalFree on data block transferred to clipboard.
1360 (fhandler_dev_clipboard::write): Drop setting errno after call to
1362 (fhandler_dev_clipboard::read): Add basic error checking. Simplify code.
1364 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
1366 * fhandler_console.cc (set_console_title): Convert title string to
1367 wchar_t and call SetConsoleTitleW.
1369 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
1371 * fhandler_console.cc (fhandler_console::read): Allow Ctrl-Space to
1374 2009-06-04 Dave Korn <dave.korn.cygwin@gmail.com>
1376 * thread.cc (__cygwin_lock_lock): Delete racy optimisation.
1377 (__cygwin_lock_unlock): Likewise.
1379 2009-06-03 IWAMURO Motnori <deenheart@gmail.com>
1381 * strfuncs.cc (sys_cp_mbstowcs): Fix condition.
1383 2009-06-03 Corinna Vinschen <corinna@vinschen.de>
1385 * strfuncs.cc (sys_cp_wcstombs): Implement reverse functionality
1386 of the change to sys_cp_mbstowcs from 2009-05-30.
1387 (sys_cp_mbstowcs): Slightly reformat. Fix comment to accommodate
1388 change to sys_cp_wcstombs. Don't write to *ptr if dst is NULL.
1390 2009-06-03 Corinna Vinschen <corinna@vinschen.de>
1392 * fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace
1393 to \033\177 or to \377 dependent on the setting of dev_state->metabit.
1395 2009-06-02 Corinna Vinschen <corinna@vinschen.de>
1397 * path.cc (path_conv::check): Don't call set_exec for files on "noacl"
1400 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
1402 * strfuncs.cc (sys_cp_mbstowcs): Treat src as unsigned char *. Convert
1403 failure of f_mbtowc into a single malformed utf-16 value.
1405 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
1407 * cygwin/include/sys/termios.h: Make default erase character "^?".
1409 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
1411 * fhandler_console.cc (fhandler_console::read): Convert backspace key
1414 2009-05-29 Christopher Faylor <me+cygwin@cgf.cx>
1416 * path.cc (cwdstuff::set): Rewrite previous change to properly test the
1419 2009-05-28 Christopher Faylor <me+cygwin@cgf.cx>
1421 * path.cc (cwdstuff::set): Avoid removing a nonexistent trailing slash.
1423 2009-05-20 Eric Blake <ebb9@byu.net>
1425 * net.cc (gethostby_helper): Use correct signedness.
1427 2009-05-18 Christopher Faylor <me+cygwin@cgf.cx>
1429 * mount.cc (mount_info::add_item): Avoid using any-old '/' as
1432 2009-05-18 Christopher Faylor <me+cygwin@cgf.cx>
1434 * mount.cc (mount_info::got_usr_bin): Mark as NO_COPY.
1435 (mount_info::got_usr_lib): Ditto.
1436 (mount_info::root_idx): Ditto.
1438 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
1440 * wchar.h (sys_mbstowcs): Add missing __stdcall attribute.
1442 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
1444 * cygheap.cc (cygheap_init): Set Cygwin default locale values.
1445 * cygheap.h (struct cygheap_locale): New structure.
1446 (struct user_heap_info): Add cygheap_locale member locale.
1447 * dcrt0.cc (dll_crt0_1): Revert to calling _setlocale_r so that only
1448 the applications locale is reverted to "C".
1449 * environ.cc (environ_init): Remove unused got_lc variable.
1450 * fhandler.h (class dev_console): Remove now unsed locale variables.
1451 * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove
1452 setting dev_console's locale members.
1453 (dev_console::con_to_str): Use internal locale settings. Default to
1454 __ascii_wctomb if charset is "ASCII".
1455 (fhandler_console::write_normal): Ditto.
1456 * strfuncs.cc (__ascii_wctomb): Drop declaration.
1457 (__db_wctomb): Use fixed value 2 instead of not
1458 necessarily matching MB_CUR_MAX.
1459 (__eucjp_wctomb): Use 3 instead of MB_CUR_MAX.
1460 (sys_cp_wcstombs): Remove special case for "C" locale.
1461 (sys_wcstombs): Implement here. Use internal locale data stored on
1463 (sys_cp_mbstowcs): Remove special case for "C" locale.
1464 (sys_mbstowcs): Implement here. Use internal locale data stored on
1466 * syscalls.cc (internal_setlocale): New function to set cygheap locale
1467 data and to reset CWD posix path.
1468 (setlocale): Just call internal_setlocale from here if necessary.
1469 * wchar.h (__ascii_wctomb): Declare.
1470 (sys_wcstombs): Don't define inline, just declare.
1471 (sys_mbstowcs): Ditto.
1473 2009-05-14 Christopher Faylor <me+cygwin@cgf.cx>
1475 * mount.cc (mount_info::init): Remove MOUNT_CYGWIN_EXEC setting when
1476 auto-mounting /usr/bin.
1478 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
1480 * mount.cc (oopts): Add a no-op "auto" option.
1481 (mount_info::create_root_entry): Set root dir to MOUNT_IMMUTABLE rather
1482 than to MOUNT_OVERRIDE.
1484 2009-05-13 Corinna Vinschen <corinna@vinschen.de>
1485 Christopher Faylor <me+cygwin@cgf.cx>
1487 * mount.cc (mount_info::got_usr_bin): Define.
1488 (mount_info::got_usr_lib): Ditto.
1489 (mount_info::root_idx): Ditto.
1490 (mount_info::create_root_entry): Create root entry as immutable and
1492 (mount_info::init): Remove "Huh? No /etc/fstab..." warning.
1493 Unconditionally call from_fstab for user and system tables. Fill in
1494 /usr/bin and /usr/lib if they have not been specified in /etc/fstab.
1495 (oopts): Alphabetize. Add "override" option to allow overriding
1496 immutable mount points.
1497 (mount_info::add_item): Accommodate new MOUNT_IMMUTABLE flag intended
1499 (mount_info::add_item): Detect "/usr/bin", "/usr/lib", and "/" and set
1500 appropriate global state.
1501 (fillout_mntent): Add ,auto to mount points added by Cygwin DLL.
1502 (mount): Remove masking of MOUNT_SYSTEM. Allow user to shoot
1503 themselves. Add comment.
1504 * mount.h (mount_info::got_usr_bin): Declare.
1505 (mount_info::got_usr_lib): Ditto.
1506 (mount_info::root_idx): Ditto.
1507 * include/sys/mount.h: Reformat enum.
1508 Add MOUNT_{OVERRIDE,IMMUTABLE,AUTOMATIC}.
1510 2009-05-13 Corinna Vinschen <corinna@vinschen.de>
1512 * cygheap.h (cwdstuff): Convert to class. Make posix and dir private.
1513 (cwdstuff::get_posix): New method.
1514 (cwdstuff::reset_posix): New method.
1515 * dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r.
1516 * environ.cc (environ_init): Ditto. Prefer "C" locale over current
1517 codepage default locale.
1518 * path.cc (chdir): Use cwdstuff::get_posix method instead of accessing
1519 cwdstuff::posix directly.
1520 (cwdstuff::set): Defer creating posix path to first usage.
1521 (cwdstuff::get_posix): Create posix path if it's empty, and return it.
1522 (cwdstuff::get): Create posix path if it's empty.
1523 * strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C"
1525 (sys_cp_mbstowcs): Ditto.
1526 * syscalls.cc (gen_full_path_at): Fetch CWD posix path locked.
1527 (setlocale): Implement here. Reset CWD posix path.
1529 2009-05-09 Christopher Faylor <me+cygwin@cgf.cx>
1531 * cygwin/version.h (CYGWIN_VERSION_CYGWIN_CONV): New define.
1533 2009-05-09 Corinna Vinschen <corinna@vinschen.de>
1535 * dtable.cc (dtable::init_std_file_from_handle): Add workaround for
1536 Windows 7 64 bit issue. Add lengthy comment to explain what happens.
1537 * wincap.h (wincaps::has_console_handle_problem): New element.
1538 * wincap.cc: Implement above element throughout.
1539 (wincap_7): New wincaps structure for NT 6.1 kernels.
1540 (wincapc::init): Set has_console_handle_problem to false for 32 bit
1543 2009-05-09 Corinna Vinschen <corinna@vinschen.de>
1545 * sec_auth.cc (str2uni_cat): Move from here...
1546 * path.cc (str2uni_cat): ...to here. Simplify. Make static inline.
1547 (get_nt_native_path): Use RtlAppendUnicodeToString rather than
1548 str2uni_cat for constant strings for speed.
1549 * security.h (str2uni_cat): Drop declaration.
1551 2009-05-08 Corinna Vinschen <corinna@vinschen.de>
1552 IWAMURO Motonori <deenheart@gmail.com>
1554 * strfuncs.cc (sys_cp_wcstombs): save and restore previous errno value.
1555 (sys_cp_mbstowcs): Ditto.
1557 2009-05-08 IWAMURO Motonori <deenheart@gmail.com>
1559 * strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting
1560 wide char to SO/UTF-8 sequence.
1562 2009-05-08 Corinna Vinschen <corinna@vinschen.de>
1564 * include/sys/select.h: Guard definitions with __USE_W32_SOCKETS as
1565 the accompanying fd_set definitions in newlib's sys/types.h.
1567 2009-05-06 Christopher Faylor <me+cygwin@cgf.cx>
1569 * fhandler_console.cc (fhandler_console::ioctl): Properly treat
1570 TIOCLINUX argument as a char.
1571 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use coercion to properly
1574 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
1576 * libc/minires.c (scanline): Fix type in calls to ctype functions
1577 to stay in unsigned char range for char values >= 0x80.
1578 * regex/regcomp.c: Ditto, throughout.
1579 * regex/regex2.h (ISWORD): Ditto.
1581 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
1583 * cygheap.cc (cygheap_init): Set umask to a sane default.
1584 * uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH
1585 to set HOME. Default to /home/USERNAME.
1587 2009-05-03 Corinna Vinschen <corinna@vinschen.de>
1589 * security.cc (set_file_sd): Drop using FILE_OPEN_FOR_RECOVERY flag in
1591 * exceptions.cc (open_stackdumpfile): Ditto in call to NtCreateFile.
1592 * fhandler.cc (fhandler_base::open): Ditto. Simplify setting
1595 * mount.cc (fs_info::update): Recognize offline storage.
1596 (fillout_mntent): Report UDF and offline storage.
1597 * mount.h (class fs_info): Add is_csc_cache status flag.
1599 2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
1601 * fhandler_console.cc (fhandler_console::write_console): Eliminate
1602 unneeded debugging output.
1603 (fhandler_console::write_normal): Eliminate unneeded __seterrno.
1605 2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
1607 * libc/minires.c (scanline): Accommodate ctype changes which disallow
1608 use of an unadorned char argument to is* macros.
1609 * regex/regcomp.c: Ditto, throughout.
1610 * regex/regex2.h (ISWORD): Ditto.
1612 2009-05-03 Christopher Faylor <me+cygwin@cgf.cx>
1614 * fhandler.h (fhandler_console::MAX_WRITE_CHARS): Declare.
1615 (fhandler_console::write_replacement_char): Declare as inline.
1616 (fhandler_console::write_console): Declare new function.
1617 * fhandler_console.cc (fhandler_console::MAX_WRITE_CHARS): Define.
1618 (handler_console::write_console): Define.
1619 (fhandler_console::write_replacement_char): Define as inline.
1620 (fhandler_console::write_normal): Use write_console when writing
1621 buffers of unknown length.
1623 2009-04-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1625 * include/cygwin/socket.h: Define SOL_IPV6.
1627 2009-04-21 Corinna Vinschen <corinna@vinschen.de>
1629 * ctype.cc (__set_ctype): Copy exact part of the current active
1630 character class array.
1632 2009-04-20 Corinna Vinschen <corinna@vinschen.de>
1634 * flock.cc (lf_setlock): Handle border case which results in WFMO loop
1635 exiting with ret == WAIT_TIMEOUT gracefully. Add a system_printf to
1636 uncover other potential problems with WFMO loop.
1638 2009-04-18 Christopher Faylor <me+cygwin@cgf.cx>
1640 * mkimport: Specify .text for stub explicitly.
1641 * speclib: Add a dummy '.idata$7' section referring to the dll
1642 associated with the real import library.
1644 2009-04-18 Corinna Vinschen <corinna@vinschen.de>
1646 * dcrt0.cc (globify): Only call mbtowc for non-ascii chars.
1648 2009-04-17 Corinna Vinschen <corinna@vinschen.de>
1650 * dcrt0.cc (globify): Make multibyte-aware.
1652 2009-04-17 Corinna Vinschen <corinna@vinschen.de>
1654 * flock.cc (class inode_t): Add i_wait member and matching methods
1655 wait(), unwait(), and waiting().
1656 (inode_t::inode_t): Initialize i_wait to 0.
1657 (fhandler_disk_file::lock): Only remove node if no other thread is
1658 waiting for a blocking lock.
1659 (lf_setlock): Manipulate node->i_wait to signal that a thread is
1660 waiting for a blocking lock in this node.
1661 (lf_findoverlap): Reinstantiate SELF test as in original code.
1663 2009-04-16 Corinna Vinschen <corinna@vinschen.de>
1665 * dlfcn.cc (get_full_path_of_dll): Just return a bool value. Drop
1666 local path_conv in favor of getting it as parameter. Add local string
1667 buffer instead of getting it as parameter.
1668 (dlopen): Accommodate get_full_path_of_dll change. Fetch WCHAR Windows
1669 path from path_conv variable and call LoadLibraryW.
1671 2009-04-16 Corinna Vinschen <corinna@vinschen.de>
1673 * ntdll.h (STATUS_LOCK_NOT_GRANTED): Define.
1674 * syscalls.cc (unlink_nt): Handle STATUS_LOCK_NOT_GRANTED same as
1675 STATUS_SHARING_VIOLATION. Add lengthy comment to explain why.
1677 2009-04-15 Corinna Vinschen <corinna@vinschen.de>
1679 * path.cc (path_conv::get_wide_win32_path): Allow relative paths.
1680 (cygwin_conv_path): In case of CCP_POSIX_TO_WIN_W, convert relative
1681 paths to absolute paths if the relative pathname length exceeds
1684 2009-04-15 Corinna Vinschen <corinna@vinschen.de>
1686 * libc/bsdlib.cc: Align copyright with upstream.
1687 * libc/fnmatch.c: Ditto.
1688 * libc/fts.c: Ditto.
1689 * libc/inet_addr.c: Ditto.
1690 * libc/inet_network.c: Ditto.
1691 * libc/rcmd.cc: Ditto.
1692 * libc/rexec.cc: Ditto.
1694 2009-04-14 Christopher Faylor <me+cygwin@cgf.cx>
1696 * speclib: Really revert to using tempdir.
1698 2009-04-14 Christopher Faylor <me+cygwin@cgf.cx>
1700 * speclib: Revert to using tempdir.
1702 2009-04-14 Corinna Vinschen <corinna@vinschen.de>
1704 * localtime.cc (tzload): Implement setting __tzrule's offset member
1705 using newlib's __gettzinfo () interface also when tzload returns
1708 2009-04-13 Dave Korn <dave.korn.cygwin@gmail.com>
1710 * include/stdint.h (intptr_t): Remove long from type.
1711 (uintptr_t): Likewise.
1712 (INTPTR_MIN): Remove 'L' suffix.
1713 (INTPTR_MAX, UINTPTR_MAX): Likewise.
1715 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
1717 * speclib: Initial stab at cleaning up temp files. More work needed.
1720 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
1722 * Makefile.in (clean): Clean globals.h.
1723 (LIBCOS): Depend on globals.h.
1725 2009-04-11 Christopher Faylor <me+cygwin@cgf.cx>
1727 * mkimport: New script to perform all operations necessary to create
1731 * Makefile.in (toolopts): New variable which holds options relating to
1733 (speclib): Use toolopts. Add symbols to avoid copying to special
1735 (OBSOLETE_FUNCTIONS): Delete.
1736 (NEW_FUNCTIONS): Change to represent an argument to new mkimport
1738 (libcygwin.a): Use only new mkimport script to create libcygwin.a.
1739 Only rely on ${LIBCOS}.
1740 (*/lib*.a): Simplify speclib dependencies.
1741 (speclib): Accept toolchain options. Convert every argument to
1742 absolute path. Simplify parsing of nm output. Accommodate new
1745 2009-04-11 Dave Korn <dave.korn.cygwin@googlemail.com>
1747 * include/stdint.h (INTPTR_MIN, INTPTR_MAX): Add 'L' suffix.
1748 (WINT_MAX): Add 'U' suffix.
1750 2009-04-10 Christopher Faylor <me+cygwin@cgf.cx>
1752 * speclib: Use a more robust method to derive full file path.
1754 2009-04-09 Christopher Faylor <me+cygwin@cgf.cx>
1756 * speclib: Semi-revert to previous version but don't try to generate
1757 well-formed import library. Instead, just extract appropriate symbols
1758 and let later libcygwin.a on link line fill in the rest of the import
1760 * gendef: Hopefully no-op modification to allow easier post-processing
1763 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1765 * syscalls.cc (try_to_bin): Use tmp_pathbuf buffer to allocate infobuf
1766 rather than using the stack.
1768 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1770 * syscalls.cc (try_to_bin): Fix alignment of infobuf.
1772 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1774 * fhandler_disk_file.cc (fhandler_disk_file::fchown): Catch an
1775 error when changing the user account on a standalone Samba server.
1777 * sec_acl.cc (setacl): Accommodate additional parameter to set_file_sd.
1778 * sec_helper.cc (SECURITY_SAMBA_UNIX_AUTHORITY): Define.
1779 (well_known_samba_unix_user_fake_sid): Define.
1780 * security.cc (set_file_sd): Take additional parameter if ownership
1781 should be changed. Restrict requested permissions accordingly.
1782 (set_file_attribute): Accommodate additional parameter to set_file_sd.
1783 * security.h (well_known_samba_unix_user_fake_sid): Declare.
1784 (set_file_sd): Align declaration to above change.
1786 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1788 * include/stdint.h (int_least32_t): Define as int.
1789 (uint_least32_t): Ditto, unsigned.
1790 (int_fast16_t): Define as int.
1791 (int_fast32_t): Ditto.
1792 (uint_fast16_t): Ditto, unsigned.
1793 (uint_fast32_t): Ditto.
1794 (UINT32_MAX): Remove `L' long marker.
1795 (UINT_LEAST32_MAX): Ditto.
1796 (UINT_FAST16_MAX): Ditto.
1797 (UINT_FAST32_MAX): Ditto.
1801 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1803 * strfuncs.cc: Change WCHAR to wchar_t in multibyte<->widechar
1804 conversion functions throughout.
1805 * wchar.h: Ditto in declarations. Guard them __INSIDE_CYGWIN__.
1807 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1809 * fhandler.h (class dev_console): Add members con_mbtowc, con_wctomb,
1811 (dev_console::str_to_con): Take mbtowc function pointer and charset
1812 as additional parameters.
1813 * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
1814 aforementioned new members. Explain why.
1815 (dev_console::con_to_str): Remove useless comment. Call new
1816 sys_cp_wcstombs function rather than sys_wcstombs.
1817 (dev_console::str_to_con): Take mbtowc function pointer and charset
1818 as additional parameters. Call sys_cp_mbstowcs accordingly.
1819 (fhandler_console::write_normal): Only initialize f_mbtowc and charset
1820 once. Accommodate changed str_to_con.
1821 * strfuncs.cc (sys_cp_wcstombs): Renamed from sys_wcstombs. Take
1822 wctomb function pointer and charset as parameters. Use throughout.
1823 (sys_cp_mbstowcs): Take wctomb function pointer and charset as
1824 parameters instead of codepage. Remove matching local variables and
1825 their initialization.
1826 * wchar.h (ENCODING_LEN): Define as in newlib.
1827 (__mbtowc): Use mbtowc_p typedef for declaration.
1828 (wctomb_f): New type.
1829 (wctomb_p): New type.
1830 (__wctomb): Declare.
1831 (__utf8_wctomb): Use wctomb_f typedef for declaration.
1832 (sys_cp_wcstombs): Move declaration from winsup.h here.
1833 (sys_wcstombs): Ditto.
1834 (sys_wcstombs_alloc): Ditto.
1835 (sys_cp_mbstowcs): Ditto.
1836 (sys_mbstowcs): Ditto.
1837 (sys_mbstowcs_alloc): Ditto.
1838 * winsup.h: Move declaration of sys_FOO functions to wchar.h. Include
1841 2009-04-06 Earl Chew <earl_chew@agilent.com>
1843 * libc/rexec.cc (ruserpass): Use fstat64 instead of fstat.
1845 2009-04-06 Corinna Vinschen <corinna@vinschen.de>
1847 * strfuncs.cc: Add comment to explain why we can't support JIS
1849 (__db_wctomb): Alwaus use WC_NO_BEST_FIT_CHARS.
1850 (__jis_wctomb): Just call __ascii_wctomb from here.
1851 (__eucjp_wctomb): Convert to standalone implementation to fix up the
1852 difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
1854 (__kr_wctomb): Use codepage 949.
1855 (__db_mbtowc): Reorder code slightly. Always use MB_ERR_INVALID_CHARS
1856 in call to MultiByteToWideChar. Fix a problem with singlebyte
1857 sequences. Fix a bug in '\0' handling. Reset state->__count on
1858 successful return from non-zero state.
1859 (__jis_mbtowc): Just call __ascii_mbtowc from here.
1860 (__eucjp_mbtowc): Convert to standalone implementation to fix up the
1861 difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
1862 (__kr_mbtowc): Use codepage 949.
1863 (__set_charset_from_codepage): Handle codepage 20932 as eucJP.
1865 2009-04-05 Christopher Faylor <me+cygwin@cgf.cx>
1867 * Makefile.in: Use all compile options when calculating magic values.
1868 * shared_info.h (CURR_SHARED_MAGIC): Revert erroneous value.
1869 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
1871 * fhandler.h (acquire_output_mutex): Remove unneeded ';'.
1872 (release_output_mutex): Ditto.
1874 2009-04-05 Christopher Faylor <me+cygwin@cgf.cx>
1876 * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings.
1877 * shared_info.h (CURR_SHARED_MAGIC): Update.
1878 * spawn.cc (spawn_guts): Avoid copying one line command line argument
1879 if it hasn't been filled out.
1881 2009-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1882 Corinna Vinschen <corinna@vinschen.de>
1884 * include/asm/byteorder.h (__ntohl): Prototype before define to avoid
1885 a warning with -Wmissing-prototypes. Use _ELIDABLE_INLINE macro from
1889 2009-04-02 Corinna Vinschen <corinna@vinschen.de>
1891 * environ.cc (build_env): Fix length calculation of resulting
1892 wide char environment string.
1894 2009-04-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1896 * include/netdb.h: #include <inttypes.h>, <netinet/in.h>,
1897 and <sys/socket.h> per SUSv3.
1899 2009-04-01 Corinna Vinschen <corinna@vinschen.de>
1901 * strfuncs.cc (sys_cp_mbstowcs): Check if ASCII SO is followed by at
1902 least two chars and the next byte is a valid UTF-8 start byte before
1903 trying to convert the followup bytes as UTF-8 sequence.
1905 2009-03-31 Corinna Vinschen <corinna@vinschen.de>
1907 * shm.cc (struct shm_attached_list): Convert access type to ULONG.
1908 (fixup_shms_after_fork): Fix comment. Use NtMapViewOfSection rather
1909 than MapViewOfFileEx to recreate shared memory regions. Add function
1910 name to api_fatal output.
1911 (shmat): Use NtMapViewOfSection to create shared memory region
1914 2009-03-31 Corinna Vinschen <corinna@vinschen.de>
1916 * ctype.cc: Remove implementation of ctype functions in favor of
1917 pointer-based newlib implementation.
1918 (_ctype_b): Declare.
1919 (__ctype_cp): Move to newlib. Declare.
1920 (__ctype_iso): Ditto.
1921 (__set_ctype): Implement changing __ctype_ptr__. Only copy character
1922 class data in applications built under older Cygwin.
1923 * cygwin.din (__ctype_ptr__): Export.
1924 * include/ctype.h: Remove in favor of newlib implementation.
1925 * include/cygwin/config.h (__EXPORT): Define alongside __IMPORT.
1926 * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE):
1927 Define check for old vs. new ctype implementation.
1928 Bump API minor number.
1930 2009-03-28 Christopher Faylor <me+cygwin@cgf.cx>
1932 * Makefile.in: Perform some minor cleanup. Revamp speclib handling.
1933 * speclib: Rewrite to create libraries with dlltool rather than
1934 attempting surgery on libcygwin.a.
1936 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1938 * net.cc (inet_ntop6): Convert to lowercase hex digits on the fly.
1940 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1942 * net.cc (cygwin_getaddrinfo): Check hints for non-NULL before
1943 checking its content.
1945 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1947 * fhandler.h (class fhandler_fifo): Rename read/write methods to
1949 * fhandler_fifo.cc: Ditto.
1951 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1953 * syscalls.cc (pathconf): Fix memory leak.
1955 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
1957 * path.cc (symlink_worker): Write target filename as UTF-16 string
1958 with leading BOM marker.
1959 (symlink_info::check_shortcut): If check for leading BOM marker
1960 succeeds, read filename as UTF-16 string.
1961 (symlink_info::check_sysfile): Ditto.
1963 2009-03-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1965 * include/asm/byteorder.h (__ntohl): Align definition to ISO C99.
1968 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
1970 * strfuncs.cc (__set_charset_from_codepage): Revert to translating
1971 codepage 936 to "GBK".
1973 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1975 * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two
1978 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1980 * environ.cc (environ_init): Break from locale loop after first hit.
1981 * fhandler_console.cc (fhandler_console::write_normal): Print a SO
1982 sequence using always valid Unicode chars.
1984 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1986 * strfuncs.cc (__kr_wctomb): Use codepage 51949 rather than 50949.
1987 (__kr_mbtowc): Ditto.
1988 (__set_charset_from_codepage): Ditto. Translate codepage 936 to
1989 "GB2312" and drop the charset name "GBK".
1991 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1993 * strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949.
1994 (__kr_mbtowc): Ditto.
1995 (__set_charset_from_codepage): Translate codepages 949 and 50949 to
1996 "EUCKR" and drop the charset name "CP949".
1998 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2000 * strfuncs.cc (sys_cp_mbstowcs): Don't read beyond src + nms.
2002 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2004 * shared_info.h (CURR_SHARED_MAGIC): Update.
2006 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2008 * wchar.h: Replace UINT with unsigned int.
2010 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2012 * wchar.h: Remove erroneous "C" specifier from extern declaration.
2014 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2016 * ctype.cc (_CTYPE_DATA_0_127): Add _B class to TAB character.
2017 (__ctype_default): New character class array for default ASCII
2019 (__ctype_iso): New array of character class array for ISO charsets.
2020 (__ctype_cp): Ditto for singlebyte Windows codepages.
2021 (tolower): Implement as distinct function to support any singlebyte
2024 (__set_ctype): New function to copy singlebyte character classes
2025 corresponding to current charset to ctype_b array.
2026 Align copyright text to upstream.
2027 * dcrt0.cc (dll_crt0_1): Reset current locale to "C" per POSIX.
2028 * environ.cc (set_file_api_mode): Remove.
2029 (codepage_init): Remove.
2030 (parse_thing): Remove "codepage" setting.
2031 (environ_init): Set locale according to environment settings, or
2032 to current codepage, before converting environment to multibyte.
2033 * fhandler.h (fhandler_console::write_replacement_char): Drop argument.
2034 * fhandler_console.cc (dev_console::str_to_con): Call sys_cp_mbstowcs
2035 rather than MultiByteToWideChar.
2036 (fhandler_console::write_replacement_char): Always print a funny
2037 half filled square if a character isn't in the current charset.
2038 (fhandler_console::write_normal): Convert to using __mbtowc
2039 rather than next_char.
2040 * fork.cc (frok::child): Drop call to set_file_api_mode.
2041 * globals.cc (enum codepage_type) Remove.
2042 (current_codepage): Remove.
2043 * miscfuncs.cc (cygwin_wcslwr): Unused, dangerous. Remove.
2044 (cygwin_wcsupr): Ditto.
2045 (is_cp_multibyte): Remove.
2046 (next_char): Remove.
2047 * miscfuncs.h (is_cp_multibyte): Drop declaration.
2049 * strfuncs.cc (get_cp): Remove.
2050 (__db_wctomb): New function to implement _wctomb_r functionality for
2051 doublebyte charsets using WideCharToMultiByte.
2052 (__sjis_wctomb): New function to replace unusable newlib function.
2053 (__jis_wctomb): Ditto.
2054 (__eucjp_wctomb): Ditto.
2055 (__gbk_wctomb): New function.
2056 (__kr_wctomb): Ditto.
2057 (__big5_wctomb): Ditto.
2058 (__db_mbtowc): New function to implement _mbtowc_r functionality for
2059 doublebyte charsets using MultiByteToWideChar.
2060 (__sjis_mbtowc): New function to replace unusable newlib function.
2061 (__jis_mbtowc): Ditto.
2062 (__eucjp_mbtowc): Ditto.
2063 (__gbk_mbtowc): New function.
2064 (__kr_mbtowc): New function
2065 (__big5_mbtowc): New function
2066 (__set_charset_from_codepage): New function.
2067 (sys_wcstombs): Reimplement, basically using same wide char to multibyte
2068 conversion as newlib's application level functions. Plus extras.
2069 Add lengthy comment to explain. Change return type to size_t.
2070 (sys_wcstombs_alloc): Just use sys_wcstombs. Change return type to
2072 (sys_cp_mbstowcs): Replace sys_mbstowcs, take additional codepage
2073 argument. Explain why. Change return type to size_t.
2074 (sys_mbstowcs_alloc): Just use sys_mbstowcs. Change return type to
2076 * wchar.h: Declare internal functions implemented in strfuncs.cc.
2077 (wcscasecmp): Remove.
2078 (wcsncasecmp): Remove.
2081 * winsup.h (codepage_init): Remove declaration.
2083 (sys_wcstombs): Align declaration to new implementation.
2084 (sys_wcstombs_alloc): Ditto.
2085 (sys_cp_mbstowcs): Add declaration.
2086 (sys_mbstowcs): Define as inline function.
2087 (sys_mbstowcs_alloc): Align declaration to new implementation.
2088 (set_file_api_mode): Remove declaration.
2089 * include/ctype.h (isblank): Redefine to use _B character class.
2090 (toupper): Remove ASCII-only definition.
2093 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
2095 * sec_auth.cc (str2buf2uni): Remove.
2096 * security.h (str2buf2uni): Remove declaration.
2098 2009-03-24 Yaakov Selkowitz <yselkowitz@cygwin.com>
2100 * include/mntent.h: Remove declarations of nonexistant addmntent
2101 and hasmntopt. Update and clarify the /etc/mtab comment.
2103 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
2105 * smallprint.cc (__small_vsprintf): Handle NULL PWCHAR and
2106 PUNICODE_STRING arguments.
2107 (__small_vswprintf): Ditto.
2109 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
2111 * include/asm/byteorder.h (__constant_ntohs): Remove declaration.
2112 (__constant_ntohl): Ditto.
2114 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
2116 * cygwin.din: Export wordexp, wordfree.
2117 * posix.sgml: Move them to SUSv4 list.
2118 * include/cygwin/version.h: Bump API minor number.
2120 2009-03-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2122 * include/sys/un.h: #include <string.h> for strlen.
2124 2009-03-19 Corinna Vinschen <corinna@vinschen.de>
2126 * dlfcn.cc (get_full_path_of_dll): Revert patch from 2008-07-16.
2128 2009-03-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2130 * cygwin.din: Export log2, log2f as functions.
2131 * posix.sgml: Add them to SUSv4 list.
2132 * include/cygwin/version.h: Bump API minor number.
2134 2009-03-18 Corinna Vinschen <corinna@vinschen.de>
2136 * sec_auth.cc (lsaauth): Remove local definitions of struct
2137 _TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions
2139 (lsaprivkeyauth): As in lsaauth, fetch linked token if available and
2140 return that in favor of default token.
2142 2009-03-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2144 * errno.cc (_sys_errlist): Add ESTRPIPE.
2146 2009-03-15 Corinna Vinschen <corinna@vinschen.de>
2148 * cygwin.din: Export wcsdup.
2149 * posix.sgml: Add wcsdup to SUSv4 list.
2150 * include/cygwin/version.h: Bump API minor number.
2152 2009-03-15 Corinna Vinschen <corinna@vinschen.de>
2154 * include/inttypes.h: Remove "l" size specifier from all 16 and 32 bit
2157 2009-03-14 Christopher Faylor <me+cygwin@cgf.cx>
2159 * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered
2160 during initialization.
2162 2009-03-14 Corinna Vinschen <corinna@vinschen.de>
2164 * gendef: Remove STABS directives.
2166 2009-03-13 Corinna Vinschen <corinna@vinschen.de>
2168 * mktemp.cc: Remove STABS specific link-time warning. Align copyright
2171 2009-03-13 Corinna Vinschen <corinna@vinschen.de>
2173 * flock.cc: Fix lockf copyright to latest version.
2175 2009-03-12 Corinna Vinschen <corinna@vinschen.de>
2177 * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined
2179 (get_ino_by_handle): Take additional path_conv argument, accommodate
2180 throughout. Only use FileId if isgood_inode check is true.
2181 (fhandler_base::open_fs): Simplify setting ino due to above change.
2182 (readdir_get_ino): Make sure to return always a non-zero inode number.
2183 (fhandler_disk_file::readdir): Always open file in dir with
2184 FILE_OPEN_REPARSE_POINT so as not to open wrong file.
2185 Drop call to isgood_inode here.
2186 * path.cc (symlink_info::check): Call fs.update in case we're fetching
2187 file information from call to NtQueryDirectoryFile.
2189 2009-03-12 Corinna Vinschen <corinna@vinschen.de>
2191 * flock.cc (fhandler_disk_file::lock): Don't test file open mode in
2192 case of flock-type locks. Explain why.
2194 2009-03-12 Brian Ford <Brian.Ford@FlightSafety.com>
2196 * gethostby_helper: Fix typos in DEBUGGING case.
2198 2009-03-11 Corinna Vinschen <corinna@vinschen.de>
2200 * cygwin.din: Export wcscasecmp, wcsncasecmp.
2201 * posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list.
2202 * include/cygwin/version.h: Bump API minor number.
2204 2009-03-11 Corinna Vinschen <corinna@vinschen.de>
2206 * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf,
2208 * posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf
2210 * include/cygwin/version.h: Bump API minor number.
2212 2009-03-09 Corinna Vinschen <corinna@vinschen.de>
2214 * fhandler.h (fhandler_socket::wait_for_events): Take additional
2215 parameter "dontwait".
2216 * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the
2217 socket is non-blocking if dontwait is true.
2218 (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to
2219 set the wait_for_events dontwait parameter.
2220 (fhandler_socket::send_internal): Ditto. Optimize code slightly.
2221 * include/cygwin/socket.h (MSG_DONTWAIT): Define.
2222 * include/cygwin/version.h: Bump API minor number.
2224 2009-03-09 Corinna Vinschen <corinna@vinschen.de>
2226 * cygwin.din: Export wcsftime.
2227 * posix.sgml: Move wcsftime to SUSv4 list.
2228 * include/cygwin/version.h: Bump API minor number.
2230 2009-03-06 Pierre A. Humblet <pierre@phumblet.no-ip.org>
2232 * cygwin.din: Export gethostbyname2.
2233 * net.cc: define _CYGWIN_IN_H and include resolv.h.
2234 (realloc_ent): New function.
2235 (dup_ent): Call realloc_ent.
2236 (memcpy4to6): New function.
2237 (dn_length1): New function.
2238 (gethostby_helper): New function.
2239 (gethostbyname2): New function.
2240 * posix.sgml: Add gethostbyname2.
2241 * include/cygwin/version.h: Bump API minor number.
2242 * libc/minires.c (get_options): Look for "inet6" and apply bounds
2243 to "retry" and "retrans".
2244 (res_ninit): Set the default options at the beginning.
2245 (dn_expand): Fix "off by one".
2247 2009-03-06 Corinna Vinschen <corinna@vinschen.de>
2249 * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf,
2251 * posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf
2252 to SUSv4 list. Sort SUSv4 list.
2253 * include/cygwin/version.h: Bump API minor number.
2255 2009-03-04 Corinna Vinschen <corinna@vinschen.de>
2257 * dcrt0.cc (disable_dep): Disable. Explain why.
2258 (dll_crt0_0): Disable calling disable_dep. Explain why.
2260 2009-03-03 Corinna Vinschen <corinna@vinschen.de>
2262 * net.cc: Include asm/byteorder.h.
2263 (htonl): Move to end of file. Add comment to explain why. Align
2264 definition to POSIX. Use related macro from asm/byteorder.h.
2268 * include/asm/byteorder.h: Revert previous patch.
2270 2009-03-03 Corinna Vinschen <corinna@vinschen.de>
2272 * include/asm/byteorder.h: Disable optimization when building
2273 Cygwin network code.
2275 2009-02-26 Christopher Faylor <me+cygwin@cgf.cx>
2277 * dtable.cc (dtable::select_read): Add ability to override fh.
2278 * fhandler.h (fhandler_fifo::select_read): Declare new function.
2279 (fhandler_fifo::select_write): Ditto.
2280 (fhandler_fifo::select_except): Ditto.
2281 * select.cc (peek_pipe): Treat certain classes of pipe errors as "no
2283 (fhandler_fifo::select_read): Define new function.
2284 (fhandler_fifo::select_write): Ditto.
2285 (fhandler_fifo::select_except): Ditto.
2287 * shared_info.h (CURR_SHARED_MAGIC): Update.
2289 2009-02-23 Sjors Gielen <mailinglist@dazjorz.com>
2291 * Makefile.in: Add DESTDIR functionality.
2293 2009-02-23 Corinna Vinschen <corinna@vinschen.de>
2295 * sec_auth.cc (get_user_local_groups): Simplify LookupAccountName code.
2297 2009-02-20 Corinna Vinschen <corinna@vinschen.de>
2299 * autoload.cc (NetLocalGroupEnum): Remove.
2300 (NetLocalGroupGetMembers): Remove.
2301 (NetUserGetLocalGroups): Add.
2302 * sec_auth.cc (is_group_member): Remove function.
2303 (get_user_local_groups): Get user as string instead of as SID.
2304 Call NetUserGetLocalGroups instead of NetLocalGroupEnum. Drop call
2306 (get_server_groups): Call get_user_local_groups with user name instead
2309 2009-02-19 Corinna Vinschen <corinna@vinschen.de>
2311 * winver.rc: Fix Copyright date.
2313 2009-02-19 Corinna Vinschen <corinna@vinschen.de>
2315 * cygwin.din: Export mbsnrtowcs and wcsnrtombs.
2316 * posix.sgml: Move mbsnrtowcs and wcsnrtombs to SUSv4 section.
2317 * include/cygwin/version.h: Bump API minor number.
2319 2009-02-18 Corinna Vinschen <corinna@vinschen.de>
2321 * cygwin.din: Export open_wmemstream.
2322 * posix.sgml: Move open_wmemstream to SUSv4 section.
2323 * include/cygwin/version.h: Bump API minor number.
2325 2009-02-16 Corinna Vinschen <corinna@vinschen.de>
2327 * cygwin.din: Export reallocf.
2328 * malloc_wrapper.cc( reallocf): New function.
2329 * posix.sgml: Add reallocf to BSD section.
2330 * include/cygwin/version.h: Bump API minor number.
2331 * libc/fts.c: Remove erroneous reallocf definition.
2333 2009-02-16 Corinna Vinschen <corinna@vinschen.de>
2335 * cygwin.din: Export wcstoimax, wcstoumax.
2336 * posix.sgml: Move wcstoimax and wcstoumax to SUSv4 section.
2337 * include/inttypes.h: Declare wcstoimax and wcstoumax.
2338 * include/cygwin/version.h: Bump API minor number.
2340 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
2342 * cygwin.din: Export wcsnlen.
2343 * posix.sgml: Move wcsnlen to SUSv4 section.
2344 * include/cygwin/version.h: Bump API minor number.
2346 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
2348 * environ.cc (_getenv_r): New function.
2350 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
2352 * posix.sgml: Move dirfd to SUSv4 section.
2354 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
2356 * posix.sgml: Move interfaces deprecated in SUSv4 to deprecated
2357 interfaces section. Move interfaces added in SUSv4 to SUSv4
2358 section or, if unimplemented, add them to the unimplemented interfaces
2361 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
2363 * posix.sgml: Merge SUSv3 and SUSv4 section into a single SUSv4 section.
2364 Move Solaris calls now in SUSv4 to SUSv4 section. Rename unimplemented
2365 section to refer to SUSv4. Add note about missing interfaces.
2366 Move wcstod and wcstof from unimplemented to SUSv4 section.
2368 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
2370 * mount.cc (mount_info::from_fstab_line): Make cygdrive posix=0 by
2371 default as documented.
2373 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
2375 * cygwin.din: Export wcstod and wcstof.
2376 * include/cygwin/version.h: Bump API minor number.
2378 2009-02-11 Corinna Vinschen <corinna@vinschen.de>
2380 * syscalls.cc (open): Handle O_DIRECTORY flag.
2381 * include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH.
2382 * include/cygwin/version.h: Bump API minor number.
2384 2009-02-09 Corinna Vinschen <corinna@vinschen.de>
2386 * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix format. Add
2387 code to allow to read disk and CD/DVD devices in full length. Explain
2389 (fhandler_dev_floppy::raw_read): Add current position to debug output.
2391 * include/sys/sched.h: New stub file to override newlib file with
2392 clashing definitions.
2394 2009-02-05 Corinna Vinschen <corinna@vinschen.de>
2396 * cygwin.din: Export wcstok.
2397 * posix.sgml: Move wcstok from unimplemented to susv3.
2398 * include/cygwin/version.h: Bump API minor number.
2400 2009-02-04 Corinna Vinschen <corinna@vinschen.de>
2402 * fhandler_proc.cc (proc_tab): Add entry for mounts symlink.
2403 (format_proc_mounts): New function to implement mounts symlink.
2404 * fhandler_process.cc (process_tab): Add entry for mounts file.
2405 (format_process_mounts): New function to implement mounts file.
2407 2009-02-04 Corinna Vinschen <corinna@vinschen.de>
2409 * security.cc (alloc_sd): Disable generating default permission entries
2412 2009-01-29 Corinna Vinschen <corinna@vinschen.de>
2414 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number
2415 evaluation for faked "." entry.
2417 * mount.cc (fs_info::update): Move setting of is_cdrom after checking
2418 for caseinsensitivity. Recognize UDF in is_cdrom case and set
2419 caseinsensitive flag according to UDF brokenness determined by OS.
2420 Add comment to explain why.
2421 * mount.h (class fs_info): Add is_udf status flag.
2422 * path.cc (symlink_info::check): Add workaround for UDF bug in
2423 terms of casesensitivity on certain OSes.
2424 * wincap.h (wincaps::has_broken_udf): New element.
2425 * wincap.cc: Implement above element throughout.
2427 2009-01-27 Christopher Faylor <me+cygwin@cgf.cx>
2429 * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on
2430 EINTR or real error.
2431 (fhandler_base::write_overlapped): Assume that bytes_written will
2432 contain proper error value.
2433 * pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since
2434 signals are handled by pipe functions now.
2436 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
2438 * shared.cc (shared_name): New function for WCHAR names.
2439 (open_shared): Take name parameter as WCHAR. Accommodate throughout.
2440 * shared_info.h ((CURR_SHARED_MAGIC): Redefine.
2441 (shared_name): Add declaration for function taking a WCHAR name.
2442 (open_shared): Change declaration according to above change.
2443 * pinfo.cc (pinfo::init) : Accommodate above change.
2445 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
2447 * grp.cc (getgrgid_r): Simplify code by using stpcpy.
2448 (getgrnam_r): Ditto.
2449 * passwd.cc (getpwuid_r32): Simplify code by using stpcpy.
2450 (getpwnam_r): Ditto.
2452 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
2454 * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENT
2457 2009-01-24 Corinna Vinschen <corinna@vinschen.de>
2459 * mount.cc (mount_info::from_fstab): Open fstab file with
2460 FILE_OPEN_FOR_BACKUP_INTENT flag.
2462 2009-01-23 Corinna Vinschen <corinna@vinschen.de>
2464 * smallprint.cc (__small_vsprintf): Use already available buffer tmp
2467 2009-01-22 Christopher Faylor <me+cygwin@cgf.cx>
2469 * select.cc (peek_serial): Add hack to allow proper operation with
2472 2009-01-21 Corinna Vinschen <corinna@vinschen.de>
2474 Remove USE_SERVER define. Accommodate throughout.
2475 * configure.in: Remove --enable-server option.
2476 * configure: Regenerate.
2477 * environ.cc: Remove CYGWIN=server setting.
2479 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
2481 * fhandler_procnet.cc: Reorganize global procnet content data into a
2482 new struct virt_tab_t. Accommodate throughout.
2484 * fhandler.h: Fix copyright dates.
2485 * fhandler_process.cc: Ditto.
2486 * fhandler_registry.cc: Ditto.
2488 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
2490 * devices.h (FH_PROCESSFD): New device type.
2491 * dtable.cc (build_fh_pc): Add case for FH_PROCESSFD.
2492 * fhandler.h (class fhandler_virtual): Drop bufalloc member.
2493 * fhandler_virtual.h: New header.
2494 * fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor
2495 of types virt_type_t and virt_tab_t from fhandler_virtual.h.
2496 Change prototypes of format_XXX functions accordingly.
2497 (proc_tab): Drop size member info.
2498 (fhandler_proc::fill_filebuf): Don't allocate filebuf here. Allocate
2499 it in the format_XXX functions.
2500 * fhandler_process.cc: Reorganize global process content data into a
2501 new struct virt_tab_t. Accommodate throughout.
2502 (format_process_winexename): New function.
2503 (format_process_winpid): New function.
2504 (format_process_exename): New function.
2505 (format_process_root): New function.
2506 (format_process_cwd): New function.
2507 (format_process_cmdline): New function.
2508 (format_process_ppid): New function.
2509 (format_process_uid): New function.
2510 (format_process_pgid): New function.
2511 (format_process_sid): New function.
2512 (format_process_gid): New function.
2513 (format_process_ctty): New function.
2514 (format_process_fd): New function.
2515 * fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use
2517 * fhandler_registry.cc (fhandler_registry::fill_filebuf): Define
2519 * fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop
2520 initialization of bufalloc.
2521 (fhandler_virtual::dup): Drop copying bufalloc.
2523 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
2525 * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.
2526 * thread.cc (pthread_rwlock::rdlock): If a thread already owns a
2527 read lock, just count the number of locks for it, per SUSv4.
2528 (pthread_rwlock::tryrdlock): Ditto.
2529 (pthread_rwlock::unlock): If a thread has more than one concurrent
2530 read locks, just count down.
2532 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
2534 * autoload.cc (WSAIoctl): Reintroduce.
2535 (WSASendMsg): Define.
2536 * fhandler.h (class fhandler_socket): Change definition of recv_internal
2537 and send_internal to take WSAMSG pointer as parameter.
2538 * fhandler_socket.cc (WSAID_WSARECVMSG): Define.
2539 (LPFN_WSARECVMSG): Define.
2540 (WSASendMsg): Declare.
2541 (get_ext_funcptr): New function to fetch address of WSARecvMsg.
2542 (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter.
2543 Change code accordingly. If control information is requested,
2544 fetch address of WSARecvMsg and use that instead of WSARecvFrom.
2545 (fhandler_socket::recvfrom): Change return type to ssize_t as
2546 declared in fhandler.h. Accommodate changes to recv_internal.
2547 (fhandler_socket::recvmsg): Ditto. Make sure that control information
2548 is only requested if system, address family, and socket type support it.
2549 (fhandler_socket::send_internal): Take just a LPWSAMSG parameter
2550 and the flags. Change code accordingly. If control information is
2551 provided, use WSASendMsg instead of WSASendTo.
2552 (fhandler_socket::sendto): Drop useless comment. Accommodate changes
2554 (fhandler_socket::sendmsg): Ditto. Make sure that control information
2555 is only provided if system, address family, and socket type support it.
2556 * wincap.h (wincaps::has_recvmsg): New element.
2557 (wincaps::has_sendmsg): New element
2558 * wincap.cc: Implement above elements throughout.
2559 * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment
2560 of type struct cmsghdr.
2562 2009-01-17 Corinna Vinschen <corinna@vinschen.de>
2564 * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond
2567 2009-01-17 Corinna Vinschen <corinna@vinschen.de>
2569 * fhandler_proc.cc: Reorganize global proc content data into a new
2570 struct proc_tab_t. Accommodate throughout.
2571 (format_proc_version): New function.
2572 (format_proc_loadavg): New function.
2573 (format_proc_self): New function.
2575 * resource.cc (getrlimit): Return correct rlim_max value for
2578 2009-01-16 Corinna Vinschen <corinna@vinschen.de>
2580 * Fix copyright dates.
2582 2009-01-13 Corinna Vinschen <corinna@vinschen.de>
2584 * libc/getopt.c (parse_long_options): Use fix from NetBSD's getopt
2585 to avoid false ambiguities.
2587 2009-01-12 Corinna Vinschen <corinna@vinschen.de>
2589 * syscalls.cc (enum bin_status): New type.
2590 (try_to_bin): Return bin_status. Rename win32_path to pc. Rename h
2591 to fh. Rename fh to tmp_fh. Add code to set delete dispostion and
2592 more code to replace file moved to bin by another, temporary file.
2593 Add comments to explain why.
2594 (unlink_nt): Replace move_to_bin with bin_stat. Only set bin_stat
2595 to move_to_bin for non-remote files. As a last resort, call try_to_bin
2596 if setting delete-on-close failed. Only re-set R/O DOS attribute
2597 and only close handle if it's still valid.
2599 2009-01-11 Corinna Vinschen <corinna@vinschen.de>
2601 * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.
2602 * path.cc (path_conv::check): Set to and check for ENOENT instead of
2605 * path.cc (symlink_info::check): Fix Samba 3.2.x comment.
2607 2009-01-09 Corinna Vinschen <corinna@vinschen.de>
2609 * mount.cc (mount_info::from_fstab_line): Always convert drive
2610 letter in native path to uppercase.
2611 * path.cc (normalize_win32_path): Ditto.
2612 (path_prefix_p): Revert previous patch.
2614 * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
2615 return code to circumvent weird behaviour of Samba 3.2.x shares.
2617 2009-01-09 Christopher Faylor <me+cygwin@cgf.cx>
2619 * include/sys/cygwin.h (CW_SETERRNO): Define.
2620 * external.cc (CW_SETERRNO): Implement.
2621 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to
2622 reflect the above change.
2624 * path.cc (path_prefix_p): Treat X: as equivalent to x:.
2626 * mkglobals_h: Remove unneeded #define.
2628 * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
2630 2009-01-08 Corinna Vinschen <corinna@vinschen.de>
2632 * libc/fts.c (fts_build): Use DT_DIR case on Cygwin.
2633 (fts_ufslinks): Fix using wrong structure member in Cygwin-specific
2636 2009-01-07 Corinna Vinschen <corinna@vinschen.de>
2638 * ntdll.h: Reorder NT status flags. Fix a case difference. Add
2639 STATUS_CANNOT_DELETE flag.
2640 * syscalls.cc (unlink_nt): Change initial NtOpenFile to request
2641 FILE_SHARE_DELETE sharing mode. Change comment accordingly.
2642 If setting delete disposition failed with STATUS_CANNOT_DELETE, try
2643 to delete using delete-on-close. Explain why.
2644 Rearrange setting R/O DOS attribute after trying to delete. Simplify
2647 2009-01-07 Corinna Vinschen <corinna@vinschen.de>
2649 * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe if
2650 original file has .exe as well.
2651 * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit
2654 2009-01-02 Christopher Faylor <me+cygwin@cgf.cx>
2656 Remove unneeded header files from source files throughout.
2657 Update copyrights where appropriate.
2659 * globals.cc: New file for generic global variables.
2660 * mkglobals_h: New script to generate globals.h.
2661 * mkstatic: New script used to build a (currently non-working) static
2663 * Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
2664 (DLL_OFILES): Add globals.o. Make all objects rely on globals.h.
2665 (globals.h): New target. Generate globals.h.
2666 * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE
2667 operator is allowed in _cygtls.
2668 * dcrt0.cc: Move most globals to globals.cc.
2670 * environ.cc (strip_title_path): Remove now-unneeded extern.
2671 * fhandler_serial.cc (fhandler_serial::open): Ditto.
2673 (commune_process): Ditto.
2677 * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
2678 * path.cc (stat_suffixes): Move here.
2679 * security.h: Add forward class path_conv declaration.
2680 * smallprint.cc (__small_vsprintf): Make a true c++ function.
2681 (__small_sprintf): Ditto.
2682 (small_printf): Ditto.
2683 (console_printf): Ditto.
2684 (__small_vswprintf): Ditto.
2685 (__small_swprintf): Ditto.
2686 * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of
2688 (hExeced): Move to globals.cc
2689 * strfuncs.cc (current_codepage): Ditto.
2690 (active_codepage): Ditto.
2691 * sync.cc (lock_process::locker): Move here from dcrt0.cc.
2692 * syscalls.cc (stat_suffixes): Move to path.cc.
2693 * tty.cc (tty::create_master): Uncapitalize fatal warning for
2695 * winsup.h: Include globals.h to declare most of the grab bag list of
2696 globals which were previously defined here.
2698 * mount.h: Move USER_* defines back to shared_info.h.
2700 * speclib: Force temporary directory cleanup.
2702 2009-01-02 Christopher Faylor <me+cygwin@cgf.cx>
2704 * speclib: Rewrite completely in perl. Avoid multiple nm calls.