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

pcntl_sigtimedwait function cannot callable in macos #125

Closed
lamjack opened this issue Mar 17, 2016 · 6 comments
Closed

pcntl_sigtimedwait function cannot callable in macos #125

lamjack opened this issue Mar 17, 2016 · 6 comments

Comments

@lamjack
Copy link

lamjack commented Mar 17, 2016

:) could u add a callable checker in Gos\Bundle\WebSocketBundle\Event\StartServerListener line 95?

@lamjack
Copy link
Author

lamjack commented Mar 17, 2016

php -r 'var_dump(PHP_VERSION,is_callable('pcntl_sigtimedwait'),is_callable('pcntl_signal'));'

string(5) "7.0.4"
bool(false)
bool(true)

@jjsaunier
Copy link
Contributor

Ok why not, I just need to figure out the problem. Following the official docs http://php.net/manual/fr/function.pcntl-sigtimedwait.php is working on PHP7. May be it's a problem with pcntl extension under PHP7

@lamjack
Copy link
Author

lamjack commented Mar 21, 2016

got it.
pcntl_sigtimedwait() is unavailable (under Mac OS, under PHP < 5.3), so could you pick up this code on the workaround,

if (!function_exists('pcntl_sigtimedwait')) {
    function pcntl_sigtimedwait($signals, $siginfo, $sec, $nano)
    {
        pcntl_signal_dispatch();
        if (time_nanosleep($sec, $nano) === true) {
            return false;
        }
        pcntl_signal_dispatch();
        return true;
    }
}

@jjsaunier
Copy link
Contributor

yes, I'm going to add this polyfill. Thank you @lamjack

@lamjack
Copy link
Author

lamjack commented Mar 22, 2016

@Prophet777 welcome

@jjsaunier
Copy link
Contributor

Polyfill was added GeniusesOfSymfony/PNCTLEventLoopEmitter@ac34105

You can update via composer :)

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

No branches or pull requests

2 participants