lkml.org 
[lkml]   [2008]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: file offset corruption on 32-bit machines?
From
Date
>What is the difference between doing:
>
>threadA: seek(positionA)
>threadB: seel(positionB)
>threadA: write
>threadB: write
>
>versus
>
>threadA: seek(posisionA) but only set half the 64bits
>threadB: seek(positionB) set all 64bits
>threadA: complete seek operation setting the other half of the bits
>threadA: write
>threadB: write
>
>either way you end up writing to the wrong file location

Only if you make an assumption about what this program considers the right
location. One difference is that in the first case, data gets written
only at a place to which the program seeked, while in the second, it gets
written to a totally illogical place. Another is that in the first, the
data gets written as specified in standards and in the second, it doesn't.
I can imagine a program that would be satisfied with the first and not
the second, and for such a program, I cannot use the word "incorrect" or
"broken" or say the programmer doesn't understand shared resources.

--
Bryan Henderson IBM Almaden Research Center
San Jose CA Filesystems



\
 
 \ /
  Last update: 2008-04-11 23:31    [W:0.054 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site