BSD syscall#554
svc · unix #554
mknodat
Creates a node (device, FIFO or regular file) relative to a directory descriptor.
Prototype
int mknodat(int fd, user_addr_t path, int mode, int dev);Returns: int
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| fd | int | - | |
| path | user_addr_t | - | |
| mode | int | - | |
| dev | int | - |
Version history
| XNU tag | macOS | # |
|---|---|---|
| xnu-8792.41.9 | macOS 13.0 Ventura | 554 |
| xnu-10002.1.13 | macOS 14.0 Sonoma | 554 |
| xnu-11215.1.10 | macOS 15.0 Sequoia | 554 |
| xnu-11417.101.15 | macOS 15.4 Sequoia | 554 |
| xnu-12377.1.9 | macOS 26.0 Tahoe | 554 |
| xnu-10002.41.9 | — | 554 |
| xnu-10002.61.3 | — | 554 |
| xnu-10002.81.5 | — | 554 |
| xnu-10063.101.15 | — | 554 |
| xnu-10063.121.3 | — | 554 |
| xnu-10063.141.1 | — | 554 |
| xnu-11215.41.3 | — | 554 |
| xnu-11215.61.5 | — | 554 |
| xnu-11215.81.4 | — | 554 |
| xnu-11417.121.6 | — | 554 |
| xnu-11417.140.69 | — | 554 |
| xnu-12377.101.15 | — | 554 |
| xnu-12377.41.6 | — | 554 |
| xnu-12377.61.12 | — | 554 |
| xnu-12377.81.4 | — | 554 |
| xnu-8792.61.2 | — | 554 |
| xnu-8792.81.2 | — | 554 |
| xnu-8796.101.5 | — | 554 |
| xnu-8796.121.2 | — | 554 |
| xnu-8796.141.3 | — | 554 |
Notes
Same restrictions as mknod: device creation requires root and a supportive filesystem. Useful inside sandboxes to combine path-relative resolution with device creation when allowed by the profile.
Detection
ES NOTIFY_CREATE for the new vnode; syscall::mknodat:entry in DTrace.
Related APIs
mknodmkfifoatmkdiratopenat