Date: Thu, 9 Sep 2010 10:45:59 -0700 From: mdf@FreeBSD.org To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: FreeBSD Arch <freebsd-arch@freebsd.org> Subject: Re: Extending sbufs with a drain, take 2 Message-ID: <AANLkTik7%2BKTOCYJiZ_n3SYTbwszNPNgh0SL49HhJDoii@mail.gmail.com> In-Reply-To: <85035.1284017219@critter.freebsd.dk> References: <AANLkTim16YitneEE7kkWzwssQasab3qG9dygv%2BTuHa7x@mail.gmail.com> <85035.1284017219@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
Thank you very much for your continued input. I have incorporated all these ideas and I am committing the patches as I update them and test them. On Thu, Sep 9, 2010 at 12:26 AM, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote: >>Replace sbuf_overflowed() with sbuf_error(), which returns any error >>code associated with overflow or with the drain function. >> >>http://people.freebsd.org/~mdf/0006-Replace-sbuf_overflowed-with-sbuf_error-which-return.patch > > Now that sbuf_finish() returns the error, most applications should > not need to sbuf_finish()/sbuf_error() at all. Right. There were 16 uses in the entire tree (all in the kernel). Several of these were in error; that is checking sbuf_overflowed() after an sbuf_finish(). These uses I fixed to check the return code from sbuf_finish(). I believe 5 were used to determine if the static buffer for sysctl was too small; these uses are removed in my patch. The remaining uses are to check that the data fits in the static sized buffer, e.g. MAXPATHLEN for audit, 1024 bytes for some ioctls, etc. Again, thanks for all your help. One question about the printf expanded args in xprintf.c: Does the extension framework allow for multiple character conversion specifiers? I.e. I see that you added a sample %V and %H and %T in the original version. Could this framework allow a %{} specifier or is it assumed that conversions are a single character (possibly with modifiers)? Thanks, matthew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik7%2BKTOCYJiZ_n3SYTbwszNPNgh0SL49HhJDoii>