The “passes its arguments to the underlying syscall” part is documented under dir_fd:
For POSIX systems, Python will call the variant of the function with an
atsuffix and possibly prefixed withf(e.g. callfaccessatinstead ofaccess).
So, your system docs apply; on Linux man 2 readlinkat should say:
Since Linux 2.6.39, path can be an empty string, in which case the
call operates on the symbolic link referred to by dirfd (which
should have been obtained usingopen(2)with theO_PATHand
O_NOFOLLOWflags).
Unfortunately, O_PATH is Linux-specific and it makes the fd unusable for most other operations. I wouldn’t be comfortable adding os.readlink to os.supports_fd if it only supports OS_PATH fd’s.
+1. If you send a PR, ping me for review :)
Perfectly fine; os.supports_fd is already rather short on Windows.