...
Some platforms may forbid a file simultaneously being opened multiple times, but other platforms may allow it. Therefore, portable code cannot depend on what will happen if this rule is violated.
Opening an already-opened file might open a different file. For more information, see FIO45-C. Avoid TOCTOU race conditions while accessing files.
Noncompliant Code Example
...
Because the file log is opened twice simultaneously this program has has implementation-defined behavior. On On a Linux machine running GCC 4.3.2, for example, this program produces
...