summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-16 07:53:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-16 07:53:21 +0000
commite1c29a3f13a8d5ca0f9a4e491a752c73aca1d721 (patch)
tree6aa26039a5949f42bd879914ef2f124c5144a392 /time.c
parent9ac8f70f3da942e8a1bc6cadc87cbeaaec2bf44f (diff)
* io.c (set_outfile): f should be the FILE* from the assigning value.
* ext/socket/socket.c (tcp_s_open): should not give default value to local_host. * time.c (time_s_times): move to Process::times. * file.c (rb_file_s_lchmod): new method File::lchmod. * file.c (rb_file_s_lchown): new method File::lchown. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/time.c b/time.c
index 9acc00f7a6..4648611ef8 100644
--- a/time.c
+++ b/time.c
@@ -26,18 +26,11 @@ struct timeval {
#endif
#endif /* NT */
-#ifdef HAVE_SYS_TIMES_H
-#include <sys/times.h>
-#endif
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
VALUE rb_cTime;
-#if defined(HAVE_TIMES) || defined(NT)
-static VALUE S_Tms;
-#endif
struct time_object {
struct timeval tv;
@@ -953,25 +946,8 @@ static VALUE
time_s_times(obj)
VALUE obj;
{
-#if defined(HAVE_TIMES) && !defined(__CHECKER__)
-#ifndef HZ
-# ifdef CLK_TCK
-# define HZ CLK_TCK
-# else
-# define HZ 60
-# endif
-#endif /* HZ */
- struct tms buf;
-
- if (times(&buf) == -1) rb_sys_fail(0);
- return rb_struct_new(S_Tms,
- rb_float_new((double)buf.tms_utime / HZ),
- rb_float_new((double)buf.tms_stime / HZ),
- rb_float_new((double)buf.tms_cutime / HZ),
- rb_float_new((double)buf.tms_cstime / HZ));
-#else
- rb_notimplement();
-#endif
+ rb_warn("obsolete method Time::times; use Process::times");
+ return rb_proc_times(obj);
}
static VALUE
@@ -1113,10 +1089,6 @@ Init_Time()
rb_define_method(rb_cTime, "strftime", time_strftime, 1);
-#if defined(HAVE_TIMES) || defined(NT)
- S_Tms = rb_struct_define("Tms", "utime", "stime", "cutime", "cstime", 0);
-#endif
-
/* methods for marshaling */
rb_define_method(rb_cTime, "_dump", time_dump, -1);
rb_define_singleton_method(rb_cTime, "_load", time_load, 1);