lstat.c 791 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * lstat() for uClibc
  4. *
  5. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include <sys/syscall.h>
  10. #include <unistd.h>
  11. #include <sys/stat.h>
  12. #include "xstatconv.h"
  13. #define __NR___syscall_lstat __NR_lstat
  14. static __inline__ _syscall2(int, __syscall_lstat,
  15. const char *, file_name, struct kernel_stat *, buf)
  16. int lstat(const char *file_name, struct stat *buf)
  17. {
  18. int result;
  19. struct kernel_stat kbuf;
  20. result = __syscall_lstat(file_name, &kbuf);
  21. if (result == 0) {
  22. __xstat_conv(&kbuf, buf);
  23. }
  24. return result;
  25. }
  26. libc_hidden_def(lstat)
  27. #if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__
  28. strong_alias_untyped(lstat,lstat64)
  29. libc_hidden_def(lstat64)
  30. #endif