BSD syscall#133
svc · unix #133
sendto
Sends a datagram or stream segment to a specified address.
Prototype
int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, socklen_t tolen);Returns: int
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| s | int | - | |
| buf | caddr_t | - | |
| len | size_t | - | |
| flags | int | - | |
| to | caddr_t | - | |
| tolen | socklen_t | - |
Version history
| XNU tag | macOS | # |
|---|---|---|
| xnu-1456.1.26 | macOS 10.6 Snow Leopard | 133 |
| xnu-1486.2.11 | — | 133 |
| xnu-1504.15.3 | — | 133 |
| xnu-1504.3.12 | — | 133 |
| xnu-1504.7.4 | — | 133 |
| xnu-1504.9.17 | — | 133 |
| xnu-1504.9.26 | — | 133 |
| xnu-1504.9.37 | — | 133 |
Notes
For connected sockets the destination argument must be NULL or match the existing peer. UDP sendto is the typical path for unconnected datagram sockets and triggers NECP policy resolution on every call unless the socket has a cached policy ID. Sandboxed apps without the matching network entitlement are rejected at the NECP layer before any packet leaves the kernel.
Detection
NEFilterDataProvider.handleOutboundData fires for each outbound chunk and is the primary tap. nettop -m route -p <pid> gives a coarse counter view without an extension.
Related APIs
sendmsgsendmsg_xwriteconnectnecp_client_action