Skip to content
BSD syscall#124

svc · unix #124

fchmod

Changes the mode of a file referenced by an open descriptor.

Prototype

int fchmod(int fd, int mode);

Returns: int

Arguments

NameTypeDirDescription
fdint-
modeint-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard124
xnu-1486.2.11—124
xnu-1504.15.3—124
xnu-1504.3.12—124
xnu-1504.7.4—124
xnu-1504.9.17—124
xnu-1504.9.26—124
xnu-1504.9.37—124

Notes

Identical permission rules to chmod. Useful when a caller has already opened a temporary file and wants to set the final permissions atomically before linking it into place.

Detection

ES NOTIFY_SETMODE surfaces the new mode and target vnode.

Related APIs

chmodfchmodatfchownopenstat