1 2009-07-27 Corinna Vinschen <corinna@vinschen.de>
3 * mount.h (enum fs_info_type): New type.
4 (IMPLEMENT_FS_FLAG): New define.
5 (class fs_info): Convert filesystem type status flags into an enum
6 fs_info_type. Add cifs FS. Revert change to has_buggy_open and
7 has_buggy_fileid_dirinfo. Make them normal; status flags again.
8 Implement is_FS functions using IMPLEMENT_FS_FLAG.
9 * mount.cc (fs_info::update): Define MINIMAL_WIN_NTFS_FLAGS and
10 FS_IS_WINDOWS_NTFS. Add comment. Only test remote filesystems
11 for "NTFS" once. Add is_cifs check using FS_IS_WINDOWS_NTFS.
12 Set has_buggy_open flag for SUNWNFS. Set has_buggy_fileid_dirinfo
13 flag for UNIXFS and all cifs type filesystems. Only check for
14 caseinsensitivity once.
15 (fillout_mntent): Create locale fs_names array. Use for setting
16 _my_tls.locals.mnt_type.
18 2009-07-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
20 * posix.sgml (std-notes): Remove obsolete reference to CYGWIN=server.
22 2009-07-25 Corinna Vinschen <corinna@vinschen.de>
24 * posix.sgml (std-notes): Add flock restriction.
26 2009-07-25 Corinna Vinschen <corinna@vinschen.de>
28 * fhandler_console.cc (set_console_title): Set buffer size to
29 TITLESIZE + 1. Call sys_mbstowcs with correct destination length.
31 2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
33 * sigproc.h (wait_for_sigthread): Eliminate parameter.
34 * sigproc.cc (wait_for_sigthread): Ditto. Don't synchronize with
35 wait_sig after receiving an event that it is ready to go.
36 (init_sig_pipe): New function.
37 (wait_sig): Call init_sig_pipe to create pipes for communicating
38 signals to this process. Don't send sigCONT signal when initializing.
39 * fork.cc (frok::child): Accommodate wait_for_sigpipe parameter change.
41 2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
43 * fhandler.h (fhandler_*::write): Make ssize_t/__stdcall.
44 (fhandler_*::write_overlapped): Ditto.
45 (fhandler_*::raw_write): Ditto.
46 (fhandler_*::readv): Ditto.
47 (fhandler_*::writev): Ditto.
48 (fhandler_*::raw_read): Make __stdcall.
49 * fhandler: Accommodate changes to read/write functions throughout.
50 * fhandler_clipboard.cc: Ditto.
51 * fhandler_console.cc: Ditto.
52 * fhandler_dsp.cc: Ditto.
53 * fhandler_fifo.cc: Ditto.
54 * fhandler_mailslot.cc: Ditto.
55 * fhandler_mem.cc: Ditto.
56 * fhandler_mem.cc: Ditto.
57 * fhandler_random.cc: Ditto.
58 * fhandler_tape.cc: Ditto.
59 * fhandler_tty.cc: Ditto.
60 * fhandler_virtual.cc: Ditto.
61 * fhandler_windows.cc: Ditto.
62 * fhandler_zero.cc: Ditto.
63 * syscalls.cc (readv): Use ssize_t as temp variable.
65 * fhandler.cc (fhandler_base::read): Coerce returned len to signed or
66 it will never be treated as < 0.
67 (fhandler_base::wait_overlapped): Minimize calls to GetLastError.
68 Remove duplicate debugging test. Fix error return.
70 * fhandler.h (fhandler_fifo::fifo_name): Declare new function.
71 (fhandler_fifo::close): Ditto.
72 (fhandler_fifo::dup): Ditto.
73 (fhandler_fifo::close_on_exec): Ditto.
74 * fhandler.cc (fhandler_fifo::fifo_name): Define new function.
75 (FIFO_BUF_SIZE): New define.
77 (fhandler_fifo::open): Rework. Use cnp to open named pipe. Always
78 open write side as a client. Open dummy client when writing and can't
80 (wait): Rework. Implement fifo_wait_for_next_client. Handle signals
81 during connect better. Add new fifo_wait_for_server code which polls
82 (sigh) waiting for server.
83 (fhandler_fifo::raw_read): Handle transition states when one client
84 closes and another is available.
85 (fhandler_fifo::close): Define.
86 (fhandler_fifo::dup): Ditto.
87 (fhandler_fifo::close_on_exec): Ditto.
89 2009-07-24 Corinna Vinschen <corinna@vinschen.de>
91 * syscalls.cc (internal_setlocale): Fix typo in GBK codepage.
93 2009-07-24 Corinna Vinschen <corinna@vinschen.de>
95 * syscalls.cc (unlink_nt): Ignore sharing violation on NFS. Align
98 2009-07-23 Corinna Vinschen <corinna@vinschen.de>
100 * mount.h (fs_info::fsn): New member.
101 (fs_info::clear): Clear fsn.
102 (fs_info::fsname): New read accessor for fsn.
103 * mount.cc (fs_info::update): Fill in fsn member with lowercased
104 filesystem name if filesystem is not well-known. Fall back to
105 "unknown" if filesystem name is missing.
106 (fillout_mntent): Print filesystem name retrieved in fs_info::update
107 rather than static string "unknown".
109 2009-07-23 Corinna Vinschen <corinna@vinschen.de>
111 * mount.cc (fs_info::update): Revert to open filesystem with access set
112 to READ_CONTROL. If that fails, try additionally with FILE_READ_DATA.
114 2009-07-22 Eric Blake <ebb9@byu.net>
116 * exceptions.cc (handle_exceptions): Set si_addr according to
119 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
121 * mount.cc (fs_info::update): Open filesystem with access set to 0.
124 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
126 * mount.cc: Revert accidental checkin.
128 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
130 * path.cc (symlink_info::check): Handle STATUS_NOT_SUPPORTED from
131 NtCreateFile just like STATUS_EAS_NOT_SUPPORTED.
133 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
135 * mount.cc (fillout_mntent): Fix typo (noexec -> notexec).
137 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
139 * path.cc (symlink_info::check): Fix typo in comment.
141 2009-07-22 Corinna Vinschen <corinna@vinschen.de>
143 * fhandler.h (enum del_lock_called_from): New enumeration.
144 (fhandler_base::del_my_locks): Declare taking a del_lock_called_from
146 * fhandler.cc (fhandler_base::close): Call del_my_locks with "on_close".
147 (fhandler_base::fixup_after_fork): Call del_my_locks with "after_fork".
148 (fhandler_base::fixup_after_exec): Call del_my_locks with "after_exec".
149 * flock.cc (fhandler_base::del_my_locks): Take del_lock_called_from
150 as argument. Call node->del_my_locks with NULL handle in after_exec
153 2009-07-21 Eric Blake <ebb9@byu.net>
155 * dtable.cc (dup2): Correct return value for no-op.
157 2009-07-21 Corinna Vinschen <corinna@vinschen.de>
158 Eric Blake <ebb9@byu.net>
160 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Add special case
161 for MVFS. Explain why.
162 (fhandler_disk_file::utimens): Drop local variables lastaccess and
163 lastwrite. Copy timestamps right into FILE_BASIC_INFORMATION structure
164 to avoid copying them twice.
166 2009-07-20 Corinna Vinschen <corinna@vinschen.de>
168 * wincap.h (wincaps::has_always_all_codepages): New element.
169 * wincap.cc: Implement above element throughout.
170 * wchar.h (__sjis_mbtowc): Declare.
171 (__eucjp_mbtowc): Ditto.
172 (__gbk_mbtowc): Ditto.
173 (__kr_mbtowc): Ditto.
174 (__big5_mbtowc): Ditto.
175 * syscalls.cc (internal_setlocale): Convert to char * function.
176 Return parameter by default. Return NULL if request to use a
177 charset can't be satisfied due to missing codepage support in the
178 underlying OS. Fix comment.
179 (setlocale): Store original locale. Restore to original locale if
180 internal_setlocale returns NULL.
182 2009-07-20 Corinna Vinschen <corinna@vinschen.de>
184 * fork.cc (fork): Create local tmp_pathbuf. Explain why.
186 2009-07-18 Christopher Faylor <me+cygwin@cgf.cx>
188 * exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when
190 (stopped_or_terminated): Honor WCONTINUED.
191 * wait.cc (wait4): Ditto.
192 * include/cygwin/wait.h (WCONTINUED): Define.
193 (__W_CONTINUED): Ditto.
194 (WIFCONTINUED): Ditto.
196 2009-07-18 Dave Korn <dave.korn.cygwin@gmail.com>
198 * libstdcxx_wrapper.cc (operator delete): Remove stray space in
201 2009-07-17 Christopher Faylor <me+cygwin@cgf.cx>
203 * cygtls.cc (_cygtls::init_exception_handler): Test for e, not e->prev
204 or we could still end up adding our handler twice. Add comment
205 explaining what we're doing.
206 * dll_init.cc (dll_dllcrt0_1): Clarify comment.
208 2009-07-17 Christopher Faylor <me+cygwin@cgf.cx>
210 * cygtls.cc (_cygtls::init_exception_handler): Avoid adding our
211 exception handler twice.
213 2009-07-17 Corinna Vinschen <corinna@vinschen.de>
215 * syscalls.cc (unlink_nt): Just return when a sharing violation
216 occurs on remote filesystems.
218 2009-07-17 Corinna Vinschen <corinna@vinschen.de>
220 * globals.cc: Improve comment on R/O UNICODE_STRINGs.
221 * mount.h (class fs_info): Add is_mvfs bit.
222 * mount.cc (fs_info::update): Recognize MVFS remote filesystem.
223 (fillout_mntent): Reorder filesystem checks for speed. Add
224 mvfs, unixfs, and sunwnfs filesystem types.
225 * path.h (class path_conv): Add fs_is_mvfs method.
226 * path.cc (symlink_worker): On MVFS, always create symlinks as
227 Windows shortcuts. Explain why.
229 2009-07-16 Corinna Vinschen <corinna@vinschen.de>
231 * syscalls.cc (unlink_nt): First remove the R/O DOS attribute with
232 FILE_WRITE_ATTRIBUTES access only, then re-open the file for DELETE.
235 2009-07-16 Corinna Vinschen <corinna@vinschen.de>
237 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Remove file
238 attribute check already done in NtSetAttributesFile.
240 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
242 * globals.cc: Reorder constant UNICODE_STRINGs for clarity.
243 * mount.h (fs_info::sttaus): Move filesystem type flags into
244 substructure. Add union to allow simple test for having set any
245 one filesystem type flag. Replace has_buggy_open flag with is_sunwnfs
246 flag. Replace has_buggy_fileid_dirinfo with is_unixfs flag.
247 (fs_info::got_fs): New private method.
248 (fs_info::has_buggy_open): New explicit implementation.
249 (fs_info::has_buggy_fileid_dirinfo): Ditto.
250 * mount.cc (fs_info::update): Optimize filesystem checks for speed.
251 * winsup.h (IMPLEMENT_STATUS_FLAG): Change write accessor to return
254 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
256 * fhandler_netdrive.cc (GET_RESOURCE_INFO): Remove.
257 (thread_netdrive): Drop GET_RESOURCE_INFO case.
258 (fhandler_netdrive::exists): Use GET_RESOURCE_OPENENUM info class
259 to check for existance.
261 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
263 * fhandler_netdrive.cc (fhandler_netdrive::readdir): Remove useless
266 2009-07-15 Corinna Vinschen <corinna@vinschen.de>
268 * path.cc (cwdstuff::set): Only fix up UNC path in win32 so as not
269 to overwrite incoming path.
271 2009-07-14 Corinna Vinschen <corinna@vinschen.de>
273 Throughout avoid having to initialize constant UNICODE_STRINGs.
274 * globals.cc: Define constant UNICODE_STRINGs and store in .rdata
276 * fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs
277 rather then initializing local UNICODE_STRING variable where
279 * fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
280 * flock.cc (inode_t::inode_t): Ditto.
282 * syscalls.cc: Ditto.
283 * mount.cc (fs_info::update): Ditto.
286 * ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as
288 (RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING.
289 * fhandler_disk_file.cc: Accommodate throughout.
290 * mount.cc (fs_info::update): Ditto.
291 * path.cc (cwdstuff::set): Ditto.
292 * syscalls.cc: Ditto.
294 2009-07-14 Corinna Vinschen <corinna@vinschen.de>
296 * globals.cc (active_codepage): Remove.
298 2009-07-12 Christopher Faylor <me+cygwin@cgf.cx>
300 * how-spawn-works.txt: Add "out of date" note.
301 * how-vfork-works.txt: Ditto.
303 2009-07-12 Christopher Faylor <me+cygwin@cgf.cx>
305 * Makefile.in: Don't do anything special with any RCS directories.
307 * ntdll.h (PROCESSINFOCLASS): Remove unneeded trailing comma.
309 * pinfo.cc (_pinfo::dup_proc_pipe): Remove unneeded assignment.
311 * sigproc.cc (sig_send): Don't send signal to myself if this is an exec
314 2009-07-12 Corinna Vinschen <corinna@vinschen.de>
316 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Don't use
317 FileAllInformation info class since it needs a big buffer. Add a
320 2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com>
322 * winbase.h (ilockexch): Avoid making 'ret' volatile.
323 (ilockcmpexch): Likewise.
325 2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com>
327 * Makefile.in (DLL_OFILES): Add libstdcxx_wrapper.o
328 (libstdcxx_wrapper_CFLAGS): Add flags for new module.
329 (_cygwin_crt0_common_STDINCFLAGS): Define per-file override.
330 (libstdcxx_wrapper_STDINCFLAGS, cxx_STDINCFLAGS): Likewise.
331 * cxx.cc: Include "cygwin-cxx.h".
332 (operator new): Tweak prototype for full standards compliance.
333 (operator new[]): Likewise.
334 (operator new (nothrow)): New fallback function.
335 (operator new[] (nothrow), operator delete (nothrow),
336 operator delete[] (nothrow)): Likewise.
337 (default_cygwin_cxx_malloc): New struct of pointers to the above,
338 for final last-resort fallback default.
339 * cygwin-cxx.h: New file.
340 (struct per_process_cxx_malloc): Define.
341 (default_cygwin_cxx_malloc): Declare extern.
342 * cygwin.din (__wrap__ZdaPv): Export new wrapper.
343 (__wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
344 __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
345 __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
346 __wrap__ZnwjRKSt9nothrow_t): Likewise.
347 * globals.cc (__cygwin_user_data): Init newly-repurposed 'forkee'
348 field (now 'cxx_malloc') to point to default_cygwin_cxx_malloc.
349 * libstdcxx_wrapper.cc: New file.
350 (__wrap__ZdaPv, __wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv,
351 __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj,
352 __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj,
353 __wrap__ZnwjRKSt9nothrow_t): Define wrapper functions for libstdc++
354 malloc operators and their overrides.
355 * winsup.h (default_cygwin_cxx_malloc): Declare extern.
356 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
357 * include/sys/cygwin.h (struct per_process_cxx_malloc): Forward
359 (struct per_process::forkee): Rename and repurpose from this ...
360 (struct per_process::cxx_malloc): ... to this.
361 * lib/_cygwin_crt0_common.cc: Include cygwin-cxx.h.
362 (WEAK): Define shorthand helper macro.
363 (__cygwin_cxx_malloc): Define and populate with weak references
364 to whatever libstdc++ malloc operators will be visible at final
365 link time for Cygwin apps and dlls.
366 (_cygwin_crt0_common): Always look up cygwin DLL's internal
367 per_process data, and don't test for (impossible) failure. Inherit
368 any members of __cygwin_cxx_malloc that we don't have overrides
369 for from the DLL's default and store the resulting overall set of
370 overrides back into the DLL's global per_process data.
372 2009-07-07 Corinna Vinschen <corinna@vinschen.de>
374 * cygtls.cc (_cygtls::remove): Fix typo.
376 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
378 * Makefile.in (clean): Clean generated files in srcdir.
379 * tlsoffsets.h: Regenerate.
381 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
383 * cygtls.cc (_cygtls::remove): Avoid closing a NULL handle.
385 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
387 * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabuf
388 and wsacnt to references. Fix handling of WSAEMSGSIZE.
390 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
392 * cygtls.h (struct _local_storage): Add thread storage pointers for
393 memory used by socket select functions. Combine them into a single
395 * cygtls.cc: Accommodate above change throughout.
396 (_cygtls::init_thread): Drop initalizing of sockevt to
397 INVALID_HANDLE_VALUE.
398 (_cygtls::fixup_after_fork): Reset sockevt to NULL.
399 (_cygtls::remove): Don't use sockevt value to bail out prematurely.
400 Set sockevt to NULL. Free malloced select members.
401 * select.h (struct select_socket_info): Drop max_w4 member.
402 * select.cc (thread_socket): Use INFINITE timeout value if number of
403 objects to wait for is <= MAXIMUM_WAIT_OBJECTS. Use num_w4 member
404 of select_socket_info struct rather than dropped max_w4.
405 (init_tls_select_info): New inline function to initialize TLS select
407 (start_thread_socket): Just call init_tls_select_info to initialize TLS
408 select members and use them later on.
409 (socket_cleanup): Don't free select_socket_info pointer members since
410 they are thread local now.
412 2009-07-06 Christopher Faylor <me+cygwin@cgf.cx>
414 * dtable.cc (handle_to_fn): Detect failing NtQueryObject.
416 2009-07-06 Corinna Vinschen <corinna@vinschen.de>
418 * autoload.cc: Delete stray CR.
420 2009-07-05 Christopher Faylor <me+cygwin@cgf.cx>
422 * fhandler_console.cc: Change workstation -> windows station
425 2009-07-04 Christopher Faylor <me+cygwin@cgf.cx>
427 * autoload.cc (SetParent): Add new import.
428 * fhandler.h (fhandler_console::create_invisible_console): Declare new
430 (create_invisible_console_workaround): Ditto.
431 * fhandler_console.cc (fhandler_console::create_invisible_console):
433 (create_invisible_console_workaround): Ditto. Add too much code to
434 deal with broken Windows 7. Use a helper app to start an invisible
436 (fhandler_console::need_invisible): Reorganize to use helper functions
437 to create invisible console.
439 * spawn.cc (spawn_guts): Avoid zeroing already zeroed fields in si.
441 2009-07-04 Dave Korn <dave.korn.cygwin@gmail.com>
443 * autoload.cc (AttachConsole): Correct size of args.
445 2009-07-03 Christopher Faylor <me+cygwin@cgf.cx>
447 * dcrt0.cc (jit_debug): New global.
448 (initial_env): Set jit_debug when we are automatically starting a gdb
450 * dtable.cc (dtable::get_debugger_info): Don't tty tricks when we are
451 being debugged by our own captive gdb, as determined by jit_debug ==
453 (dtable::init_std_file_from_handle): Detect errors when initializing a
454 tty early rather than at random points later.
455 * fhandler.h (fhandler_*::init): Return int to indicate
457 * fhandler.cc (fhandler_base::init): Reflect change in return value.
458 * pipe.cc (fhandler_pipe::init): Ditto.
459 (fhandler_pipe::create_selectable): Don't say we're retrying when we
461 * fhandler_console.cc (fhandler_console::init): Ditto. Return
463 * fhandler_serial.cc (fhandler_serial::init): Ditto.
464 * fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
465 (fhandler_tty_slave::open): Make debugging output more detailed.
466 * tty.cc (tty_list::terminate): Don't close I/O handles before all
467 slaves have checked in.
468 (tty::slave_alive): Make a non-inlined function. Check if tty pipe
469 handles can be created as an additional exists check.
470 * tty.h (tty::slave_alive): Just define here.
472 2009-07-03 Corinna Vinschen <corinna@vinschen.de>
474 * posix.sgml: Add fpurge and mkstemps to BSD list.
476 2009-07-03 Eric Blake <ebb9@byu.net>
478 * cygwin.din (fpurge, mkstemps): New exports.
479 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
480 * mktemp.cc (_gettemp): Add parameter.
481 (mkstemps): New function.
482 (mkstemp, mkdtemp, mktemp): Adjust clients.
484 2009-07-03 Corinna Vinschen <corinna@vinschen.de>
486 * autoload.cc: Fix typo in comment.
487 (ShowWindowAsync): Define.
488 (AttachConsole): Define.
489 * fhandler_console.cc (fhandler_console::need_invisible): Add band-aid
490 for Windows 7 AllocConsole bug.
492 2009-07-01 Corinna Vinschen <corinna@vinschen.de>
494 * net.cc (get_xp_ifs): Fix typo in comment.
496 2009-07-01 Corinna Vinschen <corinna@vinschen.de>
498 * fhandler.h (class fhandler_socket): Add class members and methods
499 to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes.
500 * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members.
501 (fhandler_socket::send_internal): Check for SO_SNDBUF size and
502 restrict send to 1 byte less per KB 823764. Leave loop immediately
503 if WSASendMsg has been used.
504 * net.cc (fdsock): Change comment again. Set buffer sizes to 65536.
505 Store values in fhandler_socket.
506 (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in
508 (cygwin_sendto): Drop call to sig_dispatch_pending.
509 (cygwin_recvfrom): Ditto.
510 (cygwin_recvmsg): Ditto.
511 (cygwin_sendmsg): Ditto.
513 2009-06-30 Christopher Faylor <me+cygwin@cgf.cx>
515 * select.h: New file split from fhandler.h.
516 (select_record::select_record): Define do-nothing constructor for "new"
517 to avoid gratuitous zeroing.
518 (select_info): New base class.
519 (select_pipe_info): New class with methods for dealing with pipes.
520 (select_socket_info): New class with methods for dealing with sockets.
521 (select_serial_info): Dummy class for serial.
522 (select_mailslot_info): Dummy class for mailslots.
523 (select_stuff): Define device_specific_* as actual classes rather than
525 * dtable.h (dtable::select_read): Accommodate return value change to
526 'bool' and argument change to "select_stuff".
527 (dtable::select_write): Ditto.
528 (dtable::select_except): Ditto.
529 * dtable.cc (dtable::select_read): Accommodate return value change to
530 'bool' and argument change to "select_stuff".
531 (dtable::select_write): Ditto.
532 (dtable::select_except): Ditto.
533 * fhandler.h: Excise select-related classes.
534 (fhandler_*::select_read): Change argument to select_stuff.
535 (fhandler_*::select_write): Ditto.
536 (fhandler_*::select_except): Ditto.
537 * select.cc (UNIX_FD_ZERO): Use memset rather than bzero.
538 (select_stuff::test_and_set): Change return type to bool. Allocate
539 select_record on entry and let fhandler_*::select_* operate on the
540 start.next field of select_stuff.
542 (select_pipe_info::select_pipe_info): New constructor. Allocates event
543 for controlling pipe waits.
544 (select_pipe_info::~select_pipe_info): New destructor. Destroy event.
546 (select_pipe_info::add_watch_handle): New function.
547 (thread_pipe): Wait for the hEvent part of any overlapped pipes before
549 (start_thread_pipe): Don't allocate device_specific_pipe stuff here.
550 Assume that it has been allocated earlier.
551 (pipe_cleanup): Rely on select_pipe_info destructor to clean up pipe
553 (fhandler_*::select_*): Derive select_record from new select_stuff
555 (fhandler_pipe::select_*): Ditto. Allocate pipe-specific field if not
558 (thread_serial): serialinf -> select_serial_info.
559 (fhandler_base::ready_for_read): Rewrite to accommodate change in
560 argument to fhandler_*::select_*.
562 (thread_socket): socketinf -> select_socket_info.
563 (mailslotinf): Delete.
564 (thread_mailslot): mailslotinf -> select_mailslot_info.
566 2009-06-30 Christopher Faylor <me+cygwin@cgf.cx>
568 * fhandler.cc (fhandler_base::has_ongoing_io): Accept an argument
569 indicating whether the overlapped event should be tested.
570 (fhandler_base::read_overlapped): Pass is_overlapped state to
572 (fhandler_base::write_overlapped): Ditto.
573 * fhandler.h (fhandler_base::has_ongoing_io): Accommodate argument
575 * select.cc (peek_pipe): Ditto.
577 2009-06-30 Corinna Vinschen <corinna@vinschen.de>
579 * net.cc (fdsock): Set default socket buffer sizes to 65520. Change
581 * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum
582 send size to 65520 as well.
584 2009-06-29 Christopher Faylor <me+cygwin@cgf.cx>
586 * select.cc (peek_pipe): Turn on (temporarily?) the experimental code
587 which tries to determine when a pipe is writable.
589 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
591 * select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe
592 is ready for writing rather than performing brute-force checks.
594 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
596 * fhandler.h (fhandler_base::has_ongoing_io): Declare new function.
597 * fhandler.cc (fhandler_base::has_ongoing_io): Define new function.
598 (fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing
599 when handle has not completed last I/O.
600 (fhandler_base::write_overlapped): Ditto.
601 * select.cc (peek_pipe): Be more careful about accessing hEvent field
602 from get_overlapped().
604 2009-06-28 Christopher Faylor <me+cygwin@cgf.cx>
606 * gendef (cleanup): Rename from 'nocr'. Remove comments and trailing
608 * cygwin.din: Add long-needed comment describing what
609 dll_crt0__FP11per_process demangles to.
611 * select.cc (peek_pipe): Flag handle as not ready for write if event is
613 * fhandler.cc (fhandler_base::setup_overlapped): Establish event as
615 (fhandler_base::wait_overlapped): Don't reset event after we've
616 successfully waited. MSDN documentation says that this happens
617 automatically after a WriteFileEx/ReadFileEx.
619 2009-06-26 Corinna Vinschen <corinna@vinschen.de>
621 * wincap.h (wincaps::has_broken_alloc_console): New element.
622 * wincap.cc: Implement above element throughout.
624 2009-06-25 Corinna Vinschen <corinna@vinschen.de>
626 * sec_auth.cc (lsaauth): Close unused handle.
627 (lsaprivkeyauth): Ditto.
629 2009-06-23 Corinna Vinschen <corinna@vinschen.de>
631 * sec_auth.cc (get_server_groups): Ignore errors from
632 get_user_local_groups.
634 2009-06-22 Corinna Vinschen <corinna@vinschen.de>
636 * spawn.cc (spawn_guts): Don't run additional check for Win32
637 incompatible CWD if newargv.fixup bailed out already.
638 (av::fixup): Check shell scripts for executability.
640 2009-06-18 Corinna Vinschen <corinna@vinschen.de>
642 * path.cc (chdir): Check error conditions first.
644 2009-06-17 Corinna Vinschen <corinna@vinschen.de>
646 * fhandler_socket.cc (fhandler_socket::recv_internal): Mark WSARecvMsg
649 2009-06-16 Christopher Faylor <me+cygwin@cgf.cx>
651 * fhandler.cc (fhandler_base::read_overlapped): Use a better variable
654 2009-06-16 Christopher Faylor <me+cygwin@cgf.cx>
656 * fhandler.cc (fhandler_base::read_overlapped): Preserve len when
657 looping due to received signal.
659 2009-06-15 Corinna Vinschen <corinna@vinschen.de>
661 * net.cc (get_flags): New static function to generate interface flags
663 (get_ipv4fromreg_ipcnt): New static function to fetch number of
664 configured IPv4 addresses for a given NIC from registry.
665 (get_ipv4fromreg): New static function to fetch configured IPv4
666 addresses for a given NIC from registry.
667 (get_friendlyname): New static function to generate friendly name.
668 (get_hwaddr): New static function to copy hardware address.
669 (get_xp_ifs): Restructure slightly. Add code to generate IPv4 entries
670 entries for interfaces which are disconnected.
672 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
674 * errno.cc (errmap): Add mapping for ERROR_IO_INCOMPLETE.
675 * fhandler.cc (fhandler_base::fcntl): Fix comment.
676 (fhandler_base::wait_overlapped): Accept an optional len parameter.
677 Use the len parameter when WriteFile fails with ERROR_IO_PENDING. Make
678 debug output less alarming.
679 (fhandler_base::write_overlapped): Pass len to wait_overlapped.
680 * fhandler.h (fhandler_base::wait_overlapped): Add an optional argument
681 denoting the number of characters intended to be written.
683 * fhandler_tty.cc (fhandler_pty_master::close): Don't close archetype
684 handles when cygwin is still initializing since the handles aren't
685 actually opened at that point.
687 2009-06-14 Corinna Vinschen <corinna@vinschen.de>
689 * localtime.cc (time2): Take another stab at fixing a compiler warning.
691 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
693 * localtime.cc (time2): Take a stab at fixing a compiler warning.
695 2009-06-14 Christopher Faylor <me+cygwin@cgf.cx>
697 * fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag
698 for writes. Don't reset event handle when we see a ERROR_IO_PENDING.
700 * sigproc.cc (stopped_or_terminated): Use bool constants for
703 * wait.cc (wait4): Remove nonsensical comment.
705 2009-06-13 Corinna Vinschen <corinna@vinschen.de>
707 * fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen
708 pointer to NULL if name pointer is NULL. Explain why.
710 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
712 * localtime.cc (time2): Change "spring gap" to "spring forward gap"
715 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
717 * localtime.cc (time2): Add workaround for spring forward gap problem.
718 Add explaining comment.
720 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
722 * Makefile.in (SUBLIBS): Add librt.a.
723 (librt.a): New rule to build librt.a.
725 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
727 * posix_ipc.cc (check_path): Fix typo in comment. Align naming
728 convention rules to Linux. Handle backslash same as slash. Add
731 2009-06-09 Corinna Vinschen <corinna@vinschen.de>
733 * autoload.cc (GetSystemTimes): Remove.
734 * fhandler_proc.cc (format_proc_uptime): Use global system_info rather
735 than retrieving a local copy of the SYSTEM_INFO. Drop call to
736 GetSystemTimes and retrieve SystemPerformanceInformation on all systems
737 again with buffer size big enough for 64 bit systems.
738 (format_proc_stat): Use global system_info rather than retrieving a
739 local copy of the SYSTEM_INFO. Retrieve SystemPerformanceInformation
740 with buffer size big enough for 64 bit systems.
742 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
744 * autoload.cc (GetSystemTimes): Define.
745 * fhandler_proc.cc (format_proc_uptime): Use GetSystemInfo to retrieve
746 processor count. Use GetSystemTimes when available to retrieve system
747 idle time. Improve debug output.
748 (format_proc_stat): Use GetSystemInfo to retrieve processor
749 count. Improve debug output. Ignore if SystemPerformanceInformation
750 returns error. Explain why.
752 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
754 * fork.cc (frok::parent): Remove ancient code erroneously flushing
757 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
759 * cygerrno.h (save_errno::~save_errno): Set errno directly to avoid
760 flooding debug output.
762 2009-06-08 Corinna Vinschen <corinna@vinschen.de>
764 * path.cc (symlink_info::check): Return with error set to ENOENT if
765 STATUS_NO_MEDIA_IN_DEVICE is returned.
767 2009-06-07 Christopher Faylor <me+cygwin@cgf.cx>
769 * cygheap.h (mini_cygheap): New struct.
770 (init_cygheap): Inherit locale field via mini_cygheap.
771 * cygheap.cc (cygheap_at_start): Define new variable.
772 (cygheap): Initialize as cygheap_at_start so that locale information is
774 (cygheap_init): Initialize cygheap iff it is set to cygheap_at_start.
775 * shared_info.h (memory_init): Accommodate argument change.
776 * memory.cc (memory_init): Accept an argument indicating whether
777 cygheap should be initialized or not.
778 * dcrt0.cc (child_info_fork::handle_fork): Pass false to memory_init().
779 (child_info_spawn::handle_spawn): Ditto.
780 (dll_crt0_0): Pass true to memory_init when not forking or execing.
782 * cygheap.h (cygheap_types::HEAP_2_DLL): New enum.
783 * dll_init.h (dll): Remove unused namelen field.
784 (dll_list::load_after_fork): Accommodate change in arguments.
785 * dll_init.cc (dll_list::alloc): Allocate dll information in the cygwin
787 (dll_list::detach): Free dll information from the cygwin heap.
788 (dll_list::load_after_fork): Use dll information in the cygwin heap
789 directly rather than querying parent.
790 * fork.cc (frok::first_dll): Delete.
791 (frok::child): Don't report on first_dll. Don't pass it to
793 (frok::parent): Don't set first_dll.
796 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
798 * dll_init.cc (dll_list::alloc): Allocate memory using a section
799 object. Explain why. Drop call to GetSystemInfo, rather call
800 getpagesize to get allocation granularity. Only align to allocation
801 granularity under WOW64. Use roundup2 to align.
802 (dll_list::detach): Call NtUnmapViewOfSection instead of VirtualFree.
804 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
806 * mmap.cc: Use NtUnmapViewOfSection instead of UnmapViewOfFile
807 throughout for symmetry.
808 (fhandler_dev_mem::munmap): Use correct process handle in call to
809 NtUnmapViewOfSection.
811 2009-06-06 Corinna Vinschen <corinna@vinschen.de>
813 * dll_init.h (struct dll): Set size of name element to ANYSIZE_ARRAY.
814 * dll_init.cc: Fix formatting.
815 (dll_list::alloc): Only allocate as much memory for struct dll as
816 necessary for given DLL name.
817 (dll_list::load_after_fork): Only read a single page of parent memory.
818 Only read more if namelen indicates that it's necessary.
820 2009-06-05 Dave Korn <dave.korn.cygwin@gmail.com>
822 * winbase.h (ilockexch): Fix asm constraints.
823 (ilockcmpexch): Likewise.
825 2009-06-05 Corinna Vinschen <corinna@vinschen.de>
827 * heap.cc (heap_init): Fix typo in comment.
829 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
831 * fhandler_clipboard.cc: Avoid calling system_printf.
832 (set_clipboard): Add basic error checking. Set errno here. Per MSDN,
833 don't call GlobalFree on data block transferred to clipboard.
834 (fhandler_dev_clipboard::write): Drop setting errno after call to
836 (fhandler_dev_clipboard::read): Add basic error checking. Simplify code.
838 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
840 * fhandler_console.cc (set_console_title): Convert title string to
841 wchar_t and call SetConsoleTitleW.
843 2009-06-04 Corinna Vinschen <corinna@vinschen.de>
845 * fhandler_console.cc (fhandler_console::read): Allow Ctrl-Space to
848 2009-06-04 Dave Korn <dave.korn.cygwin@gmail.com>
850 * thread.cc (__cygwin_lock_lock): Delete racy optimisation.
851 (__cygwin_lock_unlock): Likewise.
853 2009-06-03 IWAMURO Motnori <deenheart@gmail.com>
855 * strfuncs.cc (sys_cp_mbstowcs): Fix condition.
857 2009-06-03 Corinna Vinschen <corinna@vinschen.de>
859 * strfuncs.cc (sys_cp_wcstombs): Implement reverse functionality
860 of the change to sys_cp_mbstowcs from 2009-05-30.
861 (sys_cp_mbstowcs): Slightly reformat. Fix comment to accommodate
862 change to sys_cp_wcstombs. Don't write to *ptr if dst is NULL.
864 2009-06-03 Corinna Vinschen <corinna@vinschen.de>
866 * fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace
867 to \033\177 or to \377 dependent on the setting of dev_state->metabit.
869 2009-06-02 Corinna Vinschen <corinna@vinschen.de>
871 * path.cc (path_conv::check): Don't call set_exec for files on "noacl"
874 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
876 * strfuncs.cc (sys_cp_mbstowcs): Treat src as unsigned char *. Convert
877 failure of f_mbtowc into a single malformed utf-16 value.
879 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
881 * cygwin/include/sys/termios.h: Make default erase character "^?".
883 2009-05-30 Christopher Faylor <me+cygwin@cgf.cx>
885 * fhandler_console.cc (fhandler_console::read): Convert backspace key
888 2009-05-29 Christopher Faylor <me+cygwin@cgf.cx>
890 * path.cc (cwdstuff::set): Rewrite previous change to properly test the
893 2009-05-28 Christopher Faylor <me+cygwin@cgf.cx>
895 * path.cc (cwdstuff::set): Avoid removing a nonexistent trailing slash.
897 2009-05-20 Eric Blake <ebb9@byu.net>
899 * net.cc (gethostby_helper): Use correct signedness.
901 2009-05-18 Christopher Faylor <me+cygwin@cgf.cx>
903 * mount.cc (mount_info::add_item): Avoid using any-old '/' as
906 2009-05-18 Christopher Faylor <me+cygwin@cgf.cx>
908 * mount.cc (mount_info::got_usr_bin): Mark as NO_COPY.
909 (mount_info::got_usr_lib): Ditto.
910 (mount_info::root_idx): Ditto.
912 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
914 * wchar.h (sys_mbstowcs): Add missing __stdcall attribute.
916 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
918 * cygheap.cc (cygheap_init): Set Cygwin default locale values.
919 * cygheap.h (struct cygheap_locale): New structure.
920 (struct user_heap_info): Add cygheap_locale member locale.
921 * dcrt0.cc (dll_crt0_1): Revert to calling _setlocale_r so that only
922 the applications locale is reverted to "C".
923 * environ.cc (environ_init): Remove unused got_lc variable.
924 * fhandler.h (class dev_console): Remove now unsed locale variables.
925 * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove
926 setting dev_console's locale members.
927 (dev_console::con_to_str): Use internal locale settings. Default to
928 __ascii_wctomb if charset is "ASCII".
929 (fhandler_console::write_normal): Ditto.
930 * strfuncs.cc (__ascii_wctomb): Drop declaration.
931 (__db_wctomb): Use fixed value 2 instead of not
932 necessarily matching MB_CUR_MAX.
933 (__eucjp_wctomb): Use 3 instead of MB_CUR_MAX.
934 (sys_cp_wcstombs): Remove special case for "C" locale.
935 (sys_wcstombs): Implement here. Use internal locale data stored on
937 (sys_cp_mbstowcs): Remove special case for "C" locale.
938 (sys_mbstowcs): Implement here. Use internal locale data stored on
940 * syscalls.cc (internal_setlocale): New function to set cygheap locale
941 data and to reset CWD posix path.
942 (setlocale): Just call internal_setlocale from here if necessary.
943 * wchar.h (__ascii_wctomb): Declare.
944 (sys_wcstombs): Don't define inline, just declare.
945 (sys_mbstowcs): Ditto.
947 2009-05-14 Christopher Faylor <me+cygwin@cgf.cx>
949 * mount.cc (mount_info::init): Remove MOUNT_CYGWIN_EXEC setting when
950 auto-mounting /usr/bin.
952 2009-05-14 Corinna Vinschen <corinna@vinschen.de>
954 * mount.cc (oopts): Add a no-op "auto" option.
955 (mount_info::create_root_entry): Set root dir to MOUNT_IMMUTABLE rather
956 than to MOUNT_OVERRIDE.
958 2009-05-13 Corinna Vinschen <corinna@vinschen.de>
959 Christopher Faylor <me+cygwin@cgf.cx>
961 * mount.cc (mount_info::got_usr_bin): Define.
962 (mount_info::got_usr_lib): Ditto.
963 (mount_info::root_idx): Ditto.
964 (mount_info::create_root_entry): Create root entry as immutable and
966 (mount_info::init): Remove "Huh? No /etc/fstab..." warning.
967 Unconditionally call from_fstab for user and system tables. Fill in
968 /usr/bin and /usr/lib if they have not been specified in /etc/fstab.
969 (oopts): Alphabetize. Add "override" option to allow overriding
970 immutable mount points.
971 (mount_info::add_item): Accommodate new MOUNT_IMMUTABLE flag intended
973 (mount_info::add_item): Detect "/usr/bin", "/usr/lib", and "/" and set
974 appropriate global state.
975 (fillout_mntent): Add ,auto to mount points added by Cygwin DLL.
976 (mount): Remove masking of MOUNT_SYSTEM. Allow user to shoot
977 themselves. Add comment.
978 * mount.h (mount_info::got_usr_bin): Declare.
979 (mount_info::got_usr_lib): Ditto.
980 (mount_info::root_idx): Ditto.
981 * include/sys/mount.h: Reformat enum.
982 Add MOUNT_{OVERRIDE,IMMUTABLE,AUTOMATIC}.
984 2009-05-13 Corinna Vinschen <corinna@vinschen.de>
986 * cygheap.h (cwdstuff): Convert to class. Make posix and dir private.
987 (cwdstuff::get_posix): New method.
988 (cwdstuff::reset_posix): New method.
989 * dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r.
990 * environ.cc (environ_init): Ditto. Prefer "C" locale over current
991 codepage default locale.
992 * path.cc (chdir): Use cwdstuff::get_posix method instead of accessing
993 cwdstuff::posix directly.
994 (cwdstuff::set): Defer creating posix path to first usage.
995 (cwdstuff::get_posix): Create posix path if it's empty, and return it.
996 (cwdstuff::get): Create posix path if it's empty.
997 * strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C"
999 (sys_cp_mbstowcs): Ditto.
1000 * syscalls.cc (gen_full_path_at): Fetch CWD posix path locked.
1001 (setlocale): Implement here. Reset CWD posix path.
1003 2009-05-09 Christopher Faylor <me+cygwin@cgf.cx>
1005 * cygwin/version.h (CYGWIN_VERSION_CYGWIN_CONV): New define.
1007 2009-05-09 Corinna Vinschen <corinna@vinschen.de>
1009 * dtable.cc (dtable::init_std_file_from_handle): Add workaround for
1010 Windows 7 64 bit issue. Add lengthy comment to explain what happens.
1011 * wincap.h (wincaps::has_console_handle_problem): New element.
1012 * wincap.cc: Implement above element throughout.
1013 (wincap_7): New wincaps structure for NT 6.1 kernels.
1014 (wincapc::init): Set has_console_handle_problem to false for 32 bit
1017 2009-05-09 Corinna Vinschen <corinna@vinschen.de>
1019 * sec_auth.cc (str2uni_cat): Move from here...
1020 * path.cc (str2uni_cat): ...to here. Simplify. Make static inline.
1021 (get_nt_native_path): Use RtlAppendUnicodeToString rather than
1022 str2uni_cat for constant strings for speed.
1023 * security.h (str2uni_cat): Drop declaration.
1025 2009-05-08 Corinna Vinschen <corinna@vinschen.de>
1026 IWAMURO Motonori <deenheart@gmail.com>
1028 * strfuncs.cc (sys_cp_wcstombs): save and restore previous errno value.
1029 (sys_cp_mbstowcs): Ditto.
1031 2009-05-08 IWAMURO Motonori <deenheart@gmail.com>
1033 * strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting
1034 wide char to SO/UTF-8 sequence.
1036 2009-05-08 Corinna Vinschen <corinna@vinschen.de>
1038 * include/sys/select.h: Guard definitions with __USE_W32_SOCKETS as
1039 the accompanying fd_set definitions in newlib's sys/types.h.
1041 2009-05-06 Christopher Faylor <me+cygwin@cgf.cx>
1043 * fhandler_console.cc (fhandler_console::ioctl): Properly treat
1044 TIOCLINUX argument as a char.
1045 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use coercion to properly
1048 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
1050 * libc/minires.c (scanline): Fix type in calls to ctype functions
1051 to stay in unsigned char range for char values >= 0x80.
1052 * regex/regcomp.c: Ditto, throughout.
1053 * regex/regex2.h (ISWORD): Ditto.
1055 2009-05-06 Corinna Vinschen <corinna@vinschen.de>
1057 * cygheap.cc (cygheap_init): Set umask to a sane default.
1058 * uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH
1059 to set HOME. Default to /home/USERNAME.
1061 2009-05-03 Corinna Vinschen <corinna@vinschen.de>
1063 * security.cc (set_file_sd): Drop using FILE_OPEN_FOR_RECOVERY flag in
1065 * exceptions.cc (open_stackdumpfile): Ditto in call to NtCreateFile.
1066 * fhandler.cc (fhandler_base::open): Ditto. Simplify setting
1069 * mount.cc (fs_info::update): Recognize offline storage.
1070 (fillout_mntent): Report UDF and offline storage.
1071 * mount.h (class fs_info): Add is_csc_cache status flag.
1073 2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
1075 * fhandler_console.cc (fhandler_console::write_console): Eliminate
1076 unneeded debugging output.
1077 (fhandler_console::write_normal): Eliminate unneeded __seterrno.
1079 2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
1081 * libc/minires.c (scanline): Accommodate ctype changes which disallow
1082 use of an unadorned char argument to is* macros.
1083 * regex/regcomp.c: Ditto, throughout.
1084 * regex/regex2.h (ISWORD): Ditto.
1086 2009-05-03 Christopher Faylor <me+cygwin@cgf.cx>
1088 * fhandler.h (fhandler_console::MAX_WRITE_CHARS): Declare.
1089 (fhandler_console::write_replacement_char): Declare as inline.
1090 (fhandler_console::write_console): Declare new function.
1091 * fhandler_console.cc (fhandler_console::MAX_WRITE_CHARS): Define.
1092 (handler_console::write_console): Define.
1093 (fhandler_console::write_replacement_char): Define as inline.
1094 (fhandler_console::write_normal): Use write_console when writing
1095 buffers of unknown length.
1097 2009-04-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1099 * include/cygwin/socket.h: Define SOL_IPV6.
1101 2009-04-21 Corinna Vinschen <corinna@vinschen.de>
1103 * ctype.cc (__set_ctype): Copy exact part of the current active
1104 character class array.
1106 2009-04-20 Corinna Vinschen <corinna@vinschen.de>
1108 * flock.cc (lf_setlock): Handle border case which results in WFMO loop
1109 exiting with ret == WAIT_TIMEOUT gracefully. Add a system_printf to
1110 uncover other potential problems with WFMO loop.
1112 2009-04-18 Christopher Faylor <me+cygwin@cgf.cx>
1114 * mkimport: Specify .text for stub explicitly.
1115 * speclib: Add a dummy '.idata$7' section referring to the dll
1116 associated with the real import library.
1118 2009-04-18 Corinna Vinschen <corinna@vinschen.de>
1120 * dcrt0.cc (globify): Only call mbtowc for non-ascii chars.
1122 2009-04-17 Corinna Vinschen <corinna@vinschen.de>
1124 * dcrt0.cc (globify): Make multibyte-aware.
1126 2009-04-17 Corinna Vinschen <corinna@vinschen.de>
1128 * flock.cc (class inode_t): Add i_wait member and matching methods
1129 wait(), unwait(), and waiting().
1130 (inode_t::inode_t): Initialize i_wait to 0.
1131 (fhandler_disk_file::lock): Only remove node if no other thread is
1132 waiting for a blocking lock.
1133 (lf_setlock): Manipulate node->i_wait to signal that a thread is
1134 waiting for a blocking lock in this node.
1135 (lf_findoverlap): Reinstantiate SELF test as in original code.
1137 2009-04-16 Corinna Vinschen <corinna@vinschen.de>
1139 * dlfcn.cc (get_full_path_of_dll): Just return a bool value. Drop
1140 local path_conv in favor of getting it as parameter. Add local string
1141 buffer instead of getting it as parameter.
1142 (dlopen): Accommodate get_full_path_of_dll change. Fetch WCHAR Windows
1143 path from path_conv variable and call LoadLibraryW.
1145 2009-04-16 Corinna Vinschen <corinna@vinschen.de>
1147 * ntdll.h (STATUS_LOCK_NOT_GRANTED): Define.
1148 * syscalls.cc (unlink_nt): Handle STATUS_LOCK_NOT_GRANTED same as
1149 STATUS_SHARING_VIOLATION. Add lengthy comment to explain why.
1151 2009-04-15 Corinna Vinschen <corinna@vinschen.de>
1153 * path.cc (path_conv::get_wide_win32_path): Allow relative paths.
1154 (cygwin_conv_path): In case of CCP_POSIX_TO_WIN_W, convert relative
1155 paths to absolute paths if the relative pathname length exceeds
1158 2009-04-15 Corinna Vinschen <corinna@vinschen.de>
1160 * libc/bsdlib.cc: Align copyright with upstream.
1161 * libc/fnmatch.c: Ditto.
1162 * libc/fts.c: Ditto.
1163 * libc/inet_addr.c: Ditto.
1164 * libc/inet_network.c: Ditto.
1165 * libc/rcmd.cc: Ditto.
1166 * libc/rexec.cc: Ditto.
1168 2009-04-14 Christopher Faylor <me+cygwin@cgf.cx>
1170 * speclib: Really revert to using tempdir.
1172 2009-04-14 Christopher Faylor <me+cygwin@cgf.cx>
1174 * speclib: Revert to using tempdir.
1176 2009-04-14 Corinna Vinschen <corinna@vinschen.de>
1178 * localtime.cc (tzload): Implement setting __tzrule's offset member
1179 using newlib's __gettzinfo () interface also when tzload returns
1182 2009-04-13 Dave Korn <dave.korn.cygwin@gmail.com>
1184 * include/stdint.h (intptr_t): Remove long from type.
1185 (uintptr_t): Likewise.
1186 (INTPTR_MIN): Remove 'L' suffix.
1187 (INTPTR_MAX, UINTPTR_MAX): Likewise.
1189 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
1191 * speclib: Initial stab at cleaning up temp files. More work needed.
1194 2009-04-12 Christopher Faylor <me+cygwin@cgf.cx>
1196 * Makefile.in (clean): Clean globals.h.
1197 (LIBCOS): Depend on globals.h.
1199 2009-04-11 Christopher Faylor <me+cygwin@cgf.cx>
1201 * mkimport: New script to perform all operations necessary to create
1205 * Makefile.in (toolopts): New variable which holds options relating to
1207 (speclib): Use toolopts. Add symbols to avoid copying to special
1209 (OBSOLETE_FUNCTIONS): Delete.
1210 (NEW_FUNCTIONS): Change to represent an argument to new mkimport
1212 (libcygwin.a): Use only new mkimport script to create libcygwin.a.
1213 Only rely on ${LIBCOS}.
1214 (*/lib*.a): Simplify speclib dependencies.
1215 (speclib): Accept toolchain options. Convert every argument to
1216 absolute path. Simplify parsing of nm output. Accommodate new
1219 2009-04-11 Dave Korn <dave.korn.cygwin@googlemail.com>
1221 * include/stdint.h (INTPTR_MIN, INTPTR_MAX): Add 'L' suffix.
1222 (WINT_MAX): Add 'U' suffix.
1224 2009-04-10 Christopher Faylor <me+cygwin@cgf.cx>
1226 * speclib: Use a more robust method to derive full file path.
1228 2009-04-09 Christopher Faylor <me+cygwin@cgf.cx>
1230 * speclib: Semi-revert to previous version but don't try to generate
1231 well-formed import library. Instead, just extract appropriate symbols
1232 and let later libcygwin.a on link line fill in the rest of the import
1234 * gendef: Hopefully no-op modification to allow easier post-processing
1237 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1239 * syscalls.cc (try_to_bin): Use tmp_pathbuf buffer to allocate infobuf
1240 rather than using the stack.
1242 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1244 * syscalls.cc (try_to_bin): Fix alignment of infobuf.
1246 2009-04-09 Corinna Vinschen <corinna@vinschen.de>
1248 * fhandler_disk_file.cc (fhandler_disk_file::fchown): Catch an
1249 error when changing the user account on a standalone Samba server.
1251 * sec_acl.cc (setacl): Accommodate additional parameter to set_file_sd.
1252 * sec_helper.cc (SECURITY_SAMBA_UNIX_AUTHORITY): Define.
1253 (well_known_samba_unix_user_fake_sid): Define.
1254 * security.cc (set_file_sd): Take additional parameter if ownership
1255 should be changed. Restrict requested permissions accordingly.
1256 (set_file_attribute): Accommodate additional parameter to set_file_sd.
1257 * security.h (well_known_samba_unix_user_fake_sid): Declare.
1258 (set_file_sd): Align declaration to above change.
1260 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1262 * include/stdint.h (int_least32_t): Define as int.
1263 (uint_least32_t): Ditto, unsigned.
1264 (int_fast16_t): Define as int.
1265 (int_fast32_t): Ditto.
1266 (uint_fast16_t): Ditto, unsigned.
1267 (uint_fast32_t): Ditto.
1268 (UINT32_MAX): Remove `L' long marker.
1269 (UINT_LEAST32_MAX): Ditto.
1270 (UINT_FAST16_MAX): Ditto.
1271 (UINT_FAST32_MAX): Ditto.
1275 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1277 * strfuncs.cc: Change WCHAR to wchar_t in multibyte<->widechar
1278 conversion functions throughout.
1279 * wchar.h: Ditto in declarations. Guard them __INSIDE_CYGWIN__.
1281 2009-04-07 Corinna Vinschen <corinna@vinschen.de>
1283 * fhandler.h (class dev_console): Add members con_mbtowc, con_wctomb,
1285 (dev_console::str_to_con): Take mbtowc function pointer and charset
1286 as additional parameters.
1287 * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
1288 aforementioned new members. Explain why.
1289 (dev_console::con_to_str): Remove useless comment. Call new
1290 sys_cp_wcstombs function rather than sys_wcstombs.
1291 (dev_console::str_to_con): Take mbtowc function pointer and charset
1292 as additional parameters. Call sys_cp_mbstowcs accordingly.
1293 (fhandler_console::write_normal): Only initialize f_mbtowc and charset
1294 once. Accommodate changed str_to_con.
1295 * strfuncs.cc (sys_cp_wcstombs): Renamed from sys_wcstombs. Take
1296 wctomb function pointer and charset as parameters. Use throughout.
1297 (sys_cp_mbstowcs): Take wctomb function pointer and charset as
1298 parameters instead of codepage. Remove matching local variables and
1299 their initialization.
1300 * wchar.h (ENCODING_LEN): Define as in newlib.
1301 (__mbtowc): Use mbtowc_p typedef for declaration.
1302 (wctomb_f): New type.
1303 (wctomb_p): New type.
1304 (__wctomb): Declare.
1305 (__utf8_wctomb): Use wctomb_f typedef for declaration.
1306 (sys_cp_wcstombs): Move declaration from winsup.h here.
1307 (sys_wcstombs): Ditto.
1308 (sys_wcstombs_alloc): Ditto.
1309 (sys_cp_mbstowcs): Ditto.
1310 (sys_mbstowcs): Ditto.
1311 (sys_mbstowcs_alloc): Ditto.
1312 * winsup.h: Move declaration of sys_FOO functions to wchar.h. Include
1315 2009-04-06 Earl Chew <earl_chew@agilent.com>
1317 * libc/rexec.cc (ruserpass): Use fstat64 instead of fstat.
1319 2009-04-06 Corinna Vinschen <corinna@vinschen.de>
1321 * strfuncs.cc: Add comment to explain why we can't support JIS
1323 (__db_wctomb): Alwaus use WC_NO_BEST_FIT_CHARS.
1324 (__jis_wctomb): Just call __ascii_wctomb from here.
1325 (__eucjp_wctomb): Convert to standalone implementation to fix up the
1326 difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
1328 (__kr_wctomb): Use codepage 949.
1329 (__db_mbtowc): Reorder code slightly. Always use MB_ERR_INVALID_CHARS
1330 in call to MultiByteToWideChar. Fix a problem with singlebyte
1331 sequences. Fix a bug in '\0' handling. Reset state->__count on
1332 successful return from non-zero state.
1333 (__jis_mbtowc): Just call __ascii_mbtowc from here.
1334 (__eucjp_mbtowc): Convert to standalone implementation to fix up the
1335 difference between eucJP and CP 20932 affecting JIS-X-0212 characters.
1336 (__kr_mbtowc): Use codepage 949.
1337 (__set_charset_from_codepage): Handle codepage 20932 as eucJP.
1339 2009-04-05 Christopher Faylor <me+cygwin@cgf.cx>
1341 * Makefile.in: Use all compile options when calculating magic values.
1342 * shared_info.h (CURR_SHARED_MAGIC): Revert erroneous value.
1343 * child_info.h (CURR_CHILD_INFO_MAGIC): Update.
1345 * fhandler.h (acquire_output_mutex): Remove unneeded ';'.
1346 (release_output_mutex): Ditto.
1348 2009-04-05 Christopher Faylor <me+cygwin@cgf.cx>
1350 * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings.
1351 * shared_info.h (CURR_SHARED_MAGIC): Update.
1352 * spawn.cc (spawn_guts): Avoid copying one line command line argument
1353 if it hasn't been filled out.
1355 2009-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1356 Corinna Vinschen <corinna@vinschen.de>
1358 * include/asm/byteorder.h (__ntohl): Prototype before define to avoid
1359 a warning with -Wmissing-prototypes. Use _ELIDABLE_INLINE macro from
1363 2009-04-02 Corinna Vinschen <corinna@vinschen.de>
1365 * environ.cc (build_env): Fix length calculation of resulting
1366 wide char environment string.
1368 2009-04-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1370 * include/netdb.h: #include <inttypes.h>, <netinet/in.h>,
1371 and <sys/socket.h> per SUSv3.
1373 2009-04-01 Corinna Vinschen <corinna@vinschen.de>
1375 * strfuncs.cc (sys_cp_mbstowcs): Check if ASCII SO is followed by at
1376 least two chars and the next byte is a valid UTF-8 start byte before
1377 trying to convert the followup bytes as UTF-8 sequence.
1379 2009-03-31 Corinna Vinschen <corinna@vinschen.de>
1381 * shm.cc (struct shm_attached_list): Convert access type to ULONG.
1382 (fixup_shms_after_fork): Fix comment. Use NtMapViewOfSection rather
1383 than MapViewOfFileEx to recreate shared memory regions. Add function
1384 name to api_fatal output.
1385 (shmat): Use NtMapViewOfSection to create shared memory region
1388 2009-03-31 Corinna Vinschen <corinna@vinschen.de>
1390 * ctype.cc: Remove implementation of ctype functions in favor of
1391 pointer-based newlib implementation.
1392 (_ctype_b): Declare.
1393 (__ctype_cp): Move to newlib. Declare.
1394 (__ctype_iso): Ditto.
1395 (__set_ctype): Implement changing __ctype_ptr__. Only copy character
1396 class data in applications built under older Cygwin.
1397 * cygwin.din (__ctype_ptr__): Export.
1398 * include/ctype.h: Remove in favor of newlib implementation.
1399 * include/cygwin/config.h (__EXPORT): Define alongside __IMPORT.
1400 * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE):
1401 Define check for old vs. new ctype implementation.
1402 Bump API minor number.
1404 2009-03-28 Christopher Faylor <me+cygwin@cgf.cx>
1406 * Makefile.in: Perform some minor cleanup. Revamp speclib handling.
1407 * speclib: Rewrite to create libraries with dlltool rather than
1408 attempting surgery on libcygwin.a.
1410 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1412 * net.cc (inet_ntop6): Convert to lowercase hex digits on the fly.
1414 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1416 * net.cc (cygwin_getaddrinfo): Check hints for non-NULL before
1417 checking its content.
1419 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1421 * fhandler.h (class fhandler_fifo): Rename read/write methods to
1423 * fhandler_fifo.cc: Ditto.
1425 2009-03-27 Corinna Vinschen <corinna@vinschen.de>
1427 * syscalls.cc (pathconf): Fix memory leak.
1429 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
1431 * path.cc (symlink_worker): Write target filename as UTF-16 string
1432 with leading BOM marker.
1433 (symlink_info::check_shortcut): If check for leading BOM marker
1434 succeeds, read filename as UTF-16 string.
1435 (symlink_info::check_sysfile): Ditto.
1437 2009-03-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1439 * include/asm/byteorder.h (__ntohl): Align definition to ISO C99.
1442 2009-03-26 Corinna Vinschen <corinna@vinschen.de>
1444 * strfuncs.cc (__set_charset_from_codepage): Revert to translating
1445 codepage 936 to "GBK".
1447 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1449 * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two
1452 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1454 * environ.cc (environ_init): Break from locale loop after first hit.
1455 * fhandler_console.cc (fhandler_console::write_normal): Print a SO
1456 sequence using always valid Unicode chars.
1458 2009-03-25 Corinna Vinschen <corinna@vinschen.de>
1460 * strfuncs.cc (__kr_wctomb): Use codepage 51949 rather than 50949.
1461 (__kr_mbtowc): Ditto.
1462 (__set_charset_from_codepage): Ditto. Translate codepage 936 to
1463 "GB2312" and drop the charset name "GBK".
1465 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1467 * strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949.
1468 (__kr_mbtowc): Ditto.
1469 (__set_charset_from_codepage): Translate codepages 949 and 50949 to
1470 "EUCKR" and drop the charset name "CP949".
1472 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1474 * strfuncs.cc (sys_cp_mbstowcs): Don't read beyond src + nms.
1476 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1478 * shared_info.h (CURR_SHARED_MAGIC): Update.
1480 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1482 * wchar.h: Replace UINT with unsigned int.
1484 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1486 * wchar.h: Remove erroneous "C" specifier from extern declaration.
1488 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1490 * ctype.cc (_CTYPE_DATA_0_127): Add _B class to TAB character.
1491 (__ctype_default): New character class array for default ASCII
1493 (__ctype_iso): New array of character class array for ISO charsets.
1494 (__ctype_cp): Ditto for singlebyte Windows codepages.
1495 (tolower): Implement as distinct function to support any singlebyte
1498 (__set_ctype): New function to copy singlebyte character classes
1499 corresponding to current charset to ctype_b array.
1500 Align copyright text to upstream.
1501 * dcrt0.cc (dll_crt0_1): Reset current locale to "C" per POSIX.
1502 * environ.cc (set_file_api_mode): Remove.
1503 (codepage_init): Remove.
1504 (parse_thing): Remove "codepage" setting.
1505 (environ_init): Set locale according to environment settings, or
1506 to current codepage, before converting environment to multibyte.
1507 * fhandler.h (fhandler_console::write_replacement_char): Drop argument.
1508 * fhandler_console.cc (dev_console::str_to_con): Call sys_cp_mbstowcs
1509 rather than MultiByteToWideChar.
1510 (fhandler_console::write_replacement_char): Always print a funny
1511 half filled square if a character isn't in the current charset.
1512 (fhandler_console::write_normal): Convert to using __mbtowc
1513 rather than next_char.
1514 * fork.cc (frok::child): Drop call to set_file_api_mode.
1515 * globals.cc (enum codepage_type) Remove.
1516 (current_codepage): Remove.
1517 * miscfuncs.cc (cygwin_wcslwr): Unused, dangerous. Remove.
1518 (cygwin_wcsupr): Ditto.
1519 (is_cp_multibyte): Remove.
1520 (next_char): Remove.
1521 * miscfuncs.h (is_cp_multibyte): Drop declaration.
1523 * strfuncs.cc (get_cp): Remove.
1524 (__db_wctomb): New function to implement _wctomb_r functionality for
1525 doublebyte charsets using WideCharToMultiByte.
1526 (__sjis_wctomb): New function to replace unusable newlib function.
1527 (__jis_wctomb): Ditto.
1528 (__eucjp_wctomb): Ditto.
1529 (__gbk_wctomb): New function.
1530 (__kr_wctomb): Ditto.
1531 (__big5_wctomb): Ditto.
1532 (__db_mbtowc): New function to implement _mbtowc_r functionality for
1533 doublebyte charsets using MultiByteToWideChar.
1534 (__sjis_mbtowc): New function to replace unusable newlib function.
1535 (__jis_mbtowc): Ditto.
1536 (__eucjp_mbtowc): Ditto.
1537 (__gbk_mbtowc): New function.
1538 (__kr_mbtowc): New function
1539 (__big5_mbtowc): New function
1540 (__set_charset_from_codepage): New function.
1541 (sys_wcstombs): Reimplement, basically using same wide char to multibyte
1542 conversion as newlib's application level functions. Plus extras.
1543 Add lengthy comment to explain. Change return type to size_t.
1544 (sys_wcstombs_alloc): Just use sys_wcstombs. Change return type to
1546 (sys_cp_mbstowcs): Replace sys_mbstowcs, take additional codepage
1547 argument. Explain why. Change return type to size_t.
1548 (sys_mbstowcs_alloc): Just use sys_mbstowcs. Change return type to
1550 * wchar.h: Declare internal functions implemented in strfuncs.cc.
1551 (wcscasecmp): Remove.
1552 (wcsncasecmp): Remove.
1555 * winsup.h (codepage_init): Remove declaration.
1557 (sys_wcstombs): Align declaration to new implementation.
1558 (sys_wcstombs_alloc): Ditto.
1559 (sys_cp_mbstowcs): Add declaration.
1560 (sys_mbstowcs): Define as inline function.
1561 (sys_mbstowcs_alloc): Align declaration to new implementation.
1562 (set_file_api_mode): Remove declaration.
1563 * include/ctype.h (isblank): Redefine to use _B character class.
1564 (toupper): Remove ASCII-only definition.
1567 2009-03-24 Corinna Vinschen <corinna@vinschen.de>
1569 * sec_auth.cc (str2buf2uni): Remove.
1570 * security.h (str2buf2uni): Remove declaration.
1572 2009-03-24 Yaakov Selkowitz <yselkowitz@cygwin.com>
1574 * include/mntent.h: Remove declarations of nonexistant addmntent
1575 and hasmntopt. Update and clarify the /etc/mtab comment.
1577 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
1579 * smallprint.cc (__small_vsprintf): Handle NULL PWCHAR and
1580 PUNICODE_STRING arguments.
1581 (__small_vswprintf): Ditto.
1583 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
1585 * include/asm/byteorder.h (__constant_ntohs): Remove declaration.
1586 (__constant_ntohl): Ditto.
1588 2009-03-23 Corinna Vinschen <corinna@vinschen.de>
1590 * cygwin.din: Export wordexp, wordfree.
1591 * posix.sgml: Move them to SUSv4 list.
1592 * include/cygwin/version.h: Bump API minor number.
1594 2009-03-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1596 * include/sys/un.h: #include <string.h> for strlen.
1598 2009-03-19 Corinna Vinschen <corinna@vinschen.de>
1600 * dlfcn.cc (get_full_path_of_dll): Revert patch from 2008-07-16.
1602 2009-03-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1604 * cygwin.din: Export log2, log2f as functions.
1605 * posix.sgml: Add them to SUSv4 list.
1606 * include/cygwin/version.h: Bump API minor number.
1608 2009-03-18 Corinna Vinschen <corinna@vinschen.de>
1610 * sec_auth.cc (lsaauth): Remove local definitions of struct
1611 _TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions
1613 (lsaprivkeyauth): As in lsaauth, fetch linked token if available and
1614 return that in favor of default token.
1616 2009-03-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
1618 * errno.cc (_sys_errlist): Add ESTRPIPE.
1620 2009-03-15 Corinna Vinschen <corinna@vinschen.de>
1622 * cygwin.din: Export wcsdup.
1623 * posix.sgml: Add wcsdup to SUSv4 list.
1624 * include/cygwin/version.h: Bump API minor number.
1626 2009-03-15 Corinna Vinschen <corinna@vinschen.de>
1628 * include/inttypes.h: Remove "l" size specifier from all 16 and 32 bit
1631 2009-03-14 Christopher Faylor <me+cygwin@cgf.cx>
1633 * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered
1634 during initialization.
1636 2009-03-14 Corinna Vinschen <corinna@vinschen.de>
1638 * gendef: Remove STABS directives.
1640 2009-03-13 Corinna Vinschen <corinna@vinschen.de>
1642 * mktemp.cc: Remove STABS specific link-time warning. Align copyright
1645 2009-03-13 Corinna Vinschen <corinna@vinschen.de>
1647 * flock.cc: Fix lockf copyright to latest version.
1649 2009-03-12 Corinna Vinschen <corinna@vinschen.de>
1651 * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined
1653 (get_ino_by_handle): Take additional path_conv argument, accommodate
1654 throughout. Only use FileId if isgood_inode check is true.
1655 (fhandler_base::open_fs): Simplify setting ino due to above change.
1656 (readdir_get_ino): Make sure to return always a non-zero inode number.
1657 (fhandler_disk_file::readdir): Always open file in dir with
1658 FILE_OPEN_REPARSE_POINT so as not to open wrong file.
1659 Drop call to isgood_inode here.
1660 * path.cc (symlink_info::check): Call fs.update in case we're fetching
1661 file information from call to NtQueryDirectoryFile.
1663 2009-03-12 Corinna Vinschen <corinna@vinschen.de>
1665 * flock.cc (fhandler_disk_file::lock): Don't test file open mode in
1666 case of flock-type locks. Explain why.
1668 2009-03-12 Brian Ford <Brian.Ford@FlightSafety.com>
1670 * gethostby_helper: Fix typos in DEBUGGING case.
1672 2009-03-11 Corinna Vinschen <corinna@vinschen.de>
1674 * cygwin.din: Export wcscasecmp, wcsncasecmp.
1675 * posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list.
1676 * include/cygwin/version.h: Bump API minor number.
1678 2009-03-11 Corinna Vinschen <corinna@vinschen.de>
1680 * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf,
1682 * posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf
1684 * include/cygwin/version.h: Bump API minor number.
1686 2009-03-09 Corinna Vinschen <corinna@vinschen.de>
1688 * fhandler.h (fhandler_socket::wait_for_events): Take additional
1689 parameter "dontwait".
1690 * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the
1691 socket is non-blocking if dontwait is true.
1692 (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to
1693 set the wait_for_events dontwait parameter.
1694 (fhandler_socket::send_internal): Ditto. Optimize code slightly.
1695 * include/cygwin/socket.h (MSG_DONTWAIT): Define.
1696 * include/cygwin/version.h: Bump API minor number.
1698 2009-03-09 Corinna Vinschen <corinna@vinschen.de>
1700 * cygwin.din: Export wcsftime.
1701 * posix.sgml: Move wcsftime to SUSv4 list.
1702 * include/cygwin/version.h: Bump API minor number.
1704 2009-03-06 Pierre A. Humblet <pierre@phumblet.no-ip.org>
1706 * cygwin.din: Export gethostbyname2.
1707 * net.cc: define _CYGWIN_IN_H and include resolv.h.
1708 (realloc_ent): New function.
1709 (dup_ent): Call realloc_ent.
1710 (memcpy4to6): New function.
1711 (dn_length1): New function.
1712 (gethostby_helper): New function.
1713 (gethostbyname2): New function.
1714 * posix.sgml: Add gethostbyname2.
1715 * include/cygwin/version.h: Bump API minor number.
1716 * libc/minires.c (get_options): Look for "inet6" and apply bounds
1717 to "retry" and "retrans".
1718 (res_ninit): Set the default options at the beginning.
1719 (dn_expand): Fix "off by one".
1721 2009-03-06 Corinna Vinschen <corinna@vinschen.de>
1723 * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf,
1725 * posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf
1726 to SUSv4 list. Sort SUSv4 list.
1727 * include/cygwin/version.h: Bump API minor number.
1729 2009-03-04 Corinna Vinschen <corinna@vinschen.de>
1731 * dcrt0.cc (disable_dep): Disable. Explain why.
1732 (dll_crt0_0): Disable calling disable_dep. Explain why.
1734 2009-03-03 Corinna Vinschen <corinna@vinschen.de>
1736 * net.cc: Include asm/byteorder.h.
1737 (htonl): Move to end of file. Add comment to explain why. Align
1738 definition to POSIX. Use related macro from asm/byteorder.h.
1742 * include/asm/byteorder.h: Revert previous patch.
1744 2009-03-03 Corinna Vinschen <corinna@vinschen.de>
1746 * include/asm/byteorder.h: Disable optimization when building
1747 Cygwin network code.
1749 2009-02-26 Christopher Faylor <me+cygwin@cgf.cx>
1751 * dtable.cc (dtable::select_read): Add ability to override fh.
1752 * fhandler.h (fhandler_fifo::select_read): Declare new function.
1753 (fhandler_fifo::select_write): Ditto.
1754 (fhandler_fifo::select_except): Ditto.
1755 * select.cc (peek_pipe): Treat certain classes of pipe errors as "no
1757 (fhandler_fifo::select_read): Define new function.
1758 (fhandler_fifo::select_write): Ditto.
1759 (fhandler_fifo::select_except): Ditto.
1761 * shared_info.h (CURR_SHARED_MAGIC): Update.
1763 2009-02-23 Sjors Gielen <mailinglist@dazjorz.com>
1765 * Makefile.in: Add DESTDIR functionality.
1767 2009-02-23 Corinna Vinschen <corinna@vinschen.de>
1769 * sec_auth.cc (get_user_local_groups): Simplify LookupAccountName code.
1771 2009-02-20 Corinna Vinschen <corinna@vinschen.de>
1773 * autoload.cc (NetLocalGroupEnum): Remove.
1774 (NetLocalGroupGetMembers): Remove.
1775 (NetUserGetLocalGroups): Add.
1776 * sec_auth.cc (is_group_member): Remove function.
1777 (get_user_local_groups): Get user as string instead of as SID.
1778 Call NetUserGetLocalGroups instead of NetLocalGroupEnum. Drop call
1780 (get_server_groups): Call get_user_local_groups with user name instead
1783 2009-02-19 Corinna Vinschen <corinna@vinschen.de>
1785 * winver.rc: Fix Copyright date.
1787 2009-02-19 Corinna Vinschen <corinna@vinschen.de>
1789 * cygwin.din: Export mbsnrtowcs and wcsnrtombs.
1790 * posix.sgml: Move mbsnrtowcs and wcsnrtombs to SUSv4 section.
1791 * include/cygwin/version.h: Bump API minor number.
1793 2009-02-18 Corinna Vinschen <corinna@vinschen.de>
1795 * cygwin.din: Export open_wmemstream.
1796 * posix.sgml: Move open_wmemstream to SUSv4 section.
1797 * include/cygwin/version.h: Bump API minor number.
1799 2009-02-16 Corinna Vinschen <corinna@vinschen.de>
1801 * cygwin.din: Export reallocf.
1802 * malloc_wrapper.cc( reallocf): New function.
1803 * posix.sgml: Add reallocf to BSD section.
1804 * include/cygwin/version.h: Bump API minor number.
1805 * libc/fts.c: Remove erroneous reallocf definition.
1807 2009-02-16 Corinna Vinschen <corinna@vinschen.de>
1809 * cygwin.din: Export wcstoimax, wcstoumax.
1810 * posix.sgml: Move wcstoimax and wcstoumax to SUSv4 section.
1811 * include/inttypes.h: Declare wcstoimax and wcstoumax.
1812 * include/cygwin/version.h: Bump API minor number.
1814 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1816 * cygwin.din: Export wcsnlen.
1817 * posix.sgml: Move wcsnlen to SUSv4 section.
1818 * include/cygwin/version.h: Bump API minor number.
1820 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1822 * environ.cc (_getenv_r): New function.
1824 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1826 * posix.sgml: Move dirfd to SUSv4 section.
1828 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1830 * posix.sgml: Move interfaces deprecated in SUSv4 to deprecated
1831 interfaces section. Move interfaces added in SUSv4 to SUSv4
1832 section or, if unimplemented, add them to the unimplemented interfaces
1835 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1837 * posix.sgml: Merge SUSv3 and SUSv4 section into a single SUSv4 section.
1838 Move Solaris calls now in SUSv4 to SUSv4 section. Rename unimplemented
1839 section to refer to SUSv4. Add note about missing interfaces.
1840 Move wcstod and wcstof from unimplemented to SUSv4 section.
1842 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1844 * mount.cc (mount_info::from_fstab_line): Make cygdrive posix=0 by
1845 default as documented.
1847 2009-02-13 Corinna Vinschen <corinna@vinschen.de>
1849 * cygwin.din: Export wcstod and wcstof.
1850 * include/cygwin/version.h: Bump API minor number.
1852 2009-02-11 Corinna Vinschen <corinna@vinschen.de>
1854 * syscalls.cc (open): Handle O_DIRECTORY flag.
1855 * include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH.
1856 * include/cygwin/version.h: Bump API minor number.
1858 2009-02-09 Corinna Vinschen <corinna@vinschen.de>
1860 * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix format. Add
1861 code to allow to read disk and CD/DVD devices in full length. Explain
1863 (fhandler_dev_floppy::raw_read): Add current position to debug output.
1865 * include/sys/sched.h: New stub file to override newlib file with
1866 clashing definitions.
1868 2009-02-05 Corinna Vinschen <corinna@vinschen.de>
1870 * cygwin.din: Export wcstok.
1871 * posix.sgml: Move wcstok from unimplemented to susv3.
1872 * include/cygwin/version.h: Bump API minor number.
1874 2009-02-04 Corinna Vinschen <corinna@vinschen.de>
1876 * fhandler_proc.cc (proc_tab): Add entry for mounts symlink.
1877 (format_proc_mounts): New function to implement mounts symlink.
1878 * fhandler_process.cc (process_tab): Add entry for mounts file.
1879 (format_process_mounts): New function to implement mounts file.
1881 2009-02-04 Corinna Vinschen <corinna@vinschen.de>
1883 * security.cc (alloc_sd): Disable generating default permission entries
1886 2009-01-29 Corinna Vinschen <corinna@vinschen.de>
1888 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number
1889 evaluation for faked "." entry.
1891 * mount.cc (fs_info::update): Move setting of is_cdrom after checking
1892 for caseinsensitivity. Recognize UDF in is_cdrom case and set
1893 caseinsensitive flag according to UDF brokenness determined by OS.
1894 Add comment to explain why.
1895 * mount.h (class fs_info): Add is_udf status flag.
1896 * path.cc (symlink_info::check): Add workaround for UDF bug in
1897 terms of casesensitivity on certain OSes.
1898 * wincap.h (wincaps::has_broken_udf): New element.
1899 * wincap.cc: Implement above element throughout.
1901 2009-01-27 Christopher Faylor <me+cygwin@cgf.cx>
1903 * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on
1904 EINTR or real error.
1905 (fhandler_base::write_overlapped): Assume that bytes_written will
1906 contain proper error value.
1907 * pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since
1908 signals are handled by pipe functions now.
1910 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
1912 * shared.cc (shared_name): New function for WCHAR names.
1913 (open_shared): Take name parameter as WCHAR. Accommodate throughout.
1914 * shared_info.h ((CURR_SHARED_MAGIC): Redefine.
1915 (shared_name): Add declaration for function taking a WCHAR name.
1916 (open_shared): Change declaration according to above change.
1917 * pinfo.cc (pinfo::init) : Accommodate above change.
1919 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
1921 * grp.cc (getgrgid_r): Simplify code by using stpcpy.
1922 (getgrnam_r): Ditto.
1923 * passwd.cc (getpwuid_r32): Simplify code by using stpcpy.
1924 (getpwnam_r): Ditto.
1926 2009-01-26 Corinna Vinschen <corinna@vinschen.de>
1928 * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENT
1931 2009-01-24 Corinna Vinschen <corinna@vinschen.de>
1933 * mount.cc (mount_info::from_fstab): Open fstab file with
1934 FILE_OPEN_FOR_BACKUP_INTENT flag.
1936 2009-01-23 Corinna Vinschen <corinna@vinschen.de>
1938 * smallprint.cc (__small_vsprintf): Use already available buffer tmp
1941 2009-01-22 Christopher Faylor <me+cygwin@cgf.cx>
1943 * select.cc (peek_serial): Add hack to allow proper operation with
1946 2009-01-21 Corinna Vinschen <corinna@vinschen.de>
1948 Remove USE_SERVER define. Accommodate throughout.
1949 * configure.in: Remove --enable-server option.
1950 * configure: Regenerate.
1951 * environ.cc: Remove CYGWIN=server setting.
1953 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
1955 * fhandler_procnet.cc: Reorganize global procnet content data into a
1956 new struct virt_tab_t. Accommodate throughout.
1958 * fhandler.h: Fix copyright dates.
1959 * fhandler_process.cc: Ditto.
1960 * fhandler_registry.cc: Ditto.
1962 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
1964 * devices.h (FH_PROCESSFD): New device type.
1965 * dtable.cc (build_fh_pc): Add case for FH_PROCESSFD.
1966 * fhandler.h (class fhandler_virtual): Drop bufalloc member.
1967 * fhandler_virtual.h: New header.
1968 * fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor
1969 of types virt_type_t and virt_tab_t from fhandler_virtual.h.
1970 Change prototypes of format_XXX functions accordingly.
1971 (proc_tab): Drop size member info.
1972 (fhandler_proc::fill_filebuf): Don't allocate filebuf here. Allocate
1973 it in the format_XXX functions.
1974 * fhandler_process.cc: Reorganize global process content data into a
1975 new struct virt_tab_t. Accommodate throughout.
1976 (format_process_winexename): New function.
1977 (format_process_winpid): New function.
1978 (format_process_exename): New function.
1979 (format_process_root): New function.
1980 (format_process_cwd): New function.
1981 (format_process_cmdline): New function.
1982 (format_process_ppid): New function.
1983 (format_process_uid): New function.
1984 (format_process_pgid): New function.
1985 (format_process_sid): New function.
1986 (format_process_gid): New function.
1987 (format_process_ctty): New function.
1988 (format_process_fd): New function.
1989 * fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use
1991 * fhandler_registry.cc (fhandler_registry::fill_filebuf): Define
1993 * fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop
1994 initialization of bufalloc.
1995 (fhandler_virtual::dup): Drop copying bufalloc.
1997 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
1999 * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.
2000 * thread.cc (pthread_rwlock::rdlock): If a thread already owns a
2001 read lock, just count the number of locks for it, per SUSv4.
2002 (pthread_rwlock::tryrdlock): Ditto.
2003 (pthread_rwlock::unlock): If a thread has more than one concurrent
2004 read locks, just count down.
2006 2009-01-20 Corinna Vinschen <corinna@vinschen.de>
2008 * autoload.cc (WSAIoctl): Reintroduce.
2009 (WSASendMsg): Define.
2010 * fhandler.h (class fhandler_socket): Change definition of recv_internal
2011 and send_internal to take WSAMSG pointer as parameter.
2012 * fhandler_socket.cc (WSAID_WSARECVMSG): Define.
2013 (LPFN_WSARECVMSG): Define.
2014 (WSASendMsg): Declare.
2015 (get_ext_funcptr): New function to fetch address of WSARecvMsg.
2016 (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter.
2017 Change code accordingly. If control information is requested,
2018 fetch address of WSARecvMsg and use that instead of WSARecvFrom.
2019 (fhandler_socket::recvfrom): Change return type to ssize_t as
2020 declared in fhandler.h. Accommodate changes to recv_internal.
2021 (fhandler_socket::recvmsg): Ditto. Make sure that control information
2022 is only requested if system, address family, and socket type support it.
2023 (fhandler_socket::send_internal): Take just a LPWSAMSG parameter
2024 and the flags. Change code accordingly. If control information is
2025 provided, use WSASendMsg instead of WSASendTo.
2026 (fhandler_socket::sendto): Drop useless comment. Accommodate changes
2028 (fhandler_socket::sendmsg): Ditto. Make sure that control information
2029 is only provided if system, address family, and socket type support it.
2030 * wincap.h (wincaps::has_recvmsg): New element.
2031 (wincaps::has_sendmsg): New element
2032 * wincap.cc: Implement above elements throughout.
2033 * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment
2034 of type struct cmsghdr.
2036 2009-01-17 Corinna Vinschen <corinna@vinschen.de>
2038 * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond
2041 2009-01-17 Corinna Vinschen <corinna@vinschen.de>
2043 * fhandler_proc.cc: Reorganize global proc content data into a new
2044 struct proc_tab_t. Accommodate throughout.
2045 (format_proc_version): New function.
2046 (format_proc_loadavg): New function.
2047 (format_proc_self): New function.
2049 * resource.cc (getrlimit): Return correct rlim_max value for
2052 2009-01-16 Corinna Vinschen <corinna@vinschen.de>
2054 * Fix copyright dates.
2056 2009-01-13 Corinna Vinschen <corinna@vinschen.de>
2058 * libc/getopt.c (parse_long_options): Use fix from NetBSD's getopt
2059 to avoid false ambiguities.
2061 2009-01-12 Corinna Vinschen <corinna@vinschen.de>
2063 * syscalls.cc (enum bin_status): New type.
2064 (try_to_bin): Return bin_status. Rename win32_path to pc. Rename h
2065 to fh. Rename fh to tmp_fh. Add code to set delete dispostion and
2066 more code to replace file moved to bin by another, temporary file.
2067 Add comments to explain why.
2068 (unlink_nt): Replace move_to_bin with bin_stat. Only set bin_stat
2069 to move_to_bin for non-remote files. As a last resort, call try_to_bin
2070 if setting delete-on-close failed. Only re-set R/O DOS attribute
2071 and only close handle if it's still valid.
2073 2009-01-11 Corinna Vinschen <corinna@vinschen.de>
2075 * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.
2076 * path.cc (path_conv::check): Set to and check for ENOENT instead of
2079 * path.cc (symlink_info::check): Fix Samba 3.2.x comment.
2081 2009-01-09 Corinna Vinschen <corinna@vinschen.de>
2083 * mount.cc (mount_info::from_fstab_line): Always convert drive
2084 letter in native path to uppercase.
2085 * path.cc (normalize_win32_path): Ditto.
2086 (path_prefix_p): Revert previous patch.
2088 * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
2089 return code to circumvent weird behaviour of Samba 3.2.x shares.
2091 2009-01-09 Christopher Faylor <me+cygwin@cgf.cx>
2093 * include/sys/cygwin.h (CW_SETERRNO): Define.
2094 * external.cc (CW_SETERRNO): Implement.
2095 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to
2096 reflect the above change.
2098 * path.cc (path_prefix_p): Treat X: as equivalent to x:.
2100 * mkglobals_h: Remove unneeded #define.
2102 * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
2104 2009-01-08 Corinna Vinschen <corinna@vinschen.de>
2106 * libc/fts.c (fts_build): Use DT_DIR case on Cygwin.
2107 (fts_ufslinks): Fix using wrong structure member in Cygwin-specific
2110 2009-01-07 Corinna Vinschen <corinna@vinschen.de>
2112 * ntdll.h: Reorder NT status flags. Fix a case difference. Add
2113 STATUS_CANNOT_DELETE flag.
2114 * syscalls.cc (unlink_nt): Change initial NtOpenFile to request
2115 FILE_SHARE_DELETE sharing mode. Change comment accordingly.
2116 If setting delete disposition failed with STATUS_CANNOT_DELETE, try
2117 to delete using delete-on-close. Explain why.
2118 Rearrange setting R/O DOS attribute after trying to delete. Simplify
2121 2009-01-07 Corinna Vinschen <corinna@vinschen.de>
2123 * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe if
2124 original file has .exe as well.
2125 * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit
2128 2009-01-02 Christopher Faylor <me+cygwin@cgf.cx>
2130 Remove unneeded header files from source files throughout.
2131 Update copyrights where appropriate.
2133 * globals.cc: New file for generic global variables.
2134 * mkglobals_h: New script to generate globals.h.
2135 * mkstatic: New script used to build a (currently non-working) static
2137 * Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
2138 (DLL_OFILES): Add globals.o. Make all objects rely on globals.h.
2139 (globals.h): New target. Generate globals.h.
2140 * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE
2141 operator is allowed in _cygtls.
2142 * dcrt0.cc: Move most globals to globals.cc.
2144 * environ.cc (strip_title_path): Remove now-unneeded extern.
2145 * fhandler_serial.cc (fhandler_serial::open): Ditto.
2147 (commune_process): Ditto.
2151 * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
2152 * path.cc (stat_suffixes): Move here.
2153 * security.h: Add forward class path_conv declaration.
2154 * smallprint.cc (__small_vsprintf): Make a true c++ function.
2155 (__small_sprintf): Ditto.
2156 (small_printf): Ditto.
2157 (console_printf): Ditto.
2158 (__small_vswprintf): Ditto.
2159 (__small_swprintf): Ditto.
2160 * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of
2162 (hExeced): Move to globals.cc
2163 * strfuncs.cc (current_codepage): Ditto.
2164 (active_codepage): Ditto.
2165 * sync.cc (lock_process::locker): Move here from dcrt0.cc.
2166 * syscalls.cc (stat_suffixes): Move to path.cc.
2167 * tty.cc (tty::create_master): Uncapitalize fatal warning for
2169 * winsup.h: Include globals.h to declare most of the grab bag list of
2170 globals which were previously defined here.
2172 * mount.h: Move USER_* defines back to shared_info.h.
2174 * speclib: Force temporary directory cleanup.
2176 2009-01-02 Christopher Faylor <me+cygwin@cgf.cx>
2178 * speclib: Rewrite completely in perl. Avoid multiple nm calls.