fcntl(), fork() operations on Solaris

fcntl(), fork() operations on Solaris

Post by Venkat Sidhabathun » Sat, 30 May 1998 04:00:00



Hi,

This may be a question for FAQ. Since I don't
watch this group, pls. email your response.

I have a file open in Process (P1) and then that
process forks, and exec another program (P2).
P2 program opens a Socket connection to another
system. It is indefinitely waiting on poll() method
which never returned, though remote system
send response [message] on that socket.

If I do fcntl( fd, F_SETFD, 1); // close on exec
in P1 when the file is opened, it works. Yes,
from the description, it makes sense to do SETFD.
Can someone explain to me what really is it
doing (other than closing the file descriptor on
exec) Still beats me why should socket connection
is broken because of not doing close on exec
on another file!

Thanks in advance,
Venkat