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 &1 or exec 5< ./some_file.txt



I believe that there is now LLM generated code in the Linux kernel, so BSD is probably going to be where this path leads you. Solaris or AIX maybe ;p