INIT_LIST_HEAD(9)
π INIT_LIST_HEAD β okay bestie, let's talk about it
So the manual page you're holding is INIT_LIST_HEAD(9), which lives in the Kernel API Manual section 9 β yes, the kernel section, we're being fancy today. This is the page about making a list_head structure be born. π
β¨ SYNOPSIS β¨
void INIT_LIST_HEAD (struct list_head *list );
That's it. That's the whole vibe. No return value, no drama, no exit status β it just does the thing and dips. π
πΈ ARGUMENTS πΈ
listβ thelist_headstructure you want to initialize. That's the one, girl. Hand her over. π«Ά
π¦ DESCRIPTION π¦
Okay so picture this: you've got a list_head, and it's just sitting there with nothing going on. INIT_LIST_HEAD initializes it to point to itself. That's the whole move. Self-love, literally. π
And if that list_head happens to be a list header? Then congrats, you just made an empty list. Main character energy β a list that knows itself before it knows anybody else. π
No cap, that's the entire function. One pointer, pointing back at home. Periodt. β¨
Fr fr though: the "points to itself" bit is the important detail, don't gloss over it when you're explaining it to someone else. It's giving circular list foundation and we respect it. π
π₯ SEE ALSO π₯
Grab a snack, because the friend group here is huge β all of these live in the kernel file ./scripts/include/list.h:
container_of(9)list_add(9)list_add_tail(9)list_del(9)list_replace(9)list_replace_init(9)list_move(9)list_move_tail(9)list_is_first(9)list_is_last(9)list_is_head(9)list_empty(9)list_entry(9)list_first_entry(9)list_last_entry(9)list_next_entry(9)list_prev_entry(9)list_entry_is_head(9)list_for_each_entry(9)list_for_each_entry_reverse(9)list_for_each_entry_safe(9)hlist_unhashed(9)hlist_del(9)hlist_del_init(9)hlist_add_head(9)hlist_for_each_entry(9)hlist_for_each_entry_safe(9)
That's the whole squad, bestie. The list_* girlies and the hlist_* girls. Iykyk. π
π§ Quick reminder: every one of those names came straight from the original page, so don't come for me if you can't find your fave β she's listed, I promise.
π a lil sign-off π
This page came from ./scripts/include and it's dated October 2026 β and yeah, the title up in the corner is INIT_LIST_HEAD(9) the whole way through. Slay, icon, ate, no crumbs. ππΈβ
π¦ 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