RFD: Rework/extending functionality of mdev

Harald Becker ralda at gmx.de
Sat Mar 14 00:20:55 UTC 2015


On 13.03.2015 21:43, Laurent Bercot wrote:
>   Except you have to make the writes blocking, which severely limits
> what the writers can do - no asynchronous event loop. For a simple
> "cat"-equivalent between the netlink and a fifo, it's enough, but
> it's about all it's good for. And such a "cat"-equivalent is still
> useless.

I'm using none blocking I/O and expect handling of failure situations, 
e.g writing into pipe fails with EAGAIN: poll wait until write possible 
with timeout. then redo write

>   It's still a very bad idea to allow writes from different sources
> into a single fifo when there's only one authoritative source of data,
> in this case the netlink.

Ohps!?

one netlink daemon -> pipe -> parser
   or
many hotplug helper -> pipe -> parser

> If a process wants to read uevents from a
> pipe, it can simply read from an anonymous pipe, being spawned by the
> netlink listener. That's what my s6-uevent-listener and Natanael's
> nldev do, and I agree with you: there's simply no need to introduce
> fifos into the picture.

Laurent, you still stuck on netlink! Using named pipe is requirement for 
the hotplug helper stuff, how else should they get access to the pipe, 
when not using a named pipe? And what is the difference between fifos 
and pipes?

from "man 7 pipe":

---snip---
Pipes  and  FIFOs (also known as named pipes) provide a unidirectional 
interprocess communication channel. A pipe has a read end and a write 
end. Data written to the write end of a pipe can be read from the read
end of the pipe.
---snip---

You see? So whey is pipe good (your choice) and fifo bad (mine)? They 
differ only in how to get access to the descriptors.

--
Harald


More information about the busybox mailing list