-.\" $OpenBSD: imsg_init.3,v 1.20 2017/12/06 12:07:08 zhuk Exp $
+.\" $OpenBSD: imsg_init.3,v 1.21 2018/02/16 07:42:07 nicm Exp $
.\"
.\" Copyright (c) 2010 Nicholas Marriott <nicm@openbsd.org>
.\"
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: December 6 2017 $
+.Dd $Mdocdate: February 16 2018 $
.Dt IMSG_INIT 3
.Os
.Sh NAME
.Fn imsg_create "struct imsgbuf *ibuf" "uint32_t type" "uint32_t peerid" \
"pid_t pid" "uint16_t datalen"
.Ft int
-.Fn imsg_add "struct ibuf *buf" "const void *data" "uint16_t datalen"
+.Fn imsg_add "struct ibuf *msg" "const void *data" "uint16_t datalen"
.Ft void
.Fn imsg_close "struct imsgbuf *ibuf" "struct ibuf *msg"
.Ft void
.Pp
.Fn imsg_add
appends to
-.Fa imsg
-.Fa len
+.Fa msg
+.Fa datalen
bytes of ancillary data pointed to by
-.Fa buf .
+.Fa data .
It returns
.Fa len
if it succeeds, \-1 otherwise.
.Pp
.Fn imsg_close
completes creation of
-.Fa imsg
+.Fa msg
by adding it to
-.Fa imsgbuf
+.Fa ibuf
output buffer.
.Pp
.Fn imsg_compose
The
.Fn ibuf_write
routine transmits as many pending buffers as possible from
-.Fn msgbuf
+.Fa msgbuf
using
.Xr writev 2 .
It returns 1 if it succeeds, \-1 on error and 0 when no buffers were