Commit Graph

121 Commits

Author SHA1 Message Date
Corinna Vinschen f4ddbb8ebf * times.cc (GetSystemTimePreciseAsFileTime): Add comment to declaration.
(__to_clock_t): Remove a debug_printf.
	(times): Align syscall_printf to debug output of other system calls.
2013-06-17 08:33:41 +00:00
Corinna Vinschen 7584fa98d4 * autoload.cc (GetSystemTimePreciseAsFileTime): Define.
* times.cc (GetSystemTimePreciseAsFileTime): Temporarily declare here
	to workaround missing definition in 32 bit w32api headers.
	(get_system_time): New always inline function to call either
	GetSystemTimePreciseAsFileTime or GetSystemTimeAsFileTime on a per OS
	basis.  Call throughout instead of GetSystemTimeAsFileTime.
	* wincap.h (wincaps::has_precise_system_time): New element.
	* wincap.cc: Implement above element throughout.
2013-06-14 15:41:17 +00:00
Corinna Vinschen 0ff057d5a5 Streamline time/times functionality. Remove last remains of former
Windows 9x compatibility.
	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Drop now unneeded
	casts in calls to_timestruc_t.
	(fhandler_base::utimens_fs): Ditto for timespec_to_filetime.
	* fhandler_proc.cc (format_proc_stat): Ditto for to_time_t.
	* hires.h (class hires_ms): Remove unused member initime_ns.
	Remove declarations for timeGetTime_ns and prime.
	(hires_ms::uptime): Remove.
	* posix_ipc.cc (ipc_cond_timedwait): Ditto for timespec_to_filetime.
	* fhandler_registry.cc (fhandler_registry::fstat): Add cast.
	* resource.cc (fill_rusage): Call NtQueryInformationProcess rather than
	GetProcessTimes to deal with LARGE_INTEGER rather than FILETIME.
	* times.cc: Simplify time handling.  Throughout, use LARGE_INTEGER
	rather than FILETIME to simplify computations.  Throughout use
	{u}int64_t rather than {unsigned} long long.  Drop unneeded casts since
	NSPERSEC is 64 bit anyway.
	(systime_ns): Remove.
	(times): Call NtQuerySystemInformation to fetch boot time.  Call
	NtQueryInformationProcess rather than GetProcessTimes to deal with
	LARGE_INTEGER rather than FILETIME.  Call GetSystemTimeAsFileTime.
	(totimeval): Use constant 1000000 as in other functions.
	(time_t_to_filetime): Remove.
	(to_time_t): Change return type to time_t.
	(time_as_timestruc_t): Rename filetime to systime.
	(time): Ditto. Add cast.
	(hires_ns::nsecs): Fix return type cast.
	(hires_ms::timeGetTime_ns): Remove.
	(hires_ns::prime): Remove.
	(hires_ms::nsecs): Drop call to prime.  Call GetSystemTimeAsFileTime
	directly.  Subtract FACTOR here since it's the only function needing
	to do so.
	(minperiod): Cosmetically change to ULONG.
	(hires_ns::resolution): Fix return type cast.
	(hires_ms::resolution): Simplify, rely on NtQueryTimerResolution.
	* winsup.h: Align time related prototypes to above changes.
2013-06-14 09:09:41 +00:00
Corinna Vinschen 61522196c7 * Merge in cygwin-64bit-branch. 2013-04-23 09:44:36 +00:00
Corinna Vinschen 8f81761b69 * hires.h (hires_ns::nsecs): Declare with bool parameter.
* times.cc (hires_ns::nsecs): Take bool parameter.  If set to true,
	don't use prime value (== return system wide absolute value).
