Re: socket closing

From: Lee Chin (
Date: Wed Apr 25 2001 - 20:30:54 EST

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


------Original Message------
From: Mark Hahn <>
To: Lee Chin <>
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
Sign up at
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to

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