Using this answer https://unix.stackexchange.com/a/283521/114939 which allow us to find processes that keep an given pty opened without login (who command cannot show them), caused me to ask the inverse.How to get the opened pty(s) for a given process in AIX systems ? (for those launched in background and not attached to a terminal/pty login).
How to get the opened pty for a given background process (without login) in AIX
terminal;aix;background process;pty
AIX has a /proc filesystem (since about 5.1?) and you can list the open file descriptors for a pid with procfiles:$ procfiles -n 1550215502 : /home/guest/test   Current rlimit: 2000 file descriptors                                    0: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1  O_RDONLY   1: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1  O_RDONLY   2: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1  O_RDONLY   3: S_IFREG mode:0644 dev:10,7  ino:26 uid:100 gid:100 rdev:0,0         O_RDONLY size:0  name:/tmp/fooFor open devices like a pty only the inode and major/minor numbers are given, but you should be able to easily match these with those shown by a simple ls -l /dev/pts/.You can also install the AIX Toolbox for Linux Applications and then use the lsof command.