Shouldn't the standard input for different process unique? If so, shouldn't the path of the stdin file be like /dev/pid/stdin
instead of a global /dev/stdin
?
Does anyone have ideas about this?
Shouldn't the standard input for different process unique? If so, shouldn't the path of the stdin file be like /dev/pid/stdin
instead of a global /dev/stdin
?
Does anyone have ideas about this?
/dev/stdin
is unique because/proc/self/fd/0
/proc/self
is a symbolic link only seen by your running process to its process-idThe
/proc
filesystem is a virtual (not real) filesystem which has the ability to show a different view to each process.Further reading: