Let's say we have a pipe, my_pipe
, which occupies file descriptors at entries 3 and 4 of the process's FDT (initial FDT scheme)
- First, we close the stdout standard output stream using
close(1)
(updated FDT scheme). - Next, using
dup(my_pipe[1])
, we create a copy of the pipe's writing end file descriptor at the lowest available FDT entry - in our case entry 1, which was made available in the previous step.
my_pipe[1]
is now referred to by both entry 1 and entry 4 (updated FDT scheme). - The following command we run is
close(my_pipe[1])
.
My question is - which of the file descriptors referring to my_pipe[1]
will close?