ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / um / kernel / skas / syscall_user.c
1 /* 
2  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #include <stdlib.h>
7 #include <signal.h>
8 #include "kern_util.h"
9 #include "syscall_user.h"
10 #include "sysdep/ptrace.h"
11 #include "sysdep/sigcontext.h"
12
13 /* XXX Bogus */
14 #define ERESTARTSYS     512
15 #define ERESTARTNOINTR  513
16 #define ERESTARTNOHAND  514
17
18 void handle_syscall(union uml_pt_regs *regs)
19 {
20         long result;
21         int index;
22
23         index = record_syscall_start(UPT_SYSCALL_NR(regs));
24
25         syscall_trace();
26         result = execute_syscall(regs);
27
28         REGS_SET_SYSCALL_RETURN(regs->skas.regs, result);
29         if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || 
30            (result == -ERESTARTNOINTR))
31                 do_signal(result);
32
33         syscall_trace();
34         record_syscall_end(index, result);
35 }
36
37 /*
38  * Overrides for Emacs so that we follow Linus's tabbing style.
39  * Emacs will notice this stuff at the end of the file and automatically
40  * adjust the settings for this buffer only.  This must remain at the end
41  * of the file.
42  * ---------------------------------------------------------------------------
43  * Local variables:
44  * c-file-style: "linux"
45  * End:
46  */