mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
add basic support of signal
currently, HermitCore is only able to raise signals to itself
This commit is contained in:
parent
a2b36849d9
commit
3dea76c4b9
3 changed files with 13 additions and 2 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 6c1f50c29faf3096050ffcfeadf0c051d532ea7b
|
||||
Subproject commit 018dde1981d2d27b40aa1fad01422750dbd59665
|
|
@ -1 +1 @@
|
|||
Subproject commit be9e07a0375955068500e7d2fe8eda9eb2c569d4
|
||||
Subproject commit 2e946da5c46a44958a2690a53a686af023b952c9
|
|
@ -30,20 +30,31 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
|
||||
#define N 255
|
||||
|
||||
static void test_handler(int s)
|
||||
{
|
||||
printf("Receive signal with number %d\n", s);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int i, random;
|
||||
FILE* file;
|
||||
|
||||
// register test handler
|
||||
signal(SIGUSR1, test_handler);
|
||||
|
||||
printf("Hello World!!!\n");
|
||||
//for(i=0; environ[i]; i++)
|
||||
// printf("environ[%d] = %s\n", i, environ[i]);
|
||||
for(i=0; i<argc; i++)
|
||||
printf("argv[%d] = %s\n", i, argv[i]);
|
||||
|
||||
raise(SIGUSR1);
|
||||
|
||||
file = fopen("/etc/hostname", "r");
|
||||
if (file)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue