[EMAIL PROTECTED] wrote:

> > I would like to develop daemon applications for part of my final project. 
> > So that I need to have any source code relate to daemon programming. 
> > Could anybody let me know how to find the source code ? 

> (5) umask(0) so that we have complete control over the permissions of anything
>    we write. We don't know what umask we may have inherited.

Hmm. That's debatable. It may be desirable to just use whatever umask
has been set, rather than having to provide a separate configuration
option for it.

> (7) Create a new stdout, an example might be: open("/dev/console",O_RDWR).
> (8) dup2() twice to duplicate the fd for standard out for standard in and
>    standard error.

Again, that's debatable.

> NOTE:  If you're started from inetd some of this is a little different, you
>    don't have to do the first fork, and fds 0, 1, and 2 are set up to be
>    the connected socket.  That means you should probably skip steps 6, 7
>    and 8.

If the program is being started from inetd, you shouldn't need to do
any of this.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to