Extending sbufs with a drain

mdf at FreeBSD.org mdf at FreeBSD.org
Wed Sep 8 23:09:19 UTC 2010


On Wed, Sep 8, 2010 at 3:35 PM, Gordon Tetlow <gordon at tetlows.org> wrote:
> On Wed, Sep 8, 2010 at 9:29 AM, Poul-Henning Kamp <phk at phk.freebsd.dk>
> wrote:
>>
>> In message <AANLkTikerOYdEyT6jt7rAN3JP_N_oofq7ZXc4NptA4zP at mail.gmail.com>,
>> mdf@
>> FreeBSD.org writes:
>> >> For one thing, sbuf is not a kernel facility, it is a general purpose
>> >> string editing library which is also used outside FreeBSD.   If
>> >> we add the drain facility it should work in both userland and kernel.
>> >
>> >Given that sys/sbuf.h is included in 100+ kernel files and 4
>> >user-space files, [...]
>>
>> That is probably more an indication that our userland is largely
>> unchanged from 1995, whereas as everybody loves to hack up the
>> kernel :-)  The various people who have told me they adopted sbufs
>> have been very happy with them in userland.
>
> I would think that is more likely a result of the only documentation I see
> for sbuf always refers to kernel implementation (sbuf(9), I don't see any
> documentation for sbuf(3). Can you give some pointers? I've always hated
> string manipulation in C, if I can find another way to do it, I'm all for
> it.

The sbuf(9) man page describes the library well.  It's in lib/libsbuf,
so link a userland application with -lsbuf.

Cheers,
matthew


More information about the freebsd-arch mailing list