DEVCTL_SAFE_QUOTE_SB(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 NAME 🌸

Okay bestie, this is the DEVCTL_SAFE_QUOTE_SB(9) page from the Kernel Developer's Manual ✨ β€” and the function is devctl_safe_quote_sb: it inserts a string, properly quoted, into a sbuf. Periodt πŸ’….

✨ SYNOPSIS ✨

#include <sys/devctl.h>
#include <sys/sbuf.h>

void
devctl_safe_quote_sb(struct sbuf *sb, const char *src);

πŸ’… DESCRIPTION πŸ’…

So here’s the vibe: copy the string from src into sb. That’s the main-character move πŸ’–.

When it does that, these rules are non-negotiable:

  • All backslash characters (\) are doubled.
  • All double quote characters (") are also preceded by a backslash (\).
  • All other characters are copied without modification.

The devctl(4) protocol requires a quoted string to be quoted this exact way. This routine is the one that centralizes this knowledge, so it lives in one place instead of being scattered everywhere. Slay 🫢.

πŸ¦‹ SEE ALSO πŸ¦‹

πŸŽ€ AUTHORS πŸŽ€

This manual page was written by M. Warner Losh. Iconic πŸ‘‘.


That’s the whole page, bestie πŸ’– β€” the footer source/version says Debian, and the date is September 22, 2020. DEVCTL_SAFE_QUOTE_SB(9) signing off 🌈.

πŸ“¦ where this page comes from