datagram_poll(9)
π datagram_poll(9) β from the Kernel API Manual, bestie β¨
okay so picture this: you're deep in the kernel, the manual is called Kernel API Manual, and today's main character is datagram_poll. she's generic, she's reliable, she's literally the blueprint. let's get into it π
πΈ NAME πΈ
datagram_poll β the generic datagram poll, no cap π
β¨ SYNOPSIS β¨
__poll_t datagram_poll (struct file *file , struct socket *sock ,
poll_table *wait );
like, that's the whole signature and yes the spacing is exactly like that, don't come for me π
π¦ ARGUMENTS π¦
fileβ the file struct. that's it, that's the whole description, she's a woman of few words πsockβ the socket. the vibes container π«Άwaitβ the poll table. the guest list for the poll party π
π₯ DESCRIPTION π₯
Datagram poll. again: totally generic. she said "I'm not doing anything specific and I'm thriving" π
here's the slay part: this also handles sequenced packet sockets, provided the socket receive queue is only ever holding data that's ready to receive. that's the condition, bestie, don't forget it β if your queue is holding anything else, this is not the routine for you π
π NOTE π
listen up, this is the important one π
when you don't use this routine for this protocol, and you use a different write policy from sock_writeable, then please supply your own write_space callback. like, please. for me. π
β RETURN β
a poll bitmask indicating the socket's current state. basically a little status report card on how the socket is doing rn π
π§ SEE ALSO π§
all the kernel friends from ./net/core/datagram.c β go say hi, they're iconic:
__skb_try_recv_datagram(9)skb_kill_datagram(9)skb_copy_and_crc32c_datagram_iter(9)skb_copy_datagram_iter(9)skb_copy_datagram_from_iter(9)zerocopy_sg_from_iter(9)skb_copy_and_csum_datagram(9)skb_copy_and_csum_datagram_msg(9)datagram_poll_queue(9)
and that's the page!! this one lives in ./net/core, dated October 2026 β so if you see that timestamp around, that's her, that's the source and version, mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms