]> git.ipfire.org Git - thirdparty/util-linux.git/commit - misc-utils/lsfd-fifo.c
lsfd: fill ENDPOINTS column for FIFOs
authorMasatake YAMATO <yamato@redhat.com>
Mon, 7 Mar 2022 13:19:28 +0000 (22:19 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Mon, 4 Apr 2022 17:51:02 +0000 (02:51 +0900)
commit5211d5a18082c52c31dfc92b3c710e8e32c8ef2c
treed4d027c7273d89c940b13911572ec2d22f975957
parent66f31d8dfdaae2dc98913138f200287db8db7669
lsfd: fill ENDPOINTS column for FIFOs

For FIFO type files, lsof can fill ENDPOINTS as following:

  _PID_,_COMMAND_,_ASSOC_[-r][-w]

Example output:

  $ dd if=/dev/zero | nc -l 127.0.0.1 9091 > /dev/null &
  [1] 1707808 1707809

  $ ./lsfd -p "1707808 1707809" -o+ENDPOINTS -Q '(type == "FIFO")'
  COMMAND     PID   USER ASSOC MODE TYPE SOURCE MNTID    INODE NAME            ENDPOINTS
  dd      1707808 yamato     1  -w- FIFO pipefs    14 73477636 pipe:[734776361707809,nc,0r-
  nc      1707809 yamato     0  r-- FIFO pipefs    14 73477636 pipe:[734776361707808,dd,1-w

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd-fifo.c
misc-utils/lsfd.1.adoc
misc-utils/lsfd.c