aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/option.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 96cc8b440f..fec8277da1 100644
--- a/ext/socket/option.c
+++ b/ext/socket/option.c
@@ -465,6 +465,9 @@ rb_if_indextoname(const char *succ_prefix, const char *fail_prefix, unsigned int
else
return snprintf(buf, len, "%s%s", succ_prefix, ifbuf);
#else
+# ifndef IFNAMSIZ
+# define IFNAMSIZ (sizeof(unsigned int)*3+1)
+# endif
return snprintf(buf, len, "%s%u", fail_prefix, ifindex);
#endif
}