Reads and writes may be intermixed on read/write streams in any order.
Note that ANSI C requires that a file positioning function intervene
between output and input, unless an input operation encounters end‐of‐
file. (If this condition is not met, then a read is allowed to return
the result of writes other than the most recent.) Therefore it is good
practice (and indeed sometimes necessary under Linux) to put an fseek
or fgetpos operation between write and read operations on such a
stream. This operation may be an apparent no‐op (as in fseek(..., 0L,
SEEK_CUR) called for its synchronizing side effect.