From owner-freebsd-questions@FreeBSD.ORG Wed Nov 14 22:21:46 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0717416A417 for ; Wed, 14 Nov 2007 22:21:46 +0000 (UTC) (envelope-from af300wsm@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.179]) by mx1.freebsd.org (Postfix) with ESMTP id D21B113C478 for ; Wed, 14 Nov 2007 22:21:45 +0000 (UTC) (envelope-from af300wsm@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so420226waf for ; Wed, 14 Nov 2007 14:21:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=D3qEsyxOJXpebBrG7MmHFk8AKWFXgtvMQvUjnyxcIrk=; b=oVXjfgRlik8TiEf9OlW/0IUeIpF+QQVTFjgTHY7+EsAidqMbMywkBCBdfDdncSMxLtO+m+LUCvKdkgObXo5it1pO/UZtqvPgWOLewJC7ZPWH+23N3LBtAWAET/aoYsYGV1WlodPzEz+Llx8yQpzzl63ubpSsaTB093BdMdRRc/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=hK446F4GzPyQXQSRdUQ1ZT7Odch1Ov+MLSY9AedOmwrOYwEF/ccfMwvEQw0o0Ijvd61Tdjt6Qq7gDOE07HR9cOAgbvssimFRwjun05hplyh2E2iAxx/9X9O6tFs2Mr9JMxEv0BAlbWYch1b3UYvlXDiMpODZZSpj1d6ZoVedklo= Received: by 10.115.22.1 with SMTP id z1mr463492wai.1195078903972; Wed, 14 Nov 2007 14:21:43 -0800 (PST) Received: by 10.114.254.9 with HTTP; Wed, 14 Nov 2007 14:21:43 -0800 (PST) Message-ID: <340a29540711141421tda33970q79f85533fb5ba725@mail.gmail.com> Date: Wed, 14 Nov 2007 15:21:43 -0700 From: "Andrew Falanga" To: "User Questions" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Socket programming question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2007 22:21:46 -0000 Hi, My question has to do with how someone would find out if a call to socket(2) actually produced a socket. I know that the API works, I've programmed with it many times, but is there a way to find out if 's' returned by socket(2) is actually valid in whatever kernel structure it is stored? I understand that I may have the process entirely mixed up. But it seems to me that the socket is somehow known to the kernel and I should be able to query the kernel somehow and discover if it is valid. Let me know if my question doesn't make sense as worded and I'll try to explain myself better. Another question related to this one, would someone in this list know where the source code is, in the system source tree, for the select call? Thanks, Andy