示例#1
0
文件: pid.c 项目: maces/firejail
// recursivity!!!
void pid_print_tree(unsigned index, unsigned parent, int nowrap) {
	print_elem(index, nowrap);

	// Remove unused parameter warning
	(void)parent;
	
	unsigned i;
	for (i = index + 1; i < (unsigned)max_pids; i++) {
		if (pids[i].parent == (pid_t)index)
			pid_print_tree(i, index, nowrap);
	}

	for (i = 0; i < index; i++) {
		if (pids[i].parent == (pid_t)index)
			pid_print_tree(i, index, nowrap);
	}
}
示例#2
0
static void procevent_print_pids(void) {
	// print files
	int i;
	for (i = 0; i < MAX_PIDS; i++) {
		if (pids[i].level == 1)
			pid_print_tree(i, 0, 1);
	}
	printf("\n");
}
示例#3
0
文件: pid.c 项目: sshirokov/firejail
// recursivity!!!
void pid_print_tree(unsigned index, unsigned parent, int nowrap) {
	print_elem(index, nowrap);
	
	int i;
	for (i = index + 1; i < MAX_PIDS; i++) {
		if (pids[i].parent == index)
			pid_print_tree(i, index, nowrap);
	}
}
示例#4
0
文件: tree.c 项目: maces/firejail
void tree(pid_t pid) {
	pid_read(pid);
	
	// print processes
	int i;
	for (i = 0; i < max_pids; i++) {
		if (pids[i].level == 1)
			pid_print_tree(i, 0, arg_nowrap);
	}
	printf("\n");
}
示例#5
0
文件: tree.c 项目: shifter/firejail
void tree(void) {
	if (getuid() == 0)
		firemon_drop_privs();
	
	pid_read(0);	// include all processes
	
	// print processes
	int i;
	for (i = 0; i < MAX_PIDS; i++) {
		if (pids[i].level == 1)
			pid_print_tree(i, 0, 0);
	}
}