1 /* lxstat using old-style Unix fstat system call.
2 Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
24 #include <kernel_stat.h>
26 extern int __syscall_lstat (const char *, struct kernel_stat
*);
28 /* Get information about the file NAME in BUF. */
30 __lxstat (int vers
, const char *name
, struct stat
*buf
)
32 struct kernel_stat kbuf
;
37 case _STAT_VER_LINUX_OLD
:
38 /* Nothing to do. The struct is in the form the kernel expects
40 result
= __syscall_lstat (name
, (struct kernel_stat
*) buf
);
44 /* Do the system call. */
45 result
= __syscall_lstat (name
, &kbuf
);
47 /* Convert to current kernel version of `struct stat'. */
48 buf
->st_dev
= kbuf
.st_dev
;
52 buf
->st_ino
= kbuf
.st_ino
;
53 buf
->st_mode
= kbuf
.st_mode
;
54 buf
->st_nlink
= kbuf
.st_nlink
;
55 buf
->st_uid
= kbuf
.st_uid
;
56 buf
->st_gid
= kbuf
.st_gid
;
57 buf
->st_rdev
= kbuf
.st_rdev
;
61 buf
->st_size
= kbuf
.st_size
;
62 buf
->st_blksize
= kbuf
.st_blksize
;
63 buf
->st_blocks
= kbuf
.st_blocks
;
64 buf
->st_atime
= kbuf
.st_atime
;
65 #ifdef _HAVE___UNUSED1
68 buf
->st_mtime
= kbuf
.st_mtime
;
69 #ifdef _HAVE___UNUSED2
72 buf
->st_ctime
= kbuf
.st_ctime
;
73 #ifdef _HAVE___UNUSED3
76 #ifdef _HAVE___UNUSED4
79 #ifdef _HAVE___UNUSED5
92 weak_alias (__lxstat
, _lxstat
)