Commit Graph

8613 Commits

Author SHA1 Message Date
Yaakov Selkowitz 162deed595 * thread.cc (pthread_setschedprio): New function.
* include/pthread.h (pthread_setschedprio): Declare.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* cygwin.din (pthread_setschedprio): Export.
* posix.sgml (std-notimpl) Move pthread_setschedprio from here...
(std-susv4) ...to here.
2011-04-15 09:22:14 +00:00
Jon TURNEY cc00d3deb9 2011-04-12 Jon TURNEY <jon.turney@dronecode.org.uk>
* utils.sgml (strace): Fix a pair of exchanged lines in usage text.
2011-04-13 11:42:43 +00:00
Yaakov Selkowitz 2f4d0818b3 * new-features.sgml (ov-new1.7.10): Document /proc/swaps. 2011-04-11 02:10:35 +00:00
Yaakov Selkowitz 5f6d028db2 * fhandler_proc.cc (proc_tab): Add /proc/swaps virtual file.
(format_proc_swaps): New function.
2011-04-11 02:09:43 +00:00
Christopher Faylor 30a4f5b696 * Makefile.in: Move srcdir definition before others which uses it. 2011-04-07 06:07:21 +00:00
Christopher Faylor 8d777a13fc * dll_init.cc (reserve_at, release_at): New functions.
(load_after_fork): If the DLL was loaded higher than the required address,
assume that it loaded at it's base address and also reserve memory there to
force it to be relocated.
2011-04-06 13:58:00 +00:00
Yaakov Selkowitz ddebf19a2a * include/cygwin/types.h: Move #include <sys/sysmacros.h> to
end of header so that it gets the dev_t typedef.
* include/sys/sysmacros.h (gnu_dev_major, gnu_dev_minor,
gnu_dev_makedev): Prototype and define as inline functions.
(major, minor, makedev): Redefine in terms of gnu_dev_*.
2011-04-05 00:53:17 +00:00
Yaakov Selkowitz 8b09538c94 * include/cygwin/types.h: Move multiple inclusion guards to
beginning and end of header.
2011-04-05 00:50:19 +00:00
Christopher Faylor 3649c742cb * Makefile.in: Move Makefile.common include earlier to fix problems with
relative ${srcdir} path which confuses make.
2011-04-04 15:01:43 +00:00
Corinna Vinschen 708293f94e * new-features.sgml (ov-new1.7.10): Document dropped NT4 support. 2011-04-04 12:25:37 +00:00
Corinna Vinschen 6ce541281e Drop NT4 support.
* autoload.cc (DnsQuery_A): Fatal if not available.
	(DnsRecordListFree): Ditto.
	(DsGetDcNameW): Ditto.
	(NetGetAnyDCName): Remove.
	(NetGetDCName): Remove.
	(EnumProcessModules): Fatal if not available.
	(GetModuleFileNameExW): Ditto.
	(GetModuleInformation): Ditto.
	(GetProcessMemoryInfo): Ditto.
	(QueryWorkingSet): Ditto.
	(LsaRegisterLogonProcess): Ditto.
	* fenv.cc (_feinitialise): Drop supports_sse condition.
	* fhandler_disk_file.cc (path_conv::isgood_inode): Fix comment.
	(fhandler_base::fstat_by_name): Drop has_fileid_dirinfo condition.
	(fhandler_disk_file::opendir): Ditto.
	* fhandler_netdrive.cc (fhandler_netdrive::readdir): Fix comment.
	* fhandler_proc.cc (format_proc_partitions): Drop NT4-only code.
	* fhandler_process.cc (get_process_state): Ditto.
	* kernel32.cc (GetWindowsDirectoryW): Remove.
	(GetWindowsDirectoryA): Remove.
	* miscfuncs.cc (nice_to_winprio): Drop NT4-only code.
	* mount.cc (fs_info::update): Fix comments.
	* net.cc (get_2k_ifs): Drop NT4-only code.
	* sec_auth.cc (get_logon_server): Ditto.
	(lsaauth): Drop NT4-specific error handling.
	* security.cc (alloc_sd): Set SE_DACL_PROTECTED unconditionally.
	* select.cc (select_stuff::wait): Always use MWMO_INPUTAVAILABLE.
	(peek_windows): Drop NT4-only condition in call to PeekMessage.
	* syscalls.cc (gethostid): Remove NT4-only workaround.
	* wincap.cc: Througout, drop has_dacl_protect,
	has_broken_if_oper_status, has_process_io_counters,
	has_terminal_services, has_extended_priority_class, has_guid_volumes,
	has_fileid_dirinfo, has_mwmo_inputavailable and supports_sse from
	wincaps.
	(wincap_nt4sp4): Remove.
	(wincap_minimal): Set to wincap_2000.
	(wincapc::init): Rely on availability of OSVERSIONINFOEX structure.
	Treat error from GetVersionEx as fatal.  Treat NT4 as fatal.
	* wincap.h (struct wincaps): Drop has_dacl_protect,
	has_broken_if_oper_status, has_process_io_counters,
	has_terminal_services, has_extended_priority_class, has_guid_volumes,
	has_fileid_dirinfo, has_mwmo_inputavailable and supports_sse flags
	and methods.
	* winlean.h (GetWindowsDirectoryW) Define as GetSystemWindowsDirectoryW.
	(GetWindowsDirectoryA): Define as GetSystemWindowsDirectoryA.
