Commit graph

10 commits

Author SHA1 Message Date
Thomas Weißschuh
54a0643829 lsfd: make a few structs const 2023-01-23 13:52:00 +01:00
Masatake YAMATO
5211d5a180 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:[73477636] 1707809,nc,0r-
  nc      1707809 yamato     0  r-- FIFO pipefs    14 73477636 pipe:[73477636] 1707808,dd,1-w

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-04-05 02:51:02 +09:00
Masatake YAMATO
f54225c449 lsfd: delete __unused__ attribute for an used parameter
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-04-04 21:05:58 +09:00
Masatake YAMATO
618db96498 lsfd: rename DEVNAME column to SOURCE
Reflecting the review comment:

    maybe rename DEVNAME to SOURCE as we have here things like 'devtmpfs' etc.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:54 +02:00
Masatake YAMATO
eb5fc0a0f3 lsfd: remove redundant "nodev:" prefix from DEVNAME column
Reflecting the review comment:

    remove "nodev:" from DEVNAME

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:54 +02:00
Karel Zak
f9fa97d395 lsfd: cleanup new file initialization
Don't use new_<class>() functions if we have already have
file_class callbacks.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-10-06 11:01:54 +02:00
Karel Zak
2d95dc093b lsfd: use 'new_' prefix when we allocate something
It's more readable than rather than 'make_'.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-10-06 11:01:54 +02:00
Masatake YAMATO
63f3938581 lsfd: add MAPLEN column
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
a500de3400 lsfd: introduce DEVNAME column and use it as default
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-10-06 11:01:53 +02:00
Masatake YAMATO
5bced64c66 lsfd: add a stub for fifo type 2021-10-06 11:01:53 +02:00