diff --git a/lib/isc/uv.c b/lib/isc/uv.c index af23012fca..5f4b12dde6 100644 --- a/lib/isc/uv.c +++ b/lib/isc/uv.c @@ -20,6 +20,23 @@ #include #include +int +uv_os_getenv(const char *name, char *buffer, size_t *size) { + size_t len; + char *buf = getenv(name); + if (buf == NULL) { + return (UV_ENOENT); + } + len = strlen(buf) + 1; + if (len > *size) { + *size = len; + return (UV_ENOBUFS); + } + *size = len; + memmove(buffer, buf, len); + return (0); +} + #endif #if UV_VERSION_HEX < UV_VERSION(1, 27, 0)