openat.c 666 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 openat __xx_openat
  9. #include <sys/syscall.h>
  10. #include <fcntl.h>
  11. #undef openat
  12. #ifdef __NR_openat
  13. /* The openat() prototype is varargs based, but we don't care about that
  14. * here, so need to provide our own dedicated signature.
  15. */
  16. extern int openat(int fd, const char *file, int oflag, mode_t mode);
  17. libc_hidden_proto(openat)
  18. _syscall4(int, openat, int, fd, const char *, file, int, oflag, mode_t, mode)
  19. libc_hidden_def(openat)
  20. #else
  21. /* should add emulation with open() and /proc/self/fd/ ... */
  22. #endif