diff --git a/misc-utils/lsfd-file.c b/misc-utils/lsfd-file.c index b9c77d887..dc19b8754 100644 --- a/misc-utils/lsfd-file.c +++ b/misc-utils/lsfd-file.c @@ -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; }; diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index b245113cd..c53082aed 100644 --- a/misc-utils/lsfd.c +++ b/misc-utils/lsfd.c @@ -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, }; diff --git a/misc-utils/lsfd.h b/misc-utils/lsfd.h index 69996614c..c156297a1 100644 --- a/misc-utils/lsfd.h +++ b/misc-utils/lsfd.h @@ -60,6 +60,7 @@ enum { COL_NAME, COL_PID, COL_RDEV, + COL_SIZE, COL_TYPE, COL_UID, COL_USER,