2.10 Interpretation of Android ebpf help function (9)

161.struct task_struct *bpf_get_current_task_btf(void)

Description: Returns a BTF pointer to "current". This pointer can be used to receive a task_struct type ARG_PTR_TO_BTF_ID in the helper function.

Return value: Returns a pointer to the current task.

162.long bpf_bprm_opts_set(struct linux_binprm *bprm, u64 flags)

Description: Clean or set certain options on bprm:

BPF_F_BPRM_SECUREEXEC means setting the secureexec bit, which sets AT_SECURE auxv for glibc. If flag is not specified, this bit will be cleared.

Return value: Returns -EINVAL if invalid flags are passed, otherwise returns 0.

163.u64 bpf_ktime_get_coarse_ns(void)

Description: Returns the elapsed time since the system was started, excluding time the system was hung, in nanoseconds.

For reference, clock_gettime(CLOCK_MONOTONIC_COARSE)

Return value: returns the current ktime.

164.long bpf_ima_inode_hash(struct inode *inode, void *dst, u32 size)

Description: Return the IMA hash value of the stored inode, if the hash is larger than size, only the size of the size will be copied

おすすめ

転載: blog.csdn.net/huangyabin001/article/details/131673033