open64.c 805 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. /* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
  14. a third argument is the file protection. */
  15. int open64 (const char *file, int oflag, ...)
  16. {
  17. mode_t mode = 0;
  18. if (oflag & O_CREAT)
  19. {
  20. va_list arg;
  21. va_start (arg, oflag);
  22. mode = va_arg (arg, mode_t);
  23. va_end (arg);
  24. }
  25. return open(file, oflag | O_LARGEFILE, mode);
  26. }
  27. #ifndef __LINUXTHREADS_OLD__
  28. libc_hidden_def(open64)
  29. #else
  30. libc_hidden_weak(open64)
  31. strong_alias(open64,__libc_open64)
  32. #endif
  33. #endif /* __UCLIBC_HAS_LFS__ */