Skip to content

Fix and use posix_spawn_file_actions_addchdir_np() check for Android #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Sources/TSCclibc/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,24 @@
#include "process.h"

int SPM_posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *restrict file_actions, const char *restrict path) {
#if __GLIBC_PREREQ(2, 29)
#if defined(__GLIBC__)
# if __GLIBC_PREREQ(2, 29)
return posix_spawn_file_actions_addchdir_np(file_actions, path);
# else
return ENOSYS;
# endif
#else
return ENOSYS;
#endif
}

bool SPM_posix_spawn_file_actions_addchdir_np_supported() {
#if __GLIBC_PREREQ(2, 29)
#if defined(__GLIBC__)
# if __GLIBC_PREREQ(2, 29)
return true;
# else
return false;
# endif
#else
return false;
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/TSCBasicTests/ProcessTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class ProcessTests: XCTestCase {
return
}

#if os(Linux)
#if os(Linux) || os(Android)
guard SPM_posix_spawn_file_actions_addchdir_np_supported() else {
// Skip this test since it's not supported in this OS.
return
Expand Down