open64.c 686 B

123456789101112131415161718192021222324252627282930
  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 <_lfs_64.h>
  7. #include <fcntl.h>
  8. #include <stdarg.h>
  9. #include <cancel.h>
  10. /* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
  11. a third argument is the file protection. */
  12. int open64(const char *file, int oflag, ...)
  13. {
  14. mode_t mode = 0;
  15. if (oflag & O_CREAT) {
  16. va_list arg;
  17. va_start (arg, oflag);
  18. mode = va_arg (arg, mode_t);
  19. va_end (arg);
  20. }
  21. return open(file, oflag | O_LARGEFILE, mode);
  22. }
  23. lt_strong_alias(open64)
  24. lt_libc_hidden(open64)
  25. /* open handled cancellation, noop on uClibc */
  26. LIBC_CANCEL_HANDLED();