From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 6 20:50:02 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABA9016A401 for ; Tue, 6 Feb 2007 20:50:02 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.230]) by mx1.freebsd.org (Postfix) with ESMTP id 6B63D13C4AC for ; Tue, 6 Feb 2007 20:50:01 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: by nz-out-0506.google.com with SMTP id i11so2061224nzh for ; Tue, 06 Feb 2007 12:50:01 -0800 (PST) Received: by 10.65.216.19 with SMTP id t19mr13585836qbq.1170793470275; Tue, 06 Feb 2007 12:24:30 -0800 (PST) Received: by 10.64.208.16 with HTTP; Tue, 6 Feb 2007 12:24:30 -0800 (PST) Message-ID: Date: Tue, 6 Feb 2007 22:24:30 +0200 From: "Vlad GALU" To: "Andrew N. Below" In-Reply-To: <20070206230620.N97390@defan.zenon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070206230620.N97390@defan.zenon.net> Cc: freebsd-hackers@freebsd.org Subject: Re: socket descriptor returned from socket() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2007 20:50:02 -0000 On 2/6/07, Andrew N. Below wrote: > Hello. > > Could 0 (zero) be a valid socket descriptor? Yes, if your program is a daemon and closes fds 0, 1, 2 which corespond to stdin, stdout and stderr. > man 2 socket: > > RETURN VALUES > A -1 is returned if an error occurs, otherwise the return value is a > descriptor referencing the socket. > > I have some troubles with xinetd (2.3.14) - first service > in config file with proto=tcp, socket_type=stream and wait=yes > fail to start (fcntl returns "Bad file descriptor" error). > > -- > Andrew N. Below > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- If it's there, and you can see it, it's real. If it's not there, and you can see it, it's virtual. If it's there, and you can't see it, it's transparent. If it's not there, and you can't see it, you erased it.