akaros/tests/hello.c
<<
>>
Prefs
   1#include <stdlib.h>
   2#include <parlib/stdio.h>
   3#include <parlib/parlib.h>
   4#include <unistd.h>
   5#include <signal.h>
   6
   7static void sig_hand(int signr)
   8{
   9        printf("Got posix signal %d\n", signr);
  10}
  11
  12struct sigaction sigact = {.sa_handler = sig_hand, 0};
  13
  14int main(int argc, char **argv)
  15{
  16        sigaction(SIGTERM, &sigact, 0);
  17        printf("Hello world from program %s!!\n", argv[0]);
  18        sys_block(5000);
  19        kill(getpid(), SIGTERM);
  20        printf("Done\n");
  21        return 0;
  22}
  23