From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from math.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with SMTP id VAA02845 for ; Thu, 23 Nov 1995 21:37:14 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA27851; Thu, 23 Nov 1995 05:13:15 -0500 Resent-Date: Thu, 23 Nov 1995 11:12:47 +0100 Old-Return-Path: Message-Id: <9511231012.AA14552@sgi.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: timing builtins etc. Date: Thu, 23 Nov 1995 11:12:47 +0100 From: Peter Stephenson Resent-Message-Id: <"kn9B8.0.5p6.xa4jm"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/636 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu (Thought I'd sent this: it looks like I exited Emacs before MH finished sending it.) I have been working on the bug that builtins and shell functions can't be timed. I found a neat way of doing it which simply involved adding the current process to the job list. This even supplied a more natural way of fixing the previous bug that a builtin run at the end of the pipeline lost its status to something before. It was all very swish, and it works fine for builtins. Unfortunately it doesn't work for shell functions. The culprit is the list_pipe code in exec.c, which randomly deletes the job from the table and it gets used for other purposes later (you can't simply hijack the new current job). So the code worked where the shell function was inside a pipe, such as `echo foo | fn', but not on its own. Unfortunately, too, the list_pipe code is horrendously complicated and completely uncommented and I've never understood any of it. Can anybody suggest anything? Does anybody know why it randomly deletes jobs? Isn't there a neater way of fixing the original problem? I'm tempted to pretend that the code is already in a pipeline when `time' is used. I'm not quite sure yet what effect this will have. -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.