init.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /*
  6. Module: initialization and some global vars
  7. Author: Ceriel J.H. Jacobs
  8. Version: $Id$
  9. */
  10. #include <signal.h>
  11. #include <em_abs.h>
  12. #include <m2_traps.h>
  13. /* map unix signals onto EM traps */
  14. init()
  15. {
  16. sigtrp(M2_UNIXSIG, SIGHUP);
  17. sigtrp(M2_UNIXSIG, SIGINT);
  18. sigtrp(M2_UNIXSIG, SIGQUIT);
  19. sigtrp(EILLINS, SIGILL);
  20. sigtrp(M2_UNIXSIG, SIGTRAP);
  21. sigtrp(M2_UNIXSIG, SIGIOT);
  22. sigtrp(M2_UNIXSIG, SIGEMT);
  23. sigtrp(M2_UNIXSIG, SIGFPE);
  24. sigtrp(M2_UNIXSIG, SIGBUS);
  25. sigtrp(M2_UNIXSIG, SIGSEGV);
  26. sigtrp(EBADMON, SIGSYS);
  27. sigtrp(M2_UNIXSIG, SIGPIPE);
  28. sigtrp(M2_UNIXSIG, SIGALRM);
  29. sigtrp(M2_UNIXSIG, SIGTERM);
  30. }
  31. #if defined(__em22) || defined(__em24) || defined(__em44)
  32. killbss()
  33. {
  34. }
  35. #else
  36. static int blablabla; /* We cannot use end, because then also
  37. bss allocated for the systemcall lib
  38. would be overwritten. Lets hope that
  39. this helps ...
  40. */
  41. killbss()
  42. {
  43. extern char *bkillbss;
  44. register char *p = (char *) &bkillbss;
  45. while (p < (char *) &blablabla) *p++ = 0x66;
  46. }
  47. #endif
  48. extern int catch();
  49. int (*handler)() = catch;
  50. char **argv = 0, **environ = 0;
  51. int argc = 0;
  52. char *MainLB = 0;