Commit dff56fc7 authored by tomas@mc05.(none)'s avatar tomas@mc05.(none)

portability fixes and some comments

parent 0422d559
......@@ -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
......
......@@ -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)
......
......@@ -21,6 +21,7 @@
#define MAX_THREAD_NAME 16
//#define USE_PTHREAD_EXTRAS
struct NdbThread
{
......@@ -52,11 +53,9 @@ 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);
......@@ -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;
......
......@@ -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,11 +346,10 @@ 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){
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment