list_cut_position(9)
π NAME π
list_cut_position(9) β cut a list into two. Hi bestie, welcome to this page from the Kernel API Manual; we're doing linked-list surgery and it's giving very delicate, very iconic. π
π¦ SYNOPSIS π¦
void list_cut_position (struct list_head *list , struct list_head *head
, struct list_head *entry );
Yep, that's the whole signature: void, and three struct list_head * parameters. Slay. β¨
π ARGUMENTS π
listβ a new list to add all removed entries. πheadβ a list with entries. π¦entryβ an entry withinhead, could be theheaditself and if so we won't cut the list. π
π DESCRIPTION π
okay so here's the vibe: this helper moves the initial part of head, up to and including entry, from head to list. β¨ You should pass on entry an element you know is on head. And list should be an empty list or a list you do not care about losing its data.
β οΈ bestie, the data-loss caveat is real: list should be empty or a list whose existing data you are okay losing. No cap. π
π SEE ALSO π
Kernel file ./tools/include/linux/list.h is where the list lore lives, and the whole crew shows up:
list_add(9),list_add_tail(9),list_replace(9),list_del_init(9),list_move(9),list_move_tail(9),list_is_first(9),list_is_last(9)list_empty(9),list_empty_careful(9),list_rotate_left(9),list_is_singular(9),list_splice(9),list_splice_tail(9),list_splice_init(9),list_splice_tail_init(9)list_entry(9),list_first_entry(9),list_last_entry(9),list_first_entry_or_null(9),list_last_entry_or_null(9),list_next_entry(9),list_prev_entry(9)list_for_each(9),list_for_each_prev(9),list_for_each_safe(9),list_for_each_prev_safe(9),list_for_each_entry(9),list_for_each_entry_reverse(9),list_prepare_entry(9)list_for_each_entry_continue(9),list_for_each_entry_continue_reverse(9),list_for_each_entry_from(9),list_for_each_entry_safe(9),list_for_each_entry_safe_continue(9),list_for_each_entry_safe_from(9),list_for_each_entry_safe_reverse(9)list_safe_reset_next(9),hlist_for_each_entry(9),hlist_for_each_entry_continue(9),hlist_for_each_entry_from(9),hlist_for_each_entry_safe(9),list_del_range(9),list_for_each_from(9)
xoxo, your Unix bestie π this page's source/version footer vibe is ./tools/include/linux, dated October 2026. π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms