Another Basement Idea - Make realpath() a system call! namei() already does much of this work in any case. - Add NI_REALPATH flag to namei() - Save and return the components as traversed. In-kernel realpath() has been committed this week, libc wrappers to call it will be committed soon. This will be in OpenBSD 6.6. Once realpath() no longer needs to readlink() every path component unveil will no longer allow readlink() for every path component. realpath() as a system call has a nice side effect of being a lot faster than iterating calls to readlink() on every path component.