From: Theo Buehler Subject: Re: imsg_get -> imsgbuf_get To: Kyle Ackerman Cc: gameoftrees@openbsd.org, claudio@openbsd.org Date: Wed, 29 Jul 2026 09:09:22 +0200 On Tue, Jul 28, 2026 at 10:40:19PM -0600, Kyle Ackerman wrote: > some recent commits to OpenBSD brought to my attention we may could use > a better function to test if get get a new imsg in some of our IPC > functions. Currently, we mainly use imsg_get to test if we got a new > message. This function returns the length of the message written. We > could use imsgbuf_get which just returns the status of if the message > was written. This doesn't save any meaningful amount of time, but may > be the more correct function since in many cases we don't actually do > anything, other than to test if there is a failure or no new messages, > with the return value of imsg_get. Thank you. claudio will remove imsg_get() from libutil soon. ok tb for your diff. As you noticed, and it is essentially true in general, that nothing really uses the actual length return value of imsg_get(). The few uses of it (like in sbin/mountd) first have to fiddle with IMSG_HEADER_SIZE to get to the info and data they actually want, which shows that imsg_get() is not a great interface. IMSG_HEADER_SIZE is a libutil implementation detail applications should not need to know about and it should eventually become internal to libutil. It would generally be desirable if got could make more use of the new imsg API like imsg_get_type() and imsg_get_len() in libutil and stop reaching into struct imsg directly: longer term struct imsg should become opaque. Getting there is going to take a lot of thankless, boring churn and the conversion should not be rushed, as it is easy to introduce errors along the way. The imsg_get() -> imsgbuf_get() conversion is one small step towards such long term goals, which should result in safer use of imsg and better privsep hygiene by introducing better programming idioms. > > diff /home/kyle/src/got > path + /home/kyle/src/got > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 6c2f52da2a05de81659479ad8d6fbcc3eb7f709b > file + gotd/auth.c > --- gotd/auth.c > +++ gotd/auth.c > @@ -345,8 +345,8 @@ auth_dispatch(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 45dbd3ef29ebaaf3b2f33fc65fe4d9bba4931a65 > file + gotd/gotd.c > --- gotd/gotd.c > +++ gotd/gotd.c > @@ -686,8 +686,8 @@ gotd_dispatch_reload(int fd, short event, void *arg) > for (;;) { > const struct got_error *err = NULL; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -967,9 +967,9 @@ gotd_request(int fd, short events, void *arg) > } > > while (err == NULL && !do_disconnect) { > - n = imsg_get(ibuf, &imsg); > + n = imsgbuf_get(ibuf, &imsg); > if (n == -1) { > - err = got_error_from_errno("imsg_get"); > + err = got_error_from_errno("imsgbuf_get"); > break; > } > if (n == 0) > @@ -1555,8 +1555,8 @@ gotd_dispatch_listener(int fd, short event, void *arg) > uint32_t client_id = 0; > int do_disconnect = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -1840,8 +1840,8 @@ gotd_dispatch_notifier(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -2016,8 +2016,8 @@ gotd_dispatch_auth_child(int fd, short event, void *ar > if (client->auth->iev.ibuf.fd != fd) > fatalx("%s: unexpected fd %d", __func__, fd); > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > return; > > @@ -2222,8 +2222,8 @@ dispatch_gotsys_check(int fd, short event, void *arg) > const struct got_error *err = NULL; > int do_disconnect = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -2361,8 +2361,8 @@ dispatch_gotsys_apply(int fd, short event, void *arg) > const struct got_error *err = NULL; > int do_notify = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -2667,8 +2667,8 @@ gotd_dispatch_client_session(int fd, short event, void > int do_disconnect = 0, do_start_repo_child = 0; > int do_gotsys_check = 0, refs_updated = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -2950,8 +2950,8 @@ gotd_dispatch_repo_child(int fd, short event, void *ar > uint32_t client_id = 0; > int do_disconnect = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 5b53a41bab02a5df6cb15e49a2d53073c43885c8 > file + gotd/imsg.c > --- gotd/imsg.c > +++ gotd/imsg.c > @@ -44,9 +44,9 @@ gotd_imsg_recv(struct imsg *imsg, struct imsgbuf *ibuf > { > ssize_t n; > > - n = imsg_get(ibuf, imsg); > + n = imsgbuf_get(ibuf, imsg); > if (n == -1) > - return got_error_from_errno("imsg_get"); > + return got_error_from_errno("imsgbuf_get"); > > if (n == 0) { > n = imsgbuf_read(ibuf); > @@ -54,9 +54,9 @@ gotd_imsg_recv(struct imsg *imsg, struct imsgbuf *ibuf > return got_error_from_errno("imsgbuf_read"); > if (n == 0) > return got_error(GOT_ERR_EOF); > - n = imsg_get(ibuf, imsg); > + n = imsgbuf_get(ibuf, imsg); > if (n == -1) > - return got_error_from_errno("imsg_get"); > + return got_error_from_errno("imsgbuf_get"); > if (n == 0) > return got_error(GOT_ERR_PRIVSEP_READ); > } > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - e9b0b75eb61bca09a252391911da38586a33b02c > file + gotd/libexec/gotsys-apply/gotsys-apply.c > --- gotd/libexec/gotsys-apply/gotsys-apply.c > +++ gotd/libexec/gotsys-apply/gotsys-apply.c > @@ -326,9 +326,9 @@ gotsys_apply(struct gotd_imsgev *iev) > goto done; > } > > - n = imsg_get(&ibuf, &imsg); > + n = imsgbuf_get(&ibuf, &imsg); > if (n == -1) { > - err = got_error_from_errno("imsg_get"); > + err = got_error_from_errno("imsgbuf_get"); > goto done; > } > if (n == 0) { > @@ -415,8 +415,8 @@ dispatch_event(int fd, short event, void *arg) > } > > while (err == NULL && !flush_and_exit) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 66cdf5fa497bc9069380226071d45bcfaa482bf3 > file + gotd/libexec/gotsys-check/gotsys-check.c > --- gotd/libexec/gotsys-check/gotsys-check.c > +++ gotd/libexec/gotsys-check/gotsys-check.c > @@ -184,8 +184,8 @@ dispatch_event(int fd, short event, void *arg) > } > > while (err == NULL && !flush_and_exit) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 5e354ab042e0fdb202fbd1524b28dce4ed292333 > file + gotd/listen.c > --- gotd/listen.c > +++ gotd/listen.c > @@ -519,8 +519,8 @@ listen_dispatch(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - bcf55f560262a0964000226253b2e21dd4ff4ffd > file + gotd/notify.c > --- gotd/notify.c > +++ gotd/notify.c > @@ -411,8 +411,8 @@ notify_dispatch_session(int fd, short event, void *arg > for (;;) { > const struct got_error *err = NULL; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -559,8 +559,8 @@ notify_dispatch(int fd, short event, void *arg) > for (;;) { > const struct got_error *err = NULL; > > - if ((n = imsg_get(imsgbuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(imsgbuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 60f58609acec0f7c93b34a7517dca7ca395fa06a > file + gotd/repo_read.c > --- gotd/repo_read.c > +++ gotd/repo_read.c > @@ -704,8 +704,8 @@ repo_read_dispatch_session(int fd, short event, void * > } > > while (err == NULL && check_cancelled(NULL) == NULL) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -825,8 +825,8 @@ repo_read_dispatch(int fd, short event, void *arg) > } > > while (err == NULL && check_cancelled(NULL) == NULL) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 5c1603d91166a4e668acee7239e2e40044928795 > file + gotd/repo_write.c > --- gotd/repo_write.c > +++ gotd/repo_write.c > @@ -2664,8 +2664,8 @@ repo_write_dispatch_session(int fd, short event, void > } > > while (err == NULL) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -2849,8 +2849,8 @@ repo_write_dispatch(int fd, short event, void *arg) > err = check_cancelled(NULL); > if (err) > break; > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - e3ed47916c3eb8fe92a48e667a22443927f8d805 > file + gotd/session_read.c > --- gotd/session_read.c > +++ gotd/session_read.c > @@ -226,8 +226,8 @@ session_dispatch_repo_child(int fd, short event, void > uint32_t client_id = 0; > int do_disconnect = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -493,9 +493,9 @@ session_dispatch_client(int fd, short events, void *ar > } > > while (err == NULL) { > - n = imsg_get(ibuf, &imsg); > + n = imsgbuf_get(ibuf, &imsg); > if (n == -1) { > - err = got_error_from_errno("imsg_get"); > + err = got_error_from_errno("imsgbuf_get"); > break; > } > if (n == 0) > @@ -794,8 +794,8 @@ session_dispatch(int fd, short event, void *arg) > uint32_t client_id = 0; > int do_disconnect = 0, do_list_refs = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 0e07b3bfbe68530ea229a3a9839bd806b6fc995a > file + gotd/session_write.c > --- gotd/session_write.c > +++ gotd/session_write.c > @@ -1045,8 +1045,8 @@ session_dispatch_repo_child(int fd, short event, void > int packfile_verified = 0; > int do_packfile_install = 0, do_notify = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -1454,9 +1454,9 @@ session_dispatch_client(int fd, short events, void *ar > } > > while (err == NULL) { > - n = imsg_get(ibuf, &imsg); > + n = imsgbuf_get(ibuf, &imsg); > if (n == -1) { > - err = got_error_from_errno("imsg_get"); > + err = got_error_from_errno("imsgbuf_get"); > break; > } > if (n == 0) > @@ -1669,8 +1669,8 @@ session_dispatch_notifier(int fd, short event, void *a > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -1846,8 +1846,8 @@ session_dispatch(int fd, short event, void *arg) > int do_disconnect = 0, do_list_refs = 0; > int send_notifications = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 5e9ae4dae66bcbb8c1a62f380c607b129b9fbafb > file + gotsys/gotsys.c > --- gotsys/gotsys.c > +++ gotsys/gotsys.c > @@ -386,9 +386,9 @@ cmd_apply(int argc, char *argv[]) > goto done; > } > > - n = imsg_get(&ibuf, &imsg); > + n = imsgbuf_get(&ibuf, &imsg); > if (n == -1) { > - err = got_error_from_errno("imsg_get"); > + err = got_error_from_errno("imsgbuf_get"); > goto done; > } > if (n == 0) { > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - e75d7335a4a574bb49b357019e04efae2f3e3db9 > file + gotsysd/auth.c > --- gotsysd/auth.c > +++ gotsysd/auth.c > @@ -253,8 +253,8 @@ auth_dispatch(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 8722302377ba2757e47ee7f596d6c4b28b317f33 > file + gotsysd/gotsysd.c > --- gotsysd/gotsysd.c > +++ gotsysd/gotsysd.c > @@ -496,8 +496,8 @@ gotsysd_dispatch_sysconf_child(int fd, short event, vo > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -755,9 +755,9 @@ gotsysd_request(int fd, short events, void *arg) > } > > while (err == NULL) { > - n = imsg_get(ibuf, &imsg); > + n = imsgbuf_get(ibuf, &imsg); > if (n == -1) { > - err = got_error_from_errno("imsg_get"); > + err = got_error_from_errno("imsgbuf_get"); > break; > } > if (n == 0) > @@ -869,8 +869,8 @@ gotsysd_dispatch_auth_child(int fd, short event, void > if (client->auth->iev.ibuf.fd != fd) > fatalx("%s: unexpected fd %d", __func__, fd); > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > return; > > @@ -1115,8 +1115,8 @@ gotsysd_dispatch_listener(int fd, short event, void *a > uint32_t client_id = 0; > int do_disconnect = 0; > > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -1290,8 +1290,8 @@ gotsysd_dispatch_priv(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -1379,8 +1379,8 @@ gotsysd_dispatch_libexec(int fd, short event, void *ar > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - ae56fc2816ed9bda7e6570c7eb6687f2c425d739 > file + gotsysd/helpers.c > --- gotsysd/helpers.c > +++ gotsysd/helpers.c > @@ -549,8 +549,8 @@ dispatch_helper_child(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get error", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get error", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -878,8 +878,8 @@ helpers_dispatch_sysconf(int fd, short event, void *ar > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -1194,8 +1194,8 @@ helpers_dispatch(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - dd80358169ad52434998f8e391ee7cc3b4699057 > file + gotsysd/imsg.c > --- gotsysd/imsg.c > +++ gotsysd/imsg.c > @@ -82,9 +82,9 @@ gotsysd_imsg_recv(struct imsg *imsg, struct imsgbuf *i > { > ssize_t n; > > - n = imsg_get(ibuf, imsg); > + n = imsgbuf_get(ibuf, imsg); > if (n == -1) > - return got_error_from_errno("imsg_get"); > + return got_error_from_errno("imsgbuf_get"); > > if (n == 0) { > n = imsgbuf_read(ibuf); > @@ -92,9 +92,9 @@ gotsysd_imsg_recv(struct imsg *imsg, struct imsgbuf *i > return got_error_from_errno("imsgbuf_read"); > if (n == 0) > return got_error(GOT_ERR_EOF); > - n = imsg_get(ibuf, imsg); > + n = imsgbuf_get(ibuf, imsg); > if (n == -1) > - return got_error_from_errno("imsg_get"); > + return got_error_from_errno("imsgbuf_get"); > if (n == 0) > return got_error(GOT_ERR_PRIVSEP_READ); > } > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 5141d30d3ad8f8e91bbc26345641dcae3e14d73f > file + gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c > --- gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c > +++ gotsysd/libexec/gotsys-apply-conf/gotsys-apply-conf.c > @@ -145,8 +145,8 @@ dispatch_gotd(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > @@ -212,8 +212,8 @@ dispatch_gotsysd(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - ce1a38ab459d8f6487dc192388d82cf0af173a9c > file + gotsysd/libexec/gotsys-apply-webconf/gotsys-apply-webconf.c > --- gotsysd/libexec/gotsys-apply-webconf/gotsys-apply-webconf.c > +++ gotsysd/libexec/gotsys-apply-webconf/gotsys-apply-webconf.c > @@ -195,8 +195,8 @@ dispatch_gotwebd(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto loopexit; > } > if (n == 0) /* No more messages. */ > @@ -275,8 +275,8 @@ dispatch_gotsysd(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto loopexit; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - d0585c9b7aac72a411be01c5c4ae8bf1bfeeebef > file + gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c > --- gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c > +++ gotsysd/libexec/gotsys-groupadd/gotsys-groupadd.c > @@ -502,8 +502,8 @@ dispatch_event(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 6591a44022103233a58421604b572c94d96d0803 > file + gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c > --- gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c > +++ gotsysd/libexec/gotsys-read-conf/gotsys-read-conf.c > @@ -118,8 +118,8 @@ dispatch_event(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 12c7dd61f55ffd2c9ad4d38346a42d3ad5d81623 > file + gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c > --- gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c > +++ gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c > @@ -331,8 +331,8 @@ dispatch_event(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 7e67b29f962375e303c84fcfb80594a7f00bd379 > file + gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c > --- gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c > +++ gotsysd/libexec/gotsys-rmkeys/gotsys-rmkeys.c > @@ -164,8 +164,8 @@ dispatch_event(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - d081094fbdf495ca1f60bb1ae1ff98c564918da3 > file + gotsysd/libexec/gotsys-useradd/gotsys-useradd.c > --- gotsysd/libexec/gotsys-useradd/gotsys-useradd.c > +++ gotsysd/libexec/gotsys-useradd/gotsys-useradd.c > @@ -759,8 +759,8 @@ dispatch_event(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 4453471c40767aa1128cab6d58f177140526c993 > file + gotsysd/libexec/gotsys-userhome/gotsys-userhome.c > --- gotsysd/libexec/gotsys-userhome/gotsys-userhome.c > +++ gotsysd/libexec/gotsys-userhome/gotsys-userhome.c > @@ -230,8 +230,8 @@ dispatch_event(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - cc7bbb4e42f961f932054dd9a8c25629e7f3135a > file + gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c > --- gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c > +++ gotsysd/libexec/gotsys-userkeys/gotsys-userkeys.c > @@ -163,8 +163,8 @@ dispatch_event(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - f47afeacb14be6b7b606b9436eb491291146c0e9 > file + gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c > --- gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c > +++ gotsysd/libexec/gotsys-write-conf/gotsys-write-conf.c > @@ -1741,8 +1741,8 @@ dispatch_event(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) { > - warn("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) { > + warn("%s: imsgbuf_get", __func__); > goto fatal; > } > if (n == 0) /* No more messages. */ > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - ef984e71f19411e3b16d48ca6c352f8abf8f535b > file + gotsysd/listen.c > --- gotsysd/listen.c > +++ gotsysd/listen.c > @@ -411,8 +411,8 @@ listen_dispatch(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 4224dec1efda1c933218d45619b7dc35f7efac0c > file + gotsysd/sysconf.c > --- gotsysd/sysconf.c > +++ gotsysd/sysconf.c > @@ -184,8 +184,8 @@ sysconf_dispatch_libexec(int fd, short event, void *ar > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -1442,8 +1442,8 @@ sysconf_dispatch_priv(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > @@ -1827,8 +1827,8 @@ sysconf_dispatch(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("%s: imsg_get", __func__); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("%s: imsgbuf_get", __func__); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 96a15fa0e4433a990a034e451c230139129a38de > file + gotwebctl/gotwebctl.c > --- gotwebctl/gotwebctl.c > +++ gotwebctl/gotwebctl.c > @@ -162,9 +162,9 @@ cmd_info(int argc, char *argv[], int gotwebd_sock) > if (n == 0) > break; > > - n = imsg_get(&ibuf, &imsg); > + n = imsgbuf_get(&ibuf, &imsg); > if (n == -1) { > - err = got_error_from_errno("imsg_get"); > + err = got_error_from_errno("imsgbuf_get"); > break; > } > > @@ -236,9 +236,9 @@ cmd_stop(int argc, char *argv[], int gotwebd_sock) > break; > } > > - n = imsg_get(&ibuf, &imsg); > + n = imsgbuf_get(&ibuf, &imsg); > if (n == -1) { > - err = got_error_from_errno("imsg_get"); > + err = got_error_from_errno("imsgbuf_get"); > break; > } > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 668dd10528386642058c7f883943dce5080411e5 > file + gotwebd/auth.c > --- gotwebd/auth.c > +++ gotwebd/auth.c > @@ -831,8 +831,8 @@ auth_dispatch_sockets(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -935,8 +935,8 @@ auth_dispatch_gotweb(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -1026,8 +1026,8 @@ auth_dispatch_main(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 3aa0806a14d767bd4f2ead5eea1fec881a7c5e9c > file + gotwebd/fcgi.c > --- gotwebd/fcgi.c > +++ gotwebd/fcgi.c > @@ -815,8 +815,8 @@ fcgi_dispatch_server(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -904,8 +904,8 @@ fcgi_dispatch_main(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 361d77c7427fc4a3d7cf21474edb09a17c84f5ed > file + gotwebd/gotweb.c > --- gotwebd/gotweb.c > +++ gotwebd/gotweb.c > @@ -2022,8 +2022,8 @@ gotweb_dispatch_server(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -2117,8 +2117,8 @@ gotweb_dispatch_main(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 5843e7fe7a81b94859d0baae3ecf01229fb91a45 > file + gotwebd/gotwebd.c > --- gotwebd/gotwebd.c > +++ gotwebd/gotwebd.c > @@ -206,8 +206,8 @@ gotwebd_dispatch_login(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -253,8 +253,8 @@ gotwebd_dispatch_server(int fd, short event, void *arg > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -303,8 +303,8 @@ gotwebd_dispatch_fcgi(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -353,8 +353,8 @@ gotwebd_dispatch_auth(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -403,8 +403,8 @@ gotwebd_dispatch_gotweb(int fd, short event, void *arg > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -739,7 +739,7 @@ control_request(int fd, short event, void *arg) > } > > for (;;) { > - n = imsg_get(&client->iev.ibuf, &imsg); > + n = imsgbuf_get(&client->iev.ibuf, &imsg); > if (n == -1) { > disconnect(client); > return; > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 1d50b27ccf680b462552a70afeb3c32fe1e4e88a > file + gotwebd/login.c > --- gotwebd/login.c > +++ gotwebd/login.c > @@ -781,8 +781,8 @@ login_dispatch_main(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 6d106f0a375678d96ece6c28b54c08e49d0cdecd > file + gotwebd/sockets.c > --- gotwebd/sockets.c > +++ gotwebd/sockets.c > @@ -427,8 +427,8 @@ server_dispatch_auth(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -703,8 +703,8 @@ server_dispatch_fcgi(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > @@ -814,8 +814,8 @@ sockets_dispatch_main(int fd, short event, void *arg) > } > > for (;;) { > - if ((n = imsg_get(ibuf, &imsg)) == -1) > - fatal("imsg_get"); > + if ((n = imsgbuf_get(ibuf, &imsg)) == -1) > + fatal("imsgbuf_get"); > if (n == 0) /* No more messages. */ > break; > > commit - b3611acb7c736d2f45369e1eea2806450e9d11b2 > blob - 0d88d6641ad7de8be828fa7ee672e3023c8963c3 > file + lib/privsep.c > --- lib/privsep.c > +++ lib/privsep.c > @@ -126,17 +126,17 @@ got_privsep_recv_imsg(struct imsg *imsg, struct imsgbu > const struct got_error *err; > ssize_t n; > > - n = imsg_get(ibuf, imsg); > + n = imsgbuf_get(ibuf, imsg); > if (n == -1) > - return got_error_from_errno("imsg_get"); > + return got_error_from_errno("imsgbuf_get"); > > while (n == 0) { > err = read_imsg(ibuf); > if (err) > return err; > - n = imsg_get(ibuf, imsg); > + n = imsgbuf_get(ibuf, imsg); > if (n == -1) > - return got_error_from_errno("imsg_get"); > + return got_error_from_errno("imsgbuf_get"); > } > > if (imsg->hdr.type == GOT_IMSG_ERROR) { >