2011-04-04 12:23:36 +00:00
Corinna Vinschen 02dbd9ae87 * dtable.cc (dtable::init_std_file_from_handle): Fix a comment to
reflect the current state.
2011-04-04 11:24:20 +00:00
Yaakov Selkowitz 43a6063156 * new-features.sgml (ov-new1.7.10): Document additional information
in /proc/version.
2011-04-04 11:14:20 +00:00
Yaakov Selkowitz a2ef34bfd8 * Makefile.in (fhandler_proc_CFLAGS): Define USERNAME, HOSTNAME,
and GCC_VERSION.
* fhandler_proc.cc (format_proc_version):  Add build machine and GCC
version information as on Linux.
2011-04-04 11:12:48 +00:00
Yaakov Selkowitz 26968b5c05 * devices.h (fh_devices): Define FH_PROC_MIN_MINOR.
Reorder major-0 devices so that all /proc directories fall
between FH_PROC and FH_PROC_MIN_MINOR.
* path.h (isproc_dev): Redefine accordingly.
2011-04-04 10:14:27 +00:00
Corinna Vinschen 3f7dfed9e9 * include/winnt.h (DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS): Add. 2011-04-04 09:10:41 +00:00
Corinna Vinschen ff73fd1ec1 * passwd.c (main): Add the ability to specify a username for the -R
command.
	* utils.sgml: Document the aforementioned change.
2011-04-04 09:09:43 +00:00
Corinna Vinschen 1db2e3fbfb * cygserver_setpwd.h (setlsapwd): Add username parameter to declaration.
* external.cc (cygwin_internal): In the CW_SET_PRIV_KEY case, fetch
	additional username parameter.
	* setlsapwd.cc (setlsapwd): Add username parameter.  Allow admin to
	set the hidden password for other users.
2011-04-04 09:04:00 +00:00
Corinna Vinschen 225b37131a Add ChangeLog missing in previous checkin 2011-04-04 09:00:53 +00:00
Corinna Vinschen 99edadedc9 * sec_auth.cc (get_user_groups): Mark well-known groups as well-known.
(get_user_local_groups): Ditto.
	(verify_token): Drop useless label.
	* sec_helper.cc (cygsid::get_sid): Check for well-known SID if
	well_known isn't set.
	* security.h (well_known_sid_type): New inline function.
