SRPL_EMPTY_LOCKED(9)

πŸ“¦ in nixpkgs unstable

πŸ’– SRPL_EMPTY_LOCKED(9) πŸ’–

hiii bestie, welcome to the SRPL_EMPTY_LOCKED(9) page from the Kernel Developer's Manual β€” today we're doing serialised singly-linked shared reference pointer list operations and it's giving main character energy fr fr. πŸ¦‹βœ¨

🌸 NAME 🌸

okay so this page is the whole locked SRPL crew: SRPL_EMPTY_LOCKED, SRPL_FIRST_LOCKED, SRPL_NEXT_LOCKED, SRPL_FOREACH_LOCKED, SRPL_FOREACH_SAFE_LOCKED, SRPL_INSERT_HEAD_LOCKED, SRPL_INSERT_AFTER_LOCKED, and SRPL_REMOVE_LOCKED β€” all about serialised singly-linked shared reference pointer list operations. periodt. πŸ‘‘

✨ SYNOPSIS ✨

#include <sys/srp.h>

int
SRPL_EMPTY_LOCKED(SRPL_HEAD *sl);

void *
SRPL_FIRST_LOCKED(SRPL_HEAD *sl);

void *
SRPL_NEXT_LOCKED(struct TYPE *listelm, FIELDNAME);

SRPL_FOREACH_LOCKED(VARNAME, SRPL_HEAD *sl, FIELDNAME);

SRPL_FOREACH_SAFE_LOCKED(VARNAME, SRPL_HEAD *sl, FIELDNAME,
    TEMP_VARNAME);

void
SRPL_INSERT_HEAD_LOCKED(struct srpl_rc *rc, SRPL_HEAD *sl,
    struct TYPE *elm, FIELDNAME);

void
SRPL_INSERT_AFTER_LOCKED(struct srpl_rc *rc, struct TYPE *listelm,
    struct TYPE *elm, FIELDNAME);

void
SRPL_REMOVE_LOCKED(struct srpl_rc *rc, SRPL_HEAD *sl,
    struct TYPE *listelm, TYPE, FIELDNAME);

πŸ’… DESCRIPTION πŸ’…

The SRP list macros build a linked list on top of shared reference pointers. These macros allow manipulation and traversal of the linked list while access to the list is serialised by the caller. no cap, that's the vibe. 🫢

  • SRPL_EMPTY_LOCKED() β€” tests whether the SRP list sl is empty. like a little vibe check for the list. πŸ•΅οΈβ€β™€οΈ
  • SRPL_FIRST_LOCKED() β€” accesses the first element in the SRP list sl. firsties! πŸ₯‡
  • SRPL_NEXT_LOCKED() β€” accesses the next element in the SRP list after listelm. onward, bestie. ➑️
  • SRPL_FOREACH_LOCKED() β€” creates a loop for traversing the elements in the SRP list sl. loop-de-loop icon behavior. πŸ”
  • SRPL_FOREACH_SAFE_LOCKED() β€” creates a loop for traversing the elements in the SRP list sl, permitting it to remove VARNAME as well as freeing it from within the loop safely without interfering with the traversal. safe traversal ate, honestly. πŸ›‘οΈ
  • SRPL_INSERT_HEAD_LOCKED() β€” inserts elm into the SRP list sl. Reference counts are adjusted on the list items using the functions specified by rc. insert at the front, slay. πŸ’…
  • SRPL_INSERT_AFTER_LOCKED() β€” inserts elm into an SRP list after the element listelm. Reference counts are adjusted on the list items using the functions specified by rc. right after your fave, iconic. ✨
  • SRPL_REMOVE_LOCKED() β€” iterates over the SRP list sl until it finds listelm and then removes it. Reference counts are adjusted on the list items using the functions specified by rc. find it, remove it, goodbye. 🫑

πŸ¦‹ CONTEXT πŸ¦‹

SRPL_EMPTY_LOCKED(), SRPL_FIRST_LOCKED(), SRPL_NEXT_LOCKED(), SRPL_FOREACH_LOCKED(), SRPL_INSERT_HEAD_LOCKED(), SRPL_INSERT_AFTER_LOCKED(), and SRPL_REMOVE_LOCKED() may be called during autoconf or from process context. An appropriate lock must be held that prevents concurrent modifications to the list. this part is important, bestie β€” hold the right lock! πŸ”

⭐ RETURN VALUES ⭐

  • SRPL_FIRST_LOCKED() and SRPL_NEXT_LOCKED() return a pointer to elements in the SRP list, or NULL if there are no more elements.
  • SRPL_EMPTY_LOCKED() returns non-zero when the list is empty, otherwise 0.

🌈 SEE ALSO 🌈

  • SRPL_FIRST(9) β€” go peek at this one too, iykyk. πŸ‘€

πŸŽ€ HISTORY πŸŽ€

The srp API was originally written by Jonathan Matthew <jmatthew@openbsd.org> and David Gwynne <dlg@openbsd.org>. The SRP list API first appeared in OpenBSD 5.9. storytime with the Unix girlies πŸ’œ


made with πŸ’– by Debian, dated November 21, 2016 β€” byeee bestie! βœ¨πŸ’…

πŸ“¦ where this page comes from
  • nixpkgs unstable: cvs-export
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms