Hello everybody, I am developing a device driver, which is exposed as a character device (i.e. /dev/pcd) and which mostly uses ioctl for device control. Within a specific ioctl command implementation I am starting a new kernel thread via kthread_create_with_stack. Once this thread's main function exits, the NuttX scheduler calls 'close' on all open file descriptors, which causes undesired side effects.
What is the correct way to start a lightweight kernel thread without copying the open file descriptors from the original thread? (workqueues are probably not an option since the thread's main function might run for an extended period of time). Your help is much appreciated Thanks! Michael