DEVCTL_PROCESS_RUNNING(9)

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

πŸ’… DEVCTL_PROCESS_RUNNING(9) πŸ’…

okay so this is a page from the Kernel Developer's Manual β€” yes, the kernel devs have a manual too, and yes it's iconic. The function is literally called devctl_process_running, and no cap, it does exactly what it says on the tin. 🫢


✨ NAME ✨

devctl_process_running β€” returns true when devctl has a consumer process running πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <sys/devctl.h>

bool
devctl_process_running(void);

so first you gotta #include <sys/devctl.h> bestie, and then the function takes no arguments β€” it's a total low-maintenance queen, void era. It hands you back a bool. periodt. ✨


🌸 DESCRIPTION 🌸

The devctl_process_running call returns true when a process has the devctl device open for reading, and false otherwise. That's it. That's the whole vibe check. πŸ¦‹

So like, when it comes back true, you can go ahead and assume the default devd(8) (or something similar) is running. main character energy, honestly. πŸ‘‘

Here's why this slaps: some subsystems will send a message and let userland do something before proceeding with a default action β€” but only if there's a timeout. And this call? It lets those subsystems just do the default action right away when no process is running. No waiting around for a bestie who's never gonna text back. πŸ’€ Not me being dramatic, it's just efficient. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

go give that one a read too, iykyk 🧚


⭐ AUTHORS ⭐

This manual page was written by M. Warner Losh β€” absolute icon, we stan πŸ’œ


and that's the whole page bestie, mwah πŸ’…πŸŒˆ

sign-off time: this gem came from Debian, dated September 22, 2020, and it's living in the DEVCTL_PROCESS_RUNNING(9) section of the Kernel Developer's Manual. slay. πŸŽ€πŸ“

πŸ“¦ where this page comes from