4 /* Copyright (C) 1992, 2001, 2003, 2005 Free Software Foundation, Inc.
5 Written by James Clark (jjc@jclark.com)
7 This file is part of groff.
9 groff is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
14 groff is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License along
20 with groff; see the file COPYING. If not, write to the Free Software
21 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
23 /* file_name_max(dir) does the same as pathconf(dir, _PC_NAME_MAX) */
27 #include <sys/types.h>
31 #endif /* HAVE_UNISTD_H */
35 size_t file_name_max(const char *fname
)
37 return pathconf(fname
, _PC_NAME_MAX
);
40 #else /* not _POSIX_VERSION */
44 #else /* not HAVE_DIRENT_H */
47 #endif /* HAVE_SYS_DIR_H */
48 #endif /* not HAVE_DIRENT_H */
52 #define NAME_MAX MAXNAMLEN
53 #else /* !MAXNAMLEN */
55 #define NAME_MAX MAXNAMELEN
56 #else /* !MAXNAMELEN */
58 #endif /* !MAXNAMELEN */
59 #endif /* !MAXNAMLEN */
60 #endif /* !NAME_MAX */
62 size_t file_name_max(const char *)
67 #endif /* not _POSIX_VERSION */