Re: Ioctl Numbering

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

 



Hi,

Please reply to the mailing list also. See inline:

manikandan wrote:

hi,
In "Advanced Char Driver Operations" Chapter in LDD by Alessandro Rubini. ,some macros like _IOC_NONE , _IOC_READ,_IOC_WRITE, and _IOC_READ | _IOC_WRITE are given to frame commands.

the above mentioned indicate the direction of data transfer.

If Interpretation of commands must be same in user space and kernel space and if we r using these macros and dynamically allocating value,then how user space will know this..(these macros can't be used in user space know)

AFAIK commands are interpreted based on the magic numbers (ioctl-number.txt) used to define an ioctl command. The macros _IOC_READ, _IOC_WRITE are interpreted only when there is a data transfer involved when issuing a particular ioctl command.


Rgds
B.M.K

hiran wrote:



manikandan wrote:

hi,
what is the method to follow for framing numbering for ioctl commands... what are the drawbacks if i follow sequence numbering starting from some 25 or 35...



ioctl command numbers should be unique across the whole system. For details refer to "Advanced Char Driver Operations" Chapter in LDD by Alessandro Rubini.


Rgds
B.M.K


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux