If there's nothing available and the file is O_NONBLOCK, return -EAGAIN. This is a bit grubby - really we should push the file* down into do_syslog() and handle it inside the spinlock. --- 25-akpm/fs/proc/kmsg.c | 2 ++ 1 files changed, 2 insertions(+) diff -puN fs/proc/kmsg.c~kmsg-nonblock fs/proc/kmsg.c --- 25/fs/proc/kmsg.c~kmsg-nonblock Mon Feb 23 15:56:59 2004 +++ 25-akpm/fs/proc/kmsg.c Mon Feb 23 16:02:22 2004 @@ -33,6 +33,8 @@ static int kmsg_release(struct inode * i static ssize_t kmsg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { + if ((file->f_flags & O_NONBLOCK) && !do_syslog(9, 0, 0)) + return -EAGAIN; return do_syslog(2, buf, count); } _