lsfd: add columns for SIZE
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This commit is contained in:
parent
61fe735065
commit
bec8c27141
3 changed files with 7 additions and 0 deletions
|
@ -136,6 +136,9 @@ static bool file_fill_column(struct proc *proc,
|
|||
case COL_UID:
|
||||
xasprintf(&str, "%d", (int)file->stat.st_uid);
|
||||
break;
|
||||
case COL_SIZE:
|
||||
xasprintf(&str, "%ju", file->stat.st_size);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
};
|
||||
|
|
|
@ -94,6 +94,8 @@ static struct colinfo infos[] = {
|
|||
N_("PID of the process opening the file") },
|
||||
[COL_RDEV] = { "RDEV", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING,
|
||||
N_("device ID (if special file)") },
|
||||
[COL_SIZE] = { "SIZE", 4, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER,
|
||||
N_("file size"), },
|
||||
[COL_TYPE] = { "TYPE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING,
|
||||
N_("file type") },
|
||||
[COL_UID] = { "UID", 0, SCOLS_FL_RIGHT, SCOLS_JSON_NUMBER,
|
||||
|
@ -111,6 +113,7 @@ static int default_columns[] = {
|
|||
COL_ASSOC,
|
||||
COL_TYPE,
|
||||
COL_DEVICE,
|
||||
COL_SIZE,
|
||||
COL_INODE,
|
||||
COL_NAME,
|
||||
};
|
||||
|
|
|
@ -60,6 +60,7 @@ enum {
|
|||
COL_NAME,
|
||||
COL_PID,
|
||||
COL_RDEV,
|
||||
COL_SIZE,
|
||||
COL_TYPE,
|
||||
COL_UID,
|
||||
COL_USER,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue