找回密码
 注册
搜索
查看: 570|回复: 1

[讨论] 请教ioctl参数问题

[复制链接]
发表于 2007-10-18 11:11:51 | 显示全部楼层 |阅读模式
int (*ioctl) (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); 的参数arg是干什么的?
static int leds_ioctl(struct inode *inode,struct file *file,unsigned int cmd,
unsigned long arg){
switch(cmd){
case 0:
case 1:
if (arg > 4){
return -EINVAL;
}
write_gpio_bit(led_table[arg],!cmd);
default:
return -EINVAL;
}
}
看不懂arg是哪里传来的参数,刚学linux请大侠指教。
 楼主| 发表于 2009-7-9 11:43:51 | 显示全部楼层
哈哈,以前我真是菜鸟一只啊。嘿嘿。
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-10-8 10:50 , Processed in 0.061322 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表