Le Sun, 8 Jul 2012 14:01:35 +0000 (UTC)
Thorsten Glaser <[email protected]> a écrit:

> Seb dixit:
> 
> >Is it a bug, or are things expected to be that way for a reason I
> >have missed? :)
> 
> Hrm. On MirBSD, INT ABRT and of course KILL terminate it. But
> sleep is special anyway, even if you don’t get the shell builtin:
> most implementations use a syscall that terminates on ALRM only,
> and they set the signal mask otherwise.

Have you tried in a script, or in an interactive shell? because I've
just noticed even TERM is perfectly honoured in an interactive shell.

Moreover, in a script even cat as a problem:

  /bin/cat /dev/zero >/dev/null &
  kill -s TERM %%
  wait

This never ends (but once again, no problem in an interactive shell).
I've also tried with "-m" (just in case -- dash needs it to control
jobs properly), it doesn't change anything.
 
> I’ve learned to just use kill -ALRM (do not use numbers, they are
> not portable, especially not on Linux) when dealing with sleep.

Good to know about sleep, thanks. I'm surprised, though, about the
signal numbers on Linux, because they are POSIX and properly
described in signal(7). However, here it was just to be more
concise; to code I usually prefer names, which I find more clear.

++
Seb.

Reply via email to