Index: lib/sanitizer_common/sanitizer_internal_defs.h =================================================================== --- lib/sanitizer_common/sanitizer_internal_defs.h +++ lib/sanitizer_common/sanitizer_internal_defs.h @@ -82,7 +82,8 @@ // _FILE_OFFSET_BITS. This definition of OFF_T matches the ABI of system calls // like pread and mmap, as opposed to pread64 and mmap64. // Mac and Linux/x86-64 are special. -#if SANITIZER_MAC || (SANITIZER_LINUX && defined(__x86_64__)) +#if SANITIZER_FREEBSD || SANITIZER_MAC || \ + (SANITIZER_LINUX && defined(__x86_64__)) typedef u64 OFF_T; #else typedef uptr OFF_T; Index: lib/sanitizer_common/tests/sanitizer_libc_test.cc =================================================================== --- lib/sanitizer_common/tests/sanitizer_libc_test.cc +++ lib/sanitizer_common/tests/sanitizer_libc_test.cc @@ -142,8 +142,11 @@ res = internal_ftruncate(fd, page_size * 2); ASSERT_FALSE(internal_iserror(res)); - internal_lseek(fd, page_size, SEEK_SET); - internal_write(fd, "AB", 2); + res = internal_lseek(fd, page_size, SEEK_SET); + ASSERT_FALSE(internal_iserror(res)); + + res = internal_write(fd, "AB", 2); + ASSERT_FALSE(internal_iserror(res)); char *p = (char *)MapWritableFileToMemory(nullptr, page_size, fd, page_size); ASSERT_NE(nullptr, p);