
device file is closed, rather on every descriptor close. Instead of getting the exclusive lock on open and releasing on close, get the lock only when needed in sysmonioctl_envsys(). Fixes kern/14368 by Anthony Mallet. Okayed by Jason Thorpe. While here, also inline sysmon_envsys_init() to sysmonopen_envsys(), and g/c sysmonioctl_wdog() prototype.