aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/file.c b/file.c
index 860aff056b..d30a2c6692 100644
--- a/file.c
+++ b/file.c
@@ -502,8 +502,12 @@ rb_stat_blksize(VALUE self)
static VALUE
rb_stat_blocks(VALUE self)
{
-#ifdef HAVE_ST_BLOCKS
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+# ifdef HUGE_STRUCT_STAT_ST_BLOCKS
+ return ULL2NUM(get_stat(self)->st_blocks);
+# else
return ULONG2NUM(get_stat(self)->st_blocks);
+# endif
#else
return Qnil;
#endif