From owner-freebsd-hackers Fri Feb 15 0:52:34 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from hotmail.com (f105.pav1.hotmail.com [64.4.31.105]) by hub.freebsd.org (Postfix) with ESMTP id EEB2037B402 for ; Fri, 15 Feb 2002 00:52:22 -0800 (PST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 15 Feb 2002 00:52:22 -0800 Received: from 212.30.183.204 by pv1fd.pav1.hotmail.msn.com with HTTP; Fri, 15 Feb 2002 08:52:22 GMT X-Originating-IP: [212.30.183.204] From: "Magdalinin Kirill" To: freebsd-hackers@FreeBSD.ORG Subject: a daemon C skeleton Date: Fri, 15 Feb 2002 11:52:22 +0300 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 15 Feb 2002 08:52:22.0655 (UTC) FILETIME=[154998F0:01C1B5FE] Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, can anyone, please, point out a C skeleton for FreeBSD daemon. Is the following simple example correct for FreeBSD? if (getppid() != 1) { signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); signal(SIGTSTP, SIG_IGN); if (fork() != 0) exit(0); setsid(); } getrlimit(RLIMIT_NOFILE, &flim); for (fd = 0; fd < flim.rlim_max; fd++) close(fd); chdir("/"); ..... thanks in advance, Kirill Magdalinin bsdforumen@hotmail.com _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message