打印
[嵌入式linux]

请问XFree86中ioctl()函数的实现

[复制链接]
2148|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
yp311|  楼主 | 2007-6-24 17:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
最近读XFree86驱动,发现里面很多地方都用到了ioctl()函数,找了很久却没有找到它的函数原型,只找到一个定义:

#define ioctl()      xf86ioctl();

然后找xf86ioctl()函数的实现,发现它是这样的:

int
xf86ioctl(int fd, unsigned long request, pointer argp)
{
    int status = ioctl(fd, request, argp);

    xf86errno = xf86GetErrno();
    return status;
}
岂不是又回去了?怎么可能呢?还是这里的ioctl()函数有另外的实现?

在Linux下,ioctl()函数是由系统实现的还是由各个驱动自己实现的呢?在XFree86中是如何实现的呢?

困惑中,各位高手帮忙看看!先谢了!

相关帖子

沙发
fineamy| | 2007-6-25 14:23 | 只看该作者

看注释

/* Prevent name collision when including sys/ioccom.h */
#undef ioctl
#include <sys/ioccom.h>
#define ioctl(a,b,c)        xf86ioctl(a,b,c)
#else
#include <sys/ioccom.h>

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

6

帖子

0

粉丝