nbd_poll2(3)
π nbd_poll2 β polling but make it extra
okay bestie, so this is nbd_poll2(3) from the libnbd fam π β it's a libnbd function, and yes it lives in section 3 of the manual like all the other cute library calls.
β¨ SYNOPSIS β¨
first things first, you gotta include the header, no cap:
#include <libnbd.h>
int nbd_poll2 (
struct nbd_handle *h, int fd, int timeout
);
πΈ DESCRIPTION πΈ
so this is literally the same as nbd_poll(3) β same energy, same vibe β except bestie, there's an extra file descriptor parameter that gets passed in. π
that extra fd also gets polled (using POLLIN, obviously), so it's out here waiting on two things at once like the main character it is.
one use for this? waiting on an eventfd(2) π¦. that's the moment. that's the whole point. iykyk.
π RETURN VALUE π
this call returns an integer β₯ 0. slay. positive vibes only.
π ERRORS π
when it's not slaying, it returns -1. π rough.
if you need the juicy details on what went wrong, refer to "ERROR HANDLING" in libnbd(3) β that's where the actual error info lives, fr fr.
also important: the following parameters must not be NULL: "h". like, do not pass NULL for h, bestie, i'm begging. for more info see "Non-NULL parameters" in libnbd(3).
β VERSION β
this function first appeared in libnbd 1.16. so if you're on something older, it's giving "not yet, gorgeous." π
need to test at compile time whether it's available? check if this macro is defined:
#define LIBNBD_HAVE_NBD_POLL2 1
π¦ SEE ALSO π¦
go read these next, bestie:
π AUTHORS π
- Eric Blake
- Richard W.M. Jones
π COPYRIGHT π
Copyright Red Hat
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
ok that's the whole page bestie, go forth and poll responsibly π«Ά
and finally, the little sign-off the manpage footer woulda said: this one's from libnbd-1.25.8, dated 2026-10-13. periodt. π β¨
π¦ where this page comes from
- centos-stream 10: libnbd-devel 1.25.8-1.el10 Β· LGPL-2.0-or-later AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms