前の43BSDとnetstat出力

前の43BSDとnetstat出力

古い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 */

おすすめ記事