ustat.c 604 B

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