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# - 什么是 C fread() 的 C# 模拟?

c - 如何设置矩阵的基地址?

c - 什么数字符合这个 C 模式?

mysql - 无法启动mysql服务器

python - 如何离线安装包?

c - 如果未在父级中关闭,则从属 pty 上的最终输出将丢失。为什么?

c - 程序不想读取文件

linux - 简单的linux设备驱动没有出现在/dev

linux - 学习linux驱动

c - 在 Windows 中跨重启访问相同的资源