summaryrefslogtreecommitdiff
blob: 8c0f91a069e862871cf59a83115638524e5a6a3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
glibc-2.8 no loner provides the ARG_MAX macro.

--- tnftp-20090520/libnetbsd/glob.c
+++ tnftp-20090520/libnetbsd/glob.c
@@ -55,6 +55,8 @@
  *	Number of matches in the current invocation of glob.
  */
 
+#include <unistd.h>
+
 #include "tnftp.h"
 
 #undef	TILDE			/* XXX: AIX 4.1.5 has this in <sys/ioctl.h> */
@@ -720,7 +722,7 @@
 	}
 	pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
 
-	if ((pglob->gl_flags & GLOB_LIMIT) && (newsize + *limit) >= ARG_MAX) {
+	if ((pglob->gl_flags & GLOB_LIMIT) && (newsize + *limit) >= sysconf(_SC_ARG_MAX)) {
 		errno = 0;
 		return(GLOB_NOSPACE);
 	}