我发现一个错误归结为:
#include <sys/types.h>
#include <sys/stat.h>
#include <fts.h>
#include <stdlib.h>
int main () {
char *LOG_ROOT = "/var/log";
FTS *ftsp;
FTSENT *p, *chp;
int fts_options = FTS_COMFOLLOW | FTS_LOGICAL | FTS_NOCHDIR;
char *paths[] = { LOG_ROOT };
fts_open(paths, fts_options, NULL);
}
为什么会出现这个段错误?