use*_*981 5 file-descriptors gnome-shell gnome3 socket
strace
显示 GNOME shell 不断尝试从套接字读取,这通常不可用(或不包含任何要读取的数据):
strace -p gnome-shell-pid -e trace=recvfrom
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(6, "\1\233t\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\3304\351\244\307\202\36", 4096, 0, NULL, NULL) = 32
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(6, 0x1390a84, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
Run Code Online (Sandbox Code Playgroud)
/proc/$pid/fd
显示6是 UNIX 套接字的文件描述符。
lrwx------. 1 me me 64 Jan 5 12:48 6 -> socket:[55696]
Run Code Online (Sandbox Code Playgroud)
我试图在/proc/$pid/net/unix
.
是否可以知道该连接的另一端是哪个进程?
编辑:
输出lsof | grep 55696
:
gnome-she 2250 hamid 6u unix 0xffff880101064000 0t0 55696 socket
gdbus 2250 5801 hamid 6u unix 0xffff880101064000 0t0 55696 socket
dconf 2250 5805 hamid 6u unix 0xffff880101064000 0t0 55696 socket
threaded- 2250 5806 hamid 6u unix 0xffff880101064000 0t0 55696 socket
JS 2250 5807 hamid 6u unix 0xffff880101064000 0t0 55696 socket
JS 2250 5808 hamid 6u unix 0xffff880101064000 0t0 55696 socket
gmain 2250 5818 hamid 6u unix 0xffff880101064000 0t0 55696 socket
Run Code Online (Sandbox Code Playgroud)
这意味着该套接字由 GNOME shell 进程的线程使用。好的,但是谁能说出这个套接字发送和接收的数据?