daemon

I want to write background running program. How to use daemon function. Please send me source code.
Thanks.

Click here for some HP documentation on this subject.