We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38ac1b8 commit c83850bCopy full SHA for c83850b
src/usr/local/src/forkbomb.c
@@ -0,0 +1,17 @@
1
+// multiprocessing example
2
+#include <stdio.h>
3
+#include <process.h>
4
+
5
6
+int main(int argc,char *argv[]) {
7
+ while(1) {
8
+ int potential_parent_pid = getpid();
9
+ int pid = fork();
10
+ if(pid<0) {
11
+ printf("fork bomb pid: %d says it can't fork anymore\n", potential_parent_pid);
12
+ } else if(pid>0) {
13
+ printf("new fork bomb pid:%d says thanks to pid:%d\n", pid, potential_parent_pid);
14
+ }
15
16
+ return 0;
17
+}
0 commit comments