---
name: "__sk_attach_filter"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/__sk_attach_filter"
---

# \_\_sk\_attach\_filter(9)

attach a socket filter

## NAME

\_\_sk\_attach\_filter - attach a socket filter

## SYNOPSIS

**int \_\_sk\_attach\_filter(struct sock\_fprog \*** *fprog***, struct sock \*** *sk***, bool** *locked***);**

## ARGUMENTS

*fprog*

the filter program

*sk*

the socket to use

*locked*

\-- undescribed --

## DESCRIPTION

Attach the user's filter code. We first run some sanity checks on it to make sure it does not explode on us later. If an error occurs or there is insufficient memory for the filter a negative errno code is returned. On success the return is zero.

## COPYRIGHT
