summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.gypi2
-rwxr-xr-xconfigure2
-rw-r--r--src/cares_wrap.cc4
-rw-r--r--src/node.cc12
4 files changed, 12 insertions, 8 deletions
diff --git a/common.gypi b/common.gypi
index c7c367ec83..d152c81498 100644
--- a/common.gypi
+++ b/common.gypi
@@ -291,7 +291,7 @@
'cflags': [ '-pthread', ],
'ldflags': [ '-pthread' ],
}],
- [ 'OS in "linux freebsd openbsd solaris android aix"', {
+ [ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ],
'ldflags': [ '-rdynamic' ],
diff --git a/configure b/configure
index 9e04b03d4f..95f103fbcb 100755
--- a/configure
+++ b/configure
@@ -57,7 +57,7 @@ from gyp_node import run_gyp
parser = optparse.OptionParser()
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
- 'android', 'aix')
+ 'android', 'aix', 'cloudabi')
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc',
'ppc64', 'x32','x64', 'x86', 's390', 's390x')
valid_arm_float_abi = ('soft', 'softfp', 'hard')
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc
index 1abbbe629a..77426c4acd 100644
--- a/src/cares_wrap.cc
+++ b/src/cares_wrap.cc
@@ -34,6 +34,10 @@
#include <vector>
#include <unordered_set>
+#ifdef __POSIX__
+# include <netdb.h>
+#endif // __POSIX__
+
#if defined(__ANDROID__) || \
defined(__MINGW32__) || \
defined(__OpenBSD__) || \
diff --git a/src/node.cc b/src/node.cc
index 33bf5199d6..bfe36f218a 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -108,7 +108,7 @@ typedef int mode_t;
#include <unistd.h> // setuid, getuid
#endif
-#if defined(__POSIX__) && !defined(__ANDROID__)
+#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
#include <pwd.h> // getpwnam()
#include <grp.h> // getgrnam()
#endif
@@ -1002,7 +1002,7 @@ Local<Value> UVException(Isolate* isolate,
// Look up environment variable unless running as setuid root.
bool SafeGetenv(const char* key, std::string* text) {
-#ifndef _WIN32
+#if !defined(__CloudABI__) && !defined(_WIN32)
if (linux_at_secure || getuid() != geteuid() || getgid() != getegid())
goto fail;
#endif
@@ -2122,7 +2122,7 @@ static void Umask(const FunctionCallbackInfo<Value>& args) {
}
-#if defined(__POSIX__) && !defined(__ANDROID__)
+#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
static const uid_t uid_not_found = static_cast<uid_t>(-1);
static const gid_t gid_not_found = static_cast<gid_t>(-1);
@@ -2441,7 +2441,7 @@ static void InitGroups(const FunctionCallbackInfo<Value>& args) {
}
}
-#endif // __POSIX__ && !defined(__ANDROID__)
+#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
static void WaitForInspectorDisconnect(Environment* env) {
@@ -3706,7 +3706,7 @@ void SetupProcessObject(Environment* env,
env->SetMethod(process, "umask", Umask);
-#if defined(__POSIX__) && !defined(__ANDROID__)
+#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
env->SetMethod(process, "getuid", GetUid);
env->SetMethod(process, "geteuid", GetEUid);
env->SetMethod(process, "setuid", SetUid);
@@ -3720,7 +3720,7 @@ void SetupProcessObject(Environment* env,
env->SetMethod(process, "getgroups", GetGroups);
env->SetMethod(process, "setgroups", SetGroups);
env->SetMethod(process, "initgroups", InitGroups);
-#endif // __POSIX__ && !defined(__ANDROID__)
+#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
env->SetMethod(process, "_kill", Kill);