This is an archive of the discontinued LLVM Phabricator instance.

[libc][For demonstration only] Refactor how errno is accessed in libc interal code.
Needs ReviewPublic

Authored by sivachandra on Feb 22 2023, 12:19 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Internal code should read/set errno using the new macro libc_errno
introduced by this change. When building for tests, this macro resolves
to an internal libc only errno variable. Which means, libc tests
will not affect the global errno value (the errno of the libc to which
the tests are linked to.)

Not all tests are clean but one should be able to build the libc after
this change.

Diff Detail

Event Timeline

sivachandra created this revision.Feb 22 2023, 12:19 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 22 2023, 12:19 PM
sivachandra requested review of this revision.Feb 22 2023, 12:19 PM
libc/src/errno/libc_errno.cpp