Re: [PATCH] Add timeout utility

2008-04-03 Thread Pádraig Brady
take 2 attached. Note I kept the time interval parsing function separate between `kill` and `timeout`, as they operate on different types. Pádraig. >From 95c61d20933a749482c3d1d54eb3b1032735ab75 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?P=C3=A1draig=20Brady?= <[EMAIL PROTECTED]> Date: Fri, 28 Mar 2

Re: [PATCH] Add timeout utility

2008-04-02 Thread Pádraig Brady
Bo Borgerson wrote: > On Wed, Apr 2, 2008 at 10:20 AM, Pádraig Brady <[EMAIL PROTECTED]> wrote: >> It will always go through though as the kernel will buffer it. > > Yes, that introduces some fuzz, but I think the principle remains > viable -- the kernel will only buffer so much. That could be a

Re: [PATCH] Add timeout utility

2008-04-02 Thread Pádraig Brady
Mike Frysinger wrote: > On Wednesday 02 April 2008, Pádraig Brady wrote: >> To be sure, are you referring to races where a signal >> can be received while in the signal handler on some systems? >> >> Also there is the issue of restarting system calls >> after the signal handler has run. >> >> Also

Re: [PATCH] Add timeout utility

2008-04-02 Thread Bo Borgerson
On Wed, Apr 2, 2008 at 10:20 AM, Pádraig Brady <[EMAIL PROTECTED]> wrote: > It will always go through though as the kernel will buffer it. Yes, that introduces some fuzz, but I think the principle remains viable -- the kernel will only buffer so much. Consider the following using a timeout.c mod

Re: [PATCH] Add timeout utility

2008-04-02 Thread Mike Frysinger
On Wednesday 02 April 2008, Pádraig Brady wrote: > Mike Frysinger wrote: > > On Tuesday 01 April 2008, Pádraig Brady wrote: > >> + /* Setup handlers before fork() so that we > >> + * handle any signals caused by child, without races. */ > >> + signal (SIGALRM, cleanup);/* our timeout. */

Re: [PATCH] Add timeout utility

2008-04-02 Thread Pádraig Brady
Bo Borgerson wrote: > Pádraig Brady <[EMAIL PROTECTED]> wrote: >> Subject: [PATCH] Add new program: timeout > > Great idea for a tool! Not my idea TBH: http://mail.linux.ie/pipermail/ilug/2006-November/thread.html#90654 > Have you considered an alternate run-mode where it could operate as a > fi

Re: [PATCH] Add timeout utility

2008-04-02 Thread Bo Borgerson
Pádraig Brady <[EMAIL PROTECTED]> wrote: > Subject: [PATCH] Add new program: timeout Great idea for a tool! Have you considered an alternate run-mode where it could operate as a filter and timeout on 'inactivity' of the pipeline? If, for instance, I have a pipeline that processes a lot of data a

Re: [PATCH] Add timeout utility

2008-04-02 Thread Pádraig Brady
Jim Meyering wrote: > Thanks! > > Pádraig Brady <[EMAIL PROTECTED]> wrote: >> Subject: [PATCH] Add new program: timeout > ... >> +/* Given an integer value *X, and a suffix character, SUFFIX_CHAR, >> + scale *X by the multiplier implied by SUFFIX_CHAR. SUFFIX_CHAR may >> + be the NUL byte or

Re: [PATCH] Add timeout utility

2008-04-02 Thread Jim Meyering
Thanks! Pádraig Brady <[EMAIL PROTECTED]> wrote: > Subject: [PATCH] Add new program: timeout ... > +/* Given an integer value *X, and a suffix character, SUFFIX_CHAR, > + scale *X by the multiplier implied by SUFFIX_CHAR. SUFFIX_CHAR may > + be the NUL byte or `s' to denote seconds, `m' for m

Re: [PATCH] Add timeout utility

2008-04-02 Thread Pádraig Brady
Mike Frysinger wrote: > On Tuesday 01 April 2008, Pádraig Brady wrote: >> + /* Setup handlers before fork() so that we >> + * handle any signals caused by child, without races. */ >> + signal (SIGALRM, cleanup);/* our timeout. */ >> + signal (SIGINT, cleanup); /* Ctrl-C at terminal f

Re: [PATCH] Add timeout utility

2008-04-01 Thread Mike Frysinger
On Tuesday 01 April 2008, Pádraig Brady wrote: > +  /* Setup handlers before fork() so that we > +   * handle any signals caused by child, without races.  */ > +  signal (SIGALRM, cleanup);    /* our timeout.  */ > +  signal (SIGINT, cleanup);     /* Ctrl-C at terminal for example.  */ > +  signal