]>
git.ipfire.org Git - thirdparty/bash.git/blob - maxpath.h
1 /* maxpath.h - Find out what this system thinks PATH_MAX and NAME_MAX are. */
3 /* Copyright (C) 1993 Free Software Foundation, Inc.
5 This file is part of GNU Bash, the Bourne Again SHell.
7 Bash is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License along
18 with Bash; see the file COPYING. If not, write to the Free Software
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 #if !defined (_MAXPATH_H_)
24 /* These values are supposed to be in <limits.h> or one of the files
26 #if defined (HAVE_LIMITS_H)
28 #endif /* !HAVE_LIMITS_H */
30 /* If PATH_MAX is not defined, look for MAXPATHLEN */
31 #if !defined (PATH_MAX)
32 # if defined (HAVE_SYS_PARAM_H)
33 # include <sys/param.h>
34 # define maxpath_param_h
36 # if defined (MAXPATHLEN) && !defined (PATH_MAX)
37 # define PATH_MAX MAXPATHLEN
38 # endif /* MAXPATHLEN && !PATH_MAX */
39 #endif /* !PATH_MAX */
41 /* If NAME_MAX is not defined, look for MAXNAMLEN */
42 #if !defined (NAME_MAX)
43 # if defined (HAVE_SYS_PARAM_H) && !defined (maxpath_param_h)
44 # include <sys/param.h>
46 # if defined (MAXNAMLEN) && !defined (NAME_MAX)
47 # define NAME_MAX MAXNAMLEN
48 # endif /* MAXNAMLEN && !NAME_MAX */
49 #endif /* !NAME_MAX */
51 /* Default POSIX values */
52 #if !defined (PATH_MAX) && defined (_POSIX_PATH_MAX)
53 # define PATH_MAX _POSIX_PATH_MAX
56 #if !defined (NAME_MAX) && defined (_POSIX_NAME_MAX)
57 # define NAME_MAX _POSIX_NAME_MAX
62 #if !defined (PATH_MAX)
63 # define PATH_MAX 1024
66 #if !defined (NAME_MAX)
72 # define PATH_MAX 1024
75 #endif /* _MAXPATH_H_ */