datagram_poll(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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