I'll address the NDB parts...
On Thu, 2007-06-21 at 11:47 -0400, Jeff Licquia wrote:
> I've attached our proposed patch for enabling MySQL to be built using
> the Linux Standard Base (LSB) SDK, resulting in LSB-compliant
> binaries.
> - getdtablesize() is not available, so I have provided a local
> replacement. Since getdtablesize() is defined in terms of sysconf()
> and
> getrlimit(), it should be an exact equivalent.
hrrm... where isn't it always available?
Granted, we only care about cpcd on test systems... it's not for
deployment (unless you're casually insane).
> === modified file 'storage/ndb/src/common/portlib/NdbTCP.cpp'
> --- storage/ndb/src/common/portlib/NdbTCP.cpp 2007-06-20 22:11:55
> +0000
> +++ storage/ndb/src/common/portlib/NdbTCP.cpp 2007-06-20 22:50:51
> +0000
> @@ -18,6 +18,10 @@
> #include <my_net.h>
> #include <NdbTCP.h>
>
> +#ifdef HAVE_POLL
> +#include <poll.h>
> +#endif
> +
> extern "C"
> int
> Ndb_getInAddr(struct in_addr * dst, const char *address) {
looks ok.
> === modified file 'storage/ndb/src/cw/cpcd/Process.cpp'
> --- storage/ndb/src/cw/cpcd/Process.cpp 2007-06-20 22:11:55 +0000
> +++ storage/ndb/src/cw/cpcd/Process.cpp 2007-06-20 22:50:51 +0000
> @@ -22,10 +22,29 @@
> #include "CPCD.hpp"
>
> #include <pwd.h>
> +
> +#ifdef HAVE_UNISTD_H
> +#include <unistd.h>
> +#endif
> +
> #ifdef HAVE_GETRLIMIT
> #include <sys/resource.h>
> #endif
>
> +/* getdtablesize() isn't always guaranteed to be there */
> +
> +int
> +local_getdtablesize() {
> +#ifdef HAVE_GETRLIMIT
> + struct rlimit rlim;
> +
> + if (getrlimit(RLIMIT_NOFILE, &rlim) == 0)
> + return (int)rlim.rlim_cur;
> + else
> +#endif
> + return (int)sysconf(_SC_OPEN_MAX);
> +}
> +
> void
> CPCD::Process::print(FILE * f){
> fprintf(f, "define process\n");
> @@ -316,7 +335,7 @@
> }
>
> /* Close all filedescriptors */
> - for(i = STDERR_FILENO+1; (int)i < getdtablesize(); i++)
> + for(i = STDERR_FILENO+1; (int)i < local_getdtablesize(); i++)
> close(i);
>
> execv(m_path.c_str(), argv);
This should probably be in NDB portlib instead of here.
--
Stewart Smith, Senior Software Engineer
MySQL AB, www.mysql.com
Office: +14082136540 Ext: 6616
VoIP: 6616@stripped
Mobile: +61 4 3 8844 332
Jumpstart your cluster:
http://www.mysql.com/consulting/packaged/cluster.html
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature]