mkdir.c 652 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * mkdir() for uClibc
  3. *
  4. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <sys/syscall.h>
  9. #include <sys/stat.h>
  10. #if defined __NR_mkdirat && !defined __NR_mkdir
  11. # include <fcntl.h>
  12. int mkdir(const char *pathname, mode_t mode)
  13. {
  14. return mkdirat(AT_FDCWD, pathname, mode);
  15. }
  16. #else
  17. # define __NR___syscall_mkdir __NR_mkdir
  18. static __inline__ _syscall2(int, __syscall_mkdir, const char *, pathname,
  19. __kernel_mode_t, mode)
  20. int mkdir(const char *pathname, mode_t mode)
  21. {
  22. return (__syscall_mkdir(pathname, mode));
  23. }
  24. #endif
  25. libc_hidden_def(mkdir)