list_is_last(9)
π list_is_last(9) π
okay so picture this: you're deep in the Kernel API Manual, right, and you just need to know ONE thing β is this entry, like, the last one in the list or not? that's it. that's the whole page. and honestly? iconic of it.
β¨ NAME β¨
list_is_last β tests whether list is the last entry in list head π
like, straight up. it tests if list is the last entry in list head. no cap.
πΈ SYNOPSIS πΈ
int list_is_last (const struct list_head *list , const struct list_head *head );
π¦ ARGUMENTS π¦
listβ the entry to test π (this is the one you're side-eyeing, asking "are you the last one bestie?")headβ the head of the list π
π SEE ALSO π
first up, the receipts β this lives in the Kernel file ./tools/include/linux/list.h, and look at this absolute friend group of list functions:
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_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)
like I said. whole squad. π«Ά
lowkey the entire energy of this page is "one tiny question, answered." list_is_last doesn't do your taxes, it doesn't sort anything, it just tells you if you're at the end of the line. main character energy honestly π
and that's a wrap, bestie! π this lil page is from ./tools/include/linux, dated October 2026 β so go forth, check your list tails, and slay β¨πππ¦
π¦ 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