215
submitted 18 hours ago by cm0002@europe.pub to c/linux@programming.dev
you are viewing a single comment's thread
view the rest of the comments
[-] korthrun@piefed.social 6 points 15 hours ago* (last edited 15 hours 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

this post was submitted on 20 Aug 2026
215 points (100.0% liked)

Linux

14739 readers
401 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 3 years ago
MODERATORS