This adds a -s option to fstat(1) to display socket endpoint(s) information.
Details
- Reviewers
jilles - Group Reviewers
manpages - Commits
- rS354140: Grammar fix.
rS353769: Add the fstat -s option to display socket information.
Here is the sample output:
# /usr/obj/usr/src-svn/amd64.amd64/usr.bin/fstat/fstat -s | awk '$5 ~ /^(local|internet)$/' | head root sshd 92160 3* internet stream tcp fffff8049255fb70 192.168.1.22:22 <-> *:0 1000 ssh-agent 24448 3* local stream fffff8001d34fa00 /tmp/ssh-VIm9vDnboKfn/agent.24447 root sendmail 29954 3* internet stream tcp fffff80297f813d0 192.168.1.31:25 <-> *:0 root sendmail 29954 4* local dgram fffff8001d34a300 <-> fffff8001d344100 /var/run/logpriv root ssh 92165 4* internet stream tcp fffff80167375b70 192.168.1.3:41033 <-> 62.210.137.175:22 smmsp sendmail 29957 3* local dgram fffff8001d63c100 <-> fffff8001d348000 /var/run/log root cron 92166 5* local dgram fffff8001d343800 <-> fffff8001d63dd00 /var/run/logpriv root cron 29961 4* local dgram fffff8001d34cc00 <-> fffff8001d344100 /var/run/logpriv root smbd 86666 6* local dgram fffff8001d854600 /var/db/samba4/private/msg.sock/86666 root smbd 86666 29* local dgram fffff8047d297600 <-> fffff8047cff3100 /var/run/logpriv
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 26965 Build 25265: arc lint + arc unit
Event Timeline
This seems useful.
usr.bin/fstat/fstat.1 | ||
---|---|---|
89 | "(s)" is not needed, as below. | |
203–204 | This is no longer true since fstat now duplicates parts of netstat, but that need not be bad. Consider simply removing the sentence. | |
216 | This sentence is incomplete. | |
usr.bin/fstat/fstat.c | ||
346 | Perhaps use inet_ntop() here as well to avoid using mutable static data (even though this program is single-threaded). | |
460 | non-NULL (NUL is '\0') |
Looks good with one grammar issue. Don't forget to bump .Dd.
usr.bin/fstat/fstat.1 | ||
---|---|---|
216 | socket endpoint information *is* shown |
usr.bin/fstat/fstat.1 | ||
---|---|---|
216 | Ah, this is uncountable in English (not in French :-)). Thanks! |
fstat.1:
- fix minor grammer issue
- bump Dd
fstat.c:
- fix a whitespace mistake
- remove the IS_INADDR_ANY() macro, as requested by rgrimes@ in https://lists.freebsd.org/pipermail/svn-src-head/2019-October/129784.html
head/usr.bin/fstat/fstat.1 | ||
---|---|---|
218 ↗ | (On Diff #63483) | With a "non-native speaker" disclaimer, this looks somehow wrong to me, should it be "the local and remote addresses are shown", or even "both local and remote addresses are shown" instead? |
head/usr.bin/fstat/fstat.1 | ||
---|---|---|
218 ↗ | (On Diff #63483) | Can't really tell. Leaving it to a native speaker. |
head/usr.bin/fstat/fstat.1 | ||
---|---|---|
218 ↗ | (On Diff #63483) | "The a and b" is plural. So "addresses" is needed. |
I won't update the patch here given it's already submitted but I'm submitting a fix to HEAD now.