mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-30 21:34:27 +01:00
fork and fork bomb moved in from cpp-cheat
This commit is contained in:
13
userland/posix/fork_bomb.c
Normal file
13
userland/posix/fork_bomb.c
Normal file
@@ -0,0 +1,13 @@
|
||||
/* https://cirosantilli.com/linux-kernel-module-cheat#fork-bomb */
|
||||
|
||||
#define _XOPEN_SOURCE 700
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc > 1 && strcmp(argv[1], "danger") == 0) {
|
||||
while (1) {
|
||||
fork();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user