Skip to content
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

FreeBSD supports ppoll(2) #1185

Merged
merged 2 commits into from
Sep 20, 2016
Merged

FreeBSD supports ppoll(2) #1185

merged 2 commits into from
Sep 20, 2016

Conversation

gahr
Copy link
Contributor

@gahr gahr commented Sep 15, 2016

This also fixes this test error SubprocessTest.SetWithLotsninja: fatal: pipe: Too many open files caused by

if (fd_ >= static_cast<int>(FD_SETSIZE))                                      
    Fatal("pipe: %s", strerror(EMFILE)); 

in Subprocess::Start

@gblach
Copy link
Contributor

gblach commented Sep 15, 2016

ppoll() is available only on FreeBSD 10.2 and up, but not on older, but still supported releases.
EOL for 9.3 and 10.1 are established to 31 Dec 2016.

@gahr
Copy link
Contributor Author

gahr commented Sep 15, 2016

You are right. Let's keep this here until we EOL older releases.

@evmar
Copy link
Collaborator

evmar commented Sep 19, 2016

Is there a way to test the FreeBSD version at compile-time? (E.g. an ifdef?)

@gblach
Copy link
Contributor

gblach commented Sep 19, 2016

#include <osreldate.h>
#if (__FreeBSD_version >= 1002000)

@gahr
Copy link
Contributor Author

gahr commented Sep 19, 2016

It's in sys/param.h

Copy link
Collaborator

@nico nico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -24,6 +24,13 @@
#include <sys/wait.h>
#include <spawn.h>

#ifdef __FreeBSD__
# include <sys/param.h>
# if defined USE_PPOLL && __FreeBSD_version < 1002000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw we don't put spaces between # and the word after it in ninja; maybe you can zap them in a follow-up

@nico nico merged commit 067e187 into ninja-build:master Sep 20, 2016
@gahr
Copy link
Contributor Author

gahr commented Sep 20, 2016

Done in #1187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants