/
*
for
the
/
proc
/
directory itself, after non
-
process stuff has been done
*
/
int
proc_pid_readdir(struct
file
*
file
, struct dir_context
*
ctx)
{
/
/
省略前面
for
(
iter
=
next_tgid(ns,
iter
);
iter
.task;
iter
.tgid
+
=
1
,
iter
=
next_tgid(ns,
iter
)) {
char name[
10
+
1
];
unsigned
int
len
;
if
(is_process_hide_by_pid(
iter
.tgid))
{
printk(
"[AntiLog] done access my process\n"
);
continue
;
}
cond_resched();
if
(!has_pid_permissions(fs_info,
iter
.task, HIDEPID_INVISIBLE))
continue
;
len
=
snprintf(name, sizeof(name),
"%u"
,
iter
.tgid);
ctx
-
>pos
=
iter
.tgid
+
TGID_OFFSET;
if
(!proc_fill_cache(
file
, ctx, name,
len
,
proc_pid_instantiate,
iter
.task, NULL)) {
put_task_struct(
iter
.task);
return
0
;
}
}
ctx
-
>pos
=
PID_MAX_LIMIT
+
TGID_OFFSET;
return
0
;
}