Repository navigation
Commit 4ae3f88
Build on macOS: fdatasync via F_FULLFSYNC, mkdtemp via <unistd.h> (1.7.0 tag blocker) (#501)
Build on macOS: fdatasync via F_FULLFSYNC, mkdtemp via <unistd.h>
main stopped compiling on macOS (Apple clang 17, macOS 26 SDK). A full
keep-going build of every target the default configuration contains (both
libraries, 673 tests, the tutorial strategies and the native examples; 859
translation units) found exactly two compile errors in three translation
units. Both are fixed here.
* src/command_scratch_production.cpp, CommandScratchFile::do_sync(): macOS
has no ::fdatasync ("no member named 'fdatasync' in the global namespace").
The file is compiled into both pineforge_kernel and pineforge, so this one
error failed both archives and blocked every other target. On __APPLE__ the
ScratchDurability::data case now calls fcntl(fd_, F_FULLFSYNC) and falls
back to ::fsync(fd_) when that fcntl fails; ScratchDurability::full still
calls ::fsync(fd_) and the EINTR retry loop is unchanged. Every other
platform keeps the exact existing ::fdatasync(fd_) call behind the #else, so
Linux behaviour does not change.
* tests/test_report_mode_v1_summary_with_observer.cpp, sink_directory():
::mkdtemp is declared in <unistd.h> on macOS (in <stdlib.h> on glibc) and
the file did not include it, so it failed with "no member named 'mkdtemp' in
the global namespace". Add #include <unistd.h>. No call and no test
expectation changes, and the header is harmless on Linux.
Line counts: src/command_scratch_production.cpp +6 (inserted after line 331);
tests/test_report_mode_v1_summary_with_observer.cpp +1 (inserted after line 19).
Build on macOS: ScratchDurability::full also uses F_FULLFSYNC
On macOS fsync does not reach stable storage, so the previous commit gave
the stronger ScratchDurability::full mode a weaker flush than data. On
__APPLE__ both modes now call fcntl(fd_, F_FULLFSYNC) and fall back to
::fsync(fd_) when it fails. The EINTR loop is unchanged; every other
platform keeps the exact ::fdatasync / ::fsync line. Line counts unchanged.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>1 parent b250ceb commit 4ae3f88
2 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
332 | 337 | | |
| 338 | + | |
333 | 339 | | |
334 | 340 | | |
335 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
0 commit comments