Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2008-04-21 * Makefile.in (DLL_OFILES): Add kernel32.o.Corinna Vinschen
* autoload.cc (WSACloseEvent): Remove. (WSACreateEvent): Remove. * cygheap.cc (cygheap_init): Drop initializing shared_prefix. * cygheap.h (struct init_cygheap): Drop shared_prefix and shared_prefix_buf members. * fhandler_socket.cc (sock_shared_name): New static function. (search_wsa_event_slot): Convert name buffers to WCHAR. Call NtCreateMutant/NtOpenMutant to create mutexes in session local namespace. (fhandler_socket::init_events): Ditto. Fix debug output. (fhandler_socket::release_events): Close mutexes using NtClose. (fhandler_socket::dup): Ditto. * kernel32.cc: New file, implementing Win32 calls in a Cygwin-specific way. * mmap.cc (MapView): Make static. * ntdll.h: Fix status code sorting. (STATUS_OBJECT_NAME_EXISTS): Define. (SEMAPHORE_QUERY_STATE): Define. (CYG_SHARED_DIR_ACCESS): Define. (CYG_MUTANT_ACCESS): Define. (CYG_EVENT_ACCESS): Define. (CYG_SEMAPHORE_ACCESS): Define. (enum _PROCESSINFOCLASS): Define ProcessSessionInformation. (struct _PROCESS_SESSION_INFORMATION): Define. (NtCreateSemaphore): Declare. (NtOpenSemaphore): Declare. * flock.cc: Use CYG_xxx_ACCESS access masks where appropriate. * posix_ipc.cc (ipc_mutex_init): Use native functions to create mutex. Create in cygwin-shared subdir. (ipc_cond_init): Ditto for event. (ipc_mutex_close): Use NtClose. (ipc_cond_close): Ditto. (mq_open): Drop "cyg" prefix from mqh_uname. * shared.cc (CYG_SHARED_DIR_ACCESS): Drop definition here. (_cygwin_testing): Declare extern on file level. (get_shared_parent_dir): Change name of shared directory. Add name to api_fatal output. (get_session_parent_dir): New function. (shared_name): Simplify. (shared_info::initialize): Call get_session_parent_dir. * shared_info.h (get_session_parent_dir): Declare. * smallprint.cc (__small_vswprintf): Fix bug in multibyte string conversion. * thread.cc (semaphore::semaphore): Align semaphore name to object names in posix IPC functions. * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
2008-04-19 Revert thinko in previous patch.Corinna Vinschen
* fhandler.h (struct wsa_event): Move back from wsa_event.h to here. * fhandler_socket.cc (NUM_SOCKS): Ditto. (wsa_events): Move back from cygwin_shared to here. Accommodate throughout. (socket_serial_number): Ditto. * shared_info.h: Accommodate above changes. * wsa_event.h: Remove.
2008-04-19 * fhandler.h (-struct wsa_event): Move to wsa_event.h. IncludeCorinna Vinschen
wsa_event.h instead. * fhandler_socket.cc (NUM_SOCKS): Move to wsa_event.h. (wsa_events): Move from DLL shared area to cygwin_shared shared memory. Accommodate throughout. (socket_serial_number): Ditto. * fhandler_tape.cc (mt): Ditto. (mtinfo_init): Remove. (mt): Define as cygwin_shared->mt. * flock.cc (FLOCK_PARENT_DIR_ACCESS): Remove. (FLOCK_INODE_DIR_ACCESS): Move up in file. (FLOCK_MUTANT_ACCESS): Ditto. (FLOCK_EVENT_ACCESS): Ditto. (get_lock_parent_dir): Remove. (inode_t::inode_t): Call get_shared_parent_dir to get parent dir handle. Add a "flock-" prefix to file's lock directory name for clarity. * mtinfo.h (mtinfo_init): Drop declaration. * net.cc (last_used_bindresvport): Move from DLL shared area to cygwin_shared shared memory. (cygwin_bindresvport_sa): Accommodate above change. * sec_helper.cc (_everyone_sd): Move here from flock.cc. * security.h (SD_MIN_SIZE): Ditto. (everyone_sd): Ditto. * shared.cc (cygwin_shared_area): Remove. (cygwin_shared_h): New handle. (get_shared_parent_dir): New static function. (shared_name): Drop session_local argument. Call get_shared_parent_dir here. Add cygwin-shared subdir to object name. (offsets): Reinstantiate SH_CYGWIN_SHARED member. (open_shared): Revert change from 2007-03-29 for systems supporting SeCreateGlobalPrivilege. (shared_info::initialize): Call mtinfo's initialize here. (memory_init): Drop call to mtinfo_init. * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. (CURR_SHARED_MAGIC): Ditto. (class shared_info): Add members for global socket and tape info sharing. (enum shared_locations): Reinstantiate SH_CYGWIN_SHARED. (get_shared_parent_dir): Declare. (shared_name): Drop session_local argument from declaration. * wsa_event.h: New file. Move definitions of NUM_SOCKS and struct wsa_event here.
2008-04-16 * fhandler_socket.cc (fhandler_socket::close): Disable enforcedCorinna Vinschen
lingering since the original problem can no longer be reproduced.
2008-04-07Remove unneeded header files from source files throughout.Christopher Faylor
2008-04-01 * Fix copyright dates.Corinna Vinschen
2008-03-27 * fhandler_socket.cc: Create shared objects session local throughout.Corinna Vinschen
* shared.cc (shared_name): Add argument to allow opening session local shared memory. * shared_info.h (shared_name): Change declaration accordingly.
2008-03-07 * fhandler_socket.cc (fhandler_socket::sendto): Never send more thanCorinna Vinschen
64K. Add comment to explain why. (fhandler_socket::sendmsg): Ditto.
2008-02-15Perform whitespace cleanup throughout.Christopher Faylor
* dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards compatibility. (check_sanity_and_sync): Ditto. * winsup.h (SIGTOMASK): Ditto. Just use constant in signal calculation. * include/cygwin/version: Remove backwards signal mask compatibility define. * path.cc (symlink_info::check_sysfile): Cosmetic change. * registry.cc (get_registry_hive_path): Remove unneeded variable. * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and use either main sigmask or current thread sigmask. (set_process_mask): Ditto. (sighold): Ditto. (sigrelse): Ditto. (sigset): Ditto. (set_process_mask_delta): Ditto. (_cygtls::call_signal_handler): Ditto. * fhandler_process.cc (format_process_status): Ditto. * fhandler_termios.cc (fhandler_termios::bg_check): Ditto. * pinfo.h (class pinfo): Ditto. * select.cc (pselect): Ditto. * signal.cc (sigprocmask): Ditto. (abort): Ditto. (sigpause): Ditto. (sigsend): Ditto. (wait_sig): Ditto. * thread.h (pthread::parent_tls): New member. * thread.cc (pthread::pthread): Record parent_tls here. (pthread::thread_init_wrapper): Initialize sigmask from parent thread.
2007-12-05 * fhandler_registry.cc: Use NAME_MAX + 1 instead of CYG_MAX_PATHCorinna Vinschen
throughout for subkey name buffer size. * fhandler_socket.cc (search_wsa_event_slot): Use MAX_PATH instead of CYG_MAX_PATH for mutext name buffer size. (fhandler_socket::init_events): Ditto. * fhandler_virtual.cc (fhandler_virtual::opendir): Check path length against PATH_MAX instead of against CYG_MAX_PATH. * registry.cc (get_registry_hive_path): Use PATH_MAX instead of CYG_MAX_PATH for registry value path buffer size. * shared.cc (open_shared): Use MAX_PATH instead of CYG_MAX_PATH for shared memory name buffer size. * thread.cc (semaphore::semaphore): Use MAX_PATH instead of CYG_MAX_PATH for semaphore name buffer size. * uinfo.cc (cygheap_user::env_userprofile): Use PATH_MAX instead of CYG_MAX_PATH for temporary path name buffer size. * winf.h (LINE_BUF_CHUNK): Define as MAX_PATH * 2. * include/sys/dirent.h: Include sys/limits.h. Define name buffer sizes using NAME_MAX.
2007-11-28 * fhandler_socket.cc (fhandler_socket::recv_internal): Add MSG_WAITALLCorinna Vinschen
handling. Use explicit flag values instead of MSG_WINMASK. (fhandler_socket::send_internal): Use explicit flag values instead of MSG_WINMASK. * include/cygwin/socket.h (MSG_WINMASK): Remove definition. (MSG_WAITALL): Define.
2007-10-10 * fhandler_socket.cc (fhandler_socket::bind): Open file for deletion,Corinna Vinschen
too. Don't write to file and especially don't close handle if file couldn't be created. Set delete disposition if writing failed, instead of calling unlink_nt.
2007-08-16 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Handle S_IFSOCKCorinna Vinschen
mode bit by setting the SYSTEM attribute. * fhandler_socket.cc (fhandler_socket::fchmod): Add S_IFSOCK mode bit when calling fhandler_disk_file::fchmod. Don't set attributes here.
2007-08-16 * path.h (path_conv::operator char *): Delete.Corinna Vinschen
(path_conv::operator const char *): Delete. * dlfcn.cc: Throughout, replace path_conv::operator char * and path_conv::operator const char * by call to path_conv::get_win32 for easier transition to UNICODE_PATHs. * fhandler_socket.cc: Ditto. * hookapi.cc: Ditto. * path.cc: Ditto. * spawn.cc: Ditto. * syscalls.cc: Ditto. * uinfo.cc: Ditto.
2007-08-15 * fhandler_socket.cc (get_inet_addr): Use NT native functions forCorinna Vinschen
accessing the file representing the local socket. (fhandler_socket::bind): Ditto. * ntdll.h: Declare NtReadFile.
2007-08-13 * fhandler.h (fhandler_base::close_fs): Reintroduce (as inline function)Corinna Vinschen
for clearness. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Revert previous change. (fhandler_base::open_fs): Ditto. * fhandler_socket.cc (fhandler_socket::close): Ditto.
2007-08-13 * Makefile.in (DLL_OFILES): Remove delqueue.o.Corinna Vinschen
* delqueue.cc: Delete. * fhandler.h (fhandler_base::close_fs): Drop declaration. (fhandler_disk_file::close): Drop declaration. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Call close instead of close_fs. (fhandler_base::fstat_helper): Use open FH_UNIX handle in call to get_file_attribute. (fhandler_base::open_fs): Call close instead of get_file_attribute. (fhandler_disk_file::close): Remove. (fhandler_base::close_fs): Remove. * fhandler_socket.cc (fhandler_socket::close): Just call fhandler_base::close for FH_UNIX sockets. * shared.cc (user_shared_initialize): Drop call to user_shared->delqueue.init. * shared_info.h (CURR_USER_MAGIC): Change according to below change. (MAX_DELQUEUES_PENDING): Remove. (class delqueue_list): Remove. (class user_info): Remove delqueue. * syscalls.cc (close_all_files): Drop call to user_shared->delqueue.process_queue. (unlink): Drop delqueue handling.
2007-06-21 * autoload.cc (WSAIoctl): Remove.Corinna Vinschen
* cygwin.din: Export freeifaddrs, getifaddrs. * fhandler_socket.cc (fhandler_socket::ioctl): Drop SOCKET parameter from get_ifconf. * net.cc: Include ifaddrs.h. (in_are_prefix_equal): Match addresses in network byte order. (ip_addr_prefix): Convert address into host byte order before testing with IN_LOOPBACK. (struct ifall): Define. (get_xp_ifs): Replace get_xp_ifconf. Return struct ifall array. (get_2k_ifs): Ditto, replace get_2k_ifconf. (get_nt_ifs): Ditto, replace get_nt_ifconf. (getifaddrs): New function. (freeifaddrs): New function. (get_ifconf): Call matching get_XX_ifs function and create ifc content from here. Drop lo fake since it's now in get_nt_ifs. * posix.sgml: Add freeifaddrs and getifaddrs to list of implemented BSD functions. * wincap.h (wincapc::has_broken_if_oper_status): New element. * wincap.cc: Implement above element throughout. * include/ifaddrs.h: New file. * include/cygwin/version.h: Bump API minor number.
2007-06-14 * autoload.cc (GetIpForwardTable): Define.Corinna Vinschen
* fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFDSTADDR. * net.cc (get_routedst): New static function to get destination address of point-to-point interfaces. (get_xp_ifconf): Handle SIOCGIFDSTADDR. (get_2k_ifconf): Ditto. (get_nt_ifconf): Ditto. (get_ifconf): Ditto. * include/asm/socket.h (SIOCGIFDSTADDR): Define. * include/cygwin/if.h (struct ifreq): Add ifru_dstaddr member. (ifr_dstaddr): Define. * include/cygwin/in.h: Cast ipv4 addresses correctly to in_addr_t in definitions.
2007-05-15 * fhandler_socket.cc (adjust_socket_file_mode): New inline function.Corinna Vinschen
(fhandler_socket::fchmod): Squeeze mode through adjust_socket_file_mode before using it. (fhandler_socket::bind): Ditto.
2007-02-27 * fhandler.cc(fhandler_base::open): Open with READ_CONTROL only inCorinna Vinschen
case of query_open flag set to query_read_control. Add case for new query_read_attributes flag. (fhandler_base::fstatvfs): New method. * fhandler.h (enum query_state): Add query_read_attributes flag. (class fhandler_base): Declare new virtual fstatvfs method. (class fhandler_socket): Ditto. (class fhandler_pipe): Ditto. (class fhandler_fifo): Ditto. (class fhandler_disk_file): Ditto. (class fhandler_virtual): Ditto. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Open with query_read_attributes instead of query_read_control. (fhandler_disk_file::fstatvfs): New method. (fhandler_disk_file::facl): Open with query_read_attributes instead of query_read_control. * fhandler_fifo.cc (fhandler_fifo::fstatvfs): New method. * fhandler_socket.cc (fhandler_socket::fstatvfs): New method. (fhandler_socket::fchmod): Return with EBADF in the default case. (fhandler_socket::fchown): Ditto. (fhandler_socket::facl): Ditto. * fhandler_virtual.cc (fhandler_virtual::fstatvfs): Ditto. * ntdll.h (struct _FILE_FS_ATTRIBUTE_INFORMATION): Define. (struct _FILE_FS_FULL_SIZE_INFORMATION): Define. * pipe.cc (fhandler_pipe::fstatvfs): New method. * syscalls.cc (fstatvfs): Just call the fhandler's fstatvfs. (statvfs): Ditto. (fstatfs): Call fstatvfs. (statfs): Drop EFAULT handling.
2007-02-22 Throughout replace all usage of wincap.shared with the constantCorinna Vinschen
FILE_SHARE_VALID_FLAGS. * fhandler.cc (fhandler_base::open_9x): Drop local variable shared. * wincap.cc: Remove shared member throughout. * wincap.h: Ditto.
2007-02-20 * fhandler_socket.cc (fhandler_socket::bind): Remove printing wrongCorinna Vinschen
errno in debug output.
2007-02-20Remove extraneous whitespace.Christopher Faylor
* pinfo.cc (commune_process): Use default argument to lock_process. * sigproc.cc: Update copyright. * select.cc: Ditto.
2007-01-22 * autoload.cc (WSAIoctl): Define.Corinna Vinschen
(SendARP): Define. * cygwin.din: Export if_freenameindex, if_indextoname, if_nameindex and if_nametoindex. * fhandler_procnet.cc: Drop including wchar.h. Drop definitions of GAA_FLAG_INCLUDE_ALL_INTERFACES, IP_ADAPTER_UNICAST_ADDRESS_VISTA. (fhandler_procnet::exists): Check for has_gaa_prefixes. Call get_adapters_addresses here. (fhandler_procnet::readdir): Ditto. (prefix): Move to net.cc. (fhandler_procnet::fill_filebuf): Call get_adapters_addresses here. Simplify allocation. Use AdapterName rather than FriendlyName as interface name. Use IfIndex if available, Ipv6IfIndex otherwise. (in6_are_prefix_equal): Move to net.cc. * fhandler_socket.cc: Define old SIOCGxxx values. (CONV_OLD_TO_NEW_SIO): Convert old SIOCGxxx value to new one. (struct __old_ifreq): Define old struct ifreq. (fhandler_socket::ioctl): Handle old SIOCGxxx values. Handle new SIOCGIFFRNDLYNAM command. Simplify copying ifreq data to user space. Call get_ifconf with additional SOCKET parameter. * net.cc (IP_ADAPTER_UNICAST_ADDRESS_LH): Define. (IP_ADAPTER_ADDRESSES_LH): Define. (SIO_GET_INTERFACE_LIST): Define. (sockaddr_in6_old): Define. (sockaddr_gen): Define. (INTERFACE_INFO): Define. (IN_LOOPBACK): Define. (in_are_prefix_equal): New static function. (ip_addr_prefix): New function, replaces prefix function, add AF_INET handling. (GAA_FLAG_INCLUDE_ALL_INTERFACES): Define. (get_adapters_addresses): New function. (WS_IFF_xxx): Define Winsock interface flag values. (convert_ifr_flags): New function to convert Winsock interface flag values to Cygwin interface flag values. (get_xp_ifconf): New get_ifconf implementation for XP SP1 and above. (get_2k_ifconf): Fix interface index. Fix formatting. (get_nt_ifconf): Fix formatting. (get_95_ifconf): Ditto. (get_ifconf): Take additional SOCKET parameter. Call get_xp_ifconf on XP SP1 and above. (if_nametoindex): New function. (if_indextoname): New function. (if_nameindex): New function. (if_freenameindex): New function. (in6_are_prefix_equal): Moved here from fhandler_procnet.cc. * wincap.cc (wincap_xp): Define has_gaa_prefixes as true by default. (wincapc::init): Assume has_osversioninfoex by default. Call GetVersionEx with OSVERSIONINFOEX first. Call with OSVERSIONINFO only if that fails. Simplify NT4 case and try to avoid strcmp. Check XP Service Pack using version.wServicePackMajor to avoid strcmp. * include/asm/socket.h (SIOCGIFFRNDLYNAM): Define. * include/cygwin/if.h: Fix formatting. (IFF_POINTTOPOINT): Define. (IFF_NOARP): Define. (IFF_LOWER_UP): Define. (IFF_DORMANT): Define. (struct if_nameindex): Define. (IFRF_FRIENDLYNAMESIZ): Define. (struct ifreq_frndlyname): Define. (IFNAMSIZ): Redefine as 44. (IF_NAMESIZE): Define. (struct ifreq): Redefine ifru_flags as int. Define ifru_data. Pad size to sizeof sockaddr_in6 for further extensions. (ifr_data): Define. (ifr_frndlyname): Define. (if_nametoindex): Declare. (if_indextoname): Declare. (if_nameindex): Declare. (if_freenameindex): Declare. * include/cygwin/version.h: Bump API minor number. (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ): Define check for old vs. new ifreq structure.
2007-01-16 * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFINDEX.Corinna Vinschen
* net.cc (get_2k_ifconf): Ditto. (get_nt_ifconf): Fake SIOCGIFINDEX. (get_95_ifconf): Ditto. (get_ifconf): Handle SIOCGIFINDEX. Fake it for loopback on systems not supporting IP Helper Lib. * include/asm/socket.h (SIOCGIFINDEX): Define. * include/cygwin/if.h (struct ifreq): Add member for interface index. (ifr_ifindex): Define.
2007-01-04 * fhandler_socket.cc (fhandler_socket::ioctl): Don't fake resultsCorinna Vinschen
for SIOCGIFFLAGS here. Call get_ifconf instead. * net.cc (get_2k_ifconf): Clean up code to generate interface name. Handle SIOCGIFFLAGS here. (get_nt_ifconf): Fake SIOCGIFFLAGS here. (get_95_ifconf): Ditto. (get_ifconf): Don't fake loopback on systems with IP Helper Lib. Set MTU for loopback to a more "modern" value.
2006-08-10revert erroneous checkinChristopher Faylor
2006-08-10* winsup.h: Turn on DEBUGGING by default for now.Christopher Faylor
2006-07-31 * fhandler_socket.cc (fhandler_socket::recv_internal): Fix a problemCorinna Vinschen
with poll(2) after shutdown(SHUT_RD) has been called on the local side. * poll.cc (poll): Use POSIX type nfds_t for second parameter. Drop special socket handling for POLLIN. Add comment to explain why. * include/sys/poll.h: Declare nfds_t. Use as type for second parameter in poll(2) declaration.
2006-07-31 * fhandler_socket.cc (fhandler_socket::evaluate_events): CircumventCorinna Vinschen
potential race condition. (fhandler_socket::recv_internal): Fix MSG_PEEK bug on blocking sockets and simplify recv loop. (fhandler_socket::send_internal): Only lock when changing wsock_events.
2006-07-28 * fhandler.h (struct wsa_event): Define here.Corinna Vinschen
(class fhandler_socket): Make wsock_evt private again. (fhandler_socket::wsock_event): New read accessor for wsock_evt. (fhandler_socket::serial_number): New read accessor to get the socket's serial number. (fhandler_socket::ready_for_read): Just return true. * fhandler_socket.cc (struct wsa_event): Move definition to fhandler.h. * select.cc (struct socketinf): Add serial number vector. (start_thread_socket): Identify duplicate sockets by their serial number, not (wrongly) by their wsock_evt.
2006-07-27 * fhandler_socket.cc: Revert misguided attempt to handle FD_CLOSE errorCorinna Vinschen
conditions in evaluate_events. (search_wsa_event_slot): Move wrongly placed memset in fhandler_socket::init_events here. (fhandler_socket::init_events): Initially set FD_WRITE event for connectionless sockets. * poll.cc (poll): Don't add sockets always to except_fds since select is now supposed to do it right. * select.cc (set_bits): Set connection state correctly for failed af_local_connect on local sockets. Remove socket special handling for except_selected descriptors. (peek_socket): Try to set the read/write/exception bits actually correctly.
2006-07-27 * fhandler_socket.cc (fhandler_socket::recvmsg): Remove unused totCorinna Vinschen
argument. All callers changed. (fhandler_socket::sendmsg): Likewise. * net.cc (cygwin_recvmsg): Likewise. (cygwin_sendmsg): Likewise, and prevent calling sendmsg whith an invalid iovec. * fhandler.h (fhandler_socket::recvmsg): Adjust prototype. (fhandler_socket::sendmsg): Likewise.
2006-07-27 * fhandler.h (class fhandler_socket): Remove prot_info_ptr.Corinna Vinschen
(fhandler_socket::fixup_before_fork_exec): Remove. (fhandler_socket::fixup_after_exec): Remove. (fhandler_socket::need_fixup_before): Remove. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop initializing prot_info_ptr. Remove unused code. (fhandler_socket::~fhandler_socket): Drop free'ing prot_info_ptr. (struct wsa_event): Rename connect_errorcode to errorcode. (fhandler_socket::evaluate_events): Handle FD_CLOSE error condition as FD_CONNECT error condition, except, never reset an FD_CLOSE error condition. Always set FD_WRITE after successfully recorded FD_CONNECT. (fhandler_socket::fixup_before_fork_exec): Remove. (fhandler_socket::fixup_after_fork): Revert to using handle duplication. (fhandler_socket::fixup_after_exec): Remove. (fhandler_socket::dup): Revert to using handle duplication. (fhandler_socket::send_internal): Only call wait_for_events in case of WSAEWOULDBLOCK condition. (fhandler_socket::set_close_on_exec): Call fhandler_base::set_close_on_exec. * net.cc (fdsock): Just set socket to inheritable on non-NT. Don't call inc_need_fixup_before. * select.cc (peek_socket): Don't set except_ready on every FD_CLOSE, just on error.
2006-07-252006-07-25 Corinna Vinschen <corinna@vinschen.de>Corinna Vinschen
* include/cygwin/version.h: Bump DLL version to 1.7.0. 2006-07-25 Corinna Vinschen <corinna@vinschen.de> * select.h: Remove. * fhandler_socket.cc: Don't include select.h. * select.cc: Ditto. 2006-07-25 Corinna Vinschen <corinna@vinschen.de> * cygtls.h: Drop socket related includes. (struct _local_storage): Remove exitsock and exitsock_sin. Add select_sockevt. * cygtls.cc: Accomodate above change throughout. * fhandler.h (class fhandler_socket): Make wsock_evt public. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Accomodate reordering members. (fhandler_socket::evaluate_events): Drop FD_CONNECT event as soon as it gets read once. Never remove FD_WRITE event here. (fhandler_socket::wait_for_events): Wait 50 ms instead of INFINITE for socket events. (fhandler_socket::accept): Fix conditional. Set wsock_events members of accepted socket to useful start values. (fhandler_socket::recv_internal): Always drop FD_READ/FD_OOB events from wsock_events after the call to WSARecvFrom. (fhandler_socket::send_internal): Drop FD_WRITE event from wsock_events if the call to WSASendTo fails with WSAEWOULDBLOCK. Fix return value condition. * select.cc (struct socketinf): Change to accomodate using socket event handling. (peek_socket): Use event handling for peeking socket. (thread_socket): Ditto. (start_thread_socket): Ditto. (socket_cleanup): Same here. * tlsoffsets.h: Regenerate. 2006-07-20 Corinna Vinschen <corinna@vinschen.de> * fhandler.h (class fhandler_socket): Rearrange slightly to keep event handling methods and members together. Drop owner status flag. Split wait method. Rename event handling methods for readability. * fhandler_socket.cc (struct wsa_event): Add owner field. (LOCK_EVENTS): New macro. (UNLOCK_EVENTS): Ditto. (fhandler_socket::init_events): rename from prepare. (fhandler_socket::evaluate_events): First half of former wait method. Do everything but wait. Allow specifiying whether or not events from event_mask should be erased from wsock_events->events. Simplify OOB handling. Allow sending SIGURG to any process (group). (fhandler_socket::wait_for_events): Second half of former wait method. Call evaluate_events and wait in a loop if socket is blocking. (fhandler_socket::release_events): Rename from release. (fhandler_socket::connect): Accomodate above name changes. (fhandler_socket::accept): Ditto. (fhandler_socket::recv_internal): Ditto. (fhandler_socket::send_internal): Ditto. (fhandler_socket::close): Ditto. (fhandler_socket::fcntl): Always set owner to given input value on F_SETOWN. Handle F_GETOWN. * net.cc (fdsock): Accomodate above name changes. 2006-07-20 Corinna Vinschen <corinna@vinschen.de> * fhandler_socket.cc (fhandler_socket::wait): Set Winsock errno to WSAEWOULDBLOCK instead of WSAEINPROGRESS. 2006-07-18 Brian Ford <Brian.Ford@FlightSafety.com> Corinna Vinschen <corinna@vinschen.de> * winsup.h (mmap_region_status): New enum. (mmap_is_attached_or_noreserve_page): Adjust prototype and rename as below. * mmap.cc (mmap_is_attached_or_noreserve_page): Rename mmap_is_attached_or_noreserve. Add region length parameter. Return enum above. * exceptions.cc (_cygtls::handle_exceptions): Accomodate above. * fhandler.cc (fhandler_base::raw_read): Call above for NOACCESS errors and retry on success to allow reads into untouched MAP_NORESERVE buffers. 2006-07-18 Corinna Vinschen <corinna@vinschen.de> * cygwin.din (posix_openpt): Export. * tty.cc (posix_openpt): New function. * include/cygwin/stdlib.h (posix_openpt): Declare. * include/cygwin/version.h: Bump API minor number. 2006-07-14 Corinna Vinschen <corinna@vinschen.de> * security.cc (get_token_group_sidlist): Always add the interactive group to the token. Add comment. Create logon_id group SID by copying it from incoming group list. (create_token): Add subauth_token parameter. Use information in subauth_token if present. Tweak SourceIdentifier if subauth_token is present for debugging purposes. * security.h (create_token): Add subauth_token parameter in declaration. * syscalls.cc (seteuid32): Call subauth first. Call create_token regardless. Use subauth token in call to create_token if subauth succeeded. 2006-07-13 Corinna Vinschen <corinna@vinschen.de> * include/netinet/in.h: Update copyright. 2006-07-13 Corinna Vinschen <corinna@vinschen.de> * fhandler_socket.cc (fhandler_socket::wait): Rework function so that WaitForMultipleObjects is really only called when necessary. 2006-07-12 Corinna Vinschen <corinna@vinschen.de> * include/netdb.h: Declare rcmd, rcmd_af, rexec, rresvport, rresvport_af, iruserok, iruserok_sa, ruserok. 2006-07-12 Corinna Vinschen <corinna@vinschen.de> * Makefile.in (DLL_OFILES): Drop iruserok.o. Add rcmd.o. * autoload.cc (rcmd): Drop definition. * cygwin.din: Export bindresvport, bindresvport_sa, iruserok_sa, rcmd_af, rresvport_af. * net.cc (cygwin_rcmd): Remove. (last_used_bindresvport): Rename from last_used_rrecvport. (cygwin_bindresvport_sa): New function implementing bindresvport_sa. (cygwin_bindresvport): New function implementing bindresvport. (cygwin_rresvport): Remove. * include/cygwin/version.h: Bump API minor number. * include/netinet/in.h: Declare bindresvport and bindresvport_sa. * libc/iruserok.c: Remove file. * libc/rcmd.cc: New file implementing rcmd, rcmd_af, rresvport, rresvport_af, iruserok_sa, iruserok and ruserok. 2006-07-12 Corinna Vinschen <corinna@vinschen.de> * fhandler_socket.cc (fhandler_socket::getsockname): Return valid result for unbound sockets. 2006-07-11 Corinna Vinschen <corinna@vinschen.de> * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Handle wsock_mtx and wsock_evt on fork, thus handling close_on_exec correctly. (fhandler_socket::fixup_after_exec): Drop misguided attempt to handle close_on_exec here. (fhandler_socket::dup): Call fixup_after_fork with NULL parent. Add comment. (fhandler_socket::set_close_on_exec): Handle wsock_mtx and wsock_evt. 2006-07-10 Corinna Vinschen <corinna@vinschen.de> * fhandler.h (class fhandler_socket): Add wsock_mtx, wsock_evt and wsock_events members. Remove closed status flag, add listener status flag. Accomodate new implementation of socket event handling methods. Declare recv* and send* functions ssize_t as the POSIX equivalents. (fhandler_socket::recv_internal): Declare. (fhandler_socket::send_internal): Ditto. * fhandler_socket.cc (EVENT_MASK): Define mask of selected events. (fhandler_socket::fhandler_socket): Initialize new members. (fhandler_socket::af_local_setblocking): Don't actually set the socket to blocking mode. Keep sane event selection. (fhandler_socket::af_local_unsetblocking): Don't actually set the socket to previous blocking setting, just remember it. (struct wsa_event): New structure to keep event data per shared socket. (NUM_SOCKS): Define number of shared sockets concurrently handled by all active Cygwin processes. (wsa_events): New shared datastructure keeping all wsa_event records. (socket_serial_number): New shared variable to identify shared sockets. (wsa_slot_mtx): Global mutex to serialize wsa_events access. (search_wsa_event_slot): New static function to select a new wsa_event slot for a new socket. (fhandler_socket::prepare): Rewrite. Prepare event selection per new socket. (fhandler_socket::wait): Rewrite. Wait for socket events in thread safe and multiple process safe. (fhandler_socket::release): Rewrite. Close per-socket descriptor mutex handle and event handle. (fhandler_socket::dup): Duplicate wsock_mtx and wsock_evt. Fix copy-paste error in debug output. (fhandler_socket::connect): Accomodate new event handling. (fhandler_socket::listen): Set listener flag on successful listen. (fhandler_socket::accept): Accomodate new event handling. (fhandler_socket::recv_internal): New inline method centralizing common recv code. (fhandler_socket::recvfrom): Call recv_internal now. (fhandler_socket::recvmsg): Ditto. Streamline copying from iovec to WSABUF. (fhandler_socket::send_internal): New inline method centralizing common send code. (fhandler_socket::sendto): Call send_internal now. (fhandler_socket::sendmsg): Ditto. Streamline copying from iovec to WSABUF. (fhandler_socket::close): Call release now. (fhandler_socket::ioctl): Never actually switch to blocking mode. Just keep track of the setting. * net.cc (fdsock): Call prepare now. (cygwin_connect): Revert again to event driven technique. (cygwin_accept): Ditto. * poll.cc (poll): Don't call recvfrom on a listening socket. Remove special case for failing recvfrom. * include/sys/socket.h: Declare recv* and send* functions ssize_t as requested by POSIX. 2006-07-07 Corinna Vinschen <corinna@vinschen.de> * net.cc (cygwin_inet_ntop): Fix data type of forth parameter. 2006-07-06 Corinna Vinschen <corinna@vinschen.de> * include/cygwin/in6.h (struct in6_addr): Fix typo. 2006-07-06 Corinna Vinschen <corinna@vinschen.de> * cygwin.din: Export in6addr_any, in6addr_loopback, freeaddrinfo, gai_strerror, getaddrinfo, getnameinfo. * fhandler_socket.cc: Include cygwin/in6.h. (get_inet_addr): Accomodate AF_INET6 usage. (fhandler_socket::connect): Ditto. (fhandler_socket::listen): Ditto. (fhandler_socket::sendto): Ditto. * net.cc: Include cygwin/in6.h. (in6addr_any): Define. (in6addr_loopback): Define. (cygwin_socket): Accomodate AF_INET6 usage. (socketpair): Bind socketpairs only to loopback for security. (inet_pton4): New static function. (inet_pton6): Ditto. (cygwin_inet_pton): New AF_INET6 aware inet_pton implementation. (inet_ntop4): New static function. (inet_ntop6): Ditto. (cygwin_inet_ntop): New AF_INET6 aware inet_ntop implementation. (ga_aistruct): New static function. (ga_clone): Ditto. (ga_echeck): Ditto. (ga_nsearch): Ditto. (ga_port): Ditto. (ga_serv): Ditto. (ga_unix): Ditto. (gn_ipv46): Ditto. (ipv4_freeaddrinfo): Ditto. (ipv4_getaddrinfo): Ditto. (ipv4_getnameinfo): Ditto. (gai_errmap_t): New structure holding error code - error string mapping. (cygwin_gai_strerror): New function implementing gai_strerror. (w32_to_gai_err): New static function. (get_ipv6_funcs): Ditto. (load_ipv6_funcs): Ditto. (cygwin_freeaddrinfo): New function implementing freeaddrinfo. (cygwin_getaddrinfo): New function implementing getaddrinfo. (cygwin_getnameinfo): New function implementing getnameinfo. * include/netdb.h: Include stdint.h and cygwin/socket.h. Define data types and macros used by getaddrinfo and friends. Declare freeaddrinfo, gai_strerror, getaddrinfo and getnameinfo. * include/cygwin/in.h: Add IPv6 related IPPROTOs. Remove definition of struct sockaddr_in6. Include cygwin/in6.h instead. * include/cygwin/in6.h: New header file defining IPv6 releated data types and macros. * include/cygwin/socket.h: Enable AF_INET6 and PF_INET6. Add IPv6 related socket options. * include/cygwin/version.h: Bump API minor number. 2006-07-06 Corinna Vinschen <corinna@vinschen.de> * autoload.cc (DsGetDcNameA): Define. (NetGetAnyDCName): Define. * security.cc: Include dsgetdc.h. (DsGetDcNameA): Declare. (DS_FORCE_REDISCOVERY): Define. (get_logon_server): Add bool parameter to control rediscovery of DC. Use DsGetDcNameA function if supported, NetGetDCName/NetGetAnyDCName otherwise. (get_server_groups): Rediscover DC if get_user_groups fails and try again. (get_reg_security): Use correct error code macro when testing RegGetKeySecurity return value. * security.h (get_logon_server): Remove default vaue from wserver parameter. Add rediscovery parameter. * uinfo.cc (cygheap_user::env_logsrv): Accomodate rediscovery parameter in call to get_logon_server.
2006-07-13 * fhandler_socket.cc: Update copyright.Corinna Vinschen
* include/pthread.h: Ditto.
2006-07-07 * fhandler_socket.cc (fhandler_socket::wait): Disable SA_RESTARTCorinna Vinschen
handling for now.
2006-07-05 * fhandler_socket.cc (fhandler_socket::listen): Allow listening onCorinna Vinschen
unbound INET socket.
2006-06-26 Revert patches from 2005-10-22 and 2006-06-14 to use event drivenCorinna Vinschen
accept and connect back to using select: * fhandler.h (class fhandler_socket): Remove accept_mtx. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop initializing accept_mtx. (fhandler_socket::accept): Drop event handling. (fhandler_socket.cc (fhandler_socket::connect): Ditto. (fhandler_socket::dup): Drop accept_mtx handling. (fhandler_socket::listen): Ditto. (fhandler_socket::prepare): Ditto. (fhandler_socket::release): Ditto. (fhandler_socket::close): Ditto. * net.cc (cygwin_accept): Revert to calling cygwin_select to implement interuptible accept. (cygwin_connect): Ditto for connect.
2006-06-15 * fhandler.h (class fhandler_socket): Add private mutex handleCorinna Vinschen
accept_mtx. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize accept_mtx to NULL. (fhandler_socket::dup): Duplicate accept_mtx, if available. (fhandler_socket::listen): Create accept_mtx before trying to listen. (fhandler_socket::prepare): Wait for accept_mtx if available to serialize accepts on the same socket. (fhandler_socket::release): Release accept_mtx. (fhandler_socket::close): Close accept_mtx on successful closesocket.
2006-05-28white spaceChristopher Faylor
2006-04-21 * fhandler_socket.cc (fhandler_socket::wait): Reorder settingCorinna Vinschen
WSAError to avoid spurious errors with WSAError set to 0.
2006-04-05* fhandler_socket.cc: Move iptypes.h include after winsock2 since it now reliesChristopher Faylor
on it. * net.cc: Ditto.
2006-02-06 * fhandler_socket.cc (fhandler_socket::connect): Fix formatting.Corinna Vinschen
(fhandler_socket::wait): Handle SA_RESTART when signal arrives.
2006-02-01 * autoload.cc (GetTcpTable): Define.Corinna Vinschen
* fhandler_socket.cc (address_in_use): New function to check if sockaddr_in address is already in use. (fhandler_socket::bind): Check if address is alreay in use in case of SO_REUSEADDR, to circumvent WinSock non-standard behaviour.
2006-01-29 * fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag.Corinna Vinschen
* fhandler_socket.cc (fhandler_socket::bind): Set socket to SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR socket option, on systems supporting SO_EXCLUSIVEADDRUSE. * net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag if SO_REUSEADDR socket option has been successsfully set. * wincap.h (wincaps::has_exclusiveaddruse): New element. * wincap.cc: Implement above element throughout.
2006-01-23 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): ResetCorinna Vinschen
inheritance for duplicated socket.
2006-01-20 * fhandler_socket.cc (fhandler_socket::prepare): Fix debug output.Corinna Vinschen
(fhandler_socket::release): Add debug output for WSAEventSelect failure. (fhandler_socket::ioctl): Always cancel WSAEventSelect before switching to blocking mode. Only set nonblocking flag if ioctlsocket call succeeded. Only print new socket state if ioctlsocket call succeeded.
2005-12-22whitespace cleanup to force snapshot.Christopher Faylor