Alien-libmaxminddb
view release on metacpan or search on metacpan
maxminddb/src/maxminddb.c view on Meta::CPAN
438439440441442443444445446447448449450451452453454455456457
}
#if defined(FD_CLOEXEC) && !defined(O_CLOEXEC)
int
fd_flags =
fcntl
(fd, F_GETFD);
if
(fd_flags >= 0) {
fcntl
(fd, F_SETFD, fd_flags | FD_CLOEXEC);
}
#endif
struct
stat
s;
if
(fstat(fd,
&s
)) {
status = MMDB_FILE_OPEN_ERROR;
goto
cleanup;
}
off_t size = s.st_size;
if
(size < 0 || size > SSIZE_MAX) {
status = MMDB_OUT_OF_MEMORY_ERROR;
goto
cleanup;
}
( run in 0.716 second using v1.01-cache-2.11-cpan-49f99fa48dc )