xref: /dflybsd-src/contrib/grep/lib/chdir-long.h (revision 91b9ed38d3db6a8a8ac5b66da1d43e6e331e259a)
1cf28ed85SJohn Marino /* provide a chdir function that tries not to fail due to ENAMETOOLONG
2*09d4459fSDaniel Fojt    Copyright (C) 2004-2005, 2009-2020 Free Software Foundation, Inc.
3cf28ed85SJohn Marino 
4cf28ed85SJohn Marino    This program is free software: you can redistribute it and/or modify
5cf28ed85SJohn Marino    it under the terms of the GNU General Public License as published by
6cf28ed85SJohn Marino    the Free Software Foundation; either version 3 of the License, or
7cf28ed85SJohn Marino    (at your option) any later version.
8cf28ed85SJohn Marino 
9cf28ed85SJohn Marino    This program is distributed in the hope that it will be useful,
10cf28ed85SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
11cf28ed85SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12cf28ed85SJohn Marino    GNU General Public License for more details.
13cf28ed85SJohn Marino 
14cf28ed85SJohn Marino    You should have received a copy of the GNU General Public License
15*09d4459fSDaniel Fojt    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
16cf28ed85SJohn Marino 
17cf28ed85SJohn Marino /* Written by Jim Meyering.  */
18cf28ed85SJohn Marino 
19cf28ed85SJohn Marino #include <unistd.h>
20cf28ed85SJohn Marino #include <limits.h>
21cf28ed85SJohn Marino 
22cf28ed85SJohn Marino #include "pathmax.h"
23cf28ed85SJohn Marino 
24cf28ed85SJohn Marino /* On systems without PATH_MAX, presume that chdir accepts
25cf28ed85SJohn Marino    arbitrarily long directory names.  */
26cf28ed85SJohn Marino #ifndef PATH_MAX
27cf28ed85SJohn Marino # define chdir_long(Dir) chdir (Dir)
28cf28ed85SJohn Marino #else
29cf28ed85SJohn Marino int chdir_long (char *dir);
30cf28ed85SJohn Marino #endif
31