clock_nanosleep for uClibc 0.9.27

Baruch Siach baruch at tkos.co.il
Tue Oct 7 19:56:30 UTC 2014


Hi Travis,

On Tue, Oct 07, 2014 at 03:40:28PM -0400, Travis J. Weaver wrote:
> Where would I put this? In a file called clock_nanosleep.c in the librt
> directory? If so, are there any "includes" that I need to include?
> time.h/errno.h/syscall.h?

Just put it near the code using clock_nanosleep() as part of your program 
source. You need to include unistd.h and sys/syscall.h. See the syscall(2) man 
page.

baruch

> -----Original Message-----
> From: Baruch Siach [mailto:baruch at tkos.co.il] 
> Sent: Tuesday, October 07, 2014 3:22 PM
> To: Travis J. Weaver
> Cc: uclibc at uclibc.org
> Subject: Re: clock_nanosleep for uClibc 0.9.27
> 
> Hi Travis,
> 
> On Tue, Oct 07, 2014 at 12:56:14PM -0400, Travis J. Weaver wrote:
> > I know I'm using an older uClibc version. This is what is in my SDK 
> > and instead of retooling or upgrading the whole thing, I'm wondering 
> > if there is a possible patch that can work for this version that would 
> > give me the use of clock_nanosleep? If not, what are some possible 
> > suggestions that I can try? Would a later version of uClibc that has 
> > clock_nanosleep work with my current kernel?
> >  
> > uClibc: 0.9.27
> > Kernel: 2.6.30.4
> 
> How about (untested):
> 
> int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec
> *request,
>                            struct timespec *remain) {
> 	return syscall(__NR_clock_nanosleep, clock_id, flags, request,
> remain); }
> 
> baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -


More information about the uClibc mailing list