From owner-freebsd-arch@FreeBSD.ORG Mon Apr 12 22:28:47 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C745A106566B for ; Mon, 12 Apr 2010 22:28:47 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 710C98FC0C for ; Mon, 12 Apr 2010 22:28:47 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 805B3A561A1; Tue, 13 Apr 2010 06:28:46 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id TZUpelbWeKNT; Tue, 13 Apr 2010 06:28:40 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 7E005A56199; Tue, 13 Apr 2010 06:28:39 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:subject:x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=cLlVQu6zh3kqkdAmLLrCuYRufh2md+ZnqofYf6atiYqskPrj0Pnbln/R9OmGMw9It zsh88YSptj4Dr6vXTk/SQ== Message-ID: <4BC39E93.7060906@delphij.net> Date: Mon, 12 Apr 2010 15:28:35 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100408 Thunderbird/3.0.4 ThunderBrowse/3.2.8.1 MIME-Version: 1.0 To: freebsd-arch@freebsd.org X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: _IOWR when errno != 0 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 22:28:47 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Is there a sane way to copyout ioctl request when the returning errno != 0? Looking at the code, currently, in sys/kern/sys_generic.c, we have: =========== error = kern_ioctl(td, uap->fd, com, data); if (error == 0 && (com & IOC_OUT)) error = copyout(data, uap->data, (u_int)size); =========== Is there any objection if I change it to something like: =========== saved_error = kern_ioctl(td, uap->fd, com, data); if (com & IOC_OUT) error = copyout(data, uap->data, (u_int)size); if (saved_error) error = saved_error; =========== Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJLw56PAAoJEATO+BI/yjfBuYMIAM7qAVWuWn/noQPzH12W3IoH TInBLyGjG8tH5z9CPJeXe3X+aVz932KEuE85E6GXBo7zoGf1IWbMk8+LO+Ai+5It AgxeFrBUn0MUEY4dJPZs89Ag8LCBFvvHOe1eTxw+6sjdSDtFg2OV55F2nrCcPtoG jIEQtcfhy1H+evihEycoN9uMdTH0XWEcCZVhXKS0R4a3veOp2RUt4I21LhSYdyrx xairvHNIOp0eBdHf8O2TlwyWzlZpHg3XMO9UM/aZ5uiVeSIsB0nEX3SXGi3o7Rih DaCTqZpk4L6z1UIUsGEqLl5i6yrbP5LFwNDk9dYbQL3of4SVPofsD9O1hJ3MuIE= =cMdX -----END PGP SIGNATURE-----