Skip to content

src: define O_SYNC, O_DSYNC and O_DIRECT on Windows#64707

Open
PickBas wants to merge 1 commit into
nodejs:mainfrom
JaneaSystems:win-fix-fs-constants
Open

src: define O_SYNC, O_DSYNC and O_DIRECT on Windows#64707
PickBas wants to merge 1 commit into
nodejs:mainfrom
JaneaSystems:win-fix-fs-constants

Conversation

@PickBas

@PickBas PickBas commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

src: define O_SYNC, O_DSYNC and O_DIRECT on Windows

These POSIX open-flag names have no macro in the Windows C runtime, so they were missing from fs.constants on Windows and got silently dropped when passed to fs.open(). libuv already honors the underlying flags (FILE_FLAG_WRITE_THROUGH for sync, FILE_FLAG_NO_BUFFERING for direct), so this just exposes the constants under their portable names wired to libuv's values.

Portable code requesting synchronized or unbuffered I/O now works on Windows instead of losing the flag.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jul 24, 2026
@PickBas
PickBas force-pushed the win-fix-fs-constants branch 2 times, most recently from 16f53e6 to d45f76d Compare July 24, 2026 08:20
Signed-off-by: Kirill Saied <sayed.kirill@gmail.com>
@PickBas
PickBas force-pushed the win-fix-fs-constants branch from d45f76d to 3171100 Compare July 24, 2026 08:28
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (874e96e) to head (3171100).
⚠️ Report is 77 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64707      +/-   ##
==========================================
- Coverage   90.24%   90.12%   -0.13%     
==========================================
  Files         739      741       +2     
  Lines      241676   242251     +575     
  Branches    45544    45621      +77     
==========================================
+ Hits       218102   218329     +227     
- Misses      15101    15427     +326     
- Partials     8473     8495      +22     
Files with missing lines Coverage Δ
src/node_constants.cc 99.71% <ø> (ø)

... and 104 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants