raman_klogius@ani.social to Programmer Humor@programming.devEnglish · 6 days agoHell yeahani.socialimagemessage-square15fedilinkarrow-up1635arrow-down15file-text
arrow-up1630arrow-down1imageHell yeahani.socialraman_klogius@ani.social to Programmer Humor@programming.devEnglish · 6 days agomessage-square15fedilinkfile-text
minus-squareChaosMonkey@lemmy.dbzer0.comlinkfedilinkarrow-up2arrow-down1·5 days agoNow that’s just cruel.
minus-squareSonotsugipaa@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up6·5 days agoThe 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; }
Now that’s just cruel.
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; }