mknodat.c 601 B

12345678910111213141516171819202122232425
  1. /*
  2. * mknodat() for uClibc
  3. *
  4. * Copyright (C) 2009 Analog Devices Inc.
  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. #ifdef __NR_mknodat
  11. int mknodat(int fd, const char *path, mode_t mode, dev_t dev)
  12. {
  13. unsigned long long int k_dev;
  14. /* We must convert the value to dev_t type used by the kernel. */
  15. k_dev = (dev) & ((1ULL << 32) - 1);
  16. return INLINE_SYSCALL(mknodat, 4, fd, path, mode, (unsigned int)k_dev);
  17. }
  18. libc_hidden_def(mknodat)
  19. #else
  20. /* should add emulation with mknod() and /proc/self/fd/ ... */
  21. #endif