Back to index

glibc  2.9
lxstat.c
Go to the documentation of this file.
00001 /* lxstat using old-style Unix lstat system call.
00002    Copyright (C) 1991, 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004
00003    Free Software Foundation, Inc.
00004    This file is part of the GNU C Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 /* Ho hum, since xstat == xstat64 we must get rid of the prototype or gcc
00022    will complain since they don't strictly match.  */
00023 #define __lxstat64 __lxstat64_disable
00024 
00025 #include <errno.h>
00026 #include <stddef.h>
00027 #include <sys/stat.h>
00028 
00029 #include <sysdep.h>
00030 #include <sys/syscall.h>
00031 #include <bp-checks.h>
00032 
00033 /* Get information about the file FD in BUF.  */
00034 int
00035 __lxstat (int vers, const char *name, struct stat *buf)
00036 {
00037   if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)
00038     return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), CHECK_1 (buf));
00039 
00040   __set_errno (EINVAL);
00041   return -1;
00042 }
00043 
00044 hidden_def (__lxstat)
00045 weak_alias (__lxstat, _lxstat);
00046 #undef __lxstat64
00047 strong_alias (__lxstat, __lxstat64);
00048 hidden_ver (__lxstat, __lxstat64)