Re: FBSD 5.5 and software timers

[ Available lists | Index of freebsd-hackers | Month of Jul 2006 | Week of 28 Jul 2006 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
M. Warner Losh <imp@bsdimp.com>
Date
28 Jul 2006 01:41:33
Subject
Re: FBSD 5.5 and software timers
Message-ID
20060727.193844.-432837881.imp@bsdimp.com

In reply to

[ Hide this part ]
In message: <44C670BA.6060608@secnap.net>
Michael Scheidell <scheidell@secnap.net> 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


Elapsed time: 0.105 seconds