Re: close-on-exec alternatives (was: Why kernel kills processes that run out of memory instead of just failing memory allocation system calls?)

2009-06-02 Thread Joerg Sonnenberger
On Tue, Jun 02, 2009 at 08:58:50PM +0200, Bernd Walter wrote: > It is still very interesting, because I currently have a similar problem > and wasn't aware of getdtablesize(); Note that many (other) systems provide a much simpler and efficient function for the above, closefrom(3). Joerg _

close-on-exec alternatives (was: Why kernel kills processes that run out of memory instead of just failing memory allocation system calls?)

2009-06-02 Thread Bernd Walter
On Fri, May 29, 2009 at 12:31:37PM -0700, Alfred Perlstein wrote: > * Dag-Erling Sm??rgrav [090529 02:49] wrote: > > Alfred Perlstein writes: > > > Dag-Erling Sm??rgrav writes: > > > > Usually, what you see is closer to this: > > > > > > > > if ((pid = fork()) == 0) { > > > > for (int f