Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on ani.social

15 replies

Why is this a surprise to anyone? Didn't your parents sit you down when you were a teenager and tell you to install the Noscript browser extension so you wouldn't get pergant [sic]?

62

#include <sys/types.h> #include <signal.h> #include <unistd.h>

int main() { pid_t pid = fork(); if (pid == 0) { // Child process while (1); } else { // Parent process sleep(2); kill(pid, SIGKILL); // Force kill child printf("Child process killed.\n"); } return 0; }

9

The cruelest part is not formatting it correctly :c

#include <sys/types.h>
#include <signal.h>
#include <unistd.h>

int main() {
    pid_t pid = fork();
    if (pid == 0) {
        // Child process
        while (1);
    } else {
        // Parent process
        sleep(2);
        kill(pid, SIGKILL);  // Force kill child
        printf("Child process killed.\n");
    }
    return 0;
}
7

You reached the end

Hell yeah | Spyke