[compiler-rt] [netbsd] Add support for versioned statvfs interceptors
authorKamil Rytarowski <n54@gmx.com>
Fri, 27 Dec 2019 00:12:44 +0000 (01:12 +0100)
committerKamil Rytarowski <n54@gmx.com>
Fri, 27 Dec 2019 00:15:39 +0000 (01:15 +0100)
commit78f714f824fac8aa3fdd85908c41538bccefb959
tree28f58286163d1f235691d456e15ab6ae1a96b8ae
parent1584e2f9870fb95169cd4ea7aedc05bfabe28cf6
[compiler-rt] [netbsd] Add support for versioned statvfs interceptors

Summary:
Add support for NetBSD 9.0 and newer versions of interceptors
operating on struct statvfs: fstatvfs, fstatvfs1, getmntinfo,
getvfsstat, statvfs, statvfs1.

The default promoted interceptors are for NetBSD 9.99.26. Older
ones (currently 9.0) are kept in a new NetBSD specific file:
/sanitizer_common_interceptors_netbsd_compat.inc. This file
defines compat interceptors and mangles `INIT_*` macros,
concatenating the current interceptors and the compat ones.
This redefinition is not elegant, but it avoids preprocessor madness.

Define struct_statvfs90_sz for the compat purposes.

Reviewers: mgorny, kcc, vitalybuka, joerg

Reviewed By: mgorny

Subscribers: dberris, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D71700
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_netbsd_compat.inc [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h