Hi again.
Here is a question about the dup2() function. The POSIX understanding
is that the new file descriptor is just another number for the same
open file description. That means, among other things, that the new
descriptor uses the same position indicator, same locks, same
everything.

The thing is, I never figured out any reason this would be even
remotely useful. On the other hand, not supporting this kind of
sharing allows to make certain simplifications in the code. You could
also move dealing with position from the server to client (I did that
in my original VFS2 branch).

So I'd like a second (or third, or fourth, ...) opinion.
1) Have you ever seen this feature used practically in a POSIX program?
2) Can you think of anything (plausibly useful) that cannot easily be
done without this feature?

If not,
3) Would it be ok to make dup2() simply copy the descriptor?

So as not to get anyone confused, I stress that I want opinions on the
*sharing* part of the function. I am not asking about creating a new
file descriptor for a file, which is in itself quite useful.

-- Jirka Z.

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to