Messages in this thread | | | From | Amon Ott <> | Subject | Re: Linux kernel file offset pointer races | Date | Sat, 7 Aug 2004 18:02:09 +0200 |
| |
On Samstag, 7. August 2004 15:18, viro@parcelfarce.linux.theplanet.co.uk wrote: > On Sat, Aug 07, 2004 at 02:38:12PM +0200, Amon Ott wrote: > > Would it not be useful to have per-process or per-thread offsets? Do > > parallel processes really need to share the offset? > > > > E.g., the struct file could (optionally) be copied on fork with > > copy-on-write to avoid extra memory consumption. > > (cat a; cat b) > /tmp/foo
Right, the process running (...) would not know what offset to give "cat b" as a start, because it cannot see "cat a"'s final offset. It could seek to the end of /tmp/foo before starting "cat b", but this requirement would break existing shells. Bad luck.
As there are probably more examples why it does not work, there will probably have to be a macro for all offset changes, which checks for overruns.
Amon. -- http://www.rsbac.org - GnuPG: 2048g/5DEAAA30 2002-10-22 [unhandled content-type:application/pgp-signature] | |