Make sbuf_copyin() return the number of bytes copied on success.

Submitted by:	"Wojciech A. Koszek" <dunstan@freebsd.czest.pl>
This commit is contained in:
Poul-Henning Kamp 2005-12-23 11:49:53 +00:00
parent d2a401cb70
commit 49091c48d5
2 changed files with 5 additions and 1 deletions

View File

@ -337,6 +337,10 @@ and
return
.Dv NULL
and \-1, respectively, if the buffer overflowed.
.Pp
.Fn sbuf_copyin
returns \-1 if copying string from userland failed, and number of bytes
copied otherwise.
.Sh SEE ALSO
.Xr printf 3 ,
.Xr strcat 3 ,

View File

@ -379,7 +379,7 @@ sbuf_copyin(struct sbuf *s, const void *uaddr, size_t len)
return (-1); /* XXX */
}
return (0);
return (done);
}
#endif