This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add signal
ClosedPublic

Authored by abrachet on Mar 20 2020, 5:20 PM.

Details

Summary

This patch adds a Linux implementation for signal
It also fixes ASSERT|EXPECT_THAT macros

Diff Detail

Event Timeline

abrachet created this revision.Mar 20 2020, 5:20 PM
sivachandra accepted this revision.Mar 21 2020, 10:52 PM

OK with one naming fix suggested inline.

libc/spec/stdc.td
19

Neither POSIX nor std C prescribe it. Is it present merely as a convenience or because there is no way to describe function types using tablegen? Either way, I think this is OK. But to avoid name pollution, we should name this type with __ prefix.

libc/src/signal/linux/signal.cpp
22

Add a note that sigaction sets the errno value on error?

This revision is now accepted and ready to land.Mar 21 2020, 10:52 PM
abrachet updated this revision to Diff 251878.Mar 22 2020, 12:00 AM

Rename sighandler_t to __sighandler_t. Internally called __llvm_libc::sighandler_t (we could put it in global scope in internal headers or not use it all)

abrachet marked 3 inline comments as done.Mar 22 2020, 12:01 AM
abrachet added inline comments.
libc/spec/stdc.td
19

Will you take another look to make sure its ok? Specifically that I put the using sighandler_t = __sighandler_t in src/signal/signal.h inside __llvm_libc.

sivachandra accepted this revision.Mar 22 2020, 12:58 AM
sivachandra marked an inline comment as done.
sivachandra added inline comments.
libc/spec/stdc.td
19

LGTM

This revision was automatically updated to reflect the committed changes.
abrachet marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2020, 11:45 AM