open.c 372 B

12345678910111213141516171819202122232425
  1. /* $Source$
  2. * $State$
  3. * $Revision$
  4. */
  5. #include <stdlib.h>
  6. #include <errno.h>
  7. #include <unistd.h>
  8. #include <stdarg.h>
  9. #include "libsys.h"
  10. int open(const char* path, int access, ...)
  11. {
  12. int mode = 0;
  13. if (access & O_CREAT)
  14. {
  15. va_list ap;
  16. va_start(ap, access);
  17. mode = va_arg(ap, int);
  18. va_end(ap);
  19. }
  20. return _syscall(__NR_open, (quad) path, access, mode);
  21. }