Back to index

tetex-bin  3.0
xstat.c
Go to the documentation of this file.
00001 /* xstat.c: stat and (maybe) lstat with error checking.
00002 
00003 Copyright (C) 1992, 93 Free Software Foundation, Inc.
00004 
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Library General Public
00007 License as published by the Free Software Foundation; either
00008 version 2 of the License, or (at your option) any later version.
00009 
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 Library General Public License for more details.
00014 
00015 You should have received a copy of the GNU Library General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00018 
00019 #include <kpathsea/config.h>
00020 
00021 #include <kpathsea/xstat.h>
00022 
00023 
00024 struct stat
00025 xstat P1C(const_string, path)
00026 {
00027   struct stat s;
00028   
00029   if (stat (path, &s) != 0)
00030     FATAL_PERROR (path);
00031   
00032   return s;
00033 }
00034 
00035 
00036 /* If we don't have symbolic links, lstat is the same as stat, and
00037    a #define is made in the include file.  */
00038 
00039 #ifdef S_ISLNK
00040 /*
00041 // We declared lstat to prevent a warning during development.  This
00042 // turns out to be more trouble than it is worth.
00043 // extern int lstat ();
00044 */
00045 struct stat
00046 xlstat P1C(const_string, path)
00047 {
00048   struct stat s;
00049   
00050   if (lstat (path, &s) != 0)
00051     FATAL_PERROR (path);
00052   
00053   return s;
00054 }
00055 #endif