Skip to content
BSD syscall#450

svc · unix #450

socket_delegate

Creates a socket whose network activity is attributed to a delegate process for policy and accounting.

Prototype

int socket_delegate(int domain, int type, int protocol, pid_t epid);

Returns: int

Arguments

NameTypeDirDescription
domainint-
typeint-
protocolint-
epidpid_t-

Version history

XNU tagmacOS#
xnu-2422.115.4macOS 10.9 Mavericks450
xnu-2782.40.9macOS 10.10 Yosemite450
xnu-3247.1.106macOS 10.11 El Capitan450
xnu-3789.1.32macOS 10.12 Sierra450
xnu-4570.1.46macOS 10.13 High Sierra450
xnu-4903.221.2macOS 10.14 Mojave450
xnu-6153.11.26macOS 10.15 Catalina450
xnu-7195.50.7.100.1macOS 11.0 Big Sur450
xnu-8019.41.5macOS 12.0 Monterey450
xnu-8792.41.9macOS 13.0 Ventura450
xnu-10002.1.13macOS 14.0 Sonoma450
xnu-11215.1.10macOS 15.0 Sequoia450
xnu-11417.101.15macOS 15.4 Sequoia450
xnu-12377.1.9macOS 26.0 Tahoe450
xnu-10002.41.9—450
xnu-10002.61.3—450
xnu-10002.81.5—450
xnu-10063.101.15—450
xnu-10063.121.3—450
xnu-10063.141.1—450
xnu-11215.41.3—450
xnu-11215.61.5—450
xnu-11215.81.4—450
xnu-11417.121.6—450
xnu-11417.140.69—450
xnu-12377.101.15—450
xnu-12377.41.6—450
xnu-12377.61.12—450
xnu-12377.81.4—450
xnu-2422.1.72—450
xnu-2422.100.13—450
xnu-2422.110.17—450
xnu-2422.90.20—450
xnu-2782.1.97—450
xnu-2782.10.72—450
xnu-2782.20.48—450
xnu-2782.30.5—450
xnu-3247.10.11—450
xnu-3248.20.55—450
xnu-3248.30.4—450
xnu-3248.40.184—450
xnu-3248.50.21—450
xnu-3248.60.10—450
xnu-3789.21.4—450
xnu-3789.31.2—450
xnu-3789.41.3—450
xnu-3789.51.2—450
xnu-3789.60.24—450
xnu-3789.70.16—450
xnu-4570.20.62—450
xnu-4570.31.3—450
xnu-4570.41.2—450
xnu-4570.51.1—450
xnu-4570.61.1—450
xnu-4570.71.2—450
xnu-4903.231.4—450
xnu-4903.241.1—450
xnu-4903.270.47—450
xnu-6153.101.6—450
xnu-6153.121.1—450
xnu-6153.141.1—450
xnu-6153.41.3—450
xnu-6153.61.1—450
xnu-6153.81.5—450
xnu-7195.101.1—450
xnu-7195.121.3—450
xnu-7195.141.2—450
xnu-7195.60.75—450
xnu-7195.81.3—450
xnu-8019.61.5—450
xnu-8019.80.24—450
xnu-8020.101.4—450
xnu-8020.121.3—450
xnu-8020.140.41—450
xnu-8792.61.2—450
xnu-8792.81.2—450
xnu-8796.101.5—450
xnu-8796.121.2—450
xnu-8796.141.3—450

Notes

Restricted to Apple system daemons and a handful of entitled binaries via com.apple.private.network.socket-delegate. The kernel sets so_flags1 |= SOF1_DELEGATED and stores the delegate's effective audit token in the inpcb, so NECP, NetworkExtension filters, and per-process bandwidth accounting see the delegate rather than the actual caller. Used by mDNSResponder, nehelper, and trustd to ferry traffic on behalf of third-party apps while still honoring those apps' sandbox/VPN routing.

Detection

NEFilterDataProvider exposes the delegate identifier through NEFilterSocketFlow.sourceAppAuditToken vs sourceAppIdentifier; a discrepancy indicates delegation. ES does not surface this distinction.

Related APIs

socketsetsockoptnecp_client_actionconnectx