Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Driver in 2.6.8-rc2 and DVB-C



On 07/28/04 21:03, Kenneth Aafløy wrote:
On Wednesday 28 July 2004 20:42, Johannes Stezenbach wrote:

It seems Al Viro broke dvb_usercopy():

--- dvb_functions.c.orig	2004-07-28 20:39:23.000000000 +0200
+++ dvb_functions.c	2004-07-28 20:21:23.000000000 +0200
@@ -36,7 +36,7 @@ int dvb_usercopy(struct inode *inode, st
        /*  Copy arguments into temp kernel buffer  */
        switch (_IOC_DIR(cmd)) {
        case _IOC_NONE:
-                parg = NULL;
+                parg = (void *) arg;
                break;
        case _IOC_READ: /* some v4l ioctls are marked wrong ... */
        case _IOC_WRITE:

Curious, why does an ioctl with zero sized argument have an argument?
As you probably know, if you have an ioctl with an integer argument, you cannot call it with that argument directly, you need to pass the pointer instead.

[...]
int size = 4096;
/* this code does not work with the v3 api */
ioctl(fd, DMX_SET_BUFFER_SIZE, &size);
[...]

Some people find that annyoing.

#define DMX_SET_BUFFER_SIZE _IO('o', 45)

With the above hack, the argument is directly put into the pointer, so you can write this instead.

[...]
ioctl(fd, DMX_SET_BUFFER_SIZE, 4096);
[...]

Kenneth
CU
Michael.




Home | Main Index | Thread Index