Rework TTY column

* Rename internal identifier from TTY_NR to just TTY
* Unify column header on platforms
* Use devname(3) on BSD derivate to show the actual terminal,
  simplifies current FreeBSD implementation.
* Use 'unsigned long int' as id type, to fit dev_t on Linux.

Only on Solaris the terminal path is not yet resolved.
This commit is contained in:
Christian Göttsche
2021-03-21 19:40:56 +01:00
committed by cgzones
parent 36880cd61c
commit 9a8221568a
19 changed files with 76 additions and 147 deletions

View File

@ -28,7 +28,7 @@ typedef enum ProcessField_ {
PPID = 4,
PGRP = 5,
SESSION = 6,
TTY_NR = 7,
TTY = 7,
TPGID = 8,
MINFLT = 10,
MAJFLT = 12,
@ -84,11 +84,11 @@ typedef struct Process_ {
/* Foreground group identifier of the controlling terminal */
int tpgid;
/*
* Controlling terminal of the process.
* The minor device number is contained in the combination of bits 31 to 20 and 7 to 0; the major device number is in bits 15 to 8.
* */
unsigned int tty_nr;
/* Controlling terminal identifier of the process */
unsigned long int tty_nr;
/* Controlling terminal name of the process */
char* tty_name;
/* User identifier */
uid_t st_uid;