3 dnl # The proc_ops structure was introduced to replace the use of
4 dnl # of the file_operations structure when registering proc handlers.
6 AC_DEFUN([ZFS_AC_KERNEL_SRC_PROC_OPERATIONS], [
7 ZFS_LINUX_TEST_SRC([proc_ops_struct], [
8 #include <linux/proc_fs.h>
10 static int test_open(struct inode *ip, struct file *fp) { return 0; }
11 static ssize_t test_read(struct file *fp, char __user *ptr,
12 size_t size, loff_t *offp) { return 0; }
13 static ssize_t test_write(struct file *fp, const char __user *ptr,
14 size_t size, loff_t *offp) { return 0; }
15 static loff_t test_lseek(struct file *fp, loff_t off, int flag)
17 static int test_release(struct inode *ip, struct file *fp)
20 const struct proc_ops test_ops __attribute__ ((unused)) = {
21 .proc_open = test_open,
22 .proc_read = test_read,
23 .proc_write = test_write,
24 .proc_lseek = test_lseek,
25 .proc_release = test_release,
28 struct proc_dir_entry *entry __attribute__ ((unused)) =
29 proc_create_data("test", 0444, NULL, &test_ops, NULL);
33 AC_DEFUN([ZFS_AC_KERNEL_PROC_OPERATIONS], [
34 AC_MSG_CHECKING([whether proc_ops structure exists])
35 ZFS_LINUX_TEST_RESULT([proc_ops_struct], [
37 AC_DEFINE(HAVE_PROC_OPS_STRUCT, 1, [proc_ops structure exists])