openat64.c 586 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * openat() for uClibc
  3. *
  4. * Copyright (C) 2009 Analog Devices Inc.
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <_lfs_64.h>
  9. #include <sys/syscall.h>
  10. #include <fcntl.h>
  11. #include <stdarg.h>
  12. #ifdef __NR_openat
  13. static int __openat64(int fd, const char *file, int oflag, ...)
  14. {
  15. va_list ap;
  16. mode_t mode;
  17. va_start(ap, oflag);
  18. mode = va_arg(ap, int);
  19. va_end(ap);
  20. return openat(fd, file, oflag | O_LARGEFILE, mode);
  21. }
  22. strong_alias_untyped(__openat64,openat64)
  23. #else
  24. /* should add emulation with open() and /proc/self/fd/ ... */
  25. #endif