• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >linux shell > 利用kernel提供的接口打印进程号(pid)

利用kernel提供的接口打印进程号(pid)

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了kernel.pid max,kernel u盘识别,kernel32.dll修复,kernel32.dll下载,kernel32.dll等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

c文件printPid.c

static __init int printPid(void) //安装模块函数
{
    struct task_struct *task,*p;
    struct list_head *ps;
    int count=0;
    printk("begin.\n");
    task=&init_task;
    list_for_each(ps,&task->tasks)
    {
        p=list_entry(ps,struct task_struct,tasks);
        count++;
        printk("%d\t%s\n",p->pid,p->comm);
    }
    printk("Process counts:%d\n",count);
    return 0;
}
static __exit void exitPid(void)  //卸载函数
{
    printk("exit!\n");
}
module_init(printPid); //实现的函数必须放入其中
module_exit(exitPid);
</div>

make后会生成pid.ko文件。

然后用这几个命令:

#显示日志信息
dmesg

#显示挂载的挂载的所有模块
lsmod

#卸载
sudo rmmod pid
</div>

</div>

您可能想查找下面的文章:

  • 利用kernel提供的接口打印进程号(pid)

相关文章

  • 并发数据库压力测试的shell脚本代码
  • 编写shell脚本将VPS上的数据备份到Dropbox网盘的方法
  • Linux 中C语言getcwd()函数的用法
  • 在指定目录查找指定后缀文件的shell脚本代码
  • linux软件版本管理命令update-alternatives使用详解
  • shell按行读取文件的3种方法
  • 编写Bash Shell通过gnuplot绘制系统性能数据图的方法
  • 监控服务器swap并重启php的Shell脚本
  • Shell脚本中获取本机ip地址的3个方法
  • 浅析Linux系统下安装wetty和使用说明

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Shell脚本实现检测某ip网络畅通情况(含短信报警功能)
    • Ubuntu服务器配置apache2.4的限速功能shell脚本分享
    • linux删除大量文件的6种方法
    • shell脚本编程之循环语句
    • CentOS下mysql定时备份Shell脚本分享
    • Shell脚本中单引号(‘)和双引号(“)的使用区别
    • Linux Shell脚本系列教程(一):Shell入门
    • 5个Shell脚本编程入门练习例子
    • Linux中rz命令和sz命令使用详解大全
    • shell 1>&2 2>&1 &>filename重定向的含义和区别

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有