aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
AgeCommit message (Collapse)AuthorFilesLines
2013-12-01* dtable.cc (dtable::find_unused_handle): Break out of the right loop.Christopher Faylor2-2/+6
2013-12-01* dtable.cc (dtable::find_unused_handle): Fix off-by-one error. Always exitChristopher Faylor3-18/+29
through the bottom. (cygwin_attach_handle_to_fd): Make sure that fd tab is locked for the duration of this function. * dtable.h (dtable::lock): Make public. (dtable::unlock): Ditto. (dtable): Remove friends.
2013-12-01Fix ChangeLog entryCorinna Vinschen1-3/+4
2013-12-01 * dtable.cc (dtable::extend): Change local variable new_size to size_tCorinna Vinschen3-3/+10
as well. * thread.cc: Fix comment.
2013-12-01.Christopher Faylor1-2/+5
2013-12-01* dtable.h (dtable::first_fd_for_open): Change declaration to size_t.Christopher Faylor3-10/+18
(dtable::extend): Change parameter to size_t. (dtable::find_unused_handle): Ditto. * dtable.cc: Remove now-unused header. (dtable::extend): Remove pointless test. Change parameter to size_t. (dtable::find_unused_handle): Rework to avoid MAX calculation in extend() call. Change parameter to size_t.
2013-12-01* dtable.cc (build_fh_pc): When creating an archetype, use native name ratherChristopher Faylor3-1/+12
than unix name if name doesn't exist.
2013-11-29* include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 27.Christopher Faylor2-1/+5
2013-11-29 * include/cygwin/stdlib.h(initstate, random, setstate, srandom) :Jon TURNEY2-0/+9
Prototype if not __STRICT_ANSI__ or _XOPEN_SOURCE is defined appropriately.
2013-11-28 * include/glob.h: Fix invalid use of 'restrict' error.Corinna Vinschen2-1/+5
2013-11-27 * syscalls.cc (try_to_bin): Enhance debug output in case reopen fails.Corinna Vinschen2-1/+6
2013-11-27 * syscalls.cc (try_to_bin): Drop fh_dup, reuse tmp_fh instead.Corinna Vinschen2-3/+6
2013-11-27 * syscalls.cc (try_to_bin): Take additional parameter to get file openCorinna Vinschen3-5/+43
flags. If the file to move to the bin has been opened casesensitive, reopen it caseinsensitive. Explain why. Revert the default name of the Vista-and-later recycler to mixed case for readability. (unlink_nt): Call try_to_bin with file open flags as evaluated.
2013-11-26 * nlsfuncs.cc (wcscoll): Add "__restrict" to definition.Corinna Vinschen2-2/+7
(wcsxfrm): Ditto.
2013-11-26 * common.din: Export posix_spawn[...] functions.Corinna Vinschen6-2/+56
* exec.cc (execve): Add EXPORT_ALIAS _execve. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * posix.sgml (std-susv4): Add posix_spawn[...] here. (std-notimpl): Drop here.
2013-11-26 * nlsfuncs.cc (strcoll): Add "__restrict" to definition.Corinna Vinschen2-2/+7
(strxfrm): Ditto.
2013-11-25 Throughout, keep function definitions and declarations in sync withCorinna Vinschen15-30/+47
newlib in terms of C99 "restrict" keyword.
2013-11-24 * dtable.cc: Include sys/param.h for MAX definition.Corinna Vinschen2-0/+5
2013-11-24 Throughout, drop unnecessary explicit includes of windows header filesCorinna Vinschen21-49/+23
included by default. * winlean.h: Add long comment to explain why we have to define certain symbols. (_NORMALIZE_): Define. (_WINNLS_): Drop definition and subsequent undef. (_WINNETWK_): Ditto. (_WINSVC_): Ditto. 2013-11-23 Eric Blake <eblake@redhat.com>
2013-11-24*** empty log message ***Corinna Vinschen1-0/+2
2013-11-23dup2: fix off-by-one crashEric Blake3-2/+15
* dtable.cc (dup3): Fix off-by-one. (find_unused_handle): Reduce time spent expanding during dup. * syscalls.cc (setdtablesize): Report error on invalid value.
2013-11-20 * include/cygwin/stdlib.h (realpath): Drop declaration. It's declaredCorinna Vinschen2-1/+5
in newlib's stdlib.h now.
2013-11-19 * ntdll.h (RtlGetVersion): Declare.Corinna Vinschen5-7/+20
* wincap.cc (wincapc::init): Rather than GetVersionEx, call RtlGetVersion which is not crippled by missing Windows 8.1 manifest. * wincap.h (wincapc): Change type of version to RTL_OSVERSIONINFOEXW. Align formatting of all class members.
2013-11-19 * wincap.cc (wincapc::init): Revert previous change. It's not working.Corinna Vinschen3-13/+4
2013-11-19*** empty log message ***Corinna Vinschen1-0/+4
2013-11-19 * net.cc (cygwin_getaddrinfo): Fix a comment. Only memset whints ifCorinna Vinschen2-7/+17
hints is NULL. Add a comment and set whints.ai_family explicitely to AF_UNSPEC to follow glibc man page closely. Check flags against whints for locality.
2013-11-19 * wincap.cc (wincapc::init): Fix dwMinorVersion for Windows 8.1 andCorinna Vinschen2-0/+14
Server 2012. Explain why this is necessary.
2013-11-19 * autoload.cc (IdnToAscii): Define.Corinna Vinschen6-998/+335
(IdnToUnicode): Define. (FreeAddrInfoW): Define. (GetAddrInfoW): Define. (GetNameInfoW): Define. * net.cc: Drop W. Richard STEVENS libgai implementation. (cygwin_freeaddrinfo): Move code from ipv4_freeaddrinfo here. Move definition up in file to avoid forward declaration in ga_duplist. (ga_dup): Take addrinfoW as input. Add parameters to get IDN flags and to set error value. Handle IDN flags and especially AI_CANONIDN. Convert input wchar_t ai_canonname string to multibyte for output. (ga_duplist): Add parameters to get IDN flags and to set error value and propagate to ga_dup. Call cygwin_freeaddrinfo. (gai_errmap): Add comments. Align error strings to GLibc. Add EAI_IDN_ENCODE entry. (get_ipv6_funcs): Remove. (load_ipv6_guard): Remove. (ipv6_inited): Remove. (load_ipv6): Remove. (load_ipv6_funcs): Remove. (cygwin_getaddrinfo): Drop calling load_ipv6. Handle AI_IDN* flags. Convert input strings to wchar_t and call GetAddrInfoW/FreeAddrInfoW. In case hints is NULL, set default ai_flags explicitely to AI_V4MAPPED | AI_ADDRCONFIG, as documented for Glibc. Only add AI_ALL if AI_ADDRCONFIG is not given. Unconditionally add Windows-specific AI_DISABLE_IDN_ENCODING to ai_flags to make IDN behaviour compatible to Glibc even on Windows 8 and later. (cygwin_getnameinfo): Drop calling load_ipv6. Handle NI_IDN* flags. Call GetNameInfoW and convert returned strings from wchar_t to multibyte. * include/netdb.h: Add comments to describe flags and error values. (AI_*): Define all flags using hex values for clearness. (AI_IDN): Define. (AI_CANONIDN): Define. (AI_IDN_ALLOW_UNASSIGNED): Define. (AI_IDN_USE_STD3_ASCII_RULES): Define. (NI_*): Define all flags using hex values for clearness. (NI_IDN): Define. (NI_IDN_ALLOW_UNASSIGNED): Define. (NI_IDN_USE_STD3_ASCII_RULES): Define. (EAI_IDN_ENCODE): Define.
2013-11-19*** empty log message ***Corinna Vinschen1-0/+2
2013-11-07winsup/ChangeLog:Christopher Faylor3-144/+158
2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> * configure.ac: Detect windows headers/libs after we've figured out the C compiler. * configure: Regenerate. * aclocal.m4: Regenerate. * configure.cygwin: Default to '.' if can't find a winsup directory. winsup/cygserver/ChangeLog: 2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> * configure.ac: Detect windows headers/libs after we've figured out the C compiler. * configure: Regenerate. * aclocal.m4: Regenerate. winsup/cygwin/ChangeLog: 2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> * configure.ac: Detect windows headers/libs after we've figured out the C compiler. * configure: Regenerate. * aclocal.m4: Regenerate. winsup/utils/ChangeLog: 2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> * configure.ac: Detect windows headers/libs after we've figured out the C compiler. * configure: Regenerate. * aclocal.m4: Regenerate.
2013-10-31 * devices.in (dev_cygdrive_storage): Revert mapping to \Device\Null.Corinna Vinschen12-79/+138
(dev_storage): Ditto for /dev. * devices.cc: Regenerate. * fhandler.cc (fhandler_base::open_null): New method to open a fake \Device\Null handler. (fhandler_base::open): Fix formatting. Change O_ACCMODE test to a switch statement. Simplify a test which still tested for a now unused create_disposition. * fhandler.h (fhandler_base::open_null): Declare. (fhandler_netdrive::close): Declare. * fhandler_dev.cc (fhandler_dev::open): Open fake \Device\Null handle by just calling new open_null method. * fhandler_disk_file.cc (fhandler_cygdrive::open): Ditto. * fhandler_netdrive.cc (fhandler_netdrive::open): Call open_null rather than setting nohandle. (fhandler_netdrive::close): New method. * fhandler_registry.cc (fetch_hkey): Fix token in RegOpenUserClassesRoot call. Create valid key for HKEY_CURRENT_CONFIG by mapping to real key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Hardware Profiles\Current. (fhandler_registry::open): Set nohandle only when using pseudo registry handle. * fhandler_virtual.cc (fhandler_virtual::opendir): Call open rather than just setting nohandle here. * fhandler_virtual::fstatvfs): Set ST_RDONLY fs flag. * globals.cc (ro_u_null): New readonly UNICODE_STRING for \Device\Null. * path.h (path_conv::set_path): Revert previous change caring for wide_path.
2013-10-30*** empty log message ***Corinna Vinschen1-0/+11
2013-10-30 * devices.in (dev_cygdrive_storage): Map to \Device\Null.Corinna Vinschen10-102/+141
(dev_storage): Map /dev and /dev/windows to \Device\Null. * devices.cc: Regenerate. * dir.cc (opendir): Create unique id. Explain why. * fhandler.h (fhandler_dev::get_dev): Implement inline. (fhandler_cygdrive::close): Drop declaration. (fhandler_cygdrive::get_dev): Implement inline. (fhandler_windows::get_hwnd): Ditto. (fhandler_windows::set_close_on_exec): Drop declaration. (fhandler_windows::fixup_after_fork): Ditto. * fhandler_dev.cc (fhandler_dev::open): Call fhandler_disk_file::open without O_CREAT flag. Explain why. Create \Device\Null handle if /dev/ doesn't actually exist. (fhandler_dev::close): Drop nohandle case. (fhandler_dev::fstatvfs): Drop nohandle check. Test for fs_got_fs instead. Set ST_RDONLY fs flag for simulated /dev. (fhandler_dev::opendir): If /dev doesn't exist, call open() to create fake \Device\Null handle. Don't set nohandle. Set dir_exists correctly. (fhandler_dev::rewinddir): Call fhandler_disk_file::rewinddir only if /dev is a real directory. * fhandler_disk_file.cc (fhandler_disk_file::opendir): If called for the cygdrive dir, call open() to create fake \Device\Null handle. Only attach __DIR_mounts buffer to dir if not called for cygdrive dir. Don't set nohandle. (fhandler_cygdrive::open): Create \Device\Null handle. (fhandler_cygdrive::close): Remove. (fhandler_cygdrive::fstatvfs): Set ST_RDONLY fs flag. * fhandler_windows.cc (fhandler_windows::open): Create \Device\Null handle. (fhandler_windows::read): Don't add io_handle to WFMO handle array. Change subsequent test for return value accordingly. Fix test for "message arrived". (fhandler_windows::set_close_on_exec): Remove. (fhandler_windows::fixup_after_fork): Remove. * path.h (path_conv::set_path): Make sure wide_path is NULL when setting a new path. * select.cc (peek_windows): Use correct hWnd value, not io_handle. (fhandler_windows::select_read): Don't use io_handle as wait object. (fhandler_windows::select_write): Ditto. (fhandler_windows::select_except): Ditto.
2013-10-28*** empty log message ***Corinna Vinschen1-3/+4
2013-10-27 * exception.h: Fold in content of include/exceptions.h.Corinna Vinschen4-126/+107
* include/exceptions.h: Remove.
2013-10-26 * devices.in (dev_storage): Map /dev/dsp to \Device\Null.Corinna Vinschen6-18/+32
* devices.cc: Regenerate. * fhandler_dsp.cc (fhandler_dev_dsp::open): Call fhandler_base::open. (fhandler_dev_dsp::close): Call fhandler_base::close. (fhandler_dev_dsp::fixup_after_fork): Call fhandler_base::fixup_after_fork. * fhandler_raw.cc (fhandler_dev_raw::fixup_after_fork): Call fhandler_base::fixup_after_fork.
2013-10-26 * exception.h (_exception_list): Drop redefinition for x86_64.Corinna Vinschen3-5/+11
* include/exceptions.h: Disable content for x86_64 since it's not using frame based exception handling anymore.
2013-10-25 * flock.cc (fhandler_base::lock): Only refuse to lock nohandle andCorinna Vinschen4-12/+26
old-style console devices when called to perform BSD flock locking. Add a FIXME to comment and align description. * ntdll.h (THREADINFOCLASS): Following MSDN, rename throughout from THREAD_INFORMATION_CLASS.
2013-10-25 * devices.in (dev_storage): Map /dev/clipboard to \Device\Null.Corinna Vinschen6-28/+23
* devices.cc: Regenerate. * fhandler.h (fhandler_dev_clipboard::open): Drop declaration. * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Drop call to open. Set private members to 0 and call fhandler_base::dup. (fhandler_dev_clipboard::open): Remove so that default fhandler_base::open is used to open \Device\Null. (set_clipboard): Drop gratuitios call to RegisterClipboardFormatW. (fhandler_dev_clipboard::close): Call fhandler_base::close from here.
2013-10-25 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Fix comment.Corinna Vinschen2-1/+5
2013-10-25 * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Drop gratuitiosCorinna Vinschen3-4/+13
handling of membuffer. It's NULL anyway. (fhandler_dev_clipboard::lseek): Set membuffer to NULL after freeing it to avoid subsequent crashes when accessing invalid pointer.
2013-10-25 * devices.in (dev_storage): Map /dev/random and /dev/urandom toCorinna Vinschen7-46/+27
\Device\Null. * devices.cc: Regenerate. * fhandler.h (fhandler_dev_random::open): Drop declaration. (fhandler_dev_random::close): Ditto. (fhandler_dev_random::crypt_gen_random): Convert to static method. * fhandler_random.cc (fhandler_dev_random::open): Remove so that default fhandler_base::open is used to open \Device\Null. (fhandler_dev_random::close): Ditto. * fhandler_socket.cc (entropy_source): Delete. (fhandler_socket::af_local_set_secret): Remove entropy_source code and call fhandler_dev_random::crypt_gen_random directly instead.
2013-10-24 * fhandler.h (fhandler_dev_zero::lseek): Convert to inline method.Corinna Vinschen6-46/+24
(class fhandler_dev_random): Drop dummy_offset. (fhandler_dev_random::lseek): Convert to inline method. (fhandler_dev_dsp::lseek): Ditto. * fhandler_dsp.cc (fhandler_dev_dsp::lseek): Drop here. * fhandler_random.cc (fhandler_dev_random::open): Drop setting dummy_offset. (fhandler_dev_random::lseek): Drop here. * fhandler_tape.cc (fhandler_dev_tape::lseek): Make no-op, but keep old code for reference. * fhandler_zero.cc (fhandler_dev_zero::lseek): Drop here.
2013-10-24* external.cc (fillout_pinfo): If start_time is 0, wait a while beforeChristopher Faylor6-1/+28
returning the pinfo structure. * fhandler.cc (fhandler_base::open_setup): Convert from inline. * fhandler.h (fhandler_base::open_setup): Declare. * fhandler_console.cc (fhandler_console::open_setup): Always call fhandler_base::open_setup. * fhandler_tty.cc (fhandler_pty_slave::open_setup): Ditto. (fhandler_pty_master::open_setup): Ditto.
2013-10-24Fix typo.Corinna Vinschen1-1/+1
2013-10-24 * devices.in (dev_storage): Map /dev/zero and /dev/full to \Device\Null.Corinna Vinschen11-64/+109
* devices.cc: Regenerate. * dtable.h (struct dtable): Make fhandler_base friend, rather than fhandler_disk_file. * fhandler.cc (fhandler_base::open_with_arch): Create unique id. (fhandler_base::cleanup): Call del_my_locks. (fhandler_base::fcntl): Handle F_GETLK, F_SETLK and F_SETLKW. * fhandler.h (fhandler_base::get_dev): Return real device number. (fhandler_base::set_unique_id): New inline method. (fhandler_disk_file::lock): Drop declaration. (fhandler_disk_file::get_dev): New method, return pc.fs_serial_number. (fhandler_dev_zero::open): Drop declaration. * fhandler_disk_file.cc (fhandler_disk_file::close): Move del_my_locks call to fhandler_base::open_with_arch. (fhandler_disk_file::fcntl): Move handling of locking commands to fhandler_base::fcntl. (fhandler_base::open_fs): Drop call to NtAllocateLocallyUniqueId. * fhandler_zero.cc (fhandler_dev_zero::open): Remove so that default fhandler_base::open is used to open \Device\Null. * flock.cc (fixup_lockf_after_exec): Finding a single fhandler is enough here. (fhandler_base::lock): Replace fhandler_disk_file::lock. Refuse to lock nohandle devices. Handle read/write test using POSIX flags. Explain why. Never fail on SEEK_CUR or SEEK_END, rather assume position 0, just as Linux. * net.cc (fdsock): Create unique id.
2013-10-23 * include /cygwin/config.h (_READ_WRITE_BUFSIZE_TYPE): Define.Corinna Vinschen2-0/+5
2013-10-23 * fhandler.cc (fhandler_base::fstat): Drop FH_FULL case to alignCorinna Vinschen2-3/+5
/dev/full permissions to Linux.
2013-10-22* fhandler.h (fhandler_base::cleanup): Mark as extern rather than inline.Christopher Faylor4-1/+16
* fhandler_base.cc (fhandler_base::cleanup): Define. * fhandler_tty.cc (fhandler_pty_slave::cleanup): Call fhandler_base::cleanup. (fhandler_pty_master::cleanup): Ditto.
2013-10-19.Christopher Faylor1-0/+3