Linux – Meaning of [socket:number] in /proc/pid/fd

linuxprocsocket

UNIX domain sockets opened by given $PID are listed in /proc/$PID/fd/X as symlinks to [socket:ID]. I understand that it's an identifier of that socket, but what exactly is it? Is it an inode in sockfs? Is it an inode at all?

# stat  /proc/15474/fd/18
  File: /proc/15474/fd/18 -> socket:[100754490]
  Size: 64              Blocks: 0          IO Block: 1024   symbolic link
Device: 4h/4d   Inode: 100753577   Links: 1
Access: (0700/lrwx------)  Uid: (  999/mysql)   Gid: (  999/  docker)
Access: 2020-08-14 10:08:09.834593933 +0200
Modify: 2020-08-14 10:08:07.842537799 +0200
Change: 2020-08-14 10:08:07.842537799 +0200

Best Answer

That is indeed the inode number of the specific socket.

There are good answers on these Unix & Linux SE posts:

  1. /proc/PID/fd/X link number
  2. What characterizes a file in Linux/Unix?

(Please note that I couldn't post this as a comment due to reputation restrictions, hope it is still useful)

Related Question