From owner-freebsd-bugs Thu Oct 25 23:50:12 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4753037B408 for ; Thu, 25 Oct 2001 23:50:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9Q6o1n98874; Thu, 25 Oct 2001 23:50:01 -0700 (PDT) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 56F3937B408 for ; Thu, 25 Oct 2001 23:49:55 -0700 (PDT) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9Q6ntN98813; Thu, 25 Oct 2001 23:49:55 -0700 (PDT) (envelope-from nobody) Message-Id: <200110260649.f9Q6ntN98813@freefall.freebsd.org> Date: Thu, 25 Oct 2001 23:49:55 -0700 (PDT) From: Vladimir Birjukov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: i386/31504: nanosleep() strange behavior Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 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