link(2) and EFAULT

Michael Galassi nerd at xyz.com
Thu Jul 26 20:52:56 PDT 2007


A few hours ago I wrote:
> copyin() is called by the system call code and returns
> efault after validating the address, before actually
> touching it.

This is the traditional way of doing things but is clearly expensive
as validating a user address takes forever and a bit.  Do we blindly
use whatever address is passed in and then add checking to the page
fault code to figure out if we should just return efault?  This would
be a blatant example of optimizing the common case at small cost for
the error case which most people probably don't care about.

-michael





More information about the Kernel mailing list