Date: Thu, 25 Oct 2001 23:49:55 -0700 (PDT) From: Vladimir Birjukov <prg51@morics.riga.post.lv> To: freebsd-gnats-submit@FreeBSD.org Subject: i386/31504: nanosleep() strange behavior Message-ID: <200110260649.f9Q6ntN98813@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 31504
>Category: i386
>Synopsis: nanosleep() strange behavior
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Oct 25 23:50:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Vladimir Birjukov
>Release: 4.4-STABLE
>Organization:
at Home
>Environment:
FreeBSD aizk02.aizk.post.lv 4.4-STABLE FreeBSD 4.4-STABLE #14: Tue Oct 23 12:59:46 EEST 2001 wl@aizk02.aizk.post.lv:/usr/src/sys/compile/PRG51 i386
>Description:
In picprog program (ports/devel/picprog), which work nice in FreeBSD 4.3-RELEASE
after become STABLE lost functioning. Because such fragment
ioctl (fd, TIOCMBIS, &picport::rts_bit); // clock up
delay_100 ();
ioctl (fd, TIOCMBIC, &picport::rts_bit); // clock down
where delay_100 is:
static const struct timespec ns100 = { 0, 100 };
nanosleep (&ns100, 0);
Makes 10 milliseconds pulse instead 0.1 mikrosecond
And I Think some strange behavior in console application may have the same source,
as this described.
>How-To-Repeat:
This code should not work one second.
#include <time.h>
int main() {
int i;
static const struct timespec ns100 = { 0, 100 };
for (i=0; i<100; i++)
nanosleep (&ns100, 0);
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110260649.f9Q6ntN98813>
