Skip to content
BSD syscall#391

svc · unix #391

__mac_get_lcid

Retrieves the MAC label for a login context identifier.

Prototype

int __mac_get_lcid(pid_t lcid, struct mac *mac_p);

Returns: int

Arguments

NameTypeDirDescription
lcidpid_t-
mac_pstruct mac-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard391
xnu-1699.24.8macOS 10.7 Lion391
xnu-2050.18.24macOS 10.8 Mountain Lion391
xnu-2422.115.4macOS 10.9 Mavericks391
xnu-2782.40.9macOS 10.10 Yosemite391
xnu-1486.2.11391
xnu-1504.15.3391
xnu-1504.3.12391
xnu-1504.7.4391
xnu-1504.9.17391
xnu-1504.9.26391
xnu-1504.9.37391
xnu-1699.22.73391
xnu-1699.22.81391
xnu-1699.24.23391
xnu-1699.26.8391
xnu-1699.32.7391
xnu-2050.22.13391
xnu-2050.24.15391
xnu-2050.48.11391
xnu-2050.7.9391
xnu-2050.9.2391
xnu-2422.1.72391
xnu-2422.100.13391
xnu-2422.110.17391
xnu-2422.90.20391
xnu-2782.1.97391
xnu-2782.10.72391
xnu-2782.20.48391
xnu-2782.30.5391

Notes

Login contexts (lctx) were an early macOS abstraction grouping all processes belonging to a single login. __mac_get_lcid lets a privileged caller pull the MAC label for that group. The lctx machinery was largely deprecated when audit sessions took over the session-tracking role, so the syscall is effectively dormant on modern macOS.

Detection

Essentially never called; treat any invocation as anomalous and capture the calling image via DTrace.

Related APIs

__mac_get_lctx__mac_set_lctxaudit_session_self