static ssize_t file_read(struct file *file, char __user * buffer, size_t count, loff_t * ppos) { int minor = iminor(file->f_path.dentry->d_inode); /* data available? */ if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { return 0; // -EAGAIN makes cat whinge } return rtlx_read(minor, buffer, count); }
static ssize_t file_read(struct file *file, char __user * buffer, size_t count, loff_t * ppos) { int minor = iminor(file->f_path.dentry->d_inode); if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { return 0; } return rtlx_read(minor, buffer, count); }