[PATCH] D48250: [sanitizer_common] Use O_TRUNC for WrOnly access mode.

Rainer Orth via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 25 05:06:05 PDT 2018


Fāng-ruì Sòng <maskray at google.com> writes:

>>It took me quite some time building current trunk due to various new
>>problems...
>>
>>The OpenFile signature changed in r232936:
>>
>>http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150323/267202.html
>>
>>The Solaris Sanitizer port started in the GCC tree quite some time ago,
>>and obviously I missed adapting the OpenFile implementation in
>>sanitizer_solaris.cc to the changed signature when forward-porting to
>>the LLVM tree.  AFAICS the sanitizer_posix.cc implementation is
>>perfectly fine even for Solaris, so the old one can just go.
>>
>>I'll prepare a patch.
>
> Nice to learn sanitizer_solaris.cc can be merged into sanitizer_posix.cc

Not at all: just this single function can go from sanitizer_solaris.cc.
The rest most certainly has to stay: the syscall interface in Solaris
isn't stable and can (and does!) change even inside a single OS release:
it's just an implementation detail; the only stable interface to system
calls is libc.

> Also bring to your attention that
>
> #if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
>    SANITIZER_OPENBSD || SANITIZER_SOLARIS
>
> in sanitizer_linux.cc looks strange :)

Yes and no: sanitizer_linux.cc (like many of the *linux* files) is a
misnomer: it is for a large part more something like sanitizer_unix.cc,
but nobody cared to rename the affected files to reflect reality (and
maybe split off those parts that are realy Linux-specific).


More information about the llvm-commits mailing list