[asterisk-dev] asterisk ast_close_fds_above_n, wtf?

Tilghman Lesher tilghman at meg.abyt.es
Wed May 18 09:53:24 CDT 2011


On Wednesday 18 May 2011 09:08:11 Paul Albrecht wrote:
> To summarize for those that like to keep score: you have conceded that
> the "close on exec" flag can be used reliably on linux and now you're
> arguing that the "close on exec" flag isn't portable.

I have not conceded that point.  We have external libraries linked into
Asterisk, and as those libraries do not consistently use the CLOEXEC flag,
those file descriptors may remain open in a child process with your
approach, while they will be closed with the approach used in Asterisk.

> Well so what? The closefrom system call isn't portable either so what's
> your point? As the preferred platform for asterisk is linux you should
> be writing your code to that system interface. If you want to port
> asterisk to other platforms then use the preprocessor to conditionally
> generate whatever code you need for them.

Thank you for your opinion on how you engineer your own projects.  We
prefer uniting the code as best as possible for portability.  Our only
limiting criteria is ensuring that the portability factor does not
significantly impact Linux performance, and in this case, it does not.

If you feel that the CLOEXEC approach is better, then I suggest that you
work with POSIX to get that approach (and corresponding kernel APIs) into
a forthcoming edition of the Unix standard.  Following adoption of those
API changes by the platforms we support, you are welcome to ask us to
reconsider our approach at that time.

-- 
Tilghman



More information about the asterisk-dev mailing list