File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,9 @@ endif()
173
173
if ( HAVE_SYS_UIO_H )
174
174
check_symbol_exists (writev sys/uio.h HAVE_WRITEV )
175
175
endif ()
176
+ set (CMAKE_REQUIRED_DEFINITIONS "-D_LARGEFILE64_SOURCE" )
177
+ check_symbol_exists (lseek64 "sys/types.h;unistd.h" HAVE_LSEEK64 )
178
+ set (CMAKE_REQUIRED_DEFINITIONS "" )
176
179
check_symbol_exists (mallctl malloc_np.h HAVE_MALLCTL )
177
180
check_symbol_exists (mallinfo malloc.h HAVE_MALLINFO )
178
181
check_symbol_exists (malloc_zone_statistics malloc/malloc.h
Original file line number Diff line number Diff line change 120
120
/* Define to 1 if you have the <link.h> header file . */
121
121
#cmakedefine HAVE_LINK_H ${HAVE_LINK_H}
122
122
123
+ /* Define to 1 if you have the `lseek64' function. */
124
+ #cmakedefine HAVE_LSEEK64 ${HAVE_LSEEK64}
125
+
123
126
/* Define to 1 if you have the <mach/mach.h> header file . */
124
127
#cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H}
125
128
Original file line number Diff line number Diff line change @@ -598,7 +598,13 @@ void raw_fd_ostream::close() {
598
598
uint64_t raw_fd_ostream::seek (uint64_t off) {
599
599
assert (SupportsSeeking && " Stream does not support seeking!" );
600
600
flush ();
601
+ #ifdef LLVM_ON_WIN32
602
+ pos = ::_lseeki64 (FD, off, SEEK_SET);
603
+ #elif defined(HAVE_LSEEK64)
604
+ pos = ::lseek64 (FD, off, SEEK_SET);
605
+ #else
601
606
pos = ::lseek (FD, off, SEEK_SET);
607
+ #endif
602
608
if (pos == (uint64_t )-1 )
603
609
error_detected ();
604
610
return pos;
You can’t perform that action at this time.
0 commit comments