diff --git a/src/llama-mmap.cpp b/src/llama-mmap.cpp index 5be8c8a19..a8cb9439b 100644 --- a/src/llama-mmap.cpp +++ b/src/llama-mmap.cpp @@ -244,9 +244,13 @@ size_t llama_file::size() const { return pimpl->size; } int llama_file::file_id() const { #ifdef _WIN32 return _fileno(pimpl->fp); +#else +#if defined(fileno) + return fileno(pimpl->fp); #else return ::fileno(pimpl->fp); #endif +#endif } void llama_file::seek(size_t offset, int whence) const { pimpl->seek(offset, whence); }