[PATCH] sbuf_copyin() can return number of bytes copied from
user-space
Wojciech A. Koszek
dunstan at freebsd.czest.pl
Fri Dec 16 15:13:00 PST 2005
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
More information about the freebsd-current
mailing list