Date: Tue, 6 Feb 2007 22:24:30 +0200 From: "Vlad GALU" <dudu@dudu.ro> To: "Andrew N. Below" <defan@zenon.net> Cc: freebsd-hackers@freebsd.org Subject: Re: socket descriptor returned from socket() Message-ID: <ad79ad6b0702061224w7ebc9e23lc33b3cbbc8106c99@mail.gmail.com> In-Reply-To: <20070206230620.N97390@defan.zenon.net> References: <20070206230620.N97390@defan.zenon.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2/6/07, Andrew N. Below <defan@zenon.net> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ad79ad6b0702061224w7ebc9e23lc33b3cbbc8106c99>