poll() uses msecs as timeout
[elliptics.git] / cmake / Modules / CheckLargefile.cmake
blobfb001bf1b88062d3aea0b5f01c4db3b4c1a60048
1 # Check whether large files are supported
3 include(CheckCSourceCompiles)
5 if (UNIX OR MINGW)
6     SET(CMAKE_REQUIRED_DEFINITIONS -Werror-implicit-function-declaration)
7 endif()
8 list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
10 check_c_source_compiles("#include <fcntl.h>
11 #include <sys/stat.h>
12 int main()
14     int fd = open(\".\", O_RDONLY | O_LARGEFILE);
15     return 0;
17 " HAVE_LARGEFILE_SUPPORT)
19 if (HAVE_LARGEFILE_SUPPORT)
20     add_definitions(-DHAVE_LARGEFILE_SUPPORT=1 -D_LARGEFILE64_SOURCE=1)
21 endif()
23 unset(CMAKE_REQUIRED_DEFINITIONS)
24 message(STATUS "Large file support found: ${HAVE_LARGEFILE_SUPPORT}")