open64.c 703 B

1234567891011121314151617181920212223242526272829303132333435
  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. libc_hidden_def(open64)
  28. #endif /* __UCLIBC_HAS_LFS__ */