diff -Naur -X exclude-files ac_cur/arch/um/kernel/uaccess_user.c ac/arch/um/kernel/uaccess_user.c --- ac_cur/arch/um/kernel/uaccess_user.c Sat Aug 4 15:57:57 2001 +++ ac/arch/um/kernel/uaccess_user.c Sat Aug 4 21:38:10 2001 @@ -10,17 +10,20 @@ static unsigned long __do_user_copy(void *to, const void *from, int n, void **fault_addr, void **fault_catcher, void (*op)(void *to, const void *from, - int n)) + int n), int *faulted_out) { unsigned long *faddrp = (unsigned long *) fault_addr, ret; jmp_buf jbuf; *fault_catcher = &jbuf; - if (setjmp(jbuf) == 0) { - (*op)(to, from, n); - ret = 0; - } else { - ret = *faddrp; + if(setjmp(jbuf) == 0){ + (*op)(to, from, n); + ret = 0; + *faulted_out = 0; + } + else { + ret = *faddrp; + *faulted_out = 1; } *fault_addr = NULL; *fault_catcher = NULL; @@ -36,10 +39,11 @@ void **fault_addr, void **fault_catcher) { unsigned long fault; + int faulted; fault = __do_user_copy(to, from, n, fault_addr, fault_catcher, - __do_copy); - if(fault == 0) return(0); + __do_copy, &faulted); + if(!faulted) return(0); else return(n - (fault - (unsigned long) from)); } @@ -48,10 +52,11 @@ void **fault_addr, void **fault_catcher) { unsigned long fault; + int faulted; fault = __do_user_copy(to, from, n, fault_addr, fault_catcher, - __do_copy); - if(fault == 0) return(0); + __do_copy, &faulted); + if(!faulted) return(0); else return(n - (fault - (unsigned long) to)); } @@ -64,10 +69,11 @@ void **fault_addr, void **fault_catcher) { unsigned long fault; + int faulted; fault = __do_user_copy(dst, src, count, fault_addr, fault_catcher, - __do_strncpy); - if(fault == 0) return(strlen(dst)); + __do_strncpy, &faulted); + if(!faulted) return(strlen(dst)); else return(-1); } @@ -80,10 +86,11 @@ void **fault_addr, void **fault_catcher) { unsigned long fault; + int faulted; fault = __do_user_copy(mem, NULL, len, fault_addr, fault_catcher, - __do_clear); - if(fault == 0) return(0); + __do_clear, &faulted); + if(!faulted) return(0); else return(len - (fault - (unsigned long) mem)); } @@ -93,11 +100,13 @@ int ret; unsigned long *faddrp = (unsigned long *)fault_addr; jmp_buf jbuf; + *fault_catcher = &jbuf; - if (setjmp(jbuf) == 0) { + if(setjmp(jbuf) == 0){ ret = strlen(str) + 1; - } else { - ret = *faddrp - (unsigned long)str; + } + else { + ret = *faddrp - (unsigned long) str; } *fault_addr = NULL; *fault_catcher = NULL;