On Wed, 24 Feb 1999, Bogdan Taru wrote:

 # 
 #         Hi everyone,
 # 
 #  I've got an 'exotic' programming problem for you: how can I make a
 # daemon?


--- dumbdaemon.c ---
#include <stdio.h>
#include <stdlib.h>

int main(void) {
        int pid;

        if (pid=fork()) {
                // parent!
                printf("Child process is %u.\n",pid);
                exit(0);
        }
        // child!
        sleep(3600);
        exit(0);
}

Of course this does absolutely nothing (unless you count waiting one hour
'something').


G'day!
--                                             n i c h o l a s  j  l e o n
elegance through simplicity*http://mrnick.binary9.net*[EMAIL PROTECTED]
good fortune through truth*roaming:[EMAIL PROTECTED]*ICQ#2170994*U+($++)
TRA#6805*not all questions have answers*pseudogeek:P+++($++)L+($++)W=lm@b9
trust no-one with an iq under 150*understand yourself before trying others

Reply via email to