From owner-freebsd-bugs Fri Oct 26 0: 0:27 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 BB9DD37B403 for ; Fri, 26 Oct 2001 00:00:21 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9Q70LS00522; Fri, 26 Oct 2001 00:00:21 -0700 (PDT) (envelope-from gnats) Date: Fri, 26 Oct 2001 00:00:21 -0700 (PDT) Message-Id: <200110260700.f9Q70LS00522@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Poul-Henning Kamp Subject: Re: i386/31504: nanosleep() strange behavior Reply-To: Poul-Henning Kamp 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 The following reply was made to PR i386/31504; it has been noted by GNATS. From: Poul-Henning Kamp To: Vladimir Birjukov Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: i386/31504: nanosleep() strange behavior Date: Fri, 26 Oct 2001 08:55:51 +0200 In message <200110260649.f9Q6ntN98813@freefall.freebsd.org>, Vladimir Birjukov writes: >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 nanosleep() has a resolution if 1/hz. By default your hz is 100 which is where your 10 msec comes from. You can increas hz to 1000 with no problems, 10000 works as well on some hardware, but there is a bug in the tty c_cc[VTIME] handling which gets increasingly bothersome for increasing hz -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message