This is an archive of the discontinued LLVM Phabricator instance.

[libc] Implement strnlen.
ClosedPublic

Authored by cgyurgyik on Jul 21 2020, 9:46 AM.

Details

Summary

Implementation for strnlen using memchr, with corresponding unit tests.

Diff Detail

Event Timeline

cgyurgyik created this revision.Jul 21 2020, 9:46 AM

Can you also add the entries in config/spec/posix.td and config/linux/api.td files?

libc/src/string/strnlen.h
1

Clang format messed it up this way. Also in the .cpp fle.

cgyurgyik updated this revision to Diff 279658.Jul 21 2020, 4:20 PM
cgyurgyik updated this revision to Diff 279665.Jul 21 2020, 4:46 PM

Can you also add the entries in config/spec/posix.td and config/linux/api.td files?

Added, PTAL for correctness.

sivachandra accepted this revision.Jul 22 2020, 12:55 PM

Please check if integration tests are OK (you need to run them without ASAN.) So, OK to land if integration tests are OK.

This revision is now accepted and ready to land.Jul 22 2020, 12:55 PM
This revision was automatically updated to reflect the committed changes.