<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks Dave for your answer. I guess the same question has been answered several times before. For the interest reader, I've found these:<br><br><a href="http://unix.stackexchange.com/questions/4711/what-is-the-difference-between-ioctl-unlocked-ioctl-and-compat-ioctl">http://unix.stackexchange.com/questions/4711/what-is-the-difference-between-ioctl-unlocked-ioctl-and-compat-ioctl</a><br><br><a href="http://lwn.net/Articles/119652/">http://lwn.net/Articles/119652/</a><br><br><a href="http://www.mail-archive.com/kernelnewbies@nl.linux.org/msg00269.html">http://www.mail-archive.com/kernelnewbies@nl.linux.org/msg00269.html</a><br><br>I have a remaining question, though. In the lwn article I read this:<br><br>"The <tt>ioctl()</tt> system call has long been out of favor among the
kernel developers, who see it as a completely uncontrolled entry point into
the kernel".<br><br>Is this pointing that ioctl() is planning to get removed from the kernel ? In that case what's the currently preferred mechanism for giving 'control commands' to device drivers ?<br><br>Thanks again and greetings,<br>Ezequiel.<br><br>--- El <b>mié 18-may-11, Dave Hylands <i>&lt;dhylands@gmail.com&gt;</i></b> escribió:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: Dave Hylands &lt;dhylands@gmail.com&gt;<br>Asunto: Re: unlocked_ioctl explanation<br>Para: "Ezequiel García" &lt;elezegarcia@yahoo.com.ar&gt;<br>Cc: kernelnewbies@kernelnewbies.org<br>Fecha: miércoles, 18 de mayo de 2011, 3:20<br><br><div class="plainMail">Hi Ezequiel,<br><br>2011/5/17 Ezequiel García &lt;<a ymailto="mailto:elezegarcia@yahoo.com.ar" href="/mc/compose?to=elezegarcia@yahoo.com.ar">elezegarcia@yahoo.com.ar</a>&gt;<br>&gt;<br>&gt; I am aware that ioctl has been superseeded by unlocked_ioctl. I've
 been looking through patches and this seems to be BKL related.<br>&gt;<br>&gt; Could someone explain further the differences and reasons for the new ioctl prototype and name?<br>&gt;<br>&gt; I guess 'unlocked' means BKL is no longer held inside ioctl, right?<br><br>Exaclty.<br><br>&gt; What precautions should we take when using unlocked_ioctl ?<br><br>Well, since there is no BKL, your ioctl can get preempted by another<br>process and that other process just might happen to make an ioctl call<br>to your driver.<br><br>So your driver has to protect itself from being called by 2 threads<br>simultaneously, if that's a problem.<br><br>Some drivers won't need any extra protection. Unfortunately, it really<br>depends on exactly what your driver code does.<br><br>--<br>Dave Hylands<br>Shuswap, BC, Canada<br><a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a><br><br>_______________________________________________<br>Kernelnewbies
 mailing list<br><a ymailto="mailto:Kernelnewbies@kernelnewbies.org" href="/mc/compose?to=Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br><a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br></div></blockquote></td></tr></table>