We've been discussing this, and I think we're doing this the wrong way. Could you help me a little understand this?
In particular, what is the purpose of unpoisoning file? Is it in order to account for stdio functions being implemented inline or as macros, and therefore user code accessing internal FILE members? Or is there some other use case for this?
If only the former, then I think there is no purpose in definining __sanitizer_FILE on NetBSD, as we support only reentrant interfaces which are all implemented as libc routine calls.
If we understand it correctly, unpoision FILE would be only for inlined routines accessing FILE buffer(s) directly. On NetBSD we enforce _REENTRANT for all sanitizers in order to support only _REENTRANT variations of calls that go through libc calls.
There is however an exception with *_unlocked functions that are still inlined (putc_unlocked(), getc_unlocked(),...) and probably for them we still want to keep SANITIZER_HAS_STRUCT_FILE=1. Such interfaces are niche but still used according to https://codesearch.debian.net/
Please help to make it clearer.