raman_klogius@ani.social to Programmer Humor@programming.devEnglish · 7 hours agoHell yeahani.socialimagemessage-square14fedilinkarrow-up1341arrow-down14file-text
arrow-up1337arrow-down1imageHell yeahani.socialraman_klogius@ani.social to Programmer Humor@programming.devEnglish · 7 hours agomessage-square14fedilinkfile-text
minus-squareSnausagesinaBlanket@lemmy.worldlinkfedilinkarrow-up2·4 hours ago#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; }
#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; }
Now that’s just cruel.