On Wednesday, August 07, 2013 02:23:38 AM Jiří Zárevúcky wrote:
> On 7 August 2013 02:08, Jakub Klama <[email protected]> wrote:
> > On Wed, 07 Aug 2013 01:40:35 +0200, Jiří Zárevúcky wrote:
> >> 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?
> > 
> > dup2() is widely used as simple stdin/stdout redirection. Following code
> > redirects standard output to file "output.txt" by replacing stdout
> 
> > descriptor with newly opened descriptor:
> Please refer to the last paragraph of my original post.

Sharing the file offset between two file descriptors is crucial for POSIX 
shell output redirection semantics when two streams are redirected to the same 
file. Otherwise the data from one stream could be overwritten by the data from 
the other stream due to offset mismatch.
Also I'm not saying that keeping this behavior in HelenOS is important, just 
saying how it's done in POSIX.

Cheers,
Zbigniew


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

Reply via email to