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
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-02-22 19:22:38 +0300
committerCorinna Vinschen <corinna@vinschen.de>2007-02-22 19:22:38 +0300
commite9095199cc90f0d01e4ec8cb270c81a0ef3dfd74 (patch)
tree2d6a69872d8d4297ef43197dcc722b41d0effbec /winsup/cygwin/times.cc
parent501f1020f94e73eedaf581c1371387e2ae0edb8b (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r--winsup/cygwin/times.cc40
1 files changed, 14 insertions, 26 deletions
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 3922caf31..f3a6f0e21 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -75,33 +75,21 @@ times (struct tms *buf)
/* Ticks is in milliseconds, convert to our ticks. Use long long to prevent
overflow. */
clock_t tc = (clock_t) (ticks * CLOCKS_PER_SEC / 1000);
- if (wincap.has_get_process_times ())
- {
- GetProcessTimes (hMainProc, &creation_time, &exit_time,
- &kernel_time, &user_time);
-
- syscall_printf ("ticks %d, CLOCKS_PER_SEC %d", ticks, CLOCKS_PER_SEC);
- syscall_printf ("user_time %d, kernel_time %d, creation_time %d, exit_time %d",
- user_time, kernel_time, creation_time, exit_time);
- buf->tms_stime = __to_clock_t (&kernel_time, 0);
- buf->tms_utime = __to_clock_t (&user_time, 0);
- timeval_to_filetime (&myself->rusage_children.ru_stime, &kernel_time);
- buf->tms_cstime = __to_clock_t (&kernel_time, 1);
- timeval_to_filetime (&myself->rusage_children.ru_utime, &user_time);
- buf->tms_cutime = __to_clock_t (&user_time, 1);
- }
- else
- /* GetProcessTimes() does not work for non-NT versions of Windows. The
- return values are undefined, so instead just copy the ticks value
- into utime so that clock() will work properly on these systems */
- {
- buf->tms_utime = tc;
- buf->tms_stime = 0;
- buf->tms_cstime = 0;
- buf->tms_cutime = 0;
- }
- return tc;
+ GetProcessTimes (hMainProc, &creation_time, &exit_time,
+ &kernel_time, &user_time);
+
+ syscall_printf ("ticks %d, CLOCKS_PER_SEC %d", ticks, CLOCKS_PER_SEC);
+ syscall_printf ("user_time %d, kernel_time %d, creation_time %d, exit_time %d",
+ user_time, kernel_time, creation_time, exit_time);
+ buf->tms_stime = __to_clock_t (&kernel_time, 0);
+ buf->tms_utime = __to_clock_t (&user_time, 0);
+ timeval_to_filetime (&myself->rusage_children.ru_stime, &kernel_time);
+ buf->tms_cstime = __to_clock_t (&kernel_time, 1);
+ timeval_to_filetime (&myself->rusage_children.ru_utime, &user_time);
+ buf->tms_cutime = __to_clock_t (&user_time, 1);
+
+ return tc;
}
EXPORT_ALIAS (times, _times)