File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5605,6 +5605,9 @@ Supplement Regenerated the 4.04 distribution to correct a non-
56055605
56065606 [linux] Do not embed kernel version in CFLAGS (#314)
56075607
5608+ [linux] Linux 6.9 changed the pidfs appearence in procfs. Try
5609+ to maintain original output in lsof (#317)
5610+
56085611
56095612Vic Abell <abe@purdue.edu>
56105613July 14, 2018
Original file line number Diff line number Diff line change @@ -1273,6 +1273,10 @@ static int process_id(struct lsof_context *ctx, /* context */
12731273#endif /* defined(HASEPTOPTS) */
12741274 if (rest && rest [0 ] == '[' && rest [1 ] == 'p' )
12751275 fdinfo_mask |= FDINFO_PID ;
1276+ else if (Lf -> ntype == N_REGLR && rest && * rest && strcmp (pbuf , "pidfd" ) == 0 ) {
1277+ // https://github.com/lsof-org/lsof/issues/317
1278+ fdinfo_mask |= FDINFO_PID ;
1279+ }
12761280
12771281 if ((av = get_fdinfo (ctx , pathi , fdinfo_mask , & fi )) &
12781282 FDINFO_POS ) {
@@ -1338,6 +1342,15 @@ static int process_id(struct lsof_context *ctx, /* context */
13381342 Lf - > sf |= SELPTYINFO ;
13391343 }
13401344#endif /* defined(HASEPTOPTS) && defined(HASPTYEPT) */
1345+ else if (Lf -> ntype == N_REGLR && rest && * rest && Lf -> nm &&
1346+ strcmp (Lf -> nm , "pidfd ") == 0 ) {
1347+ // https://github.com/lsof-org/lsof/issues/317
1348+ // pidfd since Linux 6.9 becomes a regular file:
1349+ // /proc/PID/fd/FD -> pidfd:[INODE]
1350+ (void )snpf (rest , sizeof (pbuf ) - (rest - pbuf ),
1351+ "[pidfd :%d ]", fi .pid );
1352+ enter_nm (ctx , rest );
1353+ }
13411354
13421355 if (Lf -> sf )
13431356 link_lfile (ctx );
You can’t perform that action at this time.
0 commit comments