mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-12 04:08:28 +00:00
Define SIGUSR1 for hybrid Linux/Genode programs
This patch fixes the 'lx_hybrid_pthread_ipc.run' test. In order to use the 'Genode::Lock' we need to set the SIGUSR1 handler to an empty handler. Normally, this happens when creating a thread via the Genode API. But as this test creates a thread via the pthread library and thereby bypasses the Genode API, the signal handler remained unset.
This commit is contained in:
@ -40,6 +40,8 @@ int genode___cxa_atexit(void (*func)(void*), void *arg, void *dso)
|
|||||||
extern char **environ;
|
extern char **environ;
|
||||||
extern char **lx_environ;
|
extern char **lx_environ;
|
||||||
|
|
||||||
|
static void empty_signal_handler(int) { }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function must be called before any other static constructor in the Genode
|
* This function must be called before any other static constructor in the Genode
|
||||||
* application, so it gets the highest priority (lowest priority number >100)
|
* application, so it gets the highest priority (lowest priority number >100)
|
||||||
@ -47,6 +49,12 @@ extern char **lx_environ;
|
|||||||
__attribute__((constructor(101))) void lx_hybrid_init()
|
__attribute__((constructor(101))) void lx_hybrid_init()
|
||||||
{
|
{
|
||||||
lx_environ = environ;
|
lx_environ = environ;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set signal handler such that canceled system calls get not
|
||||||
|
* transparently retried after a signal gets received.
|
||||||
|
*/
|
||||||
|
lx_sigaction(LX_SIGUSR1, empty_signal_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -158,9 +166,6 @@ namespace Genode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void empty_signal_handler(int) { }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return Linux-specific extension of the Env::CPU session interface
|
* Return Linux-specific extension of the Env::CPU session interface
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user