|
@ -2,7 +2,9 @@ |
|
|
#include "platform.h" |
|
|
#include "platform.h" |
|
|
#include "platform_win32.h" |
|
|
#include "platform_win32.h" |
|
|
|
|
|
|
|
|
#include <errno.h> // for MAXPATHLEN |
|
|
#include <v8.h> |
|
|
|
|
|
|
|
|
|
|
|
#include <errno.h> |
|
|
#include <sys/param.h> // for MAXPATHLEN |
|
|
#include <sys/param.h> // for MAXPATHLEN |
|
|
#include <unistd.h> // getpagesize |
|
|
#include <unistd.h> // getpagesize |
|
|
#include <windows.h> |
|
|
#include <windows.h> |
|
@ -11,6 +13,8 @@ |
|
|
|
|
|
|
|
|
namespace node { |
|
|
namespace node { |
|
|
|
|
|
|
|
|
|
|
|
using namespace v8; |
|
|
|
|
|
|
|
|
static char buf[MAXPATHLEN + 1]; |
|
|
static char buf[MAXPATHLEN + 1]; |
|
|
static char *process_title = NULL; |
|
|
static char *process_title = NULL; |
|
|
|
|
|
|
|
@ -33,12 +37,12 @@ void winapi_perror(const char* prefix = NULL) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char** OS::SetupArgs(int argc, char *argv[]) { |
|
|
char** Platform::SetupArgs(int argc, char *argv[]) { |
|
|
return argv; |
|
|
return argv; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void OS::SetProcessTitle(char *title) { |
|
|
void Platform::SetProcessTitle(char *title) { |
|
|
// We need to convert _title_ to UTF-16 first, because that's what windows uses internally.
|
|
|
// We need to convert _title_ to UTF-16 first, because that's what windows uses internally.
|
|
|
// It would be more efficient to use the UTF-16 value that we can obtain from v8,
|
|
|
// It would be more efficient to use the UTF-16 value that we can obtain from v8,
|
|
|
// but it's not accessible from here.
|
|
|
// but it's not accessible from here.
|
|
@ -142,7 +146,7 @@ static inline char* _getProcessTitle() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char* OS::GetProcessTitle(int *len) { |
|
|
const char* Platform::GetProcessTitle(int *len) { |
|
|
// If the process_title was never read before nor explicitly set,
|
|
|
// If the process_title was never read before nor explicitly set,
|
|
|
// we must query it with getConsoleTitleW
|
|
|
// we must query it with getConsoleTitleW
|
|
|
if (!process_title) { |
|
|
if (!process_title) { |
|
@ -159,17 +163,39 @@ const char* OS::GetProcessTitle(int *len) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int OS::GetMemory(size_t *rss, size_t *vsize) { |
|
|
int Platform::GetMemory(size_t *rss, size_t *vsize) { |
|
|
// Not implemented
|
|
|
|
|
|
*rss = 0; |
|
|
*rss = 0; |
|
|
*vsize = 0; |
|
|
*vsize = 0; |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int OS::GetExecutablePath(char* buffer, size_t* size) { |
|
|
double Platform::GetFreeMemory() { |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double Platform::GetTotalMemory() { |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Platform::GetExecutablePath(char* buffer, size_t* size) { |
|
|
*size = 0; |
|
|
*size = 0; |
|
|
return -1; |
|
|
return -1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Platform::GetCPUInfo(Local<Array> *cpus) { |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double Platform::GetUptime() { |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int Platform::GetLoadAvg(Local<Array> *loads) { |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} // namespace node
|
|
|
} // namespace node
|
|
|