X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Fum%2Fos-Linux%2Fprocess.c;h=76bdd671241735df114ef75cf0120674acabb163;hb=eaf60d6924759eb2a249c0b568533a90c238061b;hp=b98d3ca2cd1bdb5dba29e45aa6682c729f3425fc;hpb=5694ca9f46202c50df525472abb6d8c1dee4f8eb;p=linux-2.6-omap-h63xx.git diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index b98d3ca2cd1..76bdd671241 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c @@ -7,11 +7,10 @@ #include #include #include -#include -#include #include #include #include +#include #include "ptrace_user.h" #include "os.h" #include "user.h" @@ -22,6 +21,7 @@ #include "longjmp.h" #include "skas_ptrace.h" #include "kern_constants.h" +#include "uml-config.h" #define ARBITRARY_ADDR -1 #define FAILURE_PID -1 @@ -132,20 +132,20 @@ void os_kill_ptraced_process(int pid, int reap_child) CATCH_EINTR(waitpid(pid, NULL, 0)); } +#ifdef UML_CONFIG_MODE_TT void os_usr1_process(int pid) { kill(pid, SIGUSR1); } +#endif /* Don't use the glibc version, which caches the result in TLS. It misses some * syscalls, and also breaks with clone(), which does not unshare the TLS. */ -inline _syscall0(pid_t, getpid) - int os_getpid(void) { - return(getpid()); + return(syscall(__NR_getpid)); } int os_getpgrp(void) @@ -247,7 +247,17 @@ void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) set_sigstack(sig_stack, pages * page_size()); flags = SA_ONSTACK; } - if(usr1_handler) set_handler(SIGUSR1, usr1_handler, flags, -1); + if(usr1_handler){ + struct sigaction sa; + + sa.sa_handler = usr1_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = flags; + sa.sa_restorer = NULL; + if(sigaction(SIGUSR1, &sa, NULL) < 0) + panic("init_new_thread_stack - sigaction failed - " + "errno = %d\n", errno); + } } void init_new_thread_signals(void)