virtsnd_ctl_msg_send_sync(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

  • 0 on success πŸŽ‰
  • -errno on 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