Skip to content

Commit

Permalink
[PATCH] fadvise: return ESPIPE on FIFO/pipe
Browse files Browse the repository at this point in the history
The patch makes posix_fadvise return ESPIPE on FIFO/pipe in order to be
fully POSIX-compliant.

Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Valentine Barshak authored and Linus Torvalds committed Jan 9, 2006
1 parent 99aef42 commit 87ba81d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mm/fadvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
if (!file)
return -EBADF;

if (S_ISFIFO(file->f_dentry->d_inode->i_mode)) {
ret = -ESPIPE;
goto out;
}

mapping = file->f_mapping;
if (!mapping || len < 0) {
ret = -EINVAL;
Expand Down

0 comments on commit 87ba81d

Please sign in to comment.