shouldn't it multiply and slow down my system.
int main(){
int x = 1;
while(x){
int fork(void);
}
return 0;
}
Printable View
shouldn't it multiply and slow down my system.
int main(){
int x = 1;
while(x){
int fork(void);
}
return 0;
}
try this for a fork bomb.
#include <unistd.h>
int main(void)
{
while(1) {
fork();
}
return 0;
}
ummm... I may be just being stupid here...
But I don't see any functional difference between those, aside from the #include, which I assume unhappy simply didn't paste.
What's the difference?
what's that? please give a brief intro...
Hi
While the first example by unhappy simply declares a function fork()
with "void fork(int);" the second by hogfly actually calls system's
fork()-function thus spawning a child process.
Cheers