On 05 Sep 2005 21:26:22 -0600, jbi130@xxxxxxxxx <jbi130@xxxxxxxxx> wrote: > Fawad Lateef <fawadlateef@xxxxxxxxx> writes: > > > On 02 Sep 2005 16:18:50 -0600, jbi130@xxxxxxxxx <jbi130@xxxxxxxxx> wrote: > > > I find myself implementing lots of ioctl() to get a set variables. Is > > > there a better/more correct alternative for this instead of polluting > > > the ioctl()? procfs maybe? > > > > > > > For which Kernel version you are talking about ?? If that is 2.4.x > > series kernel then you can use ProcFS, and in 2.6.x series you can use > > SysFS ..... in 2.6.x usage of ProcFS is said to be used for things > > related to process only; so go for SysFS in 2.6.x kernels. > > 2.6.. So is sysfs an ideal solution to get a set various variables? I > recall reading somewhere that ioctl()'s were an overused archaic > interface into the kernel. I do have cases where ioctl() appear to be > the right solution, but wonder about some of my other cases (exposing > a single variable). > What I read and see is that every1 is mentioning not to create many system calls (ioctls) as it make kernel messey (I m not getting the correct work to mention here against messy :) ) ........... So if u need many ioctls then use sysfs b/c that is there too for transferring data from user to kernel module in a better way !!!!! But if you can send verious variables (let say in a structure) at a single time/system call then you can use ioctl as it is the simplest way of doing user to kernel or vice versa data transfer. -- Fawad Lateef -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/