you are viewing a single comment's thread
view the rest of the comments
[–] 7 points 3 months ago*

The 3 seems to just be an incrementing number for each file opened by the process.

FWIW: https://en.wikipedia.org/wiki/File_descriptor#file_descriptor_table

If you throw an strace on a process that interacts with the filesystem you'll see that stuff like open() returns a file descriptor and stuff like read() takes a file descriptor as an argument.

These are also generally the numbers you're using when you do I/O redirection in your shell with stuff like 2>&1 or exec 5< ./some_file.txt

  • source
  • parent