openat64.c 493 B

12345678910111213141516171819202122232425
  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. #define openat64 __xx_openat
  9. #include <sys/syscall.h>
  10. #include <fcntl.h>
  11. #undef openat64
  12. #ifdef __UCLIBC_HAS_LFS__
  13. #ifdef __NR_openat
  14. int openat64(int fd, const char *file, int oflag, mode_t mode)
  15. {
  16. return openat(fd, file, oflag | O_LARGEFILE, mode);
  17. }
  18. #else
  19. /* should add emulation with open() and /proc/self/fd/ ... */
  20. #endif
  21. #endif