From owner-freebsd-current@FreeBSD.ORG Fri Dec 16 23:13:00 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1570A16A41F for ; Fri, 16 Dec 2005 23:13:00 +0000 (GMT) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3370743D66 for ; Fri, 16 Dec 2005 23:12:58 +0000 (GMT) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by freebsd.czest.pl (8.12.10/8.12.9) with ESMTP id jBGNFPPx059138 for ; Fri, 16 Dec 2005 23:15:26 GMT (envelope-from dunstan@freebsd.czest.pl) Received: (from dunstan@localhost) by freebsd.czest.pl (8.13.4/8.12.9/Submit) id jBGNFNwX059137 for freebsd-current@freebsd.org; Fri, 16 Dec 2005 23:15:23 GMT (envelope-from dunstan) Date: Fri, 16 Dec 2005 23:15:22 +0000 From: "Wojciech A. Koszek" To: freebsd-current@freebsd.org Message-ID: <20051216231521.GA59072@FreeBSD.czest.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: [PATCH] sbuf_copyin() can return number of bytes copied from user-space X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2005 23:13:00 -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@FreeBSD.czest.pl