10 static int spawned_pager;
12 static void pager_preexec(
void)
24 setenv(
"LESS",
"FRSX", 0);
27 static const char *pager_argv[] = {
"sh",
"-c",
NULL,
NULL };
30 static void wait_for_pager(
void)
40 static void wait_for_pager_signal(
int signo)
49 const char *pager = getenv(
"PERF_PAGER");
59 pager = getenv(
"PAGER");
61 if (!
access(
"/usr/bin/pager", X_OK))
62 pager =
"/usr/bin/pager";
66 else if (!*pager || !
strcmp(pager,
"cat"))
72 pager_argv[2] = pager;
73 pager_process.argv = pager_argv;
74 pager_process.in = -1;
75 pager_process.preexec_cb = pager_preexec;
81 dup2(pager_process.in, 1);
83 dup2(pager_process.in, 2);
84 close(pager_process.in);
88 atexit(wait_for_pager);
98 env = getenv(
"PERF_PAGER_IN_USE");