mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "\"YOSHIFUJI Hideaki (吉藤 英明)\"" <hideaki@yoshifuji.org>
To: KV Pavuram <kvpavuram@yahoo.co.in>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Socket vs File descriptor
Date: Thu, 24 Sep 2009 16:54:12 +0900	[thread overview]
Message-ID: <4ABB25A4.3050901@yoshifuji.org> (raw)
In-Reply-To: <179773.9311.qm@web8404.mail.in.yahoo.com>

KV Pavuram wrote:
> Is there any  ioctl call to determine if a given descriptor is a file descriptor or a socket descriptor.
> 
> Similarly, is there a way to find out a socket descriptor type ie.e if it is SOCK_STREAM, or SOCK_DGRAM type.

Maybe "lsof" command is your friend.

Or, depending on your purpose, you can use
getsockopt(), listen() etc. to get error
(e.g. ENOTSOCK) to test the type.

--yoshfuji

      parent reply	other threads:[~2009-09-24  8:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24  6:51 KV Pavuram
2009-09-24  7:10 ` Willy Tarreau
2009-09-24  7:54 ` "YOSHIFUJI Hideaki (吉藤 英明)" [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ABB25A4.3050901@yoshifuji.org \
    --to=hideaki@yoshifuji.org \
    --cc=kvpavuram@yahoo.co.in \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®