MCPcopy Create free account
hub / github.com/F-Stack/f-stack / devctl_notify

Function devctl_notify

freebsd/kern/subr_bus.c:675–702  ·  view source on GitHub ↗

* @brief Send a 'notification' to userland, using standard ways */

Source from the content-addressed store, hash-verified

673 * @brief Send a 'notification' to userland, using standard ways
674 */
675void
676devctl_notify(const char *system, const char *subsystem, const char *type,
677 const char *data)
678{
679 struct dev_event_info *dei;
680 struct sbuf sb;
681
682 if (system == NULL || subsystem == NULL || type == NULL)
683 return;
684 dei = devctl_alloc_dei_sb(&sb);
685 if (dei == NULL)
686 return;
687 sbuf_cpy(&sb, "!system=");
688 sbuf_cat(&sb, system);
689 sbuf_cat(&sb, " subsystem=");
690 sbuf_cat(&sb, subsystem);
691 sbuf_cat(&sb, " type=");
692 sbuf_cat(&sb, type);
693 if (data != NULL) {
694 sbuf_putc(&sb, ' ');
695 sbuf_cat(&sb, data);
696 }
697 sbuf_putc(&sb, '\n');
698 if (sbuf_finish(&sb) != 0)
699 devctl_free_dei(dei); /* overflow -> drop it */
700 else
701 devctl_queue(dei);
702}
703
704/*
705 * Common routine that tries to make sending messages as easy as possible.

Callers 15

rctl_enforceFunction · 0.70
coredumpFunction · 0.70
root_resumeFunction · 0.70
mount_devctl_eventFunction · 0.70
notifyFunction · 0.70
log_syseventFunction · 0.50
carp_set_stateFunction · 0.50
coretemp_get_val_sysctlFunction · 0.50
am335x_pmic_intrFunction · 0.50
axp2xx_intrFunction · 0.50
axp8xx_intrFunction · 0.50
coretemp_get_val_sysctlFunction · 0.50

Calls 7

devctl_alloc_dei_sbFunction · 0.85
sbuf_cpyFunction · 0.85
sbuf_catFunction · 0.85
sbuf_putcFunction · 0.85
sbuf_finishFunction · 0.85
devctl_free_deiFunction · 0.85
devctl_queueFunction · 0.85

Tested by

no test coverage detected