Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
fork
Configure Feed
Select the types of activity you want to include in your feed.
1/*
2 * Copyright (C) 2001 Chris Emerson (cemerson@chiark.greenend.org.uk)
3 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
4 * Licensed under the GPL
5 */
6
7#include <setjmp.h>
8#include <string.h>
9#include "longjmp.h"
10
11unsigned long __do_user_copy(void *to, const void *from, int n,
12 void **fault_addr, void **fault_catcher,
13 void (*op)(void *to, const void *from,
14 int n), int *faulted_out)
15{
16 unsigned long *faddrp = (unsigned long *) fault_addr, ret;
17
18 jmp_buf jbuf;
19 *fault_catcher = &jbuf;
20 if(UML_SETJMP(&jbuf) == 0){
21 (*op)(to, from, n);
22 ret = 0;
23 *faulted_out = 0;
24 }
25 else {
26 ret = *faddrp;
27 *faulted_out = 1;
28 }
29 *fault_addr = NULL;
30 *fault_catcher = NULL;
31 return ret;
32}
33