mknodat is not implemented on darwin-xnu

Number:rdar://FB9862426 Date Originated:01/28/2022
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:
mknodat ( has not been implemented on darwin (only mknod is present: In situations where we need to avoid race conditions with later setting permissions, we must avoid using mknod on the full path instead. That said, at the moment, the only safe way to implement mknodat on darwin is to use the undocumented syscall pthread_fchdir (349) ( to set the cwd for the current thread only.

This was first noticed in 2018 ( with attempts to bring 9pfs functionality to QEMU macOS to mirror its capabilities on Linux, and has been brought to my attention as I have tried to bring this proposed functionality in QEMU forward a few years later (

While having mknodat implemented is the ultimate end goal, in addition please do not remove this syscall until that happens.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!