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.11124
xnu-1504.15.3124
xnu-1504.3.12124
xnu-1504.7.4124
xnu-1504.9.17124
xnu-1504.9.26124
xnu-1504.9.37124

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