Linux内核中的当前宏 [英] Current macro in linux kernel

查看:83
本文介绍了Linux内核中的当前宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前宏的目的是找到一个指向当前正在运行的进程的任务结构的指针.

The purpose of the current macro is to find a pointer to the task structure of the currently running process.

那么关于其在开发内核模块时的用法,并根据其定义,此宏是否返回当前正在运行的用户空间进程的PID或什么?

So regarding its usage when developing a kernel module, and according to its definition does this macro return the PID of the current running user-space process or what?

推荐答案

当用户空间进程执行系统调用时,该宏指向与此进程关联的task_struct.它不仅包含流程的PID,而且还包含许多其他信息.

When a user-space process performs a system call, this macro points to the task_struct associated with this process. It doesn't only contain the PID of the process but a lot of other info.

这篇关于Linux内核中的当前宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