Use nanosleep(2) instead of poll(2) to sleep.
Use nanosleep(2) instead of poll(2) to sleep.

Starting with macOS Sierra developer beta 4, the behavior of poll(2) was changed, such that poll(2) will return immediately regardless the timeout if there is no file descriptor.

This fixes #1767.
And, this should be a better solution for Homebrew/homebrew-core#5041.

Closes #1803.

--
Reviewed-on: https://github.com/bazelbuild/bazel/pull/1803
MOS_MIGRATED_REVID=133816294

zhexuany/bazel,variac/bazel,meteorcloudy/bazel,variac/bazel,aehlig/bazel,akira-baruah/bazel,twitter-forks/bazel,mrdomino/bazel,kchodorow/bazel-1,damienmg/bazel,spxtr/bazel,LuminateWireless/bazel,twitter-forks/bazel,iamthearm/bazel,perezd/bazel,ButterflyNetwork/bazel,damienmg/bazel,kchodorow/bazel-1,aehlig/bazel,ulfjack/bazel,dslomov/bazel-windows,zhexuany/bazel,kchodorow/bazel,kchodorow/bazel,davidzchen/bazel,davidzchen/bazel,werkt/bazel,bazelbuild/bazel,iamthearm/bazel,kchodorow/bazel,dropbox/bazel,ButterflyNetwork/bazel,damienmg/bazel,variac/bazel,variac/bazel,hermione521/bazel,dslomov/bazel,davidzchen/bazel,ulfjack/bazel,katre/bazel,damienmg/bazel,variac/bazel,spxtr/bazel,katre/bazel,snnn/bazel,meteorcloudy/bazel,mikelikespie/bazel,spxtr/bazel,dslomov/bazel,werkt/bazel,davidzchen/bazel,twitter-forks/bazel,spxtr/bazel,kchodorow/bazel,juhalindfors/bazel-patches,zhexuany/bazel,LuminateWireless/bazel,damienmg/bazel,cushon/bazel,perezd/bazel,werkt/bazel,mbrukman/bazel,akira-baruah/bazel,dropbox/bazel,davidzchen/bazel,aehlig/bazel,mikelikespie/bazel,safarmer/bazel,perezd/bazel,cushon/bazel,davidzchen/bazel,werkt/bazel,bazelbuild/bazel,snnn/bazel,LuminateWireless/bazel,spxtr/bazel,kchodorow/bazel,dropbox/bazel,akira-baruah/bazel,mikelikespie/bazel,LuminateWireless/bazel,ulfjack/bazel,zhexuany/bazel,mrdomino/bazel,spxtr/bazel,safarmer/bazel,aehlig/bazel,meteorcloudy/bazel,perezd/bazel,dropbox/bazel,damienmg/bazel,mrdomino/bazel,ButterflyNetwork/bazel,werkt/bazel,safarmer/bazel,werkt/bazel,dslomov/bazel-windows,cushon/bazel,kchodorow/bazel-1,twitter-forks/bazel,dropbox/bazel,mbrukman/bazel,LuminateWireless/bazel,mbrukman/bazel,mbrukman/bazel,mrdomino/bazel,iamthearm/bazel,juhalindfors/bazel-patches,ulfjack/bazel,iamthearm/bazel,safarmer/bazel,zhexuany/bazel,kchodorow/bazel,LuminateWireless/bazel,dslomov/bazel,snnn/bazel,Asana/bazel,dslomov/bazel-windows,hermione521/bazel,hermione521/bazel,Asana/bazel,bazelbuild/bazel,ButterflyNetwork/bazel,Asana/bazel,mrdomino/bazel,hermione521/bazel,katre/bazel,mrdomino/bazel,ulfjack/bazel,snnn/bazel,zhexuany/bazel,twitter-forks/bazel,aehlig/bazel,perezd/bazel,aehlig/bazel,dslomov/bazel-windows,mikelikespie/bazel,Asana/bazel,snnn/bazel,juhalindfors/bazel-patches,bazelbuild/bazel,Asana/bazel,ButterflyNetwork/bazel,snnn/bazel,bazelbuild/bazel,juhalindfors/bazel-patches,perezd/bazel,aehlig/bazel,dslomov/bazel,variac/bazel,bazelbuild/bazel,juhalindfors/bazel-patches,spxtr/bazel,meteorcloudy/bazel,cushon/bazel,mbrukman/bazel,iamthearm/bazel,katre/bazel,meteorcloudy/bazel,hermione521/bazel,juhalindfors/bazel-patches,twitter-forks/bazel,katre/bazel,ButterflyNetwork/bazel,dslomov/bazel,juhalindfors/bazel-patches,ulfjack/bazel,cushon/bazel,akira-baruah/bazel,Asana/bazel,Asana/bazel,dropbox/bazel,variac/bazel,perezd/bazel,safarmer/bazel,ulfjack/bazel,hermione521/bazel,akira-baruah/bazel,katre/bazel,iamthearm/bazel,mikelikespie/bazel,kchodorow/bazel-1,damienmg/bazel,kchodorow/bazel,kchodorow/bazel-1,akira-baruah/bazel,mikelikespie/bazel,dslomov/bazel-windows,snnn/bazel,davidzchen/bazel,dslomov/bazel,kchodorow/bazel-1,twitter-forks/bazel,meteorcloudy/bazel,mbrukman/bazel,cushon/bazel,dslomov/bazel,dslomov/bazel-windows,safarmer/bazel,meteorcloudy/bazel