futimens.c 858 B

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