]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsfd: fill ENDPOINTS column for pty devices
authorMasatake YAMATO <yamato@redhat.com>
Wed, 1 Nov 2023 17:47:35 +0000 (02:47 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Sat, 4 Nov 2023 08:03:05 +0000 (17:03 +0900)
commit52e94d61b09a05f7ee5ef0dddf75e9c69b3f0368
tree2d8a86b883cf27a6b02e2fc00218c8da868ab5f8
parent036a12d4888289579f324e32ebffd94c2827a506
lsfd: fill ENDPOINTS column for pty devices

An example output:

  $ ./lsfd -o+ENDPOINTS -Q '(COMMAND =~ "tmux") and ((SOURCE == "ptmx") or (SOURCE =~ "pts:.*"))'
  COMMAND          PID   USER ASSOC  XMODE TYPE SOURCE MNTID INODE NAME         ENDPOINTS
  tmux: client 3717086 yamato     0 rw----  CHR  pts:9    27    12 /dev/pts/9   2143274,xfce4-terminal,34rw
  tmux: client 3717086 yamato     1 rw----  CHR  pts:9    27    12 /dev/pts/9   2143274,xfce4-terminal,34rw
  tmux: client 3717086 yamato     2 rw----  CHR  pts:9    27    12 /dev/pts/9   2143274,xfce4-terminal,34rw
  tmux: server 3717088 yamato     5 rw---m  CHR  pts:9    27    12 /dev/pts/9   2143274,xfce4-terminal,34rw
  tmux: server 3717088 yamato     8 rw---m  CHR   ptmx    24   208 tty-index=16 3717089,zsh,0rw
                                                                                3717089,zsh,1rw
                                                                                3717089,zsh,2rw
                                                                                3717089,zsh,10rw

  $ ./lsfd -o+ENDPOINTS -Q '(PID == 3717089) and (FD == 0)'
  COMMAND     PID   USER ASSOC  XMODE TYPE SOURCE MNTID INODE NAME        ENDPOINTS
  zsh     3717089 yamato     0 rw----  CHR pts:16    27    19 /dev/pts/16 3717088,tmux: server,8rw

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