aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/sched.cc
AgeCommit message (Collapse)AuthorFilesLines
2024-12-17Cygwin: /proc/<PID>/stat: set field (18) according to scheduling policyChristian Franke1-35/+5
If a realtime policy is selected, set the '(18) priority' field to the negated sched_priority minus one. If SCHED_IDLE is selected, set it to the lowest priority 39. Also set '(19) nice' to the originally requested nice value. Ensure consistence with the current Windows priority in all cases. Move the sched_priority from/to Windows priority mapping from sched_get/setparam() to new functions in miscfuncs.cc. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-12Cygwin: sched_setscheduler: accept SCHED_RESET_ON_FORK flagChristian Franke1-4/+7
Add SCHED_RESET_ON_FORK to <sys/sched.h>. If this flag is set, SCHED_FIFO and SCHED_RR are reset to SCHED_OTHER and negative nice values are reset to zero in each child process created with fork(2). Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-12Cygwin: sched_setscheduler: accept SCHED_BATCHChristian Franke1-5/+10
Add SCHED_BATCH to <sys/sched.h>. SCHED_BATCH is similar to SCHED_OTHER, except that the nice value is mapped to a one step lower Windows priority. Rework the mapping functions to ease the addition of this functionality. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-04Cygwin: sched_setscheduler: accept SCHED_IDLEChristian Franke1-2/+7
Add SCHED_IDLE to <sys/sched.h>. If SCHED_IDLE is selected, preserve the nice value and set the Windows priority to IDLE_PRIORITY_CLASS. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-04Cygwin: sched_setscheduler: accept SCHED_OTHER, SCHED_FIFO and SCHED_RRChristian Franke1-46/+76
If SCHED_OTHER is selected, set the Windows priority according to the nice value. If SCHED_FIFO or SCHED_RR is selected, preserve the nice value and set the Windows priority according to the sched_priority parameter. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-02Cygwin: setpriority, sched_setparam: add missing process access rightChristian Franke1-1/+3
set_and_check_winprio() also requires PROCESS_QUERY_LIMITED_INFORMATION. Also add an early check for this access right to set_and_check_winprio(). Fixes: 153b51ee08ef ("Cygwin: setpriority, sched_setparam: fail if Windows sets a lower priority") Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-11-27Cygwin: sched_setscheduler: allow changes of the priorityChristian Franke1-1/+4
Behave like sched_setparam() if the requested policy is identical to the fixed value (SCHED_FIFO) returned by sched_getscheduler(). Fixes: 9a08b2c02eea ("* sched.cc: New file. Implement sched*.") Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-11-27Cygwin: setpriority, sched_setparam: fail if Windows sets a lower priorityChristian Franke1-1/+1
Windows silently sets a lower priority than requested if the new priority requires administrator privileges. Revert to previous priority and fail with EACCES or EPERM in this case. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-11-27Cygwin: sched_getscheduler: fix error handlingChristian Franke1-1/+4
Fixes: 6b2a2aa4af1e ("Add missing files.") Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-03-07Cygwin: move EXPORT_ALIAS expressions to end of sourceCorinna Vinschen1-1/+1
This isn't strictly required, but it avoids confusion in ctags. Ctags fails to record the next function or method following the EXPORT_ALIAS expression. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2023-09-01Cygwin: sys/cpuset.h: add cpuset-specific external functionsCorinna Vinschen1-0/+12
The latest incarnation of sys/cpuset.h broke building coreutils. The reason is the inclusion of stdlib.h and string.h and hence premature requests for datatypes not yet defined in the include chain. Avoid this by defining __cpuset_alloc and __cpuset_free as external functions, now defined in sched.cc. Linux is doing this too, just using different names for the functions. Redefine __cpuset_zero_s to use __builtin_memset only on compilers supporting it, otherwise using a simple loop. Drop the stdlib.h and string.h includes. Fixes: 3f2790e04439 ("Cygwin: Make gcc-specific code in <sys/cpuset.h> compiler-agnostic") Reported-by: Denis Excoffier <cygwin@Denis-Excoffier.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-10-29Cygwin: drop support for systems not supporting processor groupsCorinna Vinschen1-104/+46
i. e., Vista/2008. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-08-30Cygwin: make pthread_yield available for internal usageCorinna Vinschen1-0/+1
In preparation of importing FreeBSDs stdthreads functions, change the way pthread_yield is exported, so that the symbol can be used internally as well. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2019-06-28Cygwin: Fix return value of sched_getaffinityMark Geisert1-10/+19
Have sched_getaffinity() interface like glibc's, and provide an undocumented internal interface __sched_getaffinity_sys() like the Linux kernel's sched_getaffinity() for benefit of taskset(1).
2019-06-24Cygwin: Implement sched_[gs]etaffinity()Mark Geisert1-0/+308
This patch set implements the Linux syscalls sched_getaffinity, sched_setaffinity, pthread_getaffinity_np, and pthread_setaffinity_np. Linux has a straightforward view of the cpu sets used in affinity masks. They are simply long (1024-bit) bit masks. This code emulates that view while internally dealing with Windows' distribution of available CPUs among processor groups.
2018-11-29Cygwin: implement extensible clock interfaceCorinna Vinschen1-1/+1
- Drop hires_[nm]s clocks, rename hires.h to clock.h. - Implement clk_t class as an extensible clock class in new file clock.cc. - Introduce get_clock(clock_id) returning a pointer to the clk_t instance for clock_id. Provide the following methods along the lines of the former hires classes: void clk_t::nsecs (struct timespec *); ULONGLONG clk_t::nsecs (); LONGLONG clk_t::usecs (); LONGLONG clk_t::msecs (); void clk_t::resolution (struct timespec *); - Add CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_RAW, CLOCK_MONOTONIC_COARSE and CLOCK_BOOTTIME clocks. - Allow clock_nanosleep, pthread_condattr_setclock and timer_create to use all new clocks (both clocks should be usable with a small tweak, though). - Bump DLL major version to 2.12. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-08-07Cygwin: implement sched_getcpuCorinna Vinschen1-0/+13
* create new function __get_cpus_per_group to evaluate # of CPU groups * Call from format_proc_cpuinfo and sched_getcpu * Bump API minor version Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-02-12Cygwin: Drop HZ usage in favor of MSPERSEC and CLOCKS_PER_SECCorinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-02-07Cygwin: Cleanup time handlingCorinna Vinschen1-3/+5
* Redefine NSPERSEC to NS100PERSEC * Define NSPERSEC as nanosecs per second * Define USPERSEC as microsecs per second * Use above constants throughout where appropriate * Rename to_us to timespec_to_us and inline * Rename it_bad to timespec_bad and inline Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-06-27Use PROCESS/THREAD_QUERY_LIMITED_INFORMATION where appropriateCorinna Vinschen1-1/+2
Using PROCESS/THREAD_QUERY_INFORMATION may limit the number of processes/threads we can inspect depending on their integrity level. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-06-23Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout optioncygwin-2_5_2-releaseCorinna Vinschen1-3/+0
Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause. Everything else stays under GPLv3+. New Linking Exception exempts resulting executables from LGPLv3 section 4. Add CONTRIBUTORS file to keep track of licensing. Remove 'Copyright Red Hat Inc' comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-06-03sched.cc: Use PROCESS_QUERY_INFORMATION for nowCorinna Vinschen1-2/+1
Temporarily revert to use PROCESS_QUERY_INFORMATION instead of PROCESS_QUERY_LIMITED_INFORMATION to make sure every aspect of the next release is still XP/2003 compatible. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-05-20Rewrite scheduler functions getting and setting process and thread priorityCorinna Vinschen1-171/+172
So far the scheduler priority handling is not POSIX compatible. The priorities use a range of -14 up to +15, which means it's not clear if the POSIX-required return value of -1 in case of an error is *really* an error or just the valid priority value -1. Even more confusing, -14 is the *max* value and 15 is the *min* value. Last but not least this range doesn't match the POSIX requirement of at least 32 priority values. This patch cleans up scheduler priority handling and moves the valid priority range to 1 (min) - 32 (max). It also adds a function sched_get_thread_priority() which will help to make thread priority more POSIX-like. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2013-04-23 * Merge in cygwin-64bit-branch.Corinna Vinschen1-99/+28
2013-01-21Throughout, update copyrights to reflect dates which correspond to main-branchChristopher Faylor1-1/+2
checkins. Regularize copyright format.
2012-11-26 * fhandler_registry.cc: Drop Mingw.org considerations.Corinna Vinschen1-4/+0
* fhandler_serial.cc: Ditto. * fhandler_socket.cc: Ditto. * fhandler_tape.cc: Ditto. * fhandler_tty.cc: Ditto. * net.cc: Ditto. * ntdll.h: Ditto. * sched.cc: Ditto. * sec_helper.cc: Ditto.
2012-11-23ChangeLog:Christopher Faylor1-3/+0
2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx> * Makefile.common: Revamp for new configury. Add default compilation targets, include .E processing. Add magic for allowing "CFLAGS" to control optimization options in "CXXFLAGS". * configure.cygwin: New include for Cygwin configure.in's. * acinclude.m4: Delete old definitions. Implement AC_WINDOWS_HEADERS, AC_WINDOWS_LIBS, AC_CYGWIN_INCLUDES, target_builddir, winsup_srcdir. * aclocal.m4: Regenerate. * autogen.sh: New file. * ccwrap: New script. * c++wrap: New script. * config.guess: New script. * config.sub: New script. * configure: Regenerate. * configure.in: Eliminate LIB_AC_PROG_* calls in favor of standard. Delete ancient target test. * install-sh: New script. cygserver/ChangeLog: 2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx> * Makefile.in: Revamp for new configury. * configure.in: Revamp for new configury. * aclocal.m4: Regenerate. * configure: Ditto. * autogen.sh: New script. cygwin/ChangeLog: 2012-11-22 Christopher Faylor <me.cygwin2012@cgf.cx> * select.cc (select): Don't return -1 when we've timed out after looping. 2012-11-22 Christopher Faylor <me.cygwin2012@cgf.cx> * Makefile.in: Revamp for new configury. (datarootdir): Add variable setting. (winver_stamp): Accommodate changes to mkvers.sh setting. (libc.a): Fix race when libm.a might not have been built yet. * configure.in: Revamp for new configury. * aclocal.m4: Regenerate. * configure: Ditto. * autogen.sh: New script. * mkvers.sh: Find include directives via CFLAGS and friends rather than assuming that w32api lives nearby. utils/ChangeLog: 2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx> * aclocal.m4: Regenerate. * configure: Ditto. * autogen.sh: New script. * configure.in: Revamp for new configury. * Makefile.in: Revamp for new configury. Rename ALL_* to just *. Always use "VERBOSE" setting. (MINGW_CXX): Don't include CFLAGS in definition. (all): Define target first, before everything else so that it is the default. (ps.exe): Don't add useless -lcygwin. (ldh.exe): For consistency, add to existing MINGW_LDFLAGS rather than redefining them. (cygcheck.exe): Always include -lz for MINGW_LDFLAGS. Don't try to figure out where to find it. (dumper.exe): Simplify check. Assume libraries are installed rather than trying to retrieve from source tree. (install): Just use /bin/mkdir to create directories. (Makefile): Regenerate when standard dependencies change. * dump_setup.cc: Always include zlib.h. Remove accommodations for it possibly not existing. * parse_pe.cc: Add define which allows building with installed binutils package. * dumper.cc: Ditto.
2012-07-06 * fhandler_registry.cc (RegOpenUserClassesRoot): Only define whenCorinna Vinschen1-0/+2
building against w32api headers. (RegOpenCurrentUser): Ditto. * fhandler_tty.cc (GetNamedPipeClientProcessId): Ditto. * ntdll.h (enum _PROCESSINFOCLASS): Add ProcessImageFileName. (RtlInitAnsiString): Declare. (RtlUnicodeStringToAnsiSize): Declare. * sched.cc (GetForegroundWindow): Ditto. * sec_helper.cc (SECURITY_NT_NON_UNIQUE): Define as SECURITY_NT_NON_UNIQUE_RID when building against w32api headers. (cygsid::get_sid): Use SECURITY_NT_NON_UNIQUE rather than SECURITY_NT_NON_UNIQUE_RID. (__sec_user): Use PISECURITY_DESCRIPTOR rather than PSECURITY_DESCRIPTOR to allow valid pointer arithmetic. (_recycler_sd): Ditto. (_everyone_sd): Ditto.
2011-07-06 * sched.c (sched_yield): Just call SwitchToThread because yield nowCorinna Vinschen1-1/+1
potentially switches CPU.
2011-04-23 * registry.cc (reg_key::get_dword): Rename from get_int, use DWORDCorinna Vinschen1-2/+2
rather than int type. Avoid compiler warning. (reg_key::set_dword): Rename from set_int, use DWORD rather than int type. Change return type to NTSTATUS. (reg_key::get_string): Change return type to NTSTATUS. (reg_key::set_string): Ditto. * registry.h: Accommodate above changes. * environ.cc (regopt): Test return value of reg_key::get_string as NTSTATUS. * sched.cc (sched_rr_get_interval): Change local int vars to DWORD. Call reg_key::get_dword instead of reg_key::get_int. * shared.cc (init_installation_root): Test return value of reg_key::get_string as NTSTATUS. (shared_info::heap_slop_size): Call reg_key::get_dword rather than reg_key::get_int. (shared_info::heap_chunk_size): Ditto. * shared_info.h (CURR_SHARED_MAGIC): Update. (class shared_info): Change heap_chunk and heap_slop to DWORD values.
2011-04-19 * Makefile.in (DLL_IMPORTS): Drop advapi32.dll.Corinna Vinschen1-4/+4
* autoload.cc: Enable autoloading advapi32 functions. * environ.cc (regopt): Use wide char arguments in reg_key functions. * fhandler_console.cc (beep): Ditto. Use WCHAR throughout. * registry.cc (reg_key): Rewrite reg_key class to use native NT registry functions. Use WCHAR string parameters throughout. Use PCWSTR rather than const WCHAR. Drop multibyte char functionality. Drop unused methods. (get_registry_hive_path): Use RtlQueryRegistryValues to fetch path from registry. (load_registry_hive): Drop useless check for user hive being available. Load hive using NtLoadKey. * registry.h: Accommodate above changes. * sched.cc (sched_rr_get_interval): Use wide char arguments in reg_key functions. * shared.cc (init_installation_root): Ditto. (shared_info::init_obcaseinsensitive): Use RtlQueryRegistryValues to fetch obcaseinsensitive value. (shared_info::heap_slop_size): Use wide char arguments in reg_key functions. (shared_info::heap_chunk_size): Ditto. * syscalls.cc (gethostid): Ditto. * winsup.h (__WIDE): Define. (_WIDE): Define. * libc/minires-os-if.c (get_registry_dns_items): Don't fetch values from registry. Just extract them from given UNICODE_STRING parameter. (get_registry_dns): Fetch all registry values at once using RtlQueryRegistryValues.
2010-03-12Throughout change all calls of low_priority_sleep (0) to yield ().Christopher Faylor1-1/+1
* miscfuncs.cc (yield): Rename from low_priority_sleep. Remove all of the logic which called Sleep() and just use SwitchToThread. * miscfuncs.h (yield): Rename from low_priority_sleep. (SLEEP_0_STAY_LOW): Delete unused define. * shared.cc (memory_init): Move heap_init() call directly after shared memory initialization to more closely mimic long-standing program flow. * tty.cc (tty_list::terminate): Replace call to low_priority_sleep with Sleep.
2008-09-11* localtime.cc (increment_overflow): Mark as non-inline to prevent compilerChristopher Faylor1-1/+1
from complaining about the very thing we're trying to test. * ntea.cc (read_ea): Reorganize to avoid a new compiler warning/error. * sched.cc (sched_rr_get_interval): Ditto. * select.cc (peek_serial): Ditto. * libc/rexec.cc (ruserpass): Ditto. * posix_ipc.cc (ipc_names): Make static to avoid a compiler warning (and it's the right thing to do anyway).
2008-04-07Remove unneeded header files from source files throughout.Christopher Faylor1-6/+0
2008-04-07Add miscfuncs.h to files as needed throughout.Christopher Faylor1-0/+1
* mount.cc: New file. * path.cc: Move mount-specific stuff into mount.cc. Move common stuff into miscfuncs.cc. Remove unneeded includes. * miscfuncs.cc: Move some common path functions here. * miscfuncs.h: New file. * winsup.h: Move miscelleneous functions to miscfuncs.h. * dcrt0.cc: Remove unneeded includes. * Makefile.in (DLL_OFILES): Add mount.o. * include/cygwin/config.h: Fix a minor typo.
2007-02-22 * Makefile.in (DLL_IMPORTS): Add libntdll.a.Corinna Vinschen1-7/+1
* 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.
2006-10-19 * fhandler_proc.cc: Drop superfluous definition of _WIN32_WINNT.Corinna Vinschen1-2/+1
* miscfuncs.cc: Ditto. * sched.cc: Ditto.
2005-07-05Change foo (void) to foo () for all c++ functions throughout. Remove allChristopher Faylor1-1/+1
fhandler_*::dump functions throughout. * fhandler.h (fhandler_dev_mem::close): Remove pass-through function in favor of virtual method. (handler_dev_raw::close): Ditto. (fhandler_dev_clipboard::fixup_after_exec): New method. * fhandler_dev_mem.cc (fhandler_dev_mem::close): Eliminate pass through * fhandler_dev_raw.cc (fhandler_dev_raw::close): Ditto. * fhandler_clipboard.cc (fhandler_dev_clipboard::close): Don't go to extra effort when execing. (fhandler_dev_clipboard::fixup_after_exec): New function. * fhandler_console.cc (fhandler_console::close): Don't do "extra stuff" when we know we're execing. * fhandler_disk_file.cc (fhandler_disk_file::close): Ditto. * fhandler_dsp.cc (fhandler_dev_dsp::close): Ditto. * fhandler_fifo.cc (fhandler_fifo.cc::close): Ditto. function in favor of base function. * fhandler_random.cc (fhandler_dev_random::close): Ditto. * fhandler_registry.cc (fhandler_registry::close): Ditto. * fhandler_tty.cc (fhandler_tty_slave::close): Ditto. * fhandler_virtual.cc (fhandler_virtual::close): Ditto. * pinfo.cc (proc_waiter): Remove unneeded hExeced declaration. * sigproc.cc: Ditto. * winsup.h (hExeced): Define here. * fhandler_virtual.cc (fhandler_virtual::fixup_after_exec): Just call close() to reinitialize things to known state.
2004-05-28* path.cc (chdir): Always use the normalized_path as posix_cwd, except if itChristopher Faylor1-1/+1
starts with a drive. Also perform whitespace cleanup.
2003-09-27* Makefile.in: Add libusr32.a to DLL_IMPORTS.Christopher Faylor1-11/+69
* 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-06-16Throughout, remove "include <errno.h>" from files which already includeChristopher Faylor1-1/+0
cygerrno.h. * include/cygwin/config.h (__DYNAMIC_REENT__): Define. * include/cygwin/version.h: Bump API minor version. * cygwin.din: Export __getreent * cygerrno.h: Include errno.h. Fix places where _impure_ptr is used directly to store the errno value. * debug.cc (__set_errno): Ditto. * errno.cc: Remove _RRENT_ONLY define to get errno.cc compiled. * signal.cc: Rename _reent_clib to _REENT throughout. * thread.h (reent_clib): Remove prototype. * thread.cc (reent_clib): Rename reent_clib to __getreent. Return _impure_ptr until MTinterface is initialized. (reent_winsup): Fix a possible SEGV when _r == NULL. Return NULL instead. * MTinterface::fixup_after_fork: Switch reent back to _impure_ptr to keep signal handling running when fork is called from a thread other than the mainthread.
2002-11-13* miscfuncs.cc (low_priority_sleep): New function. Use throughout where codeChristopher Faylor1-1/+1
is supposed to be giving up time slice. * fhandler_console.cc (fhandler_console::read): Switch button 2/3 output escape sequences to be consistent with xterm.
2002-09-23More GNUify non-GNU formatted functions calls throughout.Christopher Faylor1-5/+5
2002-06-02Remove unneeded sigproc.h includes throughout.Christopher Faylor1-1/+0
* fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument. * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search for given pid. (fhandler_proc::readdir): Assume that pid exists if it shows up in the winpid list. * fhandler_process.cc (fhandler_process::open): Simplify search for given pid. Call fill_filebuf with pinfo argument. (fhandler_process::fill_filebuf): Pass pinfo here and assume that it exists. * pinfo.h (pinfo::remember): Define differently if sigproc.h is not included. * dll_init.cc (dll_list::detach): Don't run destructor on exit.
2001-06-26* mmap.cc: Clean up *ResourceLock calls throughout.Christopher Faylor1-25/+24
* thread.cc (pthread_cond::TimedWait): Check for WAIT_TIMEOUT as well as WAIT_ABANDONED. (__pthread_cond_timedwait): Calculate a relative wait from the abstime parameter.
2001-04-12 * configure.in: Remove PTH_ALLOW.Robert Collins1-1/+43
* cygwin.din: Remove @PTH_ALLOW@ prefixes to pthread functions. Add new pthread exports. * pthread.cc: New wrapper functions for the above new exports. * sched.cc (valid_sched_parameters): New function. (sched_setparam): Use it. (sched_set_thread_priority): New function. Used by pthread_sched*. * thread.cc (pthread_key_destructor::InsertAfter): New function. (pthread_key_destructor::UnlinkNext): New function. (pthread_key_destructor::Next): New function. (pthread_key_destructor_list::Insert): New function. (pthread_key_destructor_list::Remove): New function. (pthread_key_destructor_list::Pop): New function. (pthread_key_destructor::pthread_key_destructor): New function. (pthread_key_destructor_list::IterateNull): New function. (MTinterface::Init): Initialise new member. (pthread::pthread): Initialise new members. (pthread::create): Copy new attributes. Set the new thread priority. (pthread_attr::pthread_attr): Initialise new members. (pthread_key::pthread_key): Setup destructor function. (pthread_key::~pthread_key): Remove destructor function. (pthread_mutexattr::pthread_mutexattr): New function. (pthread_mutexattr::~pthread_mutexattr): New function. (__pthread_once): New function. (__pthread_cleanup): New function. (__pthread_cancel): New function. (__pthread_setcancelstate): New function. (__pthread_setcanceltype): New function. (__pthread_testcancel): New function. (__pthread_attr_getinheritsched): New function. (__pthread_attr_getschedparam): New function. (__pthread_attr_getschedpolicy): New function. (__pthread_attr_getscope): New function. (__pthread_attr_setinheritsched): New function. (__pthread_attr_setschedparam): New function. (__pthread_attr_setschedpolicy): New function. (__pthread_attr_setscope): New function. (__pthread_exit): Call any key destructors on thread exit. (__pthread_join): Use the embedded attr values. (__pthread_detach): Use the embedded attr values. (__pthread_getconcurrency): New function. (__pthread_getschedparam): New function. (__pthread_key_create): Pass the destructor on object creation. (__pthread_key_delete): Correct incorrect prototype. (__pthread_setconcurrency): New function. (__pthread_setschedparam): New function. (__pthread_cond_timedwait): Support static mutex initialisers. (__pthread_cond_wait): Ditto. (__pthread_mutex_getprioceiling): New function. (__pthread_mutex_lock): Support static mutex initialisers. (__pthread_mutex_trylock): Ditto. (__pthread_mutex_unlock): Ditto. (__pthread_mutex_destroy): Ditto. (__pthread_mutex_setprioceiling): New function. (__pthread_mutexattr_getprotocol): New function. (__pthread_mutexattr_getpshared): New function. (__pthread_mutexattr_gettype): New function. (__pthread_mutexattr_init): New function. (__pthread_mutexattr_destroy): New function. (__pthread_mutexattr_setprotocol): New function. (__pthread_mutexattr_setprioceiling): New function. (__pthread_mutexattr_getprioceiling): New function. (__pthread_mutexattr_setpshared): New function. (__pthread_mutexattr_settype): New function. Remove stubs for non MT_SAFE compilation. * thread.h: Remove duplicate #defines. Add prototypes for new functions in thread.cc. (pthread_key_destructor): New class. (pthread_key_destructor_list): New class. (pthread_attr): Add new members. (pthread): Remove members that are duplicated in the pthread_attr class. (pthread_mutex_attr): Add new members. (pthread_once): New class. * include/pthread.h: Add prototypes for new functions exported from cygwin1.dll. Remove typedefs. * include/sched.h: Add prototypes for new functions in sched.cc. * include/cygwin/types.h: Add typedefs from pthread.h
2001-03-21Add missing files.Christopher Faylor1-0/+404