Hi Andrés, thanks for you patches :)
On Tue, Feb 16, 2010 at 12:08:44PM +0100, Andrés J. Díaz wrote: > Here are some minor patches to AIX port of collectd. The first one > (aix-test-htonll) adds support to check if the htonl and htonll > functions (which are used in AIX port) are available in configure. I've applied the patch that uses "AC_RUN_IFELSE" to collectd-4.8. I hope it doesn't break cross-compiling ;) > The second one port memcached plugin to AIX. Since AIX don't have > MSG_DONTWAIT flag support, we use MSG_NONBLOCK... and we hope to work > fine ever :) It's in collectd-4.8, too. Looks like a typical "... but we like our old and non-standard define names!" ;) > Finally port the multimeter plugin too, which do not compile in AIX > without an explicit cast for TIOCMBIC (don't ask). May forcing a cast > is not very elegant for other os... What do you think, Florian? Maybe > we could use here a per-os #ifdef? Unfortunately the "request" argument for ioctl(2) is not properly standardized. It's a "unsigned long" in the GNU libc (even though my manpage says "int" it is in fact an "unsigned long"), Mac OS X, *BSD and BeOS. It's an "int" in AIX, HP-UX, IRIX, OSF/1, Solaris, Cygwin, Interix. [0] Since "int"s are usually 32 bit wide and "long"s are the new "int"s, I assume that signedness warnings will pop up on 32 bit systems with a cast to "int". If possible, I'd like to get away without a system specific define, but currently I don't see how that should be done. The parser code generated by yacc uses the "_AIX" define to detect if it's been compiled under AIX. Could you please check if the following works for you?: #ifdef _AIX # define IOCTL_REQ_CAST (int) #else # define IOCTL_REQ_CAST /**/ #endif ... ioctl(fd, IOCTL_REQ_CAST TIOCMBIC, &rts); > The work was done by my colleage Manuel (as previously do), so > credits for him, please. I've committed the changes with the following author information: Manuel Sanmartin (no email) <collectd@verplant.org> Please say thank you to Manuel from me :) > We promise to try port other plugins to AIX in next months :) Yay :) Thanks again for your patches :) Regards, —octo [0] I fully trust that guy to have figured that out correctly. It matches with my findings for GNU libc, *BSD, Mac OS X and Solaris. <http://www.mail-archive.com/bug-gnu...@gnu.org/msg11643.html> -- Florian octo Forster Hacker in training GnuPG: 0x91523C3D http://verplant.org/
signature.asc
Description: Digital signature
_______________________________________________ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd