From: Oren Held <oren@he...> - 2003-10-18 19:40:08
I've just noticed that lirc is the only kernel thread that runs the next
(lirc_dev.c:144 or so)
/* This thread doesn't need any user-level access,
* so get rid of all our resources
current->session = 1;
current->pgrp = 1;
current->euid = 0;
current->tty = NULL;
Now, I think that it could all be replaced by the kernel's 'daemonize()'
function defined in /usr/src/linux/kernel/exit.c, like all the other
kernel thread code.
A good reason to use that is that the kernel structured got changed in
recent releases (i.e. 2.6.0-test8), and for example seems like nothing
should access the current->pgrp (which was changed to __pgrp variable
directly).. A search in the kernel tree shows that indeed nothing does
that except of lirc.
Anybody sees a reason WHY NOT to do that?