/* Define to 1 if you have the `uv_handle_set_data' function. */
#define HAVE_UV_HANDLE_SET_DATA 1
+/* Define to 1 if you have the `uv_os_getenv' function. */
+#define HAVE_UV_OS_GETENV 1
+
+/* Define to 1 if you have the `uv_os_setenv' function. */
+#define HAVE_UV_OS_SETENV 1
+
/* Define to 1 if you have the `uv_req_get_data' function. */
#define HAVE_UV_REQ_GET_DATA 1
AC_CHECK_FUNCS([uv_handle_get_data uv_handle_set_data])
AC_CHECK_FUNCS([uv_req_get_data uv_req_set_data])
AC_CHECK_FUNCS([uv_udp_connect uv_translate_sys_error uv_sleep])
+AC_CHECK_FUNCS([uv_os_getenv uv_os_setenv])
AX_RESTORE_FLAGS([libuv])
# libnghttp2
#define isc_uv_udp_connect uv_udp_connect
#else
+#ifndef HAVE_UV_OS_GETENV
+#include <stdlib.h>
+#include <string.h>
+
+static inline 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 /* HAVE_UV_OS_GETENV */
+
+#ifndef HAVE_UV_OS_SETENV
+#define uv_os_setenv(name, value) setenv(name, value, 0)
+#endif /* HAVE_UV_OS_SETENV */
+
int
isc_uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr);
/*%<