Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2011 09:12:25 -0800
From:      mdf@FreeBSD.org
To:        Robert Watson <rwatson@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r217830 - head/share/man/man9
Message-ID:  <AANLkTimqyPYah5=yWHVxf3Us4=cBYKGkb0oyAE%2B7R-%2Bt@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.1101260929430.44308@fledge.watson.org>
References:  <201101251739.p0PHdqKX044842@svn.freebsd.org> <alpine.BSF.2.00.1101260929430.44308@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 26, 2011 at 1:37 AM, Robert Watson <rwatson@freebsd.org> wrote:
> On Tue, 25 Jan 2011, Matthew D Fleming wrote:
>
>> .Dv SBUF_AUTOEXTEND .
>> .Pp
>> The
>> +.Fn sbuf_new_for_sysctl
>> +function will set up an sbuf with a drain function to use
>> +.Fn SYSCTL_OUT
>> +when the internal buffer fills.
>> +The sysctl old buffer will be wired, which allows for doing an
>> +.Fn sbuf_printf
>> +while holding a mutex.
>> +.Pp
>> +The
>> .Fn sbuf_delete
>> function clears the
>> .Fa sbuf
>
> Hmm. =A0Is this description missing mention of how wiring failures are
> handled? (Also, it should probably mention that this call can sleep for
> potentially quite long periods of time, even if sbuf_printf (and friends)
> can't).

I'm not sure how much to write, since some of the wiring failures are
dealt with by the sysctl subsystem and are not documented.

The current state of the actual code is that a failure in vslock(9) is
ignored, unless it's ENOMEM in which case sysctl_wire_old_buffer sets
the sysctl_req->validlen to 0, which would behave perhaps slightly
unexpectedly for the user since no data will be copied out.

Any non-ENOMEM failure from vslock() presumably would also have been a
failure from SYSCTL_OUT and this does get squashed, perhaps
incorrectly.

I'll think about saving the error code so that sbuf_finish can report
it if nothing else has gone wrong.

Thanks,
matthew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimqyPYah5=yWHVxf3Us4=cBYKGkb0oyAE%2B7R-%2Bt>