Sha256: d2e0eda7b056c1661a247c82a04e9d009896e4a55e98181b3ae798b3f2e8675b

Contents?: true

Size: 629 Bytes

Versions: 4

Compression:

Stored size: 629 Bytes

Contents

#ifndef EPOLL_CLOEXEC
#  define EPOLL_CLOEXEC (int)(02000000)
#endif

#ifndef HAVE_EPOLL_CREATE1
/*
 * fake epoll_create1() since some systems don't have it.
 * Don't worry about thread-safety since current Ruby 1.9 won't
 * call this without GVL.
 */
static int my_epoll_create1(int flags)
{
	int fd = epoll_create(1024); /* size ignored since 2.6.8 */

	if (fd < 0 || flags == 0)
		return fd;

	if ((flags & EPOLL_CLOEXEC) && (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1))
		goto err;
	return fd;
err:
	{
		int saved_errno = errno;
		close(fd);
		errno = saved_errno;
		return -1;
	}
}
#  define epoll_create1 my_epoll_create1
#endif

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sleepy_penguin-3.1.0 ext/sleepy_penguin/missing_epoll.h
sleepy_penguin-3.0.1 ext/sleepy_penguin/missing_epoll.h
sleepy_penguin-3.0.0 ext/sleepy_penguin/missing_epoll.h
sleepy_penguin-2.0.0 ext/sleepy_penguin/missing_epoll.h