aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/nifs/win32
AgeCommit message (Collapse)Author
2019-03-22erts: Fix incorrect UNC path length calculationJohn Högberg
This didn't cause any issues for the most part since the path was still properly formed, but it broke down when appending the wildcards in file:list_dir/1. The ASSERT_PATH_FORMAT macro would have caught this in no time, but it went unnoticed because we don't run debug builds on Windows.
2018-11-13Avoid closing files in gc/monitor callbacksJohn Högberg
Closing files in these callbacks could block scheduler progress and cause major system instability. We now defer these operations to a dedicated process instead. This process may in turn block forever and prevent further orphaned files from being closed, but it will keep the emulator itself from misbehaving.
2018-10-11erts: Fix UNC path handling on WindowsJohn Högberg
This is unlikely to be the last of the path problems seen after OTP 21, and I'm starting to regret my decision to unconditionally use long paths. The idea to hit all long-path problems all the time was good in theory as it makes such bugs far more visible, but there just aren't enough people who test pre-release versions on Windows, making this the world's slowest game of whack-a-mole.
2018-10-11erts: Fix a compiler warningJohn Högberg
This would've been a bug if the value was used.
2018-06-18Update copyright yearHenrik Nord
2018-05-03Stop assuming that all NTFS reparse points are linksJohn Högberg
This fixes a crash that would occur when using file:read_file_info/1 on a file with a non-link reparse point, which are commonly seen in RSS and OneDrive folders.
2018-03-19Fix file:change_group/change_ownerJohn Högberg
It wasn't possible to change group/owner separately, and our test suite lacked coverage for that. ERL-589
2017-12-06Add translation for ERROR_INVALID_NAMEJohn Högberg
Most functions return this if they're given an invalid path, eg. if they contain "<" or ">". ENOENT may seem like a strange translation, but that's what open(2) returns when fed garbage, so we'll roll with that.
2017-11-30Reimplement efile_drv as a dirty NIFJohn Högberg
This improves the latency of file operations as dirty schedulers are a bit more eager to run jobs than async threads, and use a single global queue rather than per-thread queues, eliminating the risk of a job stalling behind a long-running job on the same thread while other async threads sit idle. There's no such thing as a free lunch though; the lowered latency comes at the cost of increased busy-waiting which may have an adverse effect on some applications. This behavior can be tweaked with the +sbwt flag, but unfortunately it affects all types of schedulers and not just dirty ones. We plan to add type-specific flags at a later stage. sendfile has been moved to inet_drv to lessen the effect of a nasty race; the cooperation between inet_drv and efile has never been airtight and the socket dying at the wrong time (Regardless of reason) could result in fd aliasing. Moving it to the inet driver makes it impossible to trigger this by closing the socket in the middle of a sendfile operation, while still allowing it to be aborted -- something that can't be done if it stays in the file driver. The race still occurs if the controlling process dies in the short window between dispatching the sendfile operation and the dup(2) call in the driver, but it's much less likely to happen now. A proper fix is in the works. -- Notable functional differences: * The use_threads option for file:sendfile/5 no longer has any effect. * The file-specific DTrace probes have been removed. The same effect can be achieved with normal tracing together with the nif__entry/nif__return probes to track scheduling. -- OTP-14256