mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-12 10:29:24 +00:00
![Ryan Houdek](/assets/img/avatar_default.png)
In the case that the symlink following would immediately fail (Due to the first query not existing or not being a symlink), then FEX would immediately return the first query. Then the resulting syscall using this result would try to run the syscall on that file, immediately error, and try again on the file outside of the rootfs. This gives us three syscalls for the price of one. This adds an additional syscall cost to every syscall that that takes the `FollowSymlink` code path, which is quite a few. Instead now, check to see if the filepath exists at all, and if the filepath doesn't even exist for the first fstatat, return a `NoEntry` immediately. This will cause the resulting syscall waiting for the result to skip the EmulatedFDPath check and run regular syscall. If the filepath is symlink it will still loop to track through the entire symlink tree to find the one that is in the rootfs. If the filepath is just a file, then the `IsLink` step will fail, returning the filepath to the file inside of the rootfs. (Getting this step wrong will make wine/proton immediately break). With this resolved, this converts a lot of three syscall operations down to two.