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