Use fcntl instead of SOCK_NONBLOCK to make socket nonblocking in accept4 check. There are platforms (e.g. Hurd) that support SOCK_NONBLOCK only with accept4(), but not with socket(). See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715028