Re: interview question how does application connects to device

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

 



On Mon, Jul 11, 2011 at 1:43 PM, StephanT <stman937-linewbie@xxxxxxxxx> wrote:
> Hi all,
>
> ----- Original Message -----
>> From: Greg Freemyer <greg.freemyer@xxxxxxxxx>
>
>
>>
>> Correct, ioctl is no longer preferred, but it is definitely still
>> used.  And the ext4 team is still adding new ioctl commands despite it
>> being discouraged.
>>
>
>
> If ioctl is no longer preferred what is its preferred alternative ?

For simple tasks related to processes procfs.  (I think procfs is read
only from user space)

For simple tasks related to devices sysfs  (sysfs is read / write from
userspace, but uses very simple data formats.  No structures as an
example.

For complex controls, netlink sockets:
http://www.linuxjournal.com/article/7356 is a 5 year article I found
with a quick grep.

> Could you, please explain why ioctl felt in disgrace.

I really don't recall the details, but I'm almost positive I've seen
new patches rejected because they were based on ioctl's.

Can someone else please confirm I'm not imagining things.

As I recall, it has to do with the various architectures not being
easily handled by the ioctl ABI.

==> Here's one quote I just found from lkml Feb. 2010

Can you describe what your driver is doing? One rule of thumb
is that if you already require a character device, using ioctl
is the right answer, but you shouldn't create a character device
if all you want to do over it is a single ioctl operation.

        Arnd
===

Greg

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[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