---
name: "skb_unshare"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/skb_unshare"
---

# skb\_unshare(9)

make a copy of a shared buffer

## NAME

skb\_unshare - make a copy of a shared buffer

## SYNOPSIS

**struct sk\_buff \* skb\_unshare(struct sk\_buff \*** *skb***, gfp\_t** *pri***);**

## ARGUMENTS

*skb*

buffer to check

*pri*

priority for memory allocation

## DESCRIPTION

If the socket buffer is a clone then this function creates a new copy of the data, drops a reference count on the old copy and returns the new copy with the reference count at 1. If the buffer is not a clone the original buffer is returned. When called with a spinlock held or from interrupt state *pri* must be **GFP\_ATOMIC**

**NULL** is returned on a memory allocation failure.

## COPYRIGHT
