Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Sat, Nov 12, 2011 at 09:00:08PM +0100, Arnaud Versini wrote:

I have noticed some forks during valgrind check, I think it will be better
to use functions instead of the unix command. This patch replace the fork
and exec  domainnanme by a simple call to getdomainname(). It is faster and
we sould have less message during valgrind and strace
investigation's.

getdomainname() is not specified by SUS, nor POSIX. However, BSDs have
it since... a long, long time. Google tells me recent versions of
Solaris/SunOS sorta-has it, but not really: it is in -lnsl, but not in
the headers... See
http://old.nabble.com/getdomainname%3A-fix-several-problems-td30324427.html

So I guess we are happy with the portability of that, and I'm committing.

For nitpickers, note that getdomainname does *not* return the DNS
domain, but the NIS domain, which strictly speaking may or may not
coincide. The portable and strictly correct way seems to be to do a
DNS query on the result of gethostname() (gethostbyname or getaddrinfo
with AI_CANONNAME).

-- 
Lionel

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.