---
title: sflt_attach
framework: Kernel
role: symbol
role_heading: Function
platforms: [macOS 10.4+]
path: kernel/1433214-sflt_attach
---

# sflt_attach

## Declaration

```occ
errno_t sflt_attach(socket_t socket, sflt_handle handle);
```

## Parameters

- `socket`: The socket the filter should be attached to.
- `handle`: The handle of the registered filter to be attached.

## Return Value

Return Value 0 on success otherwise the errno error.

## Discussion

Discussion Attaches a socket filter to the specified socket. A filter must be registered before it can be attached.
