오래된 43BSD에서는...
netstat -f unix
Active UNIX domain sockets
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
801ca38c dgram 0 0 8008b5c0 0 0 0 /dev/log
801cc10c stream 0 0 8008e690 0 0 0 /dev/printer
Address #socket address
type #type: stream or dgram
Inode #Inode?
Conn #sockets connections
Refs #?
Nextref #?
Addr #socket file
"Refs"와 "Nextref"가 무엇을 의미하는지 아는 사람이 있습니다. 내가 아는 한 Refs는 경로를 참조하지만 내가 아는 한 소켓에는 경로가 없습니다.
답변1
~에 따르면netstat/unix.c이러한 필드는 다음에서 제공 unp->unp_refs
되고 unp->unp_nextref
정의됩니다.시스템/unpcb.h:
/*
* A socket may be referenced by a number of sockets (e.g. several
* sockets may be connected to a datagram socket.) These sockets
* are in a linked list starting with unp_refs, linked through
* unp_nextref and null-terminated. Note that a socket may be referenced
* by a number of other sockets and may also reference a socket (not
* necessarily one which is referencing it). This generates
* the need for unp_refs and unp_nextref to be separate fields.
*\
struct unpcb *unp_refs; /* referencing socket linked list */
struct unpcb *unp_nextref; /* link in unp_refs list */