Support File Descriptors in os.readlink()

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 at suffix and possibly prefixed with f (e.g. call faccessat instead of access).

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 using open(2) with the O_PATH and
O_NOFOLLOW flags).

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.