virtsnd_ctl_msg_send_sync(9)
π virtsnd_ctl_msg_send_sync β the "just send it and wait" one
okay bestie, you're in the Kernel API Manual for virtsnd_ctl_msg_send_sync(9) and this one is genuinely a lil gem. it's the simplified, no-drama way to send a synchronous message. β¨
π¦ SYNOPSIS
int virtsnd_ctl_msg_send_sync (struct virtio_snd *snd , struct
virtio_snd_msg *msg );
π ARGUMENTS
sndβ the VirtIO sound device. the main character here, obviously. πmsgβ the control message. the thing you're yeeting out into the world. π
π DESCRIPTION
okay so here's the tea. once this function returns, the message is gone β deleted, poof, no cap. π«§ so if you still need the message content afterwards, you gotta keep it alive yourself, and to do that the caller must additionally call virtsnd_ctl_msg_ref/virtsnd_ctl_msg_unref on it. like, ref it before, unref it after, standard bestie behaviour. π
the msg_timeout_ms module parameter is what defines the message completion timeout. so if the message doesn't complete within that window, the function justβ¦ returns an error. π not completing is not it.
and the return value? it's a message status code (VIRTIO_SND_S_XXX) converted into an appropriate -errno value. so it's giving status code in, errno out. π₯
πΈ CONTEXT
any context that permits to sleep. so like, sleepy-friendly zones only. respect the nap rules. π΄
β¨ RETURN
0on success π-errnoon failure π
π§ SEE ALSO
- Kernel file
./sound/virtio/virtio_ctl_msg.h virtsnd_ctl_msg_send_async(9)β the async sibling, for when you can't be bothered to wait around. π¦
and that's the whole page, bestie β you ate that. fr fr. this one's from ./sound/virtio, dated October 2026, served fresh from the Kernel API Manual. now go forth and send synchronously π
π¦ 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