1 .\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2 .\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
5 .\" SPDX-License-Identifier: GPL-3.0-or-later
7 .TH proc_pid_fdinfo 5 (date) "Linux man-pages (unreleased)"
9 /proc/pid/fdinfo/ \- information about file descriptors
12 .IR /proc/ pid /fdinfo/ " (since Linux 2.6.22)"
13 This is a subdirectory containing one entry for each file which the
14 process has open, named by its file descriptor.
15 The files in this directory are readable only by the owner of the process.
16 The contents of each file can be read to obtain information
17 about the corresponding file descriptor.
18 The content depends on the type of file referred to by the
19 corresponding file descriptor.
21 For regular files and directories, we see something like:
25 .RB "$" " cat /proc/12015/fdinfo/4"
32 The fields are as follows:
36 This is a decimal number showing the file offset.
39 This is an octal number that displays the
40 file access mode and file status flags (see
42 If the close-on-exec file descriptor flag is set, then
44 will also include the value
48 .\" commit 1117f72ea0217ba0cc19f05adbbd8b9a397f5ab7
49 this field incorrectly displayed the setting of
51 at the time the file was opened,
52 rather than the current setting of the close-on-exec flag.
56 This field, present since Linux 3.15,
57 .\" commit 49d063cb353265c3af701bab215ac438ca7df36d
58 is the ID of the mount containing this file.
59 See the description of
60 .IR /proc/ pid /mountinfo .
63 For eventfd file descriptors (see
65 we see (since Linux 3.8)
66 .\" commit cbac5542d48127b546a23d816380a7926eee1c25
79 is the current value of the eventfd counter, in hexadecimal.
81 For epoll file descriptors (see
83 we see (since Linux 3.8)
84 .\" commit 138d22b58696c506799f8de759804083ff9effae
92 tfd: 9 events: 19 data: 74253d2500000009
93 tfd: 7 events: 19 data: 74253d2500000007
97 Each of the lines beginning
99 describes one of the file descriptors being monitored via
100 the epoll file descriptor (see
105 field is the number of the file descriptor.
108 field is a hexadecimal mask of the events being monitored for this file
112 field is the data value associated with this file descriptor.
114 For signalfd file descriptors (see
116 we see (since Linux 3.8)
117 .\" commit 138d22b58696c506799f8de759804083ff9effae
118 the following fields:
125 sigmask: 0000000000000006
130 is the hexadecimal mask of signals that are accepted via this
131 signalfd file descriptor.
132 (In this example, bits 2 and 3 are set, corresponding to the signals
139 For inotify file descriptors (see
141 we see (since Linux 3.8)
142 the following fields:
149 inotify wd:2 ino:7ef82a sdev:800001 mask:800afff ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:2af87e00220ffd73
150 inotify wd:1 ino:192627 sdev:800001 mask:800afff ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:27261900802dfd73
154 Each of the lines beginning with "inotify" displays information about
155 one file or directory that is being monitored.
156 The fields in this line are as follows:
160 A watch descriptor number (in decimal).
163 The inode number of the target file (in hexadecimal).
166 The ID of the device where the target file resides (in hexadecimal).
169 The mask of events being monitored for the target file (in hexadecimal).
172 If the kernel was built with exportfs support, the path to the target
173 file is exposed as a file handle, via three hexadecimal fields:
179 For fanotify file descriptors (see
181 we see (since Linux 3.8)
182 the following fields:
189 fanotify flags:0 event\-flags:88002
190 fanotify ino:19264f sdev:800001 mflags:0 mask:1 ignored_mask:0 fhandle\-bytes:8 fhandle\-type:1 f_handle:4f261900a82dfd73
194 The fourth line displays information defined when the fanotify group
196 .BR fanotify_init (2):
203 .BR fanotify_init (2)
204 (expressed in hexadecimal).
210 .BR fanotify_init (2)
211 (expressed in hexadecimal).
214 Each additional line shown in the file contains information
215 about one of the marks in the fanotify group.
216 Most of these fields are as for inotify, except:
220 The flags associated with the mark
221 (expressed in hexadecimal).
224 The events mask for this mark
225 (expressed in hexadecimal).
228 The mask of events that are ignored for this mark
229 (expressed in hexadecimal).
232 For details on these fields, see
233 .BR fanotify_mark (2).
235 For timerfd file descriptors (see
237 we see (since Linux 3.17)
238 .\" commit af9c4957cf212ad9cf0bee34c95cb11de5426e85
239 the following fields:
249 it_value: (7695568592, 640020877)
256 This is the numeric value of the clock ID
257 (corresponding to one of the
259 constants defined via
261 that is used to mark the progress of the timer (in this example, 0 is
262 .BR CLOCK_REALTIME ).
265 This is the number of timer expirations that have occurred,
266 (i.e., the value that
271 This field lists the flags with which the timerfd was last armed (see
272 .BR timerfd_settime (2)),
274 (in this example, both
277 .B TFD_TIMER_CANCEL_ON_SET
281 This field contains the amount of time until the timer will next expire,
282 expressed in seconds and nanoseconds.
283 This is always expressed as a relative value,
284 regardless of whether the timer was created using the
289 This field contains the interval of the timer,
290 in seconds and nanoseconds.
295 fields contain the values that
296 .BR timerfd_gettime (2)
297 on this file descriptor would return.)