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
2007-02-22 * fhandler.cc (fhandler_base::set_no_inheritance): Always useCorinna Vinschen
SetHandleInformation. * fhandler_disk_file.cc (fhandler_disk_file::lock): Always use UnlockFileEx/LockFileEx functions. * net.cc (fdsock): Don't bother to duplicate socket for inheritance. * sysconf.cc (get_nproc_values): Take NT for granted. (get_avphys): Ditto. * syslog.cc (WIN95_EVENT_LOG_PATH): Remove define. (get_win95_event_log_path): Remove. (vsyslog): Fix formatting. Take NT for granted. * wincap.cc: Remove has_lock_file_ex, has_signal_object_and_wait, has_eventlog, has_set_handle_information, has_set_handle_information_on_console_handles and supports_smp throughout. * wincap.h: Ditto.
2007-02-22 * fhandler.cc (fhandler_base::write): Remove wincap.has_lseek_bug case.Corinna Vinschen
Simplify seek beyond EOF case. * times.cc (times): Remove wincap.has_get_process_times case. * wincap.cc: Remove has_delete_on_close, has_page_guard, has_get_process_times and has_lseek_bug throughout. * wincap.h: Ditto.
2007-02-22 Throughout remove all usage of wincap.access_denied_on_delete.Corinna Vinschen
* dir.cc (rmdir): Add existance check to be errno-compatible with Linux. * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop test for non-existent dir on 9x share. * syscalls.cc (unlink): Add comment. * wincap.cc: Remove access_denied_on_delete flag throughout. * wincap.h: Ditto.
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-22 * Makefile.in (DLL_IMPORTS): Add libntdll.a.Corinna Vinschen
* autoload.cc: Remove all symbols from advapi32.dll, kernel32.dll and ntdll.dll available on all platforms since NT4. Throughout remove all usage of wincap.is_winnt. * dcrt0.cc (dll_crt0_0): Remove call to mmap_init. * fhandler.h (class fhandler_base): Remove has_changed flag. (fhandler_disk_file::touch_ctime): Remove declaration. (fhandler_disk_file::readdir_9x): Ditto. (fhandler_disk_file::touch_ctime): Remove. (fhandler_disk_file::readdir_9x): Remove. (fhandler_disk_file::closedir): Call NtClose instead of CloseHandle. * mmap.cc: Throughout call CreateMapping and MapView directly. (VirtualProt9x): Remove. (VirtualProtNT): Remove. (VirtualProtEx9x): Remove. (VirtualProtExNT): Remove. (VirtualProtect): Remove define. (VirtualProtectEx): Remove define. (CreateMapping9x): Remove. (CreateMappingNT): Rename to CreateMapping. (MapView9x): Remove. (MapViewNT): Rename to MapView. (struct mmap_func_t): Remove definition. (mmap_funcs_9x): Remove. (mmap_funcs_nt): Remove. (mmap_func): Remove. (mmap_init): Remove. * net.cc (getdomainname): Drop comment. Use NT4 registry key only. (get_95_ifconf): Remove. * pinfo.cc (winpids::enumNT): Rename to winpids::enum_processes. (winpids::enum9x): Remove. (winpids::set): Just call enum_processes directly. (winpids::enum_init): Ditto. * pinfo.h (class winpids): Drop enum_processes pointer. Rename enumNT to enum_processes. Drop enum9x declaration. Drop initialization of enum_processes throughout. * registry.cc (get_registry_hive_path): Just create NT key. (load_registry_hive): Only load NT specific file. * syscalls.cc (unlink_9x): Remove. (unlink): Just call unlink_nt. * wincap.cc: Remove is_winnt flag throughout. * wincap.h: Ditto. * winsup.h: Remove mmap_init declaration.
2007-02-21 * wincap.cc (wincap_unknown): Change settings for unknown to reflectCorinna Vinschen
the capabilities of NT4. (wincap_95): Remove. (wincap_95osr2): Remove. (wincap_98): Remove. (wincap_98se): Remove. (wincap_me): Remove. (wincap_nt3): Remove. (wincapc::init): Temporarily bail out on any 9x system.
2007-02-01 * net.cc (ga_dup): New function, taken from ga_clone with v4-in-v6Corinna Vinschen
mapping addition. (ga_clone): Just call ga_dup from here. (ga_duplist): New function to duplicate list of struct addrinfo. (ga_echeck): Don't check a_flags, it already happened in cygwin_getaddrinfo. (cygwin_freeaddrinfo): Always call ipv4_freeaddrinfo. (cygwin_getaddrinfo): Use new wincap.supports_all_posix_ai_flags flag rather than wincap.has_gaa_on_link_prefix. Always duplicate WinSock's addrinfo list to a self-allocated list. Handle AI_V4MAPPED for pre-Vista platforms supporting getaddrinfo. * wincap.h (wincapc::supports_all_posix_ai_flags): New element. * wincap.cc: Implement above element throughout. * include/netdb.h: Note how AI_ADDRCONFIG is not supported pre-Vista. Remove superfluous comment.
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-17 * Makefile.in (DLL_OFILES): Add fhandler_procnet.o.Corinna Vinschen
* autoload.cc (GetAdaptersAddresses): Define. * devices.h (FH_PROCNET): Define new device. * devices.in (dev_procnet_storage): Add "/proc/net" entry. * devices.cc: Regenerate. * dir.cc (readdir_worker): Use isproc_dev macro. * dtable.cc (build_fh_pc): Add FH_PROCNET. * fhandler.h (class fhandler_procnet): New class. * fhandler_proc.cc: Add "net" subdirectory handling. * fhandler_procnet.cc: New file handling "/proc/net" directory. * path.cc (isvirtual_dev): Move to path.h. * path.h (isproc_dev): New macro to identify /proc files by device. (isvirtual_dev): Moved here. Define using isproc_dev. * syscalls.cc (unlink): Use isproc_dev macro. * wincap.h (wincapc::has_gaa_prefixes): New element. (wincapc::has_gaa_on_link_prefix): New element. * wincap.cc: Implement above elements throughout. (wincapc::init): Check XP for service pack and set has_gaa_prefixes appropriately. * include/cygwin/in6.h: Include asm/byteorder.h.
2006-12-10 * autoload.cc (SHFileOperationA): Drop definition.Corinna Vinschen
* ntdll.h (struct _FILE_RENAME_INFORMATION): Define. * path.cc (fs_info::update): Note length of rootdir prefix in root_len. (get_nt_native_path): New function, taking over functionality of path_conv::get_nt_native_path. (path_conv::get_nt_native_path): Just call get_nt_native_path. * path.h (get_nt_native_path): Declare. (struct fs_info): New member root_len. (fs_info::length): New inline method returning root_len. (path_conv::rootdir): New inline method returning rootdir prefix. * syscalls.cc (try_to_bin): Rewrite using only system calls. (unlink_nt): Call try_to_bin with additional handle to open file parameter. (statvfs): Use path_conv::rootdir method. * wincap.h: Define has_recycle_dot_bin throughout. * wincap.cc: Ditto.
2006-12-06 * fhandler_mem.cc (fhandler_dev_mem::open): Fix comment.Corinna Vinschen
* wincap.cc (has_physical_mem_access): Reflect the fact that physical memory access has been made a protected operation beginning with 2003 Server.
2006-12-05 * dcrt0.cc (get_cygwin_startup_info): Fix comment.Corinna Vinschen
* wincap.cc (wincapc::init): Always reset needs_count_in_si_lpres2 to false on non 64-bit systems.
2006-12-05 * dcrt0.cc (get_cygwin_startup_info): Change zeros to DWORD array.Corinna Vinschen
Expect first DWORD in child_info struct being set to non-zero if wincap.needs_count_in_si_lpres2 is set. Add comment to explain why. * fork.cc (frok::parent): Set ch.zero[0] to a sensible count value if wincap.needs_count_in_si_lpres2 is set. * spawn.cc (spawn_guts): Ditto. Add filler bytes after ch on stack to accomodate needs_count_in_si_lpres2. * wincap.h: Define needs_count_in_si_lpres2 throughout. * wincap.cc: Ditto.
2006-11-27 * cyglsa.h: New header file.Corinna Vinschen
* environ.cc: Disable subauth settings. * grp.cc: Accomodate cygsidlist's count now being a method. * sec_helper.cc (SECURITY_MANDATORY_INTEGRITY_AUTHORITY): Remove. (mandatory_medium_integrity_sid): Remove. (mandatory_high_integrity_sid): Remove. (mandatory_system_integrity_sid): Remove. (fake_logon_sid): Add. (cygsid::get_sid): Add well_known parameter. Set well_known_sid accordingly. (cygsid::getfromstr): Ditto. (cygsidlist::alloc_sids): Move here from security.cc. (cygsidlist::free_sids): Ditto. (cygsidlist::add): Move here from security.h. Add well_known parameter. Set well_known_sid accordingly. Don't allow duplicate SIDs. * security.cc: Include cyglsa.h and cygwin/version.h. Throughout accomodate cygsidlist's count now being a method. Throughout drop redundant "contains" tests. (get_user_local_groups): Add local groups as well known SIDs. (get_token_group_sidlist): Add well known groups as well known SIDs. (get_server_groups): Ditto. Only call get_unix_group_sidlist after get_user_local_groups to maintain "well_known_sid" attribute. (get_initgroups_sidlist): Add well known groups as well known SIDs. (get_setgroups_sidlist): Add usersid and struct passwd parameter to allow calling get_server_groups from here. (get_system_priv_list): Make static. Return size of TOKEN_PRIVILEGES structure. (get_priv_list): Ditto. (create_token): Accomodate above changes. Drop misguided attempt to add MIC SIDs to created user token. Print returned token as hex value. (subauth): Disable. (lsaauth): New function implementing client side of LSA authentication. * security.h (class cygsid): Add well_known_sid attribute. Accomodate throughout. Add *= operator to create a well known SID. (class cygsidlist): Rename count to cnt. Make count a method. (cygsidlist::add): Move to sec_helper.cc. (cygsidlist::operator *=): New method to add well known SID. (cygsidlist::non_well_known_count): New method returning number of non well known SIDs in list. (cygsidlist::next_non_well_known_sid): New method returning next non well known SID by index. (mandatory_medium_integrity_sid): Drop declaration. (mandatory_high_integrity_sid): Drop declaration. (mandatory_system_integrity_sid): Drop declaration. (fake_logon_sid): Add declaration. (subauth): Disable declaration. (lsaauth): Add declaration. * syscalls.cc (seteuid32): Disable subauthentication. Add LSA authentication. * wincap.h: Define needs_logon_sid_in_sid_list throughout. * wincap.cc: Ditto.
2006-11-08 * sec_helper.cc (sid_auth): Remove.Corinna Vinschen
(well_known_this_org_sid): New well known sid. (SECURITY_MANDATORY_INTEGRITY_AUTHORITY): Define. (mandatory_medium_integrity_sid): New well known sid. (mandatory_high_integrity_sid): Ditto. (mandatory_system_integrity_sid): Ditto. (cygsid::get_sid): Use local SID_IDENTIFIER_AUTHORITY. Allow all authorities fitting in a UCHAR. * security.cc (get_token_group_sidlist): Always add the local group to the token. Add comment. Add "This Organization" group if available in incoming group list. (get_server_groups): Only add world and authenticated users groups if not already in list. (create_token): Add matching mandatory integrity SID to group list on systems supporting Mandatory Integrity Control. * security.h (well_known_this_org_sid): Define. (mandatory_medium_integrity_sid): Define. (mandatory_high_integrity_sid): Define. (mandatory_system_integrity_sid): Define. * wincap.h: Define has_mandatory_integrity_control throughout. * wincap.cc: Ditto.
2006-10-31 * cygheap.h (struct user_heap_info): Add slop member.Corinna Vinschen
* heap.cc (heap_init): Add slop factor to heap allocation. Add comment. * mmap.cc (MapViewNT): Allocate memory maps top down. (fhandler_dev_zero::mmap): Ditto. * shared.cc (shared_info::heap_slop_size): New method. (shared_info::heap_chunk_size): Don't use debug_printf at early stage. * shared_info.h (SHARED_INFO_CB): Accomodate change to shared_info. (CURR_SHARED_MAGIC): Ditto. (class shared_info): Add heap_slop member. Declare heap_slop_size. * wincap.h: Define heapslop throughout. * wincap.cc: Ditto.
2006-10-23 * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): AccomodateCorinna Vinschen
buggy RestartScan behaviour of Windows 2000. * wincap.h: Define has_buggy_restart_scan throughout. * wincap.cc: Ditto.
2006-03-16* cygheap.cc (init_cygheap::manage_console_count): Turn console control handlerChristopher Faylor
on/off depending on whether we have allocated a console or not. * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry statuses. (dll_crt0_0): Turn on/off console control depending on whether we have a controlling tty or not. * exceptions.cc (init_console_handler): Change BOOL to bool. * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic change. * winsup.h (init_console_handler): Reflect argument type change. * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate capability throughout. * wincap.cc: Ditto.
2006-03-13* dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a littleChristopher Faylor
later. Add a comment. * fork.cc (resume_child): Make void. (frok::parent): Only zero pi when necessary. Explicitly zero si. Set this_errno when child_copy fails. Accommodate change to resume_child. * sigproc.cc (sigalloc): Move global_sigs initialization here. (sigproc_init): Move global_sigs. (sig_send): Just check for flush signals once. * wincap.h: Define supports_setconsolectrlhandler_null throughout. * wincap.cc: Ditto.
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-28 * autoload.cc (NtQueryDirectoryFile): Define.Corinna Vinschen
* dir.cc (__opendir_with_d_ino): Just call opendir. (opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling. (readdir_worker): Only try generating d_ino if it's 0. Utilize namehash of directories fhandler. Call readdir_get_ino to generate d_ino for "..". (seekdir64): Keep dirent_set_d_ino flag. * fhandler.h (enum dirent_states): Add dirent_get_d_ino. (class fhandler_disk_file): Declare new private methods readdir_helper and readdir_9x. * fhandler_disk_file.cc (path_conv::hasgood_inode): New method to evaluate if a filesystem has reliable inode numbers. (fhandler_base::fstat_by_handle): Accomodate structure member name change from IndexNumber to FileId. (fhandler_base::fstat_helper): Call hasgood_inode here. (fhandler_disk_file::opendir): Call fhaccess only for real files. Don't append '*' to __d_dirname here, move to readdir_9x. On NT, open directory handle here. Set dirent_get_d_ino and dirent_set_d_ino flags according to wincap and filesystem. (fhandler_disk_file::readdir_helper): New method to implement readdir postprocessing only once. (readdir_get_ino_by_handle): New static function. (readdir_get_ino): New function to centralize inode number evaluation in case inode number hasn't been returned by NtQueryDirectoryFile. (fhandler_disk_file::readdir): Move old functionality to readdir_9x. Call readdir_9x when on 9x/Me. Implement NT specific readdir here. (fhandler_disk_file::readdir_9x): Move 9x specific readdir here. (fhandler_disk_file::seekdir): Accomodate new NT readdir method. (fhandler_disk_file::closedir): Ditto. (fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment. (fhandler_cygdrive::opendir): Call get_namehash to prepare later correct evaluation of d_ino. (fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate drive's d_ino by calling readdir_get_ino. * fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and dirent_saw_dot_dot to avoid seeing . and .. entries twice. * fhandler_process.cc (fhandler_process::readdir): Ditto. * fhandler_registry.cc (fhandler_registry::readdir): Ditto. * ntdll.h (STATUS_INVALID_PARAMETER): New define. (STATUS_INVALID_LEVEL): New define. (struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to FileId (as in Nebbitt). * path.h (path_conv::hasgood_inode): Now implemented in fhandler_disk_file.cc. * wincap.h (wincaps::has_fileid_dirinfo): New element. * wincap.cc: Implement above element throughout. * winsup.h (readdir_get_ino): Add declaration. * include/sys/dirent.h (struct dirent): Slightly rename structure members to accomodate changes. Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of __opendir_with_d_ino.
2006-01-13 * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS onCorinna Vinschen
Windows 2000 and above. Clarify the comment about IP_TOS and move to the place where the magic happens. (get_ifconf): Remove unused code. * wincap.h (wincaps::has_disabled_user_tos_setting): New element. * wincap.cc: Implement above element throughout.
2006-01-12 * Update copyrights.Corinna Vinschen
2006-01-10 * dcrt0.cc (dll_crt0_0): Remove call to wincap.init.Corinna Vinschen
* init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker. Call wincap.init here before doing anything else. Use wincap.is_wow64 to determine if we're running in a WOW64 emulator. * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's apparently not supported. (mmap64): Don't create mappings beyond EOF, which would need to use AT_ROUND_TO_PAGE, on WOW64. * wincap.cc (wincap): Throw into the .cygwin_dll_common section. (wincapc::init): Determine if running in WOW64 and set wow_64 flag. * wincap.h (class wincapc): Add wow64 member. (wincapc::is_wow64): New method.
2005-11-29 * autoload.cc (NtCreateSection): Define.Corinna Vinschen
* cygheap.cc (_csbrk): Call getpagesize instead of getshmlba. * dcrt0.cc (dll_crt0_0): Call mmap_init. * external.cc (cygwin_internal): Call getpagesize instead of getshmlba. * fhandler.h (fhandler_base::mmap): Change access to prot parameter. (fhandler_base::fixup_mmap_after_fork): Ditto. (fhandler_disk_file::mmap): Ditto. (fhandler_disk_file::fixup_mmap_after_fork): Ditto. (fhandler_dev_mem::mmap): Ditto. (fhandler_dev_mem::fixup_mmap_after_fork): Ditto. * fhandler_mem.cc (fhandler_dev_mem::write): Call getsystempagesize instead of getpagesize. (fhandler_dev_mem::read): Ditto. (fhandler_dev_mem::fstat): Ditto. (fhandler_dev_mem::mmap): Move to mmap.cc. (fhandler_dev_mem::munmap): Ditto. (fhandler_dev_mem::msync): Ditto. (fhandler_dev_mem::fixup_mmap_after_fork): Ditto. * fhandler_proc.cc (format_proc_meminfo): Call getsystempagesize instead of getpagesize. * fhandler_process.cc (format_process_stat): Ditto. (format_process_status): Ditto. (get_mem_values): Ditto. * mmap.cc: Fix formatting. Try to make more readable and modular. Take advantage of pagesize==granularity. (gen_protect): New static function to evaluate Windows protection bits from POSIX protection and flags. (gen_access): Ditto for Windows access mode. (VirtualProt9x): Wrapper function to call VirtualProtect on 9x. (VirtualProtNT): Ditto for NT. (VirtualProtEx9x): Ditto for VirtualProtectEx on 9x. (VirtualProtExNT): Ditto for NT. (CreateMapping9x): Wrapper function for creating a mapping handle on 9x. (CreateMappingNT): Ditto for NT. (MapView9x): Wrapper function to map a view on 9x. (MapViewNT): Ditto for NT. (mmap_funcs_9x): Structure containing function pointers to wrapper functions for 9x. (mmap_funcs_nt): Ditto for NT. (mmap_func): Pointer to wrapper functions used in subsequent code. (mmap_init): Initialize mmap_func depending on OS. (class mmap_record): Use sensible member names. Add POSIX protection member. Drop Windows access flags member. Constify more methods. Use accessors instead of direct member access inside of own methods. (mmap_record::gen_protect): Class wrapper to evaluate matching Windows protection bits. (mmap_record::gen_access): Ditto for Windows access flags. (mmap_record::compatible_flags): New function to check if flags are compatible with flags of existing map. (list::add_record): Drop offset and length arguments. (class map): Change counters to unsigned. Match usage throughout. (mmapped_areas): Convert from pointer to global struct. (mmap_record::alloc_page_map): Simplify. (mmap_record::map_pages): Ditto. (mmap_record::fixup_page_map): Delete. (mmap64): Simplify. Add workaround for Windows 98 bug. Fix bug on NT that existing anonymous mappings weren't searched for a match. (munmap): Add workaround for Windows 98 bug. (msync): Simplify. (mprotect): Handle existing maps correctly. (mlock): Add local pagesize variable and enlightening comment. (fhandler_disk_file::mmap): Main functionality now in CreateMapping/ MapView wrapper functions. (fhandler_disk_file::fixup_mmap_after_fork): Call MapView wrapper. (fhandler_dev_mem::mmap): Moved from fhandler_mem.cc. Simplify by calling MapViewNT. (fhandler_dev_mem::munmap): Moved from fhandler_mem.cc. (fhandler_dev_mem::msync): Ditto. (fhandler_dev_mem::fixup_mmap_after_fork): Ditto. Call MapViewNT. (fixup_mmaps_after_fork): Restructure and hopefully speed up loop for setting protection and memory content on MAP_PRIVATE maps. * ntdll.h (AT_ROUND_TO_PAGE): Remove define. (AT_EXTENDABLE_FILE): Add define. (NtCreateSection): Add prototype. * syscalls.cc (getpagesize): Return granularity as pagesize now. (getsystempagesize): New function to retrieve "real" pagesize. (getshmlba): Delete since it's replaced by getpagesize now. * wincap.h (wincaps::has_mmap_alignment_bug): New element. * wincap.cc: Implement above element throughout. * winsup.h (getshmlba): Drop prototype. (getsystempagesize): Add prototype. (mmap_init): Ditto. * include/sys/mman.h: (Not yet) define MAP_NORESERVE.
2005-10-18 * autoload.cc (NtLockVirtualMemory): Import.Corinna Vinschen
(NtUnlockVirtualMemory): Import. (GetProcessWorkingSetSize): Import. (SetProcessWorkingSetSize): Import. * cygwin.din (mlock): Export. (munlock): Export. * mmap.cc (mlock): New function. (munlock): Ditto. * ntdll.h (STATUS_WORKING_SET_QUOTA): Define. (LOCK_VM_IN_WSL): Define. (LOCK_VM_IN_RAM): Define. (NtLockVirtualMemory): Declare. (NtUnlockVirtualMemory): Declare. * sysconf.cc (sysconf): Implement _SC_MEMLOCK_RANGE. * wincap.h: Implement has_working_virtual_lock throughout. * wincap.cc: Ditto. * include/cygwin/version.h: Bump API minor version. * include/sys/mman.h (mlock): Declare, (munlock): Declare.
2005-09-28 * fhandler.h (class fhandler_dev_raw): Delete current_position andCorinna Vinschen
eof_detected status flag. Delete is_eom and is_eof methods. Move drive_size, bytes_per_sector, eom_detected status flag, as well as the methods read_file, write_file, raw_read and raw_write to ... (class fhandler_dev_floppy): ... here. Remove is_eom and is_eof methods. Add dup method. * fhandler_floppy.cc (IS_EOM): New macro. (fhandler_dev_floppy::is_eom): Remove. (fhandler_dev_floppy::is_eof): Remove. (fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags. (fhandler_dev_floppy::get_drive_info): Only call EX functions on systems supporting them and stop suffering strange delays. (fhandler_dev_floppy::read_file): Move here, drop setting current_position. (fhandler_dev_floppy::write_file): Move here, drop setting current_position. (fhandler_dev_floppy::open): Rearrange comment. (fhandler_dev_floppy::dup): New method. (fhandler_dev_floppy::get_current_position): New inline method. Use instead of former current_position were appropriate. (fhandler_dev_floppy::raw_read): Move here. Drop EOF handling. (fhandler_dev_floppy::raw_write): Move here. Drop EOF handling. (fhandler_dev_floppy::lseek): Remove useless conditions. Convert sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call. (fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case to here. * fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove. (fhandler_dev_raw::is_eof): Remove. (fhandler_dev_raw::write_file): Remove. (fhandler_dev_raw::read_file): Remove. (fhandler_dev_raw::raw_read): Remove. (fhandler_dev_raw::raw_write): Remove. (fhandler_dev_raw::dup): Drop copying removed members. (fhandler_dev_raw::ioctl): Drop blocksize testing. * wincap.h: Implement has_disk_ex_ioctls throughout. * wincap.cc: Ditto. (wincap_vista): Preliminary wincaps for Windows Vista/Longhorn. (wincapc::init): Add Vista/Longhorn handling.
2005-09-28 Revert erroneous checkin.Corinna Vinschen
2005-09-28 * fhandler.h (class fhandler_dev_raw): Delete current_position andCorinna Vinschen
eof_detected status flag. Delete is_eom and is_eof methods. Move drive_size, bytes_per_sector, eom_detected status flag, as well as the methods read_file, write_file, raw_read and raw_write to ... (class fhandler_dev_floppy): ... here. Remove is_eom and is_eof methods. Add dup method. * fhandler_floppy.cc (IS_EOM): New macro. (fhandler_dev_floppy::is_eom): Remove. (fhandler_dev_floppy::is_eof): Remove. (fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags. (fhandler_dev_floppy::get_drive_info): Only call EX functions on systems supporting them and stop suffering strange delays. (fhandler_dev_floppy::read_file): Move here, drop setting current_position. (fhandler_dev_floppy::write_file): Move here, drop setting current_position. (fhandler_dev_floppy::open): Rearrange comment. (fhandler_dev_floppy::dup): New method. (fhandler_dev_floppy::get_current_position): New inline method. Use instead of former current_position were appropriate. (fhandler_dev_floppy::raw_read): Move here. Drop EOF handling. (fhandler_dev_floppy::raw_write): Move here. Drop EOF handling. (fhandler_dev_floppy::lseek): Remove useless conditions. Convert sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call. (fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case to here. * fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove. (fhandler_dev_raw::is_eof): Remove. (fhandler_dev_raw::write_file): Remove. (fhandler_dev_raw::read_file): Remove. (fhandler_dev_raw::raw_read): Remove. (fhandler_dev_raw::raw_write): Remove. (fhandler_dev_raw::dup): Drop copying removed members. (fhandler_dev_raw::ioctl): Drop blocksize testing. * wincap.h: Implement has_disk_ex_ioctls throughout. * wincap.cc: Ditto. (wincap_vista): Preliminary wincaps for Windows Vista/Longhorn. (wincapc::init): Add Vista/Longhorn handling.
2005-06-30* cygerrno.h: Make multi-inclusion safe.Christopher Faylor
* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Deal with EINTR. * dcrt0.cc (dll_crt0_0): Accommodate init_console_handler argument change. * winsup.h: Ditto. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * exceptions.cc (init_console_handler): Ditto. Ignore console events if we're not attached to a terminal. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * wincap.cc: Implement has_null_console_handler_routine throughout. * wincap.h: Ditto.
2005-06-18* wincap.h (wincaps::detect_win16_exe): Declare.Christopher Faylor
(wincapc::detect_win16_exe): Implement. * wincap.cc: Populate detect_win16_exe where appropriate. * spawn.cc (spawn_guts): Only go out of the way to detect 16-bit apps on systems which are flummoxed by them.
2005-04-12 Revert previous patch.Corinna Vinschen
* autoload.cc (GetVolumePathNamesForVolumeNameA): Remove. * autoload.cc (GetVolumeNameForVolumeMountPointA): Add. * syscalls.cc (sync): Rewrite guid case to skip floppies also on Windows 2000.
2005-04-12 * syscalls.cc (sync): Use renamed has_get_volume_pathnames wincap.Corinna Vinschen
* wincap.h (wincaps::has_get_volume_pathnames): Rename from has_guid_volumes * wincap.cc: Accomodate above rename throughout. Set to false on Windows 2000.
2005-02-28 * fhandler.h (class fhandler_socket): Declare new methodCorinna Vinschen
set_socketpair_eids. * fhandler_socket.cc (fhandler_socket::set_socketpair_eids): New method. (fhandler_socket::dup): Duplicate sec_pipe if necessary. (fhandler_socket::listen): Only create sec_pipe if named pipes are available. Initialized sec_peer_pid to 0 as on Linux. (fhandler_socket::connect): Only run eid credential transaction if named pipes are available. Fake otherwise. Initialized sec_peer_pid to 0 as on Linux. (fhandler_socket::accept): Ditto. (fhandler_socket::close): Move closing sec_pipe handle from here... (fhandler_socket::~fhandler_socket): ... to here. * net.cc (socketpair): Set eid credentials by calling fhandler_socket::set_socketpair_eids() on both socket ends. * wincap.h (wincaps::has_named_pipes): New element. * wincap.cc: Implement above element throughout.
2005-02-20 * autoload.cc (FindFirstVolumeA): Add.Corinna Vinschen
(FindNextVolumeA): Add. (FindVolumeClose): Add. (GetVolumePathNamesForVolumeNameA): Add. * fhandler.h (class fhandler_base): Declare new method fsync. * fhandler.cc (fhandler_base::fsync): New method. * syscalls.cc (fsync): Move functionality into fhandler method fsync. Just call this method from here. (sync_worker): New static function. (sync): Fill with life for NT systems. * wincap.h (wincaps::has_guid_volumes): New element. * wincap.cc: Implement above element throughout.
2005-02-20copyrightChristopher Faylor
2005-01-26 * cygwin.din: Export getpriority and setpriority.Corinna Vinschen
* fork.cc (fork_parent): Copy parent's nice value into child. * spawn.cc (spawn_guts): Ditto. * miscfuncs.cc (winprio_to_nice): New function. (nice_to_winprio): Ditto. * pinfo.cc (pinfo_init): If parent is not a Cygwin process, set default nice value according to current Win32 priority class. * pinfo.h (class _pinfo): Add nice member. * syscalls.cc (setpriority): New function, only implementing PRIO_PROCESS for now. (getpriority): Ditto. (nice): Just call setpriority. * wincap.h (wincaps::has_extended_priority_class): New element. * wincap.cc: Implement above element throughout. * winsup.h: Add prototypes for winprio_to_nice and nice_to_winprio. * include/limits.h (NZERO): New define. * include/cygwin/types.h (id_t): New datatype. * include/cygwin/version.h: Bump API minor version. * include/sys/resource.h: Add PRIO_XXX defines and prototypes for getpriority and setpriority.
2004-12-28* cygthread.cc (cygthread::stub): Add better debug output.Christopher Faylor
(cygthread::cygthread): Ditto. (cygthread::terminate_thread): Ditto. Move inuse test earlier or suffer infinite loop. * pinfo.cc (_pinfo::dup_proc_pipe): Close handle if DuplicateHandle fails and process no longer exists. * spawn.cc (spawn_guts): Create process in suspended state if OS demands it. * wincap.cc: Add "start_proc_suspended" throughout. * wincap.h (wincaps): Ditto. (wincapc): Ditto.
2004-05-28* path.cc (chdir): Always use the normalized_path as posix_cwd, except if itChristopher Faylor
starts with a drive. Also perform whitespace cleanup.
2004-03-14 * errno.cc (errmap): Map ERROR_BEGINNING_OF_MEDIA andCorinna Vinschen
ERROR_SETMARK_DETECTED to EIO instead of ESPIPE. Handle ERROR_FILEMARK_DETECTED. * fhandler_tape.cc (TAPE_FUNC): Add comment that ERROR_BUS_RESET has still to be handled correctly. (fhandler_dev_tape::open): Accomodate fact that get.mt_dsreg also contains density code. (fhandler_dev_tape::ioctl): Rearrange slightly. Reset devbuf also on MTNOP, MTWSM, MTSETBLK, MTSETDRVBUFFER, MTSETPART and MTMKPART. (fhandler_dev_tape::tape_set_pos): Rearrange. Match behaviour to the Linux tape driver. (fhandler_dev_tape::tape_status): Call IOCTL_STORAGE_GET_MEDIA_TYPES_EX if available. Return device type and density code in appropriate mtget members. * wincap.h (wincaps::has_ioctl_storage_get_media_types_ex): New element. * wincap.cc: Implement above element throughout. * include/cygwin/mtio.h: Add tape device types as returned by IOCTL_STORAGE_GET_MEDIA_TYPES_EX. (MT_TAPE_INFO): Use above type codes. (struct mtget): Change mt_dsreg comment.
2004-02-09* debug.h (console_printf): Define for non-debugging condition.Christopher Faylor
* cygtls.h (_threadinfo::lock): Remove wait argument. (_threadinfo::interrupt_setup): Remove retaddr argument. * exceptions.cc (_threadinfo::interrupt_setup): Ditto. (_threadinfo::interrupt_now): Accommodate change to interrupt_setup argument. (setup_handler): Ditto. Always lock sig stack prior to determining interrupt method. * gendef (_sigfe): Correct thinko regarding cmpxchg. (_sigbe): Ditto. (_threadinfo::lock): Ditto. (_threadinfo::pop): Eliminate left-over stack unlock. * sigproc.cc (proc_subproc): Chnage debugging output to printed warning.
2004-01-20* sigproc.cc (sigproc_terminate): Don't close sendsig handle when execing sinceChristopher Faylor
we're not closing what we think we're closing. (sig_send): Improve debugging when exiting due to no_signals_available. * wincap.h (wincaps::cant_debug_dll_entry): New element. * wincap.cc: Implement above element throughout. * dcrt0.cc (initial_env): Accommodate changes necessary to allow initial debugging for systems which do not allow debugging in dll_entry. (dll_crt0_0): Add initial_env call back here. * Makefile.in (install-man): Use mandir as target for installation. * include/cygwin/version.h: Bump DLL minor number to 7 (should have been done earlier).
2003-12-03 Substitute 0x7fffffff and 0xffffffff by INT32_MAX and UINT32_MAXCorinna Vinschen
throughout, except in assembler code.
2003-09-27 * wincap.cc (wincapc::init): Allow requesting server info for NT4 SP6.Corinna Vinschen
2003-09-27* Makefile.in: Add libusr32.a to DLL_IMPORTS.Christopher Faylor
* wincap.h (wincaps::is_server): New flag. (wincapc::version): Change type to OSVERSIONINFOEX. (wincapc::is_server): New function. * wincap.cc (wincap_unknown::is_server): New initializer. (wincap_95): Ditto. (wincap_95osr2): Ditto. (wincap_98): Ditto. (wincap_me): Ditto. (wincap_nt3): Ditto. (wincap_nt4): Ditto. (wincap_nt4sp4): Ditto. (wincap_2000): Ditto. (wincap_xp): Ditto. (wincapc::init): Adapt to OSVERSIONINFOEX. Add detection of NT server systems. * sched.cc: Include windows.h and registry.h. (sched_rr_get_interval): Re-implement for NT systems.
2003-08-28* syscalls.cc (mount): Don't check win32_path when doing cygdrive mount.Christopher Faylor
2003-07-26* exceptions.cc (ctrl_c_handler): Send SIGHUP when events occur only if thereChristopher Faylor
is a tty associated with the process. Send SIGHUP on CTRL_LOGOFF_EVENT. * fhandler_tty.cc (fhandler_tty_slave::open): Adjust console open handle counter regardless of whether this is a pty or tty. (fhandler_tty_slave::open): Ditto. (fhandler_tty_slave::dup): Ditto. (fhandler_tty_common::set_close_on_exec): Ditto. (fhandler_tty_master::init_console): Decrement console open handle counter after init since it will now be handled by all tty open. * syscalls.cc (setsid): Rework debugging output slightly.
2003-05-20 * fhandler_socket.cc (SECRET_EVENT_NAME): Remove.Corinna Vinschen
(ENTROPY_SOURCE_NAME): Ditto. (secret_event_name): New static function. Create shared event name with "Global\" prefix on systems supporting terminal services. (fhandler_socket::set_connect_secret): Fix conditional. (fhandler_socket::create_secret_event): Create secret event using secret_event_name(). (fhandler_socket::close_secret_event): Ditto. * shared.cc (shared_name): Create shared object name with "Global\" prefix on systems supporting terminal services. * wincap.cc: Set has_terminal_services capability throughout. (wincap_2003): New global object representing Windows 2003 Server capabilities. (wincapc::init): Accomodate Windows 2003 Server. * wincap.h (struct wincaps): Add has_terminal_services capability.
2003-04-20* wincap.h (wincaps:pty_needs_alloc_console): New element.Christopher Faylor
(wincapc:pty_needs_alloc_console): New function. * wincap.cc: Add pty_needs_alloc_console throughout. * fhandler_tty.cc (fhandler_tty_slave::open): Open an "invisible" console on first pty allocation.
2003-02-20 * wincap.h (wincap): Remove unnecessary definition ofCorinna Vinschen
supports_sparse_files. * wincap.cc: Ditto.