linux - 在交换器中执行时,Linux 内核模块中的任务所有者 pid

标签 linux module kernel task pid

给定一个具有 pid 0 和通讯“swapper/0”的任务实例,如何获取所有者 pid ?

==编辑==

这是使用 Netfilter Hook 发生的。

最佳答案

In the operating system Unix, every process except process 0 (the swapper) is created when another process executes the fork() system call. The process that invoked fork is the parent process and the newly-created process is the child process. Every process (except process 0) has one parent process, but can have many child processes.

The operating system kernel identifies each process by its process identifier. Process 0 is a special process that is created when the system boots; after forking a child process (process 1), process 0 becomes the swapper process (sometimes also known as the "idle task"). Process 1, known as init, is the ancestor of every other process in the system.

关于linux - 在交换器中执行时,Linux 内核模块中的任务所有者 pid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15010602/

相关文章:

java - 为什么附加到文件时 Windows 和 Linux 机器上的 file-io 会产生不同的结果?

c++ - 如何将 char* 变量转换/放入 struct sockaddr 中?

python - 如何从同级文件夹中导入 Python 模块?

linux - 插入 USB HID 设备时防止 usbhid 自动加载

c - MacOS 使用 sysctl() 获取 HW_MACHINE_ARCH 获取 "no such file or directory"

linux - 更改ssh端口

module - Puppet - 为非伪造模块安装模块依赖

python - 在模块中编写单元测试的正确方法?

ubuntu - vfork() child 拥有什么特权?

Linux Socket::connect 和 QT::connect 混合