Duplicating a descriptor makes a second descriptor point to the same open file description: dup(fd) uses the lowest free number, and dup2(fd, target) uses target, closing first whatever it pointed to.
Computer Science · Glossaire
Computer Science · Glossaire
Duplicating a descriptor makes a second descriptor point to the same open file description: dup(fd) uses the lowest free number, and dup2(fd, target) uses target, closing first whatever it pointed to.