Return file descriptor value

Hi
I have wrote one program that listens on one port and responds to client.
for this, I have used "socket" API. I do not know why, first returned value of file descriptor from "socket" function is always "3"!!
and all created file descriptors since then are sequential!!(.ex 4 or 6 or etc)
I am curious about numbering of file descriptor in Linux kernel.

Thanks in advance
If I remember correctly, usually,

stdin is 0
stdout is 1
stderr is 2

therefore, the one you create will usually start at 3
Thanks a lot for your quick reply.
Topic archived. No new replies allowed.