From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199610172203.RAA00640@atheist.tamu.edu> Date: Thu, 17 Oct 1996 17:03:51 -0500 (CDT) From: Richard Henderson Subject: Re: Linux-2.1.4 In-Reply-To: > There is still issue (tought not directly related to kernel source). What > to do with such functions when the exception occurs in the middle of > user space cleared, copyed from or copyed to (assuming functions as > clear_user, strncpy_from_user, strncpy_to_user) ? The copy_to_user and copy_from_user functions Linus defined to return the number of bytes _not_ copied. In doing the others for the Alpha, I defined clear_user the same way. As for strncpy_from_user, which Linus just mentioned but did not define, I did something slightly different due to the difference in the way the function would be used in the first place: it returnes -EFAULT on exception, -ENAMETOOLONG if the buffer filled before the terminator was copied (but it does always make sure that the kernel buffer is terminated!) Otherwise, it returns the length of the string. Oh, and strncpy_to_user is not likely to be useful, as we usually already know the length of the string and so copy_to_user is better. r~ -- To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null