Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

pathmax.h

Go to the documentation of this file.
00001 /* Define PATH_MAX somehow.  Requires sys/types.h.
00002    Copyright (C) 1992, 1999 Free Software Foundation, Inc.
00003 
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; either version 2, or (at your option)
00007    any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; if not, write to the Free Software Foundation,
00016    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00017 
00018 #ifndef _PATHMAX_H
00019 # define _PATHMAX_H
00020 
00021 # ifdef HAVE_UNISTD_H
00022 #  include <unistd.h>
00023 # endif
00024 
00025 /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
00026    PATH_MAX but might cause redefinition warnings when sys/param.h is
00027    later included (as on MORE/BSD 4.3).  */
00028 # if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
00029 #  include <limits.h>
00030 # endif
00031 
00032 # ifndef _POSIX_PATH_MAX
00033 #  define _POSIX_PATH_MAX 255
00034 # endif
00035 
00036 # if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
00037 #  define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \
00038           : pathconf ("/", _PC_PATH_MAX))
00039 # endif
00040 
00041 /* Don't include sys/param.h if it already has been.  */
00042 # if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
00043 #  include <sys/param.h>
00044 # endif
00045 
00046 # if !defined(PATH_MAX) && defined(MAXPATHLEN)
00047 #  define PATH_MAX MAXPATHLEN
00048 # endif
00049 
00050 # ifndef PATH_MAX
00051 #  define PATH_MAX _POSIX_PATH_MAX
00052 # endif
00053 
00054 #endif /* _PATHMAX_H */

Generated on Mon Apr 7 19:41:46 2003 for DuTree by doxygen1.2.18