vb2_core_poll(9)
π vb2_core_poll π
okay so this is a page from the Kernel API Manual, and it's about vb2_core_poll β which, as the name lowkey gives away, is the function that implements poll syscall() logic. yes bestie, that poll. the one where userspace goes "hey is anything ready yet π" and the kernel goes "hold on let me check." iconic behaviour, honestly.
β¨ NAME β¨
vb2_core_poll β implements poll syscall() logic. that's it. that's the whole job. main character energy fr π
πΈ SYNOPSIS πΈ
__poll_t vb2_core_poll (struct vb2_queue *q , struct file *file ,
poll_table *wait );
three args, one __poll_t return. no cap, that's the whole signature π¦
π«Ά ARGUMENTS π«Ά
qβ pointer tostruct vb2_queuewith the videobuf2 queue. it's the queue, bestie. the whole vibe lives in here πfileβ thestruct fileargument that gets passed to thepollfile operation handler. yes, the same one your handler already got handed β¨waitβ thepoll_tablewait argument, also passed to thepollfile operation handler. it's the "put me in the wait queue" little guy π§
π DESCRIPTION π
so here's the tea: this function implements the poll file operation handler for a driver. like, that's literally what it's for π«Ά
for CAPTURE queues, if a buffer is ready to be dequeued, the userspace peeps get informed that the file descriptor of a video device is available for reading. slay. somebody's got footage waiting π₯
for OUTPUT queues, if a buffer is ready to be dequeued, the file descriptor gets reported as available for writing. and that's the whole vibe check π
the return values from this function are intended to be directly returned from the poll handler in the driver. don't get creative with them, don't remix them, just hand them straight back fr fr π
π¦ SEE ALSO π¦
buckle up, this list is long and honestly kind of iconic β everything here lives in the kernel file ./include/media/videobuf2-core.h:
enum vb2_memory(9)struct vb2_mem_ops(9)struct vb2_plane(9)enum vb2_io_modes(9)enum vb2_buffer_state(9)struct vb2_buffer(9)struct vb2_ops(9)struct vb2_buf_ops(9)struct vb2_queue(9)vb2_queue_allows_cache_hints(9)vb2_plane_vaddr(9)vb2_plane_cookie(9)vb2_buffer_done(9)vb2_discard_done(9)vb2_wait_for_all_buffers(9)vb2_core_querybuf(9)vb2_core_reqbufs(9)vb2_core_create_bufs(9)vb2_core_prepare_buf(9)vb2_core_remove_bufs(9)vb2_core_qbuf(9)vb2_core_dqbuf(9)vb2_core_streamon(9)vb2_core_streamoff(9)vb2_core_expbuf(9)vb2_core_queue_init(9)vb2_core_queue_release(9)vb2_queue_error(9)vb2_mmap(9)vb2_get_unmapped_area(9)vb2_read(9)vb2_write(9)vb2_thread_fnc(9)vb2_thread_start(9)vb2_thread_stop(9)vb2_is_streaming(9)vb2_fileio_is_active(9)vb2_get_num_buffers(9)vb2_is_busy(9)vb2_get_drv_priv(9)vb2_set_plane_payload(9)vb2_get_plane_payload(9)vb2_plane_size(9)vb2_start_streaming_called(9)vb2_clear_last_buffer_dequeued(9)vb2_get_buffer(9)vb2_buffer_in_use(9)vb2_verify_memory_type(9)vb2_request_object_is_buffer(9)vb2_request_buffer_cnt(9)
okay that's the whole page, go touch some buffers π
sign-off era: this lil masterpiece comes from ./include/media, dated October 2026, and yeah β it's the vb2_core_poll(9) page, serving Kernel API Manual realness from top to bottom. 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