SRPL_EMPTY_LOCKED(9)
π 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 listslis empty. like a little vibe check for the list. π΅οΈββοΈSRPL_FIRST_LOCKED()β accesses the first element in the SRP listsl. firsties! π₯SRPL_NEXT_LOCKED()β accesses the next element in the SRP list afterlistelm. onward, bestie. β‘οΈSRPL_FOREACH_LOCKED()β creates a loop for traversing the elements in the SRP listsl. loop-de-loop icon behavior. πSRPL_FOREACH_SAFE_LOCKED()β creates a loop for traversing the elements in the SRP listsl, permitting it to removeVARNAMEas well as freeing it from within the loop safely without interfering with the traversal. safe traversal ate, honestly. π‘οΈSRPL_INSERT_HEAD_LOCKED()β insertselminto the SRP listsl. Reference counts are adjusted on the list items using the functions specified byrc. insert at the front, slay. πSRPL_INSERT_AFTER_LOCKED()β insertselminto an SRP list after the elementlistelm. Reference counts are adjusted on the list items using the functions specified byrc. right after your fave, iconic. β¨SRPL_REMOVE_LOCKED()β iterates over the SRP listsluntil it findslistelmand then removes it. Reference counts are adjusted on the list items using the functions specified byrc. 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()andSRPL_NEXT_LOCKED()return a pointer to elements in the SRP list, orNULLif there are no more elements.SRPL_EMPTY_LOCKED()returns non-zero when the list is empty, otherwise0.
π 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
- Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms