| 1 |
.\" Copyright 1994-1995, Daniel Quinlan <[email protected]> |
| 2 |
.\" Copyright 2002-2017, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-3.0-or-later |
| 6 |
.\" |
| 7 |
.TH proc_pid_fdinfo 5 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
/proc/pid/fdinfo/ \- information about file descriptors |
| 10 |
.SH DESCRIPTION |
| 11 |
This is a subdirectory containing one entry for each file which the |
| 12 |
process has open, named by its file descriptor. |
| 13 |
The files in this directory are readable only by the owner of the process. |
| 14 |
The contents of each file can be read to obtain information |
| 15 |
about the corresponding file descriptor. |
| 16 |
The content depends on the type of file referred to by the |
| 17 |
corresponding file descriptor. |
| 18 |
.P |
| 19 |
For regular files and directories, we see something like: |
| 20 |
.P |
| 21 |
.in +4n |
| 22 |
.EX |
| 23 |
.RB "$" " cat /proc/12015/fdinfo/4" |
| 24 |
pos: 1000 |
| 25 |
flags: 01002002 |
| 26 |
mnt_id: 21 |
| 27 |
.EE |
| 28 |
.in |
| 29 |
.P |
| 30 |
The fields are as follows: |
| 31 |
.TP |
| 32 |
.I pos |
| 33 |
This is a decimal number showing the file offset. |
| 34 |
.TP |
| 35 |
.I flags |
| 36 |
This is an octal number that displays the |
| 37 |
file access mode and file status flags (see |
| 38 |
.BR open (2)). |
| 39 |
If the close-on-exec file descriptor flag is set, then |
| 40 |
.I flags |
| 41 |
will also include the value |
| 42 |
.BR O_CLOEXEC . |
| 43 |
.IP |
| 44 |
Before Linux 3.1, |
| 45 |
.\" commit 1117f72ea0217ba0cc19f05adbbd8b9a397f5ab7 |
| 46 |
this field incorrectly displayed the setting of |
| 47 |
.B O_CLOEXEC |
| 48 |
at the time the file was opened, |
| 49 |
rather than the current setting of the close-on-exec flag. |
| 50 |
.TP |
| 51 |
.I mnt_id |
| 52 |
This field, present since Linux 3.15, |
| 53 |
.\" commit 49d063cb353265c3af701bab215ac438ca7df36d |
| 54 |
is the ID of the mount containing this file. |
| 55 |
See the description of |
| 56 |
.IR /proc/ pid /mountinfo . |
| 57 |
.P |
| 58 |
For eventfd file descriptors (see |
| 59 |
.BR eventfd (2)), |
| 60 |
we see (since Linux 3.8) |
| 61 |
.\" commit cbac5542d48127b546a23d816380a7926eee1c25 |
| 62 |
the following fields: |
| 63 |
.P |
| 64 |
.in +4n |
| 65 |
.EX |
| 66 |
pos: 0 |
| 67 |
flags: 02 |
| 68 |
mnt_id: 10 |
| 69 |
eventfd\-count: 40 |
| 70 |
.EE |
| 71 |
.in |
| 72 |
.P |
| 73 |
.I eventfd\-count |
| 74 |
is the current value of the eventfd counter, in hexadecimal. |
| 75 |
.P |
| 76 |
For epoll file descriptors (see |
| 77 |
.BR epoll (7)), |
| 78 |
we see (since Linux 3.8) |
| 79 |
.\" commit 138d22b58696c506799f8de759804083ff9effae |
| 80 |
the following fields: |
| 81 |
.P |
| 82 |
.in +4n |
| 83 |
.EX |
| 84 |
pos: 0 |
| 85 |
flags: 02 |
| 86 |
mnt_id: 10 |
| 87 |
tfd: 9 events: 19 data: 74253d2500000009 |
| 88 |
tfd: 7 events: 19 data: 74253d2500000007 |
| 89 |
.EE |
| 90 |
.in |
| 91 |
.P |
| 92 |
Each of the lines beginning |
| 93 |
.I tfd |
| 94 |
describes one of the file descriptors being monitored via |
| 95 |
the epoll file descriptor (see |
| 96 |
.BR epoll_ctl (2) |
| 97 |
for some details). |
| 98 |
The |
| 99 |
.I tfd |
| 100 |
field is the number of the file descriptor. |
| 101 |
The |
| 102 |
.I events |
| 103 |
field is a hexadecimal mask of the events being monitored for this file |
| 104 |
descriptor. |
| 105 |
The |
| 106 |
.I data |
| 107 |
field is the data value associated with this file descriptor. |
| 108 |
.P |
| 109 |
For signalfd file descriptors (see |
| 110 |
.BR signalfd (2)), |
| 111 |
we see (since Linux 3.8) |
| 112 |
.\" commit 138d22b58696c506799f8de759804083ff9effae |
| 113 |
the following fields: |
| 114 |
.P |
| 115 |
.in +4n |
| 116 |
.EX |
| 117 |
pos: 0 |
| 118 |
flags: 02 |
| 119 |
mnt_id: 10 |
| 120 |
sigmask: 0000000000000006 |
| 121 |
.EE |
| 122 |
.in |
| 123 |
.P |
| 124 |
.I sigmask |
| 125 |
is the hexadecimal mask of signals that are accepted via this |
| 126 |
signalfd file descriptor. |
| 127 |
(In this example, bits 2 and 3 are set, corresponding to the signals |
| 128 |
.B SIGINT |
| 129 |
and |
| 130 |
.BR SIGQUIT ; |
| 131 |
see |
| 132 |
.BR signal (7).) |
| 133 |
.P |
| 134 |
For inotify file descriptors (see |
| 135 |
.BR inotify (7)), |
| 136 |
we see (since Linux 3.8) |
| 137 |
the following fields: |
| 138 |
.P |
| 139 |
.in +4n |
| 140 |
.EX |
| 141 |
pos: 0 |
| 142 |
flags: 00 |
| 143 |
mnt_id: 11 |
| 144 |
inotify wd:2 ino:7ef82a sdev:800001 mask:800afff ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:2af87e00220ffd73 |
| 145 |
inotify wd:1 ino:192627 sdev:800001 mask:800afff ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:27261900802dfd73 |
| 146 |
.EE |
| 147 |
.in |
| 148 |
.P |
| 149 |
Each of the lines beginning with "inotify" displays information about |
| 150 |
one file or directory that is being monitored. |
| 151 |
The fields in this line are as follows: |
| 152 |
.TP |
| 153 |
.I wd |
| 154 |
A watch descriptor number (in decimal). |
| 155 |
.TP |
| 156 |
.I ino |
| 157 |
The inode number of the target file (in hexadecimal). |
| 158 |
.TP |
| 159 |
.I sdev |
| 160 |
The ID of the device where the target file resides (in hexadecimal). |
| 161 |
.TP |
| 162 |
.I mask |
| 163 |
The mask of events being monitored for the target file (in hexadecimal). |
| 164 |
.P |
| 165 |
If the kernel was built with exportfs support, the path to the target |
| 166 |
file is exposed as a file handle, via three hexadecimal fields: |
| 167 |
.IR fhandle\-bytes , |
| 168 |
.IR fhandle\-type , |
| 169 |
and |
| 170 |
.IR f_handle . |
| 171 |
.P |
| 172 |
For fanotify file descriptors (see |
| 173 |
.BR fanotify (7)), |
| 174 |
we see (since Linux 3.8) |
| 175 |
the following fields: |
| 176 |
.P |
| 177 |
.in +4n |
| 178 |
.EX |
| 179 |
pos: 0 |
| 180 |
flags: 02 |
| 181 |
mnt_id: 11 |
| 182 |
fanotify flags:0 event\-flags:88002 |
| 183 |
fanotify ino:19264f sdev:800001 mflags:0 mask:1 ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:4f261900a82dfd73 |
| 184 |
.EE |
| 185 |
.in |
| 186 |
.P |
| 187 |
The fourth line displays information defined when the fanotify group |
| 188 |
was created via |
| 189 |
.BR fanotify_init (2): |
| 190 |
.TP |
| 191 |
.I flags |
| 192 |
The |
| 193 |
.I flags |
| 194 |
argument given to |
| 195 |
.BR fanotify_init (2) |
| 196 |
(expressed in hexadecimal). |
| 197 |
.TP |
| 198 |
.I event\-flags |
| 199 |
The |
| 200 |
.I event_f_flags |
| 201 |
argument given to |
| 202 |
.BR fanotify_init (2) |
| 203 |
(expressed in hexadecimal). |
| 204 |
.P |
| 205 |
Each additional line shown in the file contains information |
| 206 |
about one of the marks in the fanotify group. |
| 207 |
Most of these fields are as for inotify, except: |
| 208 |
.TP |
| 209 |
.I mflags |
| 210 |
The flags associated with the mark |
| 211 |
(expressed in hexadecimal). |
| 212 |
.TP |
| 213 |
.I mask |
| 214 |
The events mask for this mark |
| 215 |
(expressed in hexadecimal). |
| 216 |
.TP |
| 217 |
.I ignored_mask |
| 218 |
The mask of events that are ignored for this mark |
| 219 |
(expressed in hexadecimal). |
| 220 |
.P |
| 221 |
For details on these fields, see |
| 222 |
.BR fanotify_mark (2). |
| 223 |
.P |
| 224 |
For timerfd file descriptors (see |
| 225 |
.BR timerfd (2)), |
| 226 |
we see (since Linux 3.17) |
| 227 |
.\" commit af9c4957cf212ad9cf0bee34c95cb11de5426e85 |
| 228 |
the following fields: |
| 229 |
.P |
| 230 |
.in +4n |
| 231 |
.EX |
| 232 |
pos: 0 |
| 233 |
flags: 02004002 |
| 234 |
mnt_id: 13 |
| 235 |
clockid: 0 |
| 236 |
ticks: 0 |
| 237 |
settime flags: 03 |
| 238 |
it_value: (7695568592, 640020877) |
| 239 |
it_interval: (0, 0) |
| 240 |
.EE |
| 241 |
.in |
| 242 |
.TP |
| 243 |
.I clockid |
| 244 |
This is the numeric value of the clock ID |
| 245 |
(corresponding to one of the |
| 246 |
.B CLOCK_* |
| 247 |
constants defined via |
| 248 |
.IR <time.h> ) |
| 249 |
that is used to mark the progress of the timer (in this example, 0 is |
| 250 |
.BR CLOCK_REALTIME ). |
| 251 |
.TP |
| 252 |
.I ticks |
| 253 |
This is the number of timer expirations that have occurred, |
| 254 |
(i.e., the value that |
| 255 |
.BR read (2) |
| 256 |
on it would return). |
| 257 |
.TP |
| 258 |
.I settime flags |
| 259 |
This field lists the flags with which the timerfd was last armed (see |
| 260 |
.BR timerfd_settime (2)), |
| 261 |
in octal |
| 262 |
(in this example, both |
| 263 |
.B TFD_TIMER_ABSTIME |
| 264 |
and |
| 265 |
.B TFD_TIMER_CANCEL_ON_SET |
| 266 |
are set). |
| 267 |
.TP |
| 268 |
.I it_value |
| 269 |
This field contains the amount of time until the timer will next expire, |
| 270 |
expressed in seconds and nanoseconds. |
| 271 |
This is always expressed as a relative value, |
| 272 |
regardless of whether the timer was created using the |
| 273 |
.B TFD_TIMER_ABSTIME |
| 274 |
flag. |
| 275 |
.TP |
| 276 |
.I it_interval |
| 277 |
This field contains the interval of the timer, |
| 278 |
in seconds and nanoseconds. |
| 279 |
(The |
| 280 |
.I it_value |
| 281 |
and |
| 282 |
.I it_interval |
| 283 |
fields contain the values that |
| 284 |
.BR timerfd_gettime (2) |
| 285 |
on this file descriptor would return.) |
| 286 |
.SH HISTORY |
| 287 |
Linux 2.6.22. |
| 288 |
.SH SEE ALSO |
| 289 |
.BR proc (5) |