list_cut_position(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 within head, could be the head itself 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:


xoxo, your Unix bestie πŸ’– this page's source/version footer vibe is ./tools/include/linux, dated October 2026. πŸŽ€

πŸ“¦ where this page comes from