Skip to content
BSD syscall#55

svc · unix #55

reboot

Requests an immediate system reboot, halt or panic from the kernel; restricted to the superuser.

Prototype

int reboot(int opt, char *command);

Returns: int

Arguments

NameTypeDirDescription
optint-
commandchar-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard55
xnu-1699.24.8macOS 10.7 Lion55
xnu-2050.18.24macOS 10.8 Mountain Lion55
xnu-2422.115.4macOS 10.9 Mavericks55
xnu-2782.40.9macOS 10.10 Yosemite55
xnu-3247.1.106macOS 10.11 El Capitan55
xnu-3789.1.32macOS 10.12 Sierra55
xnu-4570.1.46macOS 10.13 High Sierra55
xnu-1486.2.11—55
xnu-1504.15.3—55
xnu-1504.3.12—55
xnu-1504.7.4—55
xnu-1504.9.17—55
xnu-1504.9.26—55
xnu-1504.9.37—55
xnu-1699.22.73—55
xnu-1699.22.81—55
xnu-1699.24.23—55
xnu-1699.26.8—55
xnu-1699.32.7—55
xnu-2050.22.13—55
xnu-2050.24.15—55
xnu-2050.48.11—55
xnu-2050.7.9—55
xnu-2050.9.2—55
xnu-2422.1.72—55
xnu-2422.100.13—55
xnu-2422.110.17—55
xnu-2422.90.20—55
xnu-2782.1.97—55
xnu-2782.10.72—55
xnu-2782.20.48—55
xnu-2782.30.5—55
xnu-3247.10.11—55
xnu-3248.20.55—55
xnu-3248.30.4—55
xnu-3248.40.184—55
xnu-3248.50.21—55
xnu-3248.60.10—55
xnu-3789.21.4—55
xnu-3789.31.2—55
xnu-3789.41.3—55
xnu-3789.51.2—55
xnu-3789.60.24—55
xnu-3789.70.16—55
xnu-4570.20.62—55

Notes

reboot(2) takes a flag word (RB_AUTOBOOT, RB_HALT, RB_PANIC, RB_QUICK, RB_UPSDELAY…) and is the primitive behind shutdown(8), halt(8) and reboot(8). On modern macOS userland actually goes through launchd → IOKit power-management paths in the normal case; the raw syscall is reserved for emergencies and for the kernel itself.

Related APIs

shutdownkillexitreboot3 (Mach)