Index: sys/sys/sbuf.h =================================================================== --- sys/sys/sbuf.h (revision 268937) +++ sys/sys/sbuf.h (working copy) @@ -33,6 +33,8 @@ #include +.symver _sbuf_setpos_old, sbuf_setpos@FBSD_1.3 + struct sbuf; typedef int (sbuf_drain_func)(void *, const char *, int); Index: lib/libsbuf/Version.def =================================================================== --- lib/libsbuf/Version.def (revision 268937) +++ lib/libsbuf/Version.def (working copy) @@ -5,3 +5,6 @@ FBSD_1.3 { } FBSD_1.2; + +FBSD_1.4 { +} FBSD_1.3; Index: sys/kern/subr_sbuf.c =================================================================== --- sys/kern/subr_sbuf.c (revision 268937) +++ sys/kern/subr_sbuf.c (working copy) @@ -289,6 +289,19 @@ } /* + * Compat shim for buf_setpos with pos being ssize_t. + */ +int _sbuf_setpos_old(struct sbuf *s, ssize_t pos) +{ + KASSERT(pos >= 0, + ("attempt to seek to a negative position (%jd)", (intmax_t)pos)); + + if (pos < 0) + return (-1); + return (buf_setpos(s, pos)); +} + +/* * Set the sbuf's end position to an arbitrary value. * Effectively truncates the sbuf at the new position. */