Messages in this thread | | | Date | Wed, 26 Aug 1998 11:14:21 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: copy_from_user() fix |
| |
On Wed, 26 Aug 1998, Rob Hagopian wrote: > > Just my $0.02, I think it should be a per process personality, but it > should default to SEGV.
I certainly used to dislike EFAULT too, and much preferred SIGSEGV because it's what makes more sense. The EFAULT return really is an implementation issue from fairly early UNIX, and it's not conceptually the right thing to do. As Peter points out, it needlessly shows the difference between a system call and a library function, and as such exposes a difference that really shouldn't be there.
That said, it's how UNIX works, and Linux can easily do it either way. If I _could_ just do a SIGSEGV I would probably do so, because it would be less work in worrying about return codes etc. However, once you accept that you need to be able to return EFAULT because some processes want it, it is no longer any less work to do so everywhere, and there is no longer any advantage to raising SIGSEGV from an implementation standpoint.
So in the end, SIGSEGV/EFAULT is not all that important implementation- wise and due to historical reasons EFAULT would be the default as far as I'm concerned. And if it's the default, then there isn't much advantage to having SIGSEGV at all for system calls - it just complicates the issue to have a choice.
It all really boils down to the fact that I'd prefer to have just one behaviour, whichever it is. And EFAULT is almost mandated as a choice, so I'll just stick to returning EFAULT..
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |