summaryrefslogtreecommitdiffstats
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
commitd4cab5cd66af1263de18681a5b09940abcc71a95 (patch)
tree6aa26039a5949f42bd879914ef2f124c5144a392 /time.c
parent90248f8b33cdc1467dbdfc9035cda7a9f7af22c0 (diff)
downloadruby-d4cab5cd66af1263de18681a5b09940abcc71a95.tar.gz
ruby-d4cab5cd66af1263de18681a5b09940abcc71a95.tar.xz
ruby-d4cab5cd66af1263de18681a5b09940abcc71a95.zip
* 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: http://svn.ruby-lang.org/repos/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 9acc00f7a..4648611ef 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);