mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-10 21:00:19 +02:00
Performance stats up front: This improves pressure-vessel startup time on my test device by 10.1% Improving the startup time from 9.71425 seconds to 8.7421 seconds. Most filesystem based syscalls support a file descriptor version with an *at suffix. This allows us to do these syscalls with pathnames that are relative to the directory FD that is passed to the syscall. This is pretty much exactly what we want when we are searching for files inside of our rootfs. The only quirk ends up being that we are getting passed absolute paths. This ends up being very simple to workaround by stripping off the front '/' character. Doing this is just offsetting the pointer passed to the syscall by one byte. This does require having two temporary buffers of size PATH_MAX passed to the handler since just like in the other implementation, we need to keep the previous result around. The difference being now that we aren't doing a bunch of std::string temporary manipulation and now we are returning one of the passed in buffers back depending on the result.