This is an archive of the discontinued LLVM Phabricator instance.

Add a new interceptors for statvfs1(2) and fstatvfs1(2) from NetBSD
ClosedPublic

Authored by krytarowski on Nov 28 2018, 2:36 PM.

Details

Summary

statvfs1, fstatvfs1 - get file system statistics.

While there, use file descriptor related macros in the fstatvfs interceptor.

Add a dedicated test.

Diff Detail

Event Timeline

krytarowski created this revision.Nov 28 2018, 2:36 PM
vitalybuka added inline comments.
lib/sanitizer_common/sanitizer_common_interceptors.inc
7368

cc @dvyukov
Looks like tsan wants these :

COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
....
if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
krytarowski edited the summary of this revision. (Show Details)
  • apply comment from review
krytarowski marked an inline comment as done.Dec 6 2018, 9:48 PM
  • align style
vitalybuka accepted this revision.Dec 7 2018, 1:39 PM
vitalybuka added inline comments.
lib/sanitizer_common/sanitizer_common_interceptors.inc
4280
test/sanitizer_common/TestCases/NetBSD/statvfs1.cc
46

test_statvfs1
test_fstatvfs1

This revision is now accepted and ready to land.Dec 7 2018, 1:39 PM
krytarowski marked an inline comment as done.Dec 7 2018, 1:47 PM
krytarowski added inline comments.
lib/sanitizer_common/sanitizer_common_interceptors.inc
4280

This looks correct. statvfs/fstatvfs are existing interceptors.

This revision was automatically updated to reflect the committed changes.
vitalybuka added inline comments.Dec 7 2018, 2:09 PM
lib/sanitizer_common/sanitizer_common_interceptors.inc
4280

I see, you just updated similar existing one as well.

krytarowski marked an inline comment as done.Dec 7 2018, 2:28 PM
krytarowski added inline comments.
lib/sanitizer_common/sanitizer_common_interceptors.inc
4280

Yes. It was documented in the description.