Carts are now batches of events waiting to be or just recently
persisted. _lo_work calls u2_reck_kick on the last batch of events,
removes every batch that's been through Raft, and then prepares the next
batch.
TODO make _lo_punk et al stick things on roe
TODO move disk persistence to raft.c
TODO raft_push: lo_open / mark / lo_shut
This fixes daemon mode.
Strictly speaking, the _lo_poll call is only necessary when we're
in daemon mode, but having our network code randomly work as a side
effect of polling for terminal input seems like a poor life choice,
so we do it unconditionally.
OpenBSD whines about these and recommends using strlcpy / snprintf
instead. Since strlcpy isn't quite universal yet, we use strncpy instead
and be careful about terminating the string. We could implement a
portable strlcpy in terms of strncpy, but that'd add another function to
the namespace.
Yes, usually the length is obviously bounded. Still, pretending
strcpy/sprintf don't exist seems like a great strategy.
N.B. there are still a few occurrences of strcpy and sprintf under f/
and in libuv, but I don't have time to tackle them right now.