[uClinux-dev] Daemonize a process

Stuart MacDonald stuartm at connecttech.com
Wed Mar 12 17:28:52 EST 2003


The classic sequence of:

fork();
setsid();
fork();

doesn't work in uClinux because vfork blocks the parent until an _exit
or execve().

What I end up with is two D state processes (zombies) and the final
child still parented by its real parent instead of init.

I've checked a number of /user apps, but haven't found one that wants
to do the same thing, so no example code to follow.

Am I missing a simple solution, or is this just not possible until
uClinux gets fork()? If so, what's required to get fork working? The
comment in arch/m68knommu/kernel/process.c states that it almost
works, but doesn't specify which bit is failing.

..Stu





More information about the uClinux-dev mailing list