1 // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
3 // UNSUPPORTED: darwin, target={{.*(linux|solaris).*}}
16 char *const paths
[] = {(char *)"/etc", 0};
17 FTS
*ftsp
= fts_open(paths
, FTS_LOGICAL
, NULL
);
20 FTSENT
*chp
= fts_children(ftsp
, 0);
24 for (FTSENT
*p
= fts_read(ftsp
); p
; p
= fts_read(ftsp
)) {
25 /* Skip recursively subdirectories */
26 if (p
->fts_info
== FTS_D
&& p
->fts_level
!= FTS_ROOTLEVEL
) /* pre-order */
27 fts_set(ftsp
, p
, FTS_SKIP
);
28 else if (p
->fts_info
== FTS_DP
) /* post-order */
30 else if (p
->fts_info
== FTS_F
) /* regular file */
34 int rv
= fts_close(ftsp
);
37 printf("Number of files in /etc: '%zu'\n", n
);
41 // CHECK: Number of files in /etc: '{{.*}}'