Skip to content
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

NameTypeDirDescription
fdint-
pathuser_addr_t-
modeint-
devint-

Version history

XNU tagmacOS#
xnu-8792.41.9macOS 13.0 Ventura554
xnu-10002.1.13macOS 14.0 Sonoma554
xnu-11215.1.10macOS 15.0 Sequoia554
xnu-11417.101.15macOS 15.4 Sequoia554
xnu-12377.1.9macOS 26.0 Tahoe554
xnu-10002.41.9554
xnu-10002.61.3554
xnu-10002.81.5554
xnu-10063.101.15554
xnu-10063.121.3554
xnu-10063.141.1554
xnu-11215.41.3554
xnu-11215.61.5554
xnu-11215.81.4554
xnu-11417.121.6554
xnu-11417.140.69554
xnu-12377.101.15554
xnu-12377.41.6554
xnu-12377.61.12554
xnu-12377.81.4554
xnu-8792.61.2554
xnu-8792.81.2554
xnu-8796.101.5554
xnu-8796.121.2554
xnu-8796.141.3554

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