zoukankan      html  css  js  c++  java
  • ioctl命令

    用户空间 ioctl() 系统调用原型 int ioctl(int fd,unsigned long cmd, ...);

    驱动中的 ioctl 方法原型 int (*ioctl) (struct inode *inode,struct file *flip,unsigned int cmd,unsigned long arg);

    1. ioctl 中的 命令cmd 以及参数 arg

    (1) 内核中生成命令的辅助的宏:

     _IO  an ioctl with no parameters

     _IOW  an ioctl with write parameters (copy_from_user)

     _IOR  an ioctl with read parameters (copy_to_user)

     _IOWR an ioctl with both write and read parameters

    'write' and 'read' are from the user's point of view

    (2) 内核中的预定义命令,如果设备驱动中包含了与预定义命令一样的命令码,则这些命令将会被当作预定义命令被内核处理。

    FIOCLEX , FIONCLEX , FIOQSIZE , FIONBIO

  • 相关阅读:
    MySQL主从复制
    MySQL索引
    MySQL视图(view)
    MySQL表类型和存储引擎
    MySQL事务(三)
    MySQL事务(二)
    MySQL事务(一)
    MySQL事件调度器
    协同过滤推荐算法
    SVD奇异值分解
  • 原文地址:https://www.cnblogs.com/youngvoice/p/4840075.html
Copyright © 2011-2022 走看看