assoc_array_iterate(9)
β¨ NAME β¨
assoc_array_iterate β Pass all objects in the array to a callback π
Hey bestie, welcome to the assoc_array_iterate(9) page from the Kernel API Manual β itβs giving kernel-core realness and weβre gonna get through it together π«Ά
πΈ SYNOPSIS πΈ
int assoc_array_iterate (const struct assoc_array *array , int
(*iterator)(const void *object, void *iterator_data) , void
*iterator_data );
π ARGUMENTS π
arrayβ The array to iterate over.iteratorβ The callback function.iterator_dataβ Private data for the callback function.
π¦ DESCRIPTION π¦
okay so this one iterates over all the objects in an associative array. Each one gets presented to the iterator function, no cap β¨
concurrency warning, bestie π β if the array is being modified concurrently with the iteration, it is possible that some objects in the array will be passed to the iterator callback more than once β though every object should be passed at least once. If this is undesirable, then the caller must lock against modification for the duration of this function.
The function will return 0 if no objects were in the array, or else it will return the result of the last iterator function called. Iteration stops immediately if any call to the iteration function results in a non-zero return. periodt π
The caller should hold the RCU read lock or better if concurrent modification is possible. iykyk π§
π SEE ALSO π
Kernel file ./lib/assoc_array.c β and the whole squad:
assoc_array_find(9)assoc_array_destroy(9)assoc_array_insert(9)assoc_array_insert_set_object(9)assoc_array_delete(9)assoc_array_clear(9)assoc_array_apply_edit(9)assoc_array_cancel_edit(9)assoc_array_gc(9)
mwah π β source/version: ./lib, date: October 2026, page: assoc_array_iterate(9).
π¦ 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