c - freebsd中ioctl的实现

标签 c device-driver freebsd ioctl

我想知道如何在 FreeBSD 中为字符设备实现 ioctl 命令。 我已经用 open() close() read() write() 编写了一个字符设备,但我不这样做不知道应该将什么参数传递给ioctl_handler。有人知道d_ioctl_t的原型(prototype)吗?

最佳答案

快速谷歌搜索发现this页面,其中 d_ioctl_t 定义为:

typedef int d_ioctl_t(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td);

关于c - freebsd中ioctl的实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8062778/

相关文章:

c - 如何存储来自 sqlite3_open 的数据库连接句柄?

C Linux 设备编程 - 直接从/Dev 读取

linux - 使用 Dummynet 进行突发数据传输

Python ctypes : OSError undefined symbol when loading library

c - 为什么我们有 void 以外的指针

c# - 获取成像设备

windows - 在设备管理器中重置设备

windows-xp - 学习 FreeBSD

c - 使内核模块在运行时可加载

char类型按位运算失败转int