Re: socket closing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks....
How do I tell if a file descriptor is a socket or not in C?

Thanks
Lee

------Original Message------
From: Mark Hahn <hahn@coffee.psychology.mcmaster.ca>
To: Lee Chin <leechin@mail.com>
Sent: April 24, 2001 8:25:29 PM GMT
Subject: Re: socket closing


> My question is, how do I tell what these (UNCLOSED) file descriptors point
> to ?
>
> I can so a stat on /proc/PID/fd/FILE and I get something like this:
> stat /proc/10881/fd/44
> File: "/proc/10881/fd/44" -> "socket:[1041079]"

the number is an inode, which you can find in /proc/net/{tcp,udp,unix}
lsof or fuser might be able to do this "non-manually"


______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux