From owner-freebsd-questions Wed May 15 9: 1:36 2002 Delivered-To: freebsd-questions@freebsd.org Received: from fepC.post.tele.dk (fepC.post.tele.dk [195.41.46.147]) by hub.freebsd.org (Postfix) with ESMTP id 817D637B404 for ; Wed, 15 May 2002 09:01:28 -0700 (PDT) Received: from there ([80.63.125.30]) by fepC.post.tele.dk (InterMail vM.4.01.03.23 201-229-121-123-20010418) with SMTP id <20020515160127.JFIA12125.fepC.post.tele.dk@there> for ; Wed, 15 May 2002 18:01:27 +0200 Content-Type: text/plain; charset="iso-8859-1" From: Daniel Blankensteiner To: freebsd-questions@freebsd.org Subject: Descriptors Date: Wed, 15 May 2002 18:01:46 +0200 X-Mailer: KMail [version 1.3] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020515160127.JFIA12125.fepC.post.tele.dk@there> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi FL (FreeBSD lovers ;-) I am reading about socket programming and the author wrote that a socket is given a descriptor, like when you open a file you get a file descriptor. The descriptors are given from the same table, so a file and a socket can't get the same descriptor. That is all fine, but then I run sockstat on my FreeBSD 4.5 Stable, I get: db# sockstat -4 -l USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS root centeric 696 8 tcp4 *:49158 *:* root XF86_SVG 637 0 tcp4 *:6000 *:* root sshd 82 4 tcp4 *:22 *:* root amd 72 4 udp4 *:1023 *:* root amd 72 5 tcp4 *:1023 *:* root amd 72 6 udp4 *:1022 *:* root amd 72 7 udp4 *:1021 *:* daemon portmap 70 3 udp4 *:111 *:* daemon portmap 70 4 tcp4 *:111 *:* root syslogd 67 5 udp4 *:514 *:* Why do some have the same FD (file descriptor)? br db To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message