AT_SYMLINK_NOFOLLOW acts on the symlink itself rather than following it.
AT_EMPTY_PATH acts on the directory if path is empty.
Currently, this is implemented in fstatat itself but the code is general
enough to be refactored once we get the other *at functions. It could
likely just live in openat itself.
Linux's variant uses the syscall as intended. Redox's variant uses fpath
to build a path to pass to fstat from the file descriptor plus the file
name. Unlike the syscall, this isn't atomic so the liminal space between
fpath/getcwd and fstat is subject to TOCTOU.
Beyond fstatat, I moved the stat test to its correct location and added
an assert since the output of the test is unchecked.
I also added AT_FDCWD which seems to be -100 across Unixes. The other
AT_* constants are unimplemented for now.