]> git.cworth.org Git - tar/blob - gnu/pathmax.h
upstream: Fix extraction of device nodes.
[tar] / gnu / pathmax.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Define PATH_MAX somehow.  Requires sys/types.h.
4    Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2010 Free Software
5    Foundation, Inc.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software Foundation,
19    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21 #ifndef _PATHMAX_H
22 # define _PATHMAX_H
23
24 # include <unistd.h>
25
26 # include <limits.h>
27
28 # ifndef _POSIX_PATH_MAX
29 #  define _POSIX_PATH_MAX 256
30 # endif
31
32 # if !defined PATH_MAX && defined _PC_PATH_MAX && defined HAVE_PATHCONF
33 #  define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \
34                     : pathconf ("/", _PC_PATH_MAX))
35 # endif
36
37 /* Don't include sys/param.h if it already has been.  */
38 # if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
39 #  include <sys/param.h>
40 # endif
41
42 # if !defined PATH_MAX && defined MAXPATHLEN
43 #  define PATH_MAX MAXPATHLEN
44 # endif
45
46 # ifndef PATH_MAX
47 #  define PATH_MAX _POSIX_PATH_MAX
48 # endif
49
50 #endif /* _PATHMAX_H */