Re: socket closing

From: Lee Chin (leechin@mail.com)
Date: Wed Apr 25 2001 - 20:30:54 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org



This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:29 EST