Why would anyone use the unix/linux dup function?
I know that dup2 is useful but I'm confused about why someone use a function that seems to just return another number for the same job.
Why do we care if the file descriptor is the smallest available? We will store the value in a variable anyway. It seems like it might aswell be any int value.