list_for_each_entry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, welcome to the Kernel API Manual page for list_for_each_entry β€” the move where you iterate over a list of a given type. πŸ’… It's giving β€œloop cursor has entered the chat,” and honestly? iconic. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

list_for_each_entry (pos , head , member );

πŸŽ€ ARGUMENTS πŸŽ€

  • pos β€” the type * to use as a loop cursor. Yes, with the star, bestie β€” that’s literally the type pointer situation. ⭐
  • head β€” the head for your list. Like, the main-character starting point of the whole thing. πŸ‘‘
  • member β€” the name of the list_head within the struct. That’s the little field inside your struct doing the linking, iykyk. πŸ”—

🌈 SEE ALSO 🌈

Kernel file ./tools/include/linux/list.h β€” that’s the exact file, no cap. πŸ’– The squad rolls deep: 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_cut_position(9), list_splice(9), list_splice_tail(9), list_splice_init(9), list_splice_tail_init(9).

Also pulling up: 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_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).

And the rest of the group chat: 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 πŸ’‹ this page ships from ./tools/include/linux, dated October 2026, and lives in the Kernel API Manual β€” catch you in the list-iteration group chat, bestie. πŸŽ€πŸ’–

πŸ“¦ where this page comes from