public inbox for linux-gpio@vger.kernel.org
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: andy.shevchenko@gmail.com
Cc: Gabriel Matni <gabriel.matni@exfo.com>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [libgpiod][PATCH] tools: gpiomon: add timeout option
Date: Tue, 30 May 2023 21:09:00 +0800	[thread overview]
Message-ID: <ZHX1bEThvg8Cq8zD@sol> (raw)
In-Reply-To: <ZHXcLvUNvw75Z-3W@surfacebook>

On Tue, May 30, 2023 at 02:21:18PM +0300, andy.shevchenko@gmail.com wrote:
> Tue, May 30, 2023 at 05:29:23PM +0800, Kent Gibson kirjoitti:
> > On Mon, May 29, 2023 at 08:20:44PM +0000, Gabriel Matni wrote:
> > > From: Gabriel Matni <gabriel.matni@exfo.com>
> 
> ...
> 
> > My preferred solution is to run gpiomon as a coproc and have the
> > controlling script perform the timeout. e.g.
> > 
> > #!/bin/env bash
> 
> Oh, this is too bad.
> 
> > coproc gpiomon "$@"
> > while :
> > do
> >         read -t5 -u ${COPROC[0]} event || break
> >         echo $event
> > done
> > kill $COPROC_PID
> 
> I'm wondering what coproc is and why it requires bash.
> 

And I'm wondering why your mail got to the list, but not to me directly,
despite being directly addressed.  It isn't even in my junk folder.
And it was gmail to gmail.  Now that is weird.

Anyway, coproc is a feature of many shells, such as bash, zsh, ksh.
I don't think or ash or dash have coproc, but then you cn always use named
pipes to similar effect.  It would be similar to the simple gpioset
daemon I posted the other day, just in reverse.

I did say that coproc was my preferred solution, not that it is the only
one. 

> What I want to have and keep that working is that all our tools can be run in
> Busybox environment (embedded application). That's why I'm against seeing bash
> in any form of the tooling.
> 

It isn't IN the tooling.  It is in the shell that calls the tooling.
The tool test suite does require bash, but that is due to the framework we
use, not coproc.

I take it you would be in favour of an idle timeout option then?

I'm puzzled why no one has ever asked for it before, if it is something
that is in demand.

Cheers,
Kent.

  reply	other threads:[~2023-05-30 13:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 20:20 [libgpiod][PATCH] tools: gpiomon: add timeout option Gabriel Matni
2023-05-30  9:29 ` Kent Gibson
2023-05-30 11:21   ` andy.shevchenko
2023-05-30 13:09     ` Kent Gibson [this message]
2023-05-30 19:10       ` Bartosz Golaszewski
2023-05-31  1:26         ` Kent Gibson
2023-05-31 13:56           ` [E!] : " Gabriel Matni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZHX1bEThvg8Cq8zD@sol \
    --to=warthog618@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=gabriel.matni@exfo.com \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox