From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 28 01:41:33 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6537316A4DA for ; Fri, 28 Jul 2006 01:41:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0011B43D46 for ; Fri, 28 Jul 2006 01:41:32 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k6S1cQIm045641; Thu, 27 Jul 2006 19:38:26 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 27 Jul 2006 19:38:44 -0600 (MDT) Message-Id: <20060727.193844.-432837881.imp@bsdimp.com> To: scheidell@secnap.net From: "M. Warner Losh" In-Reply-To: <44C670BA.6060608@secnap.net> References: <44C63DD2.9080705@freebsd.org> <44C6509E.4090708@secnap.net> <44C670BA.6060608@secnap.net> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Thu, 27 Jul 2006 19:38:26 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: FBSD 5.5 and software timers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2006 01:41:33 -0000 In message: <44C670BA.6060608@secnap.net> Michael Scheidell writes: : Found it! library libc_r : : Given POC: : : int main( int argc, char **argv ) : { : char execs1[256] = "/bin/date +A%Y%m%d%H%M.%S"; : char execs2[256] = "/bin/date +B%Y%m%d%H%M.%S"; : int a; : : while ( 1) { : : system( execs1 ); : usleep( 500*1000); : system( execs2 ); : } : : return 0; : } /* main */ : : compile with: : cc -g -c nanotest.c : cc -g -o nanotest nanotest.o : : everything works as expected. : : time forward, back, doesn't matter (date prints out wallclock, : nanosleep() sleeps 500*1000*1000us (.5 seconds) : : this breaks it: : cc -g -c nanotest.c : cc -g -o nanotest nanotest.o -lc_r : : setting clock back 'hangs' during usleep (500*1000) : didn't hang on 5.4. : I will be writing up a bug report shortly. libc_r depends on absolute system time to do its sleeps and timeouts, and has since FreeBSD 3.4. This dependency has been the result of many conversations over time, and has had several patches posted. Since libc_r is dead technology, there's little chance they will be adopted. Warner