gyh2002
驱动牛犊
驱动牛犊
  • 注册日期2002-11-05
  • 最后登录2005-03-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1106回复:1

有关linux中的加载数问题!

楼主#
更多 发布于:2003-03-03 20:21
我在驱动程序中的open函数中,写入MOD_INC_USE_COUNT,并且在close中写入MOD_DEC_USE_COUNT;
在用insmod ***.o后,用lsmod 查看状态,结果used 为2,为什么?什么地方出了问题?
如果将上述语句去掉,used 为0;
应该如何修改,才能使used 为1呢?
hometown
驱动大牛
驱动大牛
  • 注册日期2002-10-24
  • 最后登录2004-05-21
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2003-03-03 22:00
我在驱动程序中的open函数中,写入MOD_INC_USE_COUNT,并且在close中写入MOD_DEC_USE_COUNT;
在用insmod ***.o后,用lsmod 查看状态,结果used 为2,为什么?什么地方出了问题?
如果将上述语句去掉,used 为0;
应该如何修改,才能使used 为1呢?
这个情况的发生可能是你同时有两个进程打开了这个设备, 你在OPEN中没有做排他的打开动作
How fair and how pleasant art thou, O love, for delights!This thy stature is like to a palm tree, and thy breasts to clusters of grapes.I said, I will go up to the palm tree, I will take hold of the boughs thereof: now also thy breasts shall be as clusters of the vine, and the smell of thy nose like apples;And the roof of thy mouth like the best wine for my beloved, that goeth down sweetly, causing the lips of those that are asleep to speak.
游客

返回顶部