[PATCH] sbuf_copyin() can return number of bytes copied from user-space

From: Wojciech A. Koszek <dunstan_at_freebsd.czest.pl>
Date: Fri, 16 Dec 2005 23:15:22 +0000
Hello,

Function sbuf_copyin() at current stage makes no use of "done" argument,
used internally. "done", which is a result of copying string from
user-space address with copyinstr(), contains number of bytes copied. We
can easily extend current implementation:

http://freebsd.czest.pl/dunstan/FreeBSD/sbuf_copyin.0.patch

I'd like to receive comments from people making use of sbuf_copyin() in
their sources. This change will probably make it necessary to compare
return value with -1 in order to detect failure. At current stage,
existing FreeBSD code uses sbuf_copyin in two files, both ignoring
return value, so this shouldn't break anything.

If noone will object, above change will probably be commited. 

Comments are welcome!
-- 
* Wojciech A. Koszek && dunstan_at_FreeBSD.czest.pl
Received on Fri Dec 16 2005 - 22:13:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:49 UTC