This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] Refactor nanosleep in terms of clock_nanosleep


* Adhemerval Zanella:

> +++ b/sysdeps/mach/clock_nanosleep.c

> +static struct timespec
> +timespec_sub (struct timespec a, struct timespec b)
> +{
> +  struct timespec result = { a.tv_sec - b.tv_sec,
> +			     a.tv_nsec - b.tv_nsec };
> +  if (result.tv_nsec < 0)
> +    {
> +      --result.tv_sec;
> +      result.tv_nsec += 1000000000ul;
> +    }
> +  return result;
> +}

Can you use the version in <posix-timers.h>?

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]