ustat.c 632 B

12345678910111213141516171819202122232425
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * ustat() for uClibc
  4. *
  5. * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
  6. *
  7. * GNU Library General Public License (LGPL) version 2 or later.
  8. */
  9. #include "syscalls.h"
  10. #include <sys/ustat.h>
  11. #include <sys/sysmacros.h>
  12. #define __NR___syscall_ustat __NR_ustat
  13. static inline _syscall2(int, __syscall_ustat,
  14. unsigned short int, kdev_t, struct ustat *, ubuf);
  15. int ustat(dev_t dev, struct ustat *ubuf)
  16. {
  17. /* We must convert the dev_t value to a __kernel_dev_t */
  18. __kernel_dev_t k_dev;
  19. k_dev = ((major(dev) & 0xff) << 8) | (minor(dev) & 0xff);
  20. return __syscall_ustat(k_dev, ubuf);
  21. }