[jim at meyering.net: [Pkg-nagios-devel] Bug#358178: x86_64: avoid `Size... > POSIX-guaranteed...' warning]
Andreas Ericsson
ae at op5.se
Wed Mar 22 15:00:34 CET 2006
Ethan Galstad wrote:
> Looks good - I'll commit this to CVS shortly. A 2.1 release should
> be out soon once people get a change to test the latest patches I've
> committed.
>
#define MAX_PLUGINOUTPUT_LENGTH (332 + (16 * (64 / __WORDSIZE)))
Since pointers and long's are always words (in the asm sense), it will
always use an output buffer of maximum size, while keeping it below the
POSIX-required minimum atomic write(2) size.
Or better yet, use a tcp-socket listening on either 127.0.0.1 (if you
intend to port it to Windows some day) or a udp unix socket (if you
don't. udp is a lot simpler since you don't have the disturbing problems
of multiplexing connectivity) for feeding results back in. That way you
can set the receive-buffers to 256K and never worry about it again. It
would also scale a lot better. In fact, I think I'll start hacking on
that later today.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
More information about the Developers
mailing list