summaryrefslogtreecommitdiffstats
path: root/src/unix/sunos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix/sunos.c')
-rw-r--r--src/unix/sunos.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unix/sunos.c b/src/unix/sunos.c
index d511c18..2bf297e 100644
--- a/src/unix/sunos.c
+++ b/src/unix/sunos.c
@@ -865,3 +865,14 @@ void uv_free_interface_addresses(uv_interface_address_t* addresses,
uv__free(addresses);
}
+
+
+#if !defined(_POSIX_VERSION) || _POSIX_VERSION < 200809L
+size_t strnlen(const char* s, size_t maxlen) {
+ const char* end;
+ end = memchr(s, '\0', maxlen);
+ if (end == NULL)
+ return maxlen;
+ return end - s;
+}
+#endif