1 2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
3 * sigproc.h (wait_for_sigthread): Eliminate parameter.
4 * sigproc.cc (wait_for_sigthread): Ditto. Don't synchronize with
5 wait_sig after receiving an event that it is ready to go.
6 (init_sig_pipe): New function.
7 (wait_sig): Call init_sig_pipe to create pipes for communicating
8 signals to this process. Don't send sigCONT signal when initializing.
9 * fork.cc (frok::child): Accommodate wait_for_sigpipe parameter change.
11 2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
13 * fhandler.h (fhandler_*::write): Make ssize_t/__stdcall.
14 (fhandler_*::write_overlapped): Ditto.
15 (fhandler_*::raw_write): Ditto.
16 (fhandler_*::readv): Ditto.
17 (fhandler_*::writev): Ditto.
18 (fhandler_*::raw_read): Make __stdcall.
19 * fhandler: Accommodate changes to read/write functions throughout.
20 * fhandler_clipboard.cc: Ditto.
21 * fhandler_console.cc: Ditto.
22 * fhandler_dsp.cc: Ditto.
23 * fhandler_fifo.cc: Ditto.
24 * fhandler_mailslot.cc: Ditto.
25 * fhandler_mem.cc: Ditto.
26 * fhandler_mem.cc: Ditto.
27 * fhandler_random.cc: Ditto.
28 * fhandler_tape.cc: Ditto.
29 * fhandler_tty.cc: Ditto.
30 * fhandler_virtual.cc: Ditto.
31 * fhandler_windows.cc: Ditto.
32 * fhandler_zero.cc: Ditto.
33 * syscalls.cc (readv): Use ssize_t as temp variable.
35 * fhandler.cc (fhandler_base::read): Coerce returned len to signed or
36 it will never be treated as < 0.
37 (fhandler_base::wait_overlapped): Minimize calls to GetLastError.
38 Remove duplicate debugging test. Fix error return.
40 * fhandler.h (fhandler_fifo::fifo_name): Declare new function.
41 (fhandler_fifo::close): Ditto.
42 (fhandler_fifo::dup): Ditto.
43 (fhandler_fifo::close_on_exec): Ditto.
44 * fhandler.cc (fhandler_fifo::fifo_name): Define new function.
45 (FIFO_BUF_SIZE): New define.
47 (fhandler_fifo::open): Rework. Use cnp to open named pipe. Always
48 open write side as a client. Open dummy client when writing and can't
50 (wait): Rework. Implement fifo_wait_for_next_client. Handle signals
51 during connect better. Add new fifo_wait_for_server code which polls
52 (sigh) waiting for server.
53 (fhandler_fifo::raw_read): Handle transition states when one client
54 closes and another is available.
55 (fhandler_fifo::close): Define.
56 (fhandler_fifo::dup): Ditto.
57 (fhandler_fifo::close_on_exec): Ditto.
59 2009-07-24 Corinna Vinschen <corinna@vinschen.de>
61 * syscalls.cc (internal_setlocale): Fix typo in GBK codepage.
63 2009-07-24 Corinna Vinschen <corinna@vinschen.de>
65 * syscalls.cc (unlink_nt): Ignore sharing violation on NFS. Align
68 2009-07-23 Corinna Vinschen <corinna@vinschen.de>
70 * mount.h (fs_info::fsn): New member.
71 (fs_info::clear): Clear fsn.
72 (fs_info::fsname): New read accessor for fsn.
73 * mount.cc (fs_info::update): Fill in fsn member with lowercased
74 filesystem name if filesystem is not well-known. Fall back to
75 "unknown" if filesystem name is missing.
76 (fillout_mntent): Print filesystem name retrieved in fs_info::update
77 rather than static string "unknown".
79 2009-07-23 Corinna Vinschen <corinna@vinschen.de>
81 * mount.cc (fs_info::update): Revert to open filesystem with access set
82 to READ_CONTROL. If that fails, try additionally with FILE_READ_DATA.
84 2009-07-22 Eric Blake <ebb9@byu.net>
86 * exceptions.cc (handle_exceptions): Set si_addr according to
89 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
91 * mount.cc (fs_info::update): Open filesystem with access set to 0.
94 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
96 * mount.cc: Revert accidental checkin.
98 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
100 * path.cc (symlink_info::check): Handle STATUS_NOT_SUPPORTED from
101 NtCreateFile just like STATUS_EAS_NOT_SUPPORTED.
103 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
105 * mount.cc (fillout_mntent): Fix typo (noexec -> notexec).
107 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
109 * path.cc (symlink_info::check): Fix typo in comment.
111 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
113 * fhandler.h (enum del_lock_called_from): New enumeration.
114 (fhandler_base::del_my_locks): Declare taking a del_lock_called_from
116 * fhandler.cc (fhandler_base::close): Call del_my_locks with "on_close".
117 (fhandler_base::fixup_after_fork): Call del_my_locks with "after_fork".
118 (fhandler_base::fixup_after_exec): Call del_my_locks with "after_exec".
119 * flock.cc (fhandler_base::del_my_locks): Take del_lock_called_from
120 as argument. Call node->del_my_locks with NULL handle in after_exec
123 2009-07-21 Eric Blake <ebb9@byu.net>
125 * dtable.cc (dup2): Correct return value for no-op.
127 2009-07-21 Corinna Vinschen <corinna@vinschen.de>
128 Eric Blake <ebb9@byu.net>
130 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Add special case
131 for MVFS. Explain why.
132 (fhandler_disk_file::utimens): Drop local variables lastaccess and
133 lastwrite. Copy timestamps right into FILE_BASIC_INFORMATION structure
134 to avoid copying them twice.
136 2009-07-20 Corinna Vinschen <corinna@vinschen.de>
138 * wincap.h (wincaps::has_always_all_codepages): New element.
139 * wincap.cc: Implement above element throughout.
140 * wchar.h (__sjis_mbtowc): Declare.
141 (__eucjp_mbtowc): Ditto.
142 (__gbk_mbtowc): Ditto.
143 (__kr_mbtowc): Ditto.
144 (__big5_mbtowc): Ditto.
145 * syscalls.cc (internal_setlocale): Convert to char * function.
146 Return parameter by default. Return NULL if request to use a
147 charset can't be satisfied due to missing codepage support in the
148 underlying OS. Fix comment.
149 (setlocale): Store original locale. Restore to original locale if
150 internal_setlocale returns NULL.
152 2009-07-20 Corinna Vinschen <corinna@vinschen.de>
154 * fork.cc (fork): Create local tmp_pathbuf. Explain why.
156 2009-07-18 Christopher Faylor <me+cygwin@cgf.cx>
158 * exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when
160 (stopped_or_terminated): Honor WCONTINUED.
161 * wait.cc (wait4): Ditto.
162 * include/cygwin/wait.h (WCONTINUED): Define.
163 (__W_CONTINUED): Ditto.
164 (WIFCONTINUED): Ditto.
166 2009-07-18 Dave Korn <dave.korn.cygwin@gmail.com>
168 * libstdcxx_wrapper.cc (operator delete): Remove stray space in
171 2009-07-17 Christopher Faylor <me+cygwin@cgf.cx>
173 * cygtls.cc (_cygtls::init_exception_handler): Test for e, not e->prev
174 or we could still end up adding our handler twice. Add comment
175 explaining what we're doing.
176 * dll_init.cc (dll_dllcrt0_1): Clarify comment.
178 2009-07-17 Christopher Faylor <me+cygwin@cgf.cx>
180 * cygtls.cc (_cygtls::init_exception_handler): Avoid adding our
181 exception handler twice.
183 2009-07-17 Corinna Vinschen <corinna@vinschen.de>
185 * syscalls.cc (unlink_nt): Just return when a sharing violation
186 occurs on remote filesystems.
188 2009-07-17 Corinna Vinschen <corinna@vinschen.de>
190 * globals.cc: Improve comment on R/O UNICODE_STRINGs.
191 * mount.h (class fs_info): Add is_mvfs bit.
192 * mount.cc (fs_info::update): Recognize MVFS remote filesystem.
193 (fillout_mntent): Reorder filesystem checks for speed. Add
194 mvfs, unixfs, and sunwnfs filesystem types.
195 * path.h (class path_conv): Add fs_is_mvfs method.
196 * path.cc (symlink_worker): On MVFS, always create symlinks as
197 Windows shortcuts. Explain why.
199 2009-07-16 Corinna Vinschen <corinna@vinschen.de>
201 * syscalls.cc (unlink_nt): First remove the R/O DOS attribute with
202 FILE_WRITE_ATTRIBUTES access only, then re-open the file for DELETE.
205 2009-07-16 Corinna Vinschen <corinna@vinschen.de>
207 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Remove file
208 attribute check already done in NtSetAttributesFile.
210 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
212 * globals.cc: Reorder constant UNICODE_STRINGs for clarity.
213 * mount.h (fs_info::sttaus): Move filesystem type flags into
214 substructure. Add union to allow simple test for having set any
215 one filesystem type flag. Replace has_buggy_open flag with is_sunwnfs
216 flag. Replace has_buggy_fileid_dirinfo with is_unixfs flag.
217 (fs_info::got_fs): New private method.
218 (fs_info::has_buggy_open): New explicit implementation.
219 (fs_info::has_buggy_fileid_dirinfo): Ditto.
220 * mount.cc (fs_info::update): Optimize filesystem checks for speed.
221 * winsup.h (IMPLEMENT_STATUS_FLAG): Change write accessor to return
224 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
226 * fhandler_netdrive.cc (GET_RESOURCE_INFO): Remove.
227 (thread_netdrive): Drop GET_RESOURCE_INFO case.
228 (fhandler_netdrive::exists): Use GET_RESOURCE_OPENENUM info class
229 to check for existance.
231 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
233 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Remove useless
236 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
238 * path.cc (cwdstuff::set): Only fix up UNC path in win32 so as not
239 to overwrite incoming path.
241 2009-07-14 Corinna Vinschen <corinna@vinschen.de>
243 Throughout avoid having to initialize constant UNICODE_STRINGs.
244 * globals.cc: Define constant UNICODE_STRINGs and store in .rdata
246 * fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs
247 rather then initializing local UNICODE_STRING variable where
249 * fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
250 * flock.cc (inode_t::inode_t): Ditto.
252 * syscalls.cc: Ditto.
253 * mount.cc (fs_info::update): Ditto.
256 * ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as
258 (RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING.
259 * fhandler_disk_file.cc: Accommodate throughout.
260 * mount.cc (fs_info::update): Ditto.
261 * path.cc (cwdstuff::set): Ditto.
262 * syscalls.cc: Ditto.
264 2009-07-14 Corinna Vinschen <corinna@vinschen.de>
266 * globals.cc (active_codepage): Remove.
268 2009-07-12 Christopher Faylor <me+cygwin@cgf.cx>
270 * how-spawn-works.txt: Add "out of date" note.
271 * how-vfork-works.txt: Ditto.
273 2009-07-12 Christopher Faylor <me+cygwin@cgf.cx>
275 * Makefile.in: Don't do anything special with any RCS directories.
277 * ntdll.h (PROCESSINFOCLASS): Remove unneeded trailing comma.
279 * pinfo.cc (_pinfo::dup_proc_pipe): Remove unneeded assignment.
281 * sigproc.cc (sig_send): Don't send signal to myself if this is an exec
284 2009-07-12 Corinna Vinschen <corinna@vinschen.de>
286 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Don't use
287 FileAllInformation info class since it needs a big buffer. Add a
290 2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com>
292 * winbase.h (ilockexch): Avoid making 'ret' volatile.
293 (ilockcmpexch): Likewise.
295 2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com>
297 * Makefile.in (DLL_OFILES): Add libstdcxx_wrapper.o
298 (libstdcxx_wrapper_CFLAGS): Add flags for new module.
299 (_cygwin_crt0_common_STDINCFLAGS): Define per-file override.
300 (libstdcxx_wrapper_STDINCFLAGS, cxx_STDINCFLAGS): Likewise.
301 * cxx.cc: Include "cygwin-cxx.h".
302 (operator new): Tweak prototype for full standards compliance.
303 (operator new[]): Likewise.
304 (operator new (nothrow)): New fallback function.
305 (operator new[] (nothrow), operator delete (nothrow),
306 operator delete[] (nothrow)): Likewise.
307 (default_cygwin_cxx_malloc): New struct of pointers to the above,
308 for final last-resort fallback default.
309 * cygwin-cxx.h: New file.
310 (struct per_process_cxx_malloc): Define.
311 (default_cygwin_cxx_malloc): Declare extern.
312 * cygwin.din (__wrap__ZdaPv): Export new wrapper.
313 (__wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
314 __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
315 __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
316 __wrap__ZnwjRKSt9nothrow_t): Likewise.
317 * globals.cc (__cygwin_user_data): Init newly-repurposed 'forkee'
318 field (now 'cxx_malloc') to point to default_cygwin_cxx_malloc.
319 * libstdcxx_wrapper.cc: New file.
320 (__wrap__ZdaPv, __wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
321 __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
322 __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
323 __wrap__ZnwjRKSt9nothrow_t): Define wrapper functions for libstdc++
324 malloc operators and their overrides.
325 * winsup.h (default_cygwin_cxx_malloc): Declare extern.
326 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
327 * include/sys/cygwin.h (struct per_process_cxx_malloc): Forward
329 (struct per_process::forkee): Rename and repurpose from this ...
330 (struct per_process::cxx_malloc): ... to this.
331 * lib/_cygwin_crt0_common.cc: Include cygwin-cxx.h.
332 (WEAK): Define shorthand helper macro.
333 (__cygwin_cxx_malloc): Define and populate with weak references
334 to whatever libstdc++ malloc operators will be visible at final
335 link time for Cygwin apps and dlls.
336 (_cygwin_crt0_common): Always look up cygwin DLL's internal
337 per_process data, and don't test for (impossible) failure. Inherit
338 any members of __cygwin_cxx_malloc that we don't have overrides
339 for from the DLL's default and store the resulting overall set of
340 overrides back into the DLL's global per_process data.
342 2009-07-07 Corinna Vinschen <corinna@vinschen.de>
344 * cygtls.cc (_cygtls::remove): Fix typo.
346 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
348 * Makefile.in (clean): Clean generated files in srcdir.
349 * tlsoffsets.h: Regenerate.
351 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
353 * cygtls.cc (_cygtls::remove): Avoid closing a NULL handle.
355 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
357 * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabuf
358 and wsacnt to references. Fix handling of WSAEMSGSIZE.
360 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
362 * cygtls.h (struct _local_storage): Add thread storage pointers for
363 memory used by socket select functions. Combine them into a single
365 * cygtls.cc: Accommodate above change throughout.
366 (_cygtls::init_thread): Drop initalizing of sockevt to
367 INVALID_HANDLE_VALUE.
368 (_cygtls::fixup_after_fork): Reset sockevt to NULL.
369 (_cygtls::remove): Don't use sockevt value to bail out prematurely.
370 Set sockevt to NULL. Free malloced select members.
371 * select.h (struct select_socket_info): Drop max_w4 member.
372 * select.cc (thread_socket): Use INFINITE timeout value if number of
373 objects to wait for is <= MAXIMUM_WAIT_OBJECTS. Use num_w4 member
374 of select_socket_info struct rather than dropped max_w4.
375 (init_tls_select_info): New inline function to initialize TLS select
377 (start_thread_socket): Just call init_tls_select_info to initialize TLS
378 select members and use them later on.
379 (socket_cleanup): Don't free select_socket_info pointer members since
380 they are thread local now.
382 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
384 * dtable.cc (handle_to_fn): Detect failing NtQueryObject.
386 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
388 * autoload.cc: Delete stray CR.
390 2009-07-05 Christopher Faylor <me+cygwin@cgf.cx>
392 * fhandler_console.cc: Change workstation -> windows station
395 2009-07-04 Christopher Faylor <me+cygwin@cgf.cx>
397 * autoload.cc (SetParent): Add new import.
398 * fhandler.h (fhandler_console::create_invisible_console): Declare new
400 (create_invisible_console_workaround): Ditto.
401 * fhandler_console.cc (fhandler_console::create_invisible_console):
403 (create_invisible_console_workaround): Ditto. Add too much code to
404 deal with broken Windows 7. Use a helper app to start an invisible
406 (fhandler_console::need_invisible): Reorganize to use helper functions
407 to create invisible console.
409 * spawn.cc (spawn_guts): Avoid zeroing already zeroed fields in si.
411 2009-07-04 Dave Korn <dave.korn.cygwin@gmail.com>
413 * autoload.cc (AttachConsole): Correct size of args.
415 2009-07-03 Christopher Faylor <me+cygwin@cgf.cx>
417 * dcrt0.cc (jit_debug): New global.
418 (initial_env): Set jit_debug when we are automatically starting a gdb
420 * dtable.cc (dtable::get_debugger_info): Don't tty tricks when we are
421 being debugged by our own captive gdb, as determined by jit_debug ==
423 (dtable::init_std_file_from_handle): Detect errors when initializing a
424 tty early rather than at random points later.
425 * fhandler.h (fhandler_*::init): Return int to indicate
427 * fhandler.cc (fhandler_base::init): Reflect change in return value.
428 * pipe.cc (fhandler_pipe::init): Ditto.
429 (fhandler_pipe::create_selectable): Don't say we're retrying when we
431 * fhandler_console.cc (fhandler_console::init): Ditto. Return
433 * fhandler_serial.cc (fhandler_serial::init): Ditto.
434 * fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
435 (fhandler_tty_slave::open): Make debugging output more detailed.
436 * tty.cc (tty_list::terminate): Don't close I/O handles before all
437 slaves have checked in.
438 (tty::slave_alive): Make a non-inlined function. Check if tty pipe
439 handles can be created as an additional exists check.
440 * tty.h (tty::slave_alive): Just define here.
442 2009-07-03 Corinna Vinschen <corinna@vinschen.de>
444 * posix.sgml: Add fpurge and mkstemps to BSD list.
446 2009-07-03 Eric Blake <ebb9@byu.net>
448 * cygwin.din (fpurge, mkstemps): New exports.
449 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
450 * mktemp.cc (_gettemp): Add parameter.
451 (mkstemps): New function.
452 (mkstemp, mkdtemp, mktemp): Adjust clients.
454 2009-07-03 Corinna Vinschen <corinna@vinschen.de>
456 * autoload.cc: Fix typo in comment.
457 (ShowWindowAsync): Define.
458 (AttachConsole): Define.
459 * fhandler_console.cc (fhandler_console::need_invisible): Add band-aid
460 for Windows 7 AllocConsole bug.
462 2009-07-01 Corinna Vinschen <corinna@vinschen.de>
464 * net.cc (get_xp_ifs): Fix typo in comment.
466 2009-07-01 Corinna Vinschen <corinna@vinschen.de>
468 * fhandler.h (class fhandler_socket): Add class members and methods
469 to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes.
470 * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members.
471 (fhandler_socket::send_internal): Check for SO_SNDBUF size and
472 restrict send to 1 byte less per KB 823764. Leave loop immediately
473 if WSASendMsg has been used.
474 * net.cc (fdsock): Change comment again. Set buffer sizes to 65536.
475 Store values in fhandler_socket.
476 (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in
478 (cygwin_sendto): Drop call to sig_dispatch_pending.
479 (cygwin_recvfrom): Ditto.
480 (cygwin_recvmsg): Ditto.
481 (cygwin_sendmsg): Ditto.
483 2009-06-30 Christopher Faylor <me+cygwin@cgf.cx>
485 * select.h: New file split from fhandler.h.
486 (select_record::select_record): Define do-nothing constructor for "new"
487 to avoid gratuitous zeroing.
488 (select_info): New base class.
489 (select_pipe_info): New class with methods for dealing with pipes.
490 (select_socket_info): New class with methods for dealing with sockets.
491 (select_serial_info): Dummy class for serial.
492 (select_mailslot_info): Dummy class for mailslots.
493 (select_stuff): Define device_specific_* as actual classes rather than
495 * dtable.h (dtable::select_read): Accommodate return value change to
496 'bool' and argument change to "select_stuff".
497 (dtable::select_write): Ditto.
498 (dtable::select_except): Ditto.
499 * dtable.cc (dtable::select_read): Accommodate return value change to
500 'bool' and argument change to "select_stuff".
501 (dtable::select_write): Ditto.
502 (dtable::select_except): Ditto.
503 * fhandler.h: Excise select-related classes.
504 (fhandler_*::select_read): Change argument to select_stuff.
505 (fhandler_*::select_write): Ditto.
506 (fhandler_*::select_except): Ditto.
507 * select.cc (UNIX_FD_ZERO): Use memset rather than bzero.
508 (select_stuff::test_and_set): Change return type to bool. Allocate
509 select_record on entry and let fhandler_*::select_* operate on the
510 start.next field of select_stuff.
512 (select_pipe_info::select_pipe_info): New constructor. Allocates event
513 for controlling pipe waits.
514 (select_pipe_info::~select_pipe_info): New destructor. Destroy event.
516 (select_pipe_info::add_watch_handle): New function.
517 (thread_pipe): Wait for the hEvent part of any overlapped pipes before
519 (start_thread_pipe): Don't allocate device_specific_pipe stuff here.
520 Assume that it has been allocated earlier.
521 (pipe_cleanup): Rely on select_pipe_info destructor to clean up pipe
523 (fhandler_*::select_*): Derive select_record from new select_stuff
525 (fhandler_pipe::select_*): Ditto. Allocate pipe-specific field if not
528 (thread_serial): serialinf -> select_serial_info.
529 (fhandler_base::ready_for_read): Rewrite to accommodate change in
530 argument to fhandler_*::select_*.
532 (thread_socket): socketinf -> select_socket_info.
533 (mailslotinf): Delete.
534 (thread_mailslot): mailslotinf -> select_mailslot_info.
536 2009-06-30 Christopher Faylor <me+cygwin@cgf.cx>
538 * fhandler.cc (fhandler_base::has_ongoing_io): Accept an argument
539 indicating whether the overlapped event should be tested.
540 (fhandler_base::read_overlapped): Pass is_overlapped state to
542 (fhandler_base::write_overlapped): Ditto.
543 * fhandler.h (fhandler_base::has_ongoing_io): Accommodate argument
545 * select.cc (peek_pipe): Ditto.
547 2009-06-30 Corinna Vinschen <corinna@vinschen.de>
549 * net.cc (fdsock): Set default socket buffer sizes to 65520. Change
551 * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum
552 send size to 65520 as well.
554 2009-06-29 Christopher Faylor <me+cygwin@cgf.cx>
556 * select.cc (peek_pipe): Turn on (temporarily?) the experimental code
557 which tries to determine when a pipe is writable.
559 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
561 * select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe
562 is ready for writing rather than performing brute-force checks.
564 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
566 * fhandler.h (fhandler_base::has_ongoing_io): Declare new function.
567 * fhandler.cc (fhandler_base::has_ongoing_io): Define new function.
568 (fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing
569 when handle has not completed last I/O.
570 (fhandler_base::write_overlapped): Ditto.
571 * select.cc (peek_pipe): Be more careful about accessing hEvent field
572 from get_overlapped().
574 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
576 * gendef (cleanup): Rename from 'nocr'. Remove comments and trailing
578 * cygwin.din: Add long-needed comment describing what
579 dll_crt0__FP11per_process demangles to.
581 * select.cc (peek_pipe): Flag handle as not ready for write if event is
583 * fhandler.cc (fhandler_base::setup_overlapped): Establish event as
585 (fhandler_base::wait_overlapped): Don't reset event after we've
586 successfully waited. MSDN documentation says that this happens
587 automatically after a WriteFileEx/ReadFileEx.
589 2009-06-26 Corinna Vinschen <corinna@vinschen.de>
591 * wincap.h (wincaps::has_broken_alloc_console): New element.
592 * wincap.cc: Implement above element throughout.
594 2009-06-25 Corinna Vinschen <corinna@vinschen.de>
596 * sec_auth.cc (lsaauth): Close unused handle.
597 (lsaprivkeyauth): Ditto.
599 2009-06-23 Corinna Vinschen <corinna@vinschen.de>
601 * sec_auth.cc (get_server_groups): Ignore errors from
602 get_user_local_groups.
604 2009-06-22 Corinna Vinschen <corinna@vinschen.de>
606 * spawn.cc (spawn_guts): Don't run additional check for Win32
607 incompatible CWD if newargv.fixup bailed out already.
608 (av::fixup): Check shell scripts for executability.
610 2009-06-18 Corinna Vinschen <corinna@vinschen.de>
612 * path.cc (chdir): Check error conditions first.
614 2009-06-17 Corinna Vinschen <corinna@vinschen.de>
616 * fhandler_socket.cc (fhandler_socket::recv_internal): Mark WSARecvMsg
619 2009-06-16 Christopher Faylor <me+cygwin@cgf.cx>
621 * fhandler.cc (fhandler_base::read_overlapped): Use a better variable
624 2009-06-16 Christopher Faylor <me+cygwin@cgf.cx>
626 * fhandler.cc (fhandler_base::read_overlapped): Preserve len when
627 looping due to received signal.
629 2009-06-15 Corinna Vinschen <corinna@vinschen.de>
631 * net.cc (get_flags): New static function to generate interface flags
633 (get_ipv4fromreg_ipcnt): New static function to fetch number of
634 configured IPv4 addresses for a given NIC from registry.
635 (get_ipv4fromreg): New static function to fetch configured IPv4
636 addresses for a given NIC from registry.
637 (get_friendlyname): New static function to generate friendly name.
638 (get_hwaddr): New static function to copy hardware address.
639 (get_xp_ifs): Restructure slightly. Add code to generate IPv4 entries
640 entries for interfaces which are disconnected.
642 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
644 * errno.cc (errmap): Add mapping for ERROR_IO_INCOMPLETE.
645 * fhandler.cc (fhandler_base::fcntl): Fix comment.
646 (fhandler_base::wait_overlapped): Accept an optional len parameter.
647 Use the len parameter when WriteFile fails with ERROR_IO_PENDING. Make
648 debug output less alarming.
649 (fhandler_base::write_overlapped): Pass len to wait_overlapped.
650 * fhandler.h (fhandler_base::wait_overlapped): Add an optional argument
651 denoting the number of characters intended to be written.
653 * fhandler_tty.cc (fhandler_pty_master::close): Don't close archetype
654 handles when cygwin is still initializing since the handles aren't
655 actually opened at that point.
657 2009-06-14 Corinna Vinschen <corinna@vinschen.de>
659 * localtime.cc (time2): Take another stab at fixing a compiler warning.
661 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
663 * localtime.cc (time2): Take a stab at fixing a compiler warning.
665 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
667 * fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag
668 for writes. Don't reset event handle when we see a ERROR_IO_PENDING.
670 * sigproc.cc (stopped_or_terminated): Use bool constants for
673 * wait.cc (wait4): Remove nonsensical comment.
675 2009-06-13 Corinna Vinschen <corinna@vinschen.de>
677 * fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen
678 pointer to NULL if name pointer is NULL. Explain why.
680 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
682 * localtime.cc (time2): Change "spring gap" to "spring forward gap"
685 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
687 * localtime.cc (time2): Add workaround for spring forward gap problem.
688 Add explaining comment.
690 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
692 * Makefile.in (SUBLIBS): Add librt.a.
693 (librt.a): New rule to build librt.a.
695 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
697 * posix_ipc.cc (check_path): Fix typo in comment. Align naming
698 convention rules to Linux. Handle backslash same as slash. Add
701 2009-06-09 Corinna Vinschen <corinna@vinschen.de>
703 * autoload.cc (GetSystemTimes): Remove.
704 * fhandler_proc.cc (format_proc_uptime): Use global system_info rather
705 than retrieving a local copy of the SYSTEM_INFO. Drop call to
706 GetSystemTimes and retrieve SystemPerformanceInformation on all systems
707 again with buffer size big enough for 64 bit systems.
708 (format_proc_stat): Use global system_info rather than retrieving a
709 local copy of the SYSTEM_INFO. Retrieve SystemPerformanceInformation
710 with buffer size big enough for 64 bit systems.
712 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
714 * autoload.cc (GetSystemTimes): Define.
715 * fhandler_proc.cc (format_proc_uptime): Use GetSystemInfo to retrieve
716 processor count. Use GetSystemTimes when available to retrieve system
717 idle time. Improve debug output.
718 (format_proc_stat): Use GetSystemInfo to retrieve processor
719 count. Improve debug output. Ignore if SystemPerformanceInformation
720 returns error. Explain why.
722 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
724 * fork.cc (frok::parent): Remove ancient code erroneously flushing
727 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
729 * cygerrno.h (save_errno::~save_errno): Set errno directly to avoid
730 flooding debug output.
732 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
734 * path.cc (symlink_info::check): Return with error set to ENOENT if
735 STATUS_NO_MEDIA_IN_DEVICE is returned.
737 2009-06-07 Christopher Faylor <me+cygwin@cgf.cx>
739 * cygheap.h (mini_cygheap): New struct.
740 (init_cygheap): Inherit locale field via mini_cygheap.
741 * cygheap.cc (cygheap_at_start): Define new variable.
742 (cygheap): Initialize as cygheap_at_start so that locale information is
744 (cygheap_init): Initialize cygheap iff it is set to cygheap_at_start.
745 * shared_info.h (memory_init): Accommodate argument change.
746 * memory.cc (memory_init): Accept an argument indicating whether
747 cygheap should be initialized or not.
748 * dcrt0.cc (child_info_fork::handle_fork): Pass false to memory_init().
749 (child_info_spawn::handle_spawn): Ditto.
750 (dll_crt0_0): Pass true to memory_init when not forking or execing.
752 * cygheap.h (cygheap_types::HEAP_2_DLL): New enum.
753 * dll_init.h (dll): Remove unused namelen field.
754 (dll_list::load_after_fork): Accommodate change in arguments.
755 * dll_init.cc (dll_list::alloc): Allocate dll information in the cygwin
757 (dll_list::detach): Free dll information from the cygwin heap.
758 (dll_list::load_after_fork): Use dll information in the cygwin heap
759 directly rather than querying parent.
760 * fork.cc (frok::first_dll): Delete.
761 (frok::child): Don't report on first_dll. Don't pass it to
763 (frok::parent): Don't set first_dll.
766 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
768 * dll_init.cc (dll_list::alloc): Allocate memory using a section
769 object. Explain why. Drop call to GetSystemInfo, rather call
770 getpagesize to get allocation granularity. Only align to allocation
771 granularity under WOW64. Use roundup2 to align.
772 (dll_list::detach): Call NtUnmapViewOfSection instead of VirtualFree.
774 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
776 * mmap.cc: Use NtUnmapViewOfSection instead of UnmapViewOfFile
777 throughout for symmetry.
778 (fhandler_dev_mem::munmap): Use correct process handle in call to
779 NtUnmapViewOfSection.
781 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
783 * dll_init.h (struct dll): Set size of name element to ANYSIZE_ARRAY.
784 * dll_init.cc: Fix formatting.
785 (dll_list::alloc): Only allocate as much memory for struct dll as
786 necessary for given DLL name.
787 (dll_list::load_after_fork): Only read a single page of parent memory.
788 Only read more if namelen indicates that it's necessary.
790 2009-06-05 Dave Korn <dave.korn.cygwin@gmail.com>
792 * winbase.h (ilockexch): Fix asm constraints.
793 (ilockcmpexch): Likewise.
795 2009-06-05 Corinna Vinschen <corinna@vinschen.de>
797 * heap.cc (heap_init): Fix typo in comment.
799 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
801 * fhandler_clipboard.cc: Avoid calling system_printf.
802 (set_clipboard): Add basic error checking. Set errno here. Per MSDN,
803 don't call GlobalFree on data block transferred to clipboard.
804 (fhandler_dev_clipboard::write): Drop setting errno after call to
806 (fhandler_dev_clipboard::read): Add basic error checking. Simplify code.
808 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
810 * fhandler_console.cc (set_console_title): Convert title string to
811 wchar_t and call SetConsoleTitleW.
813 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
815 * fhandler_console.cc (fhandler_console::read): Allow Ctrl-Space to
818 2009-06-04 Dave Korn <dave.korn.cygwin@gmail.com>
820 * thread.cc (__cygwin_lock_lock): Delete racy optimisation.
821 (__cygwin_lock_unlock): Likewise.
823 2009-06-03 IWAMURO Motnori <deenheart@gmail.com>
825 * strfuncs.cc (sys_cp_mbstowcs): Fix condition.
827 2009-06-03 Corinna Vinschen <corinna@vinschen.de>
829 * strfuncs.cc (sys_cp_wcstombs): Implement reverse functionality
830 of the change to sys_cp_mbstowcs from 2009-05-30.
831 (sys_cp_mbstowcs): Slightly reformat. Fix comment to accommodate
832 change to sys_cp_wcstombs. Don't write to *ptr if dst is NULL.
834 2009-06-03 Corinna Vinschen <corinna@vinschen.de>
836 * fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace
837 to \033\177 or to \377 dependent on the setting of dev_state->metabit.
839 2009-06-02 Corinna Vinschen <corinna@vinschen.de>
841 * path.cc (path_conv::check): Don't call set_exec for files on "noacl"
844 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
846 * strfuncs.cc (sys_cp_mbstowcs): Treat src as unsigned char *. Convert
847 failure of f_mbtowc into a single malformed utf-16 value.
849 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
851 * cygwin/include/sys/termios.h: Make default erase character "^?".
853 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
855 * fhandler_console.cc (fhandler_console::read): Convert backspace key
858 2009-05-29 Christopher Faylor <me+cygwin@cgf.cx>
860 * path.cc (cwdstuff::set): Rewrite previous change to properly test the
863 2009-05-28 Christopher Faylor <me+cygwin@cgf.cx>
865 * path.cc (cwdstuff::set): Avoid removing a nonexistent trailing slash.
867 2009-05-20 Eric Blake <ebb9@byu.net>
869 * net.cc (gethostby_helper): Use correct signedness.
871 2009-05-18 Christopher Faylor <me+cygwin@cgf.cx>
873 * mount.cc (mount_info::add_item): Avoid using any-old '/' as
876 2009-05-18 Christopher Faylor <me+cygwin@cgf.cx>
878 * mount.cc (mount_info::got_usr_bin): Mark as NO_COPY.
879 (mount_info::got_usr_lib): Ditto.
880 (mount_info::root_idx): Ditto.
882 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
884 * wchar.h (sys_mbstowcs): Add missing __stdcall attribute.
886 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
888 * cygheap.cc (cygheap_init): Set Cygwin default locale values.
889 * cygheap.h (struct cygheap_locale): New structure.
890 (struct user_heap_info): Add cygheap_locale member locale.
891 * dcrt0.cc (dll_crt0_1): Revert to calling _setlocale_r so that only
892 the applications locale is reverted to "C".
893 * environ.cc (environ_init): Remove unused got_lc variable.
894 * fhandler.h (class dev_console): Remove now unsed locale variables.
895 * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove
896 setting dev_console's locale members.
897 (dev_console::con_to_str): Use internal locale settings. Default to
898 __ascii_wctomb if charset is "ASCII".
899 (fhandler_console::write_normal): Ditto.
900 * strfuncs.cc (__ascii_wctomb): Drop declaration.
901 (__db_wctomb): Use fixed value 2 instead of not
902 necessarily matching MB_CUR_MAX.
903 (__eucjp_wctomb): Use 3 instead of MB_CUR_MAX.
904 (sys_cp_wcstombs): Remove special case for "C" locale.
905 (sys_wcstombs): Implement here. Use internal locale data stored on
907 (sys_cp_mbstowcs): Remove special case for "C" locale.
908 (sys_mbstowcs): Implement here. Use internal locale data stored on
910 * syscalls.cc (internal_setlocale): New function to set cygheap locale
911 data and to reset CWD posix path.
912 (setlocale): Just call internal_setlocale from here if necessary.
913 * wchar.h (__ascii_wctomb): Declare.
914 (sys_wcstombs): Don't define inline, just declare.
915 (sys_mbstowcs): Ditto.
917 2009-05-14 Christopher Faylor <me+cygwin@cgf.cx>
919 * mount.cc (mount_info::init): Remove MOUNT_CYGWIN_EXEC setting when
920 auto-mounting /usr/bin.
922 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
924 * mount.cc (oopts): Add a no-op "auto" option.
925 (mount_info::create_root_entry): Set root dir to MOUNT_IMMUTABLE rather
926 than to MOUNT_OVERRIDE.
928 2009-05-13 Corinna Vinschen <corinna@vinschen.de>
929 Christopher Faylor <me+cygwin@cgf.cx>
931 * mount.cc (mount_info::got_usr_bin): Define.
932 (mount_info::got_usr_lib): Ditto.
933 (mount_info::root_idx): Ditto.
934 (mount_info::create_root_entry): Create root entry as immutable and
936 (mount_info::init): Remove "Huh? No /etc/fstab..." warning.
937 Unconditionally call from_fstab for user and system tables. Fill in
938 /usr/bin and /usr/lib if they have not been specified in /etc/fstab.
939 (oopts): Alphabetize. Add "override" option to allow overriding
940 immutable mount points.
941 (mount_info::add_item): Accommodate new MOUNT_IMMUTABLE flag intended
943 (mount_info::add_item): Detect "/usr/bin", "/usr/lib", and "/" and set
944 appropriate global state.
945 (fillout_mntent): Add ,auto to mount points added by Cygwin DLL.
946 (mount): Remove masking of MOUNT_SYSTEM. Allow user to shoot
947 themselves. Add comment.
948 * mount.h (mount_info::got_usr_bin): Declare.
949 (mount_info::got_usr_lib): Ditto.
950 (mount_info::root_idx): Ditto.
951 * include/sys/mount.h: Reformat enum.
952 Add MOUNT_{OVERRIDE,IMMUTABLE,AUTOMATIC}.
954 2009-05-13 Corinna Vinschen <corinna@vinschen.de>
956 * cygheap.h (cwdstuff): Convert to class. Make posix and dir private.
957 (cwdstuff::get_posix): New method.
958 (cwdstuff::reset_posix): New method.
959 * dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r.
960 * environ.cc (environ_init): Ditto. Prefer "C" locale over current
961 codepage default locale.
962 * path.cc (chdir): Use cwdstuff::get_posix method instead of accessing
963 cwdstuff::posix directly.
964 (cwdstuff::set): Defer creating posix path to first usage.
965 (cwdstuff::get_posix): Create posix path if it's empty, and return it.
966 (cwdstuff::get): Create posix path if it's empty.
967 * strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C"
969 (sys_cp_mbstowcs): Ditto.
970 * syscalls.cc (gen_full_path_at): Fetch CWD posix path locked.
971 (setlocale): Implement here. Reset CWD posix path.
973 2009-05-09 Christopher Faylor <me+cygwin@cgf.cx>
975 * cygwin/version.h (CYGWIN_VERSION_CYGWIN_CONV): New define.
977 2009-05-09 Corinna Vinschen <corinna@vinschen.de>
979 * dtable.cc (dtable::init_std_file_from_handle): Add workaround for
980 Windows 7 64 bit issue. Add lengthy comment to explain what happens.
981 * wincap.h (wincaps::has_console_handle_problem): New element.
982 * wincap.cc: Implement above element throughout.
983 (wincap_7): New wincaps structure for NT 6.1 kernels.
984 (wincapc::init): Set has_console_handle_problem to false for 32 bit
987 2009-05-09 Corinna Vinschen <corinna@vinschen.de>
989 * sec_auth.cc (str2uni_cat): Move from here...
990 * path.cc (str2uni_cat): ...to here. Simplify. Make static inline.
991 (get_nt_native_path): Use RtlAppendUnicodeToString rather than
992 str2uni_cat for constant strings for speed.
993 * security.h (str2uni_cat): Drop declaration.
995 2009-05-08 Corinna Vinschen <corinna@vinschen.de>
996 IWAMURO Motonori <deenheart@gmail.com>
998 * strfuncs.cc (sys_cp_wcstombs): save and restore previous errno value.
999 (sys_cp_mbstowcs): Ditto.
1001 2009-05-08 IWAMURO Motonori <deenheart@gmail.com>
1003 * strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting
1004 wide char to SO/UTF-8 sequence.
1006 2009-05-08 Corinna Vinschen <corinna@vinschen.de>
1008 * include/sys/select.h: Guard definitions with __USE_W32_SOCKETS as
1009 the accompanying fd_set definitions in newlib's sys/types.h.
1011 2009-05-06 Christopher Faylor <me+cygwin@cgf.cx>
1013 * fhandler_console.cc (fhandler_console::ioctl): Properly treat
1014 TIOCLINUX argument as a char.
1015 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use coercion to properly
1018 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
1020 * libc/minires.c (scanline): Fix type in calls to ctype functions
1021 to stay in unsigned char range for char values >= 0x80.
1022 * regex/regcomp.c: Ditto, throughout.
1023 * regex/regex2.h (ISWORD): Ditto.
1025 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
1027 * cygheap.cc (cygheap_init): Set umask to a sane default.
1028 * uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH
1029 to set HOME. Default to /home/USERNAME.
1031 2009-05-03 Corinna Vinschen <corinna@vinschen.de>
1033 * security.cc (set_file_sd): Drop using FILE_OPEN_FOR_RECOVERY flag in
1035 * exceptions.cc (open_stackdumpfile): Ditto in call to NtCreateFile.
1036 * fhandler.cc (fhandler_base::open): Ditto. Simplify setting
1039 * mount.cc (fs_info::update): Recognize offline storage.
1040 (fillout_mntent): Report UDF and offline storage.
1041 * mount.h (class fs_info): Add is_csc_cache status flag.
1043 2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
1045 * fhandler_console.cc (fhandler_console::write_console): Eliminate
1046 unneeded debugging output.
1047 (fhandler_console::write_normal): Eliminate unneeded __seterrno.
1049 2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
1051 * libc/minires.c (scanline): Accommodate ctype changes which disallow
1052 use of an unadorned char argument to is* macros.
1053 * regex/regcomp.c: Ditto, throughout.
1054 * regex/regex2.h (ISWORD): Ditto.
1056 2009-05-03 Christopher Faylor <me+cygwin@cgf.cx>
1058 * fhandler.h (fhandler_console::MAX_WRITE_CHARS): Declare.
1059 (fhandler_console::write_replacement_char): Declare as inline.
1060 (fhandler_console::write_console): Declare new function.
1061 * fhandler_console.cc (fhandler_console::MAX_WRITE_CHARS): Define.
1062 (handler_console::write_console): Define.
1063 (fhandler_console::write_replacement_char): Define as inline.
1064 (fhandler_console::write_normal): Use write_console when writing
1065 buffers of unknown length.
1067 2009-04-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1069 * include/cygwin/socket.h: Define SOL_IPV6.
1071 2009-04-21 Corinna Vinschen <corinna@vinschen.de>
1073 * ctype.cc (__set_ctype): Copy exact part of the current active
1074 character class array.
1076 2009-04-20 Corinna Vinschen <corinna@vinschen.de>
1078 * flock.cc (lf_setlock): Handle border case which results in WFMO loop
1079 exiting with ret == WAIT_TIMEOUT gracefully. Add a system_printf to
1080 uncover other potential problems with WFMO loop.
1082 2009-04-18 Christopher Faylor <me+cygwin@cgf.cx>
1084 * mkimport: Specify .text for stub explicitly.
1085 * speclib: Add a dummy '.idata$7' section referring to the dll
1086 associated with the real import library.
1088 2009-04-18 Corinna Vinschen <corinna@vinschen.de>
1090 * dcrt0.cc (globify): Only call mbtowc for non-ascii chars.
1092 2009-04-17 Corinna Vinschen <corinna@vinschen.de>
1094 * dcrt0.cc (globify): Make multibyte-aware.
1096 2009-04-17 Corinna Vinschen <corinna@vinschen.de>
1098 * flock.cc (class inode_t): Add i_wait member and matching methods
1099 wait(), unwait(), and waiting().
1100 (inode_t::inode_t): Initialize i_wait to 0.
1101 (fhandler_disk_file::lock): Only remove node if no other thread is
1102 waiting for a blocking lock.
1103 (lf_setlock): Manipulate node->i_wait to signal that a thread is
1104 waiting for a blocking lock in this node.
1105 (lf_findoverlap): Reinstantiate SELF test as in original code.
1107 2009-04-16 Corinna Vinschen <corinna@vinschen.de>
1109 * dlfcn.cc (get_full_path_of_dll): Just return a bool value. Drop
1110 local path_conv in favor of getting it as parameter. Add local string
1111 buffer instead of getting it as parameter.
1112 (dlopen): Accommodate get_full_path_of_dll change. Fetch WCHAR Windows
1113 path from path_conv variable and call LoadLibraryW.
1115 2009-04-16 Corinna Vinschen <corinna@vinschen.de>
1117 * ntdll.h (STATUS_LOCK_NOT_GRANTED): Define.
1118 * syscalls.cc (unlink_nt): Handle STATUS_LOCK_NOT_GRANTED same as
1119 STATUS_SHARING_VIOLATION. Add lengthy comment to explain why.
1121 2009-04-15 Corinna Vinschen <corinna@vinschen.de>
1123 * path.cc (path_conv::get_wide_win32_path): Allow relative paths.
1124 (cygwin_conv_path): In case of CCP_POSIX_TO_WIN_W, convert relative
1125 paths to absolute paths if the relative pathname length exceeds
1128 2009-04-15 Corinna Vinschen <corinna@vinschen.de>
1130 * libc/bsdlib.cc: Align copyright with upstream.
1131 * libc/fnmatch.c: Ditto.
1132 * libc/fts.c: Ditto.
1133 * libc/inet_addr.c: Ditto.
1134 * libc/inet_network.c: Ditto.
1135 * libc/rcmd.cc: Ditto.
1136 * libc/rexec.cc: Ditto.
1138 2009-04-14 Christopher Faylor <me+cygwin@cgf.cx>
1140 * speclib: Really revert to using tempdir.
1142 2009-04-14 Christopher Faylor <me+cygwin@cgf.cx>
1144 * speclib: Revert to using tempdir.
1146 2009-04-14 Corinna Vinschen <corinna@vinschen.de>
1148 * localtime.cc (tzload): Implement setting __tzrule's offset member
1149 using newlib's __gettzinfo () interface also when tzload returns
1152 2009-04-13 Dave Korn <dave.korn.cygwin@gmail.com>
1154 * include/stdint.h (intptr_t): Remove long from type.
1155 (uintptr_t): Likewise.
1156 (INTPTR_MIN): Remove 'L' suffix.
1157 (INTPTR_MAX, UINTPTR_MAX): Likewise.
1159 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
1161 * speclib: Initial stab at cleaning up temp files. More work needed.
1164 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
1166 * Makefile.in (clean): Clean globals.h.
1167 (LIBCOS): Depend on globals.h.
1169 2009-04-11 Christopher Faylor <me+cygwin@cgf.cx>
1171 * mkimport: New script to perform all operations necessary to create
1175 * Makefile.in (toolopts): New variable which holds options relating to
1177 (speclib): Use toolopts. Add symbols to avoid copying to special
1179 (OBSOLETE_FUNCTIONS): Delete.
1180 (NEW_FUNCTIONS): Change to represent an argument to new mkimport
1182 (libcygwin.a): Use only new mkimport script to create libcygwin.a.
1183 Only rely on ${LIBCOS}.
1184 (*/lib*.a): Simplify speclib dependencies.
1185 (speclib): Accept toolchain options. Convert every argument to
1186 absolute path. Simplify parsing of nm output. Accommodate new
1189 2009-04-11 Dave Korn <dave.korn.cygwin@googlemail.com>
1191 * include/stdint.h (INTPTR_MIN, INTPTR_MAX): Add 'L' suffix.
1192 (WINT_MAX): Add 'U' suffix.
1194 2009-04-10 Christopher Faylor <me+cygwin@cgf.cx>
1196 * speclib: Use a more robust method to derive full file path.
1198 2009-04-09 Christopher Faylor <me+cygwin@cgf.cx>
1200 * speclib: Semi-revert to previous version but don't try to generate
1201 well-formed import library. Instead, just extract appropriate symbols
1202 and let later libcygwin.a on link line fill in the rest of the import
1204 * gendef: Hopefully no-op modification to allow easier post-processing
1207 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1209 * syscalls.cc (try_to_bin): Use tmp_pathbuf buffer to allocate infobuf
1210 rather than using the stack.
1212 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1214 * syscalls.cc (try_to_bin): Fix alignment of infobuf.
1216 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1218 * fhandler_disk_file.cc (fhandler_disk_file::fchown): Catch an
1219 error when changing the user account on a standalone Samba server.
1221 * sec_acl.cc (setacl): Accommodate additional parameter to set_file_sd.
1222 * sec_helper.cc (SECURITY_SAMBA_UNIX_AUTHORITY): Define.
1223 (well_known_samba_unix_user_fake_sid): Define.
1224 * security.cc (set_file_sd): Take additional parameter if ownership
1225 should be changed. Restrict requested permissions accordingly.
1226 (set_file_attribute): Accommodate additional parameter to set_file_sd.
1227 * security.h (well_known_samba_unix_user_fake_sid): Declare.
1228 (set_file_sd): Align declaration to above change.
1230 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1232 * include/stdint.h (int_least32_t): Define as int.
1233 (uint_least32_t): Ditto, unsigned.
1234 (int_fast16_t): Define as int.
1235 (int_fast32_t): Ditto.
1236 (uint_fast16_t): Ditto, unsigned.
1237 (uint_fast32_t): Ditto.
1238 (UINT32_MAX): Remove `L' long marker.
1239 (UINT_LEAST32_MAX): Ditto.
1240 (UINT_FAST16_MAX): Ditto.
1241 (UINT_FAST32_MAX): Ditto.
1245 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1247 * strfuncs.cc: Change WCHAR to wchar_t in multibyte<->widechar
1248 conversion functions throughout.
1249 * wchar.h: Ditto in declarations. Guard them __INSIDE_CYGWIN__.
1251 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1253 * fhandler.h (class dev_console): Add members con_mbtowc, con_wctomb,
1255 (dev_console::str_to_con): Take mbtowc function pointer and charset
1256 as additional parameters.
1257 * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
1258 aforementioned new members. Explain why.
1259 (dev_console::con_to_str): Remove useless comment. Call new
1260 sys_cp_wcstombs function rather than sys_wcstombs.
1261 (dev_console::str_to_con): Take mbtowc function pointer and charset
1262 as additional parameters. Call sys_cp_mbstowcs accordingly.
1263 (fhandler_console::write_normal): Only initialize f_mbtowc and charset
1264 once. Accommodate changed str_to_con.
1265 * strfuncs.cc (sys_cp_wcstombs): Renamed from sys_wcstombs. Take
1266 wctomb function pointer and charset as parameters. Use throughout.
1267 (sys_cp_mbstowcs): Take wctomb function pointer and charset as
1268 parameters instead of codepage. Remove matching local variables and
1269 their initialization.
1270 * wchar.h (ENCODING_LEN): Define as in newlib.
1271 (__mbtowc): Use mbtowc_p typedef for declaration.
1272 (wctomb_f): New type.
1273 (wctomb_p): New type.
1274 (__wctomb): Declare.
1275 (__utf8_wctomb): Use wctomb_f typedef for declaration.
1276 (sys_cp_wcstombs): Move declaration from winsup.h here.
1277 (sys_wcstombs): Ditto.
1278 (sys_wcstombs_alloc): Ditto.
1279 (sys_cp_mbstowcs): Ditto.
1280 (sys_mbstowcs): Ditto.
1281 (sys_mbstowcs_alloc): Ditto.
1282 * winsup.h: Move declaration of sys_FOO functions to wchar.h. Include
1285 2009-04-06 Earl Chew <earl_chew@agilent.com>
1287 * libc/rexec.cc (ruserpass): Use fstat64 instead of fstat.
1289 2009-04-06 Corinna Vinschen <corinna@vinschen.de>
1291 * strfuncs.cc: Add comment to explain why we can't support JIS
1293 (__db_wctomb): Alwaus use WC_NO_BEST_FIT_CHARS.
1294 (__jis_wctomb): Just call __ascii_wctomb from here.
1295 (__eucjp_wctomb): Convert to standalone implementation to fix up the
1296 difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
1298 (__kr_wctomb): Use codepage 949.
1299 (__db_mbtowc): Reorder code slightly. Always use MB_ERR_INVALID_CHARS
1300 in call to MultiByteToWideChar. Fix a problem with singlebyte
1301 sequences. Fix a bug in '\0' handling. Reset state->__count on
1302 successful return from non-zero state.
1303 (__jis_mbtowc): Just call __ascii_mbtowc from here.
1304 (__eucjp_mbtowc): Convert to standalone implementation to fix up the
1305 difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
1306 (__kr_mbtowc): Use codepage 949.
1307 (__set_charset_from_codepage): Handle codepage 20932 as eucJP.
1309 2009-04-05 Christopher Faylor <me+cygwin@cgf.cx>
1311 * Makefile.in: Use all compile options when calculating magic values.
1312 * shared_info.h (CURR_SHARED_MAGIC): Revert erroneous value.
1313 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
1315 * fhandler.h (acquire_output_mutex): Remove unneeded ';'.
1316 (release_output_mutex): Ditto.
1318 2009-04-05 Christopher Faylor <me+cygwin@cgf.cx>
1320 * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings.
1321 * shared_info.h (CURR_SHARED_MAGIC): Update.
1322 * spawn.cc (spawn_guts): Avoid copying one line command line argument
1323 if it hasn't been filled out.
1325 2009-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1326 Corinna Vinschen <corinna@vinschen.de>
1328 * include/asm/byteorder.h (__ntohl): Prototype before define to avoid
1329 a warning with -Wmissing-prototypes. Use _ELIDABLE_INLINE macro from
1333 2009-04-02 Corinna Vinschen <corinna@vinschen.de>
1335 * environ.cc (build_env): Fix length calculation of resulting
1336 wide char environment string.
1338 2009-04-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1340 * include/netdb.h: #include <inttypes.h>, <netinet/in.h>,
1341 and <sys/socket.h> per SUSv3.
1343 2009-04-01 Corinna Vinschen <corinna@vinschen.de>
1345 * strfuncs.cc (sys_cp_mbstowcs): Check if ASCII SO is followed by at
1346 least two chars and the next byte is a valid UTF-8 start byte before
1347 trying to convert the followup bytes as UTF-8 sequence.
1349 2009-03-31 Corinna Vinschen <corinna@vinschen.de>
1351 * shm.cc (struct shm_attached_list): Convert access type to ULONG.
1352 (fixup_shms_after_fork): Fix comment. Use NtMapViewOfSection rather
1353 than MapViewOfFileEx to recreate shared memory regions. Add function
1354 name to api_fatal output.
1355 (shmat): Use NtMapViewOfSection to create shared memory region
1358 2009-03-31 Corinna Vinschen <corinna@vinschen.de>
1360 * ctype.cc: Remove implementation of ctype functions in favor of
1361 pointer-based newlib implementation.
1362 (_ctype_b): Declare.
1363 (__ctype_cp): Move to newlib. Declare.
1364 (__ctype_iso): Ditto.
1365 (__set_ctype): Implement changing __ctype_ptr__. Only copy character
1366 class data in applications built under older Cygwin.
1367 * cygwin.din (__ctype_ptr__): Export.
1368 * include/ctype.h: Remove in favor of newlib implementation.
1369 * include/cygwin/config.h (__EXPORT): Define alongside __IMPORT.
1370 * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE):
1371 Define check for old vs. new ctype implementation.
1372 Bump API minor number.
1374 2009-03-28 Christopher Faylor <me+cygwin@cgf.cx>
1376 * Makefile.in: Perform some minor cleanup. Revamp speclib handling.
1377 * speclib: Rewrite to create libraries with dlltool rather than
1378 attempting surgery on libcygwin.a.
1380 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1382 * net.cc (inet_ntop6): Convert to lowercase hex digits on the fly.
1384 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1386 * net.cc (cygwin_getaddrinfo): Check hints for non-NULL before
1387 checking its content.
1389 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1391 * fhandler.h (class fhandler_fifo): Rename read/write methods to
1393 * fhandler_fifo.cc: Ditto.
1395 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1397 * syscalls.cc (pathconf): Fix memory leak.
1399 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
1401 * path.cc (symlink_worker): Write target filename as UTF-16 string
1402 with leading BOM marker.
1403 (symlink_info::check_shortcut): If check for leading BOM marker
1404 succeeds, read filename as UTF-16 string.
1405 (symlink_info::check_sysfile): Ditto.
1407 2009-03-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1409 * include/asm/byteorder.h (__ntohl): Align definition to ISO C99.
1412 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
1414 * strfuncs.cc (__set_charset_from_codepage): Revert to translating
1415 codepage 936 to "GBK".
1417 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1419 * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two
1422 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1424 * environ.cc (environ_init): Break from locale loop after first hit.
1425 * fhandler_console.cc (fhandler_console::write_normal): Print a SO
1426 sequence using always valid Unicode chars.
1428 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1430 * strfuncs.cc (__kr_wctomb): Use codepage 51949 rather than 50949.
1431 (__kr_mbtowc): Ditto.
1432 (__set_charset_from_codepage): Ditto. Translate codepage 936 to
1433 "GB2312" and drop the charset name "GBK".
1435 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1437 * strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949.
1438 (__kr_mbtowc): Ditto.
1439 (__set_charset_from_codepage): Translate codepages 949 and 50949 to
1440 "EUCKR" and drop the charset name "CP949".
1442 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1444 * strfuncs.cc (sys_cp_mbstowcs): Don't read beyond src + nms.
1446 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1448 * shared_info.h (CURR_SHARED_MAGIC): Update.
1450 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1452 * wchar.h: Replace UINT with unsigned int.
1454 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1456 * wchar.h: Remove erroneous "C" specifier from extern declaration.
1458 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1460 * ctype.cc (_CTYPE_DATA_0_127): Add _B class to TAB character.
1461 (__ctype_default): New character class array for default ASCII
1463 (__ctype_iso): New array of character class array for ISO charsets.
1464 (__ctype_cp): Ditto for singlebyte Windows codepages.
1465 (tolower): Implement as distinct function to support any singlebyte
1468 (__set_ctype): New function to copy singlebyte character classes
1469 corresponding to current charset to ctype_b array.
1470 Align copyright text to upstream.
1471 * dcrt0.cc (dll_crt0_1): Reset current locale to "C" per POSIX.
1472 * environ.cc (set_file_api_mode): Remove.
1473 (codepage_init): Remove.
1474 (parse_thing): Remove "codepage" setting.
1475 (environ_init): Set locale according to environment settings, or
1476 to current codepage, before converting environment to multibyte.
1477 * fhandler.h (fhandler_console::write_replacement_char): Drop argument.
1478 * fhandler_console.cc (dev_console::str_to_con): Call sys_cp_mbstowcs
1479 rather than MultiByteToWideChar.
1480 (fhandler_console::write_replacement_char): Always print a funny
1481 half filled square if a character isn't in the current charset.
1482 (fhandler_console::write_normal): Convert to using __mbtowc
1483 rather than next_char.
1484 * fork.cc (frok::child): Drop call to set_file_api_mode.
1485 * globals.cc (enum codepage_type) Remove.
1486 (current_codepage): Remove.
1487 * miscfuncs.cc (cygwin_wcslwr): Unused, dangerous. Remove.
1488 (cygwin_wcsupr): Ditto.
1489 (is_cp_multibyte): Remove.
1490 (next_char): Remove.
1491 * miscfuncs.h (is_cp_multibyte): Drop declaration.
1493 * strfuncs.cc (get_cp): Remove.
1494 (__db_wctomb): New function to implement _wctomb_r functionality for
1495 doublebyte charsets using WideCharToMultiByte.
1496 (__sjis_wctomb): New function to replace unusable newlib function.
1497 (__jis_wctomb): Ditto.
1498 (__eucjp_wctomb): Ditto.
1499 (__gbk_wctomb): New function.
1500 (__kr_wctomb): Ditto.
1501 (__big5_wctomb): Ditto.
1502 (__db_mbtowc): New function to implement _mbtowc_r functionality for
1503 doublebyte charsets using MultiByteToWideChar.
1504 (__sjis_mbtowc): New function to replace unusable newlib function.
1505 (__jis_mbtowc): Ditto.
1506 (__eucjp_mbtowc): Ditto.
1507 (__gbk_mbtowc): New function.
1508 (__kr_mbtowc): New function
1509 (__big5_mbtowc): New function
1510 (__set_charset_from_codepage): New function.
1511 (sys_wcstombs): Reimplement, basically using same wide char to multibyte
1512 conversion as newlib's application level functions. Plus extras.
1513 Add lengthy comment to explain. Change return type to size_t.
1514 (sys_wcstombs_alloc): Just use sys_wcstombs. Change return type to
1516 (sys_cp_mbstowcs): Replace sys_mbstowcs, take additional codepage
1517 argument. Explain why. Change return type to size_t.
1518 (sys_mbstowcs_alloc): Just use sys_mbstowcs. Change return type to
1520 * wchar.h: Declare internal functions implemented in strfuncs.cc.
1521 (wcscasecmp): Remove.
1522 (wcsncasecmp): Remove.
1525 * winsup.h (codepage_init): Remove declaration.
1527 (sys_wcstombs): Align declaration to new implementation.
1528 (sys_wcstombs_alloc): Ditto.
1529 (sys_cp_mbstowcs): Add declaration.
1530 (sys_mbstowcs): Define as inline function.
1531 (sys_mbstowcs_alloc): Align declaration to new implementation.
1532 (set_file_api_mode): Remove declaration.
1533 * include/ctype.h (isblank): Redefine to use _B character class.
1534 (toupper): Remove ASCII-only definition.
1537 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1539 * sec_auth.cc (str2buf2uni): Remove.
1540 * security.h (str2buf2uni): Remove declaration.
1542 2009-03-24 Yaakov Selkowitz <yselkowitz@cygwin.com>
1544 * include/mntent.h: Remove declarations of nonexistant addmntent
1545 and hasmntopt. Update and clarify the /etc/mtab comment.
1547 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
1549 * smallprint.cc (__small_vsprintf): Handle NULL PWCHAR and
1550 PUNICODE_STRING arguments.
1551 (__small_vswprintf): Ditto.
1553 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
1555 * include/asm/byteorder.h (__constant_ntohs): Remove declaration.
1556 (__constant_ntohl): Ditto.
1558 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
1560 * cygwin.din: Export wordexp, wordfree.
1561 * posix.sgml: Move them to SUSv4 list.
1562 * include/cygwin/version.h: Bump API minor number.
1564 2009-03-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1566 * include/sys/un.h: #include <string.h> for strlen.
1568 2009-03-19 Corinna Vinschen <corinna@vinschen.de>
1570 * dlfcn.cc (get_full_path_of_dll): Revert patch from 2008-07-16.
1572 2009-03-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1574 * cygwin.din: Export log2, log2f as functions.
1575 * posix.sgml: Add them to SUSv4 list.
1576 * include/cygwin/version.h: Bump API minor number.
1578 2009-03-18 Corinna Vinschen <corinna@vinschen.de>
1580 * sec_auth.cc (lsaauth): Remove local definitions of struct
1581 _TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions
1583 (lsaprivkeyauth): As in lsaauth, fetch linked token if available and
1584 return that in favor of default token.
1586 2009-03-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1588 * errno.cc (_sys_errlist): Add ESTRPIPE.
1590 2009-03-15 Corinna Vinschen <corinna@vinschen.de>
1592 * cygwin.din: Export wcsdup.
1593 * posix.sgml: Add wcsdup to SUSv4 list.
1594 * include/cygwin/version.h: Bump API minor number.
1596 2009-03-15 Corinna Vinschen <corinna@vinschen.de>
1598 * include/inttypes.h: Remove "l" size specifier from all 16 and 32 bit
1601 2009-03-14 Christopher Faylor <me+cygwin@cgf.cx>
1603 * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered
1604 during initialization.
1606 2009-03-14 Corinna Vinschen <corinna@vinschen.de>
1608 * gendef: Remove STABS directives.
1610 2009-03-13 Corinna Vinschen <corinna@vinschen.de>
1612 * mktemp.cc: Remove STABS specific link-time warning. Align copyright
1615 2009-03-13 Corinna Vinschen <corinna@vinschen.de>
1617 * flock.cc: Fix lockf copyright to latest version.
1619 2009-03-12 Corinna Vinschen <corinna@vinschen.de>
1621 * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined
1623 (get_ino_by_handle): Take additional path_conv argument, accommodate
1624 throughout. Only use FileId if isgood_inode check is true.
1625 (fhandler_base::open_fs): Simplify setting ino due to above change.
1626 (readdir_get_ino): Make sure to return always a non-zero inode number.
1627 (fhandler_disk_file::readdir): Always open file in dir with
1628 FILE_OPEN_REPARSE_POINT so as not to open wrong file.
1629 Drop call to isgood_inode here.
1630 * path.cc (symlink_info::check): Call fs.update in case we're fetching
1631 file information from call to NtQueryDirectoryFile.
1633 2009-03-12 Corinna Vinschen <corinna@vinschen.de>
1635 * flock.cc (fhandler_disk_file::lock): Don't test file open mode in
1636 case of flock-type locks. Explain why.
1638 2009-03-12 Brian Ford <Brian.Ford@FlightSafety.com>
1640 * gethostby_helper: Fix typos in DEBUGGING case.
1642 2009-03-11 Corinna Vinschen <corinna@vinschen.de>
1644 * cygwin.din: Export wcscasecmp, wcsncasecmp.
1645 * posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list.
1646 * include/cygwin/version.h: Bump API minor number.
1648 2009-03-11 Corinna Vinschen <corinna@vinschen.de>
1650 * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf,
1652 * posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf
1654 * include/cygwin/version.h: Bump API minor number.
1656 2009-03-09 Corinna Vinschen <corinna@vinschen.de>
1658 * fhandler.h (fhandler_socket::wait_for_events): Take additional
1659 parameter "dontwait".
1660 * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the
1661 socket is non-blocking if dontwait is true.
1662 (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to
1663 set the wait_for_events dontwait parameter.
1664 (fhandler_socket::send_internal): Ditto. Optimize code slightly.
1665 * include/cygwin/socket.h (MSG_DONTWAIT): Define.
1666 * include/cygwin/version.h: Bump API minor number.
1668 2009-03-09 Corinna Vinschen <corinna@vinschen.de>
1670 * cygwin.din: Export wcsftime.
1671 * posix.sgml: Move wcsftime to SUSv4 list.
1672 * include/cygwin/version.h: Bump API minor number.
1674 2009-03-06 Pierre A. Humblet <pierre@phumblet.no-ip.org>
1676 * cygwin.din: Export gethostbyname2.
1677 * net.cc: define _CYGWIN_IN_H and include resolv.h.
1678 (realloc_ent): New function.
1679 (dup_ent): Call realloc_ent.
1680 (memcpy4to6): New function.
1681 (dn_length1): New function.
1682 (gethostby_helper): New function.
1683 (gethostbyname2): New function.
1684 * posix.sgml: Add gethostbyname2.
1685 * include/cygwin/version.h: Bump API minor number.
1686 * libc/minires.c (get_options): Look for "inet6" and apply bounds
1687 to "retry" and "retrans".
1688 (res_ninit): Set the default options at the beginning.
1689 (dn_expand): Fix "off by one".
1691 2009-03-06 Corinna Vinschen <corinna@vinschen.de>
1693 * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf,
1695 * posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf
1696 to SUSv4 list. Sort SUSv4 list.
1697 * include/cygwin/version.h: Bump API minor number.
1699 2009-03-04 Corinna Vinschen <corinna@vinschen.de>
1701 * dcrt0.cc (disable_dep): Disable. Explain why.
1702 (dll_crt0_0): Disable calling disable_dep. Explain why.
1704 2009-03-03 Corinna Vinschen <corinna@vinschen.de>
1706 * net.cc: Include asm/byteorder.h.
1707 (htonl): Move to end of file. Add comment to explain why. Align
1708 definition to POSIX. Use related macro from asm/byteorder.h.
1712 * include/asm/byteorder.h: Revert previous patch.
1714 2009-03-03 Corinna Vinschen <corinna@vinschen.de>
1716 * include/asm/byteorder.h: Disable optimization when building
1717 Cygwin network code.
1719 2009-02-26 Christopher Faylor <me+cygwin@cgf.cx>
1721 * dtable.cc (dtable::select_read): Add ability to override fh.
1722 * fhandler.h (fhandler_fifo::select_read): Declare new function.
1723 (fhandler_fifo::select_write): Ditto.
1724 (fhandler_fifo::select_except): Ditto.
1725 * select.cc (peek_pipe): Treat certain classes of pipe errors as "no
1727 (fhandler_fifo::select_read): Define new function.
1728 (fhandler_fifo::select_write): Ditto.
1729 (fhandler_fifo::select_except): Ditto.
1731 * shared_info.h (CURR_SHARED_MAGIC): Update.
1733 2009-02-23 Sjors Gielen <mailinglist@dazjorz.com>
1735 * Makefile.in: Add DESTDIR functionality.
1737 2009-02-23 Corinna Vinschen <corinna@vinschen.de>
1739 * sec_auth.cc (get_user_local_groups): Simplify LookupAccountName code.
1741 2009-02-20 Corinna Vinschen <corinna@vinschen.de>
1743 * autoload.cc (NetLocalGroupEnum): Remove.
1744 (NetLocalGroupGetMembers): Remove.
1745 (NetUserGetLocalGroups): Add.
1746 * sec_auth.cc (is_group_member): Remove function.
1747 (get_user_local_groups): Get user as string instead of as SID.
1748 Call NetUserGetLocalGroups instead of NetLocalGroupEnum. Drop call
1750 (get_server_groups): Call get_user_local_groups with user name instead
1753 2009-02-19 Corinna Vinschen <corinna@vinschen.de>
1755 * winver.rc: Fix Copyright date.
1757 2009-02-19 Corinna Vinschen <corinna@vinschen.de>
1759 * cygwin.din: Export mbsnrtowcs and wcsnrtombs.
1760 * posix.sgml: Move mbsnrtowcs and wcsnrtombs to SUSv4 section.
1761 * include/cygwin/version.h: Bump API minor number.
1763 2009-02-18 Corinna Vinschen <corinna@vinschen.de>
1765 * cygwin.din: Export open_wmemstream.
1766 * posix.sgml: Move open_wmemstream to SUSv4 section.
1767 * include/cygwin/version.h: Bump API minor number.
1769 2009-02-16 Corinna Vinschen <corinna@vinschen.de>
1771 * cygwin.din: Export reallocf.
1772 * malloc_wrapper.cc( reallocf): New function.
1773 * posix.sgml: Add reallocf to BSD section.
1774 * include/cygwin/version.h: Bump API minor number.
1775 * libc/fts.c: Remove erroneous reallocf definition.
1777 2009-02-16 Corinna Vinschen <corinna@vinschen.de>
1779 * cygwin.din: Export wcstoimax, wcstoumax.
1780 * posix.sgml: Move wcstoimax and wcstoumax to SUSv4 section.
1781 * include/inttypes.h: Declare wcstoimax and wcstoumax.
1782 * include/cygwin/version.h: Bump API minor number.
1784 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1786 * cygwin.din: Export wcsnlen.
1787 * posix.sgml: Move wcsnlen to SUSv4 section.
1788 * include/cygwin/version.h: Bump API minor number.
1790 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1792 * environ.cc (_getenv_r): New function.
1794 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1796 * posix.sgml: Move dirfd to SUSv4 section.
1798 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1800 * posix.sgml: Move interfaces deprecated in SUSv4 to deprecated
1801 interfaces section. Move interfaces added in SUSv4 to SUSv4
1802 section or, if unimplemented, add them to the unimplemented interfaces
1805 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1807 * posix.sgml: Merge SUSv3 and SUSv4 section into a single SUSv4 section.
1808 Move Solaris calls now in SUSv4 to SUSv4 section. Rename unimplemented
1809 section to refer to SUSv4. Add note about missing interfaces.
1810 Move wcstod and wcstof from unimplemented to SUSv4 section.
1812 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1814 * mount.cc (mount_info::from_fstab_line): Make cygdrive posix=0 by
1815 default as documented.
1817 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1819 * cygwin.din: Export wcstod and wcstof.
1820 * include/cygwin/version.h: Bump API minor number.
1822 2009-02-11 Corinna Vinschen <corinna@vinschen.de>
1824 * syscalls.cc (open): Handle O_DIRECTORY flag.
1825 * include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH.
1826 * include/cygwin/version.h: Bump API minor number.
1828 2009-02-09 Corinna Vinschen <corinna@vinschen.de>
1830 * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix format. Add
1831 code to allow to read disk and CD/DVD devices in full length. Explain
1833 (fhandler_dev_floppy::raw_read): Add current position to debug output.
1835 * include/sys/sched.h: New stub file to override newlib file with
1836 clashing definitions.
1838 2009-02-05 Corinna Vinschen <corinna@vinschen.de>
1840 * cygwin.din: Export wcstok.
1841 * posix.sgml: Move wcstok from unimplemented to susv3.
1842 * include/cygwin/version.h: Bump API minor number.
1844 2009-02-04 Corinna Vinschen <corinna@vinschen.de>
1846 * fhandler_proc.cc (proc_tab): Add entry for mounts symlink.
1847 (format_proc_mounts): New function to implement mounts symlink.
1848 * fhandler_process.cc (process_tab): Add entry for mounts file.
1849 (format_process_mounts): New function to implement mounts file.
1851 2009-02-04 Corinna Vinschen <corinna@vinschen.de>
1853 * security.cc (alloc_sd): Disable generating default permission entries
1856 2009-01-29 Corinna Vinschen <corinna@vinschen.de>
1858 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number
1859 evaluation for faked "." entry.
1861 * mount.cc (fs_info::update): Move setting of is_cdrom after checking
1862 for caseinsensitivity. Recognize UDF in is_cdrom case and set
1863 caseinsensitive flag according to UDF brokenness determined by OS.
1864 Add comment to explain why.
1865 * mount.h (class fs_info): Add is_udf status flag.
1866 * path.cc (symlink_info::check): Add workaround for UDF bug in
1867 terms of casesensitivity on certain OSes.
1868 * wincap.h (wincaps::has_broken_udf): New element.
1869 * wincap.cc: Implement above element throughout.
1871 2009-01-27 Christopher Faylor <me+cygwin@cgf.cx>
1873 * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on
1874 EINTR or real error.
1875 (fhandler_base::write_overlapped): Assume that bytes_written will
1876 contain proper error value.
1877 * pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since
1878 signals are handled by pipe functions now.
1880 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
1882 * shared.cc (shared_name): New function for WCHAR names.
1883 (open_shared): Take name parameter as WCHAR. Accommodate throughout.
1884 * shared_info.h ((CURR_SHARED_MAGIC): Redefine.
1885 (shared_name): Add declaration for function taking a WCHAR name.
1886 (open_shared): Change declaration according to above change.
1887 * pinfo.cc (pinfo::init) : Accommodate above change.
1889 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
1891 * grp.cc (getgrgid_r): Simplify code by using stpcpy.
1892 (getgrnam_r): Ditto.
1893 * passwd.cc (getpwuid_r32): Simplify code by using stpcpy.
1894 (getpwnam_r): Ditto.
1896 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
1898 * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENT
1901 2009-01-24 Corinna Vinschen <corinna@vinschen.de>
1903 * mount.cc (mount_info::from_fstab): Open fstab file with
1904 FILE_OPEN_FOR_BACKUP_INTENT flag.
1906 2009-01-23 Corinna Vinschen <corinna@vinschen.de>
1908 * smallprint.cc (__small_vsprintf): Use already available buffer tmp
1911 2009-01-22 Christopher Faylor <me+cygwin@cgf.cx>
1913 * select.cc (peek_serial): Add hack to allow proper operation with
1916 2009-01-21 Corinna Vinschen <corinna@vinschen.de>
1918 Remove USE_SERVER define. Accommodate throughout.
1919 * configure.in: Remove --enable-server option.
1920 * configure: Regenerate.
1921 * environ.cc: Remove CYGWIN=server setting.
1923 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
1925 * fhandler_procnet.cc: Reorganize global procnet content data into a
1926 new struct virt_tab_t. Accommodate throughout.
1928 * fhandler.h: Fix copyright dates.
1929 * fhandler_process.cc: Ditto.
1930 * fhandler_registry.cc: Ditto.
1932 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
1934 * devices.h (FH_PROCESSFD): New device type.
1935 * dtable.cc (build_fh_pc): Add case for FH_PROCESSFD.
1936 * fhandler.h (class fhandler_virtual): Drop bufalloc member.
1937 * fhandler_virtual.h: New header.
1938 * fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor
1939 of types virt_type_t and virt_tab_t from fhandler_virtual.h.
1940 Change prototypes of format_XXX functions accordingly.
1941 (proc_tab): Drop size member info.
1942 (fhandler_proc::fill_filebuf): Don't allocate filebuf here. Allocate
1943 it in the format_XXX functions.
1944 * fhandler_process.cc: Reorganize global process content data into a
1945 new struct virt_tab_t. Accommodate throughout.
1946 (format_process_winexename): New function.
1947 (format_process_winpid): New function.
1948 (format_process_exename): New function.
1949 (format_process_root): New function.
1950 (format_process_cwd): New function.
1951 (format_process_cmdline): New function.
1952 (format_process_ppid): New function.
1953 (format_process_uid): New function.
1954 (format_process_pgid): New function.
1955 (format_process_sid): New function.
1956 (format_process_gid): New function.
1957 (format_process_ctty): New function.
1958 (format_process_fd): New function.
1959 * fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use
1961 * fhandler_registry.cc (fhandler_registry::fill_filebuf): Define
1963 * fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop
1964 initialization of bufalloc.
1965 (fhandler_virtual::dup): Drop copying bufalloc.
1967 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
1969 * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.
1970 * thread.cc (pthread_rwlock::rdlock): If a thread already owns a
1971 read lock, just count the number of locks for it, per SUSv4.
1972 (pthread_rwlock::tryrdlock): Ditto.
1973 (pthread_rwlock::unlock): If a thread has more than one concurrent
1974 read locks, just count down.
1976 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
1978 * autoload.cc (WSAIoctl): Reintroduce.
1979 (WSASendMsg): Define.
1980 * fhandler.h (class fhandler_socket): Change definition of recv_internal
1981 and send_internal to take WSAMSG pointer as parameter.
1982 * fhandler_socket.cc (WSAID_WSARECVMSG): Define.
1983 (LPFN_WSARECVMSG): Define.
1984 (WSASendMsg): Declare.
1985 (get_ext_funcptr): New function to fetch address of WSARecvMsg.
1986 (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter.
1987 Change code accordingly. If control information is requested,
1988 fetch address of WSARecvMsg and use that instead of WSARecvFrom.
1989 (fhandler_socket::recvfrom): Change return type to ssize_t as
1990 declared in fhandler.h. Accommodate changes to recv_internal.
1991 (fhandler_socket::recvmsg): Ditto. Make sure that control information
1992 is only requested if system, address family, and socket type support it.
1993 (fhandler_socket::send_internal): Take just a LPWSAMSG parameter
1994 and the flags. Change code accordingly. If control information is
1995 provided, use WSASendMsg instead of WSASendTo.
1996 (fhandler_socket::sendto): Drop useless comment. Accommodate changes
1998 (fhandler_socket::sendmsg): Ditto. Make sure that control information
1999 is only provided if system, address family, and socket type support it.
2000 * wincap.h (wincaps::has_recvmsg): New element.
2001 (wincaps::has_sendmsg): New element
2002 * wincap.cc: Implement above elements throughout.
2003 * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment
2004 of type struct cmsghdr.
2006 2009-01-17 Corinna Vinschen <corinna@vinschen.de>
2008 * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond
2011 2009-01-17 Corinna Vinschen <corinna@vinschen.de>
2013 * fhandler_proc.cc: Reorganize global proc content data into a new
2014 struct proc_tab_t. Accommodate throughout.
2015 (format_proc_version): New function.
2016 (format_proc_loadavg): New function.
2017 (format_proc_self): New function.
2019 * resource.cc (getrlimit): Return correct rlim_max value for
2022 2009-01-16 Corinna Vinschen <corinna@vinschen.de>
2024 * Fix copyright dates.
2026 2009-01-13 Corinna Vinschen <corinna@vinschen.de>
2028 * libc/getopt.c (parse_long_options): Use fix from NetBSD's getopt
2029 to avoid false ambiguities.
2031 2009-01-12 Corinna Vinschen <corinna@vinschen.de>
2033 * syscalls.cc (enum bin_status): New type.
2034 (try_to_bin): Return bin_status. Rename win32_path to pc. Rename h
2035 to fh. Rename fh to tmp_fh. Add code to set delete dispostion and
2036 more code to replace file moved to bin by another, temporary file.
2037 Add comments to explain why.
2038 (unlink_nt): Replace move_to_bin with bin_stat. Only set bin_stat
2039 to move_to_bin for non-remote files. As a last resort, call try_to_bin
2040 if setting delete-on-close failed. Only re-set R/O DOS attribute
2041 and only close handle if it's still valid.
2043 2009-01-11 Corinna Vinschen <corinna@vinschen.de>
2045 * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.
2046 * path.cc (path_conv::check): Set to and check for ENOENT instead of
2049 * path.cc (symlink_info::check): Fix Samba 3.2.x comment.
2051 2009-01-09 Corinna Vinschen <corinna@vinschen.de>
2053 * mount.cc (mount_info::from_fstab_line): Always convert drive
2054 letter in native path to uppercase.
2055 * path.cc (normalize_win32_path): Ditto.
2056 (path_prefix_p): Revert previous patch.
2058 * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
2059 return code to circumvent weird behaviour of Samba 3.2.x shares.
2061 2009-01-09 Christopher Faylor <me+cygwin@cgf.cx>
2063 * include/sys/cygwin.h (CW_SETERRNO): Define.
2064 * external.cc (CW_SETERRNO): Implement.
2065 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to
2066 reflect the above change.
2068 * path.cc (path_prefix_p): Treat X: as equivalent to x:.
2070 * mkglobals_h: Remove unneeded #define.
2072 * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
2074 2009-01-08 Corinna Vinschen <corinna@vinschen.de>
2076 * libc/fts.c (fts_build): Use DT_DIR case on Cygwin.
2077 (fts_ufslinks): Fix using wrong structure member in Cygwin-specific
2080 2009-01-07 Corinna Vinschen <corinna@vinschen.de>
2082 * ntdll.h: Reorder NT status flags. Fix a case difference. Add
2083 STATUS_CANNOT_DELETE flag.
2084 * syscalls.cc (unlink_nt): Change initial NtOpenFile to request
2085 FILE_SHARE_DELETE sharing mode. Change comment accordingly.
2086 If setting delete disposition failed with STATUS_CANNOT_DELETE, try
2087 to delete using delete-on-close. Explain why.
2088 Rearrange setting R/O DOS attribute after trying to delete. Simplify
2091 2009-01-07 Corinna Vinschen <corinna@vinschen.de>
2093 * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe if
2094 original file has .exe as well.
2095 * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit
2098 2009-01-02 Christopher Faylor <me+cygwin@cgf.cx>
2100 Remove unneeded header files from source files throughout.
2101 Update copyrights where appropriate.
2103 * globals.cc: New file for generic global variables.
2104 * mkglobals_h: New script to generate globals.h.
2105 * mkstatic: New script used to build a (currently non-working) static
2107 * Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
2108 (DLL_OFILES): Add globals.o. Make all objects rely on globals.h.
2109 (globals.h): New target. Generate globals.h.
2110 * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE
2111 operator is allowed in _cygtls.
2112 * dcrt0.cc: Move most globals to globals.cc.
2114 * environ.cc (strip_title_path): Remove now-unneeded extern.
2115 * fhandler_serial.cc (fhandler_serial::open): Ditto.
2117 (commune_process): Ditto.
2121 * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
2122 * path.cc (stat_suffixes): Move here.
2123 * security.h: Add forward class path_conv declaration.
2124 * smallprint.cc (__small_vsprintf): Make a true c++ function.
2125 (__small_sprintf): Ditto.
2126 (small_printf): Ditto.
2127 (console_printf): Ditto.
2128 (__small_vswprintf): Ditto.
2129 (__small_swprintf): Ditto.
2130 * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of
2132 (hExeced): Move to globals.cc
2133 * strfuncs.cc (current_codepage): Ditto.
2134 (active_codepage): Ditto.
2135 * sync.cc (lock_process::locker): Move here from dcrt0.cc.
2136 * syscalls.cc (stat_suffixes): Move to path.cc.
2137 * tty.cc (tty::create_master): Uncapitalize fatal warning for
2139 * winsup.h: Include globals.h to declare most of the grab bag list of
2140 globals which were previously defined here.
2142 * mount.h: Move USER_* defines back to shared_info.h.
2144 * speclib: Force temporary directory cleanup.
2146 2009-01-02 Christopher Faylor <me+cygwin@cgf.cx>
2148 * speclib: Rewrite completely in perl. Avoid multiple nm calls.