summaryrefslogtreecommitdiff
path: root/erts/emulator/nifs/unix
Commit message (Collapse)AuthorAgeFilesLines
...
* | Implement sendfile over NIF handshakeRaimo Niskanen2021-04-231-6/+12
| |
* | Add erl option for reading config from file descriptorKjell Winblad2020-12-111-7/+29
|/ | | | | | | | | | | | | | | | Make it possible for users to specify the option "-configfd FD" when executing the erl command. When this option is given the system will try to read and parse configuration parameters from the file descriptor. At the moment the only configuration format that is supported is the format that is supported when using the -config option. Motivation ---------- Allow users to configure an Erlang system without writing files to disk (which can be an issue in some container environments with read-only file systems).
* fix(erts): use effective UID and GID in checksŁukasz Niemier2020-03-201-2/+2
| | | | | | In most situations effective and real IDs will match, but in theory someone can create NIF that will change the effective IDs to other one. In such cases the returned value could be different from the expected.
* Merge branch 'maint'Rickard Green2020-03-131-1/+1
|\ | | | | | | | | * maint: Update copyright year
| * Update copyright yearRickard Green2020-03-131-1/+1
| |
* | Change efile_allocate in Linux to change file sizeJulius Putra Tanu Setiaji2019-10-031-1/+1
| | | | | | | | Skip allocate_file_size test if allocate is not supported
* | Merge branch 'maint'John Högberg2019-09-191-3/+39
|\ \ | |/ | | | | | | | | * maint: file_SUITE: Only test allocate/3 size updates on known ok platforms Fix efile_allocate on Mac
| * Fix efile_allocate on MacJulius Putra Tanu Setiaji2019-09-131-3/+39
| |
* | file: allow read_file_info on file descriptorsAndre Nathan2019-07-121-24/+78
| |
* | file: allow open/2 to work on directoriesAndre Nathan2019-05-141-21/+28
|/ | | | | | This is useful mainly to ensure that a new file has been persisted to disk by calling file:sync/1 or file:datasync/1 on file's parent directory.
* Avoid closing files in gc/monitor callbacksJohn Högberg2018-11-131-2/+5
| | | | | | | | | | 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.
* Update copyright yearHenrik Nord2018-06-181-1/+1
|
* erts: Fix unused variable warning in unix prim fileLukas Larsson2018-05-151-1/+1
|
* Fix file:change_group/change_ownerJohn Högberg2018-03-191-1/+1
| | | | | | | It wasn't possible to change group/owner separately, and our test suite lacked coverage for that. ERL-589
* Allow opening device files and FIFOs with file:open/2John Högberg2018-02-261-16/+3
| | | | | | | | | | | | | | | To the best of our knowledge this was introduced since file operations on device files/FIFO:s could hang the emulator forever back when the emulator was single-threaded and lacked IO threads; a read operation could block all progress preventing the write operation it waited for from occurring. Granted, this could still happen through starving all dirty IO schedulers, but the same issue can arise with NFS files which we've always allowed. Removing this restriction also lets us remove a stat(2) call that was added to specifically allow `/dev/null`.
* Reimplement efile_drv as a dirty NIFJohn Högberg2017-11-301-0/+957
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