return scope.Close(cwd);
}
+
+#ifdef __POSIX__
+
static Handle<Value> Umask(const Arguments& args){
HandleScope scope;
unsigned int old;
return Undefined();
}
+#endif // __POSIX__
+
v8::Handle<v8::Value> Exit(const v8::Arguments& args) {
HandleScope scope;
return scope.Close(info);
}
+#ifdef __POSIX__
Handle<Value> Kill(const Arguments& args) {
HandleScope scope;
return Undefined();
}
+#endif // __POSIX__
+
// TODO remove me before 0.4
Handle<Value> Compile(const Arguments& args) {
const AccessorInfo& info) {
String::Utf8Value key(property);
String::Utf8Value val(value);
+#ifdef __POSIX__
setenv(*key, *val, 1);
+#else // __WIN32__
+ NO_IMPL_MSG(setenv)
+#endif
return value;
}
const AccessorInfo& info) {
String::Utf8Value key(property);
if (getenv(*key)) {
+#ifdef __POSIX__
unsetenv(*key); // prototyped as `void unsetenv(const char*)` on some platforms
+#else
+ NO_IMPL_MSG(unsetenv)
+#endif
return True();
}
return False();
NODE_SET_METHOD(process, "reallyExit", Exit);
NODE_SET_METHOD(process, "chdir", Chdir);
NODE_SET_METHOD(process, "cwd", Cwd);
+
+#ifdef __POSIX__
NODE_SET_METHOD(process, "getuid", GetUid);
NODE_SET_METHOD(process, "setuid", SetUid);
NODE_SET_METHOD(process, "umask", Umask);
NODE_SET_METHOD(process, "dlopen", DLOpen);
NODE_SET_METHOD(process, "_kill", Kill);
+#endif // __POSIX__
+
NODE_SET_METHOD(process, "memoryUsage", MemoryUsage);
NODE_SET_METHOD(process, "binding", Binding);
_exit(1);
}
-
+#ifdef __POSIX__
static int RegisterSignalHandler(int signal, void (*handler)(int)) {
struct sigaction sa;
sigfillset(&sa.sa_mask);
return sigaction(signal, &sa, NULL);
}
+#endif // __POSIX__
int Start(int argc, char *argv[]) {
}
V8::SetFlagsFromCommandLine(&v8argc, v8argv, false);
+#ifdef __POSIX__
// Ignore SIGPIPE
RegisterSignalHandler(SIGPIPE, SIG_IGN);
RegisterSignalHandler(SIGINT, SignalExit);
RegisterSignalHandler(SIGTERM, SignalExit);
+#endif // __POSIX__
#ifdef __MINGW32__
// On windows, to use winsock it must be initialized