diff --git a/io/fts.c b/io/fts.c
index d03b059177..1120acd2ae 100644
--- a/io/fts.c
+++ b/io/fts.c
@@ -1111,14 +1111,14 @@ static int
 fts_safe_changedir (FTSOBJ *sp, FTSENTRY *p, int fd, const char *path)
 {
 	int ret, oerrno, newfd;
-	struct stat64 sb;
+	struct __stat64_t64 sb;
 
 	newfd = fd;
 	if (ISSET(FTS_NOCHDIR))
 		return (0);
 	if (fd < 0 && (newfd = __open(path, O_RDONLY, 0)) < 0)
 		return (-1);
-	if (__fstat64(newfd, &sb)) {
+	if (__fstat64_time64(newfd, &sb)) {
 		ret = -1;
 		goto bail;
 	}
