---
name: "list_cut_before"
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/list_cut_before"
---

# list\_cut\_before(9)

cut a list into two, before given entry

## NAME

list\_cut\_before - cut a list into two, before given entry

## SYNOPSIS

**void list\_cut\_before(struct list\_head \*** *list***, struct list\_head \*** *head***, struct list\_head \*** *entry***);**

## ARGUMENTS

*list*

a new list to add all removed entries

*head*

a list with entries

*entry*

an entry within head, could be the head itself

## DESCRIPTION

This helper moves the initial part of *head*, up to but excluding *entry*, from *head* to *list*. You should pass in *entry* an element you know is on *head*. *list* should be an empty list or a list you do not care about losing its data. If *entry* == *head*, all entries on *head* are moved to *list*.

## COPYRIGHT
