sh: times syscall nowadays takes a struct, update accordingly
authorAlan Cox <alan@linux.intel.com>
Mon, 11 May 2015 21:18:43 +0000 (22:18 +0100)
committerAlan Cox <alan@linux.intel.com>
Mon, 11 May 2015 21:18:43 +0000 (22:18 +0100)
Applications/V7/cmd/sh/defs.h
Applications/V7/cmd/sh/xec.c

index aaa7459..0ac03d1 100644 (file)
@@ -5,7 +5,7 @@
 #include <stddef.h>
 #include <unistd.h>
 #include <stdlib.h>
-
+#include <sys/times.h>
 /*
  *     UNIX shell
  */
@@ -345,7 +345,7 @@ extern void blank(void);
 extern void prp(void);
 extern void prs(const char *as);
 extern void prc(char c);
-extern void prt(L_INT t);
+extern void prt(clock_t t);
 extern void prn(int n);
 extern void itos(int n);
 extern int stoi(const char *icp);
index bf3adbb..98f6230 100644 (file)
@@ -83,11 +83,11 @@ int execute(TREPTR argt, int execflg, int *pf1, int *pf2)
 
                                        case SYSTIMES:
                                        {
-                                               L_INT t[4];     /* FIXME: struct for this nowdays */
-                                               times((void *)t);
-                                               prt(t[2]);
+                                               struct tms t;
+                                               times(&t);
+                                               prt(t.tms_cutime);
                                                blank();
-                                               prt(t[3]);
+                                               prt(t.tms_cstime);
                                                newline();
                                        }
                                        break;