jart / blink

tiniest x86-64-linux emulator
ISC License
7k stars 225 forks source link

VFS feature #76

Closed trungnt2910 closed 1 year ago

trungnt2910 commented 1 year ago

This PR contains the "VFS feature" as discussed in the Discord server.

As this feature is expensive in terms of syscalls and memory, it is disabled by default. Before this PR I've made a reasonable attempt to fix as many memory leaks as possible by running the tests with MODE=asan.

I've also left some more details in the commit messages.

trungnt2910 commented 1 year ago

This pull request makes me wonder if it's possible to do the same for PID/TID emulation.

I wonder if it's possible to wrap all syscall/library calls that take a PID value and send it to a subsystem of blink, just like what this PR is doing with file descriptors. When this "PID emulation" subsystem is disabled, the wrappers become simple macros.

This feature would be really useful for platforms without fork like Emscripten.

trungnt2910 commented 1 year ago

Did this PR cause any build warning/failures? I've tested both on Cygwin and Linux and ensured that there are no build failures and/or warnings.