futimens.c 833 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * futimens() implementation for uClibc
  3. *
  4. * Copyright (C) 2009 Bernhard Reutner-Fischer <uclibc@uclibc.org>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <sys/syscall.h>
  9. #include <time.h>
  10. #ifdef __NR_utimensat
  11. /* To avoid superfluous warnings about passing NULL to the non-null annotated
  12. * 2nd param "__path" below, we bypass inclusion of sys/stat.h and use
  13. * a non annotated, local decl.
  14. * Note that due to not including the header, we have to alias the call
  15. * manually.
  16. */
  17. extern int utimensat (int __fd, const char *__path,
  18. const struct timespec __times[2],
  19. int __flags) __THROW;
  20. libc_hidden_proto(utimensat)
  21. int futimens (int __fd, const struct timespec __times[2]) __THROW;
  22. int futimens (int fd, const struct timespec ts[2])
  23. {
  24. return utimensat(fd, 0, ts, 0);
  25. }
  26. #endif