This is an archive of the discontinued LLVM Phabricator instance.

Add new interceptors: getnetent(3) family
ClosedPublic

Authored by krytarowski on Feb 20 2018, 7:30 PM.

Details

Summary

getnetent, getnetbyaddr, getnetbyname - get network entry

Reuse them on NetBSD.

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Feb 20 2018, 7:30 PM
vitalybuka added inline comments.Feb 25 2018, 2:39 PM
lib/sanitizer_common/sanitizer_common_interceptors.inc
6973

Combine declaration and initialization

6981

for (char **nn = n->n_aliases; *nn, ++nn) {
}

6982

you can remove
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, nn, sizeof(char **));
and count nn
and WRITE_RANGE after the loop

6995

You need READ_RANGE for "name"

7032

Don't install empty interceptors

7284

I'd remove GET from here and the test name

test/sanitizer_common/TestCases/NetBSD/getnetent.cc
16

remove exit(1)

18

combine declaration and initialization

96

Could you please add test name into printf and check it here.
It will help to debug failures

This revision now requires changes to proceed.Feb 25 2018, 2:43 PM
  • apply part of the comments from review
  • apply patches from review
krytarowski edited the summary of this revision. (Show Details)Feb 26 2018, 5:54 AM
vitalybuka accepted this revision.Feb 26 2018, 9:54 AM
vitalybuka added inline comments.
test/sanitizer_common/TestCases/NetBSD/getnetent.cc
96

you missed this one

Could you please add test name into printf and check it here. It will help to debug failures

This revision is now accepted and ready to land.Feb 26 2018, 9:54 AM
This revision was automatically updated to reflect the committed changes.