Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2010 15:28:35 -0700
From:      Xin LI <delphij@delphij.net>
To:        freebsd-arch@freebsd.org
Subject:   _IOWR when errno != 0
Message-ID:  <4BC39E93.7060906@delphij.net>

next in thread | raw e-mail | index | archive | help
-----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 <delphij@delphij.net>	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-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BC39E93.7060906>