From: Nicolas F. <nic...@wa...> - 2004-03-04 11:01:05
|
Chris Cannam wrote: >On Thursday 04 Mar 2004 9:32 am, Guillaume Laurent wrote: > > >>Second, before resorting to such hacks, you should try to >>understand why including time.h doesn't work. >> >> > >Actually I suspect that nanosleep may be a newer addition to glibc >than its man page lets on. > >The only reason we're using it is that the usleep man page says usleep >is deprecated in favour of nanosleep. We don't need the extra >resolution of nanosleep, and on Linux it doesn't actually give us the >extra theoretical resolution anyway. > >So I suggest we return to usleep. Here's the change, for anyone >needing to fix this themselves: look for the function >SoundDriver::sleep() in sound/SoundDriver.cpp, and replace it with > >void >SoundDriver::sleep(const RealTime &rt) >{ > unsigned long usec = rt.sec * 1000000 + rt.usec(); > usleep(usec); >} > >I'll apply this in CVS too. > > >Chris > > Thanks I'll do that for now. But I don't understand why nanosleep is unresolved whereas when I use nm on libc here is what I get : $ nm /lib/libc.so.6 |grep nano 000a6340 T __libc_nanosleep 000a6340 W nanosleep 000a6340 t __nanosleep so nanosleep is there isn't it ? I am a newbie in programming so sorry if my question is stupid. Nicolas. |