POSIX/SUS seems to be unambiguous that if you mkdir with the directory already existing at the start, mkdir exits status 1 (and 26.04 Rust uutils does). But a race while mkdir is running is something you can argue about even within the POSIX specifications language, at least as far as I can see.
Interested parties can peruse the relevant SUS page and argue about it: https://pubs.opengroup.org/onlinepubs/9799919799/
@cks Seems a bit strange, POSIX-wise mkdir -p should exit successfully on EEXIST, while without it seems undefined (see exit status section of mkdir(1)).
While without the -p option, mkdir(1) is stuck to being racy anyway and typically exits unsuccessfully when anything already exists.