[snip] In the Borland case I confirmed this by
printing the location pointers, and is obviously fixable, but I couldn't
find any information on what might cause the errno() routine to return
different locations for the same thread depending on whether the call
was inside or outside of the dll.

Were you compiling both with the same RTL option(s)? I vaguely remember
finding some issue like that from my Borland days.