diff --git a/src/port/dirmod.c b/src/port/dirmod.c
index 26611922db..3ee9d953c7 100644
--- a/src/port/dirmod.c
+++ b/src/port/dirmod.c
@@ -395,11 +395,8 @@ pgwin32_safestat(const char *path, struct stat *buf)
 		return -1;
 	}
 
-	/*
-	 * XXX no support for large files here, but we don't do that in general on
-	 * Win32 yet.
-	 */
-	buf->st_size = attr.nFileSizeLow;
+	/* note that this supports files larger than 4GB */
+	buf->st_size = ((off_t) attr.nFileSizeHigh) << 32 | attr.nFileSizeLow;
 
 	return 0;
 }
