1glob.h(0P) POSIX Programmer's Manual glob.h(0P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 glob.h — pathname pattern-matching types
13
15 #include <glob.h>
16
18 The <glob.h> header shall define the structures and symbolic constants
19 used by the glob() function.
20
21 The <glob.h> header shall define the glob_t structure type, which shall
22 include at least the following members:
23
24
25 size_t gl_pathc Count of paths matched by pattern.
26 char **gl_pathv Pointer to a list of matched pathnames.
27 size_t gl_offs Slots to reserve at the beginning of gl_pathv.
28
29 The <glob.h> header shall define the size_t type as described in
30 <sys/types.h>.
31
32 The <glob.h> header shall define the following symbolic constants as
33 values for the flags argument:
34
35 GLOB_APPEND Append generated pathnames to those previously obtained.
36
37 GLOB_DOOFFS Specify how many null pointers to add to the beginning of
38 gl_pathv.
39
40 GLOB_ERR Cause glob() to return on error.
41
42 GLOB_MARK Each pathname that is a directory that matches pattern
43 has a <slash> appended.
44
45 GLOB_NOCHECK If pattern does not match any pathname, then return a
46 list consisting of only pattern.
47
48 GLOB_NOESCAPE Disable backslash escaping.
49
50 GLOB_NOSORT Do not sort the pathnames returned.
51
52 The <glob.h> header shall define the following symbolic constants as
53 error return values:
54
55 GLOB_ABORTED The scan was stopped because GLOB_ERR was set or
56 (*errfunc)() returned non-zero.
57
58 GLOB_NOMATCH The pattern does not match any existing pathname, and
59 GLOB_NOCHECK was not set in flags.
60
61 GLOB_NOSPACE An attempt to allocate memory failed.
62
63 The following shall be declared as functions and may also be defined as
64 macros. Function prototypes shall be provided.
65
66
67 int glob(const char *restrict, int, int(*)(const char *, int),
68 glob_t *restrict);
69 void globfree(glob_t *);
70
71 The following sections are informative.
72
74 None.
75
77 None.
78
80 None.
81
83 <sys_types.h>
84
85 The System Interfaces volume of POSIX.1‐2017, glob()
86
88 Portions of this text are reprinted and reproduced in electronic form
89 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
90 table Operating System Interface (POSIX), The Open Group Base Specifi‐
91 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
92 Electrical and Electronics Engineers, Inc and The Open Group. In the
93 event of any discrepancy between this version and the original IEEE and
94 The Open Group Standard, the original IEEE and The Open Group Standard
95 is the referee document. The original Standard can be obtained online
96 at http://www.opengroup.org/unix/online.html .
97
98 Any typographical or formatting errors that appear in this page are
99 most likely to have been introduced during the conversion of the source
100 files to man page format. To report such errors, see https://www.ker‐
101 nel.org/doc/man-pages/reporting_bugs.html .
102
103
104
105IEEE/The Open Group 2017 glob.h(0P)