From da5b1681d7c9362f5e44964397bc01904493978c Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 24 Jul 1991 01:29:29 +0000 Subject: [PATCH] Work around bug in Ultrix: the `times' system call sometimes returns 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/v7/src/microcode/uxenv.c b/v7/src/microcode/uxenv.c index 8d5693c92..e5f7188c4 100644 --- a/v7/src/microcode/uxenv.c +++ b/v7/src/microcode/uxenv.c @@ -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)); -- 2.25.1