Explorar o código

another function for the new signal feature

Sebastian Vendt %!s(int64=4) %!d(string=hai) anos
pai
achega
35859dd6c3
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      libA.c

+ 6 - 0
libA.c

@@ -51,4 +51,10 @@ int main(void)
 
     sleep(5);
     return 0;
+}
+
+//this also belongs to the new signal feature
+void sighandler(int signum) {
+   printf("Caught signal %d, coming out...\n", signum);
+   exit(1);
 }