list_replace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to the list_replace(9) page from the Kernel API Manual β€” this one is short and iconic: replace old entry by new one. literally that’s the whole assignment. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

void list_replace (struct list_head *old , struct list_head *new );

🌸 ARGUMENTS 🌸

  • old β€” the element to be replaced, aka the one getting swapped out πŸ’…
  • new β€” the new element to insert, aka the replacement bestie ✨

✨ DESCRIPTION ✨

If old was empty, it will be overwritten. no cap, that’s the documented behavior 🫢


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./tools/include/linux/list.h β€” and the whole linked-list bestie squad is here: list_add(9), list_add_tail(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_cut_position(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).


mwah πŸ’‹ β€” source/version vibe is ./tools/include/linux, dated October 2026, and yes bestie this is list_replace(9). bye, go replace responsibly 🫢✨

πŸ“¦ where this page comes from