summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2010-09-24 13:32:56 +0000
committerDamien Miller <djm@cvs.openbsd.org>2010-09-24 13:32:56 +0000
commit898c385370762cd3fd1a6fa08058a30f7511fa79 (patch)
treec9c36ef54367699bdaf54b8bd9581c3f8736cb86 /include
parent0df142c814e864e0da4dbc09c556d9632501d2ee (diff)
add a GLOB_KEEPSTAT option that retains a copy of the struct stat
information that is looked up while matching glob(3)s Keeping this information around can make a big difference when fetching it is expensive, e.g. in sftp which uses GLOB_ALTDIRFUNC feedback millert@ jmc@ "get it in before the libc crank" deraadt@
Diffstat (limited to 'include')
-rw-r--r--include/glob.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/glob.h b/include/glob.h
index fdd33bcb297..f602e71edcb 100644
--- a/include/glob.h
+++ b/include/glob.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: glob.h,v 1.10 2005/12/13 00:35:22 millert Exp $ */
+/* $OpenBSD: glob.h,v 1.11 2010/09/24 13:32:55 djm Exp $ */
/* $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $ */
/*
@@ -39,6 +39,7 @@
#define _GLOB_H_
#include <sys/cdefs.h>
+#include <sys/stat.h>
struct stat;
typedef struct {
@@ -47,6 +48,7 @@ typedef struct {
int gl_offs; /* Reserved at beginning of gl_pathv. */
int gl_flags; /* Copy of flags parameter to glob. */
char **gl_pathv; /* List of paths matching pattern. */
+ struct stat **gl_statv; /* Stat entries corresponding to gl_pathv */
/* Copy of errfunc parameter to glob. */
int (*gl_errfunc)(const char *, int);
@@ -83,6 +85,7 @@ typedef struct {
#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
#define GLOB_LIMIT 0x2000 /* Limit pattern match output to ARG_MAX */
+#define GLOB_KEEPSTAT 0x4000 /* Retain stat data for paths in gl_statv. */
#define GLOB_ABEND GLOB_ABORTED /* backward compatibility */
#endif