version 1.9, 1998/09/08 18:59:00 |
version 1.10, 1998/09/26 19:54:46 |
|
|
.Op Fl u Ar user |
.Op Fl u Ar user |
.Op Ar filename... |
.Op Ar filename... |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm Fstat |
.Nm fstat |
identifies open files. |
identifies open files. |
A file is considered open by a process if it was explicitly opened, |
A file is considered open by a process if it was explicitly opened, |
is the working directory, root directory, active pure text, or kernel |
is the working directory, root directory, active pure text, or kernel |
|
|
The following fields are printed: |
The following fields are printed: |
.Bl -tag -width MOUNT |
.Bl -tag -width MOUNT |
.It Li USER |
.It Li USER |
The username of the owner of the process (effective uid). |
The username of the owner of the process (effective UID). |
.It Li CMD |
.It Li CMD |
The command name of the process. |
The command name of the process. |
.It Li PID |
.It Li PID |
The process id. |
The process ID. |
.It Li FD |
.It Li FD |
The file number in the per-process open file table or one of the following |
The file number in the per-process open file table or one of the following |
special names: |
special names: |
|
|
otherwise, the mode is printed |
otherwise, the mode is printed |
as an octal number. |
as an octal number. |
.It Li SZ\&|DV |
.It Li SZ\&|DV |
If the file is not a character or block special, prints the size of |
If the file is not a character or block special file, prints the size of |
the file in bytes. Otherwise, if the |
the file in bytes. Otherwise, if the |
.Fl n |
.Fl n |
flag is not specified, prints |
flag is not specified, prints |
|
|
The letter ``r'' indicates open for reading; |
The letter ``r'' indicates open for reading; |
the letter ``w'' indicates open for writing. |
the letter ``w'' indicates open for writing. |
This field is useful when trying to find the processes that are |
This field is useful when trying to find the processes that are |
preventing a filesystem from being down graded to read-only. |
preventing a filesystem from being downgraded to read-only. |
.It Li NAME |
.It Li NAME |
If filename arguments are specified and the |
If filename arguments are specified and the |
.Fl f |
.Fl f |
|
|
is the socket type (stream, dgram, etc), and the third is the socket |
is the socket type (stream, dgram, etc), and the third is the socket |
flags field (in hex). |
flags field (in hex). |
The remaining fields are protocol dependent. |
The remaining fields are protocol dependent. |
For tcp, it is the address of the tcpcb, and for udp, the inpcb (socket pcb). |
For TCP, it is the address of the tcpcb, and for UDP, the inpcb (socket pcb). |
For unix domain sockets, it's the address of the socket pcb and the address |
For Unix domain sockets, it's the address of the socket pcb and the address |
of the connected pcb (if connected). |
of the connected pcb (if connected). |
Otherwise the protocol number and address of the socket itself are printed. |
Otherwise the protocol number and address of the socket itself are printed. |
The attempt is to make enough information available to |
The attempt is to make enough information available to |
|
|
.Pp |
.Pp |
For example, the addresses mentioned above are the addresses which the |
For example, the addresses mentioned above are the addresses which the |
.Dq Li netstat -A |
.Dq Li netstat -A |
command would print for tcp, udp, and unixdomain. |
command would print for TCP, UDP, and Unix domain. |
Note that since pipes are implemented using sockets, a pipe appears as a |
Note that since pipes are implemented using sockets, a pipe appears as a |
connected unix domain stream socket. |
connected Unix domain stream socket. |
A unidirectional unix domain socket indicates the direction of flow with |
A unidirectional Unix domain socket indicates the direction of flow with |
an arrow (``<-'' or ``->''), and a full duplex socket shows a double arrow |
an arrow (``<-'' or ``->''), and a full duplex socket shows a double arrow |
(``<->''). |
(``<->''). |
.Pp |
.Pp |