[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#29662: marked as done (sleep(2) doesn't sleep well)



Your message dated Sun, 30 Jul 2000 14:55:09 -0400
with message-id <20000730145509.U259@visi.net>
and subject line This is not a bug
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 18 Nov 1998 16:07:04 +0000
Received: (qmail 1448 invoked from network); 18 Nov 1998 16:07:01 -0000
Received: from mail.cs.tu-berlin.de (root@130.149.17.13)
  by master.debian.org with SMTP; 18 Nov 1998 16:07:01 -0000
Received: from bolero.cs.tu-berlin.de (doko@bolero.cs.tu-berlin.de [130.149.19.1])
	by mail.cs.tu-berlin.de (8.9.1/8.9.1) with ESMTP id RAA27113
	for <submit@bugs.debian.org>; Wed, 18 Nov 1998 17:04:53 +0100 (MET)
From: Matthias Klose <doko@cs.tu-berlin.de>
Received: (from doko@localhost)
	by bolero.cs.tu-berlin.de (8.9.1/8.9.0) id RAA08499
	for submit@bugs.debian.org; Wed, 18 Nov 1998 17:04:50 +0100 (MET)
Date: Wed, 18 Nov 1998 17:04:50 +0100 (MET)
Message-Id: <199811181604.RAA08499@bolero.cs.tu-berlin.de>
To: submit@bugs.debian.org
Subject: sleep(3) doesn't sleep well

Package: libc6
Version: 2.0.7u-5
Severity: important

suspending a process, when it sleeps (sleep(3)), terminates the sleep.

cat s.c
#include <unistd.h>

int main()
{
        sleep(1000);
        return 0;
}

- start the process in the foreground
- suspend it with ^Z
- send it in the background with bg
- the process terminates.
---------------------------------------
Received: (at 29662-done) by bugs.debian.org; 30 Jul 2000 18:55:14 +0000
>From bmc@visi.net Sun Jul 30 13:55:14 2000
Return-path: <bmc@visi.net>
Received: from ppp01.ts2-2.newportnews.visi.net (blimpo.internal.net) [209.8.198.1] 
	by master.debian.org with esmtp (Exim 3.12 2 (Debian))
	id 13IyEx-0003Zw-00; Sun, 30 Jul 2000 13:55:12 -0500
Received: from bmc by blimpo.internal.net with local (Exim 3.12 #1 (Debian))
	id 13IyEv-0005ss-00
	for <29662-done@bugs.debian.org>; Sun, 30 Jul 2000 14:55:09 -0400
Date: Sun, 30 Jul 2000 14:55:09 -0400
From: Ben Collins <bcollins@debian.org>
To: 29662-done@bugs.debian.org
Subject: This is not a bug
Message-ID: <20000730145509.U259@visi.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.0.1i
Sender: Ben Collins <bmc@visi.net>
Delivered-To: 29662-done@bugs.debian.org

After reading the sleep(3) documentation, it is apparent that you are not
using sleep() properly. Note it reads that sleep() will return 0 when done
or the number of seconds left to sleep. So the snippet below would be the
proper usage:

	#include <unistd.h>

	int main()
	{
		int t = 1000;
		while ((t = sleep(t)) > 0); /* do nothing */
		return 0;
	}

Sleep(3) is not required to wait the entire time, so subsequent calls may be
needed to complete the entire time. Closing this bug report as such.

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'



Reply to: