Browse Source

Trying out signals

Sebastian Vendt 4 năm trước cách đây
mục cha
commit
718a1f9d99
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      libA.c

+ 8 - 0
libA.c

@@ -40,6 +40,14 @@ int main(void)
 
         i++;
     }
+	
+	//this belongs all to the new feature of the app 
+	signal(SIGINT, sighandler);
+
+   while(1) {
+      printf("Going to sleep for a second...\n");
+      sleep(1); 
+   }
 
     sleep(5);
     return 0;