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

Function notify

freebsd/kern/kern_conf.c:533–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533static void
534notify(struct cdev *dev, const char *ev, int flags)
535{
536 static const char prefix[] = "cdev=";
537 char *data;
538 int namelen, mflags;
539
540 if (cold)
541 return;
542 mflags = (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK;
543 namelen = strlen(dev->si_name);
544 data = malloc(namelen + sizeof(prefix), M_TEMP, mflags);
545 if (data == NULL)
546 return;
547 memcpy(data, prefix, sizeof(prefix) - 1);
548 memcpy(data + sizeof(prefix) - 1, dev->si_name, namelen + 1);
549 devctl_notify("DEVFS", "CDEV", ev, data);
550 free(data, M_TEMP);
551}
552
553static void
554notify_create(struct cdev *dev, int flags)

Callers 2

notify_createFunction · 0.85
notify_destroyFunction · 0.85

Calls 4

mallocFunction · 0.85
devctl_notifyFunction · 0.70
freeFunction · 0.70
memcpyFunction · 0.50

Tested by

no test coverage detected