K
K
Kamikaze10242015-12-30 16:30:31
linux
Kamikaze1024, 2015-12-30 16:30:31

Why doesn't the ioctl system call pass?

If you register an ioctl handler in the unlocked_ioctl field of the file_operations structure, then the ioctl handler is called if the user process connected to the driver via nodes 0,1, ...
If the user process connects via the 0xff configuration node, then the ioctl handler is not called by the kernel. -1 is returned to the user. But the operations open, close, mmap and others are executed correctly.
Registering an ioctl in the compat_ioctl field makes it impossible to work through any nodes. The handler is not called, and -1 is returned to the user.
How to make it possible for the handler to work through all nodes?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
jcmvbkbc, 2015-12-30
@jcmvbkbc

You would show the code of all structures from the device to file operations and the code for registering the device in the kernel.
And at the same time the code of your application sending ioctl.

V
vreitech, 2015-12-30
@fzfx

signed/unsigned?

K
Kamikadze1024, 2015-01-12
@Kamikadze1024

I throw a link to the source code of the driver. The required handler is located in the dispatc.c file
https://yadi.sk/d/17TR71PKdupem

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question