HomeFreeBSD

Make msgbuf_peekbytes() not return leading zeroes.

Description

Make msgbuf_peekbytes() not return leading zeroes.

Introduce new MSGBUF_WRAP flag, indicating that buffer has wrapped
at least once and does not keep zeroes from the last msgbuf_clear().
It allows msgbuf_peekbytes() to return only real data, not requiring
every consumer to trim the leading zeroes after doing pointless copy.
The most visible effect is that kern.msgbuf sysctl now always returns
proper zero-terminated string, not only after the first buffer wrap.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

Details

Provenance
mavAuthored on Dec 11 2021, 4:18 AM
Parents
rG7a382e744b0b: if_epair: fix module build outside of kernel build environment
Branches
Unknown
Tags
Unknown