Page MenuHomePhabricator

[libc] Add signal
ClosedPublic

Authored by abrachet on Fri, Mar 20, 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.Fri, Mar 20, 5:20 PM
sivachandra accepted this revision.Sat, Mar 21, 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.Sat, Mar 21, 10:52 PM
abrachet updated this revision to Diff 251878.Sun, Mar 22, 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.Sun, Mar 22, 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.Sun, Mar 22, 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 TranscriptSun, Mar 22, 11:45 AM