Skip to content

fix: include <fcntl.h> for O_RDONLY on Windows/MSVC - #873

Open
ZeZezhi wants to merge 1 commit into
ithewei:masterfrom
ZeZezhi:fix/windows-fcntl-include
Open

fix: include <fcntl.h> for O_RDONLY on Windows/MSVC#873
ZeZezhi wants to merge 1 commit into
ithewei:masterfrom
ZeZezhi:fix/windows-fcntl-include

Conversation

@ZeZezhi

@ZeZezhi ZeZezhi commented Sep 3, 2026

Copy link
Copy Markdown

Problem

Building libhv with MSVC on Windows fails in http/server/FileCache.cpp:

error C2065: "O_RDONLY": undeclared identifier

O_RDONLY is declared in <fcntl.h>, which was not included. It compiled on Linux only because another header happened to pull it in transitively.

Fix

Add #include <fcntl.h>.

Verification

  • OS: Windows 11, MSVC (VS 2022), Ninja + CMake
  • Full build cmake --build . now succeeds (134/134 targets)
  • Discovered while building the project for the first time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant