Thread (31 messages) 31 messages, 13 authors, 2011-07-17

interview question how does application connects to device

From: Greg Freemyer <hidden>
Date: 2011-07-11 18:14:14

Possibly related (same subject, not in this thread)

On Mon, Jul 11, 2011 at 1:43 PM, StephanT [off-list ref] wrote:
Hi all,

----- Original Message -----
quoted
From: Greg Freemyer <redacted>
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help