diff --git a/nbsd_include/sys/queue.h b/nbsd_include/sys/queue.h index 4c72a39dd..91a83423b 100644 --- a/nbsd_include/sys/queue.h +++ b/nbsd_include/sys/queue.h @@ -166,6 +166,11 @@ struct { \ (var); \ (var) = ((var)->field.le_next)) +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = LIST_FIRST((head)); \ + (var) && ((tvar) = LIST_NEXT((var), field), 1); \ + (var) = (tvar)) + /* * List access methods. */