summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/glob.3
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-03-19 19:10:06 +0000
committerjlemon <jlemon@FreeBSD.org>2001-03-19 19:10:06 +0000
commitb7db4c94c39d3b8f980a3c3f3ce1166ce5c3004e (patch)
tree11eade290d26f8295a18604584895a81c44ad608 /lib/libc/gen/glob.3
parent5070a55a811bdaef9f6ed3c09aa7e24c47dd3f34 (diff)
downloadFreeBSD-src-b7db4c94c39d3b8f980a3c3f3ce1166ce5c3004e.zip
FreeBSD-src-b7db4c94c39d3b8f980a3c3f3ce1166ce5c3004e.tar.gz
Introduce the GLOB_MAXPATH flag, which allows the user to limit the
number of paths which glob(3) will return. Remove the hardcoded limit from the last commit, which restores the previous unbounded behavior. Document the new flag in the manual page.
Diffstat (limited to 'lib/libc/gen/glob.3')
-rw-r--r--lib/libc/gen/glob.317
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libc/gen/glob.3 b/lib/libc/gen/glob.3
index c643aaa..efc413c 100644
--- a/lib/libc/gen/glob.3
+++ b/lib/libc/gen/glob.3
@@ -260,6 +260,14 @@ character, avoiding any special interpretation of the character.
Expand patterns that start with
.Ql ~
to user name home directories.
+.It Dv GLOB_MAXPATH
+Limit the total number of returned pathnames to the value provided in
+.Fa gl_matchc .
+If
+.Fn glob
+would match more pathnames,
+.Dv GLOB_LIMIT
+will be returned.
.El
.Pp
If, during the search, a directory is encountered that cannot be opened
@@ -376,6 +384,14 @@ The scan was stopped because an error was encountered and either
was set or
.Fa \*(lp*errfunc\*(rp\*(lp\*(rp
returned non-zero.
+.It Dv GLOB_LIMIT
+The flag
+.Dv GLOB_MAXPATH
+was provided, and the specified limit passed to
+.Fn glob
+in
+.Fa pglob\->gl_matchc
+was reached.
.El
.Pp
The arguments
@@ -412,6 +428,7 @@ that the flags
.Dv GLOB_ALTDIRFUNC ,
.Dv GLOB_BRACE ,
.Dv GLOB_MAGCHAR ,
+.Dv GLOB_MAXPATH ,
.Dv GLOB_NOMAGIC ,
.Dv GLOB_QUOTE ,
and
OpenPOWER on IntegriCloud