Clear specific debug flags with the values provided for the process associated with the file descriptor. The flags that can be cleared are described in <sys/debug.h>. The argument is a pointer to an unsigned integer that specifies the debug flags to clear. For example:

int flags;

flags = _DEBUG_FLAG_KLC;        /* Kill-on-Last-Close flag */
devctl( fd, DCMD_PROC_CLEAR_FLAG, &flags, sizeof(flags), NULL);

To set the flags, use DCMD_PROC_SET_FLAG .