[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4ABB25A4.3050901@yoshifuji.org>
Date: Thu, 24 Sep 2009 16:54:12 +0900
From: "YOSHIFUJI Hideaki (吉藤 英明)"
<hideaki@...hifuji.org>
To: KV Pavuram <kvpavuram@...oo.co.in>
CC: linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: Socket vs File descriptor
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists