open64.c 898 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. #include <features.h>
  7. #include <fcntl.h>
  8. #include <stdarg.h>
  9. #ifdef __UCLIBC_HAS_LFS__
  10. #ifndef O_LARGEFILE
  11. # define O_LARGEFILE 0100000
  12. #endif
  13. extern int __libc_open (__const char *__file, int __oflag, ...) __nonnull ((1));
  14. libc_hidden_proto(__libc_open)
  15. /* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
  16. a third argument is the file protection. */
  17. int __libc_open64 (const char *file, int oflag, ...)
  18. {
  19. int mode = 0;
  20. if (oflag & O_CREAT)
  21. {
  22. va_list arg;
  23. va_start (arg, oflag);
  24. mode = va_arg (arg, int);
  25. va_end (arg);
  26. }
  27. return __libc_open(file, oflag | O_LARGEFILE, mode);
  28. }
  29. libc_hidden_proto(open64)
  30. strong_alias(__libc_open64,open64)
  31. libc_hidden_def(open64)
  32. #endif /* __UCLIBC_HAS_LFS__ */