reaping fd's and flushing buffers

William Lee Irwin III
Fri, 3 Jan 2003 03:10:36 -0800

On Fri, Jan 03, 2003 at 03:06:48AM -0800, John Meacham wrote:
> perhaps this is related to these errors i get after my program runs for
> a while (about 2 days):
> I am guessing the no such protocol entry is because it cant open the
> /etc/protocols file due to a lack of fds. it is almost as if file
> descriptors are not being closed and leaking over time...

I removed the getProtocolByName path by using a raw integer port number
and the error(s) still occurred. By listing /proc/$PID/fd I determined
that they were sockets (which are listed in a special format).

That investigation was prompted by strace(1)'s results, which indicated
that the error returned was -EMFILE from socket(2).