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 · المسرد
Computer Science · المسرد
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.