occa
occa copied to clipboard
fsync kernel build output
Fixes #515
Codecov Report
Merging #520 (41a60f1) into main (9fc908f) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #520 +/- ##
=======================================
Coverage 76.25% 76.25%
=======================================
Files 263 263
Lines 19462 19469 +7
=======================================
+ Hits 14841 14847 +6
- Misses 4621 4622 +1
Impacted Files | Coverage Δ | |
---|---|---|
src/occa/internal/io/utils.cpp | 97.75% <100.00%> (+0.08%) |
:arrow_up: |
src/occa/internal/modes/serial/device.cpp | 90.81% <100.00%> (+0.04%) |
:arrow_up: |
src/occa/internal/lang/specialMacros.cpp | 59.60% <0.00%> (-0.67%) |
:arrow_down: |
src/occa/internal/utils/sys.cpp | 76.15% <0.00%> (-0.11%) |
:arrow_down: |
Please let me know what it takes to merge this PR.
Apologies for delay. The only thing I can see is that this may not be applicable in the Windows case, however adding some precompiler guards for now should likely be okay.
May we can use this on Windows: https://docs.microsoft.com/en-gb/windows/win32/api/fileapi/nf-fileapi-flushfilebuffers?redirectedfrom=MSDN
My Windows fork uses: int _commit(int fd);
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/commit?view=msvc-160
From enable_msvc - occa/internal/io/utils.cpp line 471:
#if (OCCA_OS & (OCCA_LINUX_OS | OCCA_MACOS_OS))
fsync(fileno(fp));
#else
_commit(fileno(fp)); // NBN: VC++ compiler
#endif
This PR has been updated in #638