RFD: Rework/extending functionality of mdev

Laurent Bercot ska-dietlibc at skarnet.org
Thu Mar 12 18:01:08 UTC 2015


On 12/03/2015 18:26, Isaac Dunham wrote:
> [1] The format proposed by Laurent uses \0 as an "line" terminator;
> I think it might be better to use something that's more readily
> generated by standard scripting tools from uevent files, which would
> make it possible to use cat or env to feed the mdev parser.

  An uevent sent by the netlink is already a series of null-terminated
strings. If you want to make text-scripting tools able to process
those messages, then you need to make the netlink listener convert
the events.

  The advantages of \0 terminators is that they can't appear anywhere
else in strings. Changing the terminators requires either a quoting /
parsing layer, which is hard and expensive, or making assumptions on
the format of the messages.

  It would be feasible, for now, to assume that \n does not appear
in uevent strings, and to replace all instances of \0 (including my
use of an extra \0 as an event terminator) with \n. But there's no
guarantee that \n won't appear in a message in the future, and I'd
rather avoid introducing constraints that don't need to be introduced.
That's my rationale for sticking with \0.

-- 
  Laurent



More information about the busybox mailing list