CMAP_ITER_NEXT(3)
π CMAP_ITER_NEXT π
okay bestie, welcome to the CMAP_ITER_NEXT(3) page β that's section 3 of the Corosync Cluster Engine Programmer's Manual, and yes she's a whole legend. sit down, grab a boba, let's go π§β¨
β¨ NAME β¨
cmap_iter_next β returns the next item in an iteration in CMAP π¦
πΈ SYNOPSIS πΈ
#include <corosync/cmap.h>
cs_error_t cmap_iter_next(cmap_handle_t handle, cmap_iter_handle_t
iter_handle, char key_name[], size_t *value_len, cmap_value_types_t
*type);
π DESCRIPTION π
so cmap_iter_next is literally the function you call to get the next value in an iteration. it's giving "walk the whole CMAP database one key at a time" energy, and honestly? iconic. π
quick vibe check on the args:
handleβ this is your connection to the CMAP database, and you get it by callingcmap_initialize(3). no handle, no party. π«Άiter_handleβ the iterator handle, which you snagged fromcmap_iter_init(3). this is your backstage pass to the iteration.key_nameβ the following key name gets stored in here. β οΈ important: you (the caller) have to preallocate this buffer. the guaranteed maximum size isCMAP_KEYNAME_MAXLEN(currently255), so plan accordingly bestie, no cutting it close. πvalue_lenβ a pointer to where the length of the value gets stored. this one can beNULLif you're feeling minimal, no judgement. πtypeβ also optional (yep, can beNULLtoo!) and this is where the type of the value gets stored. the type is one of the types described over in thecmap_get(3)function, so go peek there if you need the full roster. β
π₯ RETURN VALUE π₯
this call returns the CS_OK value when it succeeds. slay. β¨
but if there are no more items to iterate, it returns the CS_NO_SECTION error code instead β that's your "we're done here, the end, periodt" signal. π
π¦ SEE ALSO π¦
go read these too, they're all in the same friend group:
and here's the full error-code lineup, because knowing your errors is highkey main character energy π:
CS_ERR_TRY_AGAINβ resource temporarily unavailable πCS_ERR_INVALID_PARAMβ invalid argument π«CS_ERR_ACCESSβ permission denied πCS_ERR_LIBRARYβ the connection failed πCS_ERR_INTERRUPTβ system call interrupted by a signal β‘CS_ERR_NOT_SUPPORTEDβ the requested protocol/functionality is not supported πCS_ERR_MESSAGE_ERRORβ incorrect auth message received π΅οΈCS_ERR_NO_MEMORYβ not enough memory to complete the requested task π΅
and that's the whole page, bestie!! this one came straight out of the corosync Man Page, dated 06/02/2012 β oldie but a goodie, fr fr. now go iterate some keys and be amazing πππ«Ά
π¦ where this page comes from
- debian bookworm: libcmap-dev 3.1.7-1+deb12u2 Β· BSD-3-Clause
- debian trixie: libcmap-dev 3.1.9-2+deb13u1 Β· BSD-3-Clause
- epel 9: corosynclib-devel 3.1.10-0.2.el9.1 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.10-3.fc43 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.10-3.fc43 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.9-5.fc43 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.9-5.fc43 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-4.fc44 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-4.fc44 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-6.fc44 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-6.fc44 Β· BSD-3-Clause
- nixos 26.05: corosync 3.1.9
- nixpkgs unstable: corosync 3.1.9
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- ubuntu jammy: libcmap-dev 3.1.6-1ubuntu1 Β· BSD-3-Clause
- ubuntu jammy: libcmap-dev 3.1.6-1ubuntu1.2 Β· BSD-3-Clause
- ubuntu noble: libcmap-dev 3.1.7-1ubuntu3 Β· BSD-3-Clause
- ubuntu noble: libcmap-dev 3.1.7-1ubuntu3.2 Β· BSD-3-Clause
- ubuntu questing: libcmap-dev 3.1.9-2ubuntu1
- ubuntu questing: libcmap-dev 3.1.9-2ubuntu1.1
- ubuntu resolute: libcmap-dev 3.1.9-2ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libcmap-dev 3.1.10-3ubuntu1 Β· BSD-3-Clause
- Copyright (c) 2012 Red Hat, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms