Sha256: 4923a983b7265134101cf3420d48577ee84e6fae4e7dfa6b432e70461dd17275

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

#ifndef IN_CLOEXEC
#  define IN_CLOEXEC 02000000
#endif
#ifndef IN_NONBLOCK
#  define IN_NONBLOCK O_NONBLOCK
#endif
#ifndef IN_ATTRIB
#  define IN_ATTRIB 0x00000004
#endif
#ifndef IN_ONLYDIR
#  define IN_ONLYDIR 0x01000000
#endif
#ifndef IN_DONT_FOLLOW
#  define IN_DONT_FOLLOW 0x02000000
#endif
#ifndef IN_EXCL_UNLINK
#  define IN_EXCL_UNLINK 0x04000000
#endif
#ifndef IN_MASK_ADD
#  define IN_MASK_ADD 0x20000000
#endif
#ifndef IN_ONESHOT
#  define IN_ONESHOT 0x80000000
#endif

#ifndef HAVE_INOTIFY_INIT1
/*
 * fake inotify_init1() 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_inotify_init1(int flags)
{
	int fd = inotify_init();
	int tmp;

	if (fd < 0)
		return fd;
	if ((flags & IN_CLOEXEC) && (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0))
		goto fcntl_err;
	if (flags & IN_NONBLOCK) {
		tmp = fcntl(fd, F_GETFL);
		if (tmp == -1)
			goto fcntl_err;
		if ((fcntl(fd, F_SETFL, tmp | O_NONBLOCK) < 0))
			goto fcntl_err;
	}

	return fd;
fcntl_err:
	tmp = errno;
	close(fd);
	errno = tmp;
	rb_sys_fail("fcntl");
}
# define inotify_init1 my_inotify_init1
#endif /* HAVE_INOTIFY_INIT1 */

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sleepy_penguin-3.5.2 ext/sleepy_penguin/missing_inotify.h
sleepy_penguin-3.5.1 ext/sleepy_penguin/missing_inotify.h
sleepy_penguin-3.5.0 ext/sleepy_penguin/missing_inotify.h
sleepy_penguin-3.4.1 ext/sleepy_penguin/missing_inotify.h
sleepy_penguin-3.3.0 ext/sleepy_penguin/missing_inotify.h
sleepy_penguin-3.2.0 ext/sleepy_penguin/missing_inotify.h
sleepy_penguin-3.1.0.26.g7181 ext/sleepy_penguin/missing_inotify.h