So? You tell me what the pros and cons are. Sure it can be done this way but what would the idea be? You are proposing some scheme here, but you need some motivation for it to make any sense.
You do realize that file descriptor table are local to processes in the first place? A process is able to change its file descriptor table it any way it wants using dup2, close and open (to access new file descriptions). File descriptors 0 to INT_MAX (OPEN_MAX, actually) are already local to the current process.
Edit: I also sense some confusion about the difference between file descriptors, file descriptions and the actual files themselves. I don't think you understand this subject at all, actually. Go study some existing implementation!
Edit (again): Also what would happen is that most programs you port will explode because you broke the official semantics of fork and change the file descriptor of stdout.
|