nanosleep.c 610 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. #include <time.h>
  6. #include <cancel.h>
  7. /* Pause execution for a number of nanoseconds. */
  8. int
  9. nanosleep (const struct timespec *requested_time,
  10. struct timespec *remaining)
  11. {
  12. return _syscall2(int, __NC(nanosleep), const struct timespec*,
  13. requested_time, struct timespec* remaining)
  14. }
  15. CANCELLABLE_SYSCALL(int, nanosleep, (const struct timespec *requested_time,
  16. struct timespec *remaining), (requested_time, remaining))
  17. lt_libc_hidden(nanosleep)