From owner-freebsd-hackers Tue Nov 7 4:39:40 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from iclub.nsu.ru (iclub.nsu.ru [193.124.222.66]) by hub.freebsd.org (Postfix) with ESMTP id 6A4A137B479 for ; Tue, 7 Nov 2000 04:39:33 -0800 (PST) Received: from localhost (fjoe@localhost) by iclub.nsu.ru (8.9.3/8.9.3) with ESMTP id SAA27864 for ; Tue, 7 Nov 2000 18:39:17 +0600 (NS) (envelope-from fjoe@iclub.nsu.ru) Date: Tue, 7 Nov 2000 18:39:16 +0600 (NS) From: Max Khon To: hackers@freebsd.org Subject: daemon() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, there! --- cut here --- #include #include main() { if (daemon(1, 1) < 0) { perror("daemon"); } for (;;) sleep(1); } --- cut here --- lark:~$ps ax | grep foo3 26102 ?? Ss 0:00.00 ./foo3 26104 p8 S+ 0:00.01 grep foo3 lark:~$fstat -p 26102 USER CMD PID FD MOUNT INUM MODE SZ|DV R/W fjoe foo3 26102 root / 2 drwxr-xr-x 512 r fjoe foo3 26102 wd /usr 16007 drwxr-xr-x 8192 r fjoe foo3 26102 text /usr 16071 -rwxrwxr-x 4574 r fjoe foo3 26102 0 / 5542 crw--w---- ttyp8 rw fjoe foo3 26102 1 / 5542 crw--w---- ttyp8 rw fjoe foo3 26102 2 / 5542 crw--w---- ttyp8 rw fjoe foo3 26102 4* pipe c9f1cde0 <-> 0 0 rw lark:~$ what is FD 4? /fjoe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message