static unsigned signals_processed;
static int fd_pending; /* the fd of the current pending SIGIO */
-
#ifndef F_SETLEASE
#define F_SETLEASE 1024
#endif
return signals_processed != signals_received;
}
+/****************************************************************************
+see if the kernel supports oplocks
+****************************************************************************/
+static BOOL linux_oplocks_available(void)
+{
+ int fd, ret;
+ fd = open("/dev/null", O_RDONLY);
+ if (fd == -1) return False; /* uggh! */
+ ret = fcntl(fd, F_GETLEASE, 0);
+ close(fd);
+ return ret == F_UNLCK;
+}
+
/****************************************************************************
setup kernel oplocks
static struct kernel_oplocks koplocks;
struct sigaction act;
+ if (!linux_oplocks_available()) {
+ DEBUG(3,("Linux kernel oplocks not available\n"));
+ return NULL;
+ }
+
act.sa_handler = NULL;
act.sa_sigaction = sigio_handler;
act.sa_flags = SA_SIGINFO;