2013-04-11 19:49:58 +00:00
Christopher Faylor bc837d22f3 Throughout, update copyrights to reflect dates which correspond to main-branch
checkins.  Regularize copyright format.
2013-01-21 04:38:31 +00:00
Corinna Vinschen 6680cb64f1 * times.cc (clock_setres): Set minperiod to period. 2012-03-28 07:38:35 +00:00
Corinna Vinschen 4b6a427b0a * times.cc (clock_setres): Revert previous change. 2012-03-27 08:50:45 +00:00
Corinna Vinschen b54d64de05 * hires.h (hires_ms::dmsecs): Drop unused method.
* times.cc (JITTER): Remove.
	(gtod): Revert to process-local variable.
	(hires_ms::nsecs): Just return system time to disallow discrepancy with
	the OS.
	(hires_ms::resolution): Return coarsest timer value from OS.  Add
	comment to explain why.
	(clock_setres): Ditto.
2012-03-26 09:05:50 +00:00
Corinna Vinschen 74365d9715 * times.cc (hires_ns::resolution): Don't return less than 1. 2011-12-13 11:38:12 +00:00
Christopher Faylor b9aa81491f Throughout, remove extra space after function name from debugging output.
Throughout, change syscalls to report on return values using new %R format
option.
* smallprint.cc (__small_vsprintf): Add parsing for %R to report on return
values and possible errno from syscalls.
* errno.cc (errmap): Add PRIVILEGE_NOT_HELD.
* fhandler_tty.cc (fhandler_pty_master::setup): When creating a thread use
shorter name to reduce debuggging output.
* select.cc (start_thread_pipe): Ditto.
(start_thread_serial): Ditto.
(start_thread_socket): Ditto.
(start_thread_mailslot): Ditto.
* sigproc.cc (talktome): Ditto.
2011-12-03 21:43:27 +00:00
Yaakov Selkowitz f0968c1e7e * cygtls.h (struct _local_storage): Add cw_timer member.
* cygtls.cc (_cygtls::init_thread): Initialize locals.cw_timer.
(_cygtls::fixup_after_fork): Ditto.
* tlsoffsets.h: Regenerate.
* ntdll.h (enum _TIMER_INFORMATION_CLASS): Define.
(struct _TIMER_BASIC_INFORMATION): Define.
(NtQueryTimer): Declare function.
* thread.h (cancelable_wait): Change timeout argument to
PLARGE_INTEGER and provide NULL default.
(fast_mutex::lock): Adjust accordingly.
(pthread_cond::wait): Change timeout argument to PLARGE_INTEGER
and default to NULL.
* thread.cc (cancelable_wait): Change timeout argument to
PLARGE_INTEGER.  Initialize _cygtls.locals.cw_timer if needed.
Use NT waitable timers for handling timeout.  Return remaining time
to timeout argument if timeout was relative.
(pthread_cond::wait): Change timeout argument to PLARGE_INTEGER.
Adjust to change in cancelable_wait.
(pthread_mutex::lock): Adjust to change in cancelable_wait.
(pthread_spinlock::lock): Ditto.
(pthread::join): Ditto.
(__pthread_cond_dowait): Change waitlength argument to PLARGE_INTEGER.
Adjust to changes in cancelable_wait and pthread_cond::wait.
(pthread_cond_timedwait): Adjust to change in __pthread_cond_dowait.
(pthread_cond_wait): Ditto.
(semaphore::_timedwait): Adjust to change in cancelable_wait.
(semaphore::_wait): Ditto.
* exceptions.cc (handle_sigsuspend): Ditto.
* signal.cc (nanosleep): Ditto.
* wait.cc (wait4): Ditto. Fix copyright dates.
* times.cc (FACTOR, NSPERSEC): Move from here...
* hires.h (FACTOR, NSPERSEC): ...to here.
2011-08-03 16:40:48 +00:00
Christopher Faylor b86f999af1 whitespace elimination 2011-06-06 05:02:13 +00:00
Yaakov Selkowitz c8ce54290d * cygwin.din (clock_getcpuclockid): Export.
(pthread_getcpuclockid): Export.
* hires.h (PID_TO_CLOCKID): New macro.
(CLOCKID_TO_PID): New macro.
(CLOCKID_IS_PROCESS): New macro.
(THREADID_TO_CLOCKID): New macro.
(CLOCKID_TO_THREADID): New macro.
(CLOCKID_IS_THREAD): New macro.
* ntdll.h (enum _THREAD_INFORMATION_CLASS): Add ThreadTimes.
* posix.sgml (std-notimpl): Add clock_getcpuclockid and
pthread_getcpuclockid from here...
(std-susv4): ... to here.
(std-notes): Remove limitations of clock_getres and clock_gettime.
Note limitation of timer_create to CLOCK_REALTIME.
* sysconf.cc (sca): Set _SC_CPUTIME to _POSIX_CPUTIME, and
_SC_THREAD_CPUTIME to _POSIX_THREAD_CPUTIME.
* thread.cc (pthread_getcpuclockid): New function.
* timer.cc (timer_create): Set errno to ENOTSUP for CPU-time clocks.
* times.cc (clock_gettime): Handle CLOCK_PROCESS_CPUTIME_ID and
CLOCK_THREAD_CPUTIME_ID.
(clock_getres): Ditto.
(clock_settime): Set errno to EPERM for CPU-time clocks.
(clock_getcpuclockid): New function.
* include/pthread.h (pthread_getcpuclockid): Declare.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-05-17 17:08:10 +00:00
Yaakov Selkowitz 6758d2a3aa * times.cc (settimeofday): Add EFAULT handler.
Set errno to EINVAL if tv.tv_nsec is invalid, and to EPERM if
SetSystemTime fails.  Return -1 in case of failure, all for
compatibility with BSD and Linux.
(clock_settime): New function.
* cygwin.din (clock_settime): Export.
* posix.sgml (std-susv4): Add clock_settime.
Move clock_setres from here...
(std-deprec): ... to here.
(std-notes): Correct limitation of clock_setres to only CLOCK_REALTIME.
Add limitation of clock_settime to only CLOCK_REALTIME.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-05-09 08:57:46 +00:00
Christopher Faylor 8978381c2a Eliminate trailing whitespace in some files.
* dll_init.cc (dll_list::alloc): Reset 'p' in forked process.
* select.cc (select_stuff::wait): Move cleanup() closer to WFMO to minimize
unavoidable (?) race.
2011-05-02 15:28:35 +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 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
Yaakov Selkowitz b150f5236b Implement POSIX.1-2004 Monotonic Clock.
* hires.h: Change hires_us to hires_ns, with nanosecond resolution.
(hires_ns::primed_ft): Remove.
(hires_ns::nsecs): New prototype.
(hires_ns::usecs): Rewrite in terms of nsecs.
(hires_ns::resolution): New prototype.
* times.cc: Change hires_us to hires_ns.
(ntod): Declare.
(systime): Remove.
(hires_ns::prime): Increase resolution to nanoseconds.
(hires_ns::nsecs): Rename usecs to nsecs to reflect increased resolution.
Remove justdelta argument.
(hires_ns::resolution): New function.
(clock_gettime): Accept CLOCK_MONOTONIC.
Use EINVAL instead of ENOSYS per POSIX.1-2004.
(clock_getres): Ditto.
(clock_setres): Use EINVAL instead of ENOSYS to conform with other
implementations.
* strace.cc (strace::microseconds): Adjust for hires_ns.
* sysconf.cc (sca): Set _SC_MONOTONIC_CLOCK to _POSIX_MONOTONIC_CLOCK.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2010-08-09 16:47:48 +00:00
Christopher Faylor 75172e03ac * times.cc (gtod): Move to sharable region. 2010-06-12 16:34:26 +00:00
Christopher Faylor fca8f35f11 * hires.h (hires_base::reset): New function.
(hires_us): Specify that hires_base is a public import.
(hires_ms): Ditto.
* times.cc (gtod): Move earlier in file.
(settimeofday): Reset gtod so that base will be subsequently recalculated.
2010-05-26 14:48:17 +00:00
Corinna Vinschen 4ee93264fd * dtable.cc (build_fh_name_worker): Remove. Move all functionality
back into build_fh_name.
	(build_fh_name): Drop unused HANDLE parameter.  Drop call to pc.fillin.
	Remove disabled build_fh_name with UNICODE_STRING name parameter.
	* dtable.h (build_fh_name): Drop HANDLE parameter from declaration.
	Remove declaration for build_fh_name with UNICODE_STRING name parameter.
	* path.cc (path_conv::fillin): Remove.
	(symlink_info::check): Fix comment.
	* path.h (path_conv::fillin): Remove declaration.
	* dir.cc: Accommodate change in build_fh_name parameters throughout.
	* sec_acl.cc: Ditto.
	* syscalls.cc: Ditto.

	* ntea.cc (getxattr_worker): Fix debug output.
	(setxattr_worker): Ditto.
	* times.cc (utimens_worker): Ditto.
2010-01-12 10:14:59 +00:00
Corinna Vinschen f16706de97 Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcess
according to context.  Throughout, replace hMainThread with
	GetCurrentThread/NtCurrentThread according to context.
	* dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to
	hMainProc.  Drop duplication of GetCurrentThread to hMainThread.
	* dtable.cc (dtable::stdio_init): Remove useless comment.
	* globals.cc (hMainProc): Remove.
	(hMainThread): Remove.
	* ntdll.h (NtCurrentProcess): Define.
	(NtCurrentThread: Define.
2009-12-18 20:32:04 +00:00
Eric Blake b8a35083c6 Improve clock_gettime and utimensat resolution.
* hires.h (hires_ms): Change initime_us to initime_ns, with 10x
more resolution.
(hires_ms::nsecs): New prototype.
(hires_ms::usecs, hires_ms::msecs, hires_ms::uptime): Adjust.
* times.cc (systime_ns): New helper function.
(hires_ms::prime): Use it for more resolution.
(hires_ms::usecs): Change to...
(hires_ms::nsecs): ...with more resolution.
(clock_gettime): Use more resolution.
(systime): Rewrite in terms of systime_ns.
(timespec_to_filetime): Rewrite math to reflect true operation.
* fhandler_disk_file.cc (utimens_fs): Use higher resolution.
2009-10-13 02:26:33 +00:00
Christopher Faylor 66a83f3eac Remove unneeded header files from source files throughout. Update copyrights
where appropriate.
* globals.cc: New file for generic global variables.
* mkglobals_h: New file to generate globals.h.
* mkstatic: New Script used to build a (currently non-working) static
libcygwin_s.a.
* Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
(DLL_OFILES): Add globals.o.  Make all objects rely on globals.h.
(globals.h): New target.  Generate globals.h.
* cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE operator
is allowed in _cygtls.
* dcrt0.cc: Move most globals to globals.cc.
* init.cc: Ditto.
* environ.cc (strip_title_path): Remove now-unneeded extern.
* fhandler_serial.cc (fhandler_serial::open): Ditto.
* pinfo.cc: Ditto.
(commune_process): Ditto.
* shared.cc: Ditto.
* glob.cc: Ditto.
* strace.cc: Ditto.
* exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
* path.cc (stat_suffixes): Move here.
* security.h: Add forward class path_conv declaration.
* smallprint.cc (__small_vsprintf): Make a true c++ function.
(__small_sprintf): Ditto.
(small_printf): Ditto.
(console_printf): Ditto.
(__small_vswprintf): Ditto.
(__small_swprintf): Ditto.
* spawn.cc (spawn_guts): Remove _stdcall decoration in favor of regparm.
(hExeced): Move to globals.cc
* strfuncs.cc (current_codepage): Ditto.
(active_codepage): Ditto.
* sync.cc (lock_process::locker): Move here from dcrt0.cc.
* syscalls.cc (stat_suffixes): Move to path.cc.
* tty.cc (tty::create_master): Uncapitalize fatal warning for consistency.
* winsup.h: Include globals.h to declare most of the grab bag list of globals
which were previously defined here.
* mount.h: Move USER_* defines back to shared_info.h.
* speclib: Force temporary directory cleanup.
2009-01-03 05:12:22 +00:00
Corinna Vinschen e4b575030b Add case-sensitivity.
Unconditionally handle mount points case-sensitive.
	Unconditionally handle virtual paths case-sensitive.
	Unconditionally handle registry paths case-insensitive.
	Otherwise, accommodate case-sensitivity of given path throughout.
	* cygheap.cc (cygheap_root::set): Get additional caseinsensitive
	parameter and store it.
	* cygheap.h (struct cygheap_root_mount_info): Add member
	caseinsensitive.
	* dlfcn.cc (get_full_path_of_dll): Drop PC_NOFULL parameter from call
	to path_conv::check.
	* environ.cc (pcheck_case): Remove.
	(check_case_init): Remove.
	(known): Drop "check_case" option.
	* exceptions.cc (open_stackdumpfile): Add comment.
	* fhandler.cc (fhandler_base::get_default_fmode): Call pathmatch
	instead of strcasematch.
	* fhandler_disk_file.cc: Accommodate case-sensitivity of given path
	throughout.
	(__DIR_mounts::check_mount): Unconditionally check virtual paths
	case-sensitive.
	(fhandler_disk_file::link): Drop case clash handling.
	(fhandler_disk_file::open): Ditto.
	(fhandler_disk_file::readdir_helper): Drop managed mount code.
	* mount.cc: Remove managed mount code and datastructures.
	(struct opt): Remove "managed" option.  Add "posix=0" and "posix=1"
	options.
	(fillout_mntent): Remove "managed" output.  Add "posix" output.
	* path.cc (struct symlink_info): Remove case_clash member and
	case_check method.
	(pcheck_case): Remove.
	(path_prefix_p): Take additional bool parameter "caseinsensitive".
	(pathnmatch): Ditto.
	(pathmatch): Ditto.
	(mkrelpath): Ditto.
	(fs_info::update): Set caseinsensitive flag according to file system
	name and FILE_CASE_SENSITIVE_SEARCH flag.  Add comment.
	(tfx_chars_managed): Remove.
	(transform_chars): Drop "managed" parameter.  Always use tfx_chars.
	(get_nt_native_path): Drop "managed" parameter.  Make sure drive letters
	are always upper case.
	(getfileattr): Change second parameter to denote caseinsensitivity.
	(path_conv::check): Initialize caseinsensitive to OBJ_CASE_INSENSITIVE.
	Set caseinsensitive according to global obcaseinsensitive flag, file
	system case sensitivity and MOUNT_NOPOSIX mount flag.
	Drop case_clash and all the related code.
	(symlink_worker): Drop case clash handling.
	(symlink_info::set): Drop setting case_clash.
	(symlink_info::case_check): Remove.
	(cwdstuff::set): Add comment.
	(etc::init): Take path_conv instead of PUNICODE_STRING as parameter to
	allow case sensitivity.
	* path.h (enum pathconv_arg): Drop PC_SYM_IGNORE.
	(enum case_checking): Remove.
	(enum path_types): Drop PATH_ENC, add PATH_NOPOSIX flag.
	(struct fs_info): Add caseinsensitive flag and accessor methods.
	(class path_conv): Add caseinsensitive member and define
	objcaseinsensitive method.  Drop case_clash member and isencoded method.
	(pathmatch): Change prototype according to above change.
	(pathnmatch): Ditto.
	(path_prefix_p): Ditto.
	(get_nt_native_path): Ditto.
	(class etc): Ditto.
	(fnunmunge): Remove prototype.
	* shared.cc (shared_info::init_obcaseinsensitive): Initialize
	obcaseinsensitive flag from obcaseinsensitive registry value.
	(shared_info::initialize): Call init_obcaseinsensitive here by the
	first process creating the shared memory.
	* shared_info.h (mount_item::fnmunge): Remove.
	(shared_info::obcaseinsensitive): Rename from obcaseinsensitivity.
	(shared_info::init_obcaseinsensitive): Declare.
	* syscalls.cc (try_to_bin): Add comment.
	* include/sys/mount.h (MOUNT_ENC): Remove flag.
	(MOUNT_NOPOSIX): Add flag.
2008-07-16 20:20:45 +00:00
Corinna Vinschen eba32ec829 * cygwin.din (futimens): Export.
(utimensat): Export.
	* fhandler.cc (fhandler_base::utimens): Replace fhandler_base::utimes.
	Call utimens_fs.
	* fhandler.h (class fhandler_base): Declare utimens_fs instead of
	utimes_fs, utimens instead of utimes.
	(class fhandler_disk_file): Declare utimens instead of utimes.
	* fhandler_disk_file.cc (fhandler_disk_file::utimens): Replace
	fhandler_disk_file::utimes.
	(fhandler_base::utimens_fs): Replace fhandler_base::utimes_fs.
	Implement tv_nsec handling according to SUSv4.
	* syscalls.cc (utimensat): New function.
	* times.cc (timespec_to_filetime): New function.
	(timeval_to_timespec): New function.
	(utimens_worker): Replace utimes_worker.
	(utimes): Convert timeval to timespec and call utimens_worker.
	(lutimes): Ditto.
	(futimens): Take over implementation from futimes.
	(futimes): Convert timeval to timespec and call futimens.
	* winsup.h (timespec_to_filetime): Declare.
	* include/cygwin/version.h: Bump API minor number.
	* posix.sgml: Add SUSv4 section.  Add futimens and utimensat to it.
2008-04-24 09:59:54 +00:00
Christopher Faylor b13e6864f5 Remove unneeded header files from source files throughout. 2008-04-07 18:45:59 +00:00
Corinna Vinschen 4a971ce403 * fhandler.h (fhandler_base::pc): Make public.
* fhandler_disk_file.cc (fhandler_disk_file::link): Drop extern
	declaration of stat_suffixes.  Use NT native path in debug output.
	(fhandler_base::utimes_fs): Simplify closeit case.  Use close_fs
	to close newly opened file handle.
	(fhandler_base::open_fs): Use NT native path in debug output.
	* path.cc: Throughout drop extern declaration of stat_suffixes.
	* path.h (stat_suffixes): Declare.
	* sec_acl.cc (acl_worker): Drop extern declaration of stat_suffixes.
	* times.cc (utimes_worker): Take path_conv as parameter instead of
	single-byte pathnam, drop nofollow argument, accommodate throughout.
	Compare UNICODE paths when enumerating file descriptors.  Fix
	formatting.  Use NT native path in debug output.
2007-08-14 14:48:52 +00:00
Corinna Vinschen a5a0080d9c * times.cc (gettimeofday): Align definition to POSIX. 2007-07-06 20:09:23 +00:00
Corinna Vinschen c467d17e7c * times.cc: Define __timezonefunc__ before including time.h to protect
definition of timezone function.
2007-07-04 10:43:29 +00:00
Corinna Vinschen eef57fe1e3 * fhandler.cc (fhandler_base::set_no_inheritance): Always use
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 17:09:46 +00:00
Corinna Vinschen e9095199cc * fhandler.cc (fhandler_base::write): Remove wincap.has_lseek_bug case.
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 16:22:38 +00:00
Christopher Faylor 7f8c7bff6f * times.cc (clock_getres): Use correct conversion from milliseconds to
seconds/nanoseconds.
(clock_setres): Use correct conversion to nanoseconds.
2006-02-11 00:06:50 +00:00
Christopher Faylor 56b5372519 * times.cc (hires_ms::usecs): Subtract from slop from system time or we'll
always end up priming the pump.
2005-12-13 02:55:11 +00:00
Christopher Faylor d090ee8081 * times.cc (systime): Correct precision referenced in comment.
* fhandler_tty.cc (fhandler_tty_slave::open): Don't free original windows
station since that will cause strange problems displaying fonts.  Reset windows
station to original station after creating console.
* times.cc (hires_ms::usecs): Only reprime when calculated time is less than
system time.
2005-12-13 02:02:51 +00:00
Christopher Faylor c9da5a2183 * times.cc (hires_ms::usecs): Correct order when checking if high precision
time is <= current time.
2005-12-13 00:43:46 +00:00
Christopher Faylor 6c9a5ebbfc * hires.h (hires_ms::initime_ms): Delete.
(hires_ms::initime_us): Just define as LONGLONG.
(hires_ms::uptime): New function.
* select.cc (select_stuff::wait): Use gtod for timing to attempt to avoid
windows 32 bit wraparound.
* times.cc (systime): New function.
(times): Replace GetTickCount with gtod.uptime.
(hires_us::prime): Use systime() to calculate system time rather than calling
GetSystemTimeAsFileTime directly.
(hires_ms::prime): Ditto.  Eliminate initime_ms.
(hires_ms::usecs): Try harder to detect wraparound.
* fhandler_proc.cc (format_proc_partitions): Set drive_size to zero to avoid a
compiler warning.
2005-12-07 22:28:49 +00:00
Christopher Faylor 1740d2580b * times.cc (hires_ms::prime): Remove debugging stuff.
(hires_ms::usecs): Ditto.
2005-11-30 18:14:07 +00:00
Christopher Faylor 4c57fb4960 * times.cc (timezone): Put back (void).
* include/cygwin/time.h: Add more cygwin stuff from newlib.
2005-11-18 15:57:16 +00:00
Christopher Faylor 9a858ffa7f * times.cc (hires_ms::prime): Don't escalate the priority. 2005-11-16 05:12:11 +00:00
Christopher Faylor ecb908f699 * cygheap.h (init_cygheap::_gtod): Remove.
* cygwin.din: Export clock_getres and clock_setres.
* hires.h (hires_ms::minperiod): Delete declaration.
(hires_ms::began_period): Ditto.
(hires_ms::prime): Make void.
(hires_ms::resolution): Just define here.
(hires_ms::usecs): Remove unneeded argument.
(gtod): Redeclare as a variable.
* timer.cc (timer_thread): Eliminate argument to gtod.usecs().
(timer_tracker::gettime): Ditto.
(timer_tracker::settime): Ditto.
* times.cc (gettimeofday): Ditto.
(hires_ms::began_period): Delete declaration.
(hires_us::prime): Remove debugging.
(hires_ms::prime): Make void.  Eliminate period stuff.
(hires_ms::usecs): Eliminate argument to gtod.usecs().
(hires_ms::resolution): New function.
(clock_getres): Ditto.
(clock_setres): Ditto.
* version.h: Bump API version to 143.
* include/cygwin/time.h: New file.
2005-11-11 16:42:15 +00:00
Christopher Faylor b600843ae4 * times.cc (hires_ms::prime): Comment out call to timeBeginPeriod for now.
(hires_ms::usecs): Call prime if haven't called began_period().
* param.h: Don't define stuff that is already defined in endian.h.
2005-11-11 04:07:30 +00:00
Corinna Vinschen 39f7ae0616 * times.cc (futimes): Redirect to utimes_worker if given file
descriptor is opened R/O.
2005-11-07 17:08:08 +00:00
Christopher Faylor 72319550c1 * cygheap.h (init_cygheap::_gtod): New hires_ms element.
* hires.h (hires_ms::minperiod): Remove static designation.
(hires::began_period): New field.
* signal.cc: Include headers required for cygheap.h now that gtod lives in the
cygheap.
* timer.c: Ditto.
* times.cc (gtod): Delete variable.
(gtod::minperiod): Ditto.
(gtod::began_period): Define.
(hires_ms::prime): Add more debugging output.  Call timeBeginPeriod only when
!began_period.
2005-11-04 20:45:56 +00:00
Christopher Faylor f359a29fc8 * times.cc (hires_ms::prime): More debugging.
(hires_ms::usecs): Ditto.
2005-11-04 17:38:32 +00:00
Christopher Faylor 86548162b0 * times.cc (stupid_printf): Define and use throughout -- temporarily. 2005-11-04 02:01:45 +00:00
Christopher Faylor 314f743e1e * times.cc (hires_ms::prime): Add lots of temporary debugging output. 2005-11-03 14:59:23 +00:00
Christopher Faylor 369adcf72f * times.cc (hires_ms::minperiod): Make copy-on-fork.
(gettimeofday): Remove temporary debugging.
(hires_us::prime): Add lots of temporary debugging output.
2005-11-03 02:41:51 +00:00