This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Fix the posix_spawn test on FreeBSD
Needs RevisionPublic

Authored by andrew on Jun 9 2022, 4:37 AM.

Details

Reviewers
vitalybuka
Group Reviewers
Restricted Project
Summary

FreeBSD needs posix_spawnattr_init and posix_spawn_file_actions_init to
be used before calling posix_spawn. Keep the trivial version for Darwin.

Diff Detail

Event Timeline

andrew created this revision.Jun 9 2022, 4:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 4:37 AM
andrew requested review of this revision.Jun 9 2022, 4:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 4:37 AM
vitalybuka added inline comments.Jul 11 2022, 11:41 AM
compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c
11

can you include public header instead of internal one?
#include <spawn.h>

andrew added inline comments.Jul 19 2022, 12:09 AM
compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c
11

spawn.h is already included above. This include is to pick up the SANITIZER_APPLE definition.

arichardson added inline comments.Jul 19 2022, 1:12 AM
compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c
11

I'm not sure if other tests do the same, if not I'd just use defined(__APPLE__)?

vitalybuka added inline comments.Jul 20 2022, 2:35 PM
compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c
11

I would prefer avoid including imp/lib/ headers here and use defined(APPLE)

vitalybuka requested changes to this revision.Dec 7 2022, 1:50 PM
This revision now requires changes to proceed.Dec 7 2022, 1:50 PM