| OS_LOCKDOWN_MODE_ENABLED(3) | Library Functions Manual | OS_LOCKDOWN_MODE_ENABLED(3) |
os_lockdown_mode_enabled —
query the Lockdown Mode state
Standard C Library (libc, -lc)
#include
<os/lockdown_mode.h>
bool
os_lockdown_mode_enabled(void);
The
os_lockdown_mode_enabled()
function returns a cached value indicating whether Lockdown Mode is
currently enabled on the system.
Lockdown Mode is an optional security feature that provides enhanced protections by reducing attack surface. This API allows applications to query whether Lockdown Mode is currently enabled on the system.
The value returned by this
function is cached and initialized once per process. The first call to
os_lockdown_mode_enabled()
queries the system state via the sysctl(3) interface, and
subsequent calls return the cached value.
This function will abort the process if an unexpected error occurs while querying the Lockdown Mode state.
The os_lockdown_mode_enabled() function
returns true if Lockdown Mode is enabled. It returns
false if Lockdown Mode is disabled or not supported
on the platform.
The os_lockdown_mode_enabled() function
first appeared in macOS 27.0, iOS 27.0, watchOS 27.0, tvOS 27.0, and
visionOS 27.0.
| January 12, 2026 | macOS 26 |