Results 1 to 1 of 1
Thread: Private ioctls
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Dec 2010
We use ubuntu 10.04.
We are currently working on retrieving the kernel time in nanoseconds to userspace and have arrived at a conclusion that writing an ioctl would fulfill the purpose. We read linux/sockios.h and found that SIOCDEVPRIVATE to SIOCDEVPRIVATE+15 are reserved for writing private ioctls.
It mentioned that your driver must redefine them in its code.
So does this mean that, if my ioctl function is abc , then i have to #define it as-
#define abc SIOCDEVPRIVATE
in the driver code
and then write a function named abc with all the appropriate arguments and in switch case
when cmd=SIOCDEVPRIVATE, implement my own logic ???
Then from userspace simply call socket ioctl with ifreq structure pointer as its third argument.
Is this the correct approach?? If not then how should this be implemented???
Any guidance would be appreciated....