I'd like to consider this for my proposed devctl_notifyf in D34504,
which needs to tap out the data portion of the devctl notification to
netlink. The new model would expand the format string into the sbuf,
tap it out to netlink, then prepend the !system= subsystem= type=
afterwards to form the message we enqueue for devctl.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 63617 Build 60501: arc lint + arc unit
Event Timeline
Comment Actions
On second thought, I'm not so sure this will work anyways... I'd need to finish the sbuf in order to tap out a copy for netlink, since sbuf_data() is only guaranteed to work on a finished sbuf.
sys/kern/subr_sbuf.c | ||
---|---|---|
476 | BAX -- action is always immediate, only weird state is if you ENOMEM in the middle of constructing the string since we may prepend whole str in smaller chunks than the full size of the string |
sys/kern/subr_sbuf.c | ||
---|---|---|
476 | Might be, give a hint in the man page? |
sys/kern/subr_sbuf.c | ||
---|---|---|
471 | so why won't this expand this to the whole size all at once? The loop concerns me. |
sys/kern/subr_sbuf.c | ||
---|---|---|
471 | I kept the loop because of what the comment above it describes- sbuf_extend takes an int, so I wanted to account for the perhaps unlikely possibility that we get a string > INT_MAX in size |