james.oden has asked for the wisdom of the Perl Monks concerning the following question:
I have a daemon library that attempts to close all file descriptors after it forks. Unfortunately, when closing using POSIX::close() so you can close with just an fd, it is of course not cleaning up file handles associated with the fd. This causes highly interesting bugs...
What I need is a way to close all file handles associated with a fd, or get references to all the filehandles's associated with an fd so I can close them. Does anyone know how to do this.
BTW, I'm looking at the perlio.c code right now to figure out how I might do this in C, but if its already been done or there is a way that would be so helpful and appreciated.
Thanks...james
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Closing all filehandles associate with an fd
by zwon (Abbot) on Dec 11, 2009 at 23:06 UTC | |
|
Re: Closing all filehandles associate with an fd
by ikegami (Patriarch) on Dec 12, 2009 at 00:03 UTC | |
|
Re: Closing all filehandles associate with an fd
by zentara (Cardinal) on Dec 12, 2009 at 12:40 UTC | |
by afoken (Chancellor) on Dec 12, 2009 at 23:47 UTC |