On 14/06/15 02:55, Rich Salz via RT wrote:
> One possiblity is open in exclusive mode. The problem is that O_EXCL is only
> part of open(2), not fopen(3). And we have to use fopen() because we need the
> "b" mode for binary output on platforms that require it. So I don't think that
> will work, either.

Do those platforms not have fdopen(3) with the same "b" semantics?

I note fdopen(3) is a POSIX thing, and "b" has no effect on POSIX
systems, so perhaps not. Worth a look though?

Failing that, you could fstat(3) the 2 open files and compare their
st_ino and st_dev fields for equality before writing anything to either
of them.

-- 
Aaron Jones


_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to