[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sleep & Co on Linux (was: disown, fg, jobs)
From: |
Sven Mascheck |
Subject: |
sleep & Co on Linux (was: disown, fg, jobs) |
Date: |
21 Jun 2001 15:28:34 +0200 |
User-agent: |
tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u)) |
Paul Jarc <prj@po.cwru.edu> wrote:
> Dan Jacobson <jidanni@kimo.FiXcomTHiS.tw> writes:
>> Is there something funny going on here in bash 2.04?:
> No, that output looks normal.
It looks rather unexpected.
AFAIK, this only happens on Linux.
> [...] don't expect us to guess what.
I agree with you, he could have been more to the point.
The example was also misleading (not related with disown),
on Linux it's just:
$ sleep 100
^Z
[1]+ Stopped sleep 100
$ fg
$
I.e., the sleep(1) is *terminating* on SIGCONT (it sort of died
already on SIGSTOP/TSTP).
The reason is sleep(1) using glibc sleep(3) using nanosleep(2).
This would not happen if sleep(1) used alarm(2) or looked at the return
value of sleep(3) (not common practice) - or if bash had a built-in,
doing one of both, like ksh93 (which uses alarm(2) and works fine)
<http://www.uni-ulm.de/~s_smasch/nanosleep_linux/>
There are too many parties involved (utilities, glibc, kernel), so i guess
this will unecessarily still "live" for a while.
Sven
- disown, fg, jobs, Dan Jacobson, 2001/06/20
- Re: disown, fg, jobs, Paul Jarc, 2001/06/20
- sleep & Co on Linux (was: disown, fg, jobs),
Sven Mascheck <=
- Re: sleep & Co on Linux (was: disown, fg, jobs), Tim Mooney, 2001/06/21
- Re: sleep & Co on Linux (was: disown, fg, jobs), Paul Jarc, 2001/06/21
- Re: sleep & Co on Linux, Sven Mascheck, 2001/06/21
- Re: sleep & Co on Linux, Sven Mascheck, 2001/06/23
Re: disown, fg, jobs, Dan Jacobson, 2001/06/22