2011-04-04 09:00:02 +00:00
Corinna Vinschen 0d6f2b0117 * autoload.cc (FindFirstVolumeA): Remove.
(FindNextVolumeA): Remove.
	(FindVolumeClose): Remove.
	(GetVolumeNameForVolumeMountPointA): Remove.
	* ntdll.h (NtFlushBuffersFile): Declare.
	* syscalls.cc (sync_worker): Rewrite using native NT functions.
	(sync): Ditto.
2011-04-02 11:43:43 +00:00
Corinna Vinschen 8a5e2a62da * fhandler_proc.cc (format_proc_partitions): Express length in WCHAR
size.
2011-04-02 11:32:55 +00:00
Corinna Vinschen bb8216a114 * autoload.cc (GetExtendedTcpTable): Remove.
(GetTcpTable): Remove.
	(CharNextExA): Remove.
	(FindWindowA): Remove.
	(ShowWindowAsync): Remove.
	* dcrt0.cc (disable_dep): Remove unused function.
	(dll_crt0_0): Drop comment babbling about TS & DEP.
	* fhandler_socket.cc (address_in_use): Remove unused function.
	* wincap.cc: Throughout, drop ts_has_dep_problem from wincaps.
	(wincapc::init): Drop code setting ts_has_dep_problem flag.
	* wincap.h (struct wincaps): Drop ts_has_dep_problem flags and method.
2011-04-02 11:30:27 +00:00
Christopher Faylor e9b55002ba update copyright 2011-04-01 20:41:32 +00:00
Yaakov Selkowitz 15f0d50006 * new-features.sgml (ov-new1.7.10): Document /proc/sysvipc/. 2011-04-01 19:49:16 +00:00
Yaakov Selkowitz d68288f697 Implement /proc/sysvipc/*
* devices.in (dev_procsysvipc_storage): Add.
* devices.cc: Regenerate.
* devices.h (fh_devices): Add FH_PROCSYSVIPC.
* dtable.cc (build_fh_pc): Add case FH_PROCSYSVIPC.
* fhandler.h (class fhandler_procsysvipc): Declare.
(fhandler_union): Add __procsysvipc.
* fhandler_proc.cc (proc_tab): Add sysvipc virt_directory.
* fhandler_procsysvipc.cc: New file.
* Makefile.in (DLL_OFILES): Add fhandler_procsysvipc.o.
* path.h (isproc_dev): Add FH_PROCSYSVIPC to conditional.
2011-04-01 19:48:19 +00:00
Corinna Vinschen 06e21b9cb1 * Makefile.in (DLL_OFILES): Add avapi32.o.
* advapi32.cc: New file.
	* autoload.cc: Add block of remaining advapi32 functions used by
	Cygwin.  Keep commented out.  Explain why.
2011-04-01 12:46:09 +00:00
Yaakov Selkowitz 8e68bbe724 * new-features.sgml (ov-new1.7.10): /proc/loadavg now shows
current running/total processes count.
2011-04-01 09:01:47 +00:00
Yaakov Selkowitz 9ca65531e0 * fhandler_proc.cc (format_proc_loadavg): Add running/total
processes as fourth component of output.
* fhandler_process.cc (get_process_state): Make non-static.
Add FIXME about generating an 'O' flag.
2011-04-01 09:00:21 +00:00
Corinna Vinschen 40afcae356 * fhandler_random.cc (fhandler_dev_random::crypt_gen_random):
Use CryptAcquireContextW.
	* ntdll.h (STATUS_PROCEDURE_NOT_FOUND): Define.
	* sec_auth.cc (open_local_policy): Rename NTSTATUS variable ret to
	status.  Drop usage of LsaNtStatusToWinError.
	(verify_token): Call NtQuerySecurityObject instead of
	GetKernelObjectSecurity.
	(create_token): Rename NTSTATUS variable ret to status.  Rename ret2 to
	sub_status.  Drop usage of LsaNtStatusToWinError.  In case LsaLogonUser
	fails, report the sub_status as well.
2011-04-01 08:41:26 +00:00
Corinna Vinschen 37f4458299 * libc/strptime.c: Remove misleading comment. 2011-04-01 08:37:10 +00:00
Corinna Vinschen e17c77459e * ntdll.h: Allow usage from plain C code.
(FSCTL_PIPE_IMPERSONATE): Define.
	(enum _THREAD_INFORMATION_CLASS): Define.
	(RTL_QUERY_REGISTRY_xxx): Define.
	(RTL_REGISTRY_xxx): Define.
	(PRTL_QUERY_REGISTRY_ROUTINE): Define.
	(struct _RTL_QUERY_REGISTRY_TABLE): Define.
	(enum _KEY_VALUE_INFORMATION_CLASS): Define.
	(struct _KEY_VALUE_PARTIAL_INFORMATION): Define.
	(NtAccessCheck): Declare.
	(NtAllocateLocallyUniqueId): Declare.
	(NtCreateKey): Declare.
	(NtDuplicateToken): Declare.
	(NtLoadKey): Declare.
	(NtOpenKey): Declare.
	(NtOpenProcessToken): Declare.
	(NtOpenThreadToken): Declare.
	(NtPrivilegeCheck): Declare.
	(NtQueryInformationToken): Declare.
	(NtQueryValueKey): Declare.
	(NtSetInformationThread): Declare.
	(NtSetInformationToken): Declare.
	(NtSetValueKey): Declare.
	(RtlAbsoluteToSelfRelativeSD): Declare.
	(RtlAddAccessAllowedAce): Declare.
	(RtlAddAccessDeniedAce): Declare.
	(RtlAddAce): Declare.
	(RtlCheckRegistryKey): Declare.
	(RtlCopySid): Declare.
	(RtlCreateAcl): Declare.
	(RtlCreateRegistryKey): Declare.
	(RtlCreateSecurityDescriptor): Declare.
	(RtlEqualPrefixSid): Declare.
	(RtlEqualSid): Declare.
	(RtlFirstFreeAce): Declare.
	(RtlGetAce): Declare.
	(RtlGetDaclSecurityDescriptor): Declare.
	(RtlGetGroupSecurityDescriptor): Declare.
	(RtlGetOwnerSecurityDescriptor): Declare.
	(RtlIdentifierAuthoritySid): Declare.
	(RtlInitializeSid): Declare.
	(RtlLengthSid): Declare.
	(RtlQueryRegistryValues): Declare.
	(RtlSetControlSecurityDescriptor): Declare.
	(RtlSetDaclSecurityDescriptor): Declare.
	(RtlSetGroupSecurityDescriptor): Declare.
	(RtlSetOwnerSecurityDescriptor): Declare.
	(RtlSubAuthorityCountSid): Declare.
	(RtlSubAuthoritySid): Declare.
	(RtlWriteRegistryValue): Declare.
2011-03-31 16:08:01 +00:00
Corinna Vinschen 3f74d8d568 * uinfo.cc (cygheap_user::init): Don't call GetUserName. Fetch username
from Windows environment instead.  Explain why.
	(cygheap_user::env_domain): Use MAX_DOMAIN_NAME_LEN rather than DNLEN
	to specify the size of the domain name buffer.
2011-03-31 15:33:53 +00:00
Corinna Vinschen 8263a803da * Makefile.in (LIBS): Remove advapi32.dll.
(clean): Remove cyglsa.def.
	* cyglsa.c: Drop definitions required for VC++.  Don't include ntddk.h.
	Declare functions from NTDLL here.  Explain why.  Use NTDLL functions
	in place of ADVAPI32 functions.
	* cyglsa64.def: New file.
	* cyglsa64.dll: Regenerate.
	* make-64bit-version-with-mingw-w64.sh (LIBS): Remove advapi32.dll.
	Reference cyglsa64.def instead of mslsa.def.
	* make-64bit-version-with-visual-c.bat: Remove.
	* mslsa.def: Remove.
2011-03-31 14:19:35 +00:00
Corinna Vinschen 457ebe4959 * cyglsa.c: Fix compilation with MinGW-w64 toolchains.
* make-64bit-version-with-mingw-w64.sh: New file.
	* cyglsa64.dll: Regenerate with MinGW-w64-gc.
2011-03-31 13:07:54 +00:00
Corinna Vinschen 98d4d68ec4 Fix ChangeLog entry. 2011-03-30 21:58:58 +00:00
Corinna Vinschen d22bbac76c * hires.h: Fix copyright.
* times.cc: Ditto.
	localtime, gmtime).
	(FACTOR): Add comment.
	(NSPERSEC): Ditto.
	(JITTER): New definition.  Comment.
	(systime_ns): Avoid gratuitous copying of the value returned by
	GetSystemTimeAsFileTime.
	(corelocaltime, localtime, gmtime): Remove very old, unused code block.
	(cygwin_tzset): Remove.
	(hires_ms::timeGetTime_ns): Add missing semicolon in comment.
	(hires_ms::nsecs): Redefine check for difference between internal
	timer value and system time.
2011-03-30 21:54:09 +00:00
Corinna Vinschen af23d12d33 * times.cc (hires_ms::resolution): Make sure resolution is never 0.
(clock_setres): Ditto.
2011-03-30 11:30:34 +00:00
Corinna Vinschen 51564c783f * regtool.cc (cmd_set): Avoid a compiler warning. 2011-03-30 08:22:59 +00:00
Corinna Vinschen da00863389 * cygtls.h (struct _local_storage): Redefine process_ident as wchar_t
pointer.
	* syslog.cc (CYGWIN_LOG_NAME): Convert to wide char constant.
	(openlog): Convert incoming ident string to wide char.  Fix formatting.
	(vsyslog): Print ident string as wide char string.  Convert message
	string to wide char and call UNICODE Win32 Event functions to make sure
	to use correct codeset.
	* tlsoffset.h: Regenerate.
2011-03-29 11:18:10 +00:00
Corinna Vinschen 39735c85f2 * fhandler_socket.cc (get_inet_addr): Make externally available.
* autoload.cc (GetUdpTable): Define.
	* syslog.cc (connect_syslogd): Use get_inet_addr rather than _stat64
	to check for local socket file.  Create socket with type returned by
	get_inet_addr.  If connect on UDP socket works, test if there's
	really a listening peer, otherwise fall back to Windows event log.
	(try_connect_syslogd): Use syslogd_inited flag to check if syslogd
	is available.
2011-03-29 11:07:23 +00:00
Corinna Vinschen d7d8e7ce07 * cygcheck.cc (handle_unique_object_name): Avoid a compiler warning.
(dump_sysinfo): Ditto.
	* loadlib.h (_load_sys_library): Mark as used, to avoid a compiler
	warning.
	* path.cc (oopt): Gurad with !FSTAB_ONLY to avoid a compiler warning.
	(read_flags): Ditto.
2011-03-29 11:02:58 +00:00
Corinna Vinschen 91d3057085 * uinfo.cc (cygheap_user::env_domain): Use LookupAccountSidW and
convert user and domain to multibyte strings to make sure to use
	correct codeset.
2011-03-29 10:46:04 +00:00
Corinna Vinschen 5f660ecf24 * autoload.cc (UuidCreate): Remove.
(UuidCreateSequential): Remove.
	* passwd.cc (internal_getpwsid): Avoid a strict-aliasing compiler
	error with gcc 4.5.1.
	* fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Ditto.
	* ntdll.h (NtAllocateUuids): Declare.
	* syscalls.cc (gethostid): Use NtAllocateUuids function rather than
	UuidCreateSequential/UuidCreate to get rid of rpcrt4 dependency.
2011-03-29 10:42:11 +00:00
Corinna Vinschen cabe8aa22a * new-features.sgml (ov-new1.7.10): Document pthread spinlocks. 2011-03-29 10:35:08 +00:00
Corinna Vinschen f00fe1b8e7 * cygwin.din (pthread_spin_destroy): Export.
(pthread_spin_init): Export.
	(pthread_spin_lock): Export.
	(pthread_spin_trylock): Export.
	(pthread_spin_unlock): Export.
	* posix.sgml (std-susv4): Add pthread_spin_destroy, pthread_spin_init,
	pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock.
	(std-notimpl): Remove pthread_spin_[...].
	* pthread.cc (pthread_spin_init): New function.
	* thread.cc (pthread_spinlock::is_good_object): New function.
	(pthread_mutex::pthread_mutex): Rearrange initializers to accommodate
	protected data in pthread_mutex.
	(pthread_spinlock::pthread_spinlock): New constructor.
	(pthread_spinlock::lock): New method.
	(pthread_spinlock::unlock): New method.
	(pthread_spinlock::init): New method.
	(pthread_spin_lock): New function.
	(pthread_spin_trylock): New function.
	(pthread_spin_unlock): New function.
	(pthread_spin_destroy): New function.
	* thread.h (PTHREAD_SPINLOCK_MAGIC): Define.
	(class pthread_mutex): Change access level of members shared with
	derived classes to protected.
	(pthread_mutex::set_shared): New protected method.
	(class pthread_spinlock): New class, derived class of pthread_mutex.
	* include/pthread.h (pthread_spin_destroy): Declare.
	(pthread_spin_init): Declare.
	(pthread_spin_lock): Declare.
	(pthread_spin_trylock): Declare.
	(pthread_spin_unlock): Declare.
	* include/cygwin/types.h (pthread_spinlock_t): New typedef.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-03-29 10:32:40 +00:00
Corinna Vinschen a011f95216 * net.cc (SIO_BASE_HANDLE): Define.
(fdsock): If we got an LSP handle, try to create a copy of the base
	handle instead.  Change comment to explain.
2011-03-29 10:25:20 +00:00
Corinna Vinschen b8fe0ec799 * include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 10. 2011-03-29 10:24:19 +00:00
Corinna Vinschen cd50649255 * autoload.cc (winmm): Remove time functions. Don't treat
unloadable wave functions as fatal.
	* hires.h (hires_ms::timeGetTime_ns): New private method.
	(hires_ms::dmsecs): Call timeGetTime_ns here.
	* ntdll.h (struct _KSYSTEM_TIME): Define.
	(KUSER_SHARED_DATA): Redefine to allow access to InterruptTime.
	(SharedUserData): Define here.
	(NtQueryTimerResolution): Declare.
	(NtSetTimerResolution): Declare.
	* path.cc (SharedUserData): Move to ntdll.h.
	* times.cc (hires_ms::timeGetTime_ns): New private method.
	Use throughout instead of timeGetTime.  Document entire functionality
	of timeGetTime in case we need it.
	(hires_ms::resolution): Try a call to NtQueryTimerResolution
	to fetch current period.  Fall back to heuristic if that fails.
	Cast to DWORD in assignments to minperiod.
	(clock_setres): Align period to possible values per a call to
	NtQueryTimerResolution.  Explain why.  Replace calls to timeBeginPeriod
	and timeEndPeriod with underlying call to NtSetTimerResolution.  Use
	status code from NtSetTimerResolution to compute errno.
	Convert period to ULONGLONG and store 100ns value to simplify code.
2011-03-29 10:21:30 +00:00
Corinna Vinschen 700c641dfa * include/userenv.h: Add functions and definitions added with Windows
2000 and Vista.
2011-03-29 08:43:17 +00:00