-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi
Is there any way to differentiate the child processes created by different fork() functions within a program.
global variable i;
SIGCHLD handler function()
{
i--;
}
handle()
{
fork() --> FORK2
}
main()
{
while(1)
{
if(i<5)
{
i++;
if( (fpid=fork())==0)…
>>> More
-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
I just came to realize that my system is not limiting the amount of processes per user properly thus not preventing a user from dring a fork-bomb and crashing the entire system:
user@thebe:~$ cat /etc/security/limits.conf | grep user
user hard nproc 512
user@thebe:~$ ulimit -u
1024
user@thebe:~$…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm using fork() on PERL in windows (activeperl) for a basic socket server, but apparently there are problems (it won't accept connections after a few times), is there any workaround?
while($client = $bind->accept()) {
$client->autoflush();
if(fork()){ $client->close(); }
else…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
When reading about pipes in Advanced Programming in the UNIX Environment, I noticed that after a fork that the parent can close() the read end of a pipe and it doesn't close the read end for the child. When a process forks, does its file descriptors get retained? What I mean by this is that before…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I know that fork() returns differently for the son and father processes, but I'm unable to find information on how this happens. How does the son process receive the return value 0 from fork? And what is the difference in regards to the call stack? As I understand it, for the father it goes something…
>>> More