summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ndb/include/portlib/PortDefs.h2
-rw-r--r--ndb/src/client/odbc/common/common.hpp2
-rw-r--r--ndb/src/common/portlib/unix/NdbThread.c7
-rw-r--r--ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp10
-rw-r--r--ndb/src/kernel/ndb-main/Main.cpp6
-rw-r--r--ndb/src/mgmclient/CommandInterpreter.cpp28
6 files changed, 36 insertions, 19 deletions
diff --git a/ndb/include/portlib/PortDefs.h b/ndb/include/portlib/PortDefs.h
index 6cd5be0149f..5e24e08ec61 100644
--- a/ndb/include/portlib/PortDefs.h
+++ b/ndb/include/portlib/PortDefs.h
@@ -49,7 +49,7 @@ int getopt(int, char **, char *opts);
#endif // NDB_WIN32
#ifdef NDB_ALPHA
-#ifdef NDB_GCC
+#ifdef NDB_GCC // only for NDB_ALPHA
extern int gnuShouldNotUseRPCC();
#define RPCC() gnuShouldNotUseRPCC();
#else
diff --git a/ndb/src/client/odbc/common/common.hpp b/ndb/src/client/odbc/common/common.hpp
index e90950df9c5..6d99aac5455 100644
--- a/ndb/src/client/odbc/common/common.hpp
+++ b/ndb/src/client/odbc/common/common.hpp
@@ -19,7 +19,7 @@
// misc defs
-#ifdef NDB_GCC
+#ifdef NDB_GCC // only for odbc
#define PRINTFLIKE(i,j) __attribute__ ((format (printf, i, j)))
#else
#define PRINTFLIKE(i,j)
diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/unix/NdbThread.c
index a5c42f79be8..d78941454d4 100644
--- a/ndb/src/common/portlib/unix/NdbThread.c
+++ b/ndb/src/common/portlib/unix/NdbThread.c
@@ -21,6 +21,7 @@
#define MAX_THREAD_NAME 16
+//#define USE_PTHREAD_EXTRAS
struct NdbThread
{
@@ -52,12 +53,10 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
pthread_attr_init(&thread_attr);
pthread_attr_setstacksize(&thread_attr, thread_stack_size);
-#if defined NDB_SOLARIS
-#if !defined NDB_SOLARIS6
+#ifdef USE_PTHREAD_EXTRAS
/* Guard stack overflow with a 2k databuffer */
pthread_attr_setguardsize(&thread_attr, 2048);
#endif
-#endif
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
result = pthread_create(&tmpThread->thread,
@@ -104,7 +103,7 @@ void NdbThread_Exit(int status)
int NdbThread_SetConcurrencyLevel(int level)
{
-#ifndef NDB_SOLARIS6
+#ifdef USE_PTHREAD_EXTRAS
return pthread_setconcurrency(level);
#else
return 0;
diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
index f73c1ec5ee7..7ba7d0d25c6 100644
--- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
@@ -17,7 +17,8 @@
/**
* O_DIRECT
*/
-#ifdef NDB_LINUX
+#if 0
+//#ifdef NDB_LINUX
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
@@ -34,12 +35,14 @@
#include <NdbThread.h>
#include <signaldata/FsOpenReq.hpp>
-#ifdef NDB_LINUX
+#if 0
+#ifdef HAVE_PREAD
// This is for pread and pwrite
#ifndef __USE_UNIX98
#define __USE_UNIX98
#endif
#endif
+#endif
#if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE
#else
@@ -343,12 +346,11 @@ void AsyncFile::openReq(Request* request)
}
#if 0
-#if NDB_LINUX
+ //#if NDB_LINUX
if(Global_useO_DIRECT){
new_flags |= O_DIRECT;
}
#endif
-#endif
switch(flags & 0x3){
case FsOpenReq::OM_READONLY:
diff --git a/ndb/src/kernel/ndb-main/Main.cpp b/ndb/src/kernel/ndb-main/Main.cpp
index ef33802cab6..5860977346f 100644
--- a/ndb/src/kernel/ndb-main/Main.cpp
+++ b/ndb/src/kernel/ndb-main/Main.cpp
@@ -33,7 +33,7 @@
#include <EventLogger.hpp>
#include <NodeState.hpp>
-#if defined NDB_SOLARIS
+#if defined NDB_SOLARIS // ok
#include <sys/processor.h> // For system informatio
#endif
@@ -199,7 +199,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
}
RegCloseKey(hKey);
}
-#elif defined NDB_SOLARIS
+#elif defined NDB_SOLARIS // ok
// Search for at max 16 processors among the first 256 processor ids
processor_info_t pinfo; memset(&pinfo, 0, sizeof(pinfo));
int pid = 0;
@@ -213,7 +213,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
if(logLevel.getLogLevel(LogLevel::llStartUp) > 0){
g_eventLogger.info("NDB Cluster -- DB node %d", globalData.ownId);
g_eventLogger.info("%s --", NDB_VERSION_STRING);
-#ifdef NDB_SOLARIS
+#ifdef NDB_SOLARIS // ok
g_eventLogger.info("NDB is running on a machine with %d processor(s) at %d MHz",
processor, speed);
#endif
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp
index fba5fda32dd..cf9d885847a 100644
--- a/ndb/src/mgmclient/CommandInterpreter.cpp
+++ b/ndb/src/mgmclient/CommandInterpreter.cpp
@@ -30,10 +30,6 @@
#include "MgmtErrorReporter.hpp"
#include "CpcClient.hpp"
-#ifdef NDB_SOLARIS // XXX fix me
-static char* strsep(char** x, const char* y) { return 0; }
-#endif
-
/*****************************************************************************
* HELP
@@ -1865,17 +1861,36 @@ CommandInterpreter::executeRep(char* parameters)
* CPC
*****************************************************************************/
+#if 0
+
+#if 0
+//#ifdef NDB_SOLARIS // XXX fix me
+static char* strsep(char** x, const char* y) { return 0; }
+#endif
+
+// Note this code has not been verified
+#if 0
+static char * my_strsep(char **stringp, const char *delim)
+{
+ char *tmp= *stringp;
+ if (tmp == 0)
+ return 0;
+ *stringp = strtok(tmp, delim);
+ return tmp;
+}
+#endif
+
void
CommandInterpreter::executeCpc(char *parameters)
{
char *host_str = NULL, *port_str = NULL, *end;
long port = 1234; /* XXX */
- while((host_str = strsep(&parameters, " \t:")) != NULL &&
+ while((host_str = my_strsep(&parameters, " \t:")) != NULL &&
host_str[0] == '\0');
if(parameters && parameters[0] != '\0') {
- while((port_str = strsep(&parameters, " \t:")) != NULL &&
+ while((port_str = my_strsep(&parameters, " \t:")) != NULL &&
port_str[0] == '\0');
errno = 0;
@@ -1944,6 +1959,7 @@ CommandInterpreter::executeCpc(char *parameters)
<< endl;
return;
}
+#endif
#if 0
static