Work around bug in Ultrix: the `times' system call sometimes returns
authorChris Hanson <org/chris-hanson/cph>
Wed, 24 Jul 1991 01:29:29 +0000 (01:29 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 24 Jul 1991 01:29:29 +0000 (01:29 +0000)
negative numbers (other than -1) when there are no errors.  The
STD_VOID_SYSTEM_CALL macro checks for result <0, so perform explicit
check for result =-1.

v7/src/microcode/uxenv.c

index 8d5693c927e7277558450ddaf9e59dfbfc9f7580..e5f7188c47804158ddce125b83667fdbf635882b 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxenv.c,v 1.3 1991/01/24 11:25:41 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxenv.c,v 1.4 1991/07/24 01:29:29 cph Exp $
 
-Copyright (c) 1990-1 Massachusetts Institute of Technology
+Copyright (c) 1990-91 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -72,7 +72,11 @@ DEFUN_VOID (OS_process_clock)
 {
   clock_t ct = (UX_SC_CLK_TCK ());
   struct tms buffer;
-  STD_VOID_SYSTEM_CALL (syscall_times, (UX_times (&buffer)));
+  /* Was STD_VOID_SYSTEM_CALL, but at least one version of Ultrix
+     returns negative numbers other than -1 when there are no errors.  */
+  while ((UX_times (&buffer)) == (-1))
+    if (errno != EINTR)
+      error_system_call (errno, syscall_times);
   return
     (((((buffer . tms_utime) - initial_process_clock) * 2000) + ct) /
      (2 * ct));