|
@@ -12,19 +12,28 @@
|
|
|
#include <sys/stat.h>
|
|
|
#include "xstatconv.h"
|
|
|
|
|
|
-#define __NR___syscall_lstat __NR_lstat
|
|
|
-static __inline__ _syscall2(int, __syscall_lstat,
|
|
|
- const char *, file_name, struct kernel_stat *, buf)
|
|
|
-
|
|
|
int lstat(const char *file_name, struct stat *buf)
|
|
|
{
|
|
|
int result;
|
|
|
+#ifdef __NR_lstat64
|
|
|
+
|
|
|
+ * e.g. uid device major/minor etc.
|
|
|
+ * so we use 64 variant if available
|
|
|
+ * in order to get newer versions of stat elements
|
|
|
+ */
|
|
|
+ struct kernel_stat64 kbuf;
|
|
|
+ result = INLINE_SYSCALL(lstat64, 2, file_name, &kbuf);
|
|
|
+ if (result == 0) {
|
|
|
+ __xstat32_conv(&kbuf, buf);
|
|
|
+ }
|
|
|
+#else
|
|
|
struct kernel_stat kbuf;
|
|
|
|
|
|
- result = __syscall_lstat(file_name, &kbuf);
|
|
|
+ result = INLINE_SYSCALL(lstat, 2, file_name, &kbuf);
|
|
|
if (result == 0) {
|
|
|
__xstat_conv(&kbuf, buf);
|
|
|
}
|
|
|
+#endif
|
|
|
return result;
|
|
|
}
|
|
|
libc_hidden_def(lstat)
|