Skip to content

proc: Add pos and mnt_id fields to /proc/[pid]/fdinfo/[fd]#12859

Merged
copybara-service[bot] merged 2 commits intomasterfrom
test/cl893667695
Apr 6, 2026
Merged

proc: Add pos and mnt_id fields to /proc/[pid]/fdinfo/[fd]#12859
copybara-service[bot] merged 2 commits intomasterfrom
test/cl893667695

Conversation

@copybara-service
Copy link
Copy Markdown

proc: Add pos and mnt_id fields to /proc/[pid]/fdinfo/[fd]

Currently gVisor only outputs the flags field in fdinfo, which causes the Python library psutil to fail with IndexError when parsing fdinfo, as they expect pos to be the first line.

Add the typical base fields pos and mnt_id.

  • pos: via Seek(ctx, 0, SEEK_CUR), defaults to 0 for non-seekable fds
  • mnt_id: from file.Mount().ID

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12819 from tanyifeng:proc-fdinfo-pos-mntid d238786

Currently gVisor only outputs the flags field in fdinfo,
which causes the Python library psutil to fail with IndexError
when parsing fdinfo, as they expect pos to be the first line.

Add the typical base fields pos and mnt_id.
- pos: via Seek(ctx, 0, SEEK_CUR), defaults to 0 for non-seekable fds
- mnt_id: from file.Mount().ID

Signed-off-by: Tan Yifeng <yiftan@tencent.com>
@copybara-service copybara-service Bot added the exported Issue was exported automatically label Apr 2, 2026
@copybara-service copybara-service Bot force-pushed the test/cl893667695 branch 2 times, most recently from b612921 to c2f43cd Compare April 6, 2026 23:18
@copybara-service copybara-service Bot merged commit 5059323 into master Apr 6, 2026
0 of 2 checks passed
@copybara-service copybara-service Bot deleted the test/cl893667695 branch April 6, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants